diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index b0c8c55b49035..fad01c5e73f49 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt @@ -348,6 +348,7 @@ enum class UniqueType( // Unit actions should look like: "Can {action description}, to allow them to be combined with modifiers FoundCity("Founds a new city", UniqueTarget.UnitAction), + FoundPuppetCity("Founds a new puppet city", UniqueTarget.UnitAction), ConstructImprovementInstantly("Can instantly construct a [improvementFilter] improvement", UniqueTarget.UnitAction), // TODO: Should be replaced by "Can instantly construct a [] improvement " CreateWaterImprovements("May create improvements on water resources", UniqueTarget.Unit), diff --git a/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsFromUniques.kt b/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsFromUniques.kt index 33d94c5454601..1129eb988ce63 100644 --- a/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsFromUniques.kt +++ b/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsFromUniques.kt @@ -39,8 +39,11 @@ object UnitActionsFromUniques { * (no movement left, too close to another city). */ internal fun getFoundCityAction(unit: MapUnit, tile: Tile): UnitAction? { - val unique = UnitActionModifiers.getUsableUnitActionUniques(unit, UniqueType.FoundCity) - .firstOrNull() ?: return null + // FoundPuppetCity is to found a puppet city for modding. + val unique = UnitActionModifiers.getUsableUnitActionUniques(unit, + UniqueType.FoundCity).firstOrNull() ?: + UnitActionModifiers.getUsableUnitActionUniques(unit, + UniqueType.FoundPuppetCity).firstOrNull() ?: return null if (tile.isWater || tile.isImpassible()) return null // Spain should still be able to build Conquistadors in a one city challenge - but can't settle them @@ -54,12 +57,19 @@ object UnitActionsFromUniques { ) == true } val foundAction = { if (unit.civ.playerType != PlayerType.AI) - UncivGame.Current.settings.addCompletedTutorialTask("Found city") - unit.civ.addCity(tile.position, unit) + // Now takes on the text of the unique. + UncivGame.Current.settings.addCompletedTutorialTask( + unique.text) + // Get the city to be able to change it into puppet, for modding. + val city = unit.civ.addCity(tile.position, unit) if (hasActionModifiers) UnitActionModifiers.activateSideEffects(unit, unique) else unit.destroy() GUI.setUpdateWorldOnNextRender() // Set manually, since this could be triggered from the ConfirmPopup and not from the UnitActionsTable + // If unit has FoundPuppetCity make it into a puppet city. + if (unique.type == UniqueType.FoundPuppetCity) { + city.isPuppet = true + } } if (unit.civ.playerType == PlayerType.AI)