Closed jonamix-ar closed 1 month ago
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()
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()
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 $shipType;
private $fighters;
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 thispublic function getDefenderDebris()
remplace all code for thissearch in BattleEngine Folder PhysicShot.php
private $shipType;
add belowprivate $fighters;