Class: Battle::Logic::StatusChangeHandler

Inherits:
ChangeHandlerBase show all
Defined in:
docs/5_Battle_04_Logic.rb

Overview

Handler responsive of answering properly status changes requests

Constant Summary collapse

STATUS_APPLY_METHODS =

List of method to call in order to apply the status on the Pokemon

{poison: :status_poison, toxic: :status_toxic, confusion: :status_confuse, sleep: :status_sleep, freeze: :status_frozen, paralysis: :status_paralyze, burn: :status_burn, cure: :cure, flinch: :apply_flinch}
STATUS_APPLY_MESSAGE =

List of message ID when applying a status

{poison: 234, toxic: 237, confusion: 345, sleep: 306, freeze: 288, paralysis: 273, burn: 255}
STATUS_APPLY_ANIMATION =

List of animation ID when applying a status

{poison: 470, toxic: 477, confusion: 475, sleep: 473, freeze: 474, paralysis: 471, burn: 472, flinch: 476}

Instance Attribute Summary

Attributes inherited from ChangeHandlerBase

#logic, #pre_checked_effects, #scene

Instance Method Summary collapse

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

#status_appliable?(status, target, launcher = nil, skill = nil) ⇒ Boolean

Function telling if a status can be applyied

Parameters:

  • status (Symbol) —

    :poison, :toxic, :confusion, :sleep, :freeze, :paralysis, :burn, :flinch

  • target (PFM::PokemonBattler)
  • launcher (PFM::PokemonBattler, nil) (defaults to: nil) —

    Potential launcher of a move

  • skill (Battle::Move, nil) (defaults to: nil) —

    Potential move used

Returns:

  • (Boolean)


907
908
# File 'docs/5_Battle_04_Logic.rb', line 907

def status_appliable?(status, target, launcher = nil, skill = nil)
end

#status_change(status, target, launcher = nil, skill = nil, message_overwrite: nil)

Function that actually change the status

Parameters:

  • status (Symbol) —

    :poison, :toxic, :confusion, :sleep, :freeze, :paralysis, :burn, :flinch, :cure, :confuse_cure

  • target (PFM::PokemonBattler)
  • launcher (PFM::PokemonBattler, nil) (defaults to: nil) —

    Potential launcher of a move

  • skill (Battle::Move, nil) (defaults to: nil) —

    Potential move used

  • message_overwrite (Integer) (defaults to: nil) —

    Index of the message to use of file 19 to apply the status (if there's specific reason)



915
916
# File 'docs/5_Battle_04_Logic.rb', line 915

def status_change(status, target, launcher = nil, skill = nil, message_overwrite: nil)
end

#status_change_with_process(status, target, launcher = nil, skill = nil, message_overwrite: nil)

Function that test if the change is possible and perform the change if so

Parameters:

  • status (Symbol) —

    :poison, :toxic, :confusion, :sleep, :freeze, :paralysis, :burn, :flinch, :cure

  • target (PFM::PokemonBattler)
  • launcher (PFM::PokemonBattler, nil) (defaults to: nil) —

    Potential launcher of a move

  • skill (Battle::Move, nil) (defaults to: nil) —

    Potential move used



922
923
# File 'docs/5_Battle_04_Logic.rb', line 922

def status_change_with_process(status, target, launcher = nil, skill = nil, message_overwrite: nil)
end