From c4116cba97f4c691fec38d975301e81dc28b4b5c Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 8 Oct 2022 16:47:32 +0200 Subject: [PATCH 1/9] Update InFightDamage Add WinconditionAmongUs --- .../fightsystem/listener/InFightDamage.java | 4 ++- .../winconditions/WinconditionAmongUs.java | 33 +++++++++++++++++++ .../winconditions/Winconditions.java | 3 +- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/listener/InFightDamage.java b/FightSystem_Core/src/de/steamwar/fightsystem/listener/InFightDamage.java index 09ec33a..9be2167 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/listener/InFightDamage.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/listener/InFightDamage.java @@ -20,10 +20,12 @@ package de.steamwar.fightsystem.listener; import de.steamwar.fightsystem.ArenaMode; +import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.FightSystem; import de.steamwar.fightsystem.fight.Fight; import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.StateDependentListener; +import de.steamwar.fightsystem.winconditions.Winconditions; import net.md_5.bungee.api.ChatMessageType; import org.bukkit.entity.Arrow; import org.bukkit.entity.Player; @@ -36,7 +38,7 @@ import java.util.Objects; public class InFightDamage implements Listener { public InFightDamage() { - new StateDependentListener(ArenaMode.AntiReplay, FightState.Running, this); + new StateDependentListener(!Config.ActiveWinconditions.contains(Winconditions.AMONG_US), FightState.Running, this); } @EventHandler diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java new file mode 100644 index 0000000..927ed90 --- /dev/null +++ b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java @@ -0,0 +1,33 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2020 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.fightsystem.winconditions; + +import de.steamwar.fightsystem.states.FightState; +import de.steamwar.fightsystem.states.OneShotStateDependent; + +public class WinconditionAmongUs extends Wincondition { + + public WinconditionAmongUs() { + super("AmongUs"); + new OneShotStateDependent(Winconditions.AMONG_US, FightState.Ingame, () -> { + // TODO: Select 1 imposter from each team + }); + } +} diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/Winconditions.java b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/Winconditions.java index 9d7ae2a..620a247 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/Winconditions.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/Winconditions.java @@ -38,5 +38,6 @@ public enum Winconditions { PUMPKIN_TECH_KO, HELLS_BELLS, - METEOR + METEOR, + AMONG_US } -- 2.39.2 From b750433f91c7c5c6035b572fbc3344c1d7c140d2 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 8 Oct 2022 16:56:02 +0200 Subject: [PATCH 2/9] Add initial message --- .../de/steamwar/fightsystem/FightSystem.java | 1 + .../fightsystem/FightSystem.properties | 3 +++ .../fightsystem/FightSystem_de.properties | 3 +++ .../winconditions/WinconditionAmongUs.java | 21 ++++++++++++++++++- 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java index 1a94778..8d51340 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java @@ -118,6 +118,7 @@ public class FightSystem extends JavaPlugin { new HellsBells(); new Meteor(); + new WinconditionAmongUs(); new NoPlayersOnlineCountdown(); new PreSchemCountdown(); diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties index 126d650..82662c0 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties +++ b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties @@ -238,3 +238,6 @@ WIN_LESS_DAMAGE={0} §7less damaged WIN_POINTS={0} has more points WIN_POINTS_EQUAL=§7Equal points WIN_TECHKO={0} §7is tech K.O. +# WIN_AMONG_US={0} §7is tech K.O. + +AMONG_US_IMPOSTER_MESSAGE = §4You are the Imposter§8! §7Kill all your teammates to win the game! diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties index 082f69f..b5994e0 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties +++ b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties @@ -223,3 +223,6 @@ WIN_LESS_DAMAGE={0} §7weniger beschädigt WIN_POINTS={0} hat mehr Punkte WIN_POINTS_EQUAL=§7Gleicher Punktestand WIN_TECHKO={0} §7ist Tech K.O. +# WIN_AMONG_US={0} §7is tech K.O. + +AMONG_US_IMPOSTER_MESSAGE = §4Du bist ein Imposter§8! §7Du musst alle Teammates töten, um zu gewinnen. \ No newline at end of file diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java index 927ed90..720fec9 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java @@ -19,15 +19,34 @@ package de.steamwar.fightsystem.winconditions; +import de.steamwar.fightsystem.FightSystem; +import de.steamwar.fightsystem.fight.Fight; +import de.steamwar.fightsystem.fight.FightPlayer; import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.OneShotStateDependent; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Random; + public class WinconditionAmongUs extends Wincondition { + private final Random random = new Random(); + public WinconditionAmongUs() { super("AmongUs"); new OneShotStateDependent(Winconditions.AMONG_US, FightState.Ingame, () -> { - // TODO: Select 1 imposter from each team + FightPlayer redPlayer = getRandomPlayer(Fight.getRedTeam().getPlayers()); + FightPlayer bluePlayer = getRandomPlayer(Fight.getBlueTeam().getPlayers()); + + FightSystem.getMessage().send("AMONG_US_IMPOSTER_MESSAGE", redPlayer.getPlayer()); + FightSystem.getMessage().send("AMONG_US_IMPOSTER_MESSAGE", bluePlayer.getPlayer()); }); } + + private FightPlayer getRandomPlayer(Collection fightPlayers) { + List fightPlayerList = new ArrayList<>(fightPlayers); + return fightPlayerList.get(random.nextInt(fightPlayerList.size())); + } } -- 2.39.2 From b24e9a8b89839c5d5c56ebe689cfb39bb3a7b934 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 8 Oct 2022 17:00:44 +0200 Subject: [PATCH 3/9] Add message --- .../winconditions/WinconditionAmongUs.java | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java index 720fec9..3b1ece5 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java @@ -22,15 +22,22 @@ package de.steamwar.fightsystem.winconditions; import de.steamwar.fightsystem.FightSystem; import de.steamwar.fightsystem.fight.Fight; import de.steamwar.fightsystem.fight.FightPlayer; +import de.steamwar.fightsystem.fight.FightTeam; import de.steamwar.fightsystem.states.FightState; import de.steamwar.fightsystem.states.OneShotStateDependent; +import de.steamwar.fightsystem.states.StateDependentListener; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.PlayerDeathEvent; +import org.bukkit.event.player.PlayerQuitEvent; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Random; -public class WinconditionAmongUs extends Wincondition { +public class WinconditionAmongUs extends Wincondition implements Listener { private final Random random = new Random(); @@ -43,10 +50,35 @@ public class WinconditionAmongUs extends Wincondition { FightSystem.getMessage().send("AMONG_US_IMPOSTER_MESSAGE", redPlayer.getPlayer()); FightSystem.getMessage().send("AMONG_US_IMPOSTER_MESSAGE", bluePlayer.getPlayer()); }); + new StateDependentListener(Winconditions.AMONG_US, FightState.Ingame, this); } private FightPlayer getRandomPlayer(Collection fightPlayers) { List fightPlayerList = new ArrayList<>(fightPlayers); return fightPlayerList.get(random.nextInt(fightPlayerList.size())); } + + @EventHandler + public void handlePlayerDeath(PlayerDeathEvent event) { + handleDeath(event.getEntity().getPlayer()); + } + + @EventHandler + public void handlePlayerQuit(PlayerQuitEvent event) { + handleDeath(event.getPlayer()); + } + + private void handleDeath(Player player){ + // TODO: Adapt this + FightTeam team = isTarget(player); + if(team == null) + return; + + for(FightPlayer fp : team.getPlayers()) { + if(fp.isLiving() && fp.getPlayer() != player) + return; + } + + win(Fight.getOpposite(team), "WIN_ALL_DEAD", team.getPrefix()); + } } -- 2.39.2 From f1e9dda0faad864368b9641dbc5a578eecc0f527 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 8 Oct 2022 17:07:05 +0200 Subject: [PATCH 4/9] Update handleDeath method --- .../winconditions/WinconditionAmongUs.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java index 3b1ece5..bbc9778 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java @@ -32,13 +32,12 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerQuitEvent; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Random; +import java.util.*; public class WinconditionAmongUs extends Wincondition implements Listener { + private Map imposter = new HashMap<>(); + private final Random random = new Random(); public WinconditionAmongUs() { @@ -47,6 +46,9 @@ public class WinconditionAmongUs extends Wincondition implements Listener { FightPlayer redPlayer = getRandomPlayer(Fight.getRedTeam().getPlayers()); FightPlayer bluePlayer = getRandomPlayer(Fight.getBlueTeam().getPlayers()); + imposter.put(Fight.getRedTeam(), redPlayer); + imposter.put(Fight.getBlueTeam(), bluePlayer); + FightSystem.getMessage().send("AMONG_US_IMPOSTER_MESSAGE", redPlayer.getPlayer()); FightSystem.getMessage().send("AMONG_US_IMPOSTER_MESSAGE", bluePlayer.getPlayer()); }); @@ -69,16 +71,15 @@ public class WinconditionAmongUs extends Wincondition implements Listener { } private void handleDeath(Player player){ - // TODO: Adapt this FightTeam team = isTarget(player); if(team == null) return; - for(FightPlayer fp : team.getPlayers()) { - if(fp.isLiving() && fp.getPlayer() != player) - return; + FightPlayer current = team.getFightPlayer(player); + if (current == imposter.get(team)) { + // TODO: Add message that the imposter is dead and the same team won! + } else if (team.getPlayers().contains(current) && team.getPlayers().contains(imposter.get(team))) { + // TODO: Add message that the all except the imposter are dead and the other team won! } - - win(Fight.getOpposite(team), "WIN_ALL_DEAD", team.getPrefix()); } } -- 2.39.2 From 67a0d0f5e9be987f6586d2eb618b0a988178c8dc Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 8 Oct 2022 17:28:39 +0200 Subject: [PATCH 5/9] Add messages --- .../fightsystem/FightSystem.properties | 4 ++- .../fightsystem/FightSystem_de.properties | 6 +++-- .../winconditions/WinconditionAmongUs.java | 26 ++++++++++--------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties index 82662c0..0ba06f2 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties +++ b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties @@ -238,6 +238,8 @@ WIN_LESS_DAMAGE={0} §7less damaged WIN_POINTS={0} has more points WIN_POINTS_EQUAL=§7Equal points WIN_TECHKO={0} §7is tech K.O. -# WIN_AMONG_US={0} §7is tech K.O. +WIN_IMPOSTER_DEAD={0} §7killed the imposter +WIN_CREWMATE_DEAD={0} §7killed all creamates AMONG_US_IMPOSTER_MESSAGE = §4You are the Imposter§8! §7Kill all your teammates to win the game! +AMONG_US_IMPOSTER_AMONG_MESSAGE = §4There is an Imposter among us§8! §7Kill him to win the game! diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties index b5994e0..82036af 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties +++ b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties @@ -223,6 +223,8 @@ WIN_LESS_DAMAGE={0} §7weniger beschädigt WIN_POINTS={0} hat mehr Punkte WIN_POINTS_EQUAL=§7Gleicher Punktestand WIN_TECHKO={0} §7ist Tech K.O. -# WIN_AMONG_US={0} §7is tech K.O. +WIN_IMPOSTER_DEAD={0} §7 hat den Imposter getötet +WIN_CREWMATE_DEAD={0} §7 hat alle Crewmates getötet -AMONG_US_IMPOSTER_MESSAGE = §4Du bist ein Imposter§8! §7Du musst alle Teammates töten, um zu gewinnen. \ No newline at end of file +AMONG_US_IMPOSTER_MESSAGE = §4Du bist ein Imposter§8! §7Du musst alle Teammates töten, um zu gewinnen. +AMONG_US_IMPOSTER_AMONG_MESSAGE = §4Es ist ein Imposter unter uns§8! §7Tötet ihn, um das Spiel zu gewinnen! \ No newline at end of file diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java index bbc9778..7e040db 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java @@ -43,21 +43,23 @@ public class WinconditionAmongUs extends Wincondition implements Listener { public WinconditionAmongUs() { super("AmongUs"); new OneShotStateDependent(Winconditions.AMONG_US, FightState.Ingame, () -> { - FightPlayer redPlayer = getRandomPlayer(Fight.getRedTeam().getPlayers()); - FightPlayer bluePlayer = getRandomPlayer(Fight.getBlueTeam().getPlayers()); - - imposter.put(Fight.getRedTeam(), redPlayer); - imposter.put(Fight.getBlueTeam(), bluePlayer); - - FightSystem.getMessage().send("AMONG_US_IMPOSTER_MESSAGE", redPlayer.getPlayer()); - FightSystem.getMessage().send("AMONG_US_IMPOSTER_MESSAGE", bluePlayer.getPlayer()); + imposter.put(Fight.getRedTeam(), sendMessageAndReturnImposter(Fight.getRedTeam().getPlayers())); + imposter.put(Fight.getBlueTeam(), sendMessageAndReturnImposter(Fight.getBlueTeam().getPlayers())); }); new StateDependentListener(Winconditions.AMONG_US, FightState.Ingame, this); } - private FightPlayer getRandomPlayer(Collection fightPlayers) { + private FightPlayer sendMessageAndReturnImposter(Collection fightPlayers) { List fightPlayerList = new ArrayList<>(fightPlayers); - return fightPlayerList.get(random.nextInt(fightPlayerList.size())); + FightPlayer imposter = fightPlayerList.get(random.nextInt(fightPlayerList.size())); + for (FightPlayer fightPlayer : fightPlayerList) { + if (fightPlayer == imposter) { + FightSystem.getMessage().send("AMONG_US_IMPOSTER_MESSAGE", fightPlayer.getPlayer()); + } else { + FightSystem.getMessage().send("AMONG_US_IMPOSTER_AMONG_MESSAGE", fightPlayer.getPlayer()); + } + } + return imposter; } @EventHandler @@ -77,9 +79,9 @@ public class WinconditionAmongUs extends Wincondition implements Listener { FightPlayer current = team.getFightPlayer(player); if (current == imposter.get(team)) { - // TODO: Add message that the imposter is dead and the same team won! + win(team, "WIN_IMPOSTER_DEAD", team.getPrefix()); } else if (team.getPlayers().contains(current) && team.getPlayers().contains(imposter.get(team))) { - // TODO: Add message that the all except the imposter are dead and the other team won! + win(Fight.getOpposite(team), "WIN_CREWMATE_DEAD", Fight.getOpposite(team).getPrefix()); } } } -- 2.39.2 From facee211dd665838d2c47765f3b4f2796fb5e722 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 8 Oct 2022 17:51:24 +0200 Subject: [PATCH 6/9] Update messages --- .../src/de/steamwar/fightsystem/FightSystem.properties | 4 ++-- .../src/de/steamwar/fightsystem/FightSystem_de.properties | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties index 0ba06f2..ef060ac 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties +++ b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties @@ -239,7 +239,7 @@ WIN_POINTS={0} has more points WIN_POINTS_EQUAL=§7Equal points WIN_TECHKO={0} §7is tech K.O. WIN_IMPOSTER_DEAD={0} §7killed the imposter -WIN_CREWMATE_DEAD={0} §7killed all creamates +WIN_CREWMATE_DEAD={0} §7killed all team mates -AMONG_US_IMPOSTER_MESSAGE = §4You are the Imposter§8! §7Kill all your teammates to win the game! +AMONG_US_IMPOSTER_MESSAGE = §4You are the Imposter§8! §7Kill all your team mates to win the game! AMONG_US_IMPOSTER_AMONG_MESSAGE = §4There is an Imposter among us§8! §7Kill him to win the game! diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties index 82036af..80bbee7 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties +++ b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties @@ -224,7 +224,7 @@ WIN_POINTS={0} hat mehr Punkte WIN_POINTS_EQUAL=§7Gleicher Punktestand WIN_TECHKO={0} §7ist Tech K.O. WIN_IMPOSTER_DEAD={0} §7 hat den Imposter getötet -WIN_CREWMATE_DEAD={0} §7 hat alle Crewmates getötet +WIN_CREWMATE_DEAD={0} §7 hat alle Kammeraden getötet -AMONG_US_IMPOSTER_MESSAGE = §4Du bist ein Imposter§8! §7Du musst alle Teammates töten, um zu gewinnen. +AMONG_US_IMPOSTER_MESSAGE = §4Du bist ein Imposter§8! §7Du musst alle Kammeraden töten, um zu gewinnen. AMONG_US_IMPOSTER_AMONG_MESSAGE = §4Es ist ein Imposter unter uns§8! §7Tötet ihn, um das Spiel zu gewinnen! \ No newline at end of file -- 2.39.2 From d0a5e0c96fd9e346f65ea317b09b6ea8b2d735a6 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 8 Oct 2022 17:52:40 +0200 Subject: [PATCH 7/9] Update messages --- .../src/de/steamwar/fightsystem/FightSystem_de.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties index 80bbee7..2809513 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties +++ b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties @@ -224,7 +224,7 @@ WIN_POINTS={0} hat mehr Punkte WIN_POINTS_EQUAL=§7Gleicher Punktestand WIN_TECHKO={0} §7ist Tech K.O. WIN_IMPOSTER_DEAD={0} §7 hat den Imposter getötet -WIN_CREWMATE_DEAD={0} §7 hat alle Kammeraden getötet +WIN_CREWMATE_DEAD={0} §7 hat alle Kameraden getötet -AMONG_US_IMPOSTER_MESSAGE = §4Du bist ein Imposter§8! §7Du musst alle Kammeraden töten, um zu gewinnen. +AMONG_US_IMPOSTER_MESSAGE = §4Du bist ein Imposter§8! §7Du musst alle Kameraden töten, um zu gewinnen. AMONG_US_IMPOSTER_AMONG_MESSAGE = §4Es ist ein Imposter unter uns§8! §7Tötet ihn, um das Spiel zu gewinnen! \ No newline at end of file -- 2.39.2 From 80a98a998a7ac82799ff2bb1919bd8e079fae3f0 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 8 Oct 2022 17:56:22 +0200 Subject: [PATCH 8/9] Update --- .../steamwar/fightsystem/winconditions/WinconditionAmongUs.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java index 7e040db..39ee800 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java @@ -80,7 +80,7 @@ public class WinconditionAmongUs extends Wincondition implements Listener { FightPlayer current = team.getFightPlayer(player); if (current == imposter.get(team)) { win(team, "WIN_IMPOSTER_DEAD", team.getPrefix()); - } else if (team.getPlayers().contains(current) && team.getPlayers().contains(imposter.get(team))) { + } else if (team.getAlivePlayers() <= 2 && team.getPlayers().contains(imposter.get(team))) { win(Fight.getOpposite(team), "WIN_CREWMATE_DEAD", Fight.getOpposite(team).getPrefix()); } } -- 2.39.2 From 9b4eaa7a57c84bf22f07fdbbbf00fd723a3fcb1b Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 8 Oct 2022 18:00:31 +0200 Subject: [PATCH 9/9] Fix WinconditionAmongUs --- .../steamwar/fightsystem/winconditions/WinconditionAmongUs.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java index 39ee800..0be9472 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/winconditions/WinconditionAmongUs.java @@ -80,7 +80,7 @@ public class WinconditionAmongUs extends Wincondition implements Listener { FightPlayer current = team.getFightPlayer(player); if (current == imposter.get(team)) { win(team, "WIN_IMPOSTER_DEAD", team.getPrefix()); - } else if (team.getAlivePlayers() <= 2 && team.getPlayers().contains(imposter.get(team))) { + } else if (team.getAlivePlayers() <= 2 && imposter.get(team).isLiving()) { win(Fight.getOpposite(team), "WIN_CREWMATE_DEAD", Fight.getOpposite(team).getPrefix()); } } -- 2.39.2