Class: Battle::Move::MultiHit
- Inherits:
-
Basic
- Object
- Battle::Move
- Basic
- Battle::Move::MultiHit
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/04150 Battle_Move/00001 Mechanics/00103 TwoHit MultiHit.rb
Overview
Class describing a move hiting multiple time
Direct Known Subclasses
Constant Summary collapse
- MULTI_HIT_CHANCES =
[2, 2, 2, 3, 3, 5, 4, 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
-
#deal_damage(user, actual_targets)
Function that deals the damage to the pokemon.
-
#last_hit? ⇒ Boolean
Check if this the last hit of the move Don't call this method before deal_damage method call.
Methods inherited from Basic
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?, #move_usable_by_user, #name, #no_choice_skill?, #not_very_effective?, #ohko?, #one_target?, #physical?, #powder?, #power, #power_text, #pp_text, #pre_attack?, #priority, #proceed, #proceed_pre_attack, #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
#deal_damage(user, actual_targets)
Function that deals the damage to the pokemon
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'scripts/01600 Alpha 25 Battle Engine/04150 Battle_Move/00001 Mechanics/00103 TwoHit MultiHit.rb', line 9 def deal_damage(user, actual_targets) @user = user @actual_targets = actual_targets @nb_hit = 0 @hit_amount = hit_amount(user, actual_targets) @hit_amount.times.count do |i| next false unless actual_targets.all?(&:alive?) next false if user.dead? @nb_hit += 1 play_animation(user, actual_targets) if i > 0 actual_targets.each do |target| hp = damages(user, target) @logic.damage_handler.damage_change_with_process(hp, target, user, self) do if critical_hit? scene.(actual_targets.size == 1 ? parse_text(18, 84) : parse_text_with_pokemon(19, 384, target)) elsif hp > 0 && i == @hit_amount - 1 (effectiveness, target) end end recoil(hp, user) if recoil? end next true end @scene.(parse_text(18, 33, PFM::Text::NUMB[1] => @nb_hit.to_s)) return false if user.dead? end |
#last_hit? ⇒ Boolean
Check if this the last hit of the move Don't call this method before deal_damage method call
40 41 42 43 44 45 |
# File 'scripts/01600 Alpha 25 Battle Engine/04150 Battle_Move/00001 Mechanics/00103 TwoHit MultiHit.rb', line 40 def last_hit? return true if @user.dead? return true unless @actual_targets.all?(&:alive?) return @hit_amount == @nb_hit end |