diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitBlaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitBlaze.java index 37399886a..9c176940f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitBlaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitBlaze.java @@ -29,9 +29,9 @@ import nautilus.game.arcade.kit.perks.PerkSpeed; public class KitBlaze extends SmashKit { private static final Perk[] PERKS = { - new PerkSmashStats(6, 1.5, 0.25, 5), - new PerkDoubleJump("Double Jump", 1, 1, false), - new PerkKnockbackFire(1.50), + new PerkSmashStats(), + new PerkDoubleJump("Double Jump"), + new PerkKnockbackFire(), new PerkSpeed(0), new PerkInferno(), new PerkFirefly(), diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/blaze/PerkFirefly.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/blaze/PerkFirefly.java index 29cd6d704..f643d4598 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/blaze/PerkFirefly.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/blaze/PerkFirefly.java @@ -34,29 +34,45 @@ import nautilus.game.arcade.kit.perks.data.FireflyData; public class PerkFirefly extends SmashPerk { - - private static final int COOLDOWN = 12000; - private static final int DURATION = 2750; - private static final int DAMAGE = 7; - - private static final int RADIUS_NORMAL = 4; - private static final float VELOCITY_NORMAL = 0.7F; - - private static final int RADIUS_SMASH = 7; - private static final float VELOCITY_SMASH = 0.79F; - - private static final int HIT_FREQUENCY = 2000; - private static final int WARMUP_TIME = 1500; - private static final int MIN_CANCEL_DAMAGE = 4; - private static final int KNOCKBACK_MAGNITUDE = 2; - private Set _data = new HashSet(); - + private int _cooldown; + private int _duration ; + private int _damage; + + private int _radiusNormal; + private float _velocityNormal; + + private int _radiusSmash; + private float _velocitySmash; + + private int _hitFrequency; + private int _warmupTime; + private int _minCancelDamage; + private int _knockbackMagnitude; + + private Set _data = new HashSet<>(); + private int _tick = 0; - + public PerkFirefly() { - super("Firefly", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Firefly" }); + super("Firefly", new String[]{C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Firefly"}); + } + + @Override + public void setupValues() + { + _cooldown = getPerkTime("Cooldown"); + _duration = getPerkInt("Duration (ms)"); + _damage = getPerkInt("Damage"); + _radiusNormal = getPerkInt("Radius Normal"); + _velocityNormal = getPerkFloat("Velocity Normal"); + _radiusSmash = getPerkInt("Radius Smash"); + _velocitySmash = getPerkFloat("Velocity Smash"); + _hitFrequency = getPerkInt("Hit Frequency (ms)"); + _warmupTime = getPerkInt("Warmup Time (ms)"); + _minCancelDamage = getPerkInt("Cancel Damage"); + _knockbackMagnitude = getPerkInt("Knockback Magnitude"); } @EventHandler @@ -94,7 +110,7 @@ public class PerkFirefly extends SmashPerk return; } - if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true)) + if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true)) { return; } @@ -126,7 +142,7 @@ public class PerkFirefly extends SmashPerk Iterator dataIterator = _data.iterator(); //There are a lot of magic numbers here, they are all arbitrary sound and particle values. - + while (dataIterator.hasNext()) { FireflyData data = dataIterator.next(); @@ -134,15 +150,15 @@ public class PerkFirefly extends SmashPerk Player player = data.Player; boolean superActive = isSuperActive(data.Player); String skillName = superActive ? "Phoenix" : GetName(); - + if (UtilPlayer.isSpectator(player)) { dataIterator.remove(); continue; } - + // Warmup - if (!UtilTime.elapsed(data.Time, WARMUP_TIME) && !superActive) + if (!UtilTime.elapsed(data.Time, _warmupTime) && !superActive) { UtilAction.zeroVelocity(player); player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, 0.2f, 0.6f); @@ -151,14 +167,14 @@ public class PerkFirefly extends SmashPerk // Sound and Effect UtilParticle.PlayParticleToAll(ParticleType.FIREWORKS_SPARK, player.getLocation().add(0, 1, 0), 0.6f, 0.6f, 0.6f, 0, 10, ViewDist.LONG); - float progress = (float) (System.currentTimeMillis() - data.Time) / WARMUP_TIME; + float progress = (float) (System.currentTimeMillis() - data.Time) / _warmupTime; player.getWorld().playSound(player.getLocation(), Sound.BLAZE_BREATH, 0.5f, 1f + progress); } // Velocity - else if (!UtilTime.elapsed(data.Time, DURATION) || superActive) + else if (!UtilTime.elapsed(data.Time, _duration) || superActive) { - UtilAction.velocity(player, player.getLocation().getDirection().multiply(superActive ? VELOCITY_SMASH : VELOCITY_NORMAL).add(new Vector(0, 0.15, 0))); + UtilAction.velocity(player, player.getLocation().getDirection().multiply(superActive ? _velocitySmash : _velocityNormal).add(new Vector(0, 0.15, 0))); player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, 0.6f, 1.2f); // Sound and Effect @@ -176,7 +192,7 @@ public class PerkFirefly extends SmashPerk player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, 0.75f, 0.75f); } - for (Player other : UtilPlayer.getNearby(player.getLocation(), superActive ? RADIUS_SMASH : RADIUS_NORMAL)) + for (Player other : UtilPlayer.getNearby(player.getLocation(), superActive ? _radiusSmash : _radiusNormal)) { if (other.equals(player)) { @@ -192,10 +208,10 @@ public class PerkFirefly extends SmashPerk if (_tick % 12 == 0) { - if (Recharge.Instance.use(other, GetName() + " hit by " + player.getName(), HIT_FREQUENCY, false, false)) - { + if (Recharge.Instance.use(other, GetName() + " hit by " + player.getName(), _hitFrequency, false, false)) + { // Damage Event - Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, DAMAGE, true, true, false, player.getName(), skillName); + Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage, true, true, false, player.getName(), skillName); UtilPlayer.message(other, F.main("Game", F.elem(Manager.GetColor(player) + player.getName()) + " hit you with " + F.elem(skillName) + ".")); } @@ -212,11 +228,11 @@ public class PerkFirefly extends SmashPerk @EventHandler public void FireflyDamage(CustomDamageEvent event) { - if (event.GetDamage() < MIN_CANCEL_DAMAGE) + if (event.GetDamage() < _minCancelDamage) { return; } - + if (!(event.GetDamagerEntity(true) instanceof Player)) { return; @@ -232,7 +248,7 @@ public class PerkFirefly extends SmashPerk { continue; } - + if (!UtilTime.elapsed(data.Time, 1250) && !isSuperActive(data.Player)) { if (isTeamDamage(data.Player, event.GetDamagerPlayer(true))) @@ -256,7 +272,7 @@ public class PerkFirefly extends SmashPerk { return; } - - event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); + + event.AddKnockback(GetName(), _knockbackMagnitude); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/blaze/PerkInferno.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/blaze/PerkInferno.java index 7eb44eca3..2099330c5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/blaze/PerkInferno.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/blaze/PerkInferno.java @@ -30,13 +30,14 @@ public class PerkInferno extends SmashPerk { private static final float MAX_ENERGY = 0.999F; - private static final float ENERGY_PER_TICK = 0.025F; - private static final float ENERGY_PER_ITEM = 0.035F; + + private float _energyTick = 0.025F; + private float _energyItem = 0.035F; - private static final double ITEM_EXPIRE_TIME = 0.7; - private static final double ITEM_BURN_TIME = 0.5; - private static final double ITEM_DAMAGE = 0.25; - private static final float ITEM_VELOCITY_MAGNITUDE = 1.6F; + private double _itemExpireTime = 0.7; + private double _itemBurnTime = 0.5; + private double _itemDamage = 0.25; + private float _itemVelocityMagnitude = 1.6F; private Map _active = new HashMap<>(); @@ -45,6 +46,17 @@ public class PerkInferno extends SmashPerk super("Inferno", new String[] { C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Inferno" }); } + @Override + public void setupValues() + { + _energyTick = getPerkFloat("Energy Tick"); + _energyItem = getPerkFloat("Energy Item"); + _itemExpireTime = getPerkDouble("Expire Time"); + _itemBurnTime = getPerkDouble("Burn Time"); + _itemDamage = getPerkDouble("Damage"); + _itemVelocityMagnitude = getPerkFloat("Velocity Magnitude"); + } + @EventHandler public void EnergyUpdate(UpdateEvent event) { @@ -62,7 +74,7 @@ public class PerkInferno extends SmashPerk if (!player.isBlocking()) { - player.setExp(Math.min(MAX_ENERGY, player.getExp() + ENERGY_PER_TICK)); + player.setExp(Math.min(MAX_ENERGY, player.getExp() + _energyTick)); } } } @@ -130,7 +142,7 @@ public class PerkInferno extends SmashPerk continue; } - cur.setExp(cur.getExp() - ENERGY_PER_ITEM); + cur.setExp(cur.getExp() - _energyItem); if (cur.getExp() <= 0) { @@ -140,10 +152,10 @@ public class PerkInferno extends SmashPerk // Fire Item fire = cur.getWorld().dropItem(cur.getEyeLocation(), new ItemStack(Material.BLAZE_POWDER)); - Manager.GetFire().Add(fire, cur, ITEM_EXPIRE_TIME, 0, ITEM_BURN_TIME, ITEM_DAMAGE, GetName(), false); + Manager.GetFire().Add(fire, cur, _itemExpireTime, 0, _itemBurnTime, _itemDamage, GetName(), false); fire.teleport(cur.getEyeLocation()); - fire.setVelocity(cur.getLocation().getDirection().add(getRandomVector()).multiply(ITEM_VELOCITY_MAGNITUDE)); + fire.setVelocity(cur.getLocation().getDirection().add(getRandomVector()).multiply(_itemVelocityMagnitude)); // Effect cur.getWorld().playSound(cur.getLocation(), Sound.GHAST_FIREBALL, 0.1f, 1f); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/blaze/SmashBlaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/blaze/SmashBlaze.java index 6fba264a3..26e91f7b1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/blaze/SmashBlaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/blaze/SmashBlaze.java @@ -10,13 +10,11 @@ import nautilus.game.arcade.kit.Perk; public class SmashBlaze extends SmashUltimate { - private static final int DURATION = 18000; - public SmashBlaze() { - super("Phoenix", new String[] {}, Sound.BLAZE_DEATH, DURATION); + super("Phoenix", new String[] {}, Sound.BLAZE_DEATH, 0); } - + @Override public void activate(Player player) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkKnockbackFire.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkKnockbackFire.java index ab071b021..ee6bd4338 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkKnockbackFire.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkKnockbackFire.java @@ -11,7 +11,12 @@ import nautilus.game.arcade.kit.Perk; public class PerkKnockbackFire extends Perk { private double _power; - + + public PerkKnockbackFire() + { + this(0); + } + public PerkKnockbackFire(double power) { super("Flaming Knockback", new String[] @@ -21,7 +26,13 @@ public class PerkKnockbackFire extends Perk _power = power; } - + + @Override + public void setupValues() + { + _power = getPerkDouble("Power"); + } + @EventHandler(priority = EventPriority.HIGH) public void Knockback(CustomDamageEvent event) {