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

Method getBodyStateChangeCost

game/state/battle/battleunit.cpp:1343–1387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1341int BattleUnit::getTurnCost() const { return 1; }
1342
1343int BattleUnit::getBodyStateChangeCost(BodyState from, BodyState to) const
1344{
1345 // If not within these conditions, it costs nothing!
1346 switch (to)
1347 {
1348 case BodyState::Flying:
1349 case BodyState::Standing:
1350 switch (from)
1351 {
1352 case BodyState::Kneeling:
1353 return 8;
1354 case BodyState::Prone:
1355 return 16;
1356 default:
1357 return 0;
1358 }
1359 break;
1360 case BodyState::Kneeling:
1361 switch (from)
1362 {
1363 case BodyState::Prone:
1364 case BodyState::Standing:
1365 case BodyState::Flying:
1366 return 8;
1367 default:
1368 return 0;
1369 }
1370 break;
1371 case BodyState::Prone:
1372 switch (from)
1373 {
1374 case BodyState::Kneeling:
1375 case BodyState::Standing:
1376 case BodyState::Flying:
1377 return 8;
1378 default:
1379 return 0;
1380 }
1381 break;
1382 case BodyState::Throwing:
1383 return getThrowCost();
1384 default:
1385 return 0;
1386 }
1387}
1388
1389void BattleUnit::beginTurn(GameState &state)
1390{

Callers 4

advanceFacingMethod · 0.80
advanceBodyStateMethod · 0.80
routineMethod · 0.80
updateHiddenBarMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected