summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/game/Player.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Player.java b/core/src/ch/asynk/tankontank/game/Player.java
index 5a73b30..adc2f05 100644
--- a/core/src/ch/asynk/tankontank/game/Player.java
+++ b/core/src/ch/asynk/tankontank/game/Player.java
@@ -34,7 +34,7 @@ public class Player implements Drawable, Disposable
this.units = new ArrayList<Pawn>(size);
this.losses = new ArrayList<Pawn>(size);
this.reinforcement = new ArrayList<Pawn>(size);
- setActionPoints();
+ this.actionPoints = 0;
}
public String toString()
@@ -83,9 +83,19 @@ public class Player implements Drawable, Disposable
System.err.println("TurnStart " + toString());
}
+ public int d6()
+ {
+ return rand.nextInt(6) + 1;
+ }
+
private void setActionPoints()
{
- this.actionPoints = 2 + rand.nextInt(3);
+ this.actionPoints = 2;
+ if (d6() > 2) {
+ this.actionPoints += 1;
+ if (d6() > 3)
+ this.actionPoints += 1;
+ }
}
public boolean isEnemy(Pawn pawn)