From e48dfbefe463d8ea8791f31e8e0370343223ba9d Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 3 Oct 2016 21:20:15 +0100 Subject: [PATCH] Even more fixes! --- .../evolution/mobs/perks/PerkBlockTossEVO.java | 9 +++------ .../game/games/smash/SoloSuperSmash.java | 13 ++----------- .../arcade/game/games/smash/SuperSmash.java | 10 +++++++++- .../smash/perks/enderman/PerkBlockToss.java | 16 ++++++---------- .../perks/enderman/PerkEndermanTeleport.java | 6 +++--- .../smash/perks/enderman/SmashEnderman.java | 18 +++--------------- .../smash/perks/guardian/PerkTargetLazer.java | 6 +++--- .../perks/guardian/PerkWhirlpoolBlade.java | 2 +- .../arcade/kit/perks/data/BlockTossData.java | 4 +++- 9 files changed, 33 insertions(+), 51 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBlockTossEVO.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBlockTossEVO.java index 1ed85835a..2d91ec76d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBlockTossEVO.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBlockTossEVO.java @@ -43,7 +43,6 @@ public class PerkBlockTossEVO extends Perk implements IThrown */ private HashMap _hold = new HashMap(); - private HashMap _charge = new HashMap(); private HashSet _charged = new HashSet(); private HashMap _falling = new HashMap(); @@ -107,10 +106,8 @@ public class PerkBlockTossEVO extends Perk implements IThrown //Manager.GetBlockRestore().Add(event.getClickedBlock(), 0, (byte)0, 10000); event.getClickedBlock().getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, event.getClickedBlock().getType()); - _hold.put(player, new BlockTossData(id, data)); + _hold.put(player, new BlockTossData(id, data, System.currentTimeMillis())); - _charge.put(player, System.currentTimeMillis()); - //Effect player.getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, id); } @@ -132,7 +129,7 @@ public class PerkBlockTossEVO extends Perk implements IThrown //Charged Tick if (!_charged.contains(cur)) - if (System.currentTimeMillis() - _charge.get(cur) > 1200) + if (System.currentTimeMillis() - _hold.get(cur).Time > 1200) { _charged.add(cur); cur.playEffect(cur.getLocation(), Effect.CLICK1, 0); @@ -149,7 +146,7 @@ public class PerkBlockTossEVO extends Perk implements IThrown _charged.remove(cur); - long charge = System.currentTimeMillis() - _charge.remove(cur); + long charge = System.currentTimeMillis() - data.Time; //Throw double mult = 1.4; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SoloSuperSmash.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SoloSuperSmash.java index 7f36bc1fb..fd1262539 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SoloSuperSmash.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SoloSuperSmash.java @@ -109,20 +109,11 @@ public class SoloSuperSmash extends SuperSmash { Scoreboard.writeNewLine(); - Scoreboard.writeGroup(GetPlayers(true), player -> + Scoreboard.writeGroup(GetPlayers(false), player -> { int lives = getLives(player); - String out; - if (lives >= 4) out = C.cGreen + player.getName(); - else if (lives == 3) out = C.cYellow + player.getName(); - else if (lives == 2) out = C.cGold + player.getName(); - else if (lives == 1) out = C.cRed + player.getName(); - else if (lives == 0) out = C.cRed + player.getName(); - else - return null; - - return Pair.create(out, lives); + return Pair.create(getLiveColour(lives) + player.getName(), lives); }, true); } 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 8ee31b928..cbd4e822e 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 @@ -548,8 +548,9 @@ public abstract class SuperSmash extends Game case 2: return C.cGold; case 1: - case 0: return C.cRed; + case 0: + return C.cGray + C.Strike; default: return C.cGreen; } @@ -617,5 +618,12 @@ public abstract class SuperSmash extends Game } } } + else if (message.startsWith("/lives")) + { + event.setCancelled(true); + + _lives.put(player, 4); + Announce(C.cWhiteB + player.getName() + C.cAquaB + " reset their lives!"); + } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkBlockToss.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkBlockToss.java index 17aa4d7fc..adb43f296 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkBlockToss.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkBlockToss.java @@ -34,6 +34,7 @@ import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; + import nautilus.game.arcade.game.games.smash.perks.SmashPerk; import nautilus.game.arcade.kit.perks.data.BlockTossData; import nautilus.game.arcade.kit.perks.event.PerkBlockGrabEvent; @@ -48,7 +49,6 @@ public class PerkBlockToss extends SmashPerk implements IThrown private static final float KNOCKBACK_MAGNITUDE = 2.5F; private Map _hold = new HashMap<>(); - private Map _charge = new HashMap<>(); private Set _charged = new HashSet<>(); private Map _falling = new HashMap<>(); @@ -121,9 +121,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown // Remove Block event.getClickedBlock().getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, event.getClickedBlock().getType()); - _hold.put(player.getUniqueId(), new BlockTossData(id, data)); - - _charge.put(player.getUniqueId(), System.currentTimeMillis()); + _hold.put(player.getUniqueId(), new BlockTossData(id, data, System.currentTimeMillis())); // Effect player.getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, id); @@ -137,7 +135,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown return; } - Set throwSet = new HashSet(); + Set throwSet = new HashSet<>(); for (UUID key : _hold.keySet()) { @@ -157,7 +155,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown // Charged Tick if (!_charged.contains(key)) { - if (System.currentTimeMillis() - _charge.get(key) > CHARGE_TIME) + if (System.currentTimeMillis() - _hold.get(key).Time > CHARGE_TIME) { _charged.add(key); player.getWorld().playEffect(player.getLocation(), Effect.CLICK1, 0); @@ -180,12 +178,10 @@ public class PerkBlockToss extends SmashPerk implements IThrown _charged.remove(key); - long charge = System.currentTimeMillis() - _charge.remove(key); + long charge = System.currentTimeMillis() - data.Time; // Throw - double mult = 1.4 * (charge / CHARGE_TIME); - - Bukkit.broadcastMessage("mult = " + mult); + double mult = Math.min(1.4, 1.4 * ((double) charge / CHARGE_TIME)); // Action UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0.2, 0, 1, true); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkEndermanTeleport.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkEndermanTeleport.java index a135b38d5..5fcc81787 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkEndermanTeleport.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkEndermanTeleport.java @@ -49,14 +49,14 @@ public class PerkEndermanTeleport extends SmashPerk for (Player player : UtilServer.getPlayers()) { - if (!hasPerk(player)) + if (!hasPerk(player) || UtilPlayer.isSpectator(player)) { continue; } UUID key = player.getUniqueId(); - if (!(player.isSneaking() || Recharge.Instance.usable(player, GetName()))) + if (!player.isSneaking() || !Recharge.Instance.usable(player, GetName())) { _target.remove(key); _charge.remove(key); @@ -88,7 +88,7 @@ public class PerkEndermanTeleport extends SmashPerk { _charge.put(key, _charge.get(key) + CHARGE_PER_TICK); - UtilTextMiddle.display(null, UtilTextMiddle.progress(_charge.get(player)), 0, 10, 10, player); + UtilTextMiddle.display(null, UtilTextMiddle.progress(_charge.get(key)), 0, 10, 10, player); if (_charge.get(key) >= 1) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/SmashEnderman.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/SmashEnderman.java index bd45991da..04f76be18 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/SmashEnderman.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/SmashEnderman.java @@ -135,20 +135,6 @@ public class SmashEnderman extends SmashUltimate } } - @EventHandler(priority = EventPriority.LOW) - public void dragonDamageeCancel(CustomDamageEvent event) - { - if (event.GetDamagerEntity(false) == null) - { - return; - } - - if (_dragons.values().contains(event.GetDamagerEntity(false))) - { - event.SetCancelled("Enderman Dragon Damagee"); - } - } - @EventHandler(priority = EventPriority.LOW) public void dragonDamagerCancel(CustomDamageEvent event) { @@ -169,8 +155,10 @@ public class SmashEnderman extends SmashUltimate public void updateDamageAoe(UpdateEvent event) { if (event.getType() != UpdateType.TICK) + { return; - + } + for (UUID key : _dragons.keySet()) { Player player = UtilPlayer.searchExact(key); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/PerkTargetLazer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/PerkTargetLazer.java index f8c820570..cd2460f3a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/PerkTargetLazer.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/PerkTargetLazer.java @@ -122,7 +122,7 @@ public class PerkTargetLazer extends SmashPerk { if (data.getTimeElapsed() < MAX_TIME) { - break; + return; } contained = true; @@ -132,7 +132,7 @@ public class PerkTargetLazer extends SmashPerk if (best == null) { - player.sendMessage(F.main("Game", "There are no targets within the range.")); + player.sendMessage(F.main("Game", "There are no targets within range.")); return; } @@ -184,7 +184,7 @@ public class PerkTargetLazer extends SmashPerk long time = data.getTimeElapsed() / 1000; double damage = 0.5 * time; - data.getAttacker().sendMessage(F.main("Game", "Your laser ended dealing damage to " + F.name(data.getTarget().getName())) + "."); + data.getAttacker().sendMessage(F.main("Game", "Your laser broke dealing damage to " + F.name(data.getTarget().getName())) + "."); Manager.GetDamage().NewDamageEvent(data.getTarget(), data.getAttacker(), null, DamageCause.CUSTOM, damage, false, true, false, data.getAttacker().getName(), GetName()); setLazerTarget(data.getAttacker(), null); Recharge.Instance.use(data.getAttacker(), GetName(), COOLDOWN, true, true); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/PerkWhirlpoolBlade.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/PerkWhirlpoolBlade.java index f8bbcfb7f..c47293d16 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/PerkWhirlpoolBlade.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/PerkWhirlpoolBlade.java @@ -38,7 +38,7 @@ public class PerkWhirlpoolBlade extends Perk implements IThrown private static final int COOLDOWN = 5000; private static final int EXPIRE_TIME = 3000; private static final float VELOCITY = 1.2F; - private static final int HIT_BOX = 1; + private static final float HIT_BOX = 0.5F; private static final int DAMAGE = 2; private Set _items = new HashSet<>(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/data/BlockTossData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/data/BlockTossData.java index bd1130267..98fda9f0d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/data/BlockTossData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/data/BlockTossData.java @@ -4,10 +4,12 @@ public class BlockTossData { public int Type; public byte Data; + public long Time; - public BlockTossData(int type, byte data) + public BlockTossData(int type, byte data, long time) { Type = type; Data = data; + Time = time; } }