mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-11 00:08:58 +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,8 +399,14 @@ object Battle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun postBattleAddXp(attacker: ICombatant, defender: ICombatant) {
|
private fun postBattleAddXp(attacker: ICombatant, defender: ICombatant) {
|
||||||
if (!attacker.isMelee()) { // ranged attack
|
if (attacker.isAirUnit()) {
|
||||||
addXp(attacker, 2, defender)
|
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)
|
addXp(defender, 2, attacker)
|
||||||
} else if (!defender.isCivilian()) // unit was not captured but actually attacked
|
} else if (!defender.isCivilian()) // unit was not captured but actually attacked
|
||||||
{
|
{
|
||||||
@ -804,6 +810,8 @@ object Battle {
|
|||||||
|
|
||||||
attacker.takeDamage(damage)
|
attacker.takeDamage(damage)
|
||||||
interceptor.attacksThisTurn++
|
interceptor.attacksThisTurn++
|
||||||
|
if (damage > 0)
|
||||||
|
addXp(MapUnitCombatant(interceptor), 2, attacker)
|
||||||
|
|
||||||
val attackerName = attacker.getName()
|
val attackerName = attacker.getName()
|
||||||
val interceptorName = interceptor.name
|
val interceptorName = interceptor.name
|
||||||
|
@ -26,6 +26,10 @@ interface ICombatant {
|
|||||||
if (this is CityCombatant) return true
|
if (this is CityCombatant) return true
|
||||||
return (this as MapUnitCombatant).unit.baseUnit.isRanged()
|
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 {
|
fun isCity(): Boolean {
|
||||||
return this is CityCombatant
|
return this is CityCombatant
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user