mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Conquistadors only settle other continents (#5566)
* conquistadors only settle other continents * make it a conditional
This commit is contained in:
parent
04196974a4
commit
446c3fb97a
@ -617,7 +617,7 @@
|
||||
"requiredResource": "Horses",
|
||||
"upgradesTo": "Cavalry",
|
||||
"obsoleteTech": "Military Science",
|
||||
"uniques": ["Can move after attacking","No defensive terrain bonus", "Founds a new city", "[+2] Sight", "Defense bonus when embarked"],
|
||||
"uniques": ["Can move after attacking","No defensive terrain bonus", "Founds a new city <on foreign continents>", "[+2] Sight", "Defense bonus when embarked"],
|
||||
"attackSound": "horse"
|
||||
//Conquistador should have no penalty attacking cities
|
||||
//Ability to found new cities can only be used on a foreign continent that does not contain the Spanish capital.
|
||||
|
@ -82,6 +82,9 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s
|
||||
val theirCities = state.theirCombatant?.getCivInfo()?.cities?.size ?: 0
|
||||
yourCities < theirCities
|
||||
}
|
||||
UniqueType.ConditionalForeignContinent -> state.unit != null &&
|
||||
(state.unit.civInfo.cities.isEmpty() ||
|
||||
state.unit.civInfo.getCapital().getCenterTile().getContinent() != state.unit.getTile().getContinent())
|
||||
|
||||
UniqueType.ConditionalNeighborTiles ->
|
||||
state.cityInfo != null &&
|
||||
|
@ -363,6 +363,7 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget) {
|
||||
ConditionalAttacking("when attacking", UniqueTarget.Conditional),
|
||||
ConditionalDefending("when defending", UniqueTarget.Conditional),
|
||||
ConditionalInTiles("when fighting in [tileFilter] tiles", UniqueTarget.Conditional),
|
||||
ConditionalForeignContinent("on foreign continents", UniqueTarget.Conditional),
|
||||
|
||||
/////// tile conditionals
|
||||
ConditionalNeighborTiles("with [amount] to [amount] neighboring [tileFilter] tiles", UniqueTarget.Conditional),
|
||||
|
@ -16,6 +16,7 @@ import com.unciv.models.UncivSound
|
||||
import com.unciv.models.UnitAction
|
||||
import com.unciv.models.UnitActionType
|
||||
import com.unciv.models.ruleset.Building
|
||||
import com.unciv.models.ruleset.unique.StateForConditionals
|
||||
import com.unciv.models.ruleset.unique.UniqueType
|
||||
import com.unciv.models.stats.Stat
|
||||
import com.unciv.models.stats.Stats
|
||||
@ -161,7 +162,10 @@ object UnitActions {
|
||||
* (no movement left, too close to another city).
|
||||
*/
|
||||
fun getFoundCityAction(unit: MapUnit, tile: TileInfo): UnitAction? {
|
||||
if (!unit.hasUnique(UniqueType.FoundCity) || tile.isWater || tile.isImpassible()) return null
|
||||
if (!(unit.hasUnique(UniqueType.FoundCity))
|
||||
|| tile.isWater || tile.isImpassible()) return null
|
||||
// Spain should still be able to build Conquistadors in a one city challenge - but can't settle them
|
||||
if (unit.civInfo.isOneCityChallenger() && unit.civInfo.hasEverOwnedOriginalCapital == true) return null
|
||||
|
||||
if (unit.currentMovement <= 0 ||
|
||||
!tile.canBeSettled())
|
||||
|
Loading…
x
Reference in New Issue
Block a user