More missions
This commit is contained in:
parent
e4695b07f0
commit
cece5910a2
@ -4,12 +4,11 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import mineplex.core.gadget.event.ItemGadgetUseEvent;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.mission.MissionManager;
|
||||
import mineplex.core.mission.MissionTracker;
|
||||
import mineplex.core.mission.MissionTrackerType;
|
||||
|
||||
public class GadgetUseTracker extends MissionTracker<Class<? extends Gadget>>
|
||||
public class GadgetUseTracker extends MissionTracker
|
||||
{
|
||||
|
||||
public GadgetUseTracker(MissionManager manager)
|
||||
@ -20,6 +19,6 @@ public class GadgetUseTracker extends MissionTracker<Class<? extends Gadget>>
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void gadgetUse(ItemGadgetUseEvent event)
|
||||
{
|
||||
incrementProgress(event.getPlayer(), 1, null, event.getGadget().getClass());
|
||||
_manager.incrementProgress(event.getPlayer(), 1, _trackerType, null, event.getGadget().getClass());
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package mineplex.core.mission;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
|
||||
import mineplex.core.achievement.leveling.rewards.LevelCurrencyReward;
|
||||
import mineplex.core.achievement.leveling.rewards.LevelExperienceReward;
|
||||
@ -106,7 +108,7 @@ public class MissionPopulator
|
||||
|
||||
// Global Game Missions 100-199
|
||||
|
||||
MissionContext.<Material>newBuilder(manager, 100)
|
||||
MissionContext.newBuilder(manager, 100)
|
||||
.name("Enthusiast")
|
||||
.description("Play %s games")
|
||||
.games(GameDisplay.values())
|
||||
@ -160,7 +162,7 @@ public class MissionPopulator
|
||||
|
||||
// Turf Wars 200-299
|
||||
|
||||
MissionContext.<Boolean>newBuilder(manager, 200)
|
||||
MissionContext.newBuilder(manager, 200)
|
||||
.name("Juggler")
|
||||
.description("Kill %s players while in midair")
|
||||
.games(TurfWars)
|
||||
@ -227,7 +229,7 @@ public class MissionPopulator
|
||||
)
|
||||
.build();
|
||||
|
||||
MissionContext.newBuilder(manager, 301)
|
||||
MissionContext.newBuilder(manager, 302)
|
||||
.name("Streak!")
|
||||
.description("Guess the word %s times in a row")
|
||||
.games(Draw)
|
||||
@ -242,7 +244,7 @@ public class MissionPopulator
|
||||
|
||||
// Survival Games 400-499
|
||||
|
||||
MissionContext.newBuilder(manager, 400)
|
||||
MissionContext.<String>newBuilder(manager, 400)
|
||||
.name("Tickle Master")
|
||||
.description("Kill %s players with a feather")
|
||||
.games(SurvivalGames, SurvivalGamesTeams)
|
||||
@ -258,7 +260,7 @@ public class MissionPopulator
|
||||
|
||||
MissionContext.newBuilder(manager, 401)
|
||||
.name("Bojack Takedown")
|
||||
.description("Kill %s players while riding a horse.")
|
||||
.description("Kill %s players while riding a horse")
|
||||
.games(SurvivalGames, SurvivalGamesTeams)
|
||||
.xRange(1, 5)
|
||||
.tracker(SG_BOW_HORSE_KILL)
|
||||
@ -271,7 +273,7 @@ public class MissionPopulator
|
||||
|
||||
MissionContext.newBuilder(manager, 402)
|
||||
.name("Not Enough Supply")
|
||||
.description("Open %s supply drops.")
|
||||
.description("Open %s supply drops")
|
||||
.games(SurvivalGames, SurvivalGamesTeams)
|
||||
.xRange(2, 15)
|
||||
.tracker(SG_SUPPLY_DROP_OPEN)
|
||||
@ -284,7 +286,7 @@ public class MissionPopulator
|
||||
|
||||
MissionContext.<Material>newBuilder(manager, 403)
|
||||
.name("Diamond Weaponsmith")
|
||||
.description("Craft %s diamond swords.")
|
||||
.description("Craft %s diamond swords")
|
||||
.games(SurvivalGames, SurvivalGamesTeams)
|
||||
.xRange(1, 10)
|
||||
.tracker(GAME_CRAFT_ITEM)
|
||||
@ -298,7 +300,7 @@ public class MissionPopulator
|
||||
|
||||
MissionContext.<Material>newBuilder(manager, 404)
|
||||
.name("Gold Weaponsmith")
|
||||
.description("Craft %s gold swords.")
|
||||
.description("Craft %s gold swords")
|
||||
.games(SurvivalGames, SurvivalGamesTeams)
|
||||
.xRange(1, 10)
|
||||
.tracker(GAME_CRAFT_ITEM)
|
||||
@ -312,7 +314,7 @@ public class MissionPopulator
|
||||
|
||||
MissionContext.<Material>newBuilder(manager, 405)
|
||||
.name("Iron Weaponsmith")
|
||||
.description("Craft %s gold swords.")
|
||||
.description("Craft %s gold swords")
|
||||
.games(SurvivalGames, SurvivalGamesTeams)
|
||||
.xRange(1, 10)
|
||||
.tracker(GAME_CRAFT_ITEM)
|
||||
@ -326,7 +328,7 @@ public class MissionPopulator
|
||||
|
||||
MissionContext.<Material>newBuilder(manager, 406)
|
||||
.name("Why Thou")
|
||||
.description("Craft %s gold shovels.")
|
||||
.description("Craft %s gold shovels")
|
||||
.games(SurvivalGames, SurvivalGamesTeams)
|
||||
.xRange(1, 10)
|
||||
.tracker(GAME_CRAFT_ITEM)
|
||||
@ -338,9 +340,9 @@ public class MissionPopulator
|
||||
)
|
||||
.build();
|
||||
|
||||
MissionContext.<Material>newBuilder(manager, 407)
|
||||
MissionContext.newBuilder(manager, 407)
|
||||
.name("Looter")
|
||||
.description("Loot %s chests.")
|
||||
.description("Loot %s chests")
|
||||
.games(SurvivalGames, SurvivalGamesTeams)
|
||||
.xRange(25, 100)
|
||||
.tracker(GAME_CHEST_OPEN)
|
||||
@ -351,18 +353,185 @@ public class MissionPopulator
|
||||
)
|
||||
.build();
|
||||
|
||||
MissionContext.<Material>newBuilder(manager, 407)
|
||||
MissionContext.newBuilder(manager, 408)
|
||||
.name("Steve Walker")
|
||||
.description("Walk %s blocks.")
|
||||
.description("Walk %s blocks")
|
||||
.games(SurvivalGames, SurvivalGamesTeams)
|
||||
.xRange(1000, 5000)
|
||||
.tracker(SG_WALK)
|
||||
.tracker(GAME_WALK)
|
||||
.rewards(
|
||||
new LevelExperienceReward(1),
|
||||
new LevelCurrencyReward(GlobalCurrency.GEM, 1),
|
||||
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 1)
|
||||
)
|
||||
.build();
|
||||
|
||||
MissionContext.newBuilder(manager, 409)
|
||||
.name("Steve Walker")
|
||||
.description("Walk %s blocks")
|
||||
.games(SurvivalGames, SurvivalGamesTeams)
|
||||
.xRange(1, 25)
|
||||
.tracker(GAME_ENCHANT_ITEM)
|
||||
.rewards(
|
||||
new LevelExperienceReward(40),
|
||||
new LevelCurrencyReward(GlobalCurrency.GEM, 20),
|
||||
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 20)
|
||||
)
|
||||
.build();
|
||||
|
||||
// Block Hunt 500-599
|
||||
|
||||
MissionContext.newBuilder(manager, 500)
|
||||
.name("Block Ninja")
|
||||
.description("Infest %s blocks")
|
||||
.games(HideSeek)
|
||||
.xRange(10, 30)
|
||||
.tracker(BLOCK_HUNT_INFEST)
|
||||
.rewards(
|
||||
new LevelExperienceReward(20),
|
||||
new LevelCurrencyReward(GlobalCurrency.GEM, 10),
|
||||
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 10)
|
||||
)
|
||||
.build();
|
||||
|
||||
MissionContext.newBuilder(manager, 501)
|
||||
.name("Glitter In The Sky")
|
||||
.description("Set of %s fireworks")
|
||||
.games(HideSeek)
|
||||
.xRange(5, 50)
|
||||
.tracker(BLOCK_HUNT_FIREWORK)
|
||||
.rewards(
|
||||
new LevelExperienceReward(20),
|
||||
new LevelCurrencyReward(GlobalCurrency.GEM, 10),
|
||||
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 10)
|
||||
)
|
||||
.build();
|
||||
|
||||
MissionContext.newBuilder(manager, 502)
|
||||
.name("Neko Neko Nee")
|
||||
.description("Meow %s times")
|
||||
.games(HideSeek)
|
||||
.xRange(10, 100)
|
||||
.tracker(BLOCK_HUNT_MEOW)
|
||||
.rewards(
|
||||
new LevelExperienceReward(10),
|
||||
new LevelCurrencyReward(GlobalCurrency.GEM, 5),
|
||||
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 5)
|
||||
)
|
||||
.build();
|
||||
|
||||
MissionContext.<String>newBuilder(manager, 503)
|
||||
.name("Hunters Get Hunted")
|
||||
.description("Kill %s hunters with the Hyper Axe")
|
||||
.games(HideSeek)
|
||||
.xRange(1, 10)
|
||||
.tracker(GAME_KILL)
|
||||
.trackerData("Hyper Axe")
|
||||
.rewards(
|
||||
new LevelExperienceReward(200),
|
||||
new LevelCurrencyReward(GlobalCurrency.GEM, 100),
|
||||
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 100)
|
||||
)
|
||||
.build();
|
||||
|
||||
MissionContext.<ChatColor>newBuilder(manager, 504)
|
||||
.name("Legitimate Strategy")
|
||||
.description("Stand perfectly still for %s seconds as a hider")
|
||||
.games(HideSeek)
|
||||
.xRange(60, 600)
|
||||
.tracker(GAME_STAND_STILL)
|
||||
.trackerData(ChatColor.AQUA)
|
||||
.rewards(
|
||||
new LevelExperienceReward(2),
|
||||
new LevelCurrencyReward(GlobalCurrency.GEM, 1),
|
||||
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 1)
|
||||
)
|
||||
.build();
|
||||
|
||||
MissionContext.<ChatColor>newBuilder(manager, 505)
|
||||
.name("Who Needs To Hide?")
|
||||
.description("Run %s blocks as a hider")
|
||||
.games(HideSeek)
|
||||
.xRange(500, 1000)
|
||||
.tracker(GAME_WALK)
|
||||
.trackerData(ChatColor.AQUA)
|
||||
.rewards(
|
||||
new LevelExperienceReward(2),
|
||||
new LevelCurrencyReward(GlobalCurrency.GEM, 1),
|
||||
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 1)
|
||||
)
|
||||
.build();
|
||||
|
||||
MissionContext.<DamageCause>newBuilder(manager, 506)
|
||||
.name("Poke!")
|
||||
.description("Shoot %s hunters as a hider")
|
||||
.games(HideSeek)
|
||||
.xRange(5, 25)
|
||||
.tracker(GAME_DAMAGE)
|
||||
.trackerData(DamageCause.PROJECTILE)
|
||||
.rewards(
|
||||
new LevelExperienceReward(40),
|
||||
new LevelCurrencyReward(GlobalCurrency.GEM, 20),
|
||||
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 20)
|
||||
)
|
||||
.build();
|
||||
|
||||
// Cake Wars 600-699
|
||||
|
||||
MissionContext.<String>newBuilder(manager, 600)
|
||||
.name("Golden Warrior")
|
||||
.description("Kill %s players with the Golden Pickaxe")
|
||||
.games(CakeWars4, CakeWarsDuos)
|
||||
.xRange(1, 10)
|
||||
.tracker(GAME_KILL)
|
||||
.trackerData("The Golden Pickaxe")
|
||||
.rewards(
|
||||
new LevelExperienceReward(200),
|
||||
new LevelCurrencyReward(GlobalCurrency.GEM, 100),
|
||||
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 100)
|
||||
)
|
||||
.build();
|
||||
|
||||
MissionContext.<String>newBuilder(manager, 601)
|
||||
.name("Golden Warrior")
|
||||
.description("Kill %s players with a Snowball")
|
||||
.games(CakeWars4, CakeWarsDuos)
|
||||
.xRange(1, 10)
|
||||
.tracker(GAME_KILL)
|
||||
.trackerData("Snowball")
|
||||
.rewards(
|
||||
new LevelExperienceReward(200),
|
||||
new LevelCurrencyReward(GlobalCurrency.GEM, 100),
|
||||
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 100)
|
||||
)
|
||||
.build();
|
||||
|
||||
MissionContext.<String>newBuilder(manager, 602)
|
||||
.name("Fisticuffs")
|
||||
.description("Kill %s players with your Fists")
|
||||
.games(CakeWars4, CakeWarsDuos)
|
||||
.xRange(1, 10)
|
||||
.tracker(GAME_KILL)
|
||||
.trackerData("Fists")
|
||||
.rewards(
|
||||
new LevelExperienceReward(200),
|
||||
new LevelCurrencyReward(GlobalCurrency.GEM, 100),
|
||||
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 100)
|
||||
)
|
||||
.build();
|
||||
|
||||
MissionContext.<String>newBuilder(manager, 603)
|
||||
.name("The New JoJo")
|
||||
.description("Kill %s players with your Fists")
|
||||
.games(CakeWars4, CakeWarsDuos)
|
||||
.xRange(1, 10)
|
||||
.tracker(GAME_KILL)
|
||||
.rewards(
|
||||
new LevelExperienceReward(200),
|
||||
new LevelCurrencyReward(GlobalCurrency.GEM, 100),
|
||||
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 100)
|
||||
)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -14,11 +14,15 @@ public enum MissionTrackerType
|
||||
GAME_WIN,
|
||||
GAME_PLAY,
|
||||
GAME_TAUNT,
|
||||
GAME_DAMAGE,
|
||||
GAME_WALK,
|
||||
GAME_STAND_STILL,
|
||||
|
||||
GAME_KILL,
|
||||
GAME_KILL_MIDAIR,
|
||||
GAME_CHEST_OPEN,
|
||||
GAME_CRAFT_ITEM,
|
||||
GAME_ENCHANT_ITEM,
|
||||
|
||||
TURF_WARS_ON_ENEMY,
|
||||
TURF_WARS_BOW_BREAK,
|
||||
@ -29,6 +33,10 @@ public enum MissionTrackerType
|
||||
|
||||
SG_BOW_HORSE_KILL,
|
||||
SG_SUPPLY_DROP_OPEN,
|
||||
SG_WALK,
|
||||
SG_PICKUP_LOOT,
|
||||
|
||||
BLOCK_HUNT_INFEST,
|
||||
BLOCK_HUNT_MEOW,
|
||||
BLOCK_HUNT_FIREWORK,
|
||||
|
||||
}
|
||||
|
@ -46,9 +46,9 @@ public class PlayerMission<T> implements Mission<T>
|
||||
{
|
||||
_rewards = new LevelReward[_context.getRewards().length];
|
||||
|
||||
// Reduce the reward scaling if the number is >= 1000
|
||||
// Reduce the reward scaling if the number is >= 500
|
||||
// This is only the case for things like the "Walk x blocks" missions.
|
||||
int x = _x >= 1000 ? _x / 100 : _x;
|
||||
int x = _x >= 500 ? _x / 100 : _x;
|
||||
|
||||
for (int i = 0; i < _rewards.length; i++)
|
||||
{
|
||||
|
@ -74,12 +74,18 @@ public class MissionMainPage extends ShopPageBase<MissionManager, MissionShop>
|
||||
|
||||
if (games.length > 1)
|
||||
{
|
||||
StringBuilder gameBuilder = new StringBuilder();
|
||||
StringBuilder gameBuilder = new StringBuilder(lore);
|
||||
|
||||
for (int i = 1; i < games.length; i++)
|
||||
{
|
||||
GameDisplay game = games[i];
|
||||
|
||||
// No need to repeat games for something like "Survival Games, Survival Games Teams"
|
||||
if (gameBuilder.toString().contains(game.getName()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
gameBuilder
|
||||
.append(C.mBody)
|
||||
.append(", ")
|
||||
@ -87,7 +93,7 @@ public class MissionMainPage extends ShopPageBase<MissionManager, MissionShop>
|
||||
.append(game.getName());
|
||||
}
|
||||
|
||||
lore += gameBuilder.toString();
|
||||
lore = gameBuilder.toString();
|
||||
}
|
||||
|
||||
builder.addLore(lore);
|
||||
|
@ -383,6 +383,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
_serverUptimeManager = new ServerUptimeManager(this);
|
||||
_missionsManager = require(MissionManager.class);
|
||||
_missionsManager.createNPC(_gameLobbyManager.getMissions());
|
||||
_missionsManager.setCanIncrement(() -> false);
|
||||
|
||||
if (GetHost() != null && !GetHost().isEmpty() && !GetHost().startsWith("COM-"))
|
||||
{
|
||||
|
@ -105,9 +105,12 @@ import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.managers.chat.ChatStatData;
|
||||
import nautilus.game.arcade.managers.lobby.LobbyManager;
|
||||
import nautilus.game.arcade.missions.CraftItemMissionTracker;
|
||||
import nautilus.game.arcade.missions.DamageMissionTracker;
|
||||
import nautilus.game.arcade.missions.EnchantItemMissionTracker;
|
||||
import nautilus.game.arcade.missions.GameMissionTracker;
|
||||
import nautilus.game.arcade.missions.KillMissionTracker;
|
||||
import nautilus.game.arcade.missions.PlayGameMissionTracker;
|
||||
import nautilus.game.arcade.missions.WalkMissionTracker;
|
||||
import nautilus.game.arcade.missions.WinMissionTracker;
|
||||
import nautilus.game.arcade.scoreboard.GameScoreboard;
|
||||
import nautilus.game.arcade.stats.AssistsStatTracker;
|
||||
@ -444,9 +447,12 @@ public abstract class Game extends ListenerComponent implements Lifetimed
|
||||
new PlayGameMissionTracker(this),
|
||||
new WinMissionTracker(this),
|
||||
new KillMissionTracker(this),
|
||||
new CraftItemMissionTracker(this)
|
||||
new DamageMissionTracker(this),
|
||||
new CraftItemMissionTracker(this),
|
||||
new EnchantItemMissionTracker(this),
|
||||
new WalkMissionTracker(this)
|
||||
);
|
||||
manager.getMissionsManager().setCanIncrement(() -> CanAddStats && manager.IsRewardStats());
|
||||
manager.getMissionsManager().setCanIncrement(() -> CanAddStats && GetState() != GameState.Recruit && manager.IsRewardStats());
|
||||
|
||||
Manager.getResourcePackManager().setResourcePack(gameType.getResourcePackUrls(this), gameType.isEnforceResourcePack(this));
|
||||
|
||||
|
@ -87,6 +87,7 @@ import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.disguise.disguises.DisguiseBase;
|
||||
import mineplex.core.disguise.disguises.DisguiseLiving;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.mission.MissionTrackerType;
|
||||
import mineplex.core.packethandler.IPacketHandler;
|
||||
import mineplex.core.packethandler.PacketHandler;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
@ -199,7 +200,6 @@ public class HideSeek extends TeamGame
|
||||
}
|
||||
|
||||
public static final ItemStack PLAYER_ITEM = ItemStackFactory.Instance.CreateStack(Material.SLIME_BALL, (byte) 0, 1, C.cYellowB + "Click Block" + C.cWhiteB + " - " + C.cGreenB + "Change Form");
|
||||
private static final double SEEKER_TO_HIDER_RATIO = 0.2;
|
||||
|
||||
private GameTeam _hiders;
|
||||
private GameTeam _seekers;
|
||||
@ -1086,6 +1086,7 @@ public class HideSeek extends TeamGame
|
||||
return;
|
||||
|
||||
this.AddGems(player, 2, "Fireworks", true, true);
|
||||
getArcadeManager().getMissionsManager().incrementProgress(player, 1, MissionTrackerType.BLOCK_HUNT_FIREWORK, GetType().getDisplay(), null);
|
||||
|
||||
UtilInv.remove(player, Material.FIREWORK, (byte) 0, 1);
|
||||
UtilInv.Update(player);
|
||||
@ -1734,7 +1735,7 @@ public class HideSeek extends TeamGame
|
||||
}
|
||||
}
|
||||
|
||||
public void InfestStart(LivingEntity ent)
|
||||
public void InfestStart(Player ent)
|
||||
{
|
||||
UtilParticle.PlayParticleToAll(ParticleType.SLIME, ent.getLocation().add(0, 0.6, 0), 0.3f, 0.3f, 0.3f, 0, 24, ViewDist.NORMAL);
|
||||
ent.getWorld().playSound(ent.getLocation(), Sound.SLIME_ATTACK, 2f, 1f);
|
||||
@ -1749,9 +1750,11 @@ public class HideSeek extends TeamGame
|
||||
}
|
||||
|
||||
// Gets rid of timer, not needed until end
|
||||
Recharge.Instance.recharge((Player) ent, "Infest");
|
||||
Recharge.Instance.recharge(ent, "Infest");
|
||||
|
||||
_infestDeny.add(ent);
|
||||
|
||||
getArcadeManager().getMissionsManager().incrementProgress(ent, 1, MissionTrackerType.BLOCK_HUNT_INFEST, GetType().getDisplay(), null);
|
||||
}
|
||||
|
||||
public void InfestEnd(LivingEntity ent)
|
||||
|
@ -69,7 +69,6 @@ import nautilus.game.arcade.game.games.survivalgames.kit.KitHorseman;
|
||||
import nautilus.game.arcade.game.games.survivalgames.kit.KitKnight;
|
||||
import nautilus.game.arcade.game.games.survivalgames.kit.KitNecromancer;
|
||||
import nautilus.game.arcade.game.games.survivalgames.misison.BowHorseKillTracker;
|
||||
import nautilus.game.arcade.game.games.survivalgames.misison.WalkMissionTracker;
|
||||
import nautilus.game.arcade.game.games.survivalgames.modules.BorderModule;
|
||||
import nautilus.game.arcade.game.games.survivalgames.modules.FurnaceLootModule;
|
||||
import nautilus.game.arcade.game.games.survivalgames.modules.SupplyDropModule;
|
||||
@ -201,8 +200,7 @@ public abstract class SurvivalGamesNew extends Game
|
||||
|
||||
registerMissions
|
||||
(
|
||||
new BowHorseKillTracker(this),
|
||||
new WalkMissionTracker(this)
|
||||
new BowHorseKillTracker(this)
|
||||
);
|
||||
|
||||
registerChatStats
|
||||
|
@ -0,0 +1,32 @@
|
||||
package nautilus.game.arcade.missions;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import mineplex.core.mission.MissionTrackerType;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
|
||||
import nautilus.game.arcade.game.Game;
|
||||
|
||||
public class DamageMissionTracker extends GameMissionTracker<Game>
|
||||
{
|
||||
|
||||
public DamageMissionTracker(Game game)
|
||||
{
|
||||
super(MissionTrackerType.GAME_DAMAGE, game);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void damage(CustomDamageEvent event)
|
||||
{
|
||||
Player damager = event.GetDamagerPlayer(true);
|
||||
|
||||
if (event.IsCancelled() || damager == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_manager.incrementProgress(damager, 1, _trackerType, getGameType(), event.GetCause());
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package nautilus.game.arcade.missions;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.enchantment.EnchantItemEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.mission.MissionTrackerType;
|
||||
|
||||
import nautilus.game.arcade.game.Game;
|
||||
|
||||
public class EnchantItemMissionTracker extends GameMissionTracker<Game>
|
||||
{
|
||||
|
||||
public EnchantItemMissionTracker(Game game)
|
||||
{
|
||||
super(MissionTrackerType.GAME_ENCHANT_ITEM, game);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void craftItem(EnchantItemEvent event)
|
||||
{
|
||||
ItemStack itemStack = event.getItem();
|
||||
|
||||
if (itemStack == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_manager.incrementProgress(event.getEnchanter(), itemStack.getAmount(), _trackerType, getGameType(), itemStack.getType());
|
||||
}
|
||||
}
|
@ -6,12 +6,12 @@ import mineplex.core.mission.MissionTrackerType;
|
||||
|
||||
import nautilus.game.arcade.game.Game;
|
||||
|
||||
public class GameMissionTracker<U extends Game> extends MissionTracker
|
||||
public class GameMissionTracker<T extends Game> extends MissionTracker
|
||||
{
|
||||
|
||||
protected final U _game;
|
||||
protected final T _game;
|
||||
|
||||
public GameMissionTracker(MissionTrackerType trackerType, U game)
|
||||
public GameMissionTracker(MissionTrackerType trackerType, T game)
|
||||
{
|
||||
super(game.getArcadeManager().getMissionsManager(), trackerType);
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package nautilus.game.arcade.missions;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -37,6 +39,7 @@ public class KillMissionTracker extends GameMissionTracker<Game>
|
||||
return;
|
||||
}
|
||||
|
||||
_manager.incrementProgress(killerPlayer, 1, _trackerType, getGameType(), killer.GetLastDamageSource());
|
||||
Bukkit.broadcastMessage(killer.GetLastDamageSource());
|
||||
_manager.incrementProgress(killerPlayer, 1, _trackerType, getGameType(), ChatColor.stripColor(killer.GetLastDamageSource()));
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,15 @@
|
||||
package nautilus.game.arcade.game.games.survivalgames.misison;
|
||||
package nautilus.game.arcade.missions;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.mission.MissionTrackerType;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
@ -17,7 +17,6 @@ import mineplex.core.updater.event.UpdateEvent;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.Game.GameState;
|
||||
import nautilus.game.arcade.missions.GameMissionTracker;
|
||||
|
||||
public class WalkMissionTracker extends GameMissionTracker<Game>
|
||||
{
|
||||
@ -26,7 +25,7 @@ public class WalkMissionTracker extends GameMissionTracker<Game>
|
||||
|
||||
public WalkMissionTracker(Game game)
|
||||
{
|
||||
super(MissionTrackerType.GAME_CRAFT_ITEM, game);
|
||||
super(null, game);
|
||||
|
||||
_last = new HashMap<>();
|
||||
}
|
||||
@ -61,7 +60,17 @@ public class WalkMissionTracker extends GameMissionTracker<Game>
|
||||
Player player = entry.getKey();
|
||||
Location last = entry.getValue(), now = player.getLocation();
|
||||
double distance = UtilMath.offset(now, last);
|
||||
_manager.incrementProgress(player, (int) distance, _trackerType, getGameType(), null);
|
||||
ChatColor teamColour = _game.GetTeam(player).GetColor();
|
||||
|
||||
if (distance < 0.5)
|
||||
{
|
||||
_manager.incrementProgress(player, 1, MissionTrackerType.GAME_STAND_STILL, getGameType(), teamColour);
|
||||
}
|
||||
else
|
||||
{
|
||||
_manager.incrementProgress(player, (int) distance, MissionTrackerType.GAME_WALK, getGameType(), teamColour);
|
||||
}
|
||||
|
||||
entry.setValue(now);
|
||||
});
|
||||
}
|
@ -7,6 +7,8 @@ import java.util.UUID;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
import mineplex.core.mission.MissionTrackerType;
|
||||
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.games.hideseek.HideSeek;
|
||||
|
||||
@ -22,8 +24,10 @@ public class MeowStatTracker extends StatTracker<Game>
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
public void onMeow(HideSeek.MeowEvent event)
|
||||
{
|
||||
if (getGame().GetState() != Game.GameState.Live)
|
||||
if (!getGame().IsLive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Integer meows = _meowCount.get(event.getPlayer().getUniqueId());
|
||||
|
||||
@ -32,6 +36,10 @@ public class MeowStatTracker extends StatTracker<Game>
|
||||
_meowCount.put(event.getPlayer().getUniqueId(), meows);
|
||||
|
||||
if (meows >= 50)
|
||||
{
|
||||
addStat(event.getPlayer(), "Meow", 1, true, false);
|
||||
}
|
||||
|
||||
getGame().getArcadeManager().getMissionsManager().incrementProgress(event.getPlayer(), 1, MissionTrackerType.BLOCK_HUNT_MEOW, getGame().GetType().getDisplay(), null);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user