diff options
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Unit.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java index e9c2af4..d5576be 100644 --- a/core/src/ch/asynk/tankontank/game/Unit.java +++ b/core/src/ch/asynk/tankontank/game/Unit.java @@ -192,6 +192,34 @@ public class Unit extends HeadedPawn return false; } + public void promote() + { + if (isA(UnitId.GE_PANZER_IV)) + id = UnitId.GE_PANZER_IV_HQ; + else if (isA(UnitId.US_PERSHING)) + id = UnitId.US_PERSHING_HQ; + else if (isA(UnitId.US_SHERMAN)) + id = UnitId.US_SHERMAN_HQ; + else + return; + + type = UnitType.HARD_TARGET_HQ; + } + + public void degrade() + { + if (isA(UnitId.GE_PANZER_IV_HQ)) + id = UnitId.GE_PANZER_IV; + else if (isA(UnitId.US_PERSHING_HQ)) + id = UnitId.US_PERSHING; + else if (isA(UnitId.US_SHERMAN_HQ)) + id = UnitId.US_SHERMAN; + else + return; + + type = UnitType.HARD_TARGET; + } + @Override public boolean isHardTarget() { |