* Raises a unit's stun level sufficiently so that the unit is ready to become unconscious. * Used when another unit falls on top of this unit. * Zombified units first convert to their spawn unit. * @param battle Pointer to the battlescape game. */
| 1024 | * @param battle Pointer to the battlescape game. |
| 1025 | */ |
| 1026 | void BattleUnit::knockOut(BattlescapeGame *battle) |
| 1027 | { |
| 1028 | if (getArmor()->getSize() > 1) // large units die |
| 1029 | { |
| 1030 | _health = 0; |
| 1031 | } |
| 1032 | else if (_spawnUnit != "") |
| 1033 | { |
| 1034 | setSpecialAbility(SPECAB_NONE); |
| 1035 | BattleUnit *newUnit = battle->convertUnit(this, _spawnUnit); |
| 1036 | newUnit->knockOut(battle); |
| 1037 | } |
| 1038 | else |
| 1039 | { |
| 1040 | _stunlevel = _health; |
| 1041 | } |
| 1042 | } |
| 1043 | |
| 1044 | /** |
| 1045 | * Intialises the falling sequence. Occurs after death or stunned. |
no test coverage detected