mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 15:29:32 +07:00
Updating XP Rewards. Interception now gives XP (#6543)
* Updating XP Rewards to match Civ5 Add isAirUnit() Boolean for ICombatant * Revert Melee XP Co-authored-by: itanasi <spellman23@gmail.com>
This commit is contained in:
@ -399,7 +399,13 @@ object Battle {
|
||||
}
|
||||
|
||||
private fun postBattleAddXp(attacker: ICombatant, defender: ICombatant) {
|
||||
if (!attacker.isMelee()) { // ranged attack
|
||||
if (attacker.isAirUnit()) {
|
||||
addXp(attacker, 4, defender)
|
||||
addXp(defender, 2, attacker)
|
||||
} else if (attacker.isRanged()) { // ranged attack
|
||||
if(defender.isCity())
|
||||
addXp(attacker, 3, defender)
|
||||
else
|
||||
addXp(attacker, 2, defender)
|
||||
addXp(defender, 2, attacker)
|
||||
} else if (!defender.isCivilian()) // unit was not captured but actually attacked
|
||||
@ -804,6 +810,8 @@ object Battle {
|
||||
|
||||
attacker.takeDamage(damage)
|
||||
interceptor.attacksThisTurn++
|
||||
if (damage > 0)
|
||||
addXp(MapUnitCombatant(interceptor), 2, attacker)
|
||||
|
||||
val attackerName = attacker.getName()
|
||||
val interceptorName = interceptor.name
|
||||
|
@ -26,6 +26,10 @@ interface ICombatant {
|
||||
if (this is CityCombatant) return true
|
||||
return (this as MapUnitCombatant).unit.baseUnit.isRanged()
|
||||
}
|
||||
fun isAirUnit(): Boolean {
|
||||
if (this is CityCombatant) return false
|
||||
return (this as MapUnitCombatant).unit.baseUnit.isAirUnit()
|
||||
}
|
||||
fun isCity(): Boolean {
|
||||
return this is CityCombatant
|
||||
}
|
||||
|
Reference in New Issue
Block a user