mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-13 19:39:34 +07:00
More uniquetyping
This commit is contained in:
parent
0171ad168f
commit
82236fe2c8
@ -88,7 +88,7 @@ object BattleDamage {
|
||||
.flatMap { it.getUnits() }.filter { it.civInfo == combatant.unit.civInfo }
|
||||
if (nearbyCivUnits.any { it.hasUnique("Bonus for units in 2 tile radius 15%") }) {
|
||||
val greatGeneralModifier =
|
||||
if (combatant.unit.civInfo.hasUnique("Great General provides double combat bonus")) 30 else 15
|
||||
if (combatant.unit.civInfo.hasUnique(UniqueType.GreatGeneralProvidesDoubleCombatBonus)) 30 else 15
|
||||
|
||||
modifiers["Great General"] = greatGeneralModifier
|
||||
}
|
||||
@ -253,7 +253,7 @@ object BattleDamage {
|
||||
|
||||
private fun getHealthDependantDamageRatio(combatant: ICombatant): Float {
|
||||
return if (combatant !is MapUnitCombatant // is city
|
||||
|| (combatant.getCivInfo().hasUnique("Units fight as though they were at full strength even when damaged")
|
||||
|| (combatant.getCivInfo().hasUnique(UniqueType.UnitsFightFullStrengthWhenDamaged)
|
||||
&& !combatant.unit.baseUnit.movesLikeAirUnits()
|
||||
)
|
||||
) {
|
||||
|
@ -181,7 +181,7 @@ class CityInfo {
|
||||
val cityName = nationCities[cityNameIndex]
|
||||
|
||||
val cityNameRounds = civInfo.citiesCreated / nationCities.size
|
||||
if (cityNameRounds > 0 && civInfo.hasUnique("\"Borrows\" city names from other civilizations in the game")) {
|
||||
if (cityNameRounds > 0 && civInfo.hasUnique(UniqueType.BorrowsCityNames)) {
|
||||
name = borrowCityName()
|
||||
return
|
||||
}
|
||||
|
@ -399,7 +399,7 @@ class CityStats(val cityInfo: CityInfo) {
|
||||
unhappinessModifier *= civInfo.gameInfo.getDifficulty().aiUnhappinessModifier
|
||||
|
||||
var unhappinessFromCity = -3f // -3 happiness per city
|
||||
if (civInfo.hasUnique("Unhappiness from number of Cities doubled"))
|
||||
if (civInfo.hasUnique(UniqueType.UnhappinessFromCitiesDoubled))
|
||||
unhappinessFromCity *= 2f //doubled for the Indian
|
||||
|
||||
newHappinessList["Cities"] = unhappinessFromCity * unhappinessModifier
|
||||
|
@ -127,7 +127,7 @@ class CivInfoTransientUpdater(val civInfo: CivilizationInfo) {
|
||||
goldGained += 500
|
||||
}
|
||||
|
||||
if (civInfo.hasUnique("100 Gold for discovering a Natural Wonder (bonus enhanced to 500 Gold if first to discover it)")) {
|
||||
if (civInfo.hasUnique(UniqueType.GoldWhenDiscoveringNaturalWonder)) {
|
||||
goldGained += if (discoveredNaturalWonders.contains(tile.naturalWonder!!)) 100 else 500
|
||||
}
|
||||
|
||||
|
@ -289,7 +289,7 @@ class DiplomacyManager() {
|
||||
|
||||
var modifierPercent = 0f
|
||||
|
||||
if (otherCiv().hasUnique("City-State Influence recovers at twice the normal rate"))
|
||||
if (otherCiv().hasUnique(UniqueType.CityStateInfluenceRecoversTwiceNormalRate))
|
||||
modifierPercent += 100f
|
||||
|
||||
val religion = if (civInfo.cities.isEmpty()) null
|
||||
@ -355,7 +355,7 @@ class DiplomacyManager() {
|
||||
*/
|
||||
fun isConsideredFriendlyTerritory(): Boolean {
|
||||
if (civInfo.isCityState() &&
|
||||
(relationshipLevel() >= RelationshipLevel.Friend || otherCiv().hasUnique("City-State territory always counts as friendly territory")))
|
||||
(relationshipLevel() >= RelationshipLevel.Friend || otherCiv().hasUnique(UniqueType.CityStateTerritoryAlwaysFriendly)))
|
||||
return true
|
||||
return hasOpenBorders
|
||||
}
|
||||
|
@ -735,7 +735,7 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
|
||||
civInfo.updateHasActiveGreatWall()
|
||||
|
||||
// Korean unique - apparently gives the same as the research agreement
|
||||
if (science > 0 && civInfo.hasUnique("Receive a tech boost when scientific buildings/wonders are built in capital"))
|
||||
if (science > 0 && civInfo.hasUnique(UniqueType.TechBoostWhenScientificBuildingsBuiltInCapital))
|
||||
civInfo.tech.addScience(civInfo.tech.scienceOfLast8Turns.sum() / 8)
|
||||
|
||||
cityConstructions.cityInfo.cityStats.update() // new building, new stats
|
||||
|
@ -144,7 +144,7 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
||||
CityStateLuxuryHappiness("[amount]% Happiness from luxury resources gifted by City-States", UniqueTarget.Global),
|
||||
@Deprecated("as of 3.18.17", ReplaceWith("[+amount]% Happiness from luxury resources gifted by City-States"))
|
||||
CityStateLuxuryHappinessDeprecated("Happiness from Luxury Resources gifted by City-States increased by [amount]%", UniqueTarget.Global),
|
||||
|
||||
CityStateInfluenceRecoversTwiceNormalRate("City-State Influence recovers at twice the normal rate", UniqueTarget.Global),
|
||||
// endregion
|
||||
|
||||
/////// region Other global uniques
|
||||
@ -241,7 +241,14 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
||||
|
||||
EnablesConstructionOfSpaceshipParts("Enables construction of Spaceship parts", UniqueTarget.Global),
|
||||
|
||||
// Misc national uniques
|
||||
NotifiedOfBarbarianEncampments("Notified of new Barbarian encampments", UniqueTarget.Global),
|
||||
BorrowsCityNames("\"Borrows\" city names from other civilizations in the game", UniqueTarget.Global),
|
||||
UnitsFightFullStrengthWhenDamaged("Units fight as though they were at full strength even when damaged", UniqueTarget.Global),
|
||||
GoldWhenDiscoveringNaturalWonder("100 Gold for discovering a Natural Wonder (bonus enhanced to 500 Gold if first to discover it)", UniqueTarget.Global),
|
||||
UnhappinessFromCitiesDoubled("Unhappiness from number of Cities doubled", UniqueTarget.Global),
|
||||
GreatGeneralProvidesDoubleCombatBonus("Great General provides double combat bonus", UniqueTarget.Global),
|
||||
TechBoostWhenScientificBuildingsBuiltInCapital("Receive a tech boost when scientific buildings/wonders are built in capital", UniqueTarget.Global),
|
||||
|
||||
EnablesOpenBorders("Enables Open Borders agreements", UniqueTarget.Global),
|
||||
// Should the 'R' in 'Research agreements' be capitalized?
|
||||
|
@ -185,6 +185,9 @@ Example: "[20]% Happiness from luxury resources gifted by City-States"
|
||||
|
||||
Applicable to: Global
|
||||
|
||||
#### City-State Influence recovers at twice the normal rate
|
||||
Applicable to: Global
|
||||
|
||||
#### [amount] units cost no maintenance
|
||||
Example: "[20] units cost no maintenance"
|
||||
|
||||
@ -384,6 +387,24 @@ Applicable to: Global
|
||||
#### Notified of new Barbarian encampments
|
||||
Applicable to: Global
|
||||
|
||||
#### "Borrows" city names from other civilizations in the game
|
||||
Applicable to: Global
|
||||
|
||||
#### Units fight as though they were at full strength even when damaged
|
||||
Applicable to: Global
|
||||
|
||||
#### 100 Gold for discovering a Natural Wonder (bonus enhanced to 500 Gold if first to discover it)
|
||||
Applicable to: Global
|
||||
|
||||
#### Unhappiness from number of Cities doubled
|
||||
Applicable to: Global
|
||||
|
||||
#### Great General provides double combat bonus
|
||||
Applicable to: Global
|
||||
|
||||
#### Receive a tech boost when scientific buildings/wonders are built in capital
|
||||
Applicable to: Global
|
||||
|
||||
#### Enables Open Borders agreements
|
||||
Applicable to: Global
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user