mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
incrementing player stats
This commit is contained in:
@@ -145,9 +145,23 @@ namespace battleship{
|
||||
|
||||
Unit *targetUnit = orders[0].targets[0].unit;
|
||||
|
||||
if(targetUnit)
|
||||
if(targetUnit){
|
||||
targetUnit->takeDamage(damage);
|
||||
|
||||
if(targetUnit->getHealth() <= DEATH_HP){
|
||||
Player *targUnitPlayer = targetUnit->getPlayer();
|
||||
|
||||
if(targetUnit->isVehicle()){
|
||||
player->incVehiclesDestroyed();
|
||||
targUnitPlayer->incVehiclesLost();
|
||||
}
|
||||
else{
|
||||
player->incStructuresDestroyed();
|
||||
targUnitPlayer->incStructuresLost();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lastFireTime = getTime();
|
||||
}
|
||||
|
||||
@@ -187,7 +201,7 @@ namespace battleship{
|
||||
for(GarrisonSlot &slot : garrisonSlots)
|
||||
displayUnitStats(slot.foreground, slot.background, (int)((bool)slot.vehicle), (int)true, mainPlayerSelecting, slot.offset);
|
||||
|
||||
if (health <= 0)
|
||||
if (health <= DEATH_HP)
|
||||
blowUp();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user