From 82b2541e3481fe4a480e4b2a9cd0218ca4e0a393 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 10 Aug 2016 21:47:13 +0100 Subject: [PATCH] PC-827 Team SSM - Teammates can no longer cancel each other's Blaze Firefly --- .../game/arcade/kit/perks/PerkFirefly.java | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFirefly.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFirefly.java index df7e17b2e..f16ef797c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFirefly.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFirefly.java @@ -17,15 +17,17 @@ import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilParticle.ViewDist; -import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; 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.Game; +import nautilus.game.arcade.game.games.smash.TeamSuperSmash; import nautilus.game.arcade.kit.SmashPerk; import nautilus.game.arcade.kit.perks.data.FireflyData; @@ -170,6 +172,11 @@ public class PerkFirefly extends SmashPerk if (event.GetDamage() <= 4) return; + if (!(event.GetDamagerEntity(true) instanceof Player)) + { + return; + } + Iterator dataIterator = _data.iterator(); while (dataIterator.hasNext()) @@ -181,6 +188,17 @@ public class PerkFirefly extends SmashPerk if (!UtilTime.elapsed(data.Time, 1250) && !isSuperActive(data.Player))// && event.GetCause() == DamageCause.PROJECTILE) { + Game game = Manager.GetGame(); + + if (game instanceof TeamSuperSmash) + { + if (game.GetTeam(data.Player).equals(game.GetTeam(event.GetDamagerPlayer(true)))) + { + event.SetCancelled("Team Damage"); + return; + } + } + dataIterator.remove(); } else