@ -34,3 +34,13 @@ SpellEffect spellLightning(Character *character) {
lightning.effectDuration = 1;
return lightning;
}
SpellEffect spellRegeneration (Character *character) {
SpellEffect regeneration;
regeneration.damage = 0;
regeneration.healing = 5 + (getCharacterIntelligence(character) / 4);
regeneration.manaCost = 10;
regeneration.effect = SPELL_EFFECT_REGENERATION;
regeneration.effectDuration = 2;
return regeneration;
@ -15,6 +15,7 @@ enum {
SpellEffect spellFireball(Character *character);
SpellEffect spellHeal(Character *character);
SpellEffect spellLightning(Character *character);
SpellEffect spellRegeneration (Character *character);
#endif
@ -54,4 +54,12 @@ void test_spellLightning(void)
result = spellLightning(&testCharacter2).damage;
TEST_ASSERT_EQUAL_INT(13,result);
void test_spellRegeneration(void)
{
int result = spellRegeneration(&testCharacter).healing;
TEST_ASSERT_EQUAL_INT(5,result);
result = spellRegeneration(&testCharacter2).healing;
TEST_ASSERT_EQUAL_INT(6,result);
#endif // TEST