Class: Battle::Move::FocusPunch

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

Overview

The user of Focus Punch will tighten its focus before any other moves are made. If any regular move (with a higher priority than -3) directly hits the focused Pokémon, it loses its focus and flinches, not carrying out the attack. If no direct hits are made, Focus Punch attacks as normal.

Constant Summary

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, #clone, #critical_hit?, #critical_rate, #damages, #dance?, #data, #db_symbol, #definitive_types, #description, #direct?, #disable_reason, #disabled?, #effect_chance, #evasion_mod, #force_switch?, #gravity_affected?, #heal?, #initialize, #magic_coat_affected?, #mirror_move_affected?, #move_blocked_by_target?, #name, #no_choice_skill?, #not_very_effective?, #ohko?, #one_target?, #physical?, #powder?, #power, #power_text, #pp_text, #priority, #proceed, #pulse?, #punching?, #real_base_power, #recoil?, #recoil_factor, 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?, #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?, #unfreeze?

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

#move_usable_by_user(user, targets) ⇒ Boolean

Note:

Thing that prevents the move from being used should be defined by :move_prevention_user Hook

Function that tests if the user is able to use the move

Parameters:

Returns:

  • (Boolean)

    if the procedure can continue



29
30
31
32
33
34
# File 'scripts/01600 Alpha 25 Battle Engine/04150 Battle_Move/00010 Definitions/00300 FocusPunch.rb', line 29

def move_usable_by_user(user, targets)
  return false unless super
  return show_usage_failure(user) && false if disturbed?(user)

  return true
end

#pre_attack?Boolean

Is the move doing something before any other attack ?

Returns:

  • (Boolean)


13
14
15
# File 'scripts/01600 Alpha 25 Battle Engine/04150 Battle_Move/00010 Definitions/00300 FocusPunch.rb', line 13

def pre_attack?
  true
end

#proceed_pre_attack(user)

Proceed the procedure before any other attack.

Parameters:



19
20
21
22
# File 'scripts/01600 Alpha 25 Battle Engine/04150 Battle_Move/00010 Definitions/00300 FocusPunch.rb', line 19

def proceed_pre_attack(user)
  @scene.display_message_and_wait(parse_text_with_pokemon(19, 616, user))
  # @todo play charging animation
end