mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-13 01:08:25 +07:00
Fix: barbarians won't enter tiles owned by other civs (#1523)
* Fix: barbarians won't enter tiles owned by other civs * Barbarians ability to enter player tiles is now affected by difficulty setting
This commit is contained in:
@ -18,7 +18,8 @@
|
|||||||
aiFreeTechs:[],
|
aiFreeTechs:[],
|
||||||
aiFreeUnits:[],
|
aiFreeUnits:[],
|
||||||
aiUnhappinessModifier:1,
|
aiUnhappinessModifier:1,
|
||||||
aisExchangeTechs:false
|
aisExchangeTechs:false,
|
||||||
|
turnBarbariansCanEnterPlayerTiles:10000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Chieftain",
|
name:"Chieftain",
|
||||||
@ -39,7 +40,8 @@
|
|||||||
aiFreeTechs:[],
|
aiFreeTechs:[],
|
||||||
aiFreeUnits:[],
|
aiFreeUnits:[],
|
||||||
aiUnhappinessModifier:1,
|
aiUnhappinessModifier:1,
|
||||||
aisExchangeTechs:false
|
aisExchangeTechs:false,
|
||||||
|
turnBarbariansCanEnterPlayerTiles:60
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Warlord",
|
name:"Warlord",
|
||||||
@ -60,7 +62,8 @@
|
|||||||
aiFreeTechs:[],
|
aiFreeTechs:[],
|
||||||
aiFreeUnits:[],
|
aiFreeUnits:[],
|
||||||
aiUnhappinessModifier:1,
|
aiUnhappinessModifier:1,
|
||||||
aisExchangeTechs:false
|
aisExchangeTechs:false,
|
||||||
|
turnBarbariansCanEnterPlayerTiles:20
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Prince",
|
name:"Prince",
|
||||||
@ -81,7 +84,8 @@
|
|||||||
aiFreeTechs:[],
|
aiFreeTechs:[],
|
||||||
aiFreeUnits:[],
|
aiFreeUnits:[],
|
||||||
aiUnhappinessModifier:1,
|
aiUnhappinessModifier:1,
|
||||||
aisExchangeTechs:true
|
aisExchangeTechs:true,
|
||||||
|
turnBarbariansCanEnterPlayerTiles:0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"King",
|
name:"King",
|
||||||
@ -102,7 +106,8 @@
|
|||||||
aiFreeTechs:["Pottery"],
|
aiFreeTechs:["Pottery"],
|
||||||
aiFreeUnits:["Warrior"],
|
aiFreeUnits:["Warrior"],
|
||||||
aiUnhappinessModifier:0.9,
|
aiUnhappinessModifier:0.9,
|
||||||
aisExchangeTechs:true
|
aisExchangeTechs:true,
|
||||||
|
turnBarbariansCanEnterPlayerTiles:0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Emperor",
|
name:"Emperor",
|
||||||
@ -123,7 +128,8 @@
|
|||||||
aiFreeTechs:["Pottery","Animal Husbandry"],
|
aiFreeTechs:["Pottery","Animal Husbandry"],
|
||||||
aiFreeUnits:["Warrior", "Scout"],
|
aiFreeUnits:["Warrior", "Scout"],
|
||||||
aiUnhappinessModifier:0.85,
|
aiUnhappinessModifier:0.85,
|
||||||
aisExchangeTechs:true
|
aisExchangeTechs:true,
|
||||||
|
turnBarbariansCanEnterPlayerTiles:0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Immortal",
|
name:"Immortal",
|
||||||
@ -144,7 +150,8 @@
|
|||||||
aiFreeTechs:["Pottery","Animal Husbandry","Mining"],
|
aiFreeTechs:["Pottery","Animal Husbandry","Mining"],
|
||||||
aiFreeUnits:["Warrior", "Warrior", "Worker", "Scout"],
|
aiFreeUnits:["Warrior", "Warrior", "Worker", "Scout"],
|
||||||
aiUnhappinessModifier:0.75,
|
aiUnhappinessModifier:0.75,
|
||||||
aisExchangeTechs:true
|
aisExchangeTechs:true,
|
||||||
|
turnBarbariansCanEnterPlayerTiles:0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Deity",
|
name:"Deity",
|
||||||
@ -165,6 +172,7 @@
|
|||||||
aiFreeTechs:["Pottery","Animal Husbandry","Mining","The Wheel"],
|
aiFreeTechs:["Pottery","Animal Husbandry","Mining","The Wheel"],
|
||||||
aiFreeUnits:["Settler", "Warrior", "Warrior", "Worker", "Worker", "Scout"],
|
aiFreeUnits:["Settler", "Warrior", "Warrior", "Worker", "Worker", "Scout"],
|
||||||
aiUnhappinessModifier:0.6,
|
aiUnhappinessModifier:0.6,
|
||||||
aisExchangeTechs:true
|
aisExchangeTechs:true,
|
||||||
|
turnBarbariansCanEnterPlayerTiles:0
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -422,6 +422,7 @@ class CivilizationInfo {
|
|||||||
|
|
||||||
fun canEnterTiles(otherCiv: CivilizationInfo): Boolean {
|
fun canEnterTiles(otherCiv: CivilizationInfo): Boolean {
|
||||||
if(otherCiv==this) return true
|
if(otherCiv==this) return true
|
||||||
|
if(nation.isBarbarian() && gameInfo.turns >= gameInfo.difficultyObject.turnBarbariansCanEnterPlayerTiles) return true
|
||||||
if(!diplomacy.containsKey(otherCiv.civName)) // not encountered yet
|
if(!diplomacy.containsKey(otherCiv.civName)) // not encountered yet
|
||||||
return false
|
return false
|
||||||
if(isAtWarWith(otherCiv)) return true
|
if(isAtWarWith(otherCiv)) return true
|
||||||
|
@ -23,4 +23,5 @@ class Difficulty: INamed {
|
|||||||
var aiFreeUnits = ArrayList<String>()
|
var aiFreeUnits = ArrayList<String>()
|
||||||
var aiUnhappinessModifier = 1f
|
var aiUnhappinessModifier = 1f
|
||||||
var aisExchangeTechs = false
|
var aisExchangeTechs = false
|
||||||
|
var turnBarbariansCanEnterPlayerTiles = 0
|
||||||
}
|
}
|
Reference in New Issue
Block a user