mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 03:53:12 -04:00
Add "Will be destroyed when pillaged" unique (#12943)
* Add Will be destroyed when pillaged unique * Applied the suggestions of yairm210
This commit is contained in:
parent
5dc4a28707
commit
34b281ebfc
@ -642,6 +642,7 @@ enum class UniqueType(
|
|||||||
Unpillagable("Unpillagable", UniqueTarget.Improvement),
|
Unpillagable("Unpillagable", UniqueTarget.Improvement),
|
||||||
PillageYieldRandom("Pillaging this improvement yields approximately [stats]", UniqueTarget.Improvement),
|
PillageYieldRandom("Pillaging this improvement yields approximately [stats]", UniqueTarget.Improvement),
|
||||||
PillageYieldFixed("Pillaging this improvement yields [stats]", UniqueTarget.Improvement),
|
PillageYieldFixed("Pillaging this improvement yields [stats]", UniqueTarget.Improvement),
|
||||||
|
DestroyedWhenPillaged("Destroyed when pillaged", UniqueTarget.Improvement),
|
||||||
Irremovable("Irremovable", UniqueTarget.Improvement),
|
Irremovable("Irremovable", UniqueTarget.Improvement),
|
||||||
AutomatedUnitsWillNotReplace("Will not be replaced by automated units", UniqueTarget.Improvement),
|
AutomatedUnitsWillNotReplace("Will not be replaced by automated units", UniqueTarget.Improvement),
|
||||||
ImprovesResources("Improves [resourceFilter] resource in this tile", UniqueTarget.Improvement, flags = UniqueFlag.setOfNoConditionals,
|
ImprovesResources("Improves [resourceFilter] resource in this tile", UniqueTarget.Improvement, flags = UniqueFlag.setOfNoConditionals,
|
||||||
|
@ -63,6 +63,11 @@ object UnitActionsPillage {
|
|||||||
|
|
||||||
if (pillagingImprovement) // only Improvements heal HP
|
if (pillagingImprovement) // only Improvements heal HP
|
||||||
unit.healBy(25)
|
unit.healBy(25)
|
||||||
|
|
||||||
|
if (tile.getImprovementToPillage()?.hasUnique(UniqueType.DestroyedWhenPillaged) == true) {
|
||||||
|
tile.removeImprovement()
|
||||||
|
}
|
||||||
|
|
||||||
}.takeIf { unit.hasMovement() && canPillage(unit, tile) }
|
}.takeIf { unit.hasMovement() && canPillage(unit, tile) }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -2510,6 +2510,9 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
|||||||
|
|
||||||
Applicable to: Improvement
|
Applicable to: Improvement
|
||||||
|
|
||||||
|
??? example "Will be destroyed when pillaged"
|
||||||
|
Applicable to: Improvement
|
||||||
|
|
||||||
??? example "Irremovable"
|
??? example "Irremovable"
|
||||||
Applicable to: Improvement
|
Applicable to: Improvement
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user