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

[FIX] Battle Engine Report combat #595

Open
jonamix-ar opened this issue Feb 12, 2024 · 0 comments
Open

[FIX] Battle Engine Report combat #595

jonamix-ar opened this issue Feb 12, 2024 · 0 comments

Comments

@jonamix-ar
Copy link

jonamix-ar commented Feb 12, 2024

Based now on the new XGP or PSR-12 file location you decide to implement this

Search BattleReport.php y BattleEngine

use App\Libraries\BattleEngine\Utils\Math;

add Below

use App\Libraries\Functions;

public function getAttackerDebris() Replace all code for this

public function getAttackerDebris()
    {
        $sendMetal = 0;
        $sendCrystal = 0;
        foreach ($this->getAttackersLostUnits(!REPAIRED_DO_DEBRIS) as $idPlayer => $player) {
            foreach ($player as $idFleet => $fleet) {
                foreach ($fleet as $role => $values) {
                    $metal = 0;
                    $crystal = 0;
                    foreach ($values as $idShipType => $lost) {
                        $metal += $lost[0];
                        $crystal += $lost[1];
                    }
                    $factor = Functions::readConfig('fleet_cdr') / 100;
                    $sendMetal += $metal * $factor;
                    $sendCrystal += $crystal * $factor;
                }
            }
        }
        return [$sendMetal, $sendCrystal];
    }

public function getDefenderDebris() remplace all code for this

public function getDefenderDebris()
    {
        $sendMetal = 0;
        $sendCrystal = 0;
        foreach ($this->getDefendersLostUnits(!REPAIRED_DO_DEBRIS) as $idPlayer => $player) {
            foreach ($player as $idFleet => $fleet) {
                foreach ($fleet as $role => $values) {
                    $metal = 0;
                    $crystal = 0;
                    foreach ($values as $idShipType => $lost) {
                        $metal += $lost[0];
                        $crystal += $lost[1];
                    }
                    $factor = Functions::readConfig('defs_cdr') / 100;
                    $sendMetal += $metal * $factor;
                    $sendCrystal += $crystal * $factor;
                }
            }
        }
        return [$sendMetal, $sendCrystal];
    }

search in BattleEngine Folder PhysicShot.php

private $shipType; add below

private $fighters;

image
image

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

1 participant