From 463dfc7049cea92a919458b779440f2d59f6ad3d Mon Sep 17 00:00:00 2001 From: Mysticate Date: Mon, 10 Aug 2015 00:21:48 -0400 Subject: [PATCH] Minor Tweaks. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Fixed wrong evo location • Added a "Frozen" effect when evolving. --- .../game/games/evolution/Evolution.java | 82 +++++++++++++------ .../games/evolution/evolve/EvolveData.java | 4 +- 2 files changed, 60 insertions(+), 26 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java index 3ad62de58..0778d22d4 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java @@ -23,7 +23,9 @@ import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.combat.CombatComponent; import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; +import mineplex.minecraft.game.core.condition.Condition; import mineplex.minecraft.game.core.condition.Condition.ConditionType; +import mineplex.minecraft.game.core.condition.conditions.Cloak; import mineplex.minecraft.game.core.condition.ConditionActive; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; @@ -76,6 +78,8 @@ public class Evolution extends SoloGame private NautHashMap _evoPlatforms = new NautHashMap(); private ArrayList _evolutionsAvailable = new ArrayList(); + private NautHashMap _chargingExp = new NautHashMap(); + private NautHashMap _evolvingDebuffs = new NautHashMap(); public Evolution(ArcadeManager manager) { @@ -84,8 +88,7 @@ public class Evolution extends SoloGame new Kit[0], new String[] { - "You recieve an Evolution token every 2 kills.", - "Use it to Evolve into a new mob.", + "You can evolve every kill.", "Each evolution has unique skills.", "First to get through 10 evolutions wins!" }); @@ -188,9 +191,6 @@ public class Evolution extends SoloGame _tokens.put(player.getName(), new EvoToken(player)); upgradeKit(player, false); - - player.setLevel(0); - player.setExp(0F); } } @@ -279,6 +279,22 @@ public class Evolution extends SoloGame Manager.GetCondition().Factory().Cloak("Evolving", player, null, 20, false, false); + //Freeze + Condition cloak = new Cloak(Manager.GetCondition(), "Evolving", player, null, ConditionType.CLOAK, 0, (int)(20 * 20), false, Material.GHAST_TEAR, (byte)0, false); + Condition speed = new Condition(Manager.GetCondition(), "Evolving", player, null, ConditionType.SPEED, 128, (int)(20 * 20), false, Material.FEATHER, (byte)0, false, false); + Condition slow = new Condition(Manager.GetCondition(), "Evolving", player, null, ConditionType.SLOW, Integer.MAX_VALUE, (int)(20 * 20), false, Material.WEB, (byte)0, false, false); + Condition jump = new Condition(Manager.GetCondition(), "Evolving", player, null, ConditionType.JUMP, -Integer.MAX_VALUE, (int)(20 * 20), false, Material.CARROT_ITEM, (byte)0, false, false); + + _evolvingDebuffs.put(player.getName(), new Condition[] + { + cloak, speed, slow, jump + }); + + Manager.GetCondition().AddCondition(cloak); + Manager.GetCondition().AddCondition(speed); + Manager.GetCondition().AddCondition(slow); + Manager.GetCondition().AddCondition(jump); + ((Player) player).playSound(player.getLocation(), Sound.ORB_PICKUP, 1f, 1.25f); } @@ -289,8 +305,23 @@ public class Evolution extends SoloGame { for (ConditionActive condition : Manager.GetCondition().GetActiveConditions().get(event.getPlayer())) { - if (condition.GetCondition().GetType() == ConditionType.CLOAK) - continue; + if (_evolvingDebuffs.containsKey(event.getPlayer().getName())) + { + boolean d = false; + for (Condition debuf : _evolvingDebuffs.get(event.getPlayer().getName())) + { + if (condition.GetCondition() == debuf) + { + d = true; + break; + } + } + + if (d) + { + continue; + } + } condition.GetCondition().Expire(); } @@ -314,11 +345,13 @@ public class Evolution extends SoloGame @EventHandler public void endEvolve(final EvolutionPostEvolveEvent event) { - try + if (_evolvingDebuffs.containsKey(event.getPlayer().getName())) { - Manager.GetCondition().GetActiveCondition(event.getPlayer(), ConditionType.CLOAK).Expire(); + for (Condition debuf : _evolvingDebuffs.get(event.getPlayer().getName())) + { + debuf.Expire(); + } } - catch (NullPointerException ex){} if (getScore(event.getPlayer()) >= 10) { @@ -372,9 +405,9 @@ public class Evolution extends SoloGame if (!_evolutionsAvailable.contains(player)) { _evolutionsAvailable.add(player); - - player.setLevel(0); - player.setExp(0F); + + if (_chargingExp.containsKey(player.getName())) + _chargingExp.remove(player.getName()); } } @@ -430,12 +463,9 @@ public class Evolution extends SoloGame } else { - if (player.getExp() != 0F) - player.setExp(0F); - - if (player.getLevel() != 0) - player.setLevel(0); - + if (_chargingExp.containsKey(player.getName())) + _chargingExp.remove(player.getName()); + if (Recharge.Instance.use(player, "Evolve Available", 2000, false, false)) { UtilTextMiddle.display("", C.cGreen + C.Bold + "Hold Crouch to Evolve", 0, 60, 20, player); @@ -452,12 +482,16 @@ public class Evolution extends SoloGame if (!player.isOnGround() || !UtilEnt.isGrounded(player) || !UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN))) return false; - if (player.getExp() >= .9999F) + if (!_chargingExp.containsKey(player.getName())) + _chargingExp.put(player.getName(), 0F); + + float exp = _chargingExp.get(player.getName()); + + if (exp >= .9999F) { UtilTextMiddle.display("", "", player); - player.setExp(0F); - player.setLevel(0); + _chargingExp.remove(player.getName()); EvoToken token = _tokens.get(player.getName()); @@ -468,9 +502,9 @@ public class Evolution extends SoloGame return true; } - player.setExp(Math.min(player.getExp() + .008F, .9999F)); + _chargingExp.put(player.getName(), Math.min(exp + .008F, .9999F)); - UtilTextMiddle.display("", UtilTextMiddle.progress(player.getExp()).trim(), player); + UtilTextMiddle.display("", UtilTextMiddle.progress(_chargingExp.get(player.getName())).trim(), player); UtilParticle.PlayParticle(ParticleType.PORTAL, player.getLocation().clone().add(0, 1, 0), 0.5F, 1.0F, 0.5F, 0, 5, ViewDist.NORMAL, UtilServer.getPlayers()); return false; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/evolve/EvolveData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/evolve/EvolveData.java index 1de5ea85f..47376bed6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/evolve/EvolveData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/evolve/EvolveData.java @@ -88,7 +88,7 @@ public class EvolveData _eggLoc = player.getLocation().getBlock().getLocation(); _eggLocData = new SimpleEntry(_eggLoc.getBlock().getType(), _eggLoc.getBlock().getData()); - _eggHolo = new Hologram(holo, _eggLoc.clone().add(0.5, 1.0, 0.5), C.cYellow + _player.getName()).setViewDistance(20).start(); + _eggHolo = new Hologram(holo, _eggLoc.clone().add(0.5, 1.0, 0.5), C.cYellow + _player.getName()).start(); _to = to; @@ -114,7 +114,7 @@ public class EvolveData private void setupPlayer() { - _player.teleport(_token.Viewing.clone().add(0.5, 0.0, 0.5)); + _player.teleport(_token.Viewing); } //Boolean completed