update
This commit is contained in:
parent
9f28c2f60d
commit
5e0bbc69df
1 changed files with 2 additions and 2 deletions
|
@ -227,12 +227,12 @@ class BattleDamage{
|
|||
if(defender.getUnitType().isCivilian()) return 0
|
||||
val ratio = getAttackingStrength(attacker,defender) / getDefendingStrength(attacker,defender)
|
||||
val i = if (ratio < 1) -1 else 1
|
||||
return ((24 + 12 * Random().nextFloat()) * ((ratio.pow(i) + 3).pow(4) / 512 + 0.5).pow(i) * getHealthDependantDamageRatio(defender)).toInt()
|
||||
return ((24 + 12 * Random().nextFloat()) * (((ratio.pow(i) + 3).pow(4) / 512 + 0.5).pow(i)) * getHealthDependantDamageRatio(defender)).toInt()
|
||||
}
|
||||
|
||||
fun calculateDamageToDefender(attacker: ICombatant, defender: ICombatant): Int {
|
||||
val ratio = getAttackingStrength(attacker,defender) / getDefendingStrength(attacker,defender)
|
||||
val i = if (ratio < 1) -1 else 1
|
||||
return ((24 + 12 * Random().nextFloat()) * ((ratio.pow(i) + 3).pow(4) / 512 + 0.5).pow(i) * getHealthDependantDamageRatio(attacker)).toInt()
|
||||
return ((24 + 12 * Random().nextFloat()) / (((ratio.pow(i) + 3).pow(4) / 512 + 0.5).pow(i)) * getHealthDependantDamageRatio(attacker)).toInt()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue