Class: Battle::Visual::FakeHPAnimation
- Inherits:
-
Yuki::Animation::TimedAnimation
- Object
- Yuki::Animation::TimedAnimation
- Battle::Visual::FakeHPAnimation
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00001 Animations/01002 FakeHPAnimation.rb
Overview
Waiting animation if 0 HP are dealt
Instance Method Summary collapse
-
#done? ⇒ Boolean
Detect if the animation if done.
-
#effectiveness_sound(effectiveness)
Play the effectiveness sound.
-
#initialize(scene, target, effectiveness = nil) ⇒ FakeHPAnimation
constructor
Create the HP Animation.
-
#update
Update the animation.
Constructor Details
#initialize(scene, target, effectiveness = nil) ⇒ FakeHPAnimation
Create the HP Animation
9 10 11 12 13 14 15 16 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00001 Animations/01002 FakeHPAnimation.rb', line 9 def initialize(scene, target, effectiveness = nil) @scene = scene @target = target time = 1 super(time) start effectiveness_sound(effectiveness) if effectiveness end |
Instance Method Details
#done? ⇒ Boolean
Detect if the animation if done
26 27 28 29 30 31 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00001 Animations/01002 FakeHPAnimation.rb', line 26 def done? return false unless super @scene.visual.(@target) return true end |
#effectiveness_sound(effectiveness)
Play the effectiveness sound
34 35 36 37 38 39 40 41 42 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00001 Animations/01002 FakeHPAnimation.rb', line 34 def effectiveness_sound(effectiveness) if effectiveness == 1 Audio.se_play('Audio/SE/hit') elsif effectiveness > 1 Audio.se_play('Audio/SE/hitplus') else Audio.se_play('Audio/SE/hitlow') end end |
#update
Update the animation
19 20 21 22 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00001 Animations/01002 FakeHPAnimation.rb', line 19 def update super @scene.visual.(@target) end |