Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undeclared engineer officer for your bonus #36

Open
nextweb-sfe opened this issue Jul 7, 2017 · 2 comments
Open

Undeclared engineer officer for your bonus #36

nextweb-sfe opened this issue Jul 7, 2017 · 2 comments

Comments

@nextweb-sfe
Copy link

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

@Cr3aHal0
Copy link

Cr3aHal0 commented Aug 24, 2017

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

@jonamix-ar
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants