Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
Sign in to follow this  
darkcieran

An Edit of a friend's script

Question

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

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?

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...