Class: Battle::Logic
- Defined in:
- docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb
Overview
Logic part of Pokemon Battle
This class helps to access to the battle information & to process some part of the battle
Defined Under Namespace
Classes: AbilityChangeHandler, BattleEndHandler, BattleInfo, CatchHandler, ChangeHandlerBase, DamageHandler, EndTurnHandler, ExpHandler, FTerrainChangeHandler, FleeHandler, ItemChangeHandler, MegaEvolve, StatChangeHandler, StatusChangeHandler, SwitchHandler, TransformHandler, WeatherChangeHandler
Constant Summary collapse
- MOVE_PRIORITY_OFFSET =
Constant giving an offset for the move priority : In RH moves start their priority from 0 (-7) and end at 14 (+7)
-7 # Priority of pursuit when a switch will occur
- PURSUIT_PRIORITY =
Priority of pursuit when a switch will occur
7
- MEGA_PRIORITY =
Priority of MEGA
8
- OTHER_PRIORITY =
Priority of other things
6
- ITEM_PRIORITY_BOOST_IN_PRIORITY =
List of move first handler by item held
{quick_claw: :check_priority_trigger_quick_claw, custap_berry: :check_priority_trigger_custap_berry}
- ABILITY_PRIORITY_BOOST_IN_PRIORITY =
List of move first handler by ability
{quick_draw: :check_priority_trigger_quick_draw}
- VAL_0_25 =
Value that contains 0.25
0.25
- CRITICAL_RATES =
List of critical rates according to the current critical count
{0 => 0, 1 => 6_250, 2 => 12_500, 3 => 50_000}
- NO_CRITICAL_ABILITIES =
List of ability preventing the critical hit from happening
%i[battle_armor shell_armor]
- UNCONDITIONAL_CRITICAL_ITEMS =
List of items that unconditionally improve critical rate
%i[razor_claw scope_lens]
Instance Attribute Summary collapse
-
#actions ⇒ Array<Actions::Base>
readonly
List of the current actions to proccess during the scene.
-
#bags ⇒ Array<Array<PFM::Bag>>
readonly
Bags of each banks.
-
#ball_fetch_on_field ⇒ Array<PFM::PokemonBattler>
All the Pokemon with Ball Fetch on the field sorted by decreasing speed when the player fails the capture.
-
#bank_effects ⇒ Array<Effects::EffectsHandler>
readonly
Get the bank effects.
- #battle_info ⇒ Battle::Logic::BattleInfo readonly
-
#battle_result ⇒ Integer
0 : Victory, 1 : Flee, 2 : Defeat, -1 : undef.
-
#debug_end_of_battle
If the battle is in debug and forcing the end of it.
-
#evolve_request ⇒ Array<PFM::PokemonBattler>
readonly
Get the evolve requests.
-
#field_terrain ⇒ Symbol
Get or set the current field terrain type.
-
#generic_rng ⇒ Random
readonly
Get the generic rng.
-
#mega_evolve ⇒ MegaEvolve
readonly
Get the Mega Evolve helper.
-
#messages ⇒ Array<Array>
readonly
List of messages to send to an interpreter (AI/Scene).
-
#move_accuracy_rng ⇒ Random
readonly
Get the move accuracy rng.
-
#move_critical_rng ⇒ Random
readonly
Get the move critical rng.
-
#move_damage_rng ⇒ Random
readonly
Get the move damage rng.
-
#position_effects ⇒ Array<Array<Battle::Effects::EffectsHandler>>
readonly
Get the position effects.
-
#scene ⇒ Battle::Scene
readonly
Get the scene used to instanciate this Logic instance.
-
#switch_request ⇒ Array<Hash>
readonly
Get the switch requests.
-
#terrain_effects ⇒ Effects::EffectsHandler
readonly
Get the terrain effects.
-
#turn_actions ⇒ Array<Actions::Base>
List of all actions that occurs within the current turn.
Instance Method Summary collapse
-
#ability_change_handler ⇒ Battle::Logic::AbilityChangeHandler
Get the ability change handler.
-
#add_actions(actions)
Add actions to process in the next step.
-
#add_bank_effect(effect)
Add an effect on a bank.
-
#add_position_effect(effect)
Add an effect on a position.
-
#adjacent_allies_of(pokemon) ⇒ Array<PFM::PokemonBattler>
Return the adjacent allies.
-
#adjacent_foes_of(pokemon) ⇒ Array<PFM::PokemonBattler>
Return the adjacent foes.
-
#alive_battlers(bank) ⇒ Array<PFM::PokemonBattler>
Return all the alive battler of a bank.
-
#alive_battlers_without_check(bank) ⇒ Array<PFM::PokemonBattler>
Return all the alive battler of a bank but don’t check can_fight?.
-
#all_alive_battlers ⇒ Array<PFM::PokemonBattler>
Return all alive battlers.
-
#all_battlers {|battler| ... } ⇒ Enumerable<PFM::PokemonBattler>
Iterate through all battlers.
-
#allies_of(pokemon, check_adjacent = false) ⇒ Array<PFM::PokemonBattler>
Return the allies (excluding the pokemon).
-
#any_field_ability_active?(db_symbol) ⇒ Array<PFM::PokemonBattler>
Check active abilities on the field.
-
#bank_count ⇒ Integer
Return the number of bank in the current battle.
-
#battle_end_handler ⇒ Battle::Logic::BattleEndHandler
Get the battle end handler.
-
#battle_phase_end
Function that distribute the exp to all Pokemon and switch dead pokemon.
-
#battle_phase_end_caught
Function that process the battle end when Pokemon was caught.
-
#battle_phase_exp
Function that test the experience distribution.
-
#battle_phase_switch_execute(who:, with: nil)
Function that executes the switch request.
-
#battle_phase_switch_exp_check
Function that process the switches and give exp.
-
#battler(bank, position) ⇒ PFM::PokemonBattler?
Return the battler of a bank.
-
#battler_attacks_after?(battler, other) ⇒ Boolean
Test if the battler attacks after another.
-
#battler_attacks_before?(battler, other) ⇒ Boolean
Test if the battler attacks before another.
-
#battler_attacks_first?(battler) ⇒ Boolean
Test if the battler attacks first.
-
#battler_attacks_last?(battler) ⇒ Boolean
Test if the battler attacks last.
-
#battler_count(bank) ⇒ Integer
Return the number of battler (alive) in one bank.
-
#calc_critical_count(user, target, initial_critical_count) ⇒ Integer
Calculate the critical count (to get the right critical propability).
-
#calc_critical_count_item(user) ⇒ Boolean
Tell if the user has an item that increase the critical count.
-
#calc_critical_hit(user, target, initial_critical_count) ⇒ Boolean
Calculate if the current action will be a critical hit.
-
#can_battle_continue? ⇒ Boolean
Tell if the battle can continue.
-
#can_battler_be_replaced?(who) ⇒ Boolean
Test if the battler can be replaced.
-
#catch_handler ⇒ Battle::Logic::CatchHandler
Get the catch handler.
-
#damage_handler ⇒ Battle::Logic::DamageHandler
Get a new damage handler.
-
#delete_dead_effects
Delete all the dead effect by updating counters & removing them.
-
#each_effects(*pokemons) {|| ... } ⇒ Array<Effects::EffectBase>, ...
Execute a block on each effect depending on what to select as effect.
-
#end_turn_handler ⇒ Battle::Logic::EndTurnHandler
Get a new switch handler.
-
#exp_handler ⇒ Battle::Logic::ExpHandler
Get the exp handler.
-
#field_terrain_effect ⇒ Effects::FieldTerrain
Get the field terrain effect.
-
#flee_handler ⇒ Battle::Logic::FleeHandler
Get the flee handler.
-
#foes_of(pokemon, check_adjacent = false) ⇒ Array<PFM::PokemonBattler>
Return the foes.
-
#force_sort_actions(&block)
Sort the actions.
-
#fterrain_change_handler ⇒ Battle::Logic::FTerrainChangeHandler
Get a new field terrain change handler.
-
#initialize(scene) ⇒ Logic
constructor
Create a new Logic instance.
-
#item_change_handler ⇒ Battle::Logic::ItemChangeHandler
Get a new item change handler.
-
#load_battlers
Load the battlers from the battle infos.
-
#load_rng(seeds = Hash.new(Random.new_seed))
Load the RNG for the battle logic.
-
#perform_next_action ⇒ Boolean
Execute the next action.
-
#request_switch(who, with)
Add a switch request.
-
#rng_seeds ⇒ Hash{ Symbol => Integer }
Get the current RNG Seeds.
-
#sort_actions
Sort the actions.
-
#stat_change_handler ⇒ Battle::Logic::StatChangeHandler
Get a new stat change handler.
-
#status_change_handler ⇒ Battle::Logic::StatusChangeHandler
Get a new item change handler.
-
#switch_battlers(who, with)
Switch two pokemon (logically).
-
#switch_handler ⇒ Battle::Logic::SwitchHandler
Get a new switch handler.
-
#to_s
(also: #inspect)
Safe to_s & inspect.
-
#trainer_battlers ⇒ Array<PFM::PokemonBattler>
List all the trainer Pokemon.
-
#transform_handler ⇒ Battle::Logic::TransformHandler
Get the transform handler.
-
#update_battler_turn_count
Update the turn count of all alive battler.
-
#weather_change_handler ⇒ Battle::Logic::WeatherChangeHandler
Get a new weather change handler.
-
#weather_effect ⇒ Effects::Weather
Get the weather effect.
Constructor Details
#initialize(scene) ⇒ Logic
Create a new Logic instance
50 51 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 50 def initialize(scene) end |
Instance Attribute Details
#actions ⇒ Array<Actions::Base> (readonly)
Returns list of the current actions to proccess during the scene.
9 10 11 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 9 def actions @actions end |
#bags ⇒ Array<Array<PFM::Bag>> (readonly)
Returns bags of each banks.
16 17 18 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 16 def bags @bags end |
#ball_fetch_on_field ⇒ Array<PFM::PokemonBattler>
All the Pokemon with Ball Fetch on the field sorted by decreasing speed when the player fails the capture
47 48 49 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 47 def ball_fetch_on_field @ball_fetch_on_field end |
#bank_effects ⇒ Array<Effects::EffectsHandler> (readonly)
Get the bank effects
389 390 391 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 389 def bank_effects @bank_effects end |
#battle_info ⇒ Battle::Logic::BattleInfo (readonly)
18 19 20 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 18 def battle_info @battle_info end |
#battle_result ⇒ Integer
0 : Victory, 1 : Flee, 2 : Defeat, -1 : undef
14 15 16 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 14 def battle_result @battle_result end |
#debug_end_of_battle
If the battle is in debug and forcing the end of it
44 45 46 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 44 def debug_end_of_battle @debug_end_of_battle end |
#evolve_request ⇒ Array<PFM::PokemonBattler> (readonly)
Get the evolve requests
21 22 23 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 21 def evolve_request @evolve_request end |
#field_terrain ⇒ Symbol
Get or set the current field terrain type
395 396 397 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 395 def field_terrain @field_terrain end |
#generic_rng ⇒ Random (readonly)
Get the generic rng
42 43 44 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 42 def generic_rng @generic_rng end |
#mega_evolve ⇒ MegaEvolve (readonly)
Get the Mega Evolve helper
24 25 26 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 24 def mega_evolve @mega_evolve end |
#messages ⇒ Array<Array> (readonly)
Returns list of messages to send to an interpreter (AI/Scene).
7 8 9 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 7 def @messages end |
#move_accuracy_rng ⇒ Random (readonly)
Get the move accuracy rng
39 40 41 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 39 def move_accuracy_rng @move_accuracy_rng end |
#move_critical_rng ⇒ Random (readonly)
Get the move critical rng
36 37 38 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 36 def move_critical_rng @move_critical_rng end |
#move_damage_rng ⇒ Random (readonly)
Get the move damage rng
33 34 35 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 33 def move_damage_rng @move_damage_rng end |
#position_effects ⇒ Array<Array<Battle::Effects::EffectsHandler>> (readonly)
Get the position effects
392 393 394 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 392 def position_effects @position_effects end |
#scene ⇒ Battle::Scene (readonly)
Get the scene used to instanciate this Logic instance
30 31 32 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 30 def scene @scene end |
#switch_request ⇒ Array<Hash> (readonly)
Get the switch requests
27 28 29 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 27 def switch_request @switch_request end |
#terrain_effects ⇒ Effects::EffectsHandler (readonly)
Get the terrain effects
386 387 388 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 386 def terrain_effects @terrain_effects end |
#turn_actions ⇒ Array<Actions::Base>
Returns list of all actions that occurs within the current turn.
11 12 13 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 11 def turn_actions @turn_actions end |
Instance Method Details
#ability_change_handler ⇒ Battle::Logic::AbilityChangeHandler
Get the ability change handler
369 370 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 369 def ability_change_handler end |
#add_actions(actions)
Add actions to process in the next step
216 217 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 216 def add_actions(actions) end |
#add_bank_effect(effect)
Add an effect on a bank
410 411 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 410 def add_bank_effect(effect) end |
#add_position_effect(effect)
Add an effect on a position
406 407 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 406 def add_position_effect(effect) end |
#adjacent_allies_of(pokemon) ⇒ Array<PFM::PokemonBattler>
Return the adjacent allies
97 98 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 97 def adjacent_allies_of(pokemon) end |
#adjacent_foes_of(pokemon) ⇒ Array<PFM::PokemonBattler>
Return the adjacent foes
86 87 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 86 def adjacent_foes_of(pokemon) end |
#alive_battlers(bank) ⇒ Array<PFM::PokemonBattler>
Return all the alive battler of a bank
108 109 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 108 def alive_battlers(bank) end |
#alive_battlers_without_check(bank) ⇒ Array<PFM::PokemonBattler>
Return all the alive battler of a bank but don’t check can_fight?
113 114 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 113 def alive_battlers_without_check(bank) end |
#all_alive_battlers ⇒ Array<PFM::PokemonBattler>
Return all alive battlers
117 118 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 117 def all_alive_battlers end |
#all_battlers {|battler| ... } ⇒ Enumerable<PFM::PokemonBattler>
Iterate through all battlers
160 161 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 160 def all_battlers end |
#allies_of(pokemon, check_adjacent = false) ⇒ Array<PFM::PokemonBattler>
Return the allies (excluding the pokemon)
103 104 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 103 def allies_of(pokemon, check_adjacent = false) end |
#any_field_ability_active?(db_symbol) ⇒ Array<PFM::PokemonBattler>
Check active abilities on the field
173 174 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 173 def any_field_ability_active?(db_symbol) end |
#bank_count ⇒ Integer
Return the number of bank in the current battle
58 59 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 58 def bank_count end |
#battle_end_handler ⇒ Battle::Logic::BattleEndHandler
Get the battle end handler
373 374 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 373 def battle_end_handler end |
#battle_phase_end
Function that distribute the exp to all Pokemon and switch dead pokemon
300 301 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 300 def battle_phase_end end |
#battle_phase_end_caught
Function that process the battle end when Pokemon was caught
314 315 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 314 def battle_phase_end_caught end |
#battle_phase_exp
Function that test the experience distribution
303 304 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 303 def battle_phase_exp end |
#battle_phase_switch_execute(who:, with: nil)
Function that executes the switch request
311 312 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 311 def battle_phase_switch_execute(who:, with: nil) end |
#battle_phase_switch_exp_check
Function that process the switches and give exp
306 307 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 306 def battle_phase_switch_exp_check end |
#battler(bank, position) ⇒ PFM::PokemonBattler?
Return the battler of a bank
76 77 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 76 def battler(bank, position) end |
#battler_attacks_after?(battler, other) ⇒ Boolean
Test if the battler attacks after another
140 141 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 140 def battler_attacks_after?(battler, other) end |
#battler_attacks_before?(battler, other) ⇒ Boolean
Test if the battler attacks before another
134 135 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 134 def battler_attacks_before?(battler, other) end |
#battler_attacks_first?(battler) ⇒ Boolean
Test if the battler attacks first
145 146 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 145 def battler_attacks_first?(battler) end |
#battler_attacks_last?(battler) ⇒ Boolean
Test if the battler attacks last
150 151 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 150 def battler_attacks_last?(battler) end |
#battler_count(bank) ⇒ Integer
Return the number of battler (alive) in one bank
81 82 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 81 def battler_count(bank) end |
#calc_critical_count(user, target, initial_critical_count) ⇒ Integer
Calculate the critical count (to get the right critical propability)
289 290 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 289 def calc_critical_count(user, target, initial_critical_count) end |
#calc_critical_count_item(user) ⇒ Boolean
Tell if the user has an item that increase the critical count
296 297 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 296 def calc_critical_count_item(user) end |
#calc_critical_hit(user, target, initial_critical_count) ⇒ Boolean
Calculate if the current action will be a critical hit
280 281 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 280 def calc_critical_hit(user, target, initial_critical_count) end |
#can_battle_continue? ⇒ Boolean
Tell if the battle can continue
62 63 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 62 def can_battle_continue? end |
#can_battler_be_replaced?(who) ⇒ Boolean
Test if the battler can be replaced
165 166 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 165 def can_battler_be_replaced?(who) end |
#catch_handler ⇒ Battle::Logic::CatchHandler
Get the catch handler
365 366 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 365 def catch_handler end |
#damage_handler ⇒ Battle::Logic::DamageHandler
Get a new damage handler
341 342 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 341 def damage_handler end |
#delete_dead_effects
Delete all the dead effect by updating counters & removing them
413 414 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 413 def delete_dead_effects end |
#each_effects(*pokemons) {|| ... } ⇒ Array<Effects::EffectBase>, ...
This returns an enumerator if no block is given
If the block returns a Symbol, this methods returns this symbol immediately without processing the other effects
Execute a block on each effect depending on what to select as effect
402 403 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 402 def each_effects(*pokemons) end |
#end_turn_handler ⇒ Battle::Logic::EndTurnHandler
Get a new switch handler
349 350 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 349 def end_turn_handler end |
#exp_handler ⇒ Battle::Logic::ExpHandler
Get the exp handler
377 378 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 377 def exp_handler end |
#field_terrain_effect ⇒ Effects::FieldTerrain
Get the field terrain effect
421 422 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 421 def field_terrain_effect end |
#flee_handler ⇒ Battle::Logic::FleeHandler
Get the flee handler
361 362 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 361 def flee_handler end |
#foes_of(pokemon, check_adjacent = false) ⇒ Array<PFM::PokemonBattler>
Return the foes
92 93 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 92 def foes_of(pokemon, check_adjacent = false) end |
#force_sort_actions(&block)
Sort the actions
228 229 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 228 def force_sort_actions(&block) end |
#fterrain_change_handler ⇒ Battle::Logic::FTerrainChangeHandler
Get a new field terrain change handler
357 358 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 357 def fterrain_change_handler end |
#item_change_handler ⇒ Battle::Logic::ItemChangeHandler
Get a new item change handler
333 334 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 333 def item_change_handler end |
#load_battlers
Load the battlers from the battle infos
120 121 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 120 def load_battlers end |
#load_rng(seeds = Hash.new(Random.new_seed))
Load the RNG for the battle logic
66 67 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 66 def load_rng(seeds = Hash.new(Random.new_seed)) end |
#perform_next_action ⇒ Boolean
Execute the next action
220 221 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 220 def perform_next_action end |
#request_switch(who, with)
Add a switch request
125 126 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 125 def request_switch(who, with) end |
#rng_seeds ⇒ Hash{ Symbol => Integer }
Get the current RNG Seeds
70 71 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 70 def rng_seeds end |
#sort_actions
The last action in the stack is the first action to pop out from the stack
Sort the actions
224 225 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 224 def sort_actions end |
#stat_change_handler ⇒ Battle::Logic::StatChangeHandler
Get a new stat change handler
329 330 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 329 def stat_change_handler end |
#status_change_handler ⇒ Battle::Logic::StatusChangeHandler
Get a new item change handler
337 338 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 337 def status_change_handler end |
#switch_battlers(who, with)
Switch two pokemon (logically)
155 156 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 155 def switch_battlers(who, with) end |
#switch_handler ⇒ Battle::Logic::SwitchHandler
Get a new switch handler
345 346 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 345 def switch_handler end |
#to_s Also known as: inspect
Safe to_s & inspect
53 54 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 53 def to_s end |
#trainer_battlers ⇒ Array<PFM::PokemonBattler>
List all the trainer Pokemon
169 170 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 169 def trainer_battlers end |
#transform_handler ⇒ Battle::Logic::TransformHandler
Get the transform handler
381 382 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 381 def transform_handler end |
#update_battler_turn_count
Update the turn count of all alive battler
128 129 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 128 def update_battler_turn_count end |
#weather_change_handler ⇒ Battle::Logic::WeatherChangeHandler
Get a new weather change handler
353 354 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 353 def weather_change_handler end |
#weather_effect ⇒ Effects::Weather
Get the weather effect
417 418 |
# File 'docs/01600_Alpha_25_Battle_Engine_00200_Battle_Logic.rb', line 417 def weather_effect end |