fixed bug where Tiles would be replaced with Fields on PlayerBase.destroy()
This commit is contained in:
parent
55cae38f5f
commit
23271cc086
@ -22,6 +22,7 @@ public class Game {
|
|||||||
private Game() {}
|
private Game() {}
|
||||||
|
|
||||||
public void playerBaseDestroyed(PlayerBase caller) {
|
public void playerBaseDestroyed(PlayerBase caller) {
|
||||||
|
if (caller.getCurrentTile().isGap()) {
|
||||||
Field field = new Field();
|
Field field = new Field();
|
||||||
Tile callertile = caller.getCurrentTile();
|
Tile callertile = caller.getCurrentTile();
|
||||||
|
|
||||||
@ -40,10 +41,11 @@ public class Game {
|
|||||||
field.setAdajacentTile(caller.getCurrentTile().getAdjacentTile(Direction.EAST), Direction.EAST);
|
field.setAdajacentTile(caller.getCurrentTile().getAdjacentTile(Direction.EAST), Direction.EAST);
|
||||||
callertile.getAdjacentTile(Direction.EAST).setAdajacentTile(field, Direction.WEST);
|
callertile.getAdjacentTile(Direction.EAST).setAdajacentTile(field, Direction.WEST);
|
||||||
|
|
||||||
display.gapMagic((Gap)callertile, field, dungeon.getMapWidth());
|
display.gapMagic((Gap) callertile, field, dungeon.getMapWidth());
|
||||||
|
|
||||||
Game.instance.updateDisplay();
|
Game.instance.updateDisplay();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void playerDestroyed(Player caller) {
|
public void playerDestroyed(Player caller) {
|
||||||
dungeon.setZPMsToWin(dungeon.getZPMsToWin() - caller.getZPMCount());
|
dungeon.setZPMsToWin(dungeon.getZPMsToWin() - caller.getZPMCount());
|
||||||
|
@ -11,6 +11,12 @@ public class Gap extends cicaprojekt.Tile {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isGap()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEntry(PlayerBase playerBase) {
|
public void onEntry(PlayerBase playerBase) {
|
||||||
super.onEntry(playerBase);
|
super.onEntry(playerBase);
|
||||||
|
@ -65,6 +65,10 @@ public abstract class Tile {
|
|||||||
return zpm;
|
return zpm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isGap() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public void putABox(Box box) {
|
public void putABox(Box box) {
|
||||||
if (box == null)
|
if (box == null)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user