diff options
Diffstat (limited to 'Scenes/PlateDamage.gd')
-rw-r--r-- | Scenes/PlateDamage.gd | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Scenes/PlateDamage.gd b/Scenes/PlateDamage.gd new file mode 100644 index 0000000..310ac39 --- /dev/null +++ b/Scenes/PlateDamage.gd @@ -0,0 +1,19 @@ +extends Plate + +export(int) var damage + +func activate(entity : Entity, dungeon): + if entity is Player: + entity.add_action("cor_shake", [0.2]) + Global.turns -= damage + return + + if entity is Monster: + if entity.health - damage <= 0: + entity.alive = false + entity.add_action("cor_dies", []) + dungeon.kill_entity(entity) + else: + entity.health -= damage + entity.add_action("cor_shake", [0.2]) + return |