diff --git a/src/c/spell.c b/src/c/spell.c index ea368b2..b8ce864 100644 --- a/src/c/spell.c +++ b/src/c/spell.c @@ -7,4 +7,10 @@ int spellFireball(Character *character) { int damage = 10 + (getCharacterIntelligence(character) / 2); return damage; +} + + +int spellHeal(Character *character) { + int heal = 10 + (getCharacterIntelligence(character) / 3); + return heal; } \ No newline at end of file diff --git a/src/c/spell.h b/src/c/spell.h index bc7b657..fec8dd8 100644 --- a/src/c/spell.h +++ b/src/c/spell.h @@ -1,6 +1,9 @@ #ifndef SPELL_H #define SPELL_H +#include "character.h" + int spellFireball(Character *character); +int spellHeal(Character *character); #endif \ No newline at end of file diff --git a/test/c/test_spell.c b/test/c/test_spell.c index a8d4ab0..86e55ee 100644 --- a/test/c/test_spell.c +++ b/test/c/test_spell.c @@ -35,4 +35,10 @@ void test_spellFireball(void) TEST_ASSERT_EQUAL_INT(10,spellFireball(&testCharacter)); TEST_ASSERT_EQUAL_INT(13,spellFireball(&testCharacter2)); } + +void test_spellHeal(void) +{ + TEST_ASSERT_EQUAL_INT(10,spellHeal(&testCharacter)); + TEST_ASSERT_EQUAL_INT(12,spellHeal(&testCharacter2)); +} #endif // TEST \ No newline at end of file