Class: Battle::Move::RecoilMove

Inherits:
Basic show all
Defined in:
scripts/01600 Alpha 25 Battle Engine/04150 Battle_Move/00010 Definitions/00300 RecoilMove.rb

Overview

Move that has a little recoil when it hits the opponent

Direct Known Subclasses

Struggle

Constant Summary collapse

RECOIL_FACTORS =

List of factor depending on the move

{
  brave_bird: 3,
  double_edge: 3,
  chloroblast: 2,
  flare_blitz: 3,
  head_charge: 4,
  head_smash: 2,
  light_of_ruin: 2,
  shadow_end: 2,
  shadow_rush: 16,
  struggle: 4,
  submission: 4,
  take_down: 4,
  volt_tackle: 3,
  wave_crash: 3,
  wild_charge: 4,
  wood_hammer: 3
}

Constants inherited from Battle::Move

OneTarget, REGISTERED_MOVES, R_RANGE, TargetNoAsk

Instance Attribute Summary

Attributes inherited from Battle::Move

#consecutive_use_count, #damage_dealt, #effectiveness, #forced_next_move_decrease_pp, #id, #logic, #original, #pp, #ppmax, #scene, #used

Instance Method Summary collapse

Methods inherited from Basic

#deal_damage, #effect_working?

Methods inherited from Battle::Move

[], #accuracy, #accuracy_mod, #accuracy_text, #atk_class, #authentic?, #ballistics?, #battle_stage_mod, #battler_targets, #be_method, #bite?, #blocable?, #blocked_by?, #bypass_chance_of_hit?, #calc_stab, #chance_of_hit, #check_specific_procedure, #clone, #critical_hit?, #critical_rate, #damages, #dance?, #data, #db_symbol, #definitive_types, #description, #direct?, #disable_reason, #disabled?, #drain_factor, #effect_chance, #efficent_message, #evasion_mod, #force_switch?, #gravity_affected?, #heal?, #initialize, #magic_coat_affected?, #mirror_move_affected?, #move_blocked_by_target?, #move_usable_by_user, #multi_hit?, #name, #no_choice_skill?, #not_very_effective?, #ohko?, #one_target?, #physical?, #powder?, #power, #power_text, #pp_text, #pre_attack?, #priority, #proceed, #proceed_internal_parental_bond, #proceed_pre_attack, #pulse?, #punching?, #real_base_power, register, register_move_disabled_check_hook, register_move_prevention_target_hook, register_move_prevention_user_hook, register_move_type_change_hook, register_single_type_multiplier_overwrite_hook, #relative_priority, #self_user_switch?, #slicing_attack?, #snatchable?, #sound_attack?, #special?, #status?, #status_effects, #super_effective?, #target, #to_s, #trigger_king_rock?, #type, #type?, #type_dark?, #type_dragon?, #type_electric?, #type_fairy?, #type_fighting?, #type_fire?, #type_flying?, #type_ghost?, #type_grass?, #type_ground?, #type_ice?, #type_insect?, #type_modifier, #type_normal?, #type_poison?, #type_psychic?, #type_rock?, #type_steel?, #type_water?, #typeless?, #unfreeze?, #wind_attack?

Methods included from Hooks

#exec_hooks, #force_return, included, register, remove, remove_without_name

Constructor Details

This class inherits a constructor from Battle::Move

Instance Method Details

#recoil(hp, user)

Function applying recoil damage to the user

Parameters:



50
51
52
53
54
# File 'scripts/01600 Alpha 25 Battle Engine/04150 Battle_Move/00010 Definitions/00300 RecoilMove.rb', line 50

def recoil(hp, user)
  hp = user.max_hp if recoil_applies_on_user_max_hp?
  hp = user.hp if recoil_applies_on_user_hp?
  super(hp, user)
end

#recoil?Boolean

Tell that the move is a recoil move

Returns:

  • (Boolean)


27
28
29
# File 'scripts/01600 Alpha 25 Battle Engine/04150 Battle_Move/00010 Definitions/00300 RecoilMove.rb', line 27

def recoil?
  true
end

#recoil_applies_on_user_hp?Boolean

Test if teh recoil applis to user current hp

Returns:

  • (Boolean)


43
44
45
# File 'scripts/01600 Alpha 25 Battle Engine/04150 Battle_Move/00010 Definitions/00300 RecoilMove.rb', line 43

def recoil_applies_on_user_hp?
  %i[shadow_end].include?(db_symbol)
end

#recoil_applies_on_user_max_hp?Boolean

Test if the recoil applies to user max hp

Returns:

  • (Boolean)


38
39
40
# File 'scripts/01600 Alpha 25 Battle Engine/04150 Battle_Move/00010 Definitions/00300 RecoilMove.rb', line 38

def recoil_applies_on_user_max_hp?
  %i[struggle shadow_rush].include?(db_symbol)
end

#recoil_factorInteger

Returns the recoil factor

Returns:

  • (Integer)


33
34
35
# File 'scripts/01600 Alpha 25 Battle Engine/04150 Battle_Move/00010 Definitions/00300 RecoilMove.rb', line 33

def recoil_factor
  RECOIL_FACTORS[db_symbol] || super
end