diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index fc1c6fece..65f7c74de 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -18,8 +18,17 @@ import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.managers.GameLobbyManager; import nautilus.game.arcade.scoreboard.GameScoreboard; +import nautilus.game.arcade.stats.AssistsStatTracker; +import nautilus.game.arcade.stats.DamageDealtStatTracker; +import nautilus.game.arcade.stats.DamageTakenStatTracker; +import nautilus.game.arcade.stats.DeathsStatTracker; +import nautilus.game.arcade.stats.KillsStatTracker; +import nautilus.game.arcade.stats.LoseStatTracker; +import nautilus.game.arcade.stats.StatTracker; +import nautilus.game.arcade.stats.WinStatTracker; import nautilus.game.arcade.world.WorldData; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.GameMode; import org.bukkit.Location; @@ -197,6 +206,7 @@ public abstract class Game implements Listener public int EloStart = 1000; public ArrayList GemBoosters = new ArrayList(); + private final Set> _statTrackers = new HashSet<>(); public Game(ArcadeManager manager, GameType gameType, Kit[] kits, String[] gameDesc) { @@ -233,6 +243,16 @@ public abstract class Game implements Listener } WorldData = new WorldData(this); + registerStatTrackers( + new KillsStatTracker(this), + new DeathsStatTracker(this), + new AssistsStatTracker(this), + new WinStatTracker(this), + new LoseStatTracker(this), + new DamageDealtStatTracker(this), + new DamageTakenStatTracker(this) + ); + System.out.println("Loading " + GetName() + "..."); } @@ -1081,4 +1101,28 @@ public abstract class Game implements Listener { return _stats; } + + public void registerStatTrackers(StatTracker... statTrackers) + { + for (StatTracker tracker : statTrackers) + { + if (_statTrackers.add(tracker)) + Bukkit.getPluginManager().registerEvents(tracker, Manager.GetPlugin()); + } + } + + @EventHandler + public void onGameEnd(GameStateChangeEvent event) + { + if (event.GetState() == GameState.End) + { + for (StatTracker tracker : getStatTrackers()) + HandlerList.unregisterAll(tracker); + } + } + + public Collection> getStatTrackers() + { + return _statTrackers; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java index d2656ec4b..bfe10ef35 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java @@ -60,6 +60,10 @@ import nautilus.game.arcade.game.games.bridge.kits.*; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.ore.OreHider; import nautilus.game.arcade.ore.OreObsfucation; +import nautilus.game.arcade.stats.BridgesSniperStatTracker; +import nautilus.game.arcade.stats.DeathBomberStatTracker; +import nautilus.game.arcade.stats.FastKillsStatTracker; +import nautilus.game.arcade.stats.TntMinerStatTracker; public class Bridge extends TeamGame implements OreObsfucation { @@ -174,6 +178,13 @@ public class Bridge extends TeamGame implements OreObsfucation _tournament = Manager.IsTournamentServer(); + + registerStatTrackers( + new BridgesSniperStatTracker(this), + new TntMinerStatTracker(this), + new FastKillsStatTracker(this, 4, 10, "Rampage"), + new DeathBomberStatTracker(this) + ); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java index 783616d52..cae9cc02f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java @@ -65,6 +65,9 @@ import nautilus.game.arcade.game.games.castlesiege.kits.KitUndeadGhoul; import nautilus.game.arcade.game.games.castlesiege.kits.KitUndeadZombie; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.NullKit; +import nautilus.game.arcade.stats.AssistsStatTracker; +import nautilus.game.arcade.stats.BloodThirstyStatTracker; +import nautilus.game.arcade.stats.KingSlayerStatTracker; public class CastleSiege extends TeamGame { @@ -185,6 +188,12 @@ public class CastleSiege extends TeamGame this.BlockPlaceAllow.add(85); _kingName = C.cYellow + C.Bold + "King Sparklez"; + + registerStatTrackers( + new KingSlayerStatTracker(this), + new BloodThirstyStatTracker(this), + new AssistsStatTracker(this) + ); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java index 842710733..65ef7a591 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java @@ -13,6 +13,8 @@ import nautilus.game.arcade.game.games.champions.kits.KitMage; import nautilus.game.arcade.game.games.champions.kits.KitRanger; import nautilus.game.arcade.game.games.common.Domination; import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.stats.ElectrocutionStatTracker; +import nautilus.game.arcade.stats.SeismicSlamStatTracker; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -51,6 +53,11 @@ public class ChampionsDominate extends Domination EloRanking = false; EloStart = 1000; + + registerStatTrackers( + new ElectrocutionStatTracker(this), + new SeismicSlamStatTracker(this) + ); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java index 2d8c46cc8..5d9b7da24 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java @@ -17,6 +17,10 @@ import nautilus.game.arcade.game.games.champions.kits.KitMage; import nautilus.game.arcade.game.games.champions.kits.KitRanger; import nautilus.game.arcade.game.games.common.TeamDeathmatch; import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.stats.ElectrocutionStatTracker; +import nautilus.game.arcade.stats.KillAllOpposingStatTracker; +import nautilus.game.arcade.stats.SeismicSlamStatTracker; +import nautilus.game.arcade.stats.WinWithoutLosingTeammateStatTracker; public class ChampionsTDM extends TeamDeathmatch { @@ -47,6 +51,13 @@ public class ChampionsTDM extends TeamDeathmatch }; this.Manager.GetDamage().UseSimpleWeaponDamage = false; + + registerStatTrackers( + new WinWithoutLosingTeammateStatTracker(this, "FlawlessVictory"), + new KillAllOpposingStatTracker(this), + new ElectrocutionStatTracker(this), + new SeismicSlamStatTracker(this) + ); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java index c13a9b904..3b882ee0d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java @@ -27,6 +27,7 @@ import nautilus.game.arcade.game.GameTeam.PlayerState; import nautilus.game.arcade.game.games.deathtag.kits.*; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.NullKit; +import nautilus.game.arcade.stats.ComeAtMeBroStatTracker; public class DeathTag extends SoloGame { @@ -64,6 +65,8 @@ public class DeathTag extends SoloGame this.CompassEnabled = true; this.PrepareFreeze = false; + + registerStatTrackers(new ComeAtMeBroStatTracker(this)); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java index 2ff0ded4d..109eacde6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscape.java @@ -38,6 +38,8 @@ import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.games.dragonescape.kits.*; import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.stats.ParalympicsStatTracker; +import nautilus.game.arcade.stats.WinMapStatTracker; public class DragonEscape extends SoloGame { @@ -75,6 +77,11 @@ public class DragonEscape extends SoloGame this.DamagePvP = false; this.HungerSet = 20; + + registerStatTrackers( + new ParalympicsStatTracker(this), + new WinMapStatTracker(this) + ); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/Dragons.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/Dragons.java index d0c4ed4a8..a13aeb2c3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/Dragons.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/Dragons.java @@ -33,6 +33,7 @@ import nautilus.game.arcade.game.games.dragons.kits.*; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.perks.PerkSparkler; +import nautilus.game.arcade.stats.SparklezStatTracker; public class Dragons extends SoloGame { @@ -62,6 +63,10 @@ public class Dragons extends SoloGame this.DamagePvP = false; this.HungerSet = 20; this.WorldWaterDamage = 4; + + registerStatTrackers( + new SparklezStatTracker(this) + ); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java index b2243e77e..f2afd6711 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java @@ -45,6 +45,9 @@ import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.games.GameScore; import nautilus.game.arcade.game.games.draw.kits.KitPlayer; import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.stats.KeenEyeStatTracker; +import nautilus.game.arcade.stats.MrSquiggleStatTracker; +import nautilus.game.arcade.stats.PureLuckStatTracker; public class Draw extends SoloGame { @@ -99,6 +102,12 @@ public class Draw extends SoloGame { "Bird", "Volcano", "Love", "Dance", "Hair", "Glasses", "Domino", "Dice", "Computer", "Top Hat", "Beard", "Wind", "Rain", "Minecraft", "Push", "Fighting", "Juggle", "Clown", "Miner", "Creeper", "Ghast", "Spider", "Punch", "Roll", "River", "Desert", "Cold", "Pregnant", "Photo", "Quick", "Mario", "Luigi", "Bridge", "Turtle", "Door Knob", "Mineplex", "Binoculars", "Telescope", "Planet", "Mountain Bike", "Moon", "Comet", "Flower", "Squirrel", "Horse Riding", "Chef", "Elephant", "Yoshi", "Shotgun", "Pistol", "James Bond", "Money", "Salt and Pepper", "Truck", "Helicopter", "Hot Air Balloon", "Sprout", "Yelling", "Muscles", "Skinny", "Zombie", "Lava", "Snake", "Motorbike", "Whale", "Boat", "Letterbox", "Window", "Lollipop", "Handcuffs", "Police", "Uppercut", "Windmill", "Eyepatch", "Campfire", "Rainbow", "Storm", "Pikachu", "Charmander", "Tornado", "Crying", "King", "Hobo", "Worm", "Snail", "XBox", "Playstation", "Nintendo", "Duck", "Pull", "Dinosaur", "Alligator", "Ankle", "Angel", "Acorn", "Bread", "Booty", "Bacon", "Crown", "Donut", "Drill", "Crack", "Leash", "Magic", "Wizard", "Igloo", "Plant", "Screw", "Rifle", "Puppy", "Stool", "Stamp", "Letter", "Witch", "Zebra", "Wagon", "Compass", "Watch", "Clock", "Time", "Cyclops", "Coconut", "Hang", "Penguin", "Confused", "Bucket", "Lion", "Rubbish", "Spaceship", "Bowl", "Shark", "Pizza", "Pyramid", "Dress", "Pants", "Shorts", "Boots", "Boy", "Girl", "Math", "Sunglasses", "Frog", "Chair", "Cake", "Grapes", "Kiss", "Snorlax", "Earth", "Spaghetti", "Couch", "Family", "Milk", "Blood", "Pig", "Giraffe", "Mouse", "Couch", "Fat", "Chocolate", "Camel", "Cheese", "Beans", "Water", "Chicken", "Cannibal", "Zipper", "Book", "Swimming", "Horse", "Paper", "Toaster", "Television", "Hammer", "Piano", "Sleeping", "Yawn", "Sheep", "Night", "Chest", "Lamp", "Redstone", "Grass", "Plane", "Ocean", "Lake", "Melon", "Pumpkin", "Gift", "Fishing", "Pirate", "Lightning", "Stomach", "Belly Button", "Fishing Rod", "Iron Ore", "Diamonds", "Emeralds", "Nether Portal", "Ender Dragon", "Rabbit", "Harry Potter", "Torch", "Light", "Battery", "Zombie Pigman", "Telephone", "Tent", "Hand", "Traffic Lights", "Anvil", "Tail", "Umbrella", "Piston", "Skeleton", "Spikes", "Bridge", "Bomb", "Spoon", "Rainbow", "Staircase", "Poop", "Dragon", "Fire", "Apple", "Shoe", "Squid", "Cookie", "Tooth", "Camera", "Sock", "Monkey", "Unicorn", "Smile", "Pool", "Rabbit", "Cupcake", "Pancake", "Princess", "Castle", "Flag", "Planet", "Stars", "Camp Fire", "Rose", "Spray", "Pencil", "Ice Cream", "Toilet", "Moose", "Bear", "Beer", "Batman", "Eggs", "Teapot", "Golf Club", "Tennis Racket", "Shield", "Crab", "Pot of Gold", "Cactus", "Television", "Pumpkin Pie", "Chimney", "Stable", "Nether", "Wither", "Beach", "Stop Sign", "Chestplate", "Pokeball", "Christmas Tree", "Present", "Snowflake", "Laptop", "Superman", "Football", "Basketball", "Creeper", "Tetris", "Jump", "Ninja", "Baby", "Troll Face", "Grim Reaper", "Temple", "Explosion", "Vomit", "Ants", "Barn", "Burn", "Baggage", "Frisbee", "Iceberg", "Sleeping", "Dream", "Snorlax", "Balloons", "Elevator", "Alligator", "Bikini", "Butterfly", "Bumblebee", "Pizza", "Jellyfish", "Sideburns", "Speedboat", "Treehouse", "Water Gun", "Drink", "Hook", "Dance", "Fall", "Summer", "Autumn", "Spring", "Winter", "Night Time", "Galaxy", "Sunrise", "Sunset", "Picnic", "Snowflake", "Holding Hands", "America", "Laptop", "Anvil", "Bagel", "Bench", "Cigar", "Darts", "Muffin", "Queen", "Wheat", "Dolphin", "Scarf", "Swing", "Thumb", "Tomato", "Alcohol", "Armor", "Alien", "Beans", "Cheek", "Phone", "Keyboard", "Orange", "Calculator", "Paper", "Desk", "Disco", "Elbow", "Drool", "Giant", "Golem", "Grave", "Llama", "Moose", "Party", "Panda", "Plumber", "Salsa", "Salad", "Skunk", "Skull", "Stump", "Sugar", "Ruler", "Bookcase", "Hamster", "Soup", "Teapot", "Towel", "Waist", "Archer", "Anchor", "Bamboo", "Branch", "Booger", "Carrot", "Cereal", "Coffee", "Wolf", "Crayon", "Finger", "Forest", "Hotdog", "Burger", "Obsidian", "Pillow", "Swing", "YouTube", "Farm", "Rain", "Cloud", "Frozen", "Garbage", "Music", "Twitter", "Facebook", "Santa Hat", "Rope", "Neck", "Sponge", "Sushi", "Noodles", "Soup", "Tower", "Berry", "Capture", "Prison", "Robot", "Trash", "School", "Skype", "Snowman", "Crowd", "Bank", "Mudkip", "Joker", "Lizard", "Tiger", "Royal", "Erupt", "Wizard", "Stain", "Cinema", "Notebook", "Blanket", "Paint", "Guard", "Astronaut" , "Slime" , "Mansion" , "Radar" , "Thorn" , "Tears" , "Tiny" , "Candy" , "Pepsi" , "Flint" , "Draw My Thing" , "Rice" , "Shout" , "Prize" , "Skirt" , "Thief" , "Syrup" , "Kirby" , "Brush" , "Violin", }; + + registerStatTrackers( + new MrSquiggleStatTracker(this), + new KeenEyeStatTracker(this), + new PureLuckStatTracker(this) + ); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java index 3fa66c1ea..3c1b7dccd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java @@ -79,6 +79,10 @@ import nautilus.game.arcade.game.games.hideseek.forms.Form; import nautilus.game.arcade.game.games.hideseek.kits.*; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.NullKit; +import nautilus.game.arcade.stats.BadHiderStatTracker; +import nautilus.game.arcade.stats.HunterKillerStatTracker; +import nautilus.game.arcade.stats.MeowStatTracker; + import net.minecraft.server.v1_7_R4.EntityCreature; import net.minecraft.server.v1_7_R4.Navigation; @@ -204,6 +208,13 @@ public class HideSeek extends TeamGame Manager.GetExplosion().SetRegenerate(true); Manager.GetExplosion().SetTNTSpread(false); Manager.getCosmeticManager().setHideParticles(true); + + registerStatTrackers( + new HunterKillerStatTracker(this), + new MeowStatTracker(this), + new HunterKillerStatTracker(this), + new BadHiderStatTracker(this) + ); } public Material GetItemEquivilent(Material mat) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java index 212524f08..9a1176cce 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java @@ -56,6 +56,11 @@ import nautilus.game.arcade.game.TeamGame; import nautilus.game.arcade.game.GameTeam.PlayerState; import nautilus.game.arcade.game.games.paintball.kits.*; import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.stats.FastKillsStatTracker; +import nautilus.game.arcade.stats.LastStandStatTracker; +import nautilus.game.arcade.stats.MedicStatTracker; +import nautilus.game.arcade.stats.WinFastStatTracker; +import nautilus.game.arcade.stats.WinWithoutLosingTeammateStatTracker; public class Paintball extends TeamGame { @@ -111,6 +116,14 @@ public class Paintball extends TeamGame }); this.HungerSet = 20; + + registerStatTrackers( + new FastKillsStatTracker(this, 4, 5, "KillingSpree"), + new WinWithoutLosingTeammateStatTracker(this, "FlawlessVictory"), + new MedicStatTracker(this), + new WinFastStatTracker(this, 20, "Speedrunner"), + new LastStandStatTracker(this) + ); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java index a95ec1b34..f474e2847 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java @@ -32,6 +32,8 @@ import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.games.quiver.kits.*; import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.stats.SharpShooterStatTracker; +import nautilus.game.arcade.stats.WinWithoutDyingStatTracker; public class Quiver extends SoloGame { @@ -73,6 +75,11 @@ public class Quiver extends SoloGame _scoreObj = Scoreboard.GetScoreboard().registerNewObjective("Kills", "dummy"); _scoreObj.setDisplaySlot(DisplaySlot.BELOW_NAME); + + registerStatTrackers( + new WinWithoutDyingStatTracker(this, "Perfectionist"), + new SharpShooterStatTracker(this) + ); } @EventHandler(priority = EventPriority.HIGH) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java index 8ce182405..4f653735e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java @@ -52,6 +52,9 @@ import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.TeamGame; import nautilus.game.arcade.game.games.sheep.kits.*; import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.stats.SheepDropStatTracker; +import nautilus.game.arcade.stats.SheepThiefStatTracker; +import nautilus.game.arcade.stats.WinWithSheepStatTracker; public class SheepGame extends TeamGame { @@ -145,6 +148,12 @@ public class SheepGame extends TeamGame this.TeamArmor = true; this.TeamArmorHotbar = true; + + registerStatTrackers( + new SheepThiefStatTracker(this), + new SheepDropStatTracker(this), + new WinWithSheepStatTracker(this) + ); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java index d052522a5..a68dd87ea 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java @@ -32,6 +32,11 @@ import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.GameTeam.PlayerState; import nautilus.game.arcade.game.games.smash.kits.*; import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.stats.FastKillsStatTracker; +import nautilus.game.arcade.stats.FreeKitWinStatTracker; +import nautilus.game.arcade.stats.OneVThreeStatTracker; +import nautilus.game.arcade.stats.RecoveryMasterStatTracker; +import nautilus.game.arcade.stats.WinWithoutDyingStatTracker; public class SuperSmash extends SoloGame { @@ -87,6 +92,14 @@ public class SuperSmash extends SoloGame // Add stat table here // Example //Manager.GetStatsManager().addTable("SuperSmashMobStats", "Kills", "Deaths", "Wins", "Losses"); + + registerStatTrackers( + new WinWithoutDyingStatTracker(this, "MLGPro"), + new FreeKitWinStatTracker(this), + new OneVThreeStatTracker(this), + new FastKillsStatTracker(this, 3, 10, "TripleKill"), + new RecoveryMasterStatTracker(this) + ); } @EventHandler(priority = EventPriority.HIGH) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snake/Snake.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snake/Snake.java index 9ee210676..b8c0d0000 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snake/Snake.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snake/Snake.java @@ -51,6 +51,9 @@ import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.games.snake.kits.KitInvulnerable; import nautilus.game.arcade.game.games.snake.kits.KitSpeed; import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.stats.CannibalStatTracker; +import nautilus.game.arcade.stats.ChooChooStatTracker; +import nautilus.game.arcade.stats.SlimySheepStatTracker; public class Snake extends SoloGame { @@ -172,6 +175,12 @@ public class Snake extends SoloGame this.HungerSet = 2; this.GemMultiplier = 0.5; + + registerStatTrackers( + new CannibalStatTracker(this), + new ChooChooStatTracker(this), + new SlimySheepStatTracker(this) + ); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java index deb8d5542..2644f2286 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java @@ -37,6 +37,8 @@ import nautilus.game.arcade.GameType; import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.perks.event.PerkLeapEvent; +import nautilus.game.arcade.stats.SpleefBlockDestroyStatTracker; + import net.minecraft.server.v1_7_R4.EntityArrow; public class Spleef extends SoloGame @@ -63,6 +65,8 @@ public class Spleef extends SoloGame this.WorldWaterDamage = 4; this.PrepareFreeze = false; + + registerStatTrackers(new SpleefBlockDestroyStatTracker(this)); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java index fae09b7bc..7e17964f8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java @@ -74,6 +74,11 @@ import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.games.survivalgames.kit.*; import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.stats.FastKillsStatTracker; +import nautilus.game.arcade.stats.FirstSupplyDropOpenStatTracker; +import nautilus.game.arcade.stats.KillsWithinTimeLimitStatTracker; +import nautilus.game.arcade.stats.SimultaneousSkeletonStatTracker; +import nautilus.game.arcade.stats.WinWithoutWearingArmorStatTracker; public class SurvivalGames extends SoloGame { @@ -230,6 +235,13 @@ public class SurvivalGames extends SoloGame System.out.println("CREEP TYPE: " + _spreadName); System.out.println("==================="); //Manager.GetStatsManager().addTable(GetName(), "kills", "deaths", "chestsOpened"); + + registerStatTrackers( + new WinWithoutWearingArmorStatTracker(this), + new KillsWithinTimeLimitStatTracker(this, 3, 60, "Bloodlust"), + new FirstSupplyDropOpenStatTracker(this), + new SimultaneousSkeletonStatTracker(this, 5) + ); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java index e7068e923..0fb2aa12e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java @@ -50,6 +50,9 @@ import nautilus.game.arcade.game.games.turfforts.kits.KitInfiltrator; import nautilus.game.arcade.game.games.turfforts.kits.KitMarksman; import nautilus.game.arcade.game.games.turfforts.kits.KitShredder; import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.stats.BehindEnemyLinesStatTracker; +import nautilus.game.arcade.stats.BlockShreadStatTracker; +import nautilus.game.arcade.stats.TheComebackStatTracker; public class TurfForts extends TeamGame { @@ -130,6 +133,12 @@ public class TurfForts extends TeamGame this.ItemDrop = false; this.ItemPickup = false; this.DamageSelf = false; + + registerStatTrackers( + new BlockShreadStatTracker(this), + new BehindEnemyLinesStatTracker(this), + new TheComebackStatTracker(this) + ); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/FastKillsStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/FastKillsStatTracker.java index 3b58baacd..124cad183 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/FastKillsStatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/FastKillsStatTracker.java @@ -18,13 +18,15 @@ public class FastKillsStatTracker extends StatTracker private final Map _lastKillTime = new HashMap<>(); private final int _requiredKillCount; + private final String _stat; private final int _timeBetweenKills; - public FastKillsStatTracker(Game game, int requiredKillCount, int timeBetweenKills) + public FastKillsStatTracker(Game game, int requiredKillCount, int timeBetweenKills, String stat) { super(game); _requiredKillCount = requiredKillCount; + _stat = stat; _timeBetweenKills = timeBetweenKills * 1000; } @@ -74,7 +76,7 @@ public class FastKillsStatTracker extends StatTracker _lastKillTime.remove(player.getUniqueId()); if (killCount >= getRequiredKillCount()) - getGame().AddStat(killer, "FastKills", 1, true, false); + getGame().AddStat(killer, getStat(), 1, true, false); } public int getRequiredKillCount() @@ -86,4 +88,9 @@ public class FastKillsStatTracker extends StatTracker { return _timeBetweenKills; } + + public String getStat() + { + return _stat; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/KillsWithinTimeLimitStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/KillsWithinTimeLimitStatTracker.java index 8990e0ec3..cf2e2a5a1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/KillsWithinTimeLimitStatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/KillsWithinTimeLimitStatTracker.java @@ -11,15 +11,17 @@ import java.util.*; public class KillsWithinTimeLimitStatTracker extends StatTracker { private final int _killCount; + private final String _stat; private final int _timeLimit; private final Map _kills = new HashMap<>(); - public KillsWithinTimeLimitStatTracker(Game game, int killCount, int timeLimit) + public KillsWithinTimeLimitStatTracker(Game game, int killCount, int timeLimit, String stat) { super(game); _killCount = killCount; + _stat = stat; _timeLimit = timeLimit * 1000; } @@ -53,6 +55,11 @@ public class KillsWithinTimeLimitStatTracker extends StatTracker _kills.put(player.getUniqueId(), killCount); if (killCount == getKillCount() && System.currentTimeMillis() - getGame().GetStateTime() < getTimeLimit()) - getGame().AddStat(player, "Bloodlust", 1, true, false); + getGame().AddStat(player, getStat(), 1, true, false); + } + + public String getStat() + { + return _stat; } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinFastStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinFastStatTracker.java index 362a1de0c..c9bec9fe6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinFastStatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinFastStatTracker.java @@ -12,13 +12,15 @@ import nautilus.game.arcade.game.Game; public class WinFastStatTracker extends StatTracker { private final int _seconds; + private final String _stat; private long _gameStartTime; - public WinFastStatTracker(Game game, int seconds) + public WinFastStatTracker(Game game, int seconds, String stat) { super(game); _seconds = seconds; + _stat = stat; } @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) @@ -35,9 +37,14 @@ public class WinFastStatTracker extends StatTracker if (winners != null) { for (Player winner : winners) - getGame().AddStat(winner, "Speedrunner", 1, true, false); + getGame().AddStat(winner, getStat(), 1, true, false); } } } } + + public String getStat() + { + return _stat; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinMapStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinMapStatTracker.java new file mode 100644 index 000000000..3b3106616 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinMapStatTracker.java @@ -0,0 +1,33 @@ +package nautilus.game.arcade.stats; + +import java.util.List; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; + +import nautilus.game.arcade.events.GameStateChangeEvent; +import nautilus.game.arcade.game.Game; + +public class WinMapStatTracker extends StatTracker +{ + public WinMapStatTracker(Game game) + { + super(game); + } + + @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) + public void onGameStateChange(GameStateChangeEvent event) + { + if (event.GetState() == Game.GameState.End) + { + List winners = getGame().getWinners(); + + if (winners != null) + { + for (Player winner : winners) + getGame().AddStat(winner, "Win." + getGame().WorldData.MapName, 1, true, false); + } + } + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinWithoutLosingTeammateStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinWithoutLosingTeammateStatTracker.java index 5e3061e7c..c380ce566 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinWithoutLosingTeammateStatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/WinWithoutLosingTeammateStatTracker.java @@ -7,9 +7,12 @@ import org.bukkit.event.*; public class WinWithoutLosingTeammateStatTracker extends StatTracker { - public WinWithoutLosingTeammateStatTracker(TeamGame game) + private final String _stat; + + public WinWithoutLosingTeammateStatTracker(TeamGame game, String stat) { super(game); + _stat = stat; } @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) @@ -22,8 +25,13 @@ public class WinWithoutLosingTeammateStatTracker extends StatTracker if (winner.GetPlayers(true).size() == winner.GetPlayers(false).size()) { for (Player player : winner.GetPlayers(true)) - getGame().AddStat(player, "FlawlessVictory", 1, true, false); + getGame().AddStat(player, getStat(), 1, true, false); } } } + + public String getStat() + { + return _stat; + } }