Class: Battle::Effects::Ability::BoostingMoveTypeWeatherBall

Inherits:
BoostingMoveType show all
Defined in:
scripts/01600 Alpha 25 Battle Engine/04000 Effects/00700 Ability Effects/00051 BoostingMoveTypeWeatherBall.rb

Constant Summary collapse

WEATHER_BALL_TYPES_OVERWRITES =

List of type overwrite if Weather ball is called with this effect

Hash.new(:normal)

Constants inherited from BoostingMoveType

Battle::Effects::Ability::BoostingMoveType::POWER_INCREASE, Battle::Effects::Ability::BoostingMoveType::POWER_INCREASE_CONDITION, Battle::Effects::Ability::BoostingMoveType::TYPE_CONDITION

Instance Attribute Summary

Attributes inherited from Battle::Effects::Ability

#affect_allies, #db_symbol, #target

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BoostingMoveType

#base_power_multiplier

Methods inherited from Battle::Effects::Ability

#initialize, new

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?, #initialize, #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_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

This class inherits a constructor from Battle::Effects::Ability

Class Method Details

.register(db_symbol, type_overwrite, multiplier = 1.3, &block) {|user, target, move| ... }

Register a BoostingMoveType ability

Parameters:

  • db_symbol (Symbol)

    db_symbol of the ability

  • type_overwrite (Symbol)

    move type overwrite for weather_ball

  • multiplier (Float) (defaults to: 1.3)

    multiplier if all condition are meet

  • block (Proc)

    additional condition

Yield Parameters:

Yield Returns:

  • (Boolean)


30
31
32
33
34
35
36
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00700 Ability Effects/00051 BoostingMoveTypeWeatherBall.rb', line 30

def register(db_symbol, type_overwrite, multiplier = 1.3, &block)
  POWER_INCREASE_CONDITION[db_symbol] = block if block
  BoostingMoveType::TYPE_CONDITION[db_symbol] = :normal
  WEATHER_BALL_TYPES_OVERWRITES[db_symbol] = type_overwrite
  BoostingMoveType::POWER_INCREASE[db_symbol] = multiplier if multiplier
  Ability.register(db_symbol, BoostingMoveTypeWeatherBall)
end

Instance Method Details

#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



14
15
16
17
18
# File 'scripts/01600 Alpha 25 Battle Engine/04000 Effects/00700 Ability Effects/00051 BoostingMoveTypeWeatherBall.rb', line 14

def on_move_type_change(user, target, move, type)
  return nil if self.target != user || move.be_method != :s_weather_ball

  return data_type(WEATHER_BALL_TYPES_OVERWRITES[db_symbol]).id
end