From 17a4c084361d375055260c4673f6425017391573 Mon Sep 17 00:00:00 2001 From: Kai Kehres Date: Wed, 1 Feb 2023 09:58:05 +0100 Subject: [PATCH] prod: created rest function --- src/c/encounter.c | 7 +++++++ src/c/encounter.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/c/encounter.c b/src/c/encounter.c index d456dc1..e104338 100644 --- a/src/c/encounter.c +++ b/src/c/encounter.c @@ -246,4 +246,11 @@ bool dodge (Character *character, enemy* enemy) { return true; } return false; +} + +void rest(Character *character) { + setCharacterHealthPoints(character, getCharacterMaxHealthPoints(character)); + setCharacterManaPoints(character, 10); + setCharacterStatus(character, SPELL_EFFECT_NONE); + setCharacterStatusDuration(character, 0); } \ No newline at end of file diff --git a/src/c/encounter.h b/src/c/encounter.h index 52b74d4..6373e7b 100644 --- a/src/c/encounter.h +++ b/src/c/encounter.h @@ -24,6 +24,7 @@ bool enemyChoosesHeal(enemy* enemy); int switchTurns(int currentTurn); int fight(Character *character, enemy* enemy); bool dodge (Character *character, enemy* enemy); +void rest(Character *character);