SteamWar/FightSystem
Archiviert
13
1
Dieses Repository wurde am 2024-08-05 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
FightSystem/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightPlayer.java

73 Zeilen
1.6 KiB
Java

2019-09-05 18:26:13 +02:00
package de.steamwar.fightsystem.fight;
import de.steamwar.fightsystem.FightSystem;
2019-09-05 18:26:13 +02:00
import de.steamwar.fightsystem.kit.KitManager;
2019-11-16 08:37:33 +01:00
import de.steamwar.fightsystem.Config;
2019-09-05 18:26:13 +02:00
import de.steamwar.fightsystem.kit.Kit;
import org.bukkit.entity.Player;
public class FightPlayer {
private final Player player;
2019-09-05 18:26:13 +02:00
private final FightTeam team;
private boolean isOut;
private Kit kit;
private int kills;
public void sendMessage(String message) {
2019-02-23 16:07:31 +01:00
if (this.player != null && this.player.isOnline())
this.player.sendMessage(message);
}
2019-09-05 18:26:13 +02:00
FightPlayer(Player player, FightTeam team) {
this.player = player;
2019-09-05 18:26:13 +02:00
this.team = team;
this.isOut = false;
2019-04-13 16:30:25 +02:00
kit = KitManager.getKitByName(Config.MemberDefault);
kills = 0;
}
2019-09-05 18:26:13 +02:00
public void setOut() {
isOut = true;
}
public Player getPlayer() {
return this.player;
}
2019-09-05 18:26:13 +02:00
public boolean isLiving() {
return !this.isOut;
}
public boolean isLeader() {
2019-09-05 18:26:13 +02:00
FightPlayer leader = team.getLeader();
return leader != null && leader.getPlayer() == player;
}
public Kit getKit() {
return kit;
}
public void setKit(Kit kit) {
this.kit = kit;
}
2019-09-05 18:26:13 +02:00
public FightTeam getTeam(){
return team;
}
public int getKills(){
return kills;
}
public void addKill(){
kills++;
}
public boolean canEntern(){
if(Config.EnterStages.size() <= kit.getEnterStage() || kit.getEnterStage() < 0)
return false;
return Config.EnterStages.get(kit.getEnterStage()) >= FightSystem.getFightTime();
}
}