방어했을 때에 HP/SP가 회복하는 스크립트입니다.
…그것 뿐입니다.다른 무엇이기도 하지 않습니다.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆防御時回復 - KGC_GuardRecover◆
#_/----------------------------------------------------------------------------
#_/ 防御時にHP/SPを回復する処理を追加します。
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#==============================================================================
# ★ カスタマイズ項目 ★
#==============================================================================
class Scene_Battle
# ◆HP回復割合(%)
RECOVER_HP_RATE = 5
# ◆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.sp}+ #{recover_sp}"
end
end
@active_battler.hp += recover_hp
@active_battler.sp += recover_sp
# 回復値を表示
@target_battlers |= [@active_battler]
end
end
end
이것으로, 방어시에 HP/SP를 회복시킬 수 있습니다.
…그것 뿐입니다.다른 무엇이기도 하지 않습니다.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆防御時回復 - KGC_GuardRecover◆
#_/----------------------------------------------------------------------------
#_/ 防御時にHP/SPを回復する処理を追加します。
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#==============================================================================
# ★ カスタマイズ項目 ★
#==============================================================================
class Scene_Battle
# ◆HP回復割合(%)
RECOVER_HP_RATE = 5
# ◆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.sp}+ #{recover_sp}"
end
end
@active_battler.hp += recover_hp
@active_battler.sp += recover_sp
# 回復値を表示
@target_battlers |= [@active_battler]
end
end
end
이것으로, 방어시에 HP/SP를 회복시킬 수 있습니다.