mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
-"Unable to capture cities" unique prevents the unit from conquering/capturing a city. (#3309)
-Units with "All tiles costs 1" unique now spend all movement points when embarking. Technically, in CIV 5, helicopters do not embark or spend all movement units when moving to water, if embarkation (Optics) isn't researched. IMO, though, it is so unlikely that someone will have helicopters researched but not embarkation, that I don't think it is worth editing the code for this fringe case.
This commit is contained in:
parent
247350d6a1
commit
88ac6330dc
@ -63,7 +63,7 @@ object Battle {
|
||||
postBattleNationUniques(defender, attackedTile, attacker)
|
||||
|
||||
// This needs to come BEFORE the move-to-tile, because if we haven't conquered it we can't move there =)
|
||||
if (defender.isDefeated() && defender is CityCombatant && attacker.isMelee())
|
||||
if (defender.isDefeated() && defender is CityCombatant && attacker is MapUnitCombatant && attacker.isMelee() && !attacker.unit.hasUnique("Unable to capture cities"))
|
||||
conquerCity(defender.city, attacker)
|
||||
|
||||
// we're a melee unit and we destroyed\captured an enemy unit
|
||||
|
@ -8,12 +8,14 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
|
||||
|
||||
// This function is called ALL THE TIME and should be as time-optimal as possible!
|
||||
fun getMovementCostBetweenAdjacentTiles(from: TileInfo, to: TileInfo, civInfo: CivilizationInfo): Float {
|
||||
if (unit.allTilesCosts1)
|
||||
return 1f
|
||||
|
||||
if ((from.isLand != to.isLand) && !unit.civInfo.nation.embarkDisembarkCosts1 && unit.type.isLandUnit())
|
||||
return 100f // this is embarkment or disembarkment, and will take the entire turn
|
||||
|
||||
// land units will still spend all movement points to embark even with this unique
|
||||
if (unit.allTilesCosts1)
|
||||
return 1f
|
||||
|
||||
var extraCost = 0f
|
||||
|
||||
val toOwner = to.getOwner()
|
||||
|
Loading…
x
Reference in New Issue
Block a user