From 9e6ab9a69656bd58520bed90291c7ada7cffe1d0 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 23 Apr 2017 17:07:45 +0100 Subject: [PATCH] Enderman converted to Google Sheets --- .../game/games/smash/kits/KitEnderman.java | 6 ++-- .../games/smash/perks/enderman/PerkBlink.java | 16 +++++++-- .../smash/perks/enderman/PerkBlockToss.java | 27 ++++++++++----- .../perks/enderman/PerkEndermanTeleport.java | 15 ++++++--- .../smash/perks/enderman/SmashEnderman.java | 33 ++++++++++++------- 5 files changed, 68 insertions(+), 29 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitEnderman.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitEnderman.java index 0b2307689..43137cfb9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitEnderman.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitEnderman.java @@ -36,9 +36,9 @@ public class KitEnderman extends SmashKit { private static final Perk[] PERKS = { - new PerkSmashStats(7, 1.3, 0.25, 6), - new PerkDoubleJump("Double Jump", 0.9, 0.9, false), - new PerkBlink("Blink", 16, 6000), + new PerkSmashStats(), + new PerkDoubleJump("Double Jump"), + new PerkBlink("Blink"), new PerkBlockToss(), new PerkEndermanTeleport(), new SmashEnderman() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkBlink.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkBlink.java index c7f8c30ff..486149217 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkBlink.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkBlink.java @@ -24,12 +24,17 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk; public class PerkBlink extends SmashPerk { - private static final float INCREMENTAITON = 0.2F; + private static final float INCREMENTATION = 0.2F; private String _name; private double _range; private int _recharge; + public PerkBlink(String name) + { + this(name, 0, 0); + } + public PerkBlink(String name, double range, int recharge) { super(name, new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + name }); @@ -39,6 +44,13 @@ public class PerkBlink extends SmashPerk _recharge = recharge; } + @Override + public void setupValues() + { + _range = getPerkDouble("Range"); + _recharge = getPerkTime("Cooldown"); + } + @EventHandler public void Blink(PlayerInteractEvent event) { @@ -79,7 +91,7 @@ public class PerkBlink extends SmashPerk return; } - LineParticle lineParticle = new LineParticle(player.getEyeLocation(), player.getLocation().getDirection(), INCREMENTAITON, _range, null, ParticleType.SMOKE, UtilServer.getPlayers()); + LineParticle lineParticle = new LineParticle(player.getEyeLocation(), player.getLocation().getDirection(), INCREMENTATION, _range, null, ParticleType.SMOKE, UtilServer.getPlayers()); while (!lineParticle.update()) { 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 afa59acd8..56aa3a4f5 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 @@ -42,10 +42,10 @@ import nautilus.game.arcade.kit.perks.event.PerkBlockThrowEvent; public class PerkBlockToss extends SmashPerk implements IThrown { - private static final int COOLDOWN = 2000; - private static final int CHARGE_TIME = 1200; - private static final int DAMAGE = 9; - private static final float KNOCKBACK_MAGNITUDE = 2.5F; + private int _cooldown; + private int _chargeTime; + private int _damage; + private float _knockbackMagnitude; private Map _hold = new HashMap<>(); private Set _charged = new HashSet<>(); @@ -56,6 +56,15 @@ public class PerkBlockToss extends SmashPerk implements IThrown super("Block Toss", new String[] { C.cYellow + "Hold Block" + C.cGray + " to " + C.cGreen + "Grab Block", C.cYellow + "Release Block" + C.cGray + " to " + C.cGreen + "Throw Block" }); } + @Override + public void setupValues() + { + _cooldown = getPerkTime("Cooldown"); + _chargeTime = getPerkInt("Charge Time (ms)"); + _damage = getPerkInt("Damage"); + _knockbackMagnitude = getPerkFloat("Knockback Magnitude"); + } + @EventHandler public void Grab(PlayerInteractEvent event) { @@ -154,7 +163,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown // Charged Tick if (!_charged.contains(key)) { - if (System.currentTimeMillis() - _hold.get(key).Time > CHARGE_TIME) + if (System.currentTimeMillis() - _hold.get(key).Time > _chargeTime) { _charged.add(key); player.getWorld().playEffect(player.getLocation(), Effect.CLICK1, 0); @@ -167,7 +176,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown UUID key = cur.getUniqueId(); Recharge.Instance.recharge(cur, GetName()); - Recharge.Instance.use(cur, GetName(), COOLDOWN, false, true); + Recharge.Instance.use(cur, GetName(), _cooldown, false, true); BlockTossData data = _hold.remove(key); @@ -180,7 +189,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown long charge = System.currentTimeMillis() - data.Time; // Throw - double mult = Math.min(1.4, 1.4 * ((double) charge / CHARGE_TIME)); + double mult = Math.min(1.4, 1.4 * ((double) charge / _chargeTime)); // Action UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0.2, 0, 1, true); @@ -201,7 +210,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown } // Damage Event - Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, data.getThrown().getVelocity().length() * DAMAGE, true, true, false, UtilEnt.getName(data + Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, data.getThrown().getVelocity().length() * _damage, true, true, false, UtilEnt.getName(data .getThrower()), GetName()); // Block to Item @@ -260,6 +269,6 @@ public class PerkBlockToss extends SmashPerk implements IThrown 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/enderman/PerkEndermanTeleport.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkEndermanTeleport.java index 5fcc81787..c8a116dee 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 @@ -28,8 +28,8 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk; public class PerkEndermanTeleport extends SmashPerk { - private static final int COOLDOWN = 5000; - private static final float CHARGE_PER_TICK = 0.015F; + private int _cooldown = 5000; + private float _chargeTick = 0.015F; private Map _target = new HashMap<>(); private Map _charge = new HashMap<>(); @@ -39,6 +39,13 @@ public class PerkEndermanTeleport extends SmashPerk super("Teleport", new String[] { C.cYellow + "Hold Sneak" + C.cGray + " to " + C.cGreen + "Teleport" }); } + @Override + public void setupValues() + { + _cooldown = getPerkTime("Cooldown"); + _chargeTick = getPerkFloat("Charge Per Tick"); + } + @EventHandler public void update(UpdateEvent event) { @@ -86,14 +93,14 @@ public class PerkEndermanTeleport extends SmashPerk // Same Block - Increase Charge else if (block.equals(_target.get(key))) { - _charge.put(key, _charge.get(key) + CHARGE_PER_TICK); + _charge.put(key, _charge.get(key) + _chargeTick); UtilTextMiddle.display(null, UtilTextMiddle.progress(_charge.get(key)), 0, 10, 10, player); if (_charge.get(key) >= 1) { UtilTextMiddle.display(null, C.cGreen + "Teleported", 0, 10, 10, player); - Recharge.Instance.useForce(player, GetName(), COOLDOWN); + Recharge.Instance.useForce(player, GetName(), _cooldown); while (block.getRelative(BlockFace.UP).getType() != Material.AIR) { 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 ec4d33f6b..8f99fed1b 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 @@ -33,18 +33,29 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate; public class SmashEnderman extends SmashUltimate { - private static final int DURATION = 30000; - private static final int DRAGON_VELOCITY_MAGNITUDE = 40; - private static final int HIT_COOLDOWN = 1000; - private static final int DAMAGE_RADIUS = 6; - private static final int DAMAGE = 20; - private static final int KNOCKBACK_MAGNITUDE = 4; + private int _dragonVelocity; + private int _hitCooldown; + private int _damageRadius; + private int _damage; + private int _knockbackMagnitude; private Map _dragons = new HashMap<>(); public SmashEnderman() { - super("Ender Dragon", new String[] {}, Sound.ENDERDRAGON_GROWL, DURATION); + super("Ender Dragon", new String[] {}, Sound.ENDERDRAGON_GROWL, 0); + } + + @Override + public void setupValues() + { + super.setupValues(); + + _dragonVelocity = getPerkInt("Dragon Velocity"); + _hitCooldown = getPerkTime("Hit Cooldown"); + _damageRadius = getPerkInt("Damage Radius"); + _damage = getPerkInt("Damage"); + _knockbackMagnitude = getPerkInt("Knockback Magnitude"); } @Override @@ -105,7 +116,7 @@ public class SmashEnderman extends SmashUltimate } // Move - Location target = player.getLocation().add(player.getLocation().getDirection().multiply(DRAGON_VELOCITY_MAGNITUDE)); + Location target = player.getLocation().add(player.getLocation().getDirection().multiply(_dragonVelocity)); ((CraftEnderDragon) dragon).getHandle().setTargetBlock(target.getBlockX(), target.getBlockY(), target.getBlockZ()); } } @@ -179,10 +190,10 @@ public class SmashEnderman extends SmashUltimate continue; } - if (UtilMath.offset(dragon.getLocation().add(0, 4, 0), other.getLocation()) < DAMAGE_RADIUS && Recharge.Instance.use(other, "Hit By Dragon", HIT_COOLDOWN, false, false)) + if (UtilMath.offset(dragon.getLocation().add(0, 4, 0), other.getLocation()) < _damageRadius && Recharge.Instance.use(other, "Hit By Dragon", _hitCooldown, false, false)) { // Damage Event - Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, DAMAGE, true, true, false, player.getName(), GetName()); + Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage, true, true, false, player.getName(), GetName()); } } } @@ -196,7 +207,7 @@ public class SmashEnderman extends SmashUltimate return; } - event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); + event.AddKnockback(GetName(), _knockbackMagnitude); } @EventHandler(priority = EventPriority.LOW)