summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-14 12:50:29 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-14 12:50:29 +0100
commit953e31e257dd6b3ed3595cc5b90dd13fdbf6e39c (patch)
tree50f5f25ce78829ba62f3dc12356dcd13514fd033 /core/src/ch/asynk/tankontank/game
parent734c79b736a177b4f4418ad360d57a0e004a7f7e (diff)
downloadRustAndDust-953e31e257dd6b3ed3595cc5b90dd13fdbf6e39c.zip
RustAndDust-953e31e257dd6b3ed3595cc5b90dd13fdbf6e39c.tar.gz
Naming attack -> engagement - move -> movement
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r--core/src/ch/asynk/tankontank/game/Hex.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java38
-rw-r--r--core/src/ch/asynk/tankontank/game/Player.java10
-rw-r--r--core/src/ch/asynk/tankontank/game/Unit.java22
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateCommon.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateEngage.java12
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateMove.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateRotate.java4
8 files changed, 46 insertions, 46 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hex.java b/core/src/ch/asynk/tankontank/game/Hex.java
index 302dc86..656a1e6 100644
--- a/core/src/ch/asynk/tankontank/game/Hex.java
+++ b/core/src/ch/asynk/tankontank/game/Hex.java
@@ -138,7 +138,7 @@ public class Hex extends Tile
break;
}
- pawn.attack.calculus += " >= " + def + " + " + tdef;
+ pawn.engagement.calculus += " >= " + def + " + " + tdef;
return (def + tdef);
}
}
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index e22b373..3735d40 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -30,14 +30,14 @@ public abstract class Map extends Board
public final Board.PawnCollection moveablePawns;
public final Board.PawnCollection possibleTargets;
- public final Board.PawnCollection attackAssists;
+ public final Board.PawnCollection engagementAssists;
public final Board.PawnCollection activatedPawns;
public final Board.PawnCollection breakPawns;
private final SpriteAnimation explosion;
private final SpriteAnimation explosions;
private final Sound moveSound;
- private final Sound attackSound;
+ private final Sound engagementSound;
private Sound sound;
private long soundId = -1;
@@ -50,7 +50,7 @@ public abstract class Map extends Board
this.explosion = new SpriteAnimation(game.manager.get("data/explosion.png", Texture.class), 10, 4, 40);
this.explosions = new SpriteAnimation(game.manager.get("data/explosions.png", Texture.class), 16, 8, 15);
this.moveSound = game.manager.get("sounds/move.mp3", Sound.class);
- this.attackSound = game.manager.get("sounds/attack.mp3", Sound.class);
+ this.engagementSound = game.manager.get("sounds/attack.mp3", Sound.class);
setup();
@@ -59,7 +59,7 @@ public abstract class Map extends Board
moveablePawns = new PawnSet(this, 6);
possibleTargets = new PawnSet(this, 10);
- attackAssists = new PawnSet(this, 6);
+ engagementAssists = new PawnSet(this, 6);
activatedPawns = new PawnSet(this, 7);
breakPawns = new PawnSet(this, 4);
}
@@ -72,7 +72,7 @@ public abstract class Map extends Board
explosion.dispose();
explosions.dispose();
moveSound.dispose();
- attackSound.dispose();
+ engagementSound.dispose();
}
public void clearAll()
@@ -81,7 +81,7 @@ public abstract class Map extends Board
possibleTargets.clear();
possiblePaths.clear();
moveablePawns.clear();
- attackAssists.clear();
+ engagementAssists.clear();
activatedPawns.clear();
breakPawns.clear();
}
@@ -112,7 +112,7 @@ public abstract class Map extends Board
public int collectPossibleTargets(Pawn pawn, Iterator<Pawn> foes)
{
- if (!pawn.canAttack()) {
+ if (!pawn.canEngage()) {
possibleTargets.clear();
return 0;
}
@@ -122,7 +122,7 @@ public abstract class Map extends Board
public int collectMoveablePawns(Pawn pawn)
{
- if (pawn.isHq() && !pawn.move.entryMove) {
+ if (pawn.isHq() && !pawn.movement.entryMove) {
collectMoveAssists(pawn, moveablePawns);
} else {
moveablePawns.clear();
@@ -134,7 +134,7 @@ public abstract class Map extends Board
public int collectAttackAssists(Pawn pawn, Pawn target, Iterator<Pawn> units)
{
- int s = collectAttackAssists(pawn, target, units, attackAssists);
+ int s = collectAttackAssists(pawn, target, units, engagementAssists);
activatedPawns.add(pawn);
return s;
}
@@ -242,17 +242,17 @@ public abstract class Map extends Board
ctrl.animationDone();
}
- public boolean attackPawn(Pawn pawn, final Pawn target, int d1, int d2)
+ public boolean engagePawn(Pawn pawn, final Pawn target, int d1, int d2)
{
int activatedUnits = activatedPawns.size();
int dice = d1 + d2;
final boolean success;
if (dice == 2) {
- pawn.attack.calculus = "2D6 -> (1 + 1) automatic failure";
+ pawn.engagement.calculus = "2D6 -> (1 + 1) automatic failure";
success = false;
} else if (dice == 12) {
- pawn.attack.calculus = "2D6 -> (6 + 6) automatic success";
+ pawn.engagement.calculus = "2D6 -> (6 + 6) automatic success";
success = true;
} else {
int flankAttacks = 0;
@@ -262,11 +262,11 @@ public abstract class Map extends Board
break;
}
}
- pawn.attack.calculus = "2D6 -> (" + d1 + " + " + d2 + ") + " + activatedUnits + " + " + flankAttacks;
+ pawn.engagement.calculus = "2D6 -> (" + d1 + " + " + d2 + ") + " + activatedUnits + " + " + flankAttacks;
int def = target.getTile().defenseFor(pawn, target, activatedPawns);
success = ((dice + activatedUnits + flankAttacks) >= def);
}
- TankOnTank.debug(pawn + " attacks " + target + " : " + pawn.attack.calculus);
+ TankOnTank.debug(pawn + " engagements " + target + " : " + pawn.engagement.calculus);
AnimationSequence seq = AnimationSequence.get(2);
if (success) {
@@ -288,7 +288,7 @@ public abstract class Map extends Board
breakPawns.clear();
for (Pawn p : activatedPawns) {
- p.attack();
+ p.engage();
if (p.isA(Unit.UnitType.INFANTRY))
breakPawns.add(p);
}
@@ -297,7 +297,7 @@ public abstract class Map extends Board
activatedPawns.clear();
addAnimation(seq);
- sound = attackSound;
+ sound = engagementSound;
sound.play(1.0f);
return success;
@@ -322,9 +322,9 @@ public abstract class Map extends Board
public void hideMoveablePawns() { moveablePawns.enable(Unit.MOVE, false); }
public void showPossibleTargets() { possibleTargets.enable(Unit.TARGET, true); }
public void hidePossibleTargets() { possibleTargets.enable(Unit.TARGET, false); }
- public void showAttackAssists() { attackAssists.enable(Unit.MAY_FIRE, true); }
- public void hideAttackAssists() { attackAssists.enable(Unit.FIRE, false);
- attackAssists.enable(Unit.MAY_FIRE, false); }
+ public void showAttackAssists() { engagementAssists.enable(Unit.MAY_FIRE, true); }
+ public void hideAttackAssists() { engagementAssists.enable(Unit.FIRE, false);
+ engagementAssists.enable(Unit.MAY_FIRE, false); }
public void showBreakPawns() { breakPawns.enable(Unit.MOVE, true); }
public void hideBreakPawns() { breakPawns.enable(Unit.MOVE, false); }
diff --git a/core/src/ch/asynk/tankontank/game/Player.java b/core/src/ch/asynk/tankontank/game/Player.java
index fe450fa..d7b26f2 100644
--- a/core/src/ch/asynk/tankontank/game/Player.java
+++ b/core/src/ch/asynk/tankontank/game/Player.java
@@ -17,8 +17,8 @@ public class Player extends ch.asynk.tankontank.engine.Player
private boolean deploymentDone;
// stats
public int actionCount;
- public int lostAttackCount;
- public int wonAttackCount;
+ public int lostEngagementCount;
+ public int wonEngagementCount;
public Player(final TankOnTank game, Army army, int n)
{
@@ -28,8 +28,8 @@ public class Player extends ch.asynk.tankontank.engine.Player
this.actionPoints = 0;
this.deploymentDone = false;
this.actionCount = 0;
- this.lostAttackCount = 0;
- this.wonAttackCount = 0;
+ this.lostEngagementCount = 0;
+ this.wonEngagementCount = 0;
}
public String toString()
@@ -40,7 +40,7 @@ public class Player extends ch.asynk.tankontank.engine.Player
public String getStats()
{
- return String.format("%s\n%4d\n%4d\n%4d\n%4d\n%4d", getName(), actionCount, unitsLeft(), casualties.size(), wonAttackCount, lostAttackCount);
+ return String.format("%s\n%4d\n%4d\n%4d\n%4d\n%4d", getName(), actionCount, unitsLeft(), casualties.size(), wonEngagementCount, lostEngagementCount);
}
public int getAp()
diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java
index e97ff2f..dd68b20 100644
--- a/core/src/ch/asynk/tankontank/game/Unit.java
+++ b/core/src/ch/asynk/tankontank/game/Unit.java
@@ -114,7 +114,7 @@ public class Unit extends HeadedPawn
}
@Override
- public int getAttackRangeFrom(Tile tile)
+ public int getEngagementRangeFrom(Tile tile)
{
if ((type != UnitType.INFANTRY) && (((Hex) tile).terrain == Hex.Terrain.HILLS))
return rng + 1;
@@ -181,40 +181,40 @@ public class Unit extends HeadedPawn
}
@Override
- public boolean canAttack()
+ public boolean canEngage()
{
if (isHardTarget()) return !hasFired;
return (!hasMoved && !hasFired);
}
@Override
- public boolean canAssistAttackWithoutLos()
+ public boolean canAssistEngagementWithoutLos()
{
return (type == UnitType.ARTILLERY);
}
@Override
- public boolean canAttack(Pawn other)
+ public boolean canEngage(Pawn other)
{
- return (isEnemy(other) && canAttack());
+ return (isEnemy(other) && canEngage());
}
@Override
public void move()
{
- TankOnTank.debug(move.toString());
- if (move.cost > mpLeft) TankOnTank.debug("ERROR: Movement point exceeded: " + move.cost + "/" + mpLeft + " please report");
+ TankOnTank.debug(movement.toString());
+ if (movement.cost > mpLeft) TankOnTank.debug("ERROR: Movement point exceeded: " + movement.cost + "/" + mpLeft + " please report");
- if (move.isComplete()) {
+ if (movement.isComplete()) {
hasMoved = true;
}
- mpLeft -= move.cost;
+ mpLeft -= movement.cost;
}
@Override
- public void attack()
+ public void engage()
{
- TankOnTank.debug(attack.toString());
+ TankOnTank.debug(engagement.toString());
hasFired = true;
}
diff --git a/core/src/ch/asynk/tankontank/game/states/StateCommon.java b/core/src/ch/asynk/tankontank/game/states/StateCommon.java
index 7c71a9a..9dbd177 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateCommon.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateCommon.java
@@ -64,7 +64,7 @@ public abstract class StateCommon implements State
protected void showPossibilities(Unit pawn)
{
if (ctrl.cfg.showMoves && pawn.canMove()) map.showPossibleMoves();
- if (ctrl.cfg.showTargets && pawn.canAttack()) map.showPossibleTargets();
+ if (ctrl.cfg.showTargets && pawn.canEngage()) map.showPossibleTargets();
if (ctrl.cfg.showMoveAssists && pawn.canMove()) map.showMoveablePawns();
}
diff --git a/core/src/ch/asynk/tankontank/game/states/StateEngage.java b/core/src/ch/asynk/tankontank/game/states/StateEngage.java
index c157a69..af461e8 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateEngage.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateEngage.java
@@ -56,17 +56,17 @@ public class StateEngage extends StateCommon
StateType nextState = StateType.DONE;
int d1 = ctrl.player.d6();
int d2 = ctrl.player.d6();
- if (map.attackPawn(selectedUnit, activeUnit, d1, d2)) {
- ctrl.player.wonAttackCount += 1;
- ctrl.hud.notify(selectedUnit.attack.calculus + " : " + activeUnit + " is destroyed");
+ if (map.engagePawn(selectedUnit, activeUnit, d1, d2)) {
+ ctrl.player.wonEngagementCount += 1;
+ ctrl.hud.notify(selectedUnit.engagement.calculus + " : " + activeUnit + " is destroyed");
ctrl.opponent.casualty(activeUnit);
if (map.breakPawns.size() > 0) {
ctrl.hud.pushNotify("Break move possible");
nextState = StateType.BREAK;
}
} else {
- ctrl.player.lostAttackCount += 1;
- ctrl.hud.notify(selectedUnit.attack.calculus + " : failure");
+ ctrl.player.lostEngagementCount += 1;
+ ctrl.hud.notify(selectedUnit.engagement.calculus + " : failure");
}
activeUnit.showTarget();
@@ -97,7 +97,7 @@ public class StateEngage extends StateCommon
ctrl.hud.actionButtons.show(Buttons.ENGAGE.b | Buttons.DONE.b | ((ctrl.cfg.canCancel) ? Buttons.ABORT.b : 0));
}
- if ((activeUnit != null) && map.attackAssists.contains(unit)) {
+ if ((activeUnit != null) && map.engagementAssists.contains(unit)) {
if(map.toggleAttackAssist(unit))
ctrl.hud.notify(unit + " will fire");
else
diff --git a/core/src/ch/asynk/tankontank/game/states/StateMove.java b/core/src/ch/asynk/tankontank/game/states/StateMove.java
index fbc71ea..333f1b0 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateMove.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateMove.java
@@ -58,7 +58,7 @@ public class StateMove extends StateCommon
hideAssists();
ctrl.setAnimationCount(map.activatedPawns.size());
map.revertMoves();
- if (activeUnit.move.entryMove) {
+ if (activeUnit.movement.entryMove) {
map.leaveBoard(activeUnit);
ctrl.player.revertUnitEntry(activeUnit);
}
diff --git a/core/src/ch/asynk/tankontank/game/states/StateRotate.java b/core/src/ch/asynk/tankontank/game/states/StateRotate.java
index 2066a8a..ec085b0 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateRotate.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateRotate.java
@@ -47,7 +47,7 @@ public class StateRotate extends StateCommon
{
StateType nextState = StateType.ABORT;
ctrl.hud.actionButtons.hide();
- if (activeUnit.move.entryMove) {
+ if (activeUnit.movement.entryMove) {
map.leaveBoard(activeUnit);
ctrl.player.revertUnitEntry(activeUnit);
}
@@ -81,7 +81,7 @@ public class StateRotate extends StateCommon
o = Orientation.fromAdj(to.getCol(), to.getRow(), downHex.getCol(), downHex.getRow());
if (o == Orientation.KEEP) return;
- if (!activeUnit.move.entryMove && rotateOnly && (o == activeUnit.getOrientation())) return;
+ if (!activeUnit.movement.entryMove && rotateOnly && (o == activeUnit.getOrientation())) return;
rotationSet = true;