Class: Battle::Effects::Status

Inherits:
EffectBase show all
Defined in:
scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00103 Burn.rb,
scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00108 Toxic.rb,
scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00101 Poison.rb,
scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00104 Asleep.rb,
scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00105 Frozen.rb,
scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00102 Paralysis.rb,
scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00001 StatusBase.rb

Direct Known Subclasses

Asleep, Burn, Frozen, Paralysis, Poison, Toxic

Defined Under Namespace

Classes: Asleep, Burn, Frozen, Paralysis, Poison, Toxic

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from EffectBase

#base_power_multiplier, #can_attack_hit_out_of_reach?, #chance_of_hit_multiplier, #counter=, #dead?, #effect_chance_modifier, #force_next_move?, #kill, #mod1_multiplier, #mod2_multiplier, #mod3_multiplier, #name, #on_damage_prevention, #on_delete, #on_end_turn_event, #on_fterrain_prevention, #on_held_item_use_prevention, #on_move_ability_immunity, #on_move_disabled_check, #on_move_prevention_target, #on_move_prevention_user, #on_move_priority_change, #on_move_type_change, #on_post_accuracy_check, #on_post_action_event, #on_post_damage, #on_post_damage_death, #on_post_fterrain_change, #on_post_item_change, #on_post_status_change, #on_post_weather_change, #on_pre_item_change, #on_single_type_multiplier_overwrite, #on_stat_change, #on_stat_change_post, #on_stat_decrease_prevention, #on_stat_increase_prevention, #on_status_prevention, #on_switch_event, #on_switch_passthrough, #on_switch_prevention, #on_transform_event, #on_two_turn_shortcut, #on_weather_prevention, #out_of_reach?, #rapid_spin_affected?, #sp_atk_multiplier, #sp_def_multiplier, #spd_modifier, #targetted?, #update_counter

Constructor Details

#initialize(logic, target, status) ⇒ Status

Create a new status effect

Parameters:



14
15
16
17
18
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00001 StatusBase.rb', line 14

def initialize(logic, target, status)
  super(logic)
  @target = target
  @status = status
end

Instance Attribute Details

#targetPFM::PokemonBattler (readonly)

Get the target of the effect

Returns:



6
7
8
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00001 StatusBase.rb', line 6

def target
  @target
end

Class Method Details

.new(logic, target, status) ⇒ Status

Create a new Status effect

Parameters:

Returns:



81
82
83
84
85
86
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00001 StatusBase.rb', line 81

def new(logic, target, status)
  klass = @registered_statuses[status] || Status
  object = klass.allocate
  object.send(:initialize, logic, target, status)
  return object
end

.register(status, klass)

Register a new status

Parameters:

  • status (Symbol)

    Symbol of the status

  • klass (Class<Status>)

    class of the status effect



72
73
74
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00001 StatusBase.rb', line 72

def register(status, klass)
  @registered_statuses[status] = klass
end

Instance Method Details

#asleep?Boolean

Tell if the status effect is asleep

Returns:

  • (Boolean)


46
47
48
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00001 StatusBase.rb', line 46

def asleep?
  @status == :sleep
end

#burn?Boolean

Tell if the status effect is burn

Returns:

  • (Boolean)


40
41
42
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00001 StatusBase.rb', line 40

def burn?
  @status == :burn
end

#frozen?Boolean

Tell if the status effect is frozen

Returns:

  • (Boolean)


52
53
54
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00001 StatusBase.rb', line 52

def frozen?
  @status == :freeze
end

#global_poisoning?Boolean

Tell if the effect is a global poisoning effect (poison or toxic)

Returns:

  • (Boolean)


64
65
66
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00001 StatusBase.rb', line 64

def global_poisoning?
  poison? || toxic?
end

#paralysis?Boolean

Tell if the status effect is paralysis

Returns:

  • (Boolean)


34
35
36
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00001 StatusBase.rb', line 34

def paralysis?
  @status == :paralysis
end

#poison?Boolean

Tell if the status effect is poisoning

Returns:

  • (Boolean)


28
29
30
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00001 StatusBase.rb', line 28

def poison?
  @status == :poison
end

#status_idInteger

Get the ID of the status

Returns:



22
23
24
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00001 StatusBase.rb', line 22

def status_id
  Configs.states.ids[@status] || -1
end

#toxic?Boolean

Tell if the status effect is toxic

Returns:

  • (Boolean)


58
59
60
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00600 Status Effects/00001 StatusBase.rb', line 58

def toxic?
  @status == :toxic
end