opbe icon indicating copy to clipboard operation
opbe copied to clipboard

Undeclared engineer officer for your bonus

Open nextweb-sfe opened this issue 7 years ago • 2 comments

The engineer officer is not declared to exercise the bonus of minimizing defensive losses in half as in ogame.

nextweb-sfe avatar Jul 07 '17 21:07 nextweb-sfe

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

Cr3aHal0 avatar Aug 24 '17 15:08 Cr3aHal0

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())));
                }

jonamix-ar avatar Jun 24 '18 14:06 jonamix-ar