Unciv
Unciv copied to clipboard
Add Pillaging Roads and Repair Action
Rework Improvements to match Civ5 and support tiles having a pillaged state Add support for Improvements and Roads to be Pillaged and Repaired Tiles turn Brown when Pillaged. Workers can Repair and functionality (resources and city connections) is restored immediately (matching Civ5 behavior). Worker Automation will look for Repairable Tiles. Will also try to avoid Enemy Units more. Pillaged Resources are updated in yield and resources provided. NOT REVERSE COMPATIBLE since adding new variables

Translations working

Applying color filter to tile (brown) and improvements (red)

Save to experiment: Autosave-Korea-76.txt
NOT REVERSE COMPATIBLE
If this is the case, please update the CURRENT_COMPATABILITY_NUMBER variable in the companion object of GameInfo (GameInfo.kt:71) to enforce this :)
NOT REVERSE COMPATIBLE
If this is the case, please update the
CURRENT_COMPATABILITY_NUMBERvariable in the companion object ofGameInfo(GameInfo.kt:71) to enforce this :)
This is for marking if a save will break if opened in an earlier version?
NOT REVERSE COMPATIBLE
If this is the case, please update the
CURRENT_COMPATABILITY_NUMBERvariable in the companion object ofGameInfo(GameInfo.kt:71) to enforce this :)This is for marking if a save will break if opened in an earlier version?
As far as I understand it, yes
There's a lot to like here, but having the Repair action be part of the jsons means that modders can decide to not include it, so your code should always be able to handle the case where the repair action does not exist.
There's a lot to like here, but having the Repair action be part of the jsons means that modders can decide to not include it, so your code should always be able to handle the case where the repair action does not exist.
OK, created a backup TileImprovement for Repair in TileInfo. I feel like it should get added in Game Ruleset instead? But that feels very hacky and hard to find
There's a lot to like here, but having the Repair action be part of the jsons means that modders can decide to not include it, so your code should always be able to handle the case where the repair action does not exist.
OK, created a backup TileImprovement for Repair in TileInfo. I feel like it should get added in Game Ruleset instead? But that feels very hacky and hard to find
I'd think that the right way to solve this would not be to include a backup version of the unit action, but rather make it so that if no 'repair' action is in the ruleset, either repairing is just impossible, or pillaged improvements are destroyed immediately. In both cases, making sure nothing weird happens when it isn't included is the main concern. Automatically adding it in the ruleset if it isn't present to me feels like forcing modders to use it, even if they don't want it, and will probably lead to hacky ways in which modders try to disable it (setting the building time to 9999 and then be confused why AI still try to repair, for example).
K, made so if Repair doesn't exist, Pillage go straight to destruction. I couldn't get a save to update the tile though. gameInfo.setTransients is only run on new games? And the TileInfo.normalizeToRuleset() is only Map Editor?
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Conflicts have been resolved.