From 78600fa126631632290bbf20d28548128b93e91b Mon Sep 17 00:00:00 2001 From: Nathan Lovato Date: Mon, 22 Oct 2018 16:48:57 +0900 Subject: [PATCH] Add play_death function and rename stagger -> play_stagger on BattlerSkin and BattlerAnim --- godot/animation/BattlerAnim.gd | 7 ++++++- godot/combat/battlers/BattlerSkin.gd | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/godot/animation/BattlerAnim.gd b/godot/animation/BattlerAnim.gd index 35cdfe7..2513fdd 100644 --- a/godot/animation/BattlerAnim.gd +++ b/godot/animation/BattlerAnim.gd @@ -4,5 +4,10 @@ class_name BattlerAnim onready var anim = $AnimationPlayer -func stagger(): +func play_stagger(): anim.play("take_damage") + yield(anim, "animation_finished") + +func play_death(): + anim.play("death") + yield(anim, "animation_finished") diff --git a/godot/combat/battlers/BattlerSkin.gd b/godot/combat/battlers/BattlerSkin.gd index 642e9c2..e458034 100644 --- a/godot/combat/battlers/BattlerSkin.gd +++ b/godot/combat/battlers/BattlerSkin.gd @@ -60,5 +60,8 @@ func set_blink(value): else: anim.play("idle") -func stagger(): - battler_anim.stagger() +func play_stagger(): + battler_anim.play_stagger() + +func play_death(): + yield(battler_anim.play_death(), "completed") -- GitLab