MCPcopy Create free account
hub / github.com/EasyRPG/Player / ApplyHpEffect

Method ApplyHpEffect

src/game_battlealgorithm.cpp:169–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169int Game_BattleAlgorithm::AlgorithmBase::ApplyHpEffect() {
170 auto* target = GetTarget();
171 assert(target);
172
173 if (target->IsDead()) {
174 return 0;
175 }
176 int hp = GetAffectedHp();
177 if (hp != 0) {
178 hp = target->ChangeHp(hp, true);
179 if (IsAbsorbHp()) {
180 // Only absorb the hp that were left
181 source->ChangeHp(-hp, true);
182 }
183 }
184 return hp;
185}
186
187int Game_BattleAlgorithm::AlgorithmBase::ApplySpEffect() {
188 auto* target = GetTarget();

Calls 2

IsDeadMethod · 0.80
ChangeHpMethod · 0.80

Tested by

no test coverage detected