Class: Battle::Logic::DamageHandler
- Inherits:
-
ChangeHandlerBase
- Object
- ChangeHandlerBase
- Battle::Logic::DamageHandler
- Defined in:
- docs/5_Battle_04_Logic.rb
Overview
Handler responsive of defining how damage should be dealt (if possible)
Instance Attribute Summary
Attributes inherited from ChangeHandlerBase
#logic, #pre_checked_effects, #scene
Instance Method Summary collapse
-
#can_heal?(target, test_heal_block: true) ⇒ Boolean
Whether a battler can be healed.
-
#damage_appliable(hp, target, launcher = nil, skill = nil) ⇒ Integer, false
Function telling if a damage can be applied and how much.
-
#damage_change(hp, target, launcher = nil, skill = nil, &messages)
Function that actually deal the damage.
-
#damage_change_with_process(hp, target, launcher = nil, skill = nil, &messages)
Function that test if the damage can be dealt and deal the damage if so.
-
#drain(hp_factor, target, launcher, skill = nil, hp_overwrite: nil, drain_factor: 1, &messages)
Function that drains a certain quantity of HP from the target and give it to the user.
-
#drain_with_process(hp_factor, target, launcher, skill = nil, hp_overwrite: nil, drain_factor: 1, &messages)
Function that test if the drain damages can be dealt and perform the drain if so.
-
#heal(target, hp, test_heal_block: true, animation_id: nil, &block) {|hp| ... } ⇒ Boolean
Function that proceed the heal of a Pokemon.
-
#heal_change(target, hp, animation_id: nil) {|hp| ... }
Function that actually performs the heal.
Methods inherited from ChangeHandlerBase
#initialize, #pass_change, #prevent_change, #process_reason, #reset_reason
Constructor Details
This class inherits a constructor from Battle::Logic::ChangeHandlerBase
Instance Method Details
#can_heal?(target, test_heal_block: true) ⇒ Boolean
Whether a battler can be healed
1053 1054 |
# File 'docs/5_Battle_04_Logic.rb', line 1053 def can_heal?(target, test_heal_block: true) end |
#damage_appliable(hp, target, launcher = nil, skill = nil) ⇒ Integer, false
Function telling if a damage can be applied and how much
1031 1032 |
# File 'docs/5_Battle_04_Logic.rb', line 1031 def damage_appliable(hp, target, launcher = nil, skill = nil) end |
#damage_change(hp, target, launcher = nil, skill = nil, &messages)
Function that actually deal the damage
1039 1040 |
# File 'docs/5_Battle_04_Logic.rb', line 1039 def damage_change(hp, target, launcher = nil, skill = nil, &) end |
#damage_change_with_process(hp, target, launcher = nil, skill = nil, &messages)
Function that test if the damage can be dealt and deal the damage if so
1047 1048 |
# File 'docs/5_Battle_04_Logic.rb', line 1047 def damage_change_with_process(hp, target, launcher = nil, skill = nil, &) end |
#drain(hp_factor, target, launcher, skill = nil, hp_overwrite: nil, drain_factor: 1, &messages)
Function that drains a certain quantity of HP from the target and give it to the user
1083 1084 |
# File 'docs/5_Battle_04_Logic.rb', line 1083 def drain(hp_factor, target, launcher, skill = nil, hp_overwrite: nil, drain_factor: 1, &) end |
#drain_with_process(hp_factor, target, launcher, skill = nil, hp_overwrite: nil, drain_factor: 1, &messages)
Function that test if the drain damages can be dealt and perform the drain if so
1093 1094 |
# File 'docs/5_Battle_04_Logic.rb', line 1093 def drain_with_process(hp_factor, target, launcher, skill = nil, hp_overwrite: nil, drain_factor: 1, &) end |
#heal(target, hp, test_heal_block: true, animation_id: nil, &block) {|hp| ... } ⇒ Boolean
this method yields a block in order to show the message after the animation
this shows the default message if no block has been given
Function that proceed the heal of a Pokemon
1073 1074 |
# File 'docs/5_Battle_04_Logic.rb', line 1073 def heal(target, hp, test_heal_block: true, animation_id: nil, &block) end |
#heal_change(target, hp, animation_id: nil) {|hp| ... }
This method yields a block in order to show the message after the animation
This shows the default message if no block has been given
Function that actually performs the heal
1061 1062 |
# File 'docs/5_Battle_04_Logic.rb', line 1061 def heal_change(target, hp, animation_id: nil) end |