From a2ebb5195c74a1099b15fd67eb7f823eead44eda Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Fri, 5 Nov 2021 13:50:02 +0100 Subject: [PATCH] Add players' classes (dps, tank and support) --- client/src/main/java/fr/lnl/game/client/App.java | 3 +++ .../java/fr/lnl/game/server/games/player/ClassPlayer.java | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/main/java/fr/lnl/game/client/App.java b/client/src/main/java/fr/lnl/game/client/App.java index 1ab0d7c..2ab7b3f 100644 --- a/client/src/main/java/fr/lnl/game/client/App.java +++ b/client/src/main/java/fr/lnl/game/client/App.java @@ -95,6 +95,9 @@ public class App extends Application { playerClass = ComputerPlayer.class; } case "default" -> classPlayer = ClassPlayer.DEFAULT; + case "tank" -> classPlayer = ClassPlayer.TANK; + case "dps" -> classPlayer = ClassPlayer.DPS; + case "support" -> classPlayer = ClassPlayer.SUPPORT; default -> throw new IllegalArgumentException("Unknown argument: " + str); } } diff --git a/server/src/main/java/fr/lnl/game/server/games/player/ClassPlayer.java b/server/src/main/java/fr/lnl/game/server/games/player/ClassPlayer.java index 5ec633c..b51943a 100644 --- a/server/src/main/java/fr/lnl/game/server/games/player/ClassPlayer.java +++ b/server/src/main/java/fr/lnl/game/server/games/player/ClassPlayer.java @@ -5,8 +5,10 @@ import fr.lnl.game.server.games.weapon.Weapon; public enum ClassPlayer { - DEFAULT(800, 25, 40, 30, 40, 10, 800, 20, 20, 15, new Firearm()); - + DEFAULT(800, 25, 40, 30, 40, 10, 80, 20, 20, 15, new Firearm()), + TANK(1000, 20, 20, 17, 23, 13, 80, 27, 30, 22, new Firearm()), + DPS(800, 25, 16, 15, 20, 10, 80, 40, 40, 30, new Firearm()), + SUPPORT(600, 25, 20, 11, 15, 7, 80, 45, 45, 35, new Firearm()); private final int energy; private final int shieldCost; private final int shootCost;