Class: Battle::Logic::StatChangeHandler
- Inherits:
-
ChangeHandlerBase
- Object
- ChangeHandlerBase
- Battle::Logic::StatChangeHandler
- Includes:
- Hooks
- Defined in:
- docs/5_Battle_04_Logic.rb
Overview
Handler responsive of answering properly statistic changes requests
Constant Summary collapse
- TEXT_POS =
Position of text for Attack depending on the power
{atk: atk = [0, 27, 48, 69, 153, 174, 132, 111, 90], dfe: atk.map { |i| i + 3 }, ats: atk.map { |i| i + 6 }, dfs: atk.map { |i| i + 9 }, spd: atk.map { |i| i + 12 }, acc: atk.map { |i| i + 15 }, eva: atk.map { |i| i + 18 }}
- ANIMATION =
ID of the animation depending on the stat
{atk: 478, dfe: 480, spd: 482, dfs: 486, ats: 484, eva: 488, acc: 490}
- STAT_INDEX =
Index of the stages depending on the stat to change
{atk: Configs.stats.atk_stage_index, dfe: Configs.stats.dfe_stage_index, ats: Configs.stats.ats_stage_index, dfs: Configs.stats.dfs_stage_index, spd: Configs.stats.spd_stage_index, acc: Configs.stats.acc_stage_index, eva: Configs.stats.eva_stage_index}
- ALL_STATS =
Array containing all the possible stats
%i[atk dfe spd dfs ats eva acc]
- ATTACK_STATS =
Array containing all the attack kind stat
%i[atk ats]
- DEFENSE_STATS =
Array containing all the defense kind stat
%i[dfe dfs]
- PHYSICAL_STATS =
Array containing the physical stats
%i[atk dfe]
- SPECIAL_STATS =
Array containing the special stats
%i[ats dfs]
Instance Attribute Summary
Attributes inherited from ChangeHandlerBase
#logic, #pre_checked_effects, #scene
Class Method Summary collapse
-
.register_stat_change_hook(reason) {|handler, stat, power, target, launcher, skill| ... }
Function that register a stat_change hook.
-
.register_stat_change_post_event_hook(reason) {|handler, stat, power, target, launcher, skill| ... }
Function that register a stat_change_post_event hook.
-
.register_stat_decrease_prevention_hook(reason) {|handler, stat, target, launcher, skill| ... }
Function that registers a stat_decrease_prevention hook.
-
.register_stat_increase_prevention_hook(reason) {|handler, stat, target, launcher, skill| ... }
Function that registers a stat_increase_prevention hook.
Instance Method Summary collapse
-
#stat_change(stat, power, target, launcher = nil, skill = nil, no_message: false)
Function that actually change a stat.
-
#stat_change_with_process(stat, power, target, launcher = nil, skill = nil, no_message: false)
Function that test if the change is possible and perform the change if so.
-
#stat_decreasable?(stat, target, launcher = nil, skill = nil) ⇒ Boolean
Function telling if a stat can be decreased.
-
#stat_increasable?(stat, target, launcher = nil, skill = nil) ⇒ Boolean
Function telling if a stat can be increased.
-
#stat_text_index(amount, power) ⇒ Integer
Get the text index in the TEXT_POS array depending on amount & power.
Methods included from Hooks
#exec_hooks, #force_return, included, register, remove, remove_without_name
Methods inherited from ChangeHandlerBase
#initialize, #prevent_change, #process_prevention_reason, #reset_prevention_reason
Constructor Details
This class inherits a constructor from Battle::Logic::ChangeHandlerBase
Class Method Details
.register_stat_change_hook(reason) {|handler, stat, power, target, launcher, skill| ... }
Function that register a stat_change hook
843 844 |
# File 'docs/5_Battle_04_Logic.rb', line 843 def register_stat_change_hook(reason) end |
.register_stat_change_post_event_hook(reason) {|handler, stat, power, target, launcher, skill| ... }
Function that register a stat_change_post_event hook
832 833 |
# File 'docs/5_Battle_04_Logic.rb', line 832 def register_stat_change_post_event_hook(reason) end |
.register_stat_decrease_prevention_hook(reason) {|handler, stat, target, launcher, skill| ... }
Function that registers a stat_decrease_prevention hook
822 823 |
# File 'docs/5_Battle_04_Logic.rb', line 822 def register_stat_decrease_prevention_hook(reason) end |
.register_stat_increase_prevention_hook(reason) {|handler, stat, target, launcher, skill| ... }
Function that registers a stat_increase_prevention hook
812 813 |
# File 'docs/5_Battle_04_Logic.rb', line 812 def register_stat_increase_prevention_hook(reason) end |
Instance Method Details
#stat_change(stat, power, target, launcher = nil, skill = nil, no_message: false)
Function that actually change a stat
771 772 |
# File 'docs/5_Battle_04_Logic.rb', line 771 def stat_change(stat, power, target, launcher = nil, skill = nil, no_message: false) end |
#stat_change_with_process(stat, power, target, launcher = nil, skill = nil, no_message: false)
Function that test if the change is possible and perform the change if so
780 781 |
# File 'docs/5_Battle_04_Logic.rb', line 780 def stat_change_with_process(stat, power, target, launcher = nil, skill = nil, no_message: false) end |
#stat_decreasable?(stat, target, launcher = nil, skill = nil) ⇒ Boolean
Thing that prevents the stat from decreasing should be defined using :stat_decrease_prevention Hook.
Function telling if a stat can be decreased
762 763 |
# File 'docs/5_Battle_04_Logic.rb', line 762 def stat_decreasable?(stat, target, launcher = nil, skill = nil) end |
#stat_increasable?(stat, target, launcher = nil, skill = nil) ⇒ Boolean
Thing that prevents the stat from increasoing should be defined using :stat_increase_prevention Hook.
Function telling if a stat can be increased
753 754 |
# File 'docs/5_Battle_04_Logic.rb', line 753 def stat_increasable?(stat, target, launcher = nil, skill = nil) end |
#stat_text_index(amount, power) ⇒ Integer
Get the text index in the TEXT_POS array depending on amount & power
786 787 |
# File 'docs/5_Battle_04_Logic.rb', line 786 def stat_text_index(amount, power) end |