Module: Battle::MoveAnimation

Defined in:
docs/5_Battle_20_MoveAnimation.rb

Overview

Module responsive of handling all move animation

All animation will have the following values in their resolver:

- :visual => Battle::Visual object
- :user => BattleUI::PokemonSprite of the user of the move
- :target => BattleUI::PokemonSprite of the target of the move (first if user animation, current if target animation)
- :viewport => Viewport of the user sprite

Class Method Summary collapse

Class Method Details

.get(move, *animation_reason) ⇒ Array<Yuki::Animation::TimedAnimation>?

Function that retreives the animation for the user & the target depending on the condition

Parameters:

  • move (Battle::Move)

    move used

  • animation_reason (Array<Symbol>)

    reason of the animation (in order you want it, you’ll get the first that got resolved)

Returns:



31
32
# File 'docs/5_Battle_20_MoveAnimation.rb', line 31

def get(move, *animation_reason)
end

.play(animations, visual, user, targets)

Function that plays an animation

Parameters:



38
39
# File 'docs/5_Battle_20_MoveAnimation.rb', line 38

def play(animations, visual, user, targets)
end

.register_generic_animation(move_kind, move_type, animation_user, animation_target)

Function that stores a generic move animation

Parameters:

  • move_kind (Integer)

    1 = physical, 2 = special, 3 = status

  • move_type (Integer)

    type of the move

  • animation_user (Yuki::Animation::TimedAnimation)

    unstarted animation of user that will be serialized

  • animation_target (Yuki::Animation::TimedAnimation)

    unstarted animation of target that will be serialized



25
26
# File 'docs/5_Battle_20_MoveAnimation.rb', line 25

def register_generic_animation(move_kind, move_type, animation_user, animation_target)
end

.register_specific_animation(move_db_symbol, animation_reason, animation_user, animation_target)

Function that store a specific move animation

Parameters:



18
19
# File 'docs/5_Battle_20_MoveAnimation.rb', line 18

def register_specific_animation(move_db_symbol, animation_reason, animation_user, animation_target)
end