전투

방어시회복하는거래요.

by 카르닉스 posted Feb 26, 2010
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

방어시회복하는거래요.

 

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/  ◆防御時回復 - KGC_GuardRecover◆
#_/----------------------------------------------------------------------------
#_/ 防御時にHP/SPを回復する処理を追加します。
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# ★ カスタマイズ項目 ★
#==============================================================================

class Scene_Battle
  # ◆HP回復割合(%)
  RECOVER_HP_RATE =  10
  # ◆SP回復割合(%)
  RECOVER_SP_RATE = 0
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

$imported = {} if $imported == nil
$imported["GuardRecover"] = true

#==============================================================================
# ■ Scene_Battle (分割定義 4)
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● 基本アクション 結果作成
  #--------------------------------------------------------------------------
  alias make_basic_action_result_KGC_GuardRecover make_basic_action_result
  def make_basic_action_result
    # 元の処理を実行
    make_basic_action_result_KGC_GuardRecover

    # 行動が防御の場合
    if @active_battler.current_action.kind == 0 &&
        @active_battler.current_action.basic == 1
      # 回復量計算
      recover_hp = @active_battler.maxhp * RECOVER_HP_RATE / 100
      recover_sp = @active_battler.maxsp * RECOVER_SP_RATE / 100
      if recover_hp > 0
        @active_battler.damage = -recover_hp
      end
      if recover_sp > 0
        if $imported["SPDamage"]
          @active_battler.sp_damage = -recover_sp
        else
          @active_battler.damage = "#{$data_system.words.hp}+ #{recover_hp}"
        end
      end
      @active_battler.hp += recover_hp
      @active_battler.sp += recover_sp
      # 回復値を表示
      @target_battlers |= [@active_battler]
    end
  end
end