Hey.. how does the nation bonus work? I don't see it add the bonus to my troops offense/defense.
in functions.php
If you want the bonuses to add to the # of troops, you use this code:
line 68 should be
Code:
$power = $power + $player[pTroops] * ((100 + $player[nOffense] + $player[oPower]) / 100);
and line 94 should be
Code:
$power = $power + $player[pTroops] * ((100 + $player[nDefense] + $player[dPower]) / 100);
for proper addition of all bonuses and armors/weapons.
The problem with the original code:
Code:
$power = 1 + $player[pTroops] + $power * ((100 + $player[nOffense] + $player[oPower]) / 100);
is that the 2nd instance of $power (which is the item bonus from buying), if it is 0 meaning you have not bought an item yet, will null the entire equation after it because math rule is that multiplication goes first. Since 0 * ((100 + $player[nOffense] + $player[oPower]) / 100) = 0. Also the 1 in the equation is useless
If you want the bonuses to add to the item attk/defense power + # of troops, you use this code:
line 68 should be
Code:
$power = ($power + $player[pTroops]) * ((100 + $player[nOffense] + $player[oPower]) / 100);
and line 94 should be
Code:
$power = ($power + $player[pTroops]) * ((100 + $player[nDefense] + $player[dPower]) / 100);