jstar88 / opbe

Ogame probabilistic battle engine
GNU Affero General Public License v3.0
76 stars 29 forks source link

Increase the attack power #35

Closed noonn closed 3 years ago

noonn commented 7 years ago

Hello. jstar88 How are you? I have a question. My 2moons version is 1.3 My english is no good. sorry...^^

From basic attack power... (var.php)

Can I increase the attack power of the Attacker battle_ship + 10% and the Defender's light_hunter attack power + 20% in battle?

The bottom line is that in battle I want to add an increase in attack power to each attacker & defender's fleet or defense facility.

Is it possible?

jstar88 commented 3 years ago

yes, in core/Battle.php

...
//------your code----- $idPlayer is target ID player to increment power, and $idShip is your battle_ship ID (such as 202)
foreach ($this->attackers->getPlayer($idPlayer)->getIterator() as $idFleet => $fleet)
{
         $fleet->getShipType($idShip)->originalPower *= 1.1;
}
//----------------------
...            
//initialize the round
$round = new Round($this->attackers, $this->defenders, $i);
$round->startRound();