Dieser Commit ist enthalten in:
Ursprung
c4116cba97
Commit
b750433f91
@ -118,6 +118,7 @@ public class FightSystem extends JavaPlugin {
|
||||
|
||||
new HellsBells();
|
||||
new Meteor();
|
||||
new WinconditionAmongUs();
|
||||
|
||||
new NoPlayersOnlineCountdown();
|
||||
new PreSchemCountdown();
|
||||
|
@ -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!
|
||||
|
@ -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.
|
@ -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<FightPlayer> fightPlayers) {
|
||||
List<FightPlayer> fightPlayerList = new ArrayList<>(fightPlayers);
|
||||
return fightPlayerList.get(random.nextInt(fightPlayerList.size()));
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren