opbe
opbe copied to clipboard
Undeclared engineer officer for your bonus
The engineer officer is not declared to exercise the bonus of minimizing defensive losses in half as in ogame.
Hello,
Just found out this repo and I did not have the time to read it all but if your question is how to handle the bonus from the engineer officer, then you should look at the BattleReport.php file within the getPlayerRepaired method :
$lostShips->decrement($idPlayer, $idFleet, $idShipType, round($shipType->getCount() * (1 - $shipType->getRepairProb())));
I guess you just have to divide the rounded value by 2 to decrease your loss depending on your officer activity or not. Pay attention because this method is called for both fleets and defense loss so you would need to check wether $idShipType is a defense unit type or fleet unit type
perdon por la tardanza pero veo q esta muerto esto
if (Oficial activado --- > 1 ) {
$lostShips->decrement($idPlayer, $idFleet, $idShipType, round($shipType->getCount() * (1 - $shipType->getRepairProb()) / ENGINEER_DEFENSE));
} else {
$lostShips->decrement($idPlayer, $idFleet, $idShipType, round($shipType->getCount() * (1 - $shipType->getRepairProb())));
}