Live op numero uno
This commit is contained in:
parent
eec20cc620
commit
c3bd123ea1
@ -131,6 +131,7 @@ public class CastleAssault extends TeamGame
|
|||||||
private ChestLoot _miscGear = new ChestLoot();
|
private ChestLoot _miscGear = new ChestLoot();
|
||||||
|
|
||||||
private ObjectiveTNTSpawner _tntSpawner;
|
private ObjectiveTNTSpawner _tntSpawner;
|
||||||
|
private Map<GameTeam, Integer> _teamKills = new HashMap<>();
|
||||||
|
|
||||||
private boolean _writeScoreboard = true;
|
private boolean _writeScoreboard = true;
|
||||||
|
|
||||||
@ -186,6 +187,7 @@ public class CastleAssault extends TeamGame
|
|||||||
this.CrownsEnabled = true;
|
this.CrownsEnabled = true;
|
||||||
this.FirstKillReward = 20;
|
this.FirstKillReward = 20;
|
||||||
this.GemKillDeathRespawn = 1;
|
this.GemKillDeathRespawn = 1;
|
||||||
|
this.GameTimeout = -1;
|
||||||
|
|
||||||
new CompassModule()
|
new CompassModule()
|
||||||
.setGiveCompass(true)
|
.setGiveCompass(true)
|
||||||
@ -862,6 +864,55 @@ public class CastleAssault extends TeamGame
|
|||||||
}
|
}
|
||||||
|
|
||||||
AddStat(player, GetKit(player).GetName() + "KitKills", 1, false, false);
|
AddStat(player, GetKit(player).GetName() + "KitKills", 1, false, false);
|
||||||
|
_teamKills.merge(GetTeam(player), 1, Integer::sum);
|
||||||
|
if (GetTeam(player).GetColor() == ChatColor.RED)
|
||||||
|
{
|
||||||
|
GameTeam enemy = GetTeam(ChatColor.AQUA);
|
||||||
|
TeamCrystal[] crystals = _crystals.get(enemy).stream().filter(TeamCrystal::isActive).toArray(size -> new TeamCrystal[size]);
|
||||||
|
if (crystals.length > 0)
|
||||||
|
{
|
||||||
|
if (_teamKills.getOrDefault(GetTeam(player), 0) % 20 == 0)
|
||||||
|
{
|
||||||
|
crystals[UtilMath.r(crystals.length)].destroy();
|
||||||
|
if (crystals.length > 1)
|
||||||
|
{
|
||||||
|
Bukkit.broadcastMessage(F.main("Game", "One of " + F.elem(enemy.GetFormattedName() + "'s Crystals") + " has been destroyed!"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Bukkit.broadcastMessage(F.main("Game", "All of " + F.elem(enemy.GetFormattedName() + "'s Crystals") + " have been destroyed and " + F.elem(_kings.get(enemy).getName(false)) + " is now vulnerable!"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_kings.get(enemy).handleDamage(player.getName(), 10, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GameTeam enemy = GetTeam(ChatColor.RED);
|
||||||
|
TeamCrystal[] crystals = _crystals.get(enemy).stream().filter(TeamCrystal::isActive).toArray(size -> new TeamCrystal[size]);
|
||||||
|
if (crystals.length > 0)
|
||||||
|
{
|
||||||
|
if (_teamKills.getOrDefault(GetTeam(player), 0) % 20 == 0)
|
||||||
|
{
|
||||||
|
crystals[UtilMath.r(crystals.length)].destroy();
|
||||||
|
if (crystals.length > 1)
|
||||||
|
{
|
||||||
|
Bukkit.broadcastMessage(F.main("Game", "One of " + F.elem(enemy.GetFormattedName() + "'s Crystals") + " has been destroyed!"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Bukkit.broadcastMessage(F.main("Game", "All of " + F.elem(enemy.GetFormattedName() + "'s Crystals") + " have been destroyed and " + F.elem(_kings.get(enemy).getName(false)) + " is now vulnerable!"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_kings.get(enemy).handleDamage(player.getName(), 10, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (UtilPlayer.isSpectator(player))
|
if (UtilPlayer.isSpectator(player))
|
||||||
{
|
{
|
||||||
@ -970,7 +1021,7 @@ public class CastleAssault extends TeamGame
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Bukkit.broadcastMessage(F.main("Game", "All of " + F.elem(crystal.getOwner().GetFormattedName() + "'s Crystals") + " has been destroyed and " + F.elem(_kings.get(crystal.getOwner()).getName(false)) + " is now vulnerable!"));
|
Bukkit.broadcastMessage(F.main("Game", "All of " + F.elem(crystal.getOwner().GetFormattedName() + "'s Crystals") + " have been destroyed and " + F.elem(_kings.get(crystal.getOwner()).getName(false)) + " is now vulnerable!"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
import java.util.WeakHashMap;
|
import java.util.WeakHashMap;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -48,6 +49,7 @@ import org.bukkit.material.MaterialData;
|
|||||||
import org.bukkit.metadata.MetadataValue;
|
import org.bukkit.metadata.MetadataValue;
|
||||||
|
|
||||||
import mineplex.core.Managers;
|
import mineplex.core.Managers;
|
||||||
|
import mineplex.core.common.Pair;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilAction;
|
import mineplex.core.common.util.UtilAction;
|
||||||
@ -60,7 +62,9 @@ import mineplex.core.common.util.UtilMath;
|
|||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
import mineplex.core.itemstack.ItemBuilder;
|
import mineplex.core.itemstack.ItemBuilder;
|
||||||
|
import mineplex.core.leaderboard.Leaderboard;
|
||||||
import mineplex.core.leaderboard.LeaderboardManager;
|
import mineplex.core.leaderboard.LeaderboardManager;
|
||||||
|
import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType;
|
||||||
import mineplex.core.loot.ChestLoot;
|
import mineplex.core.loot.ChestLoot;
|
||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
@ -83,12 +87,14 @@ import nautilus.game.arcade.game.games.castleassault.kits.KitPlayer;
|
|||||||
import nautilus.game.arcade.game.games.castleassault.kits.KitTank;
|
import nautilus.game.arcade.game.games.castleassault.kits.KitTank;
|
||||||
import nautilus.game.arcade.game.modules.compass.CompassModule;
|
import nautilus.game.arcade.game.modules.compass.CompassModule;
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
|
import nautilus.game.arcade.managers.lobby.current.NewGameLobbyManager;
|
||||||
|
|
||||||
public class CastleAssaultTDM extends TeamGame
|
public class CastleAssaultTDM extends TeamGame
|
||||||
{
|
{
|
||||||
private static final int MAX_FLINT_AND_STEEL_USES = 4;
|
private static final int MAX_FLINT_AND_STEEL_USES = 4;
|
||||||
private static final int ITEMS_PER_CHEST = 5;
|
private static final int ITEMS_PER_CHEST = 5;
|
||||||
private static final long TIME_TILL_REFILL = 2 * 60 * 1000;
|
private static final long TIME_TILL_REFILL = 2 * 60 * 1000;
|
||||||
|
private static final int KILLS_TO_WIN = 50;
|
||||||
|
|
||||||
private long _lastRefill;
|
private long _lastRefill;
|
||||||
|
|
||||||
@ -122,7 +128,22 @@ public class CastleAssaultTDM extends TeamGame
|
|||||||
//new KitNinja(manager),
|
//new KitNinja(manager),
|
||||||
new KitTank(manager)
|
new KitTank(manager)
|
||||||
},
|
},
|
||||||
new String[] {"AlexTheCoder is awesome!"});
|
new String[]
|
||||||
|
{
|
||||||
|
"Work with your team",
|
||||||
|
"To slay the enemy.",
|
||||||
|
"First team to 50 kills",
|
||||||
|
"Wins the game and glory!"
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
_help = new String[]
|
||||||
|
{
|
||||||
|
"Purchase kit upgrades by earning and spending crowns from games",
|
||||||
|
"Each kit has special starter items, be sure to use them to your advantage in fights",
|
||||||
|
"Go on Kill Streaks to earn Kill Streak Rewards to obtain better armor & weapons!",
|
||||||
|
"Chests refill every 2 minutes with potions, golden applegates, fishing rods, and other useful PvP items!"
|
||||||
|
};
|
||||||
|
|
||||||
this.StrictAntiHack = true;
|
this.StrictAntiHack = true;
|
||||||
this.HungerSet = 20;
|
this.HungerSet = 20;
|
||||||
@ -143,6 +164,7 @@ public class CastleAssaultTDM extends TeamGame
|
|||||||
this.CrownsEnabled = true;
|
this.CrownsEnabled = true;
|
||||||
this.FirstKillReward = 20;
|
this.FirstKillReward = 20;
|
||||||
this.GemKillDeathRespawn = 1;
|
this.GemKillDeathRespawn = 1;
|
||||||
|
this.GameTimeout = -1;
|
||||||
|
|
||||||
new CompassModule()
|
new CompassModule()
|
||||||
.setGiveCompass(true)
|
.setGiveCompass(true)
|
||||||
@ -153,33 +175,33 @@ public class CastleAssaultTDM extends TeamGame
|
|||||||
_flintAndSteel = new ItemBuilder(Material.FLINT_AND_STEEL).setData((short) (Material.FLINT_AND_STEEL.getMaxDurability() - MAX_FLINT_AND_STEEL_USES));
|
_flintAndSteel = new ItemBuilder(Material.FLINT_AND_STEEL).setData((short) (Material.FLINT_AND_STEEL.getMaxDurability() - MAX_FLINT_AND_STEEL_USES));
|
||||||
generateLoot();
|
generateLoot();
|
||||||
|
|
||||||
// if (manager.IsRewardStats())
|
if (manager.IsRewardStats())
|
||||||
// {
|
{
|
||||||
// if (manager.GetLobby() instanceof NewGameLobbyManager)
|
if (manager.GetLobby() instanceof NewGameLobbyManager)
|
||||||
// {
|
{
|
||||||
// Map<String, List<Location>> lobbyCustomLocs = ((NewGameLobbyManager)manager.GetLobby()).getCustomLocs();
|
Map<String, List<Location>> lobbyCustomLocs = ((NewGameLobbyManager)manager.GetLobby()).getCustomLocs();
|
||||||
// if (lobbyCustomLocs.containsKey("TOP_DAILY_WINS"))
|
if (lobbyCustomLocs.containsKey("TOP_DAILY_WINS"))
|
||||||
// {
|
{
|
||||||
// Location loc = lobbyCustomLocs.get("TOP_DAILY_WINS").get(0);
|
Location loc = lobbyCustomLocs.get("TOP_DAILY_WINS").get(0);
|
||||||
// Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULT_DAILY_WINS", new Leaderboard("Top Daily Wins", Pair.create("Win", "Wins"), new String[] {"Castle Assault TDM.Wins"}, LeaderboardSQLType.DAILY_SEASON, loc, 10));
|
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULTTDM_DAILY_WINS", new Leaderboard("Top Daily Wins", Pair.create("Win", "Wins"), new String[] {"Castle Assault TDM.Wins"}, LeaderboardSQLType.DAILY, loc, 10));
|
||||||
// }
|
}
|
||||||
// if (lobbyCustomLocs.containsKey("TOP_DAILY_KILLS"))
|
if (lobbyCustomLocs.containsKey("TOP_DAILY_KILLS"))
|
||||||
// {
|
{
|
||||||
// Location loc = lobbyCustomLocs.get("TOP_DAILY_KILLS").get(0);
|
Location loc = lobbyCustomLocs.get("TOP_DAILY_KILLS").get(0);
|
||||||
// Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULT_DAILY_KILLS", new Leaderboard("Top Daily Kills", Pair.create("Kill", "Kills"), new String[] {"Castle Assault TDM.Kills"}, LeaderboardSQLType.DAILY_SEASON, loc, 10));
|
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULTTDM_DAILY_KILLS", new Leaderboard("Top Daily Kills", Pair.create("Kill", "Kills"), new String[] {"Castle Assault TDM.Kills"}, LeaderboardSQLType.DAILY, loc, 10));
|
||||||
// }
|
}
|
||||||
// if (lobbyCustomLocs.containsKey("TOP_WINS"))
|
if (lobbyCustomLocs.containsKey("TOP_WINS"))
|
||||||
// {
|
{
|
||||||
// Location loc = lobbyCustomLocs.get("TOP_WINS").get(0);
|
Location loc = lobbyCustomLocs.get("TOP_WINS").get(0);
|
||||||
// Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULT_WINS", new Leaderboard("Top Wins", Pair.create("Win", "Wins"), new String[] {"Castle Assault TDM.Wins"}, LeaderboardSQLType.ALL_SEASON, loc, 10));
|
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULTTDM_WINS", new Leaderboard("Top Wins", Pair.create("Win", "Wins"), new String[] {"Castle Assault TDM.Wins"}, LeaderboardSQLType.ALL_SEASON, loc, 10));
|
||||||
// }
|
}
|
||||||
// if (lobbyCustomLocs.containsKey("TOP_KILLS"))
|
if (lobbyCustomLocs.containsKey("TOP_KILLS"))
|
||||||
// {
|
{
|
||||||
// Location loc = lobbyCustomLocs.get("TOP_KILLS").get(0);
|
Location loc = lobbyCustomLocs.get("TOP_KILLS").get(0);
|
||||||
// Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULT_KILLS", new Leaderboard("Top Kills", Pair.create("Kill", "Kills"), new String[] {"Castle Assault TDM.Kills"}, LeaderboardSQLType.ALL_SEASON, loc, 10));
|
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULTTDM_KILLS", new Leaderboard("Top Kills", Pair.create("Kill", "Kills"), new String[] {"Castle Assault TDM.Kills"}, LeaderboardSQLType.ALL_SEASON, loc, 10));
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateLoot()
|
private void generateLoot()
|
||||||
@ -274,10 +296,10 @@ public class CastleAssaultTDM extends TeamGame
|
|||||||
GameTeam red = GetTeam(ChatColor.RED);
|
GameTeam red = GetTeam(ChatColor.RED);
|
||||||
GameTeam blue = GetTeam(ChatColor.AQUA);
|
GameTeam blue = GetTeam(ChatColor.AQUA);
|
||||||
Scoreboard.write(red.GetFormattedName() + " Team Kills");
|
Scoreboard.write(red.GetFormattedName() + " Team Kills");
|
||||||
Scoreboard.write(_teamKills.get(red) + "/50");
|
Scoreboard.write(_teamKills.get(red) + "/" + KILLS_TO_WIN);
|
||||||
Scoreboard.writeNewLine();
|
Scoreboard.writeNewLine();
|
||||||
Scoreboard.write(blue.GetFormattedName() + " Team Kills");
|
Scoreboard.write(blue.GetFormattedName() + " Team Kills");
|
||||||
Scoreboard.write(_teamKills.get(blue) + "/50");
|
Scoreboard.write(_teamKills.get(blue) + "/" + KILLS_TO_WIN);
|
||||||
Scoreboard.draw();
|
Scoreboard.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,12 +385,16 @@ public class CastleAssaultTDM extends TeamGame
|
|||||||
AddGems(player, 10, "Participation", false, false);
|
AddGems(player, 10, "Participation", false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
int crowns = 0;
|
int crowns = 0;
|
||||||
for (GemData data : GetGems(player).values())
|
for (Entry<String, GemData> data : GetGems(player).entrySet())
|
||||||
{
|
{
|
||||||
crowns += data.Gems;
|
if (data.getKey().equals("Kills"))
|
||||||
|
{
|
||||||
|
crowns += data.getValue().Gems;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
int streak = _streakData.getOrDefault(player, new KillStreakData()).getBestStreak();
|
int streak = _streakData.getOrDefault(player, new KillStreakData()).getBestStreak();
|
||||||
if (streak >= 2 && streak < 4)
|
if (streak >= 2 && streak < 4)
|
||||||
{
|
{
|
||||||
@ -376,7 +402,7 @@ public class CastleAssaultTDM extends TeamGame
|
|||||||
}
|
}
|
||||||
else if (streak >= 4 && streak < 6)
|
else if (streak >= 4 && streak < 6)
|
||||||
{
|
{
|
||||||
AddGems(player, crowns, streak + " Player Kill Streak", false, false);
|
AddGems(player, 1 * crowns, streak + " Player Kill Streak", false, false);
|
||||||
}
|
}
|
||||||
else if (streak >= 6 && streak < 8)
|
else if (streak >= 6 && streak < 8)
|
||||||
{
|
{
|
||||||
@ -387,22 +413,6 @@ public class CastleAssaultTDM extends TeamGame
|
|||||||
AddGems(player, 2 * crowns, streak + " Player Kill Streak", false, false);
|
AddGems(player, 2 * crowns, streak + " Player Kill Streak", false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetKit(player) != null)
|
|
||||||
{
|
|
||||||
KitPlayer kit = (KitPlayer) GetKit(player);
|
|
||||||
int kitLevel = kit.getUpgradeLevel(player.getUniqueId());
|
|
||||||
if (kitLevel > 0)
|
|
||||||
{
|
|
||||||
int crowns = 0;
|
|
||||||
for (GemData data : GetGems(player).values())
|
|
||||||
{
|
|
||||||
crowns += data.Gems;
|
|
||||||
}
|
|
||||||
|
|
||||||
AddGems(player, (0.5 * kitLevel) * crowns, kit.GetName() + " Kit Level Bonus", false, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SetState(GameState.End);
|
SetState(GameState.End);
|
||||||
@ -433,7 +443,7 @@ public class CastleAssaultTDM extends TeamGame
|
|||||||
|
|
||||||
GameTeam red = GetTeam(ChatColor.RED);
|
GameTeam red = GetTeam(ChatColor.RED);
|
||||||
GameTeam blue = GetTeam(ChatColor.AQUA);
|
GameTeam blue = GetTeam(ChatColor.AQUA);
|
||||||
if (_teamKills.get(blue).intValue() >= 50)
|
if (_teamKills.get(blue).intValue() >= KILLS_TO_WIN)
|
||||||
{
|
{
|
||||||
AnnounceEnd(blue);
|
AnnounceEnd(blue);
|
||||||
writeFinalScoreboard(blue.GetColor() + blue.GetName(), _teamKills.get(blue));
|
writeFinalScoreboard(blue.GetColor() + blue.GetName(), _teamKills.get(blue));
|
||||||
@ -454,12 +464,16 @@ public class CastleAssaultTDM extends TeamGame
|
|||||||
AddGems(player, 10, "Participation", false, false);
|
AddGems(player, 10, "Participation", false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
int crowns = 0;
|
int crowns = 0;
|
||||||
for (GemData data : GetGems(player).values())
|
for (Entry<String, GemData> data : GetGems(player).entrySet())
|
||||||
{
|
{
|
||||||
crowns += data.Gems;
|
if (data.getKey().equals("Kills"))
|
||||||
|
{
|
||||||
|
crowns += data.getValue().Gems;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
int streak = _streakData.getOrDefault(player, new KillStreakData()).getBestStreak();
|
int streak = _streakData.getOrDefault(player, new KillStreakData()).getBestStreak();
|
||||||
if (streak >= 2 && streak < 4)
|
if (streak >= 2 && streak < 4)
|
||||||
{
|
{
|
||||||
@ -467,7 +481,7 @@ public class CastleAssaultTDM extends TeamGame
|
|||||||
}
|
}
|
||||||
else if (streak >= 4 && streak < 6)
|
else if (streak >= 4 && streak < 6)
|
||||||
{
|
{
|
||||||
AddGems(player, crowns, streak + " Player Kill Streak", false, false);
|
AddGems(player, 1 * crowns, streak + " Player Kill Streak", false, false);
|
||||||
}
|
}
|
||||||
else if (streak >= 6 && streak < 8)
|
else if (streak >= 6 && streak < 8)
|
||||||
{
|
{
|
||||||
@ -478,25 +492,12 @@ public class CastleAssaultTDM extends TeamGame
|
|||||||
AddGems(player, 2 * crowns, streak + " Player Kill Streak", false, false);
|
AddGems(player, 2 * crowns, streak + " Player Kill Streak", false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
KitPlayer kit = (KitPlayer) GetKit(player);
|
|
||||||
int kitLevel = kit.getUpgradeLevel(player.getUniqueId());
|
|
||||||
if (kitLevel > 0)
|
|
||||||
{
|
|
||||||
int crowns = 0;
|
|
||||||
for (GemData data : GetGems(player).values())
|
|
||||||
{
|
|
||||||
crowns += data.Gems;
|
|
||||||
}
|
|
||||||
|
|
||||||
AddGems(player, (0.5 * kitLevel) * crowns, kit.GetName() + " Kit Level Bonus", false, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SetState(GameState.End);
|
SetState(GameState.End);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (_teamKills.get(red).intValue() >= 50)
|
if (_teamKills.get(red).intValue() >= KILLS_TO_WIN)
|
||||||
{
|
{
|
||||||
AnnounceEnd(red);
|
AnnounceEnd(red);
|
||||||
writeFinalScoreboard(red.GetColor() + red.GetName(), _teamKills.get(red));
|
writeFinalScoreboard(red.GetColor() + red.GetName(), _teamKills.get(red));
|
||||||
@ -517,12 +518,16 @@ public class CastleAssaultTDM extends TeamGame
|
|||||||
AddGems(player, 10, "Participation", false, false);
|
AddGems(player, 10, "Participation", false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
int crowns = 0;
|
int crowns = 0;
|
||||||
for (GemData data : GetGems(player).values())
|
for (Entry<String, GemData> data : GetGems(player).entrySet())
|
||||||
{
|
{
|
||||||
crowns += data.Gems;
|
if (data.getKey().equals("Kills"))
|
||||||
|
{
|
||||||
|
crowns += data.getValue().Gems;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
int streak = _streakData.getOrDefault(player, new KillStreakData()).getBestStreak();
|
int streak = _streakData.getOrDefault(player, new KillStreakData()).getBestStreak();
|
||||||
if (streak >= 2 && streak < 4)
|
if (streak >= 2 && streak < 4)
|
||||||
{
|
{
|
||||||
@ -530,7 +535,7 @@ public class CastleAssaultTDM extends TeamGame
|
|||||||
}
|
}
|
||||||
else if (streak >= 4 && streak < 6)
|
else if (streak >= 4 && streak < 6)
|
||||||
{
|
{
|
||||||
AddGems(player, crowns, streak + " Player Kill Streak", false, false);
|
AddGems(player, 1 * crowns, streak + " Player Kill Streak", false, false);
|
||||||
}
|
}
|
||||||
else if (streak >= 6 && streak < 8)
|
else if (streak >= 6 && streak < 8)
|
||||||
{
|
{
|
||||||
@ -541,19 +546,6 @@ public class CastleAssaultTDM extends TeamGame
|
|||||||
AddGems(player, 2 * crowns, streak + " Player Kill Streak", false, false);
|
AddGems(player, 2 * crowns, streak + " Player Kill Streak", false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
KitPlayer kit = (KitPlayer) GetKit(player);
|
|
||||||
int kitLevel = kit.getUpgradeLevel(player.getUniqueId());
|
|
||||||
if (kitLevel > 0)
|
|
||||||
{
|
|
||||||
int crowns = 0;
|
|
||||||
for (GemData data : GetGems(player).values())
|
|
||||||
{
|
|
||||||
crowns += data.Gems;
|
|
||||||
}
|
|
||||||
|
|
||||||
AddGems(player, (0.5 * kitLevel) * crowns, kit.GetName() + " Kit Level Bonus", false, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SetState(GameState.End);
|
SetState(GameState.End);
|
||||||
@ -587,10 +579,10 @@ public class CastleAssaultTDM extends TeamGame
|
|||||||
Manager.GetDamage().SetEnabled(true);
|
Manager.GetDamage().SetEnabled(true);
|
||||||
Manager.GetExplosion().setEnabled(true);
|
Manager.GetExplosion().setEnabled(true);
|
||||||
Manager.GetCreature().SetDisableCustomDrops(false);
|
Manager.GetCreature().SetDisableCustomDrops(false);
|
||||||
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULT_DAILY_WINS");
|
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULTTDM_DAILY_WINS");
|
||||||
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULT_DAILY_KILLS");
|
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULTTDM_DAILY_KILLS");
|
||||||
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULT_WINS");
|
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULTTDM_WINS");
|
||||||
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULT_KILLS");
|
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULTTDM_KILLS");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,10 +104,16 @@ public class TeamKing
|
|||||||
|
|
||||||
public boolean handleDamage(String player, double damage)
|
public boolean handleDamage(String player, double damage)
|
||||||
{
|
{
|
||||||
if (!UtilTime.elapsed(_lastDamage, 400))
|
return handleDamage(player, damage, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean handleDamage(String player, double damage, boolean force)
|
||||||
|
{
|
||||||
|
if (!UtilTime.elapsed(_lastDamage, 400) && !force)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_lastDamager = player;
|
_lastDamager = player;
|
||||||
_lastDamage = System.currentTimeMillis();
|
_lastDamage = System.currentTimeMillis();
|
||||||
|
|
||||||
|
@ -65,36 +65,36 @@ public class KitFighter extends KitPlayer
|
|||||||
if (level == 0)
|
if (level == 0)
|
||||||
{
|
{
|
||||||
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
||||||
player.getInventory().setItem(1, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(1).setTitle(C.cPurple + "Golden Applegate").setLore(C.cGold + "Kit Item").build());
|
player.getInventory().setItem(1, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(1).setTitle(C.cPurple + "Golden Applegate").build());
|
||||||
}
|
}
|
||||||
else if (level == 1)
|
else if (level == 1)
|
||||||
{
|
{
|
||||||
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
||||||
player.getInventory().setItem(1, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(2).setTitle(C.cPurple + "Golden Applegate").setLore(C.cGold + "Kit Item").build());
|
player.getInventory().setItem(1, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(2).setTitle(C.cPurple + "Golden Applegate").build());
|
||||||
}
|
}
|
||||||
else if (level == 2)
|
else if (level == 2)
|
||||||
{
|
{
|
||||||
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
||||||
player.getInventory().setItem(1, new ItemBuilder(Material.FISHING_ROD).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
player.getInventory().setItem(1, new ItemBuilder(Material.FISHING_ROD).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
||||||
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(2).setTitle(C.cPurple + "Golden Applegate").setLore(C.cGold + "Kit Item").build());
|
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(2).setTitle(C.cPurple + "Golden Applegate").build());
|
||||||
}
|
}
|
||||||
else if (level == 3)
|
else if (level == 3)
|
||||||
{
|
{
|
||||||
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).addEnchantment(Enchantment.DAMAGE_ALL, 1).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).addEnchantment(Enchantment.DAMAGE_ALL, 1).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
||||||
player.getInventory().setItem(1, new ItemBuilder(Material.FISHING_ROD).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
player.getInventory().setItem(1, new ItemBuilder(Material.FISHING_ROD).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
||||||
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(2).setTitle(C.cPurple + "Golden Applegate").setLore(C.cGold + "Kit Item").build());
|
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(2).setTitle(C.cPurple + "Golden Applegate").build());
|
||||||
}
|
}
|
||||||
else if (level == 4)
|
else if (level == 4)
|
||||||
{
|
{
|
||||||
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).addEnchantment(Enchantment.DAMAGE_ALL, 1).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).addEnchantment(Enchantment.DAMAGE_ALL, 1).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
||||||
player.getInventory().setItem(1, new ItemBuilder(Material.FISHING_ROD).addEnchantment(Enchantment.KNOCKBACK, 2).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
player.getInventory().setItem(1, new ItemBuilder(Material.FISHING_ROD).addEnchantment(Enchantment.KNOCKBACK, 2).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
||||||
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(3).setTitle(C.cPurple + "Golden Applegate").setLore(C.cGold + "Kit Item").build());
|
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(3).setTitle(C.cPurple + "Golden Applegate").build());
|
||||||
}
|
}
|
||||||
else if (level == 5)
|
else if (level == 5)
|
||||||
{
|
{
|
||||||
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).addEnchantment(Enchantment.DAMAGE_ALL, 2).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).addEnchantment(Enchantment.DAMAGE_ALL, 2).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
||||||
player.getInventory().setItem(1, new ItemBuilder(Material.FISHING_ROD).addEnchantment(Enchantment.KNOCKBACK, 2).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
player.getInventory().setItem(1, new ItemBuilder(Material.FISHING_ROD).addEnchantment(Enchantment.KNOCKBACK, 2).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
||||||
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(3).setTitle(C.cPurple + "Golden Applegate").setLore(C.cGold + "Kit Item").build());
|
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(3).setTitle(C.cPurple + "Golden Applegate").build());
|
||||||
}
|
}
|
||||||
|
|
||||||
player.getInventory().setHelmet(new ItemBuilder(Material.DIAMOND_HELMET).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
player.getInventory().setHelmet(new ItemBuilder(Material.DIAMOND_HELMET).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
|
||||||
|
@ -39,7 +39,7 @@ public abstract class KitPlayer extends ProgressingKit
|
|||||||
|
|
||||||
protected void giveRegeneration(Player player)
|
protected void giveRegeneration(Player player)
|
||||||
{
|
{
|
||||||
player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 20 * 3, 3));
|
player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 20 * 5, 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user