Add Great Admiral

This commit is contained in:
Rob Loach 2025-07-31 16:53:46 -04:00
parent 01a4025287
commit 4a65d9381d
No known key found for this signature in database
GPG Key ID: 627C60834A74A21A
9 changed files with 387 additions and 335 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 906 KiB

After

Width:  |  Height:  |  Size: 904 KiB

View File

@ -9,6 +9,7 @@
"Cannot build [Settler] units <when below [-10] [Happiness]>", "Cannot build [Settler] units <when below [-10] [Happiness]>",
"Rebel units may spawn <when below [-20] [Happiness]>", "Rebel units may spawn <when below [-20] [Happiness]>",
"[-1] Sight <for [Embarked] units>", "[-1] Sight <for [Embarked] units>",
"Enables [Great Admiral] units to enter ocean tiles",
// TODO: Implement the uniques below // TODO: Implement the uniques below
// "[+20]% [Culture] [in all cities] <during a golden age>", // "[+20]% [Culture] [in all cities] <during a golden age>",

View File

@ -1658,6 +1658,17 @@
"Great Person - [War]", "Unbuildable", "Uncapturable"], "Great Person - [War]", "Unbuildable", "Uncapturable"],
"movement": 5 "movement": 5
}, },
{
"name": "Great Admiral",
"unitType": "Civilian Water",
"uniques": [
"[+15]% Strength bonus for [{Military} {Water}] units within [2] tiles",
"[Target Unit] heals [100] HP <targeting [Water] units within [1] tiles> <by consuming this unit>",
"Can be earned through combat",
"Is part of Great Person group [Admiral]",
"Great Person - [War]", "Unbuildable", "Uncapturable"],
"movement": 4
},
/* Religious units */ /* Religious units */

View File

@ -87,7 +87,8 @@ object UniqueTriggerActivation {
unit: MapUnit? = null, unit: MapUnit? = null,
tile: Tile? = city?.getCenterTile() ?: unit?.currentTile, tile: Tile? = city?.getCenterTile() ?: unit?.currentTile,
notification: String? = null, notification: String? = null,
triggerNotificationText: String? = null triggerNotificationText: String? = null,
ignoreMultiModifiers: Boolean = false
): (()->Boolean)? { ): (()->Boolean)? {
val relevantCity by lazy { val relevantCity by lazy {
@ -119,6 +120,27 @@ object UniqueTriggerActivation {
else Random(-550) // Very random indeed else Random(-550) // Very random indeed
val ruleset = civInfo.gameInfo.ruleset val ruleset = civInfo.gameInfo.ruleset
// Modifier trigger to iterate through multiple units
if (unique.hasModifier(UniqueType.TargetingUnitsWithinTiles) && !ignoreMultiModifiers) {
val modifiers = unique.getModifiers(UniqueType.TargetingUnitsWithinTiles)
if (tile != null) {
val triggerFunctions = modifiers.flatMap {
val mapUnitFilter = it.params[0]
tile.getTilesInDistance(it.params[1].toInt())
.flatMap { it.getUnits() }
.filter { it.matchesFilter(mapUnitFilter) }
.mapNotNull { getTriggerFunction(unique, civInfo, city, it, it.getTile(), notification, triggerNotificationText, true) }
}
if (triggerFunctions.none()) return null
return {
for (triggerFunction in triggerFunctions) {
triggerFunction.invoke()
}
true
}
} else return null
}
when (unique.type) { when (unique.type) {
UniqueType.TriggerEvent -> { UniqueType.TriggerEvent -> {
val event = ruleset.events[unique.params[0]] ?: return null val event = ruleset.events[unique.params[0]] ?: return null

View File

@ -969,6 +969,9 @@ enum class UniqueType(
///////////////////////////////////////////// region 90 META ///////////////////////////////////////////// ///////////////////////////////////////////// region 90 META /////////////////////////////////////////////
TargetingUnitsWithinTiles("targeting [mapUnitFilter] units within [positiveAmount] tiles", UniqueTarget.MetaModifier,
docDescription = "Modifies this unique to activate on each of the given units within the certain amount of tiles"),
ConditionalTimedUnique("for [nonNegativeAmount] turns", UniqueTarget.MetaModifier, ConditionalTimedUnique("for [nonNegativeAmount] turns", UniqueTarget.MetaModifier,
docDescription = "Turns this unique into a trigger, activating this unique as a *global* unique for a number of turns"), docDescription = "Turns this unique into a trigger, activating this unique as a *global* unique for a number of turns"),

View File

@ -160,6 +160,7 @@ Unless otherwise specified, all the following are from [the Noun Project](https:
- [General](https://thenounproject.com/icon/general-933566) By anbileru adaleru for Great General - [General](https://thenounproject.com/icon/general-933566) By anbileru adaleru for Great General
- [Religion](https://thenounproject.com/icon/preach-53064) by Bruno Gätjens González adapted for Missionary - [Religion](https://thenounproject.com/icon/preach-53064) by Bruno Gätjens González adapted for Missionary
- [invisibility cloak ](https://thenounproject.com/term/invisibility-cloak/1419648/) by Locad for Inquisitor - [invisibility cloak ](https://thenounproject.com/term/invisibility-cloak/1419648/) by Locad for Inquisitor
- [Anchor](https://thenounproject.com/icon/anchor-7764100/) by M. Adebadal for Great Admiral
### Units - AbsoluteUnits unitset images ### Units - AbsoluteUnits unitset images

View File

@ -3848,6 +3848,13 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Modifiers that can be added to other uniques changing user experience, not their behavior Modifiers that can be added to other uniques changing user experience, not their behavior
??? example "&lt;targeting [mapUnitFilter] units within [positiveAmount] tiles&gt;"
Modifies this unique to activate on each of the given units within the certain amount of tiles
Example: "&lt;targeting [Wounded] units within [3] tiles&gt;"
Applicable to: MetaModifier
??? example "&lt;for [nonNegativeAmount] turns&gt;" ??? example "&lt;for [nonNegativeAmount] turns&gt;"
Turns this unique into a trigger, activating this unique as a *global* unique for a number of turns Turns this unique into a trigger, activating this unique as a *global* unique for a number of turns