Ancient Ruins can now provide Culture

This commit is contained in:
Yair Morgenstern 2020-08-10 23:12:02 +03:00
parent 2e0d73cf75
commit 3b2e813523
4 changed files with 13 additions and 3 deletions

View file

@ -463,6 +463,7 @@ The City-State of [name] has been destroyed! =
We have captured a barbarian encampment and recovered [goldAmount] gold! =
A barbarian [unitType] has joined us! =
We have found survivors in the ruins - population added to [cityName] =
We have discovered cultural artifacts in the ruins! (+20 Culture) =
We have discovered the lost technology of [techName] in the ruins! =
A [unitName] has joined us! =
An ancient tribe trains our [unitName] in their ways of combat! =

View file

@ -224,8 +224,8 @@ object Battle {
if(barbarianUnit.isDefeated() && barbarianUnit is MapUnitCombatant
&& barbarianUnit.getCivInfo().isBarbarian()
&& civUnit.getCivInfo().hasUnique("Gain Culture when you kill a barbarian unit"))
civUnit.getCivInfo().policies.storedCulture +=
max(barbarianUnit.unit.baseUnit.strength,barbarianUnit.unit.baseUnit.rangedStrength)
civUnit.getCivInfo().policies.addCulture(
max(barbarianUnit.unit.baseUnit.strength, barbarianUnit.unit.baseUnit.rangedStrength))
}
// XP!

View file

@ -56,11 +56,15 @@ class PolicyManager {
tryAddLegalismBuildings()
}
fun endTurn(culture: Int) {
fun addCulture(culture: Int){
val couldAdoptPolicyBefore = canAdoptPolicy()
storedCulture += culture
if (!couldAdoptPolicyBefore && canAdoptPolicy())
shouldOpenPolicyPicker = true
}
fun endTurn(culture: Int) {
addCulture(culture)
if (autocracyCompletedTurns > 0)
autocracyCompletedTurns -= 1
}

View file

@ -595,6 +595,11 @@ class MapUnit {
civInfo.addNotification("We have found a stash of [$amount] gold in the ruins!",tile.position, Color.GOLD)
}
actions.add {
civInfo.policies.addCulture(20)
civInfo.addNotification("We have discovered cultural artifacts in the ruins! (+20 Culture)",tile.position, Color.GOLD)
}
// Map of the surrounding area
actions.add {
val revealCenter = tile.getTilesAtDistance(ANCIENT_RUIN_MAP_REVEAL_OFFSET).toList().random(tileBasedRandom)