* 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. */
| 1388 | * @return this soldier's score. |
| 1389 | */ |
| 1390 | int 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. |
nothing calls this directly
no test coverage detected