Skip to content

Commit

Permalink
The Celtic People Reboot (#5367)
Browse files Browse the repository at this point in the history
* The Celtic People Reboot

* Redid the Shamrock sword of the Pictish Warrior

* The Celtic People Reboot - one comment

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
  • Loading branch information
SomeTroglodyte and yairm210 authored Oct 3, 2021
1 parent a0f6596 commit 71405b9
Show file tree
Hide file tree
Showing 19 changed files with 966 additions and 844 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/Images/NationIcons/Celts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
408 changes: 211 additions & 197 deletions android/assets/Construction.atlas

Large diffs are not rendered by default.

Binary file modified android/assets/Construction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,152 changes: 583 additions & 569 deletions android/assets/game.atlas

Large diffs are not rendered by default.

Binary file modified android/assets/game.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions android/assets/jsons/Civ V - Vanilla/Buildings.json
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,19 @@
"requiredTech": "Acoustics",
"uniques": ["Destroyed when the city is captured"]
},
{
"name": "Ceilidh Hall",
"replaces": "Opera House",
"uniqueTo": "Celts",
"culture": 4,
"happiness": 3,
"specialistSlots": {"Artist": 1},
"hurryCostModifier": 10,
"requiredBuilding": "Amphitheater",
"maintenance": 2,
"requiredTech": "Acoustics",
"uniques": ["Destroyed when the city is captured"]
},
{
"name": "Sistine Chapel",
"culture": 1,
Expand Down
151 changes: 93 additions & 58 deletions android/assets/jsons/Civ V - Vanilla/Nations.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions android/assets/jsons/Civ V - Vanilla/UnitPromotions.json
Original file line number Diff line number Diff line change
Expand Up @@ -534,5 +534,9 @@
{
"name": "Ignore terrain cost",
"uniques": ["Ignores terrain cost"]
},
{
"name": "Pictish Courage", // only for Pictish Warrior and subsequent upgrades
"uniques": ["No movement cost to pillage", "+[20]% Strength in [Foreign Land]"]
}
]
19 changes: 17 additions & 2 deletions android/assets/jsons/Civ V - Vanilla/Units.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
"requiredTech": "Bronze Working",
"obsoleteTech": "Civil Service",
"upgradesTo": "Pikeman",
"uniques": ["[+50]% Strength <vs [Mounted] units>","[+10] HP when healing"],
"uniques": ["[+50]% Strength <vs [Mounted] units>", "[+10] HP when healing"],
"attackSound": "metalhit"
},
{
Expand All @@ -319,7 +319,22 @@
"-[1] Visibility Range", "Can only attack [City] units"],
"promotions": ["Cover I"],
"attackSound": "throw"
}
},
{
"name": "Pictish Warrior",
"unitType": "Sword",
"replaces": "Spearman",
"uniqueTo": "Celts",
"movement": 2,
"strength": 11,
"cost": 56,
"requiredTech": "Bronze Working",
"obsoleteTech": "Civil Service",
"upgradesTo": "Pikeman",
"uniques": ["Earn [50]% of killed [Military] unit's [Strength] as [Faith]"],
"promotions": ["Pictish Courage"],
"attackSound": "metalhit"
},
/*
{
"name": "Spearman",
Expand Down
5 changes: 2 additions & 3 deletions core/src/com/unciv/logic/city/CityStats.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.unciv.logic.map.RoadStatus
import com.unciv.models.Counter
import com.unciv.models.ruleset.Building
import com.unciv.models.ruleset.ModOptionsConstants
import com.unciv.models.ruleset.unique.StateForConditionals
import com.unciv.models.ruleset.unique.Unique
import com.unciv.models.ruleset.unique.UniqueType
import com.unciv.models.ruleset.unit.BaseUnit
Expand Down Expand Up @@ -224,10 +223,10 @@ class CityStats(val cityInfo: CityInfo) {
if (unique.isOfType(UniqueType.Stats) && unique.conditionalsApply(cityInfo.civInfo, cityInfo)) {
stats.add(unique.stats)
}

if (unique.isOfType(UniqueType.StatsPerCity)
&& cityInfo.matchesFilter(unique.params[1])
&& unique.conditionalsApply(cityInfo.civInfo)
&& unique.conditionalsApply(cityInfo.civInfo, cityInfo)
) {
stats.add(unique.stats)
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/com/unciv/logic/map/TileInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ open class TileInfo {
fun matchesFilter(filter: String, civInfo: CivilizationInfo? = null): Boolean {
if (matchesTerrainFilter(filter, civInfo)) return true
if (improvement != null && ruleset.tileImprovements[improvement]!!.matchesFilter(filter)) return true
return false
return improvement == null && filter == "unimproved"
}

fun matchesTerrainFilter(filter: String, observingCiv: CivilizationInfo? = null): Boolean {
Expand Down
36 changes: 23 additions & 13 deletions core/src/com/unciv/models/ruleset/unique/Unique.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,41 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s
fun conditionalsApply(civInfo: CivilizationInfo? = null, city: CityInfo? = null): Boolean {
return conditionalsApply(StateForConditionals(civInfo, city))
}

fun conditionalsApply(state: StateForConditionals?): Boolean {
if (state == null) return conditionals.isEmpty()
for (condition in conditionals) {
if (!conditionalApplies(condition, state)) return false
}
return true
}

private fun conditionalApplies(
condition: Unique,
state: StateForConditionals
): Boolean {
return when (condition.placeholderText) {
UniqueType.ConditionalNotWar.placeholderText -> state.civInfo?.isAtWar() == false
UniqueType.ConditionalWar.placeholderText -> state.civInfo?.isAtWar() == true
UniqueType.ConditionalSpecialistCount.placeholderText ->
return when (condition.type) {
UniqueType.ConditionalNotWar -> state.civInfo?.isAtWar() == false
UniqueType.ConditionalWar -> state.civInfo?.isAtWar() == true
UniqueType.ConditionalSpecialistCount ->
state.cityInfo != null && state.cityInfo.population.getNumberOfSpecialists() >= condition.params[0].toInt()
UniqueType.ConditionalHappy.placeholderText ->
UniqueType.ConditionalHappy ->
state.civInfo != null && state.civInfo.statsForNextTurn.happiness >= 0
UniqueType.ConditionalVsCity.placeholderText ->
UniqueType.ConditionalVsCity ->
state.defender != null && state.defender.matchesCategory("City")
UniqueType.ConditionalVsUnits.placeholderText ->
UniqueType.ConditionalVsUnits ->
state.defender != null && state.defender.matchesCategory(condition.params[0])
UniqueType.ConditionalNeighborTiles ->
state.cityInfo != null &&
state.cityInfo.getCenterTile().neighbors.count {
it.matchesFilter(condition.params[2], state.civInfo)
} in (condition.params[0].toInt())..(condition.params[1].toInt())
UniqueType.ConditionalNeighborTilesAnd ->
state.cityInfo != null &&
state.cityInfo.getCenterTile().neighbors.count {
it.matchesFilter(condition.params[2], state.civInfo) &&
it.matchesFilter(condition.params[3], state.civInfo)
} in (condition.params[0].toInt())..(condition.params[1].toInt())
else -> false
}
}
Expand All @@ -62,16 +73,15 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s
}


class UniqueMap:HashMap<String, ArrayList<Unique>>() {
class UniqueMap: HashMap<String, ArrayList<Unique>>() {
//todo Once all untyped Uniques are converted, this should be HashMap<UniqueType, *>
fun addUnique(unique: Unique) {
if (!containsKey(unique.placeholderText)) this[unique.placeholderText] = ArrayList()
this[unique.placeholderText]!!.add(unique)
}

fun getUniques(placeholderText: String): Sequence<Unique> {
val result = this[placeholderText]
if (result == null) return sequenceOf()
else return result.asSequence()
return this[placeholderText]?.asSequence() ?: sequenceOf()
}

fun getUniques(uniqueType: UniqueType) = getUniques(uniqueType.placeholderText)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ enum class UniqueParameterType(val parameterName:String) {
return UniqueType.UniqueComplianceErrorSeverity.WarningOnly
}
},
TileFilter("tileFilter") {
private val knownValues = setOf("unimproved", "All Road", "Great Improvement")
override fun getErrorSeverity(parameterText: String, ruleset: Ruleset):
UniqueType.UniqueComplianceErrorSeverity? {
if (parameterText in knownValues) return null
if (ruleset.tileImprovements.containsKey(parameterText)) return null
return TerrainFilter.getErrorSeverity(parameterText, ruleset)
}
},
/** Used by NaturalWonderGenerator, only tests base terrain or a feature */
SimpleTerrain("simpleTerrain") {
private val knownValues = setOf("Elevated", "Water", "Land")
Expand Down
3 changes: 3 additions & 0 deletions core/src/com/unciv/models/ruleset/unique/UniqueType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget) {
// ConditionalAttacking("when attacking", UniqueTarget.Conditional),
// ConditionalDefending("when defending", UniqueTarget.Conditional),
// ConditionalIntercepting("when intercepting", UniqueTarget.Conditional),

ConditionalNeighborTiles("with [amount] to [amount] neighboring [tileFilter] tiles", UniqueTarget.Conditional),
ConditionalNeighborTilesAnd("with [amount] to [amount] neighboring [tileFilter] [tileFilter] tiles", UniqueTarget.Conditional),
;

/** For uniques that have "special" parameters that can accept multiple types, we can override them manually
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ object TranslationFileWriter {
"non-fresh water",
"Open Terrain",
"Rough Terrain",
"Natural Wonder"
"Natural Wonder",
"unimproved"
)) }
val tileImprovementMap = ruleset.tileImprovements.keys.toMutableSet().apply { add("Great Improvement") }
val buildingMap = ruleset.buildings.keys.toMutableSet().apply { addAll(sequenceOf(
Expand Down
5 changes: 5 additions & 0 deletions docs/Credits.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Unless otherwise specified, all the following are from [the Noun Project](https:
* [Spiked club](https://thenounproject.com/search/?q=club%20weapon&creator=1933477&i=831794) for Brute
* [Hoplite](https://www.flaticon.com/free-icon/hoplite_659126#term=hoplite&page=1&position=20) by Eucalyp for Immortal
* [Slingshot](https://thenounproject.com/term/slingshot/9106/) by James Keuning for Slinger
* [warrior](https://thenounproject.com/term/warrior/988830/) By DinosoftLab for Pictish Warrior (combined with Shamrock, see Promotions)

### Classical Era

Expand Down Expand Up @@ -290,6 +291,7 @@ Unless otherwise specified, all the following are from [the Noun Project](https:
* [Mansion](https://www.flaticon.com/free-icon/mansion_509903#term=persian&page=1&position=19) by Freepik for Satrap's Court
* [Bullets](https://thenounproject.com/term/bullets/810156/) By Aldric Rodriguez for Arsenal
* [St. Petersburg](https://thenounproject.com/search/?q=kremlin&i=1569704) By Carpe Diem for Kremlin
* [Ceilidh](https://thenounproject.com/term/ceilidh/403422/) By P Thanga Vignesh for Ceilidh Hall

### Industrial Era

Expand Down Expand Up @@ -561,6 +563,7 @@ Unless otherwise specified, all the following are from [the Noun Project](https:
* [Orthodox Cross](https://thenounproject.com/search/?q=orthodox&i=2069822) by Avana Vana for Byzantium
* [Iroquois](https://github.com/ravignir/5Hex-Tileset/blob/master/Images/NationIcons/Iroquois.png) by Ravignir for Iroquois
* [Songhai](https://github.com/ravignir/5Hex-Tileset/blob/master/Images/NationIcons/Songhai.png) by Ravignir for Songhai
* [Celtic Knot](https://thenounproject.com/term/celtic/168483/) by Ervin Bolat for the Celts


## Promotions
Expand Down Expand Up @@ -594,6 +597,8 @@ Unless otherwise specified, all the following are from [the Noun Project](https:
* [Slingshot](https://thenounproject.com/term/slingshot/9106/) by James Keuning for Slinger Withdraw
* [Anchor](https://thenounproject.com/term/anchor/676586) by Gregor Cresnar for Amphibious
* [survival knife](https://thenounproject.com/search/?q=survival&i=2663392) by b faris for Survivalism
* [Shamrock](https://thenounproject.com/term/shamrock/358507/) By P Thanga Vignesh for Pictish Courage


## Religions

Expand Down

0 comments on commit 71405b9

Please sign in to comment.