Added a load more missions

This commit is contained in:
Sam 2018-07-02 00:11:42 +01:00 committed by Alexander Meech
parent 96921063f0
commit 637a17fbee
28 changed files with 928 additions and 44 deletions

View File

@ -15,11 +15,12 @@ public class MissionContext<T> implements Mission<T>
private final T _data;
private final LevelReward[] _rewards;
private final boolean _eventMission;
private final boolean _scaleDownRewards;
private final int _minX, _maxX;
private final int _minY, _maxY;
private MissionContext(int id, String name, String description, GameDisplay[] games, MissionTrackerType trackerType, T data, LevelReward[] rewards, int minX, int maxX, int minY, int maxY, boolean eventMission)
private MissionContext(int id, String name, String description, GameDisplay[] games, MissionTrackerType trackerType, T data, LevelReward[] rewards, int minX, int maxX, int minY, int maxY, boolean eventMission, boolean scaleDownRewards)
{
_id = id;
_name = name;
@ -33,6 +34,7 @@ public class MissionContext<T> implements Mission<T>
_minY = minY;
_maxY = maxY;
_eventMission = eventMission;
_scaleDownRewards = scaleDownRewards;
}
@Override
@ -98,6 +100,11 @@ public class MissionContext<T> implements Mission<T>
return _eventMission;
}
public boolean isScaleDownRewards()
{
return _scaleDownRewards;
}
public static <T> MissionBuilder<T> newBuilder(MissionManager manager, int id)
{
return new MissionBuilder<>(manager, id);
@ -120,6 +127,7 @@ public class MissionContext<T> implements Mission<T>
private int _minY, _maxY;
private boolean _eventMission;
private boolean _scaleDownRewards;
private MissionBuilder(MissionManager manager, int id)
{
@ -183,6 +191,12 @@ public class MissionContext<T> implements Mission<T>
return this;
}
public MissionBuilder<T> scaleDownRewards()
{
_scaleDownRewards = true;
return this;
}
public void build()
{
if (_eventMission)
@ -215,7 +229,7 @@ public class MissionContext<T> implements Mission<T>
throw new IllegalStateException("The scales or y values are invalid! Mission [" + _id + "]");
}
_manager.addMission(new MissionContext<>(_id, _name, _description, _games, _trackerType, _data, _rewards, _minX, _maxX, _minY, _maxY, _eventMission));
_manager.addMission(new MissionContext<>(_id, _name, _description, _games, _trackerType, _data, _rewards, _minX, _maxX, _minY, _maxY, _eventMission, _scaleDownRewards));
}
}
}

View File

@ -359,6 +359,7 @@ public class MissionPopulator
.games(SurvivalGames, SurvivalGamesTeams)
.xRange(1000, 5000)
.tracker(GAME_WALK)
.scaleDownRewards()
.rewards(
new LevelExperienceReward(1),
new LevelCurrencyReward(GlobalCurrency.GEM, 1),
@ -455,6 +456,7 @@ public class MissionPopulator
.xRange(500, 1000)
.tracker(GAME_WALK)
.trackerData(ChatColor.AQUA)
.scaleDownRewards()
.rewards(
new LevelExperienceReward(2),
new LevelCurrencyReward(GlobalCurrency.GEM, 1),
@ -467,7 +469,7 @@ public class MissionPopulator
.description("Shoot %s hunters as a hider")
.games(HideSeek)
.xRange(5, 25)
.tracker(GAME_DAMAGE)
.tracker(GAME_DAMAGE_CAUSE)
.trackerData(DamageCause.PROJECTILE)
.rewards(
new LevelExperienceReward(40),
@ -507,7 +509,7 @@ public class MissionPopulator
.build();
MissionContext.<String>newBuilder(manager, 602)
.name("Fisticuffs")
.name("The New JoJo")
.description("Kill %s players with your Fists")
.games(CakeWars4, CakeWarsDuos)
.xRange(1, 10)
@ -520,16 +522,539 @@ public class MissionPopulator
)
.build();
MissionContext.<String>newBuilder(manager, 603)
.name("The New JoJo")
.description("Kill %s players with your Fists")
MissionContext.newBuilder(manager, 603)
.name("The Cake Wars Diet")
.description("Eat %s cake slices")
.games(CakeWars4, CakeWarsDuos)
.xRange(1, 10)
.tracker(GAME_KILL)
.xRange(5, 50)
.tracker(CW_EAT_SLICE)
.rewards(
new LevelExperienceReward(200),
new LevelCurrencyReward(GlobalCurrency.GEM, 100),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 100)
new LevelExperienceReward(80),
new LevelCurrencyReward(GlobalCurrency.GEM, 40),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 40)
)
.build();
MissionContext.<Material>newBuilder(manager, 604)
.name("This Is All Mine")
.description("Place %s wool blocks.")
.games(CakeWars4, CakeWarsDuos)
.xRange(50, 200)
.tracker(GAME_BLOCK_PLACE)
.trackerData(Material.WOOL)
.rewards(
new LevelExperienceReward(4),
new LevelCurrencyReward(GlobalCurrency.GEM, 2),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 2)
)
.build();
MissionContext.newBuilder(manager, 605)
.name("Domination")
.description("Capture %s points.")
.games(CakeWars4, CakeWarsDuos)
.xRange(3, 15)
.tracker(GAME_CAPTURE_POINT)
.rewards(
new LevelExperienceReward(60),
new LevelCurrencyReward(GlobalCurrency.GEM, 30),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 30)
)
.build();
MissionContext.newBuilder(manager, 606)
.name("It's like Christmas but with Cake")
.description("Open %s cake island chests.")
.games(CakeWars4, CakeWarsDuos)
.xRange(3, 15)
.tracker(GAME_CHEST_OPEN)
.rewards(
new LevelExperienceReward(100),
new LevelCurrencyReward(GlobalCurrency.GEM, 50),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 50)
)
.build();
MissionContext.<ChatColor>newBuilder(manager, 607)
.name("Brick Entrepreneur")
.description("Spend %s bricks")
.games(CakeWars4, CakeWarsDuos)
.xRange(32, 256)
.tracker(CW_SPEND_RESOURCE)
.trackerData(ChatColor.RED)
.scaleDownRewards()
.rewards(
new LevelExperienceReward(2),
new LevelCurrencyReward(GlobalCurrency.GEM, 1),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 1)
)
.build();
MissionContext.<ChatColor>newBuilder(manager, 608)
.name("Emerald Entrepreneur")
.description("Spend %s emeralds")
.games(CakeWars4, CakeWarsDuos)
.xRange(16, 128)
.tracker(CW_SPEND_RESOURCE)
.trackerData(ChatColor.GREEN)
.scaleDownRewards()
.rewards(
new LevelExperienceReward(2),
new LevelCurrencyReward(GlobalCurrency.GEM, 1),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 1)
)
.build();
MissionContext.<ChatColor>newBuilder(manager, 609)
.name("Nether Star Entrepreneur")
.description("Spend %s nether stars")
.games(CakeWars4, CakeWarsDuos)
.xRange(4, 64)
.tracker(CW_SPEND_RESOURCE)
.trackerData(ChatColor.GOLD)
.rewards(
new LevelExperienceReward(6),
new LevelCurrencyReward(GlobalCurrency.GEM, 3),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 3)
)
.build();
// Super Smash Mobs 700-799
MissionContext.newBuilder(manager, 700)
.name("Plus Ultra!")
.description("Use a Smash Crystal %s times")
.games(Smash, SmashTeams)
.xRange(2, 8)
.tracker(SSM_SMASH)
.rewards(
new LevelExperienceReward(50),
new LevelCurrencyReward(GlobalCurrency.GEM, 25),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 25)
)
.build();
MissionContext.newBuilder(manager, 701)
.name("Who's Next?")
.description("Win %s games without dying")
.games(Smash, SmashTeams)
.xRange(1, 4)
.tracker(GAME_WIN_WITHOUT_DYING)
.rewards(
new LevelExperienceReward(500),
new LevelCurrencyReward(GlobalCurrency.GEM, 250),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 250)
)
.build();
MissionContext.<String>newBuilder(manager, 702)
.name("Bawk Battles")
.description("Kill %s players with Chicken Missile")
.games(Smash, SmashTeams)
.xRange(2, 6)
.tracker(GAME_KILL)
.trackerData("Chicken Missile")
.rewards(
new LevelExperienceReward(500),
new LevelCurrencyReward(GlobalCurrency.GEM, 250),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 250)
)
.build();
MissionContext.<String>newBuilder(manager, 703)
.name("They Stick The Landing!")
.description("Catch %s players with Spin Web")
.games(Smash, SmashTeams)
.xRange(1, 5)
.tracker(GAME_DAMAGE_REASON)
.trackerData("Spin Web")
.rewards(
new LevelExperienceReward(500),
new LevelCurrencyReward(GlobalCurrency.GEM, 250),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 250)
)
.build();
MissionContext.newBuilder(manager, 704)
.name("Balancing Trick")
.description("Be airborne for %s seconds")
.games(Smash, SmashTeams)
.xRange(60, 180)
.tracker(SSM_AIRBORNE)
.rewards(
new LevelExperienceReward(4),
new LevelCurrencyReward(GlobalCurrency.GEM, 2),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 2)
)
.build();
// Micro Battles 800-899
MissionContext.newBuilder(manager, 800)
.name("Brock Breaks Blocks")
.description("Break %s blocks")
.games(Micro)
.xRange(25, 100)
.tracker(GAME_BLOCK_BREAK)
.rewards(
new LevelExperienceReward(6),
new LevelCurrencyReward(GlobalCurrency.GEM, 3),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 3)
)
.build();
MissionContext.newBuilder(manager, 801)
.name("New Ground")
.description("Place %s blocks")
.games(Micro)
.xRange(25, 100)
.tracker(GAME_BLOCK_PLACE)
.rewards(
new LevelExperienceReward(6),
new LevelCurrencyReward(GlobalCurrency.GEM, 3),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 3)
)
.build();
MissionContext.newBuilder(manager, 802)
.name("Still Kickin")
.description("Be part of the last 2 teams alive in %s games")
.games(Micro)
.xRange(2, 5)
.tracker(MICRO_LAST_TWO)
.rewards(
new LevelExperienceReward(50),
new LevelCurrencyReward(GlobalCurrency.GEM, 25),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 25)
)
.build();
// The Bridges 900-999
MissionContext.newBuilder(manager, 900)
.name("You can't hide whats inside!")
.description("Kill the last player on a team %s times")
.games(Bridge)
.xRange(2, 5)
.tracker(BRIDGES_KILL_LAST)
.rewards(
new LevelExperienceReward(100),
new LevelCurrencyReward(GlobalCurrency.GEM, 50),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 50)
)
.build();
MissionContext.<String>newBuilder(manager, 901)
.name("An Apple A Day")
.description("Kill %s players with Thrown Apples")
.games(Bridge)
.xRange(5, 10)
.tracker(GAME_KILL)
.trackerData("Apple Thrower")
.rewards(
new LevelExperienceReward(100),
new LevelCurrencyReward(GlobalCurrency.GEM, 50),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 50)
)
.build();
MissionContext.newBuilder(manager, 902)
.name("Resource Miner")
.description("Break %s blocks")
.games(Bridge)
.xRange(50, 100)
.tracker(GAME_BLOCK_BREAK)
.rewards(
new LevelExperienceReward(2),
new LevelCurrencyReward(GlobalCurrency.GEM, 1),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 1)
)
.build();
MissionContext.newBuilder(manager, 903)
.name("Smelter")
.description("Smelt or Cook %s items")
.games(Bridge)
.xRange(10, 50)
.tracker(GAME_FURNACE_SMELT)
.rewards(
new LevelExperienceReward(4),
new LevelCurrencyReward(GlobalCurrency.GEM, 2),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 2)
)
.build();
MissionContext.<Material>newBuilder(manager, 904)
.name("Going On The Offensive")
.description("Craft %s Diamond Swords")
.games(Bridge)
.xRange(1, 5)
.tracker(GAME_CRAFT_ITEM)
.trackerData(Material.DIAMOND_SWORD)
.rewards(
new LevelExperienceReward(50),
new LevelCurrencyReward(GlobalCurrency.GEM, 25),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 25)
)
.build();
MissionContext.newBuilder(manager, 905)
.name("Advantage")
.description("Enchant %s items")
.games(Bridge)
.xRange(2, 10)
.tracker(GAME_ENCHANT_ITEM)
.rewards(
new LevelExperienceReward(30),
new LevelCurrencyReward(GlobalCurrency.GEM, 15),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 15)
)
.build();
// Skywars 1000-1099
MissionContext.newBuilder(manager, 1000)
.name("Classicwars")
.description("Win %s games without using any kit abilities")
.games(Skywars, SkywarsTeams)
.xRange(1, 4)
.tracker(SW_NO_ABILITIES)
.rewards(
new LevelExperienceReward(250),
new LevelCurrencyReward(GlobalCurrency.GEM, 125),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 125)
)
.build();
MissionContext.<String>newBuilder(manager, 1001)
.name("Spawner")
.description("Open %s spawn island chests")
.games(Skywars, SkywarsTeams)
.xRange(4, 64)
.tracker(GAME_CHEST_OPEN)
.trackerData("Island")
.rewards(
new LevelExperienceReward(4),
new LevelCurrencyReward(GlobalCurrency.GEM, 2),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 2)
)
.build();
MissionContext.<String>newBuilder(manager, 1002)
.name("Connector")
.description("Open %s connector island chests")
.games(Skywars, SkywarsTeams)
.xRange(4, 64)
.tracker(GAME_CHEST_OPEN)
.trackerData("Connector")
.rewards(
new LevelExperienceReward(4),
new LevelCurrencyReward(GlobalCurrency.GEM, 2),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 2)
)
.build();
MissionContext.<String>newBuilder(manager, 1003)
.name("Midder")
.description("Open %s middle island chests")
.games(Skywars, SkywarsTeams)
.xRange(4, 64)
.tracker(GAME_CHEST_OPEN)
.trackerData("Middle")
.rewards(
new LevelExperienceReward(4),
new LevelCurrencyReward(GlobalCurrency.GEM, 2),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 2)
)
.build();
MissionContext.newBuilder(manager, 1003)
.name("EXPLOSION")
.description("Pickup %s Throwable TNT")
.games(Skywars, SkywarsTeams)
.xRange(1, 10)
.tracker(GAME_GENERATOR_COLLECT)
.rewards(
new LevelExperienceReward(20),
new LevelCurrencyReward(GlobalCurrency.GEM, 10),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 10)
)
.build();
MissionContext.newBuilder(manager, 1004)
.name("Megimin Approved")
.description("Throw %s Throwable TNT")
.games(Skywars, SkywarsTeams)
.xRange(1, 10)
.tracker(GAME_THROW_TNT)
.rewards(
new LevelExperienceReward(20),
new LevelCurrencyReward(GlobalCurrency.GEM, 10),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 10)
)
.build();
MissionContext.newBuilder(manager, 1005)
.name("Destructor")
.description("Break %s blocks")
.games(Skywars, SkywarsTeams)
.xRange(16, 128)
.tracker(GAME_BLOCK_BREAK)
.rewards(
new LevelExperienceReward(4),
new LevelCurrencyReward(GlobalCurrency.GEM, 2),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 2)
)
.build();
MissionContext.newBuilder(manager, 1006)
.name("Skilled In The Craft")
.description("Craft %s items")
.games(Skywars, SkywarsTeams)
.xRange(2, 8)
.tracker(GAME_CRAFT_ITEM)
.rewards(
new LevelExperienceReward(8),
new LevelCurrencyReward(GlobalCurrency.GEM, 4),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 4)
)
.build();
MissionContext.newBuilder(manager, 1007)
.name("Ella Was Enchanted")
.description("Enchant %s items")
.games(Skywars, SkywarsTeams)
.xRange(2, 8)
.tracker(GAME_CRAFT_ITEM)
.rewards(
new LevelExperienceReward(8),
new LevelCurrencyReward(GlobalCurrency.GEM, 4),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 4)
)
.build();
MissionContext.newBuilder(manager, 1008)
.name("Who Needs A Hammer?")
.description("Smelt %s items in a furnace")
.games(Skywars, SkywarsTeams)
.xRange(2, 8)
.tracker(GAME_FURNACE_SMELT)
.rewards(
new LevelExperienceReward(8),
new LevelCurrencyReward(GlobalCurrency.GEM, 4),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 4)
)
.build();
// Dominate 1100-1199
MissionContext.newBuilder(manager, 1100)
.name("A Real Champion")
.description("Earn %s points")
.games(ChampionsDominate)
.xRange(10000, 100000)
.tracker(DOM_POINT)
.scaleDownRewards()
.rewards(
new LevelExperienceReward(2),
new LevelCurrencyReward(GlobalCurrency.GEM, 1),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 1)
)
.build();
MissionContext.newBuilder(manager, 1101)
.name("Gem Hunter")
.description("Collect %s gems")
.games(ChampionsDominate)
.xRange(5, 10)
.tracker(DOM_COLLECT_GEM)
.rewards(
new LevelExperienceReward(20),
new LevelCurrencyReward(GlobalCurrency.GEM, 10),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 10)
)
.build();
MissionContext.newBuilder(manager, 1102)
.name("Playing Objective")
.description("Capture %s objectives")
.games(ChampionsDominate)
.xRange(4, 16)
.tracker(GAME_CAPTURE_POINT)
.rewards(
new LevelExperienceReward(20),
new LevelCurrencyReward(GlobalCurrency.GEM, 10),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 10)
)
.build();
// Capture the Flag 1200-1299
MissionContext.newBuilder(manager, 1200)
.name("Rally To Me!")
.description("Take %s flags")
.games(ChampionsCTF)
.xRange(2, 10)
.tracker(CTF_TAKE)
.rewards(
new LevelExperienceReward(20),
new LevelCurrencyReward(GlobalCurrency.GEM, 10),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 10)
)
.build();
MissionContext.newBuilder(manager, 1201)
.name("Cap'ed!")
.description("Capture %s flags")
.games(ChampionsCTF)
.xRange(2, 10)
.tracker(CTF_CAPTURE)
.rewards(
new LevelExperienceReward(20),
new LevelCurrencyReward(GlobalCurrency.GEM, 10),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 10)
)
.build();
// Master Builders 1300-1399
MissionContext.newBuilder(manager, 1300)
.name("Block Spammer")
.description("Place %s blocks")
.games(Build)
.xRange(100, 1000)
.tracker(GAME_BLOCK_PLACE)
.scaleDownRewards()
.rewards(
new LevelExperienceReward(20),
new LevelCurrencyReward(GlobalCurrency.GEM, 10),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 10)
)
.build();
MissionContext.newBuilder(manager, 1301)
.name("Da Bomb")
.description("Rate %s other players")
.games(Build)
.xRange(4, 20)
.tracker(BUILD_RATE)
.rewards(
new LevelExperienceReward(20),
new LevelCurrencyReward(GlobalCurrency.GEM, 10),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 10)
)
.build();
MissionContext.newBuilder(manager, 1302)
.name("Mostly Sparkles")
.description("Place %s particles")
.games(Build)
.xRange(8, 50)
.tracker(BUILD_PARTICLES)
.rewards(
new LevelExperienceReward(10),
new LevelCurrencyReward(GlobalCurrency.GEM, 5),
new LevelCurrencyReward(GlobalCurrency.TREASURE_SHARD, 5)
)
.build();
}

View File

@ -12,17 +12,24 @@ public enum MissionTrackerType
LOBBY_GLD_NO_DAMAGE,
GAME_WIN,
GAME_WIN_WITHOUT_DYING,
GAME_PLAY,
GAME_TAUNT,
GAME_DAMAGE,
GAME_DAMAGE_CAUSE,
GAME_DAMAGE_REASON,
GAME_WALK,
GAME_STAND_STILL,
GAME_KILL,
GAME_KILL_MIDAIR,
GAME_BLOCK_PLACE,
GAME_BLOCK_BREAK,
GAME_CHEST_OPEN,
GAME_CRAFT_ITEM,
GAME_ENCHANT_ITEM,
GAME_CAPTURE_POINT,
GAME_KILL,
GAME_KILL_MIDAIR,
GAME_FURNACE_SMELT,
GAME_GENERATOR_COLLECT,
GAME_THROW_TNT,
TURF_WARS_ON_ENEMY,
TURF_WARS_BOW_BREAK,
@ -39,4 +46,26 @@ public enum MissionTrackerType
BLOCK_HUNT_MEOW,
BLOCK_HUNT_FIREWORK,
CW_EAT_SLICE,
CW_KEEP_CAKE,
CW_SPEND_RESOURCE,
SSM_SMASH,
SSM_AIRBORNE,
MICRO_LAST_TWO,
BRIDGES_KILL_LAST,
SW_NO_ABILITIES,
DOM_POINT,
DOM_COLLECT_GEM,
CTF_TAKE,
CTF_CAPTURE,
BUILD_RATE,
BUILD_PARTICLES
}

View File

@ -46,9 +46,8 @@ public class PlayerMission<T> implements Mission<T>
{
_rewards = new LevelReward[_context.getRewards().length];
// Reduce the reward scaling if the number is really big
// This is only the case for things like the "Walk x blocks" missions.
int x = _x >= (_length == MissionLength.WEEK ? 1000 : 500) ? _x / 100 : _x;
int x = _context.isScaleDownRewards() ? _x / 100 : _x;
for (int i = 0; i < _rewards.length; i++)
{

View File

@ -104,9 +104,11 @@ import nautilus.game.arcade.kit.LinearUpgradeKit;
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.BlocksMissionTracker;
import nautilus.game.arcade.missions.CraftItemMissionTracker;
import nautilus.game.arcade.missions.DamageMissionTracker;
import nautilus.game.arcade.missions.EnchantItemMissionTracker;
import nautilus.game.arcade.missions.FurnaceMissionTracker;
import nautilus.game.arcade.missions.GameMissionTracker;
import nautilus.game.arcade.missions.KillMissionTracker;
import nautilus.game.arcade.missions.PlayGameMissionTracker;
@ -450,7 +452,9 @@ public abstract class Game extends ListenerComponent implements Lifetimed
new DamageMissionTracker(this),
new CraftItemMissionTracker(this),
new EnchantItemMissionTracker(this),
new WalkMissionTracker(this)
new WalkMissionTracker(this),
new BlocksMissionTracker(this),
new FurnaceMissionTracker(this)
);
manager.getMissionsManager().setCanIncrement(() -> CanAddStats && GetState() != GameState.Recruit && manager.IsRewardStats());

View File

@ -88,6 +88,7 @@ import nautilus.game.arcade.game.games.bridge.kits.KitBomber;
import nautilus.game.arcade.game.games.bridge.kits.KitBrawler;
import nautilus.game.arcade.game.games.bridge.kits.KitDestructor;
import nautilus.game.arcade.game.games.bridge.kits.KitMiner;
import nautilus.game.arcade.game.games.bridge.mission.KillLastTracker;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.perks.PerkBomber;
@ -167,6 +168,10 @@ public class Bridge extends TeamGame implements OreObsfucation
new DeathBomberStatTracker(this, 5)
);
registerMissions(
new KillLastTracker(this)
);
registerChatStats(
Kills,
Deaths,

View File

@ -0,0 +1,42 @@
package nautilus.game.arcade.game.games.bridge.mission;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.PlayerDeathEvent;
import mineplex.core.mission.MissionTrackerType;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.missions.GameMissionTracker;
public class KillLastTracker extends GameMissionTracker<Game>
{
public KillLastTracker(Game game)
{
super(MissionTrackerType.BRIDGES_KILL_LAST, game);
}
@EventHandler(priority = EventPriority.LOW)
public void playerDeath(PlayerDeathEvent event)
{
Player player = event.getEntity();
Player killer = player.getKiller();
if (killer == null || killer.equals(player))
{
return;
}
GameTeam team = _game.GetTeam(player);
if (team == null || team.GetPlayers(true).size() > 1)
{
return;
}
_manager.incrementProgress(player, 1, _trackerType, getGameType(), null);
}
}

View File

@ -94,6 +94,7 @@ import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime;
import mineplex.core.explosion.ExplosionEvent;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.mission.MissionTrackerType;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
@ -563,6 +564,8 @@ public class Build extends Game
{
teleportPlayers(_viewData);
getArcadeManager().getMissionsManager().incrementProgress(_viewData.Player, _viewData.Particles.size(), MissionTrackerType.BUILD_PARTICLES, GetType().getDisplay(), null);
//Give Items
for (Player player : GetPlayers(true))
{
@ -577,7 +580,6 @@ public class Build extends Game
UtilTextMiddle.display(null, C.cYellow + "Click to Vote", 0, 60, 5, player);
}
_buildStateTime = System.currentTimeMillis();
}
@ -701,7 +703,8 @@ public class Build extends Game
}
AddGems(voter, (int)(voteTotal / 3), "Voting Fairly", false, false);
getArcadeManager().getMissionsManager().incrementProgress(voter, 1, MissionTrackerType.BUILD_RATE, GetType().getDisplay(), null);
double votesNotCast = (GetPlayers(true).size() - 1) - votesCast;
double averageVote = 1;

View File

@ -37,6 +37,7 @@ import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime;
import mineplex.core.hologram.Hologram;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.mission.MissionTrackerType;
import mineplex.core.preferences.Preference;
import mineplex.core.preferences.PreferencesManager;
import mineplex.core.recharge.Recharge;
@ -266,6 +267,7 @@ public class CakeTeamModule extends CakeModule
_game.AddGems(player, 1, "Cake Bites", true, true);
_game.AddStat(player, "Bites", 1, false, false);
_game.getArcadeManager().getMissionsManager().incrementProgress(player, 1, MissionTrackerType.CW_EAT_SLICE, _game.GetType().getDisplay(), null);
byte data = block.getData();

View File

@ -16,6 +16,7 @@ import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilItem;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.mission.MissionTrackerType;
import mineplex.core.recharge.Recharge;
import mineplex.core.shop.item.IButton;
import mineplex.core.shop.page.ShopPageBase;
@ -287,6 +288,8 @@ public class CakeResourcePage extends ShopPageBase<ArcadeManager, CakeResourceSh
ownedItems.add(_item);
_game.getArcadeManager().getMissionsManager().incrementProgress(player, _item.getCost(), MissionTrackerType.CW_SPEND_RESOURCE, _game.GetType().getDisplay(), _resource.getChatColor());
player.sendMessage(F.main("Game", "You purchased " + F.name(getItemName(giveItem))) + ".");
playAcceptSound(player);
getShop().getPageMap().values().forEach(page ->

View File

@ -13,6 +13,7 @@ import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilText;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.mission.MissionTrackerType;
import mineplex.core.recharge.Recharge;
import mineplex.core.shop.item.IButton;
@ -177,6 +178,8 @@ public class CakeResourceStarPage extends CakeResourcePage
});
}
_game.getArcadeManager().getMissionsManager().incrementProgress(player, _item.getLevels()[_level].getRight(), MissionTrackerType.CW_SPEND_RESOURCE, _game.GetType().getDisplay(), _resource.getChatColor());
playAcceptSound(player);
getShop().getPageMap().values().forEach(page ->
{

View File

@ -24,6 +24,7 @@ import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilRadar;
import mineplex.core.common.util.UtilServer;
import mineplex.core.mission.MissionTrackerType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.CombatComponent;
@ -37,6 +38,7 @@ import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.champions.ChampionsDominate;
import nautilus.game.arcade.game.games.champions.events.CaptureEvent;
import nautilus.game.arcade.game.games.common.dominate_data.CapturePoint;
import nautilus.game.arcade.game.games.common.dominate_data.Emerald;
import nautilus.game.arcade.game.games.common.dominate_data.PlayerData;
@ -234,12 +236,7 @@ public class Domination extends TeamGame
@EventHandler
public void KillScore(CombatDeathEvent event)
{
if (!(event.GetEvent().getEntity() instanceof Player))
{
return;
}
Player killed = (Player)event.GetEvent().getEntity();
Player killed = event.GetEvent().getEntity();
GameTeam killedTeam = GetTeam(killed);
if (killedTeam == null) return;
@ -326,9 +323,9 @@ public class Domination extends TeamGame
Scoreboard.writeNewLine();
//Write CPs
for (int i=0 ; i<_points.size() ; i++)
for (CapturePoint point : _points)
{
Scoreboard.write(_points.get(i).GetScoreboardName());
Scoreboard.write(point.GetScoreboardName());
}
Scoreboard.draw();
@ -379,6 +376,9 @@ public class Domination extends TeamGame
AddGems(player, 10, "Participation", false, false);
}
}
boolean red = team.GetColor() == ChatColor.RED;
team.GetPlayers(false).forEach(player -> getArcadeManager().getMissionsManager().incrementProgress(player, red ? _redScore : _blueScore, MissionTrackerType.DOM_POINT, GetType().getDisplay(), null));
}
endElo();
@ -414,12 +414,7 @@ public class Domination extends TeamGame
Game game = Manager.GetGame();
if (game == null) return;
if (!(event.GetEvent().getEntity() instanceof Player))
{
return;
}
Player killed = (Player)event.GetEvent().getEntity();
Player killed = event.GetEvent().getEntity();
GetStats(killed).Deaths++;
if (event.GetLog().GetKiller() != null)
@ -499,4 +494,10 @@ public class Domination extends TeamGame
UtilRadar.displayRadar(player, data);
}
}
@EventHandler
public void capture(CaptureEvent event)
{
event.getPlayers().forEach(player -> getArcadeManager().getMissionsManager().incrementProgress(player, 1, MissionTrackerType.GAME_CAPTURE_POINT, GetType().getDisplay(), null));
}
}

View File

@ -17,6 +17,7 @@ import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime;
import mineplex.core.hologram.Hologram;
import mineplex.core.mission.MissionTrackerType;
import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.games.common.CaptureTheFlag;
@ -129,8 +130,7 @@ public class Flag
{
return _flagBlock.getLocation().clone().add(0.5, 0, 0.5);
}
public ItemStack getRepresentation()
{
return _representation;
@ -144,9 +144,14 @@ public class Flag
private void announceSteal(Player cap, boolean steal)
{
if (steal)
{
UtilTextMiddle.display("", _host.GetTeam(cap).GetColor() + cap.getName() + C.cWhite + " stole " + _team.GetColor() + _team.GetName() + " Flag!", 0, 60, 10);
_host.getArcadeManager().getMissionsManager().incrementProgress(cap, 1, MissionTrackerType.CTF_TAKE, _host.GetType().getDisplay(), null);
}
else
{
UtilTextMiddle.display("", _host.GetTeam(cap).GetColor() + cap.getName() + C.cWhite + " picked up " + _team.GetColor() + _team.GetName() + " Flag!", 0, 60, 10);
}
}
private void announceDrop(Player player)
@ -157,6 +162,7 @@ public class Flag
private void announceCapture(Player player)
{
UtilTextMiddle.display("", _host.GetTeam(player).GetColor() + player.getName() + C.cWhite + " scored for " + _host.GetTeam(player).GetColor() + _host.GetTeam(player).GetName(), 0, 60, 10);
_host.getArcadeManager().getMissionsManager().incrementProgress(player, 1, MissionTrackerType.CTF_CAPTURE, _host.GetType().getDisplay(), null);
}
private void announceReturn()

View File

@ -4,12 +4,13 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.mission.MissionTrackerType;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.games.common.Domination;
import org.bukkit.Color;
import org.bukkit.FireworkEffect;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.FireworkEffect.Type;
@ -104,5 +105,6 @@ public class Emerald
//Gems
Host.AddGems(player, 3, "Emerald Powerup", true, true);
Host.getArcadeManager().getMissionsManager().incrementProgress(player, 1, MissionTrackerType.DOM_COLLECT_GEM, Host.GetType().getDisplay(), null);
}
}

View File

@ -34,6 +34,7 @@ import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.micro.kits.KitArcher;
import nautilus.game.arcade.game.games.micro.kits.KitFighter;
import nautilus.game.arcade.game.games.micro.kits.KitWorker;
import nautilus.game.arcade.game.games.micro.mission.Last2Tracker;
import nautilus.game.arcade.game.modules.MapCrumbleModule;
import nautilus.game.arcade.game.modules.TeamArmorModule;
import nautilus.game.arcade.game.modules.compass.CompassModule;
@ -87,6 +88,10 @@ public class Micro extends TeamGame
new KillsWithinGameStatTracker(this, 8, "Annihilation")
);
registerMissions(
new Last2Tracker(this)
);
registerChatStats(
Kills,
Assists,

View File

@ -0,0 +1,46 @@
package nautilus.game.arcade.game.games.micro.mission;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.mission.MissionTrackerType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.missions.GameMissionTracker;
public class Last2Tracker extends GameMissionTracker<Game>
{
private boolean _awarded;
public Last2Tracker(Game game)
{
super(MissionTrackerType.MICRO_LAST_TWO, game);
}
@EventHandler
public void update(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC || _awarded)
{
return;
}
long aliveTeams = _game.GetTeamList().stream()
.filter(GameTeam::IsTeamAlive)
.count();
if (aliveTeams == 2)
{
_awarded = true;
for (Player player : _game.GetPlayers(true))
{
_manager.incrementProgress(player, 1, MissionTrackerType.MICRO_LAST_TWO, getGameType(), null);
}
}
}
}

View File

@ -1,5 +1,8 @@
package nautilus.game.arcade.game.games.skywars.kits.perks;
import java.util.HashSet;
import java.util.Set;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -9,6 +12,7 @@ import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.F;
@ -16,8 +20,11 @@ import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilInv;
import mineplex.core.mission.MissionTrackerType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.skywars.TeamSkywars;
import nautilus.game.arcade.kit.Perk;
@ -25,12 +32,14 @@ public abstract class SkywarsPerk extends Perk
{
final ItemStack _itemStack;
private final Set<Player> _used;
SkywarsPerk(String name, ItemStack itemStack)
{
super(name);
_itemStack = itemStack;
_used = new HashSet<>();
}
public abstract void onUseItem(Player player);
@ -41,6 +50,12 @@ public abstract class SkywarsPerk extends Perk
return game instanceof TeamSkywars && game.GetTeam(player1).equals(game.GetTeam(player2));
}
@Override
public void unregisteredEvents()
{
_used.clear();
}
@EventHandler(priority = EventPriority.HIGH)
public void playerInteract(PlayerInteractEvent event)
{
@ -59,6 +74,7 @@ public abstract class SkywarsPerk extends Perk
}
event.setCancelled(true);
_used.add(player);
onUseItem(player);
}
@ -95,5 +111,29 @@ public abstract class SkywarsPerk extends Perk
public void playerDeath(PlayerDeathEvent event)
{
event.getDrops().removeIf(itemStack -> itemStack.isSimilar(_itemStack));
_used.remove(event.getEntity());
}
@EventHandler
public void end(GameStateChangeEvent event)
{
if (event.GetState() != GameState.End)
{
return;
}
for (Player player : event.GetGame().getWinners())
{
if (hasPerk(player) && !_used.contains(player))
{
Manager.getMissionsManager().incrementProgress(player, 1, MissionTrackerType.SW_NO_ABILITIES, event.GetGame().GetType().getDisplay(), null);
}
}
}
@EventHandler
public void playerQuit(PlayerQuitEvent event)
{
_used.remove(event.getPlayer());
}
}

View File

@ -1,6 +1,5 @@
package nautilus.game.arcade.game.games.smash;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

View File

@ -54,6 +54,7 @@ import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetType;
import mineplex.core.hologram.Hologram;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.mission.MissionTrackerType;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
@ -87,6 +88,7 @@ import nautilus.game.arcade.game.games.smash.kits.KitWitch;
import nautilus.game.arcade.game.games.smash.kits.KitWitherSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitWolf;
import nautilus.game.arcade.game.games.smash.kits.KitZombie;
import nautilus.game.arcade.game.games.smash.mission.AirborneTracker;
import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.game.modules.perks.PerkSpreadsheetModule;
@ -146,7 +148,9 @@ public abstract class SuperSmash extends Game
ReplaceTeamsWithKits = true;
AllowParticles = false;
PlayerGameMode = GameMode.ADVENTURE;
registerMissions(new AirborneTracker(this));
AntiHack antiHack = Managers.get(AntiHack.class);
antiHack.addIgnoredCheck(Glide.class);
@ -316,6 +320,7 @@ public abstract class SuperSmash extends Game
Announce(C.Bold + event.getPlayer().getName() + " activated " + C.cGreenB + name + ChatColor.RESET + C.Bold + "!");
UtilTextMiddle.display("Smash Crystal", event.getPlayer().getName() + " used " + C.cGreen + name, 5, 50, 5, UtilServer.getPlayers());
getArcadeManager().getMissionsManager().incrementProgress(player, 1, MissionTrackerType.SSM_SMASH, GetType().getDisplay(), null);
ultimate.activate(player);
}

View File

@ -0,0 +1,42 @@
package nautilus.game.arcade.game.games.smash.mission;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.mission.MissionTrackerType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.missions.GameMissionTracker;
public class AirborneTracker extends GameMissionTracker<Game>
{
public AirborneTracker(Game game)
{
super(MissionTrackerType.SSM_AIRBORNE, game);
}
@EventHandler
public void update(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC)
{
return;
}
for (Player player : _game.GetPlayers(true))
{
if (UtilPlayer.isSpectator(player) || UtilEnt.onBlock(player))
{
continue;
}
_manager.incrementProgress(player, 1, _trackerType, getGameType(), null);
}
}
}

View File

@ -22,6 +22,7 @@ import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.mission.MissionTrackerType;
import mineplex.core.recharge.Recharge;
public class ThrowableTNTModule extends Module
@ -112,6 +113,7 @@ public class ThrowableTNTModule extends Module
}
_throwers.put(tntPrimed, player);
getGame().getArcadeManager().getMissionsManager().incrementProgress(player, 1, MissionTrackerType.GAME_THROW_TNT, getGame().GetType().getDisplay(), null);
}
@EventHandler

View File

@ -33,7 +33,7 @@ import nautilus.game.arcade.game.GameTeam;
public class CapturePoint
{
private static final int MAX_RADIUS = 5;
static final int MAX_RADIUS = 5;
private static final int MAX_PROGRESS = 5;
private static final int MAX_PROGRESS_NEUTRAL = 10;
private static final int MIN_INFORM_TIME = (int) TimeUnit.SECONDS.toMillis(30);
@ -326,4 +326,9 @@ public class CapturePoint
{
return _owner;
}
public Location getCenter()
{
return _center.clone();
}
}

View File

@ -8,18 +8,22 @@ import java.util.Map.Entry;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryOpenEvent;
import org.bukkit.inventory.BeaconInventory;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.mission.MissionTrackerType;
import mineplex.core.updater.UpdateType;
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.game.modules.Module;
import nautilus.game.arcade.missions.GameMissionTracker;
public class CapturePointModule extends Module
{
@ -31,6 +35,25 @@ public class CapturePointModule extends Module
_capturePoints = new ArrayList<>(3);
}
@Override
protected void setup()
{
getGame().registerMissions(new GameMissionTracker<Game>(MissionTrackerType.GAME_CAPTURE_POINT, getGame())
{
@EventHandler
public void capturePoint(CapturePointCaptureEvent event)
{
for (Player player : UtilPlayer.getNearby(event.getPoint().getCenter(), CapturePoint.MAX_RADIUS))
{
if (event.getPoint().getOwner().HasPlayer(player))
{
_manager.incrementProgress(player, 1, _trackerType, getGameType(), null);
}
}
}
});
}
@EventHandler
public void prepare(GameStateChangeEvent event)
{

View File

@ -9,13 +9,16 @@ import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.player.PlayerArmorStandManipulateEvent;
import mineplex.core.common.util.F;
import mineplex.core.mission.MissionTrackerType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.modules.Module;
import nautilus.game.arcade.missions.GameMissionTracker;
public class GeneratorModule extends Module
{
@ -27,6 +30,19 @@ public class GeneratorModule extends Module
_generators = new ArrayList<>();
}
@Override
protected void setup()
{
getGame().registerMissions(new GameMissionTracker<Game>(MissionTrackerType.GAME_GENERATOR_COLLECT, getGame())
{
@EventHandler
public void generatorCollect(GeneratorCollectEvent event)
{
_manager.incrementProgress(event.getPlayer(), 1, _trackerType, getGameType(), null);
}
});
}
@Override
public void cleanup()
{

View File

@ -0,0 +1,31 @@
package nautilus.game.arcade.missions;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import mineplex.core.mission.MissionTrackerType;
import nautilus.game.arcade.game.Game;
public class BlocksMissionTracker extends GameMissionTracker<Game>
{
public BlocksMissionTracker(Game game)
{
super(null, game);
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void blockPlace(BlockPlaceEvent event)
{
_manager.incrementProgress(event.getPlayer(), 1, MissionTrackerType.GAME_BLOCK_PLACE, getGameType(), event.getBlock().getType());
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void blockBreak(BlockBreakEvent event)
{
_manager.incrementProgress(event.getPlayer(), 1, MissionTrackerType.GAME_BLOCK_BREAK, getGameType(), event.getBlock().getType());
}
}

View File

@ -14,7 +14,7 @@ public class DamageMissionTracker extends GameMissionTracker<Game>
public DamageMissionTracker(Game game)
{
super(MissionTrackerType.GAME_DAMAGE, game);
super(null, game);
}
@EventHandler(priority = EventPriority.MONITOR)
@ -27,6 +27,13 @@ public class DamageMissionTracker extends GameMissionTracker<Game>
return;
}
_manager.incrementProgress(damager, 1, _trackerType, getGameType(), event.GetCause());
_manager.incrementProgress(damager, 1, MissionTrackerType.GAME_DAMAGE_CAUSE, getGameType(), event.GetCause());
String reason = event.GetReason();
if (reason != null)
{
_manager.incrementProgress(damager, 1, MissionTrackerType.GAME_DAMAGE_REASON, getGameType(), event.GetReason());
}
}
}

View File

@ -0,0 +1,23 @@
package nautilus.game.arcade.missions;
import org.bukkit.event.EventHandler;
import org.bukkit.event.inventory.FurnaceExtractEvent;
import mineplex.core.mission.MissionTrackerType;
import nautilus.game.arcade.game.Game;
public class FurnaceMissionTracker extends GameMissionTracker<Game>
{
public FurnaceMissionTracker(Game game)
{
super(MissionTrackerType.GAME_FURNACE_SMELT, game);
}
@EventHandler
public void furnaceExtract(FurnaceExtractEvent event)
{
_manager.incrementProgress(event.getPlayer(), event.getItemAmount(), _trackerType, getGameType(), event.getItemType());
}
}

View File

@ -5,6 +5,7 @@ import java.util.List;
import java.util.Set;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.mission.MissionTrackerType;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
@ -59,6 +60,7 @@ public class WinWithoutDyingStatTracker extends StatTracker<Game>
if (!_hasDied.contains(winner.getUniqueId().toString()))
{
addStat(winner, _stat, 1, true, false);
getGame().getArcadeManager().getMissionsManager().incrementProgress(winner, 1, MissionTrackerType.GAME_WIN_WITHOUT_DYING, getGame().GetType().getDisplay(), null);
}
}
}