Changes from testing
This commit is contained in:
parent
7f05ec0ecc
commit
9c7e83d5af
@ -251,6 +251,7 @@ public enum AchievementCategory
|
||||
StatDisplay.fromGame("Games Play", GameDisplay.CakeWars4, "Wins", "Losses"),
|
||||
StatDisplay.fromGame("Best Win Streak", GameDisplay.CakeWars4, "BestWinStreak"),
|
||||
StatDisplay.fromGame("Kills", GameDisplay.CakeWars4, "Kills"),
|
||||
StatDisplay.fromGame("Elimination Kills", GameDisplay.CakeWars4, "FinalKills"),
|
||||
StatDisplay.fromGame("Deaths", GameDisplay.CakeWars4, "Deaths"),
|
||||
StatDisplay.fromGame("Cake Bites", GameDisplay.CakeWars4, "Bites"),
|
||||
StatDisplay.fromGame("Whole Cakes", GameDisplay.CakeWars4, "EatWholeCake"),
|
||||
@ -260,6 +261,7 @@ public enum AchievementCategory
|
||||
StatDisplay.fromGame("Games Play", GameDisplay.CakeWarsDuos, "Wins", "Losses"),
|
||||
StatDisplay.fromGame("Best Win Streak", GameDisplay.CakeWarsDuos, "BestWinStreak"),
|
||||
StatDisplay.fromGame("Kills", GameDisplay.CakeWarsDuos, "Kills"),
|
||||
StatDisplay.fromGame("Elimination Kills", GameDisplay.CakeWarsDuos, "FinalKills"),
|
||||
StatDisplay.fromGame("Deaths", GameDisplay.CakeWarsDuos, "Deaths"),
|
||||
StatDisplay.fromGame("Cake Bites", GameDisplay.CakeWarsDuos, "Bites"),
|
||||
StatDisplay.fromGame("Whole Cakes", GameDisplay.CakeWarsDuos, "EatWholeCake"),
|
||||
|
@ -46,11 +46,7 @@ public class StaticLeaderboard extends LeaderboardDisplay
|
||||
text.addAll(_leaderboard.getFormattedEntries());
|
||||
|
||||
_hologram.setText(text.toArray(new String[0]));
|
||||
|
||||
if (!_hologram.isInUse())
|
||||
{
|
||||
_hologram.start();
|
||||
}
|
||||
_hologram.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -394,10 +394,10 @@ public class CakeWars extends TeamGame
|
||||
String two = "Cake Wars Duos.";
|
||||
String four = "Cake Wars Standard.";
|
||||
String bestStreakDuos = two + WinStreakModule.BEST_STREAK_STAT;
|
||||
String killsDuos = two + "Kills";
|
||||
String killsDuos = two + "FinalKills";
|
||||
String winsDuos = two + "Wins";
|
||||
String bestStreak4 = four + WinStreakModule.BEST_STREAK_STAT;
|
||||
String kills4 = four + "Kills";
|
||||
String kills4 = four + "FinalKills";
|
||||
String wins4 = four + "Wins";
|
||||
|
||||
LEADERBOARD_MANAGER.registerIfNotExists("CAKE_WARS",
|
||||
@ -427,15 +427,15 @@ public class CakeWars extends TeamGame
|
||||
)),
|
||||
|
||||
new DynamicLeaderboard(LEADERBOARD_MANAGER, Arrays.asList(
|
||||
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Kills", new Leaderboard(
|
||||
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Elimination Kills", new Leaderboard(
|
||||
LeaderboardSQLType.ALL,
|
||||
kills4
|
||||
), topKills),
|
||||
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Weekly Kills", new Leaderboard(
|
||||
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Weekly Elimination Kills", new Leaderboard(
|
||||
LeaderboardSQLType.WEEKLY,
|
||||
kills4
|
||||
), topKills),
|
||||
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Daily Kills", new Leaderboard(
|
||||
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Daily Elimination Kills", new Leaderboard(
|
||||
LeaderboardSQLType.DAILY,
|
||||
kills4
|
||||
), topKills)
|
||||
@ -466,15 +466,15 @@ public class CakeWars extends TeamGame
|
||||
)),
|
||||
|
||||
new DynamicLeaderboard(LEADERBOARD_MANAGER, Arrays.asList(
|
||||
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Kills", new Leaderboard(
|
||||
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Elimination Kills", new Leaderboard(
|
||||
LeaderboardSQLType.ALL,
|
||||
killsDuos
|
||||
), topKills),
|
||||
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Weekly Kills", new Leaderboard(
|
||||
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Weekly Elimination Kills", new Leaderboard(
|
||||
LeaderboardSQLType.WEEKLY,
|
||||
killsDuos
|
||||
), topKills),
|
||||
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Daily Kills", new Leaderboard(
|
||||
new StaticLeaderboard(LEADERBOARD_MANAGER, "Top Daily Elimination Kills", new Leaderboard(
|
||||
LeaderboardSQLType.DAILY,
|
||||
killsDuos
|
||||
), topKills)
|
||||
|
@ -100,15 +100,21 @@ public class CakePlayerModule extends CakeModule
|
||||
@EventHandler
|
||||
public void blockBreak(BlockBreakEvent event)
|
||||
{
|
||||
if (UtilBlock.airFoliage(event.getBlock()))
|
||||
if (!_game.IsLive())
|
||||
{
|
||||
event.getBlock().getDrops().clear();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_placedBlocks.contains(event.getBlock()))
|
||||
Block block = event.getBlock();
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
if (UtilBlock.airFoliage(event.getBlock()))
|
||||
{
|
||||
block.setType(Material.AIR);
|
||||
}
|
||||
else if (!_placedBlocks.contains(block))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
event.getPlayer().sendMessage(F.main("Game", "You cannot break blocks that have not been placed by players."));
|
||||
}
|
||||
}
|
||||
@ -124,7 +130,7 @@ public class CakePlayerModule extends CakeModule
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void damage(CustomDamageEvent event)
|
||||
public void saveInventory(CustomDamageEvent event)
|
||||
{
|
||||
Player player = event.GetDamageePlayer();
|
||||
|
||||
|
@ -84,7 +84,7 @@ public class CakeShopModule extends CakeModule
|
||||
new CakeShopItem(CakeShopItemType.AXE, new ItemStack(Material.IRON_AXE), 3),
|
||||
|
||||
// Arrow
|
||||
new CakeShopItem(CakeShopItemType.OTHER, new ItemStack(Material.ARROW, 3), 6),
|
||||
new CakeShopItem(CakeShopItemType.OTHER, new ItemStack(Material.ARROW, 3), 18),
|
||||
|
||||
// Blocks
|
||||
// Wool
|
||||
@ -173,7 +173,7 @@ public class CakeShopModule extends CakeModule
|
||||
for (CakeResource resource : CakeResource.values())
|
||||
{
|
||||
Location location = _game.WorldData.GetCustomLocs("SHOP " + teamName + " " + resource.name()).get(0);
|
||||
location.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory2d(location, cakeTeam.getCake())));
|
||||
location.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory2d(location, cakeTeam.getShop())));
|
||||
NPC npc = new NPC(-1, EntityType.VILLAGER, resource.getChatColor() + C.Bold + resource.getName() + " Shop", location, null, (byte) 0, null, null, null, null, "CAKE_NPC");
|
||||
|
||||
_manager.addNPC(npc, false);
|
||||
|
@ -19,7 +19,8 @@ public enum CakeTeamItem implements CakeItem
|
||||
"Protection",
|
||||
new ItemStack(Material.DIAMOND_CHESTPLATE),
|
||||
4,
|
||||
10
|
||||
10,
|
||||
18
|
||||
)
|
||||
{
|
||||
@Override
|
||||
@ -29,7 +30,7 @@ public enum CakeTeamItem implements CakeItem
|
||||
{
|
||||
if (UtilItem.isArmor(itemStack))
|
||||
{
|
||||
itemStack.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, level);
|
||||
itemStack.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, level);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -76,8 +77,7 @@ public enum CakeTeamItem implements CakeItem
|
||||
REGENERATION(
|
||||
"Healing Station",
|
||||
new ItemStack(Material.GOLDEN_APPLE),
|
||||
4,
|
||||
10
|
||||
4
|
||||
)
|
||||
{
|
||||
@Override
|
||||
|
@ -41,7 +41,7 @@ public class CakeTeam
|
||||
|
||||
private Hologram _cakeHologram;
|
||||
|
||||
public CakeTeam(CakeWars game, GameTeam team, Location edgeHologram, Location shopHologram, Location chest)
|
||||
CakeTeam(CakeWars game, GameTeam team, Location edgeHologram, Location shopHologram, Location chest)
|
||||
{
|
||||
_game = game;
|
||||
_team = team;
|
||||
@ -90,6 +90,16 @@ public class CakeTeam
|
||||
return _cake.getBlock().getType() == Material.CAKE_BLOCK;
|
||||
}
|
||||
|
||||
public GameTeam getGameTeam()
|
||||
{
|
||||
return _team;
|
||||
}
|
||||
|
||||
public Location getShop()
|
||||
{
|
||||
return _shop;
|
||||
}
|
||||
|
||||
public Location getChest()
|
||||
{
|
||||
return _chest;
|
||||
@ -100,11 +110,6 @@ public class CakeTeam
|
||||
return _cake;
|
||||
}
|
||||
|
||||
public GameTeam getGameTeam()
|
||||
{
|
||||
return _team;
|
||||
}
|
||||
|
||||
public Map<CakeTeamItem, Integer> getUpgrades()
|
||||
{
|
||||
return _upgrades;
|
||||
|
@ -312,6 +312,13 @@ public class CakeTeamModule extends CakeModule
|
||||
_game.Announce(F.main("Game", "The " + F.name(team.GetFormattedName()) + " team has been eliminated!"));
|
||||
}
|
||||
|
||||
Player killer = event.GetPlayer().getKiller();
|
||||
|
||||
if (killer != null)
|
||||
{
|
||||
_game.AddStat(killer, "FinalKills", 1, false, false);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -212,10 +212,11 @@ public class CapturePoint
|
||||
else
|
||||
{
|
||||
// Point back to a neutral state
|
||||
if (_progress == 0)
|
||||
if (_progress <= 0)
|
||||
{
|
||||
setBeaconColour(null);
|
||||
_side = team;
|
||||
_progress = 0;
|
||||
// Recursively call this method now that the first (same team) condition will be true
|
||||
capture(team, progress);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user