From 0751876622e350a9dd04501ef36840947b1c8f26 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 9 May 2015 14:12:46 +1200 Subject: [PATCH 1/4] Wizards: Do a null check and event is cancelled check on damage --- .../nautilus/game/arcade/game/games/wizards/Wizards.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/Wizards.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/Wizards.java index 4351096b2..6db30f5e1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/Wizards.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/Wizards.java @@ -311,7 +311,7 @@ public class Wizards extends SoloGame public void onWandHit(CustomDamageEvent event) { // Damager is ENTITY - if (event.GetDamagerEntity(true) != null) + if (!event.isCancelled() && event.GetDamagerEntity(true) != null) { if (event.GetReason() == null) { @@ -323,9 +323,12 @@ public class Wizards extends SoloGame { Wizard wizard = getWizard(damager); - String reason = damager.getInventory().getHeldItemSlot() < wizard.getWandsOwned() ? "Wand" : "Fist"; + if (wizard != null) + { + String reason = damager.getInventory().getHeldItemSlot() < wizard.getWandsOwned() ? "Wand" : "Fist"; - event.AddMod(reason, reason, 0, true); + event.AddMod(reason, reason, 0, true); + } } } } From 822718095d9aee745d64e99db99ca0b7778733f8 Mon Sep 17 00:00:00 2001 From: Mini-Chiss Date: Sat, 9 May 2015 12:23:07 -0500 Subject: [PATCH 2/4] cannot PM from spawn first push of cards game --- .../src/mineplex/core/map/MapText.java | 11 +- .../mineplex/core/message/MessageManager.java | 8 +- .../core/message/PrivateMessageEvent.java | 59 ++++ .../src/mineplex/hub/HubManager.java | 12 + .../src/nautilus/game/arcade/GameFactory.java | 2 + .../src/nautilus/game/arcade/GameType.java | 2 + .../game/arcade/game/games/build/Build.java | 4 +- .../arcade/game/games/cards/CardFactory.java | 66 +++++ .../game/arcade/game/games/cards/Cards.java | 271 ++++++++++++++++++ .../arcade/game/games/cards/RoundState.java | 8 + .../arcade/game/games/cards/VoteRoom.java | 86 ++++++ .../game/games/cards/kits/KitPlayer.java | 37 +++ .../game/arcade/game/games/draw/Draw.java | 2 +- 13 files changed, 564 insertions(+), 4 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/message/PrivateMessageEvent.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/CardFactory.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/Cards.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/RoundState.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/VoteRoom.java create mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/kits/KitPlayer.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/map/MapText.java b/Plugins/Mineplex.Core/src/mineplex/core/map/MapText.java index 289c15570..d11f032dc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/map/MapText.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/map/MapText.java @@ -9,8 +9,11 @@ import java.util.HashMap; import javax.imageio.ImageIO; +import mineplex.core.common.util.UtilServer; + import org.bukkit.Bukkit; import org.bukkit.Material; +import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.map.MapRenderer; import org.bukkit.map.MapView; @@ -128,7 +131,7 @@ public class MapText return returns; } - public ItemStack getMap(String... text) + public ItemStack getMap(boolean sendToServer, String... text) { if (_characters.isEmpty()) { @@ -176,6 +179,12 @@ public class MapText ItemStack item = new ItemStack(Material.MAP); item.setDurability(map.getId()); + + if (sendToServer) + { + for (Player player : UtilServer.getPlayers()) + player.sendMap(map); + } return item; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java b/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java index b531744a8..b47a092e0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java @@ -22,6 +22,7 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime.TimeUnit; +import mineplex.core.event.StackerEvent; import mineplex.core.friend.FriendManager; import mineplex.core.friend.data.FriendData; import mineplex.core.friend.data.FriendStatus; @@ -96,7 +97,7 @@ public class MessageManager extends MiniClientPlugin } public boolean canMessage(Player from, Player to) - { + { if (!canSenderMessageThem(from, to.getName())) { return false; @@ -179,6 +180,11 @@ public class MessageManager extends MiniClientPlugin public void DoMessage(Player from, Player to, String message) { + PrivateMessageEvent pmEvent = new PrivateMessageEvent(from, to, message); + Bukkit.getServer().getPluginManager().callEvent(pmEvent); + if (pmEvent.isCancelled()) + return; + if (!canMessage(from, to)) { return; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/message/PrivateMessageEvent.java b/Plugins/Mineplex.Core/src/mineplex/core/message/PrivateMessageEvent.java new file mode 100644 index 000000000..07716d21b --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/message/PrivateMessageEvent.java @@ -0,0 +1,59 @@ +package mineplex.core.message; + + +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +public class PrivateMessageEvent extends Event +{ + private static final HandlerList handlers = new HandlerList(); + + private boolean _cancelled = false; + private Player _sender; + private Player _recipient; + private String _msg; + + public PrivateMessageEvent(Player sender, Player recipient, String msg) + { + _sender = sender; + _recipient = recipient; + _msg = msg; + } + + public HandlerList getHandlers() + { + return handlers; + } + + public static HandlerList getHandlerList() + { + return handlers; + } + + public void setCancelled(boolean cancel) + { + _cancelled = cancel; + } + + public boolean isCancelled() + { + return _cancelled; + } + + public Player getSender() + { + return _sender; + } + + public Player getRecipient() + { + return _recipient; + } + + public String getMessage() + { + return _msg; + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index ebff189d5..529b00d7f 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -70,6 +70,7 @@ import mineplex.core.gadget.event.GadgetCollideEntityEvent; import mineplex.core.hologram.HologramManager; import mineplex.core.inventory.InventoryManager; import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.message.PrivateMessageEvent; import mineplex.core.mount.MountManager; import mineplex.core.mount.event.MountActivateEvent; import mineplex.core.party.Party; @@ -612,6 +613,17 @@ public class HubManager extends MiniClientPlugin _portalTime.remove(event.getPlayer().getName()); } + + @EventHandler + public void playerPrivateMessage(PrivateMessageEvent event) + { + //Dont Let PM Near Spawn! + if (UtilMath.offset2d(GetSpawn(), event.getSender().getLocation()) == 0 && !_clientManager.Get(event.getSender()).GetRank().Has(Rank.HELPER)) + { + UtilPlayer.message(event.getSender(), F.main("Chat", "You must leave spawn before you can Private Message!")); + event.setCancelled(true); + } + } @EventHandler public void PlayerChat(AsyncPlayerChatEvent event) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java index 2320c9083..140e9e87e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java @@ -11,6 +11,7 @@ import nautilus.game.arcade.game.games.baconbrawl.BaconBrawl; import nautilus.game.arcade.game.games.barbarians.Barbarians; import nautilus.game.arcade.game.games.bridge.Bridge; import nautilus.game.arcade.game.games.build.Build; +import nautilus.game.arcade.game.games.cards.Cards; import nautilus.game.arcade.game.games.castlesiege.CastleSiege; import nautilus.game.arcade.game.games.champions.ChampionsDominate; import nautilus.game.arcade.game.games.champions.ChampionsTDM; @@ -70,6 +71,7 @@ public class GameFactory else if (gameType == GameType.BaconBrawl) return new BaconBrawl(_manager); else if (gameType == GameType.Bridge) return new Bridge(_manager); else if (gameType == GameType.Build) return new Build(_manager); + else if (gameType == GameType.Cards) return new Cards(_manager); else if (gameType == GameType.CastleSiege) return new CastleSiege(_manager); else if (gameType == GameType.Christmas) return new Christmas(_manager); else if (gameType == GameType.DeathTag) return new DeathTag(_manager); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java index 3a514a456..2b2c97eec 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameType.java @@ -54,7 +54,9 @@ public enum GameType WitherAssault("Wither Assault", Material.SKULL_ITEM, (byte)1, GameCategory.ARCADE, 47), Wizards("Wizards", Material.BLAZE_ROD, (byte)0, GameCategory.SURVIVAL, 48, "http://chivebox.com/file/c/ResWizards.zip", true), ZombieSurvival("Zombie Survival", Material.SKULL_ITEM, (byte)2, GameCategory.SURVIVAL, 49), + Build("Master Builders", Material.BRICK, (byte)0, GameCategory.CLASSICS, 50), + Cards("Craft Against Humanity", Material.MAP, (byte)0, GameCategory.CLASSICS, 51), Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java index db8d93e7b..904c1c042 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java @@ -163,10 +163,12 @@ public class Build extends SoloGame this.CreatureAllow = true; this.WorldFireSpread = true; + + UtilServer.getServer().spigot().getConfig().set("view-distance", 4); _words = new String[] { - "Rollercoaster", "Archery Range", "Pokemon", "Pirates", "Vikings", "Dinosaur", "Dragon", "Toilet", "Farm", "Tree House", "Burger", "Cat", "Truck", "Bicycle", "Soda", "Music Instrument", "Statue", "Cannon", "Catapult", "Sailing Boat", "Grim Reaper", "Star Wars", "Elephant", "Penguin", "Ninja", "Pot of Gold", "Shrek", "Fruit", "Breakfast", "Toaster", "Robot", "Camping", "Rocket", "Aliens", "Shipwreck", "Cannibals", "Flying Creature", "Beach Creature", "Sea Creature", "Spongebob", "Car", "Pot Plant", "Weapons", "Christmas", "King", "Queen", "Angel", "Demon", "Halloween", "Tank", "Aeroplane" + "Rollercoaster", "Archery Range", "Pokemon", "Pirates", "Vikings", "Dinosaur", "Dragon", "Toilet", "Farm", "Tree House", "Burger", "Cat", "Truck", "Bicycle", "Soda", "Music Instrument", "Statue", "Cannon", "Catapult", "Sailing Boat", "Grim Reaper", "Star Wars", "Elephant", "Penguin", "Ninja", "Pot of Gold", "Shrek", "Fruit", "Breakfast", "Toaster", "Robot", "Camping", "Rocket", "Aliens", "Shipwreck", "Flying Creature", "Beach Creature", "Sea Creature", "Spongebob", "Car", "Potted Plant", "Weapons", "Christmas", "King", "Queen", "Angel", "Demon", "Halloween", "Tank", "Aeroplane" }; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/CardFactory.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/CardFactory.java new file mode 100644 index 000000000..ac0f3834d --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/CardFactory.java @@ -0,0 +1,66 @@ +package nautilus.game.arcade.game.games.cards; + +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilMath; +import mineplex.core.map.MapText; + +public class CardFactory +{ + private MapText _mapText; + + public CardFactory() + { + _mapText = new MapText(); + } + + private String[] _questions = new String[] + { + "When I get home from school, I crave _____.", "I was playing One in the Quiver when I ran into ____.", "Ultra+ now get free _____ every month.", "Everything was fine until _____ joined.", "Help me! My mom is _______.", "_________ crashed the server again…", "_______ ate his pet rabbit when he saw __________.", "My mouse batteries died because I was using it for ______.", "______ is the #1 reason of deaths on the server.", "Ugh, I'm lagging thanks to _____!", "I need to go to the doctor, I'm sick with _________!", "My best friend thinks he is _____.", "The cure for all diseases is partially made out of _____.", "When i was little i wanted to become a ______ and use _____ to save the world.", "I painted a beautiful painting of ____!", "When you grow up you will realize that ______ is all you need.", "_______ knew he had made the wrong choice when he realised he was _______.", "While falling asleep, I dreamt of ______ kissing ______.", "I went to a fancy restaurant, but the chef gave me _____!", "What am I supposed to do when I see _____ ______?", "There is absolutely nothing worse in this world than ___________.", "I get all excited and tingly when I see ________!", "I would rather be _________ than _________.", "I think my brother is a big fan of _______.", "Why can't I sleep at night?", "What's that smell?", "I got 99 problems but ________ ain't one.", "What's the next game coming out on Mineplex?", "What is the next trend on YouTube?", "It's a pity that kids these days are getting involved with ________.", "What's that sound?", "What should I look for in a girlfriend?", "I wish I could forget about _______.", "What don't you want to find in your treasure chest?", "I can't take you seriously when you are always _________.", "I'm sorry, but I couldn't finish my homework because of _________.", "What does Batman do in his spare time?", "What's a girl's best friend?", "___________. That's how I want to die.", "For my next trick, I will pull _______ out of ________.", "________ is a slippery slope that leads to ________.", "Instead of coal, Santa now gives the bad children ________.", "An exciting game of The Bridges would be incomplete without _________.", "War! What is it good for?", "While mining diamonds, I like to think about ________.", "What are my parents hiding from me?", "What will always make girls like you?", "What did I bring back from the Nether?", "What don't you want to find in your Mushroom Soup?", "Step 1: __________, Step 2: __________, Step 3: Profit!" ,"What makes you need to fart?", "What do old people smell like?", "What's your secret power?", "The class field trip was completely ruined by _______.", "I never understood _______, until I found ________.", "What does Justin Beiber enjoy in his spare time?", "Why is the Villager sticky?", "Scientists think that Creepers explode because of _________.", "Why do you hurt all over?", "When you are a billionaire, you will spend all of your money on ________.", "How do you cheer up a sad friend?", "What is the new diet everyone is trying?", "What is the secret ingredient in Mountain Dew?", "________ is one of the few things that makes me happy.", "The most important thing you need to build a house is ________.", "What is the best way to get unbanned from Mineplex?", "_________ is the secret to winning at Super Smash Mobs.", + + }; + + private String[] _answers = new String[] + { + "A Stinky Pig Butt", "Mouldy Raw Fish", "A sawed off 10-foot pole", "billions of diamonds", "A whiny forum post", "Sparkling Diamonds", "Sheep that don’t know when to stop", "Villager Legs", "Curdled cow milk", "That one popcorn piece stuck in your teeth.", "THE DIAMOND DANCE!", "an unstoppable addiction to fly hacks", "the biggest pile of poop you've ever seen!", "Bed time", "A bag of Doritos and a Mountain Dew.", "zombies chewing on my butt", "Jazz hands", "Brain surgery", "A disappointing birthday party.", "Overly friendly Iron Golems", "An Endermans favourite block", "Puppies!", "your friend who deleted you from Skype", "being on fire", "two cows stealing your wallet", "a lifetime of sadness", "a golden notch apple", "dragon eggs", "holding hands", "kissing", "wearing parents on your head", "soup that is too hot", "edible underpants", "people who are terrible at PvP", "obesity", "sheep eating potatoes", "my collection of spider eyes", "oversized fishing rods", "working as a team", "horse meat", "zombies screaming while on fire", "a ghast calling her dad to say happy birthday", "Microsoft releasing a good game", "bad childhood memories", "a bad haircut", "a steamy locker room", "armed robbery", "bankruptcy", "stacks of TNT", "a block of dirt", "cold pizza", "a pack of angry wolves", "eternal sadness", "the Nether", "a blaze having a barbeque", "Endermen robbing your house", "dental surgery", "religious villagers", "poor villagers", "flesh-eating bacteria", "the drive to win", "friends who take all your loot", "Morgan Freeman", "Darth Vader", "Villager #17", "Barrack Obama", "Lady Gaga", "That one hobo that lives down the street", "A Sad Creeper", "Parker Games", "A shaved sheep", "CaptainSparklez", "DanTDM", "SkyDoesMinecraft", "Mineplex", "A Mineplex Administrator", "Miley Cyrus", "Notch", "Mojang", "Pikachu", "BATMAN!!!", "The Hulk", "Justin Beiber", "Herobrine", "Pirates", "Vikings", "Ninjas", "Uncontrollably pooping", "Dancing until a helper warned me", "Making passive aggressive tweets", "complaining about balance on the forums", "Chopping down the mineplex lobby tree", "crashing servers", "falling off a cliff", "Realizing that you arent actually a ninja.", "Eating a hot pepper", "Digging straight down", "using xray hacks", "picking your nose", "Playing against a team in SSM", "Mining diamond with a stone pickaxe", "stepping on Legos", "Shaking it off", "Watching Parker games", "Accidentally hiding an egg as Easter bunny morph", "doing a poop and realizing there is no toilet paper", "Eating rotten flesh", "Understanding how magnets work", "watching videos on YouTube", "finding Legendary loot in a Treasure Chest", "Doing homework", "dividing by 0", "Finding out the meaning of life", "banning players for no reason", "dying", "so angry that he pooped himself.", "spending hours planting carrots", "doing the right thing", "sleeping in a cave", "getting drunk on potions", "trolling on the internet", "punching a tree", "leaving a stinky surprise", "doing math", "being devoured by zombie pigmen", "farting and walking away", "sneakily doing a poop", "blowing everything up with TNT", "peeing a little bit", "Tweeting about cats", "reading the instructions carefully", + "leaving some poop in the corner of the room", "eating a balanced breakfast", "puking", "shooting arrows at bats", "typing /kill", "watching Frozen repeatedly", "building a house out of dirt", "winking at chickens", "yelling at a toaster", "putting in 110% effort", "paying a lot of money", "bribing with candy", "throwing rocks at people", "crying until everything is better" + }; + + public String getQuestionCard() + { + return _questions[UtilMath.r(_questions.length)]; + } + + public String getAnswerCard() + { + return _answers[UtilMath.r(_answers.length)]; + } + + public ItemStack getAnswerStack() + { + String text = getAnswerCard(); + + ItemStack stack = _mapText.getMap(true, text); + + ItemMeta meta = stack.getItemMeta(); + meta.setDisplayName(C.cGreen + text); + stack.setItemMeta(meta); + + return stack; + } + + public ItemStack getQuestionStack() + { + String text = getQuestionCard(); + + ItemStack stack = _mapText.getMap(true, text); + + ItemMeta meta = stack.getItemMeta(); + meta.setDisplayName(C.cYellow + text); + stack.setItemMeta(meta); + + return stack; + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/Cards.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/Cards.java new file mode 100644 index 000000000..07e2ab006 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/Cards.java @@ -0,0 +1,271 @@ +package nautilus.game.arcade.game.games.cards; + +import java.util.ArrayList; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.ItemFrame; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.NautHashMap; +import mineplex.core.common.util.UtilTime; +import mineplex.core.common.util.UtilTextMiddle; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.GameType; +import nautilus.game.arcade.events.PlayerPrepareTeleportEvent; +import nautilus.game.arcade.game.SoloGame; +import nautilus.game.arcade.game.games.GameScore; +import nautilus.game.arcade.game.games.cards.kits.KitPlayer; +import nautilus.game.arcade.kit.Kit; + +public class Cards extends SoloGame +{ + private CardFactory _cardFactory; + + private ArrayList _ranks = new ArrayList(); + + private NautHashMap _voteRooms = new NautHashMap(); + + private Location _questionLoc = null; + private ItemFrame _questionEnt = null; + + private RoundState _roundState = RoundState.View; + private long _roundStateTime = 0; + private Player _roundDealer = null; + + private String _question = null; + + private long _playTime = 16000; + private long _judgeTime = 16000; + private long _viewTime = 6000; + + private ArrayList _dealerOrder = new ArrayList();; + + public Cards(ArcadeManager manager) + { + super(manager, GameType.Cards, + + new Kit[] + { + new KitPlayer(manager), + }, + + new String[] + { + "Be creative and build something", + "based on the build theme!" + }); + + this.StrictAntiHack = true; + this.Damage = false; + this.HungerSet = 20; + this.HealthSet = 20; + + this.WorldTimeSet = 6000; + + this.PrepareFreeze = false; + + _cardFactory = new CardFactory(); + } + + @Override + public void ParseData() + { + for (Location loc : WorldData.GetDataLocs("RED")) loc.getBlock().setType(Material.OBSIDIAN); + for (Location loc : WorldData.GetDataLocs("ORANGE")) loc.getBlock().setType(Material.OBSIDIAN); + for (Location loc : WorldData.GetDataLocs("GREEN")) loc.getBlock().setType(Material.OBSIDIAN); + + + _questionLoc = WorldData.GetDataLocs("PINK").get(0); + _questionLoc.getBlock().setType(Material.OBSIDIAN); + } + + @EventHandler + public void prepare(PlayerPrepareTeleportEvent event) + { + for (int i=0 ; i<9 ; i++) + { + event.GetPlayer().getInventory().addItem(_cardFactory.getAnswerStack()); + } + + _dealerOrder.add(event.GetPlayer()); + + //Prep Vote Room + _voteRooms.put(event.GetPlayer(), new VoteRoom( + WorldData.GetDataLocs("YELLOW").remove(0), + WorldData.GetDataLocs("ORANGE"), + WorldData.GetDataLocs("GREEN"), + WorldData.GetDataLocs("RED"))); + + addScore(event.GetPlayer(), 0); + } + + @EventHandler + public void roundStateUpdate(UpdateEvent event) + { + if (!IsLive()) + return; + + if (event.getType() != UpdateType.TICK) + return; + + if (_roundState == RoundState.PlaceCards && UtilTime.elapsed(_roundStateTime, _playTime)) + { + setRoundState(RoundState.Judge); + } + else if (_roundState == RoundState.Judge && UtilTime.elapsed(_roundStateTime, _judgeTime)) + { + setRoundState(RoundState.View); + } + else if (_roundState == RoundState.View && UtilTime.elapsed(_roundStateTime, _viewTime)) + { + setRoundState(RoundState.PlaceCards); + } + } + + public void setRoundState(RoundState state) + { + _roundStateTime = System.currentTimeMillis(); + _roundState = state; + + if (state == RoundState.PlaceCards) + { + + //Get Dealer + _roundDealer = _dealerOrder.remove(0); + _dealerOrder.add(_roundDealer); + + //New Question + ItemStack questionStack = _cardFactory.getQuestionStack(); + + if (_questionEnt != null) + { + _questionEnt.remove(); + _questionEnt = null; + } + + _questionEnt = _questionLoc.getWorld().spawn(_questionLoc.getBlock().getLocation(), ItemFrame.class); + _questionEnt.setItem(questionStack); + + //Teleport Players to Card Room + for (Player player : _voteRooms.keySet()) + { + VoteRoom room = _voteRooms.get(player); + + room.resetFrames(false); + + if (player.equals(_roundDealer)) + continue; + + player.teleport(room.Spawn); + + room.QuestionEnt.setItem(questionStack); + } + } + else if (state == RoundState.Judge) + { + GetTeamList().get(0).SpawnTeleport(); + + int i=0; + for (VoteRoom room : _voteRooms.values()) + { + room.displayAnswer(); + } + } + } + + public void addScore(Player player, double amount) + { + for (GameScore score : _ranks) + { + if (score.Player.equals(player)) + { + score.Score += amount; + EndCheck(); + return; + } + } + + _ranks.add(new GameScore(player, amount)); + + sortScores(); + } + + private void sortScores() + { + for (int i=0 ; i<_ranks.size() ; i++) + { + for (int j=_ranks.size()-1 ; j>0 ; j--) + { + if (_ranks.get(j).Score > _ranks.get(j-1).Score) + { + GameScore temp = _ranks.get(j); + _ranks.set(j, _ranks.get(j-1)); + _ranks.set(j-1, temp); + } + } + } + } + + @Override + @EventHandler + public void ScoreboardUpdate(UpdateEvent event) + { + if (!InProgress()) + return; + + if (event.getType() != UpdateType.FAST) + return; + + writeScoreboard(); + } + + public void writeScoreboard() + { + //Wipe Last + Scoreboard.Reset(); + + Scoreboard.WriteBlank(); + + if (_roundState == RoundState.PlaceCards) + { + Scoreboard.Write(C.cYellow + C.Bold + "Select Time"); + Scoreboard.Write(UtilTime.MakeStr(Math.max(0, _playTime - (System.currentTimeMillis() - _roundStateTime)), 1)); + + Scoreboard.WriteBlank(); + + Scoreboard.Write(C.cYellow + C.Bold + "Judge"); + Scoreboard.Write(C.cWhite + _roundDealer.getName()); + } + else if (_roundState == RoundState.Judge) + { + Scoreboard.Write(C.cYellow + C.Bold + "Judge Time"); + Scoreboard.Write(UtilTime.MakeStr(Math.max(0, _judgeTime - (System.currentTimeMillis() - _roundStateTime)), 1)); + + Scoreboard.WriteBlank(); + + Scoreboard.Write(C.cYellow + C.Bold + "Judge"); + Scoreboard.Write(C.cWhite + _roundDealer.getName()); + } + else if (_roundState == RoundState.View) + { + Scoreboard.Write(C.cYellow + C.Bold + "View Time"); + Scoreboard.Write(UtilTime.MakeStr(Math.max(0, _viewTime - (System.currentTimeMillis() - _roundStateTime)), 1)); + } + + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellow + C.Bold + "Round Wins"); + for (GameScore score : _ranks) + { + Scoreboard.Write((int)score.Score + " " + C.Bold + score.Player.getName()); + } + + + Scoreboard.Draw(); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/RoundState.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/RoundState.java new file mode 100644 index 000000000..1bce0902c --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/RoundState.java @@ -0,0 +1,8 @@ +package nautilus.game.arcade.game.games.cards; + +public enum RoundState +{ + PlaceCards, + Judge, + View, +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/VoteRoom.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/VoteRoom.java new file mode 100644 index 000000000..264d4f45b --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/VoteRoom.java @@ -0,0 +1,86 @@ +package nautilus.game.arcade.game.games.cards; + +import java.util.ArrayList; + +import mineplex.core.common.util.UtilAlg; + +import org.bukkit.Location; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.ItemFrame; + +public class VoteRoom +{ + public Location Spawn; + public Location Question; + public Location AnswerA; + public Location AnswerB; + + public ItemFrame QuestionEnt; + public ItemFrame AnswerAEnt; + public ItemFrame AnswerBEnt; + + public Location BoardAnswer; + public ItemFrame BoardAnswerEnt; + + public VoteRoom(Location spawn, ArrayList questions, ArrayList answers, ArrayList board) + { + Spawn = spawn; + + Question = UtilAlg.findClosest(spawn, questions); + questions.remove(Question); + + AnswerA = UtilAlg.findClosest(Question, answers); + answers.remove(AnswerA); + + AnswerB = UtilAlg.findClosest(Question, answers); + answers.remove(AnswerB); + + BoardAnswer = UtilAlg.findClosest(Question, board); + board.remove(BoardAnswer); + } + + public void resetFrames(boolean doubleAnswer) + { + if (QuestionEnt != null) + { + QuestionEnt.remove(); + QuestionEnt = null; + } + + if (AnswerAEnt != null) + { + AnswerAEnt.remove(); + AnswerAEnt = null; + } + + if (AnswerBEnt != null) + { + AnswerBEnt.remove(); + AnswerBEnt = null; + } + + if (BoardAnswerEnt != null) + { + BoardAnswerEnt.remove(); + BoardAnswerEnt = null; + } + + QuestionEnt = Question.getWorld().spawn(Question.getBlock().getLocation(), ItemFrame.class); + AnswerAEnt = AnswerA.getWorld().spawn(AnswerA.getBlock().getLocation(), ItemFrame.class); + BoardAnswerEnt = BoardAnswer.getWorld().spawn(BoardAnswer.getBlock().getLocation(), ItemFrame.class); + +// if (doubleAnswer) +// AnswerBEnt = AnswerB.getWorld().spawn(AnswerB, ItemFrame.class); + +// i.setFacingDirection(BlockFace.SOUTH); +// HangingPlaceEvent hEvent = new HangingPlaceEvent(i, player, bodyBlock, BlockFace.NORTH); +// plugin.getServer().getPluginManager().callEvent(hEvent); + } + + public void displayAnswer() + { + System.out.println(BoardAnswerEnt == null); + System.out.println(AnswerAEnt == null); + BoardAnswerEnt.setItem(AnswerAEnt.getItem()); + } +} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/kits/KitPlayer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/kits/KitPlayer.java new file mode 100644 index 000000000..2e078e7a6 --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cards/kits/KitPlayer.java @@ -0,0 +1,37 @@ +package nautilus.game.arcade.game.games.cards.kits; + +import org.bukkit.Material; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import nautilus.game.arcade.ArcadeManager; +import nautilus.game.arcade.kit.Kit; +import nautilus.game.arcade.kit.KitAvailability; +import nautilus.game.arcade.kit.Perk; + +public class KitPlayer extends Kit +{ + public KitPlayer(ArcadeManager manager) + { + super(manager, "Player", KitAvailability.Free, + + new String[] + { + ";dsgoasdyay" + }, + + new Perk[] + { + }, + EntityType.SKELETON, + new ItemStack(Material.MAP)); + + } + + @Override + public void GiveItems(Player player) + { + + } +} \ No newline at end of file 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 b0c8a3e1c..19f322029 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 @@ -116,7 +116,7 @@ public class Draw extends SoloGame _tools.add(new ToolLine(this)); _tools.add(new ToolSquare(this)); _tools.add(new ToolCircle(this)); - + registerStatTrackers( new MrSquiggleStatTracker(this), new KeenEyeStatTracker(this), From 41599de06f45953eba51a615c76aaba37f935f1d Mon Sep 17 00:00:00 2001 From: Mini-Chiss Date: Sat, 9 May 2015 17:34:07 -0500 Subject: [PATCH 3/4] build vote update --- .../game/arcade/game/games/build/Build.java | 147 ++++++++++++++---- .../arcade/game/games/build/BuildData.java | 40 ++--- .../arcade/game/games/build/BuildQuality.java | 11 +- 3 files changed, 135 insertions(+), 63 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java index 1d59041be..d1b44f8e5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/Build.java @@ -93,6 +93,8 @@ import nautilus.game.arcade.kit.Kit; public class Build extends SoloGame { private NautHashMap _data = new NautHashMap(); + + private NautHashMap> _votes = new NautHashMap>(); private ArrayList> _scoreboardPlaces = new ArrayList>(); @@ -113,7 +115,7 @@ public class Build extends SoloGame private MobShop _mobShop; private ItemStack _shopItem; - private String[] _hintText = new String[] + private String[] _hintText = new String[] { "Click Creatures to change their settings!", "Set the Time/Weather in the Options Menu!", @@ -330,9 +332,24 @@ public class Build extends SoloGame //Verdict if (!_viewData.Judged) { - BuildQuality quality = BuildQuality.getQuality(_viewData.getScore()); - - if (quality == BuildQuality.Failure) + boolean hasDecentVote = false; + + + for (Player player : _votes.keySet()) + { + NautHashMap votes = _votes.get(player); + + if (votes.containsKey(_viewData.Player)) + { + if (votes.get(_viewData.Player) > 2) + { + hasDecentVote = true; + break; + } + } + } + + if (!hasDecentVote) { Manager.GetExplosion().BlockExplosion(_viewData.Blocks, _viewData.Spawn, false); @@ -343,7 +360,7 @@ public class Build extends SoloGame } //Announce Builder - UtilTextMiddle.display(quality.getText(), "Built by: " + C.Bold + _viewData.Player.getName(), 0, 80, 5); + UtilTextMiddle.display(hasDecentVote ? null : C.cRed + "Failure", "Built by: " + C.Bold + _viewData.Player.getName(), 0, 80, 5); } _viewData.Judged = true; @@ -384,12 +401,12 @@ public class Build extends SoloGame { UtilInv.Clear(player); - player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)14, 1, C.Bold + "+0 " + C.cRed + C.Bold + "MY EYES ARE BLEEDING!")); - player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)1, 1, C.Bold + "+1 " + C.cGold + C.Bold + "MEH...")); - player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)4, 1, C.Bold + "+2 " + C.cYellow + C.Bold + "It's okay...")); - player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)5, 1, C.Bold + "+3 " + C.cGreen + C.Bold + "Good")); - player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)3, 1, C.Bold + "+4 " + C.cAqua + C.Bold + "Amazing")); - player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)10, 1, C.Bold + "+5 " + C.cPurple + C.Bold + "WOW! EVERYTHING IS AWESOME!")); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)14, 1, C.cRed + C.Bold + "MY EYES ARE BLEEDING!")); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)1, 1, C.cGold + C.Bold + "MEH...")); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)4, 1, C.cYellow + C.Bold + "It's okay...")); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)5, 1, C.cGreen + C.Bold + "Good")); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)3, 1, C.cAqua + C.Bold + "Amazing")); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)10, 1, C.cPurple + C.Bold + "WOW! EVERYTHING IS AWESOME!")); UtilTextMiddle.display(null, C.cYellow + "Click to Vote", 0, 60, 5, player); } @@ -410,6 +427,8 @@ public class Build extends SoloGame } else if (_buildGameState == 4) { + tallyScores(); + ArrayList places = new ArrayList(); //Calculate Places @@ -417,21 +436,21 @@ public class Build extends SoloGame while (!_data.isEmpty()) { Player bestPlayer = null; - double bestScore = 0; + double bestPoints = 0; for (Player player : _data.keySet()) { - double score = _data.get(player).getScore(); + double points = _data.get(player).getPoints(); - if (bestPlayer == null || score > bestScore) + if (bestPlayer == null || points > bestPoints) { bestPlayer = player; - bestScore = score; + bestPoints = points; } } - AddGems(bestPlayer, bestScore, "Build Votes", false, false); - + //Average points per player is 1000, so divided by 50 = 20 gems + AddGems(bestPlayer, bestPoints / 50, "Build Votes", false, false); BuildData data = _data.remove(bestPlayer); @@ -442,11 +461,8 @@ public class Build extends SoloGame first = false; } - //Only count if they got above TERRIBLE score - if (BuildQuality.getQuality(bestScore) != BuildQuality.Failure) - places.add(bestPlayer); - - _scoreboardPlaces.add(new AbstractMap.SimpleEntry(bestPlayer, bestScore)); + places.add(bestPlayer); + _scoreboardPlaces.add(new AbstractMap.SimpleEntry(bestPlayer, bestPoints)); } writeScoreboard(); @@ -473,6 +489,66 @@ public class Build extends SoloGame } } + private void tallyScores() + { + //Reset, if being re-called + for (BuildData data : _data.values()) + { + data.clearPoints(); + } + + //Each player has 1000 points to give to the other builders. + //They are assigned based on a ratio of points given. + + //in a 5 player game, a player who gives everyone +0 will be giving everyone equally 250 Points + for (Player voter : _votes.keySet()) + { + //Gather Data + double votesCast = 0; + double voteTotal = 0; + + NautHashMap votes = _votes.get(voter); + + for (int vote : votes.values()) + { + votesCast++; + voteTotal += vote; + } + + AddGems(voter, (int)(voteTotal / 3), "Voting Fairly", false, false); + + double votesNotCast = (GetPlayers(true).size() - 1) - votesCast; + + double averageVote = 1; + if (votesCast > 0) + averageVote = voteTotal/votesCast; + + //This ensures that only 1000 points will be shared among builds + voteTotal += votesNotCast * averageVote; + + //Apply Points to builds + for (Player builder : _data.keySet()) + { + if (builder.equals(voter)) + continue; + + //If the voter didnt vote on this build, it will be given the average of their votes + double vote = averageVote; + if (votes.containsKey(builder)) + vote = votes.get(builder); + + double points = 1000d * (vote/voteTotal); + + _data.get(builder).addPoints(points); + +// System.out.println(voter.getName() + " = " + builder.getName() + " " + +// (votes.containsKey(builder) ? vote : "No Vote (" + averageVote + ")") + " ~ " + points); + } + + //System.out.println( " " ); + } + } + public boolean isBuildTime() { return _buildStateTime == 0; @@ -627,30 +703,33 @@ public class Build extends SoloGame if (!UtilTime.elapsed(_buildStateTime, 1500)) return; + if (!_votes.containsKey(event.getPlayer())) + _votes.put(event.getPlayer(), new NautHashMap()); + switch (event.getPlayer().getItemInHand().getData().getData()) { case 14: - _viewData.addScore(event.getPlayer(), 0); + _votes.get(event.getPlayer()).put(_viewData.Player, 1); UtilTextMiddle.display(null, event.getPlayer().getItemInHand().getItemMeta().getDisplayName(), 0, 40, 5, event.getPlayer()); break; case 1: - _viewData.addScore(event.getPlayer(), 1); + _votes.get(event.getPlayer()).put(_viewData.Player, 2); UtilTextMiddle.display(null, event.getPlayer().getItemInHand().getItemMeta().getDisplayName(), 0, 40, 5, event.getPlayer()); break; case 4: - _viewData.addScore(event.getPlayer(), 2); + _votes.get(event.getPlayer()).put(_viewData.Player, 3); UtilTextMiddle.display(null, event.getPlayer().getItemInHand().getItemMeta().getDisplayName(), 0, 40, 5, event.getPlayer()); break; case 5: - _viewData.addScore(event.getPlayer(), 3); + _votes.get(event.getPlayer()).put(_viewData.Player, 4); UtilTextMiddle.display(null, event.getPlayer().getItemInHand().getItemMeta().getDisplayName(), 0, 40, 5, event.getPlayer()); break; case 3: - _viewData.addScore(event.getPlayer(), 4); + _votes.get(event.getPlayer()).put(_viewData.Player, 5); UtilTextMiddle.display(null, event.getPlayer().getItemInHand().getItemMeta().getDisplayName(), 0, 40, 5, event.getPlayer()); break; case 10: - _viewData.addScore(event.getPlayer(), 5); + _votes.get(event.getPlayer()).put(_viewData.Player, 6); UtilTextMiddle.display(null, event.getPlayer().getItemInHand().getItemMeta().getDisplayName(), 0, 40, 5, event.getPlayer()); break; default: @@ -662,9 +741,11 @@ public class Build extends SoloGame public void playerQuit(PlayerQuitEvent event) { _data.remove(event.getPlayer()); - - for (BuildData data : _data.values()) - data.removeScore(event.getPlayer()); + + for (NautHashMap votedFor : _votes.values()) + votedFor.remove(event.getPlayer()); + + _votes.remove(event.getPlayer()); } @EventHandler @@ -1039,9 +1120,7 @@ public class Build extends SoloGame { for (Entry score : _scoreboardPlaces) { - int percent = (int)(score.getValue() * 20); - - Scoreboard.Write(BuildQuality.getQuality(score.getValue()).getColor() + percent + "% " + ChatColor.RESET + score.getKey().getName()); + Scoreboard.Write(BuildQuality.getFinalQuality(score.getValue()).getColor() + (int)(score.getValue().intValue()/10) + " " + ChatColor.RESET + score.getKey().getName()); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildData.java index 177277b8d..d1892ca79 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildData.java @@ -57,7 +57,7 @@ public class BuildData public WeatherType Weather = WeatherType.SUNNY; - public NautHashMap Score = new NautHashMap(); + private double _totalPoints = 0; public BuildData(Player player, Location spawn, ArrayList buildBorders) { @@ -155,29 +155,6 @@ public class BuildData { Blocks.add(block); } - - public void addScore(Player player, int i) - { - Score.put(player, i); - } - - public void removeScore(Player player) - { - Score.remove(player); - } - - public double getScore() - { - if (Score.isEmpty()) - return -1; - - double score = 0; - - for (int i : Score.values()) - score += i; - - return score/(double)Score.size(); - } public boolean inBuildArea(Block block) { @@ -327,4 +304,19 @@ public class BuildData MapUtil.QuickChangeBlockAt(Player.getWorld(), x, y, z, mat, data); } } + + public void addPoints(double d) + { + _totalPoints += d; + } + + public double getPoints() + { + return _totalPoints; + } + + public void clearPoints() + { + _totalPoints = 0; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildQuality.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildQuality.java index 78e1c1a42..9c2b18918 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildQuality.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildQuality.java @@ -26,13 +26,14 @@ public enum BuildQuality return _text; } - public static BuildQuality getQuality(double avgScore) + //1000 points is average, if everyone votes for everyone equally + public static BuildQuality getFinalQuality(double avgScore) { if (avgScore < 0) return NoVotes; - if (avgScore <= 1) return Failure; - if (avgScore <= 2) return Satisfactory; - if (avgScore <= 3) return Good; - if (avgScore <= 4) return Awesome; + if (avgScore <= 500) return Failure; + if (avgScore <= 1000) return Satisfactory; + if (avgScore <= 1500) return Good; + if (avgScore <= 2500) return Awesome; return Mindblowing; } From 3e64115f051e501310e17fb66dfab3e173484aff Mon Sep 17 00:00:00 2001 From: Mini-Chiss Date: Sat, 9 May 2015 17:45:08 -0500 Subject: [PATCH 4/4] vote colors --- .../game/arcade/game/games/build/BuildQuality.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildQuality.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildQuality.java index 9c2b18918..f308f5227 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildQuality.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/build/BuildQuality.java @@ -30,10 +30,10 @@ public enum BuildQuality public static BuildQuality getFinalQuality(double avgScore) { if (avgScore < 0) return NoVotes; - if (avgScore <= 500) return Failure; - if (avgScore <= 1000) return Satisfactory; - if (avgScore <= 1500) return Good; - if (avgScore <= 2500) return Awesome; + if (avgScore <= 400) return Failure; + if (avgScore <= 800) return Satisfactory; + if (avgScore <= 1200) return Good; + if (avgScore <= 1600) return Awesome; return Mindblowing; }