From 7f1b1d72b941ff37929de5f428bc3716a71f7a81 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 25 Apr 2017 19:33:00 +0100 Subject: [PATCH] Chicken converted to Google Sheets --- .../game/games/smash/kits/KitChicken.java | 4 +-- .../perks/chicken/PerkChickenRocket.java | 35 ++++++++++++------- .../games/smash/perks/chicken/PerkEggGun.java | 22 ++++++++---- .../games/smash/perks/chicken/PerkFlap.java | 27 ++++++++------ .../smash/perks/chicken/SmashChicken.java | 4 +-- 5 files changed, 58 insertions(+), 34 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitChicken.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitChicken.java index 6e4f0b442..434bef8f3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitChicken.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitChicken.java @@ -25,8 +25,8 @@ public class KitChicken extends SmashKit { private static final Perk[] PERKS = { - new PerkSmashStats(4.5, 2.0, 0.2, 2), - new PerkFlap(0.8, 0.8, false), + new PerkSmashStats(), + new PerkFlap(), new PerkEggGun(), new PerkChickenRocket(), new SmashChicken() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/PerkChickenRocket.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/PerkChickenRocket.java index a671bd243..6acd00576 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/PerkChickenRocket.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/PerkChickenRocket.java @@ -44,12 +44,12 @@ import nautilus.game.arcade.kit.perks.data.ChickenMissileData; public class PerkChickenRocket extends SmashPerk { - private static final int COOLDOWN = 7000; - private static final int MIN_TIME = 200; - private static final int MAX_TIME = 4000; - private static final int HIT_BOX_RADIUS = 2; - private static final int DAMAGE_RADIUS = 3; - private static final int DAMAGE = 8; + private int _cooldown; + private int _minTime; + private int _maxTime; + private int _hitBoxRadius; + private int _damageRadius; + private int _damage; private Set _data = new HashSet<>(); @@ -59,6 +59,17 @@ public class PerkChickenRocket extends SmashPerk + " instantly recharges if you hit a player." }); } + @Override + public void setupValues() + { + _cooldown = getPerkTime("Cooldown"); + _minTime = getPerkInt("Min Time (ms)"); + _maxTime = getPerkTime("Max Time (ms)"); + _hitBoxRadius = getPerkInt("Hit Box Radius"); + _damageRadius = getPerkInt("Damage Radius"); + _damage = getPerkInt("Damage"); + } + @EventHandler public void Missile(PlayerInteractEvent event) { @@ -94,7 +105,7 @@ public class PerkChickenRocket extends SmashPerk return; } - if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true)) + if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true)) { return; } @@ -131,14 +142,14 @@ public class PerkChickenRocket extends SmashPerk data.Chicken.setVelocity(data.Direction); data.Chicken.getWorld().playSound(data.Chicken.getLocation(), Sound.CHICKEN_HURT, 0.3f, 1.5f); - if (!UtilTime.elapsed(data.Time, MIN_TIME)) + if (!UtilTime.elapsed(data.Time, _minTime)) { continue; } boolean detonate = false; - if (UtilTime.elapsed(data.Time, MAX_TIME)) + if (UtilTime.elapsed(data.Time, _maxTime)) { detonate = true; } @@ -146,7 +157,7 @@ public class PerkChickenRocket extends SmashPerk { List team = TeamSuperSmash.getTeam(Manager, data.Player, true); // Hit Entity - for (Entity ent : UtilEnt.getInRadius(data.Chicken.getLocation(), HIT_BOX_RADIUS).keySet()) + for (Entity ent : UtilEnt.getInRadius(data.Chicken.getLocation(), _hitBoxRadius).keySet()) { if (ent instanceof Arrow) { @@ -192,7 +203,7 @@ public class PerkChickenRocket extends SmashPerk { List team = TeamSuperSmash.getTeam(Manager, data.Player, true); // Damage - for (LivingEntity ent : UtilEnt.getInRadius(data.Chicken.getLocation(), DAMAGE_RADIUS).keySet()) + for (LivingEntity ent : UtilEnt.getInRadius(data.Chicken.getLocation(), _damageRadius).keySet()) { if (ent.equals(data.Player)) { @@ -212,7 +223,7 @@ public class PerkChickenRocket extends SmashPerk } // Damage Event - Manager.GetDamage().NewDamageEvent(ent, data.Player, null, DamageCause.PROJECTILE, DAMAGE, false, true, false, data.Player.getName(), GetName()); + Manager.GetDamage().NewDamageEvent(ent, data.Player, null, DamageCause.PROJECTILE, _damage, false, true, false, data.Player.getName(), GetName()); UtilAction.velocity(ent, UtilAlg.getTrajectory2d(data.Chicken, ent), 1.6, true, 0.8, 0, 10, true); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/PerkEggGun.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/PerkEggGun.java index df35fda05..6162c7276 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/PerkEggGun.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/PerkEggGun.java @@ -33,9 +33,9 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk; public class PerkEggGun extends SmashPerk { - private static final int COOLDOWN = 2500; - private static final int DURATION = 750; - private static final int DAMAGE = 1; + private int _cooldown; + private int _duration; + private int _damage; private Map _active = new HashMap<>(); @@ -44,6 +44,14 @@ public class PerkEggGun extends SmashPerk super("Egg Blaster", new String[] { C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Egg Blaster" }); } + @Override + public void setupValues() + { + _cooldown = getPerkInt("Cooldown (ms)"); + _duration = getPerkInt("Duration (ms)"); + _damage = getPerkInt("Damage"); + } + @EventHandler public void Activate(PlayerInteractEvent event) { @@ -79,7 +87,7 @@ public class PerkEggGun extends SmashPerk return; } - if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true)) + if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true)) { return; } @@ -114,7 +122,7 @@ public class PerkEggGun extends SmashPerk continue; } - if (UtilTime.elapsed(_active.get(key), DURATION)) + if (UtilTime.elapsed(_active.get(key), _duration)) { _active.remove(key); continue; @@ -150,7 +158,7 @@ public class PerkEggGun extends SmashPerk return; } - if (event.GetDamage() >= DAMAGE) + if (event.GetDamage() >= _damage) { return; } @@ -160,7 +168,7 @@ public class PerkEggGun extends SmashPerk Egg egg = (Egg) event.GetProjectile(); // Damage Event - Manager.GetDamage().NewDamageEvent(event.GetDamageeEntity(), (LivingEntity) egg.getShooter(), egg, DamageCause.PROJECTILE, DAMAGE, true, true, false, UtilEnt.getName((LivingEntity) egg + Manager.GetDamage().NewDamageEvent(event.GetDamageeEntity(), (LivingEntity) egg.getShooter(), egg, DamageCause.PROJECTILE, _damage, true, true, false, UtilEnt.getName((LivingEntity) egg .getShooter()), GetName()); UtilAction.zeroVelocity(event.GetDamageeEntity()); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/PerkFlap.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/PerkFlap.java index 6464c22d1..8dcf4877c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/PerkFlap.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/PerkFlap.java @@ -21,19 +21,26 @@ public class PerkFlap extends SmashPerk { private static final float MAX_ENERGY = 0.999F; - private static final float ENERGY_PER_TICK = 0.03F; - private static final float ENERGY_PER_FLAP = 0.17F; - private static final int COOLDOWN = 80; - + + private int _cooldown; + private float _energyPerTick; + private float _energyPerFlap; private double _power; private boolean _control; - public PerkFlap(double power, double heightLimit, boolean control) + public PerkFlap() { super("Flap", new String[] { C.cYellow + "Tap Jump Twice" + C.cGray + " to " + C.cGreen + "Flap" }); + } - _power = power; - _control = control; + @Override + public void setupValues() + { + _cooldown = getPerkTime("Cooldown (ms)"); + _energyPerTick = getPerkFloat("Energy Per Tick"); + _energyPerFlap = getPerkFloat("Energy Per Flap"); + _power = getPerkDouble("Power"); + _control = getPerkBoolean("Control"); } @EventHandler @@ -78,12 +85,12 @@ public class PerkFlap extends SmashPerk player.getWorld().playSound(player.getLocation(), Sound.BAT_TAKEOFF, (float) (0.3 + player.getExp()), (float) (Math.random() / 2 + 1)); // Set Recharge - Recharge.Instance.use(player, GetName(), COOLDOWN, false, false); + Recharge.Instance.use(player, GetName(), _cooldown, false, false); // Energy if (!isSuperActive(player)) { - player.setExp(Math.max(0f, player.getExp() - ENERGY_PER_FLAP)); + player.setExp(Math.max(0f, player.getExp() - _energyPerFlap)); } } @@ -109,7 +116,7 @@ public class PerkFlap extends SmashPerk if (UtilEnt.isGrounded(player) || UtilBlock.solid(player.getLocation().subtract(0, 2, 0).getBlock())) { - player.setExp(Math.min(MAX_ENERGY, player.getExp() + ENERGY_PER_TICK)); + player.setExp(Math.min(MAX_ENERGY, player.getExp() + _energyPerTick)); player.setAllowFlight(true); } else if (Recharge.Instance.usable(player, GetName()) && player.getExp() > 0) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/SmashChicken.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/SmashChicken.java index 605499efc..baad365ac 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/SmashChicken.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/chicken/SmashChicken.java @@ -9,11 +9,9 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate; public class SmashChicken extends SmashUltimate { - private static final int DURATION = 20000; - public SmashChicken() { - super("Aerial Gunner", new String[] {}, Sound.CHICKEN_IDLE, DURATION); + super("Aerial Gunner", new String[] {}, Sound.CHICKEN_IDLE, 0); } /**