mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-07 05:51:12 +07:00
Added 'city addbuilding', 'city removebuilding' console commands
This commit is contained in:
parent
3689eed3aa
commit
27d63f00f4
@ -498,7 +498,7 @@
|
||||
"greatPersonPoints": {"Great Merchant": 1},
|
||||
"culture": 1,
|
||||
"isWonder": true,
|
||||
"uniques": ["[+25]% [Gold] from Trade Routes","Must have an owned [Mountain] within [2] tiles"],
|
||||
"uniques": ["[+25]% [Gold] from Trade Routes", "Must have an owned [Mountain] within [2] tiles"],
|
||||
"requiredTech": "Guilds",
|
||||
"quote": "'Few romances can ever surpass that of the granite citadel on top of the beetling precipices of Machu Picchu, the crown of Inca Land.' - Hiram Bingham"
|
||||
},
|
||||
|
@ -69,5 +69,20 @@ class ConsoleCityCommands : ConsoleCommandNode {
|
||||
city.health = health
|
||||
DevConsoleResponse.OK
|
||||
},
|
||||
|
||||
"addbuilding" to ConsoleAction("city addbuilding [buildingName]") { console, params ->
|
||||
val city = console.getSelectedCity()
|
||||
val building = console.gameInfo.ruleset.buildings.values
|
||||
.firstOrNull { it.name.toCliInput() == params[0] } ?: throw ConsoleErrorException("Unknown building")
|
||||
city.cityConstructions.addBuilding(building)
|
||||
DevConsoleResponse.OK
|
||||
},
|
||||
"removebuilding" to ConsoleAction("city removebuilding [buildingName]") { console, params ->
|
||||
val city = console.getSelectedCity()
|
||||
val building = console.gameInfo.ruleset.buildings.values
|
||||
.firstOrNull { it.name.toCliInput() == params[0] } ?: throw ConsoleErrorException("Unknown building")
|
||||
city.cityConstructions.removeBuilding(building)
|
||||
DevConsoleResponse.OK
|
||||
},
|
||||
)
|
||||
}
|
||||
|
@ -75,6 +75,7 @@ open class ConsoleAction(val format: String, val action: (console: DevConsolePop
|
||||
"resourceName" -> console.gameInfo.ruleset.tileResources.keys
|
||||
"stat" -> Stat.names()
|
||||
"religionName" -> console.gameInfo.religions.keys
|
||||
"buildingName" -> console.gameInfo.ruleset.buildings.keys
|
||||
else -> listOf()
|
||||
}
|
||||
return getAutocompleteString(lastParam, options)
|
||||
|
@ -1070,9 +1070,9 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
||||
|
||||
Applicable to: Building, Unit
|
||||
|
||||
??? example "[amount]% Cost"
|
||||
??? example "[amount]% production cost"
|
||||
Intended to be used with conditionals to dynamically alter construction costs
|
||||
Example: "[3]% Cost"
|
||||
Example: "[3]% production cost"
|
||||
|
||||
Applicable to: Building, Unit
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user