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

Method updateCloak

game/state/battle/battleunit.cpp:2054–2071  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2052}
2053
2054void BattleUnit::updateCloak(GameState &state [[maybe_unused]], unsigned int ticks)
2055{
2056 if (isConscious())
2057 {
2058 auto e1 = agent->getFirstItemInSlot(EquipmentSlotType::LeftHand);
2059 auto e2 = agent->getFirstItemInSlot(EquipmentSlotType::RightHand);
2060
2061 if (cloakTicksAccumulated < CLOAK_TICKS_REQUIRED_UNIT)
2062 {
2063 cloakTicksAccumulated += ticks;
2064 }
2065 if ((!e1 || e1->type->type != AEquipmentType::Type::CloakingField) &&
2066 (!e2 || e2->type->type != AEquipmentType::Type::CloakingField))
2067 {
2068 cloakTicksAccumulated = 0;
2069 }
2070 }
2071}
2072
2073void BattleUnit::updateStateAndStats(GameState &state, unsigned int ticks)
2074{

Callers

nothing calls this directly

Calls 1

getFirstItemInSlotMethod · 0.80

Tested by

no test coverage detected