#============================================================================== # ■HP吸収率を設定 for RGSS3 Ver1.00-β # □作成者 kure # # 〇設定方法 #  スキルのメモ欄に<吸収率 x%>と書いて設定します。 #  スキル使用時の吸収するHP量がx%になります。 # #============================================================================== #============================================================================== # ■ RPG::Skill(追加定義) #============================================================================== class RPG::Skill < RPG::UsableItem #-------------------------------------------------------------------------- # ★ 吸収率の定義(追加定義) #-------------------------------------------------------------------------- def drain_rate @note.match(/<吸収率\s?(\d+)%\s?>/) return $1 ? ($1.to_f / 100) : 1 end end #============================================================================== # ■ Game_ActionResult #============================================================================== class Game_ActionResult #-------------------------------------------------------------------------- # ● ダメージの作成 #-------------------------------------------------------------------------- def make_damage(value, item) @critical = false if value == 0 @hp_damage = value if item.damage.to_hp? @mp_damage = value if item.damage.to_mp? @mp_damage = [@battler.mp, @mp_damage].min @hp_drain = (@hp_damage * item.drain_rate).to_i if item.damage.drain? @mp_drain = (@mp_damage * item.drain_rate).to_i if item.damage.drain? @hp_drain = [@battler.hp, @hp_drain].min @success = true if item.damage.to_hp? || @mp_damage != 0 end end