mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-11 00:08:58 +07:00
standardized exploration actions
This commit is contained in:
@ -85,7 +85,7 @@ object UnitActions {
|
|||||||
actionList += getSleepUntilHealedActions(unit, tile)
|
actionList += getSleepUntilHealedActions(unit, tile)
|
||||||
addFortifyActions(actionList, unit, false)
|
addFortifyActions(actionList, unit, false)
|
||||||
|
|
||||||
if (unit.isMilitary()) addExplorationActions(unit, actionList)
|
if (unit.isMilitary()) actionList += getExplorationActions(unit, unit.currentTile)
|
||||||
|
|
||||||
addWaitAction(unit, actionList)
|
addWaitAction(unit, actionList)
|
||||||
|
|
||||||
@ -110,8 +110,7 @@ object UnitActions {
|
|||||||
addSwapAction(unit, actionList)
|
addSwapAction(unit, actionList)
|
||||||
addDisbandAction(actionList, unit)
|
addDisbandAction(actionList, unit)
|
||||||
addGiftAction(unit, actionList, tile)
|
addGiftAction(unit, actionList, tile)
|
||||||
if (unit.isCivilian()) addExplorationActions(unit, actionList)
|
if (unit.isCivilian()) actionList += getExplorationActions(unit, unit.currentTile)
|
||||||
|
|
||||||
|
|
||||||
addToggleActionsAction(unit, actionList)
|
addToggleActionsAction(unit, actionList)
|
||||||
|
|
||||||
@ -171,13 +170,13 @@ object UnitActions {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addExplorationActions(unit: MapUnit, actionList: ArrayList<UnitAction>) {
|
private fun getExplorationActions(unit: MapUnit, tile: Tile): List<UnitAction> {
|
||||||
if (unit.baseUnit.movesLikeAirUnits()) return
|
if (unit.baseUnit.movesLikeAirUnits()) return listOf()
|
||||||
if (unit.isExploring()) return
|
if (unit.isExploring()) return listOf()
|
||||||
actionList += UnitAction(UnitActionType.Explore) {
|
return listOf(UnitAction(UnitActionType.Explore) {
|
||||||
unit.action = UnitActionType.Explore.value
|
unit.action = UnitActionType.Explore.value
|
||||||
if (unit.currentMovement > 0) UnitAutomation.automatedExplore(unit)
|
if (unit.currentMovement > 0) UnitAutomation.automatedExplore(unit)
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user