Skip to content

Commit

Permalink
Merge pull request #33 from BME-MIT-IET/origin/konrad_ManualTest
Browse files Browse the repository at this point in the history
Kiírhatatlan string karakter + öntámadás javítása + AxeDestroy
  • Loading branch information
Tamassch authored May 18, 2024
2 parents 584ba8a + e6b1111 commit 432879f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/java/virologist/control/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public Controller(Game game) {
*/
public void attack(Virologist v){
Virologist currentPlayer = game.GetCurrentPlayer();
actionMessage = v.getName() + " might be dead by now";
actionMessage = v.getName() + " might be dead by now...";
currentPlayer.Attack(v);
if(!currentPlayer.equals(game.GetCurrentPlayer())){
currentPlayer.detach(window);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/virologist/model/equipments/Axe.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public void Attack(Virologist attacker, Virologist target) {
attacker.DecreaseActions();
target.Kill();
used = true;
attacker.RemoveEquipment(this);
attacker.Reset();
}
}
17 changes: 11 additions & 6 deletions src/main/java/virologist/view/Window.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,21 @@ public Window(Controller controller, Game game){
mainMenu.add(actions);
frame.setJMenuBar(mainMenu);

JMenu attack= new JMenu("attack");
JMenu attack = new JMenu("attack");
actions.add(attack);
attack.addMenuListener(new ViewMenuListener(()->{
attack.removeAll();
attack.removeAll();
Virologist v = game.GetCurrentPlayer();
for (Virologist vir : v.getField().GetVirologists() ) {
JMenuItem item = new JMenuItem(vir.getName());
item.addActionListener((e)->controller.attack(vir));
attack.add(item);
ArrayList<Virologist> playersOnField = v.getField().GetVirologists();

for (Virologist vir : playersOnField) {
if(vir != game.GetCurrentPlayer()){
JMenuItem item = new JMenuItem(vir.getName());
item.addActionListener((e)->controller.attack(vir));
attack.add(item);
}
}

}));

JMenu move= new JMenu("move");
Expand Down

0 comments on commit 432879f

Please sign in to comment.