MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / tryUseSupport

Method tryUseSupport

source/creatureskill/CreatureSkillHealSelf.cpp:59–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59bool CreatureSkillHealSelf::tryUseSupport(GameMap& gameMap, Creature* creature) const
60{
61 if(!creature->isAlive())
62 return false;
63
64 if(!creature->isHurt())
65 return false;
66
67 CreatureEffectHeal* effect = new CreatureEffectHeal(mEffectDuration, mEffectValue, "SpellCreatureHeal");
68 creature->addCreatureEffect(effect);
69
70 for(Tile* tile : creature->getCoveredTiles())
71 {
72 Spell::fireSpellSound(*tile, "Heal");
73 }
74
75 return true;
76}
77
78CreatureSkillHealSelf* CreatureSkillHealSelf::clone() const
79{

Callers 1

doUpkeepMethod · 0.45

Calls 4

isAliveMethod · 0.80
isHurtMethod · 0.80
addCreatureEffectMethod · 0.80
getCoveredTilesMethod · 0.45

Tested by

no test coverage detected