summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-01 12:48:07 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-01 12:48:07 +0100
commitaa3dc8940c9ec6ac285e6792433d293b8bdd6069 (patch)
treeb26c82e0c30e1a7b1012771bf25c6e25afdef020 /core
parent342a78a5a458f2606300723c91badc23e4db81b5 (diff)
downloadRustAndDust-aa3dc8940c9ec6ac285e6792433d293b8bdd6069.zip
RustAndDust-aa3dc8940c9ec6ac285e6792433d293b8bdd6069.tar.gz
add notifications
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/Hud.java4
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateAttack.java12
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StatePromote.java1
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateRotate.java1
4 files changed, 13 insertions, 5 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java
index e2e0ae2..a3d782b 100644
--- a/core/src/ch/asynk/tankontank/game/Hud.java
+++ b/core/src/ch/asynk/tankontank/game/Hud.java
@@ -188,8 +188,10 @@ public class Hud implements Disposable
ctrl.setState(State.StateType.ATTACK);
else if (btn == checkBtn)
ctrl.done();
- else if (btn == cancelBtn)
+ else if (btn == cancelBtn) {
+ notify("Action canceled");
ctrl.abort();
+ }
btn = null;
diff --git a/core/src/ch/asynk/tankontank/game/states/StateAttack.java b/core/src/ch/asynk/tankontank/game/states/StateAttack.java
index 397b8a6..90112c7 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateAttack.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateAttack.java
@@ -54,6 +54,7 @@ public class StateAttack extends StateCommon
// activeUnit is the target
if ((activeUnit == null) && map.possibleTargets.contains(unit)) {
+ ctrl.hud.notify("Attack " + unit);
map.hidePossibleTargets();
to = upHex;
activeUnit = unit;
@@ -64,7 +65,10 @@ public class StateAttack extends StateCommon
}
if ((activeUnit != null) && map.attackAssists.contains(unit)) {
- map.toggleAttackAssist(unit);
+ if(map.toggleAttackAssist(unit))
+ ctrl.hud.notify(unit + " will fire");
+ else
+ ctrl.hud.notify(unit + " wont fire");
}
}
@@ -80,13 +84,13 @@ public class StateAttack extends StateCommon
{
int d1 = ctrl.player.d6();
int d2 = ctrl.player.d6();
- System.err.print(" attack (" + selectedHex.getCol() + ";" + selectedHex.getRow() + ") -> (" + to.getCol() + ";" + to.getRow() + ") : 2D6 -> (" + d1 + " + " + d2 + ")");
if (map.attackPawn(selectedUnit, activeUnit, d1, d2)) {
+ ctrl.hud.notify(selectedUnit.attack.calculus + " : " + activeUnit + " is destroyed");
ctrl.opponent.casualty(activeUnit);
if (map.breakPawns.size() > 0)
setNextState(StateType.BREAK);
- }
-
+ } else
+ ctrl.hud.notify(selectedUnit.attack.calculus + " : failure");
activeUnit.showTarget();
ctrl.setState(StateType.ANIMATION);
diff --git a/core/src/ch/asynk/tankontank/game/states/StatePromote.java b/core/src/ch/asynk/tankontank/game/states/StatePromote.java
index fc4b852..b4930f0 100644
--- a/core/src/ch/asynk/tankontank/game/states/StatePromote.java
+++ b/core/src/ch/asynk/tankontank/game/states/StatePromote.java
@@ -11,6 +11,7 @@ public class StatePromote extends StateCommon
ctrl.hud.hide();
Unit p = ctrl.player.promote(selectedUnit);
if (p != null) {
+ ctrl.hud.notify(p + " has been promoted");
map.promote(selectedUnit, p);
}
done();
diff --git a/core/src/ch/asynk/tankontank/game/states/StateRotate.java b/core/src/ch/asynk/tankontank/game/states/StateRotate.java
index b651312..975a8d5 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateRotate.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateRotate.java
@@ -103,6 +103,7 @@ public class StateRotate extends StateCommon
{
if (!rotationSet) return;
+ ctrl.hud.notify("Move " + activeUnit);
if (rotateOnly) {
ctrl.setAnimationCount(1);
if (map.rotatePawn(activeUnit, o) > 0)