stuff fix
This commit is contained in:
@@ -378,7 +378,6 @@ public class MainGame extends Game implements ClientCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void send(Data data) {
|
public void send(Data data) {
|
||||||
System.out.println("[MAINGAME] sending data " + data);
|
|
||||||
this.client.writeData(data);
|
this.client.writeData(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -416,7 +415,7 @@ public class MainGame extends Game implements ClientCallback {
|
|||||||
}
|
}
|
||||||
} else if (data instanceof DamageData) {
|
} else if (data instanceof DamageData) {
|
||||||
DamageData damageData = (DamageData) data;
|
DamageData damageData = (DamageData) data;
|
||||||
team.get(damageData.getName()).damage(10);
|
team.get(damageData.getName()).damage(100);
|
||||||
} else if (data instanceof TurnData) {
|
} else if (data instanceof TurnData) {
|
||||||
this.playersTurn = !this.playersTurn;
|
this.playersTurn = !this.playersTurn;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,26 +166,33 @@ public class GameInputProcessor implements InputProcessor {
|
|||||||
// clicking on enemy
|
// clicking on enemy
|
||||||
if (mainGame.hasCharacterSelected() && gameTile.containsCharacter() && gameTile.getCharacter().getFaction() != mainGame.getChosenFaction()) {
|
if (mainGame.hasCharacterSelected() && gameTile.containsCharacter() && gameTile.getCharacter().getFaction() != mainGame.getChosenFaction()) {
|
||||||
if (mainGame.mapRenderer.getSurroundedTilesOfCurrentCharacter().contains(gameTile)) {
|
if (mainGame.mapRenderer.getSurroundedTilesOfCurrentCharacter().contains(gameTile)) {
|
||||||
gameTile.getCharacter().damage(10);
|
if (!gameTile.getCharacter().isDead()) {
|
||||||
|
gameTile.getCharacter().damage(100);
|
||||||
mainGame.increaseTurn();
|
mainGame.increaseTurn();
|
||||||
mainGame.send(new DamageData(gameTile.getCharacter().getName()));
|
mainGame.send(new DamageData(gameTile.getCharacter().getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// set selected character
|
// set selected character
|
||||||
if (!mainGame.hasCharacterSelected() && gameTile.containsCharacter()) {
|
if (!mainGame.hasCharacterSelected() && gameTile.containsCharacter()) {
|
||||||
if (gameTile.getCharacter().getFaction() == mainGame.getChosenFaction()) {
|
if (gameTile.getCharacter().getFaction() == mainGame.getChosenFaction()) {
|
||||||
|
if (!gameTile.getCharacter().isDead()) {
|
||||||
mainGame.setSelectedCharacter(gameTile.getCharacter());
|
mainGame.setSelectedCharacter(gameTile.getCharacter());
|
||||||
mainGame.mapRenderer.setSurroundedTilesOfCurrentCharacter(col, row);
|
mainGame.mapRenderer.setSurroundedTilesOfCurrentCharacter(col, row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// switch character
|
// switch character
|
||||||
if (gameTile.containsCharacter()
|
if (gameTile.containsCharacter()
|
||||||
&& !mainGame.getSelectedCharacter().equals(gameTile.getCharacter())
|
&& !mainGame.getSelectedCharacter().equals(gameTile.getCharacter())
|
||||||
&& gameTile.getCharacter().getFaction() == mainGame.getChosenFaction()) {
|
&& gameTile.getCharacter().getFaction() == mainGame.getChosenFaction()) {
|
||||||
|
if (!gameTile.getCharacter().isDead()) {
|
||||||
mainGame.setSelectedCharacter(gameTile.getCharacter());
|
mainGame.setSelectedCharacter(gameTile.getCharacter());
|
||||||
mainGame.mapRenderer.setSurroundedTilesOfCurrentCharacter(col, row);
|
mainGame.mapRenderer.setSurroundedTilesOfCurrentCharacter(col, row);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user