MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / getSoldierScore

Method getSoldierScore

src/Savegame/SavedGame.cpp:1390–1398  ·  view source on GitHub ↗

* Evaluate the score of a soldier based on all of his stats, missions and kills. * @param soldier the soldier to get a score for. * @return this soldier's score. */

Source from the content-addressed store, hash-verified

1388 * @return this soldier's score.
1389 */
1390int SavedGame::getSoldierScore(Soldier *soldier)
1391{
1392 UnitStats *s = soldier->getCurrentStats();
1393 int v1 = 2 * s->health + 2 * s->stamina + 4 * s->reactions + 4 * s->bravery;
1394 int v2 = v1 + 3*( s->tu + 2*( s->firing ) );
1395 int v3 = v2 + s->melee + s->throwing + s->strength;
1396 if (s->psiSkill > 0) v3 += s->psiStrength + 2 * s->psiSkill;
1397 return v3 + 10 * ( soldier->getMissions() + soldier->getKills() );
1398}
1399
1400/**
1401 * Returns the list of alien bases.

Callers

nothing calls this directly

Calls 3

getMissionsMethod · 0.80
getKillsMethod · 0.80
getCurrentStatsMethod · 0.45

Tested by

no test coverage detected