Module: Battle::Move::Mechanics::Counter

Included in:
CounterBase
Defined in:
docs/01600_Alpha_25_Battle_Engine_04150_Battle_Move_00001_Mechanics.rb

Overview

Preset used for counter attacks Should be included only in a Battle::Move class or a class with the same interface The includer must overwrite the following methods:

  • counter_fails?(attacker, user, targets)

Instance Method Summary collapse

Instance Method Details

#damages(user, target) ⇒ Integer Also known as: counter_damages

Method calculating the damages done by counter

Parameters:

Returns:

  • (Integer)


21
22
# File 'docs/01600_Alpha_25_Battle_Engine_04150_Battle_Move_00001_Mechanics.rb', line 21

def damages(user, target)
end

#move_usable_by_user(user, targets) ⇒ Boolean Also known as: counter_move_usable_by_user

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



14
15
# File 'docs/01600_Alpha_25_Battle_Engine_04150_Battle_Move_00001_Mechanics.rb', line 14

def move_usable_by_user(user, targets)
end