From bb9ca490b1c0527cde8902bf5a374e4f6fc1a3a6 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 6 Oct 2016 15:03:51 +0100 Subject: [PATCH] GI changes --- .../game/games/smash/kits/KitGuardian.java | 6 +- .../game/games/smash/perks/SmashKit.java | 2 +- .../smash/perks/enderman/PerkBlockToss.java | 1 - .../smash/perks/enderman/SmashEnderman.java | 2 +- .../smash/perks/guardian/PerkTargetLazer.java | 8 +- .../perks/guardian/PerkWhirlpoolBlade.java | 2 +- .../smash/perks/guardian/TargetLazerData.java | 4 +- .../smash/perks/spider/PerkSpiderLeap.java | 2 +- .../smash/perks/squid/PerkFishFlurry.java | 2 +- .../games/smash/perks/witch/PerkBatWave.java | 6 +- .../smash/perks/witch/PerkWitchPotion.java | 134 ++++++++++-------- 11 files changed, 97 insertions(+), 72 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitGuardian.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitGuardian.java index 6b396586e..0e4471cdb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitGuardian.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitGuardian.java @@ -26,7 +26,7 @@ public class KitGuardian extends SmashKit { private static final Perk[] PERKS = { - new PerkSmashStats(4, 1.25, 0.25, 4), + new PerkSmashStats(4, 1.25, 0.25, 4.5), new PerkDoubleJump("Double Jump", 0.9, 0.9, false), new PerkWhirlpoolBlade(), new PerkWaterSplash(), @@ -79,10 +79,10 @@ public class KitGuardian extends SmashKit }; private static final ItemStack[] PLAYER_ARMOR = { + new ItemStack(Material.DIAMOND_BOOTS), + new ItemStack(Material.DIAMOND_LEGGINGS), null, null, - new ItemStack(Material.DIAMOND_CHESTPLATE), - null, }; public KitGuardian(ArcadeManager manager) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/SmashKit.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/SmashKit.java index 17ac0ada2..c79cd2660 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/SmashKit.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/SmashKit.java @@ -80,7 +80,7 @@ public abstract class SmashKit extends ProgressingKit if (gameTeam != null) { - disguise.setName(Manager.GetGame().GetTeam(player).GetColor() + player.getName()); + disguise.setName(gameTeam.GetColor() + player.getName()); } else { 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 adb43f296..e843ae6d4 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 @@ -6,7 +6,6 @@ import java.util.Map; import java.util.Set; import java.util.UUID; -import org.bukkit.Bukkit; import org.bukkit.Effect; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; 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 04f76be18..254343602 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 @@ -168,7 +168,7 @@ public class SmashEnderman extends SmashUltimate continue; } - EnderDragon dragon = _dragons.get(player); + EnderDragon dragon = _dragons.get(key); UtilParticle.PlayParticleToAll(ParticleType.FIREWORKS_SPARK, dragon.getLocation(), 0, 0, 0, 0, 1, ViewDist.LONGER); 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 7f6be4637..e9f964077 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 @@ -6,6 +6,7 @@ import java.util.Set; import org.bukkit.Effect; import org.bukkit.Material; +import org.bukkit.entity.ArmorStand; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; @@ -183,11 +184,15 @@ public class PerkTargetLazer extends SmashPerk { long time = data.getTimeElapsed() / 1000; double damage = 0.5 * time; + ArmorStand targetPlaceholder = data.update(Manager); + + targetPlaceholder.remove(); 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); + iterator.remove(); } } @@ -250,6 +255,7 @@ public class PerkTargetLazer extends SmashPerk if (target == null) { disguise.setTarget(0); + data.update(Manager).remove(); } else { 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 83e8f7a7a..96a03a2e9 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 @@ -37,7 +37,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 float VELOCITY = 1.6F; private static final float HIT_BOX = 0.5F; private static final int DAMAGE = 2; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/TargetLazerData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/TargetLazerData.java index b089f4f72..04f5c8500 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/TargetLazerData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/TargetLazerData.java @@ -26,7 +26,7 @@ public class TargetLazerData public ArmorStand update(ArcadeManager manager) { - if (_targetPlaceholder == null) + if (_targetPlaceholder == null || !_targetPlaceholder.isValid()) { manager.GetGame().CreatureAllowOverride = true; _targetPlaceholder = _target.getWorld().spawn(_target.getLocation(), ArmorStand.class); @@ -51,7 +51,7 @@ public class TargetLazerData { return _target; } - + public long getTimeElapsed() { return System.currentTimeMillis() - _startTime; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/spider/PerkSpiderLeap.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/spider/PerkSpiderLeap.java index 41bdc1f68..7783f96c2 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/spider/PerkSpiderLeap.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/spider/PerkSpiderLeap.java @@ -61,7 +61,7 @@ public class PerkSpiderLeap extends Perk if (!player.isSneaking()) { - if (UtilEnt.isGrounded(player) || UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN))) + if (UtilEnt.isGrounded(player)) { player.setExp((float) Math.min(0.999, player.getExp() + ENERGY_PER_TICK)); _secondJump.remove(player.getUniqueId()); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/squid/PerkFishFlurry.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/squid/PerkFishFlurry.java index 335f7c7ae..539e98cf9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/squid/PerkFishFlurry.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/squid/PerkFishFlurry.java @@ -47,7 +47,7 @@ public class PerkFishFlurry extends SmashPerk implements IThrown { private static final int COOLDOWN = 24000; - private static final int DAMAGE = 3; + private static final float DAMAGE = 2.6F; private static final int START_TIME = 2000; private static final int END_TIME = 6000; private static final float KNOCKBACK_MAGNITUDE = 1.5F; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witch/PerkBatWave.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witch/PerkBatWave.java index 2b628c182..5ba2be470 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witch/PerkBatWave.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witch/PerkBatWave.java @@ -58,7 +58,7 @@ public class PerkBatWave extends SmashPerk private Map _active = new HashMap<>(); private Map _direction = new HashMap<>(); private Map> _bats = new HashMap<>(); - private Map _damageTaken = new HashMap<>(); + private Map _damageTaken = new HashMap<>(); private Set _pulling = new HashSet<>(); private Set _allowLeash = new HashSet<>(); @@ -315,10 +315,10 @@ public class PerkBatWave extends SmashPerk if (!_damageTaken.containsKey(key)) { - _damageTaken.put(key, 0); + _damageTaken.put(key, 0D); } - _damageTaken.put(key, (int) (_damageTaken.get(key) + event.GetDamage())); + _damageTaken.put(key, (_damageTaken.get(key) + event.GetDamage())); if (_damageTaken.get(key) >= DISABLE_DAMAGE) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witch/PerkWitchPotion.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witch/PerkWitchPotion.java index 073c8b282..825948c9a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witch/PerkWitchPotion.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witch/PerkWitchPotion.java @@ -3,21 +3,23 @@ package nautilus.game.arcade.game.games.smash.perks.witch; import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.Set; +import org.bukkit.block.Block; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; import org.bukkit.entity.ThrownPotion; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.player.PlayerInteractEvent; +import com.google.common.collect.Sets; + import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilBlock; -import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilItem; @@ -27,22 +29,25 @@ 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.projectile.IThrown; +import mineplex.core.projectile.ProjectileUser; 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; -public class PerkWitchPotion extends SmashPerk +public class PerkWitchPotion extends SmashPerk implements IThrown { - + private static final int COOLDOWN = 2000; private static final int RANGE_NOMRAL = 3; private static final int RANGE_SMASH = 4; - private static final int DAMAGE_NORMAL = 7; + private static final int DAMAGE_NORMAL = 6; private static final int DAMAGE_SMASH = 10; private static final int KNOCKBACK_MAGNITUDE = 2; - + private List _proj = new ArrayList<>(); public PerkWitchPotion() @@ -89,65 +94,19 @@ public class PerkWitchPotion extends SmashPerk { return; } - + // Start ThrownPotion potion = player.launchProjectile(ThrownPotion.class); UtilAction.velocity(potion, player.getLocation().getDirection(), 1, false, 0, 0.2, 10, false); _proj.add(potion); + Manager.GetProjectile().AddThrow(potion, player, this, 10000, true, true, true, false, false, 0.5F); + // Inform UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + ".")); } - @EventHandler - public void Hit(ProjectileHitEvent event) - { - if (!_proj.remove(event.getEntity())) - { - return; - } - - for (Player player : Manager.GetGame().GetPlayers(true)) - { - if (player.equals(event.getEntity().getShooter())) - { - continue; - } - - if (!(event.getEntity().getShooter() instanceof Player)) - { - continue; - } - - Player thrower = (Player) event.getEntity().getShooter(); - - if (UtilMath.offset(player.getLocation().add(0, 1, 0), event.getEntity().getLocation()) > (isSuperActive(thrower) ? RANGE_SMASH : RANGE_NOMRAL)) - { - continue; - } - - String name = UtilEnt.getName((LivingEntity) event.getEntity().getShooter()); - - // Standard - if (!isSuperActive(thrower)) - { - // Damage Event - Manager.GetDamage().NewDamageEvent(player, thrower, null, DamageCause.CUSTOM, DAMAGE_NORMAL, true, true, false, name, GetName()); - - Manager.GetCondition().Factory().Slow(GetName(), player, null, 3, 1, true, false, false, false); - } - // Super Effect - else - { - // Damage Event - Manager.GetDamage().NewDamageEvent(player, thrower, null, DamageCause.CUSTOM, DAMAGE_SMASH, true, true, false, name, GetName()); - - Manager.GetCondition().Factory().Slow(GetName(), player, null, 7, 2, true, false, false, false); - } - } - } - @EventHandler public void Update(UpdateEvent event) { @@ -155,7 +114,7 @@ public class PerkWitchPotion extends SmashPerk { return; } - + Iterator potionIterator = _proj.iterator(); while (potionIterator.hasNext()) @@ -179,7 +138,68 @@ public class PerkWitchPotion extends SmashPerk { return; } - + event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); } + + @Override + public void Collide(LivingEntity target, Block block, ProjectileUser data) + { + Set players = Sets.newHashSet(target); + Player thrower = (Player) data.getThrower(); + + if (!(data.getThrower() instanceof Player)) + { + return; + } + + for (Player player : Manager.GetGame().GetPlayers(true)) + { + if (player.equals(data.getThrower())) + { + continue; + } + + double d = UtilMath.offset(player.getLocation().add(0, 1, 0), target.getLocation()); + + if (d > (isSuperActive(thrower) ? RANGE_SMASH : RANGE_NOMRAL)) + { + continue; + } + + players.add(player); + } + + boolean smash = isSuperActive(thrower); + int i = 0; + + for (LivingEntity entity : players) + { + if (smash) + { + // Damage Event + Manager.GetDamage().NewDamageEvent(entity, thrower, null, DamageCause.CUSTOM, (i++ == 0 ? DAMAGE_NORMAL + 1 : DAMAGE_NORMAL), true, true, false, thrower.getName(), GetName()); + + Manager.GetCondition().Factory().Slow(GetName(), entity, null, 3, 1, true, false, false, false); + } + // Super Effect + else + { + // Damage Event + Manager.GetDamage().NewDamageEvent(entity, thrower, null, DamageCause.CUSTOM, DAMAGE_SMASH, true, true, false, thrower.getName(), GetName()); + + Manager.GetCondition().Factory().Slow(GetName(), entity, null, 7, 2, true, false, false, false); + } + } + } + + @Override + public void Idle(ProjectileUser data) + { + } + + @Override + public void Expire(ProjectileUser data) + { + } }