mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 23:39:40 +07:00
Great general provides bonus for nearby friendly land units.
This commit is contained in:
@ -579,7 +579,7 @@
|
||||
name:"Great General",
|
||||
unbuildable:true,
|
||||
unitType:"Civilian",
|
||||
uniques:["Can start an 8-turn golden age","Bonus for landunits in 2 radius 15%"] //to do : should be able to build mega-fort
|
||||
uniques:["Can start an 8-turn golden age","Bonus for land units in 2 radius 15%"] //to do : should be able to build mega-fort
|
||||
movement:2
|
||||
},
|
||||
|
||||
|
@ -61,6 +61,16 @@ class BattleDamage{
|
||||
if(requiredResource!=null && combatant.getCivilization().getCivResourcesByName()[requiredResource]!!<0){
|
||||
modifiers["Missing resource"]=-0.25f
|
||||
}
|
||||
|
||||
//to do : performance improvement
|
||||
if (combatant.getUnitType().isLandUnit()) {
|
||||
val nearbyCivUnits = combatant.unit.getTile().getTilesInDistance(2)
|
||||
.filter {it.civilianUnit?.civInfo == combatant.unit.civInfo}
|
||||
.map {it.civilianUnit}
|
||||
if (nearbyCivUnits.any { it!!.hasUnique("Bonus for land units in 2 radius 15%") }) {
|
||||
modifiers["Great general"]=0.25f
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (combatant.getCivilization().policies.isAdopted("Honor") && enemy.getCivilization().isBarbarianCivilization())
|
||||
|
Reference in New Issue
Block a user