From b088fb8cb5563f0cb3b4ea741dd2d6d828b292f2 Mon Sep 17 00:00:00 2001 From: dumichno Date: Sat, 18 Jan 2020 18:47:36 +0300 Subject: [PATCH] Barbarians don't move/attack on the turn of their spawning --- core/src/com/unciv/logic/map/MapUnit.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index 129b15049b..dc2744d3d7 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -42,6 +42,7 @@ class MapUnit { lateinit var name: String var currentMovement: Float = 0f var health:Int = 100 + var createdThisTurn = true var mapUnitAction : MapUnitAction? = null @@ -77,6 +78,7 @@ class MapUnit { toReturn.name=name toReturn.currentMovement=currentMovement toReturn.health=health + toReturn.createdThisTurn=createdThisTurn toReturn.action=action toReturn.attacksThisTurn=attacksThisTurn toReturn.promotions=promotions.clone() @@ -397,6 +399,7 @@ class MapUnit { fun endTurn() { + createdThisTurn = false doPostTurnAction() if(currentMovement== getMaxMovement().toFloat() // didn't move this turn || getUniques().contains("Unit will heal every turn, even if it performs an action")){ @@ -405,7 +408,7 @@ class MapUnit { } fun startTurn(){ - currentMovement = getMaxMovement().toFloat() + currentMovement = if (createdThisTurn && civInfo.isBarbarian()) 0f else getMaxMovement().toFloat() attacksThisTurn=0 due = true