Skip to content
Snippets Groups Projects
Commit 075a7869 authored by Schlütter Yannik's avatar Schlütter Yannik
Browse files

Fix: Now able to teleport right after placing a bomb and not having to wait for the cooldown

#93
parent 3b4ef314
No related branches found
No related tags found
No related merge requests found
Pipeline #60645 failed
......@@ -296,10 +296,10 @@ class Player implements IEntity {
int lastyTile = yTile;
if (PLAYER_MODE == PlayerMode.PLAYER_ONE && !markerPlacedPlayerOne) {
if (PLAYER_MODE == PlayerMode.PLAYER_ONE && !markerPlacedPlayerOne && isTeleportItemFrame) {
markerPlacedPlayerOne = findNearestTpTile(yTile, xTile, graphicsContext);
}
if (PLAYER_MODE == PlayerMode.PLAYER_TWO && !markerPlacedPlayerTwo) {
if (PLAYER_MODE == PlayerMode.PLAYER_TWO && !markerPlacedPlayerTwo && isTeleportItemFrame) {
markerPlacedPlayerTwo = findNearestTpTile(yTile, xTile, graphicsContext);
}
......@@ -350,14 +350,14 @@ class Player implements IEntity {
List<IEntity> gameplayObjects = runtimeInfo.getGameplayObjects();
int player = 0;
if (isTeleportItemFrame && TileManager.tileMap[yTile][xTile] < 10 && PLAYER_MODE == PlayerMode.PLAYER_ONE) {
if (TileManager.tileMap[yTile][xTile] < 10 && PLAYER_MODE == PlayerMode.PLAYER_ONE) {
player = 1;
IEntity marker = EntityFactory.createMarker(ObjectType.MARKER, xTile * scaledTileSize, yTile * scaledTileSize, graphicsContext, player);
gameplayObjects.add(marker);
runtimeInfo.setGameplayObjects(gameplayObjects);
log.debug("Player 1 marker placed");
} else if (isTeleportItemFrame && TileManager.tileMap[yTile][xTile] < 10 && PLAYER_MODE == PlayerMode.PLAYER_TWO) {
} else if (TileManager.tileMap[yTile][xTile] < 10 && PLAYER_MODE == PlayerMode.PLAYER_TWO) {
player = 2;
IEntity marker = EntityFactory.createMarker(ObjectType.MARKER, xTile * scaledTileSize, yTile * scaledTileSize, graphicsContext, player);
gameplayObjects.add(marker);
......@@ -535,11 +535,12 @@ class Player implements IEntity {
@Override
public void placeBombAction(IEntity entity, GraphicsContext graphicsContext) {
List<IEntity> gameplayObjects = runtimeInfo.getGameplayObjects();
if (inputHandler.isBomb() && PLAYER_MODE == PlayerMode.PLAYER_ONE && bombPlacementRate == 0 ||
inputHandler.isSdBomb() && PLAYER_MODE == PlayerMode.PLAYER_TWO && bombPlacementRate == 0) {
if (inputHandler.isBomb() && PLAYER_MODE == PlayerMode.PLAYER_ONE ||
inputHandler.isSdBomb() && PLAYER_MODE == PlayerMode.PLAYER_TWO) {
blastRadius = updateBlastradius(blastRadius);
if (isBigBombItemFrame && !isTeleportItemFrame) {
if (isBigBombItemFrame && !isTeleportItemFrame && bombPlacementRate == 0) {
log.debug("We have Big_Bomb ItemFrames in the List");
bombPlacementRate = updateBombPlacementRate(bombPlacementRate);
int xTile = (pixelPadding + mapPosX) / scaledTileSize;
......@@ -577,7 +578,7 @@ class Player implements IEntity {
}
removeMarker(markerPlacedPlayerTwo);
isTeleportItemFrame = false;
} else if (!isTeleportItemFrame) {
} else if (!isTeleportItemFrame && bombPlacementRate == 0) {
log.debug("No BigBomb Itemframes in the List");
bombPlacementRate = bombReducedPlacementRate;
int xTile = (pixelPadding + mapPosX) / scaledTileSize;
......@@ -607,12 +608,12 @@ class Player implements IEntity {
public int updateBlastradius(int blastradius) {
if (isBlastUpItemFrame) {
blastradius++;
log.info("Upping blastradius:" + blastradius);
log.info("Upping blastRadius:" + blastradius);
isBlastUpItemFrame = false;
} else if (isBlastDownItemFrame) {
if (blastradius > 1) {
blastradius--;
log.info("Lowering blastradius:" + blastradius);
log.info("Lowering blastRadius:" + blastradius);
}
isBlastDownItemFrame = false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment