Class: Battle::Effects::EffectBase

Inherits:
Object
  • Object
show all
Defined in:
docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb

Overview

Class describing all the effect (“abstract”) and helping the handler to manage effect

Instance Method Summary collapse

Constructor Details

#initialize(logic) ⇒ EffectBase

Create a new effect

Parameters:

  • logic (Battle::Logic)

    logic used to get all the handler in order to allow the effect to work



60
61
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 60

def initialize(logic)
end

Instance Method Details

#atk_modifierFloat, Integer

Give the atk modifier over given to the Pokemon with this effect

Returns:

  • (Float, Integer)

    multiplier



396
397
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 396

def atk_modifier
end

#ats_modifierFloat, Integer

Give the ats modifier over given to the Pokemon with this effect

Returns:

  • (Float, Integer)

    multiplier



408
409
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 408

def ats_modifier
end

#base_power_multiplier(user, target, move) ⇒ Float, Integer

Give the move base power mutiplier

Parameters:

Returns:

  • (Float, Integer)

    multiplier



357
358
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 357

def base_power_multiplier(user, target, move)
end

#can_attack_hit_out_of_reach?(name) ⇒ Boolean

Check if the attack can hit the pokemon. Should be called after testing out_of_reach?

Parameters:

  • name (Symbol)

Returns:

  • (Boolean)


102
103
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 102

def can_attack_hit_out_of_reach?(name)
end

#chance_of_hit_multiplier(user, target, move) ⇒ Float

Return the chance of hit multiplier

Parameters:

Returns:

  • (Float)


424
425
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 424

def chance_of_hit_multiplier(user, target, move)
end

#counter=(counter)

Function that sets the counter

Parameters:

  • counter (Integer)

    new counter value



64
65
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 64

def counter=(counter)
end

#dead?Boolean

Function telling if the effect should be removed from effects handler

Returns:

  • (Boolean)


71
72
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 71

def dead?
end

#dfe_modifierFloat, Integer

Give the dfe modifier over given to the Pokemon with this effect

Returns:

  • (Float, Integer)

    multiplier



400
401
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 400

def dfe_modifier
end

#dfs_modifierFloat, Integer

Give the dfs modifier over given to the Pokemon with this effect

Returns:

  • (Float, Integer)

    multiplier



412
413
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 412

def dfs_modifier
end

#effect_chance_modifier(move) ⇒ Float, Integer

Give the effect chance modifier given to the Pokémon with this effect

Parameters:

Returns:

  • (Float, Integer)

    multiplier



417
418
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 417

def effect_chance_modifier(move)
end

#force_next_move?Boolean

Tell if the effect forces the next move

Returns:

  • (Boolean)


89
90
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 89

def force_next_move?
end

#force_next_turn_action?Boolean

Tell if the effect forces the next turn action into a Attack action

Returns:

  • (Boolean)


93
94
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 93

def force_next_turn_action?
end

#ignore_target_redirection?Boolean

Check if the user of this ability ignore the center of attention in the enemy bank

Returns:

  • (Boolean)


122
123
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 122

def ignore_target_redirection?
end

#kill

Kill the effect (in order to remove it from the effects handler)



78
79
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 78

def kill
end

#mod1_multiplier(user, target, move) ⇒ Float, Integer

Give the move mod1 mutiplier (before the +2 in the formula)

Parameters:

Returns:

  • (Float, Integer)

    multiplier



378
379
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 378

def mod1_multiplier(user, target, move)
end

#mod2_multiplier(user, target, move) ⇒ Float, Integer

Give the move mod1 mutiplier (after the critical)

Parameters:

Returns:

  • (Float, Integer)

    multiplier



385
386
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 385

def mod2_multiplier(user, target, move)
end

#mod3_multiplier(user, target, move) ⇒ Float, Integer

Give the move mod3 mutiplier (after everything)

Parameters:

Returns:

  • (Float, Integer)

    multiplier



392
393
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 392

def mod3_multiplier(user, target, move)
end

#nameSymbol

Function giving the name of the effect

Returns:

  • (Symbol)


75
76
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 75

def name
end

#on_damage_prevention(handler, hp, target, launcher, skill) ⇒ :prevent, ...

Function called when a damage_prevention is checked

Parameters:

Returns:

  • (:prevent, Integer, nil)

    :prevent if the damage cannot be applied, Integer if the hp variable should be updated



203
204
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 203

def on_damage_prevention(handler, hp, target, launcher, skill)
end

#on_delete

Function called when the effect has been deleted from the effects handler



81
82
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 81

def on_delete
end

#on_end_turn_event(logic, scene, battlers)

Function called at the end of a turn

Parameters:



253
254
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 253

def on_end_turn_event(logic, scene, battlers)
end

#on_fterrain_prevention(handler, fterrain_type, last_fterrain) ⇒ :prevent?

Function called when a fterrain_prevention is checked

Parameters:

  • handler (Battle::Logic::FTerrainChangeHandler)
  • fterrain_type (Symbol)

    :none, :electric_terrain, :grassy_terrain, :misty_terrain, :psychic_terrain

  • last_fterrain (Symbol)

    :none, :electric_terrain, :grassy_terrain, :misty_terrain, :psychic_terrain

Returns:

  • (:prevent, nil)

    :prevent if the status cannot be applied



273
274
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 273

def on_fterrain_prevention(handler, fterrain_type, last_fterrain)
end

#on_held_item_use_preventionBoolean

Function called when a held item wants to perform its action

Returns:

  • (Boolean)

    weither or not the item can’t proceed (true will stop the item)



111
112
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 111

def on_held_item_use_prevention
end

#on_move_ability_immunity(user, target, move) ⇒ Boolean

Function called when we try to check if the effect changes the definitive priority of the move

Parameters:

Returns:

  • (Boolean)

    if the target is immune to the move



337
338
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 337

def on_move_ability_immunity(user, target, move)
end

#on_move_disabled_check(user, move) ⇒ Proc?

Function called when we try to check if the user cannot use a move

Parameters:

Returns:

  • (Proc, nil)


323
324
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 323

def on_move_disabled_check(user, move)
end

#on_move_prevention_target(user, target, move) ⇒ Boolean

Function called when we try to check if the target evades the move

Parameters:

Returns:

  • (Boolean)

    if the target is evading the move



309
310
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 309

def on_move_prevention_target(user, target, move)
end

#on_move_prevention_user(user, targets, move) ⇒ :prevent?

Function called when we try to use a move as the user (returns :prevent if user fails)

Parameters:

Returns:

  • (:prevent, nil)

    :prevent if the move cannot continue



302
303
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 302

def on_move_prevention_user(user, targets, move)
end

#on_move_priority_change(user, priority, move) ⇒ Proc?

Function called when we try to check if the effect changes the definitive priority of the move

Parameters:

Returns:

  • (Proc, nil)


330
331
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 330

def on_move_priority_change(user, priority, move)
end

#on_move_type_change(user, target, move, type) ⇒ Integer?

Function called when we try to get the definitive type of a move

Parameters:

Returns:

  • (Integer, nil)

    new type of the move



317
318
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 317

def on_move_type_change(user, target, move, type)
end

#on_post_accuracy_check(logic, scene, targets, launcher, skill)

Function called after the accuracy check of a move is done (and the move should land)

Parameters:



295
296
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 295

def on_post_accuracy_check(logic, scene, targets, launcher, skill)
end

#on_post_action_event(logic, scene, battlers)

Function called at the end of an action

Parameters:



247
248
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 247

def on_post_action_event(logic, scene, battlers)
end

#on_post_damage(handler, hp, target, launcher, skill)

Function called after damages were applied (post_damage, when target is still alive)

Parameters:



211
212
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 211

def on_post_damage(handler, hp, target, launcher, skill)
end

#on_post_damage_death(handler, hp, target, launcher, skill)

Function called after damages were applied and when target died (post_damage_death)

Parameters:



219
220
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 219

def on_post_damage_death(handler, hp, target, launcher, skill)
end

#on_post_fterrain_change(handler, fterrain_type, last_fterrain)

Function called after the terrain was changed

Parameters:

  • handler (Battle::Logic::FTerrainChangeHandler)
  • fterrain_type (Symbol)

    :none, :electric_terrain, :grassy_terrain, :misty_terrain, :psychic_terrain

  • last_fterrain (Symbol)

    :none, :electric_terrain, :grassy_terrain, :misty_terrain, :psychic_terrain



279
280
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 279

def on_post_fterrain_change(handler, fterrain_type, last_fterrain)
end

#on_post_item_change(handler, db_symbol, target, launcher, skill)

Function called when a post_item_change is checked

Parameters:



177
178
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 177

def on_post_item_change(handler, db_symbol, target, launcher, skill)
end

#on_post_status_change(handler, status, target, launcher, skill)

Function called when a post_status_change is performed

Parameters:



194
195
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 194

def on_post_status_change(handler, status, target, launcher, skill)
end

#on_post_weather_change(handler, weather_type, last_weather)

Function called after the weather was changed (on_post_weather_change)

Parameters:

  • handler (Battle::Logic::WeatherChangeHandler)
  • weather_type (Symbol)

    :none, :rain, :sunny, :sandstorm, :hail, :fog

  • last_weather (Symbol)

    :none, :rain, :sunny, :sandstorm, :hail, :fog



266
267
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 266

def on_post_weather_change(handler, weather_type, last_weather)
end

#on_pre_accuracy_check(logic, scene, targets, launcher, skill)

Function called before the accuracy check of a move is done

Parameters:



287
288
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 287

def on_pre_accuracy_check(logic, scene, targets, launcher, skill)
end

#on_pre_item_change(handler, db_symbol, target, launcher, skill) ⇒ :prevent?

Function called when a pre_item_change is checked

Parameters:

Returns:

  • (:prevent, nil)

    :prevent if the item change cannot be applied



169
170
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 169

def on_pre_item_change(handler, db_symbol, target, launcher, skill)
end

#on_single_type_multiplier_overwrite(target, target_type, type, move) ⇒ Float?

Function that computes an overwrite of the type multiplier

Parameters:

Returns:

  • (Float, nil)

    overwriten type multiplier



350
351
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 350

def on_single_type_multiplier_overwrite(target, target_type, type, move)
end

#on_stat_change(handler, stat, power, target, launcher, skill) ⇒ Integer?

Function called when a stat_change is about to be applied

Parameters:

Returns:

  • (Integer, nil)

    if integer, it will change the power



150
151
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 150

def on_stat_change(handler, stat, power, target, launcher, skill)
end

#on_stat_change_post(handler, stat, power, target, launcher, skill) ⇒ Integer?

Function called when a stat_change has been applied

Parameters:

Returns:

  • (Integer, nil)

    if integer, it will change the power



160
161
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 160

def on_stat_change_post(handler, stat, power, target, launcher, skill)
end

#on_stat_decrease_prevention(handler, stat, target, launcher, skill) ⇒ :prevent?

Function called when a stat_decrease_prevention is checked

Parameters:

Returns:

  • (:prevent, nil)

    :prevent if the stat decrease cannot apply



140
141
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 140

def on_stat_decrease_prevention(handler, stat, target, launcher, skill)
end

#on_stat_increase_prevention(handler, stat, target, launcher, skill) ⇒ :prevent?

Function called when a stat_increase_prevention is checked

Parameters:

Returns:

  • (:prevent, nil)

    :prevent if the stat increase cannot apply



131
132
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 131

def on_stat_increase_prevention(handler, stat, target, launcher, skill)
end

#on_status_prevention(handler, status, target, launcher, skill) ⇒ :prevent?

Function called when a status_prevention is checked

Parameters:

Returns:

  • (:prevent, nil)

    :prevent if the status cannot be applied



186
187
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 186

def on_status_prevention(handler, status, target, launcher, skill)
end

#on_switch_event(handler, who, with)

Function called when a Pokemon has actually switched with another one

Parameters:



241
242
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 241

def on_switch_event(handler, who, with)
end

#on_switch_passthrough(handler, pokemon, skill, reason) ⇒ :passthrough?

Function called when testing if pokemon can switch regardless of the prevension.

Parameters:

Returns:

  • (:passthrough, nil)

    if :passthrough, can_switch? will return true without checking switch_prevention



227
228
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 227

def on_switch_passthrough(handler, pokemon, skill, reason)
end

#on_switch_prevention(handler, pokemon, skill, reason) ⇒ :prevent?

Function called when testing if pokemon can switch (when he couldn’t passthrough)

Parameters:

Returns:

  • (:prevent, nil)

    if :prevent, can_switch? will return false



235
236
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 235

def on_switch_prevention(handler, pokemon, skill, reason)
end

#on_transform_event(handler, target)

Function called when a Pokemon initialize a transformation

Parameters:



342
343
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 342

def on_transform_event(handler, target)
end

#on_two_turn_shortcut(user, targets, skill) ⇒ Boolean

Function called after a battler proceed its two turn move’s first turn

Parameters:

Returns:

  • (Boolean)

    weither or not the two turns move is executed in one turn



118
119
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 118

def on_two_turn_shortcut(user, targets, skill)
end

#on_weather_prevention(handler, weather_type, last_weather) ⇒ :prevent?

Function called when a weather_prevention is checked

Parameters:

  • handler (Battle::Logic::WeatherChangeHandler)
  • weather_type (Symbol)

    :none, :rain, :sunny, :sandstorm, :hail, :fog

  • last_weather (Symbol)

    :none, :rain, :sunny, :sandstorm, :hail, :fog

Returns:

  • (:prevent, nil)

    :prevent if the status cannot be applied



260
261
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 260

def on_weather_prevention(handler, weather_type, last_weather)
end

#out_of_reach?Boolean

Tell if the effect make the pokemon out reach

Returns:

  • (Boolean)


97
98
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 97

def out_of_reach?
end

#rapid_spin_affected?Boolean

Function that tells if the move is affected by Rapid Spin

Returns:

  • (Boolean)


85
86
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 85

def rapid_spin_affected?
end

#sp_atk_multiplier(user, target, move) ⇒ Float, Integer

Give the move [Spe]atk mutiplier

Parameters:

Returns:

  • (Float, Integer)

    multiplier



364
365
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 364

def sp_atk_multiplier(user, target, move)
end

#sp_def_multiplier(user, target, move) ⇒ Float, Integer

Give the move [Spe]def mutiplier

Parameters:

Returns:

  • (Float, Integer)

    multiplier



371
372
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 371

def sp_def_multiplier(user, target, move)
end

#spd_modifierFloat, Integer

Give the speed modifier over given to the Pokemon with this effect

Returns:

  • (Float, Integer)

    multiplier



404
405
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 404

def spd_modifier
end

#specific_proceed_internal(user, targets, move)

Return the specific proceed_internal if the condition is fulfilled

Parameters:



430
431
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 430

def specific_proceed_internal(user, targets, move)
end

#target_redirection(user, targets, move) ⇒ PFM::PokemonBattler

Return the new target if the conditions are fulfilled

Parameters:

Returns:

  • (PFM::PokemonBattler)

    the new target if the conditions are fulfilled, the initial target otherwise



437
438
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 437

def target_redirection(user, targets, move)
end

#targetted?(battler) ⇒ Boolean

Tell if the given battler is targetted by the effect

Parameters:

Returns:

  • (Boolean)


107
108
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 107

def targetted?(battler)
end

#update_counter

Function that updates the counter of the effect



67
68
# File 'docs/01600_Alpha_25_Battle_Engine_04000_Effects.rb', line 67

def update_counter
end