More Cake Wars achievements

This commit is contained in:
Sam 2017-10-23 19:30:31 +01:00 committed by Alexander Meech
parent 8632212297
commit ff393c2b4e
6 changed files with 93 additions and 4 deletions

View File

@ -1376,10 +1376,46 @@ public enum Achievement
new String[] {"II","III","IV","V","X"},
AchievementCategory.MOBA),
CAKE_WARS_KILLS("Cake Slayer", 5000,
CAKE_WARS_WIN("Cake Dinners", 0,
new String[]{"Cake Wars.Wins"},
new String[]{"+1 for each Win"},
new int[][] {new int[] {500,0,500}, new int[] {500,0,500}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{2500,0,2500}, new int[]{5000,0,5000}},
new int[]{1,5,10,25,50,75,100},
"I",
new String[] {"II","III","IV","V","VI","VII","VIII","Complete"},
AchievementCategory.CAKE_WARS),
CAKE_WARS_KILLS("Cake Slayer", 0,
new String[]{"Cake Wars.Kills"},
new String[]{"+1 for each kill"},
new int[]{50,100,200,400,1000},
new String[]{"+1 for each Kill"},
new int[][] {new int[] {500,0,500}, new int[] {500,0,500}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{2500,0,2500}, new int[]{5000,0,5000}},
new int[]{10,50,100,250,500,750,1000},
"I",
new String[] {"II","III","IV","V","VI","VII","VIII","Complete"},
AchievementCategory.CAKE_WARS),
CAKE_WARS_BITES("Big Appetite", 0,
new String[]{"Cake Wars.Bites"},
new String[]{"+1 for each Cake Bite"},
new int[][] {new int[] {500,0,500}, new int[] {500,0,500}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{2500,0,2500}, new int[]{5000,0,5000}},
new int[]{5,25,50,125,250,375,500},
"I",
new String[] {"II","III","IV","V","VI","VII","VIII","Complete"},
AchievementCategory.CAKE_WARS),
CAKE_WARS_CHESTS("Loot Fanatic", 0,
new String[]{"Cake Wars.ChestsOpened"},
new String[]{"+1 for each Floating Island", "chest opened"},
new int[][] {new int[] {500,0,500}, new int[] {500,0,500}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{1000,0,1000}, new int[]{2500,0,2500}, new int[]{5000,0,5000}},
new int[]{5,25,50,125,250,375,500},
"I",
new String[] {"II","III","IV","V","VI","VII","VIII","Complete"},
AchievementCategory.CAKE_WARS),
CAKE_WARS_GET_GOOD("Get Good", 0,
new String[]{"Cake Wars.GetGood"},
new String[]{"Kill a player while falling", "from a great height.", "Then save yourself from dieing."},
new int[]{1},
AchievementCategory.CAKE_WARS),
;

View File

@ -254,7 +254,7 @@ public enum AchievementCategory
StatDisplay.DEATHS,
StatDisplay.GEMS_EARNED,
},
Material.CAKE, 0, GameCategory.ARCADE, null, false, GameDisplay.CakeWars.getGameId());
Material.CAKE, 0, GameCategory.CLASSICS, null, false, GameDisplay.CakeWars.getGameId());
private String _name;
private String[] _statsToPull;

View File

@ -36,6 +36,7 @@ import nautilus.game.arcade.game.games.cakewars.module.CakePointModule;
import nautilus.game.arcade.game.games.cakewars.module.CakeShopModule;
import nautilus.game.arcade.game.games.cakewars.module.CakeSpawnerModule;
import nautilus.game.arcade.game.games.cakewars.module.CakeTeamModule;
import nautilus.game.arcade.game.games.cakewars.trackers.GetGoodStatTracker;
import nautilus.game.arcade.game.modules.CustomScoreboardModule;
import nautilus.game.arcade.game.modules.EnderPearlModule;
import nautilus.game.arcade.game.modules.capturepoint.CapturePointModule;
@ -106,6 +107,10 @@ public class CakeWars extends TeamGame
GameTimeout = TimeUnit.HOURS.toMillis(1);
_help = TIPS;
registerStatTrackers(
new GetGoodStatTracker(this)
);
manager.GetCreature().SetDisableCustomDrops(true);
new AbsorptionFix(this);

View File

@ -222,6 +222,7 @@ public class CakeTeamModule extends CakeModule
});
_game.AddGems(player, 4, "Cake Bites", true, true);
_game.AddStat(player, "Bites", 1, false, false);
byte data = block.getData();

View File

@ -0,0 +1,43 @@
package nautilus.game.arcade.game.games.cakewars.trackers;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import mineplex.core.common.util.UtilPlayer;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.stats.StatTracker;
public class GetGoodStatTracker extends StatTracker<Game>
{
private static final int MIN_FALL_DISTANCE = 10;
public GetGoodStatTracker(Game game)
{
super(game);
}
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event)
{
Player player = event.getEntity();
Player killer = player.getKiller();
if (killer == null || killer.getFallDistance() < MIN_FALL_DISTANCE)
{
return;
}
getGame().getArcadeManager().runSyncLater(() ->
{
if (!player.isOnline() || UtilPlayer.isSpectator(killer))
{
return;
}
getGame().AddStat(player, "GetGood", 1, false, false);
}, 60);
}
}

View File

@ -18,6 +18,7 @@ import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.Chest;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerInteractEvent;
@ -198,6 +199,9 @@ public class ChestLootModule extends Module
return;
}
Player player = event.getPlayer();
getGame().AddStat(player, "ChestsOpened", 1, false, false);
metadata.Opened = true;
metadata.OpenedAt = System.currentTimeMillis();
metadata.populateChest((Chest) block.getState());