now "flying" Stargates destroy Replicators, and belonging bugfix
Game.playerBaseDestroyed() is not called everythime a PlayerBase is destroyed.
This commit is contained in:
parent
7d059701cc
commit
89a1da497f
@ -17,6 +17,7 @@ public class Field extends cicaprojekt.Tile {
|
||||
}
|
||||
|
||||
public void onEntry(PlayerBase playerBase) {
|
||||
super.onEntry(playerBase);
|
||||
if (boxStack.size() > 0)
|
||||
return;
|
||||
playerBase.setCurrentTile(this);
|
||||
|
@ -12,7 +12,9 @@ public class Gap extends cicaprojekt.Tile {
|
||||
}
|
||||
|
||||
public void onEntry(PlayerBase playerBase) {
|
||||
super.onEntry(playerBase);
|
||||
playerBase.destroy();
|
||||
Game.instance.playerBaseDestroyed(playerBase);
|
||||
}
|
||||
|
||||
public void onExit(PlayerBase playerBase) throws IllegalStateException {
|
||||
|
@ -13,6 +13,7 @@ public class Gate extends Tile {
|
||||
}
|
||||
|
||||
public void onEntry(PlayerBase playerBase) {
|
||||
super.onEntry(playerBase);
|
||||
if (open) {
|
||||
playerBase.setCurrentTile(this);
|
||||
} else
|
||||
|
@ -20,7 +20,6 @@ public class PlayerBase implements Destroyable {
|
||||
|
||||
public void destroy() {
|
||||
destroyed = true;
|
||||
Game.instance.playerBaseDestroyed(this);
|
||||
}
|
||||
|
||||
public Tile getCurrentTile() {
|
||||
|
@ -25,6 +25,7 @@ public class Scale extends Field {
|
||||
|
||||
@Override
|
||||
public void onEntry(PlayerBase playerBase) {
|
||||
super.onEntry(playerBase);
|
||||
gateConnected.setOpen(true);
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,7 @@ public class Stargate {
|
||||
public boolean isSpawned() {
|
||||
return isSpawned;
|
||||
}
|
||||
|
||||
public boolean isOpen() {
|
||||
if(isSpawned & other.isSpawned)
|
||||
return other.getCurrentWall().getAdjacentTile(other.getExitDirection()).isSteppable();
|
||||
|
@ -10,6 +10,7 @@ public abstract class Tile {
|
||||
protected Stack<Box> boxStack;
|
||||
protected int y = -666;
|
||||
protected int x = -666;
|
||||
protected PlayerBase playerBaseOnTile = null;
|
||||
|
||||
|
||||
public Tile() {
|
||||
@ -42,10 +43,15 @@ public abstract class Tile {
|
||||
}
|
||||
|
||||
public void spawnStargate(Stargate stargate, Direction direction) {
|
||||
if (playerBaseOnTile != null && playerBaseOnTile.name.equals("Replicator"))
|
||||
playerBaseOnTile.destroy();
|
||||
|
||||
adjacentTile.get(direction).spawnStargate(stargate, direction);
|
||||
}
|
||||
|
||||
public abstract void onEntry(PlayerBase playerBase);
|
||||
public void onEntry(PlayerBase playerBase) {
|
||||
playerBaseOnTile = playerBase;
|
||||
}
|
||||
|
||||
public abstract void onExit(PlayerBase playerBase);
|
||||
|
||||
|
@ -36,6 +36,7 @@ public class Wall extends Tile {
|
||||
}
|
||||
|
||||
public void onEntry(PlayerBase playerBase) {
|
||||
super.onEntry(playerBase);
|
||||
if (sg == null) {
|
||||
return;
|
||||
} else {
|
||||
|
@ -2,8 +2,8 @@
|
||||
150
|
||||
|
||||
W W W W W
|
||||
W R W F W
|
||||
W X O F W
|
||||
W R F F W
|
||||
W F O F W
|
||||
W F F Z W
|
||||
W W W W W
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user