MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / die

Method die

game/state/battle/battlehazard.cpp:37–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37void BattleHazard::die(GameState &state, bool violently)
38{
39 auto this_shared = shared_from_this();
40 tileObject->removeFromMap();
41 tileObject.reset();
42
43 if (!violently)
44 {
45 return;
46 }
47 // Place smoke where fire died off
48 if (damageType->effectType == DamageType::EffectType::Fire)
49 {
50 StateRef<DamageType> dtSmoke = {&state, "DAMAGETYPE_SMOKE"};
51 state.current_battle->placeHazard(state, ownerOrganisation, ownerUnit, dtSmoke, position,
52 dtSmoke->hazardType->getLifetime(state), power, 6);
53 }
54}
55void BattleHazard::dieAndRemove(GameState &state, bool violently)
56{
57 die(state, violently);

Callers

nothing calls this directly

Calls 4

placeHazardMethod · 0.80
getLifetimeMethod · 0.80
removeFromMapMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected