Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[SOLVED]Edit of a friend's script

i need an edit of an old project partner's script. it's a simple absorb skill. what i want it to do is to subtract from the user's hp to add to his sp.

class Game_Temp
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :damage_hook
#---------------------------------------------------------------------------
def initialize
@damage_hook = 0
end
end

class Game_Battler
#--------------------------------------------------------------------------
# ● スキルの使用可能判定
# skill_id : スキル ID
#--------------------------------------------------------------------------
def skill_effect(user, skill)
if self.damage.is_a?(Numeric)
$game_temp.damage_hook += self.damage
end
return effective
end

#==============================================================================
# ■ Scene_Battle (分割定義 4)
#------------------------------------------------------------------------------
#  バトル画面の処理を行うクラスです。
#==============================================================================

class Scene_Battle
#--------------------------------------------------------------------------
# ● メインフェーズ開始
#--------------------------------------------------------------------------
def update_phase4_step1
$game_temp.damage_hook = 0
end
it's a skill with a common event that calls effect:
absorb = $game_temp.damage_hook * -1
$scene.active_battler.damage = absorb
$scene.active_battler.damage_pop = true
$scene.active_battler.sp -= absorb

any ideas?
 
First of all it should look more like this...

[rgss]$game_temp.damage_hook *= @damage
absorb = $game_temp.damage_hook
@active_battler.damage = -absorb
@active_battler.damage_pop = true
@active_battler.sp += absorb
[/rgss]

Then you should look for the method where the skill damage is calculated in Scene_Battle.
 
kyonides":awnrir5s said:
First of all it should look more like this...

[rgss]$game_temp.damage_hook *= @damage
absorb = $game_temp.damage_hook
@active_battler.damage = -absorb
@active_battler.damage_pop = true
@active_battler.sp += absorb
[/rgss]

Then you should look for the method where the skill damage is calculated in Scene_Battle.
and then what?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top