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

Method getAIType

game/state/battle/battleunit.cpp:1481–1496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1479bool BattleUnit::isCloaked() const { return cloakTicksAccumulated >= CLOAK_TICKS_REQUIRED_UNIT; }
1480
1481AIType BattleUnit::getAIType() const
1482{
1483 switch (moraleState)
1484 {
1485 case MoraleState::Normal:
1486 return agent->type->aiType;
1487 case MoraleState::PanicFreeze:
1488 return AIType::PanicFreeze;
1489 case MoraleState::PanicRun:
1490 return AIType::PanicRun;
1491 case MoraleState::Berserk:
1492 return AIType::Berserk;
1493 }
1494 LogError("Unhandled morale state in getAIType()");
1495 return AIType::None;
1496}
1497
1498bool BattleUnit::canFly() const
1499{

Callers 8

initialUnitSpawnMethod · 0.80
refreshUnitVisionMethod · 0.80
thinkMethod · 0.80
thinkInternalMethod · 0.80
thinkMethod · 0.80
updateHiddenBarMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected