All remaining kits converted to Google Sheets

This commit is contained in:
Sam 2017-05-01 10:37:11 +01:00
parent 0f5fcc7670
commit 6d105a0499
41 changed files with 555 additions and 344 deletions

View File

@ -26,8 +26,8 @@ public class KitCow extends SmashKit
{ {
private static final Perk[] PERKS = { private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.1, 0.25, 6.5), new PerkSmashStats(),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false), new PerkDoubleJump("Double Jump"),
new PerkCowStampede(), new PerkCowStampede(),
new PerkCowAngryHerd(), new PerkCowAngryHerd(),
new PerkCowMilkSpiral(), new PerkCowMilkSpiral(),

View File

@ -26,8 +26,8 @@ public class KitGuardian extends SmashKit
{ {
private static final Perk[] PERKS = { private static final Perk[] PERKS = {
new PerkSmashStats(4, 1.25, 0.25, 4.5), new PerkSmashStats(),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false), new PerkDoubleJump("Double Jump"),
new PerkWhirlpoolBlade(), new PerkWhirlpoolBlade(),
new PerkWaterSplash(), new PerkWaterSplash(),
new PerkTargetLazer(), new PerkTargetLazer(),

View File

@ -30,8 +30,8 @@ public class KitMagmaCube extends SmashKit
{ {
private static final Perk[] PERKS = { private static final Perk[] PERKS = {
new PerkSmashStats(5, 1.75, 0.35, 5), new PerkSmashStats(),
new PerkDoubleJump("Double Jump", 1.2, 1, false), new PerkDoubleJump("Double Jump"),
new PerkMagmaBoost(), new PerkMagmaBoost(),
new PerkMagmaBlast(), new PerkMagmaBlast(),
new PerkFlameDash(), new PerkFlameDash(),

View File

@ -33,8 +33,8 @@ public class KitPig extends SmashKit
private static final float ENERGY_PER_TICK_SMASH = 0.02F; private static final float ENERGY_PER_TICK_SMASH = 0.02F;
private static final Perk[] PERKS = { private static final Perk[] PERKS = {
new PerkSmashStats(5, 1.5, 0.25, 5), new PerkSmashStats(),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false), new PerkDoubleJump("Double Jump"),
new PerkPigBaconBounce(), new PerkPigBaconBounce(),
new PerkPigBaconBomb(), new PerkPigBaconBomb(),
new PerkPigZombie(), new PerkPigZombie(),

View File

@ -27,9 +27,9 @@ public class KitSheep extends SmashKit
{ {
private static final Perk[] PERKS = { private static final Perk[] PERKS = {
new PerkSmashStats(5, 1.7, 0.25, 5), new PerkSmashStats(),
new PerkDoubleJump("Double Jump", 1, 1, false), new PerkDoubleJump("Double Jump"),
new PerkLazer(40, 7000), new PerkLazer(),
new PerkWoolBomb(), new PerkWoolBomb(),
new PerkWoolCloud(), new PerkWoolCloud(),
new SmashSheep() new SmashSheep()

View File

@ -26,10 +26,10 @@ public class KitSkySquid extends SmashKit
{ {
private static final Perk[] PERKS = { private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.5, 0.25, 5), new PerkSmashStats(),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false), new PerkDoubleJump("Double Jump"),
new PerkSuperSquid(), new PerkSuperSquid(),
new PerkInkBlast(7, 2), new PerkInkBlast(),
new PerkFishFlurry(), new PerkFishFlurry(),
new SmashSquid() new SmashSquid()
}; };

View File

@ -27,8 +27,8 @@ public class KitWitherSkeleton extends SmashKit
{ {
private static final Perk[] PERKS = { private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.2, 0.3, 6), new PerkSmashStats(),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false), new PerkDoubleJump("Double Jump"),
new PerkWitherSkull(), new PerkWitherSkull(),
new PerkWitherImage(), new PerkWitherImage(),
new SmashWitherSkeleton() new SmashWitherSkeleton()

View File

@ -32,11 +32,11 @@ public class KitZombie extends SmashKit
{ {
private static final Perk[] PERKS = { private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.25, 0.25, 5), new PerkSmashStats(),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false), new PerkDoubleJump("Double Jump"),
new PerkFletcher(2, 2, false), new PerkFletcher(),
new PerkKnockbackArrow(1.5), new PerkKnockbackArrow(),
new PerkOvercharge(6, 250, true), new PerkOvercharge(),
new PerkZombieBile(), new PerkZombieBile(),
new PerkDeathsGrasp(), new PerkDeathsGrasp(),
new SmashZombie() new SmashZombie()

View File

@ -36,7 +36,7 @@ public class PerkFlap extends SmashPerk
@Override @Override
public void setupValues() public void setupValues()
{ {
_cooldown = getPerkTime("Cooldown (ms)"); _cooldown = getPerkInt("Cooldown (ms)");
_energyPerTick = getPerkFloat("Energy Per Tick"); _energyPerTick = getPerkFloat("Energy Per Tick");
_energyPerFlap = getPerkFloat("Energy Per Flap"); _energyPerFlap = getPerkFloat("Energy Per Flap");
_power = getPerkDouble("Power"); _power = getPerkDouble("Power");

View File

@ -37,14 +37,14 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkCowAngryHerd extends SmashPerk public class PerkCowAngryHerd extends SmashPerk
{ {
private static final int COOLDOWN_NORMAL = 13000; private int _cooldownNormal;
private static final int COOLDOWN_SMASH = 6000; private int _cooldownSmash;
private static final int MAX_TIME = 2500; private int _maxTime;
private static final int STUCK_TIME = 300; private int _stuckTime;
private static final int FORCE_MOVE = 350; private int _forceMove;
private static final float HIT_BOX_RADIUS = 2.2F; private float _hitBoxRadius;
private static final int HIT_FREQUENCY = 600; private int _hitFrequency;
private static final int DAMAGE = 5; private int _damage;
private List<DataCowCharge> _active = new ArrayList<>(); private List<DataCowCharge> _active = new ArrayList<>();
@ -53,6 +53,19 @@ public class PerkCowAngryHerd extends SmashPerk
super("Angry Herd", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Angry Herd" }); super("Angry Herd", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Angry Herd" });
} }
@Override
public void setupValues()
{
_cooldownNormal = getPerkTime("Cooldown Normal");
_cooldownSmash = getPerkTime("Cooldown Smash");
_maxTime = getPerkInt("Max Time (ms)");
_stuckTime = getPerkInt("Stuck Time (ms)");
_forceMove = getPerkInt("Force Move (ms)");
_hitBoxRadius = getPerkFloat("Hit Box Radius");
_hitFrequency = getPerkInt("Hit Frequency (ms)");
_damage = getPerkInt("Damage");
}
@EventHandler @EventHandler
public void shoot(PlayerInteractEvent event) public void shoot(PlayerInteractEvent event)
{ {
@ -83,7 +96,7 @@ public class PerkCowAngryHerd extends SmashPerk
return; return;
} }
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? COOLDOWN_SMASH : COOLDOWN_NORMAL, true, true)) if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? _cooldownSmash : _cooldownNormal, true, true))
{ {
return; return;
} }
@ -129,7 +142,7 @@ public class PerkCowAngryHerd extends SmashPerk
DataCowCharge data = activeIter.next(); DataCowCharge data = activeIter.next();
// Expire // Expire
if (UtilTime.elapsed(data.Time, MAX_TIME)) if (UtilTime.elapsed(data.Time, _maxTime))
{ {
if (data.Cow.isValid()) if (data.Cow.isValid())
{ {
@ -149,7 +162,7 @@ public class PerkCowAngryHerd extends SmashPerk
} }
// Stuck Remove // Stuck Remove
if (UtilTime.elapsed(data.LastMoveTime, STUCK_TIME)) if (UtilTime.elapsed(data.LastMoveTime, _stuckTime))
{ {
if (data.Cow.isValid()) if (data.Cow.isValid())
{ {
@ -172,7 +185,7 @@ public class PerkCowAngryHerd extends SmashPerk
} }
// Move // Move
if (UtilTime.elapsed(data.LastMoveTime, FORCE_MOVE) && UtilEnt.isGrounded(data.Cow)) if (UtilTime.elapsed(data.LastMoveTime, _forceMove) && UtilEnt.isGrounded(data.Cow))
{ {
data.Cow.setVelocity(data.Direction.clone().add(new Vector(0, 0.75, 0))); data.Cow.setVelocity(data.Direction.clone().add(new Vector(0, 0.75, 0)));
} }
@ -199,12 +212,12 @@ public class PerkCowAngryHerd extends SmashPerk
continue; continue;
} }
if (UtilMath.offset(player, data.Cow) < HIT_BOX_RADIUS) if (UtilMath.offset(player, data.Cow) < _hitBoxRadius)
{ {
if (Recharge.Instance.use(player, "Hit by " + data.Player.getName(), HIT_FREQUENCY, false, false)) if (Recharge.Instance.use(player, "Hit by " + data.Player.getName(), _hitFrequency, false, false))
{ {
// Damage Event // Damage Event
Manager.GetDamage().NewDamageEvent(player, data.Player, null, data.Cow.getLocation(), DamageCause.CUSTOM, DAMAGE, true, true, false, UtilEnt.getName(data.Player), GetName()); Manager.GetDamage().NewDamageEvent(player, data.Player, null, data.Cow.getLocation(), DamageCause.CUSTOM, _damage, true, true, false, UtilEnt.getName(data.Player), GetName());
UtilParticle.PlayParticleToAll(ParticleType.LARGE_EXPLODE, data.Cow.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0, 12, ViewDist.LONG); UtilParticle.PlayParticleToAll(ParticleType.LARGE_EXPLODE, data.Cow.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0, 12, ViewDist.LONG);

View File

@ -30,10 +30,10 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkCowMilkSpiral extends SmashPerk public class PerkCowMilkSpiral extends SmashPerk
{ {
private static final int COOLDOWN_NORMAL = 11000; private int _cooldownNormal;
private static final int COOLDOWN_SMASH = 6000; private int _cooldownSmash;
private static final int HIT_BOX_RADIUS = 2; private int _hitBoxRadius;
private static final int DAMAGE = 6; private int _damage;
private Set<DataCowMilkSpiral> _active = new HashSet<>(); private Set<DataCowMilkSpiral> _active = new HashSet<>();
@ -42,6 +42,15 @@ public class PerkCowMilkSpiral extends SmashPerk
super("Milk Spiral", new String[] { C.cYellow + "Right Click" + C.cGray + " with Spade to " + C.cGreen + "Milk Spiral", C.cGray + "Crouch to cancel movement for Milk Spiral" }); super("Milk Spiral", new String[] { C.cYellow + "Right Click" + C.cGray + " with Spade to " + C.cGreen + "Milk Spiral", C.cGray + "Crouch to cancel movement for Milk Spiral" });
} }
@Override
public void setupValues()
{
_cooldownNormal = getPerkTime("Cooldown Normal");
_cooldownSmash = getPerkTime("Cooldown Smash");
_hitBoxRadius = getPerkInt("Hit Box Radius");
_damage = getPerkInt("Damage");
}
@EventHandler @EventHandler
public void activate(PlayerInteractEvent event) public void activate(PlayerInteractEvent event)
{ {
@ -72,7 +81,7 @@ public class PerkCowMilkSpiral extends SmashPerk
return; return;
} }
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? COOLDOWN_SMASH : COOLDOWN_NORMAL, true, true)) if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? _cooldownSmash : _cooldownNormal, true, true))
{ {
return; return;
} }
@ -109,9 +118,9 @@ public class PerkCowMilkSpiral extends SmashPerk
continue; continue;
} }
if (UtilMath.offset(player.getLocation().add(0, 1, 0), data.Spiral) < HIT_BOX_RADIUS) if (UtilMath.offset(player.getLocation().add(0, 1, 0), data.Spiral) < _hitBoxRadius)
{ {
Manager.GetDamage().NewDamageEvent(player, data.Player, null, DamageCause.CUSTOM, DAMAGE, true, false, false, player.getName(), GetName()); Manager.GetDamage().NewDamageEvent(player, data.Player, null, DamageCause.CUSTOM, _damage, true, false, false, player.getName(), GetName());
UtilParticle.PlayParticle(isSuperActive(player) ? ParticleType.RED_DUST : ParticleType.FIREWORKS_SPARK, player.getLocation().add(0, 1, 0), 0.2f, 0.2f, 0.2f, 0.3f, 30, UtilParticle.PlayParticle(isSuperActive(player) ? ParticleType.RED_DUST : ParticleType.FIREWORKS_SPARK, player.getLocation().add(0, 1, 0), 0.2f, 0.2f, 0.2f, 0.3f, 30,
ViewDist.LONG, UtilServer.getPlayers()); ViewDist.LONG, UtilServer.getPlayers());

View File

@ -30,6 +30,9 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkCowStampede extends SmashPerk public class PerkCowStampede extends SmashPerk
{ {
private long _speedTime;
private Map<UUID, Long> _sprintTime = new HashMap<>(); private Map<UUID, Long> _sprintTime = new HashMap<>();
private Map<UUID, Integer> _sprintStr = new HashMap<>(); private Map<UUID, Integer> _sprintStr = new HashMap<>();
@ -38,6 +41,12 @@ public class PerkCowStampede extends SmashPerk
super("Stampede", new String[] { C.cGray + "Build up Speed Levels as you sprint.", C.cGray + "+1 damage for each Speed Level.", }); super("Stampede", new String[] { C.cGray + "Build up Speed Levels as you sprint.", C.cGray + "+1 damage for each Speed Level.", });
} }
@Override
public void setupValues()
{
_speedTime = getPerkTime("Speed Time");
}
@EventHandler @EventHandler
public void update(UpdateEvent event) public void update(UpdateEvent event)
{ {
@ -77,7 +86,7 @@ public class PerkCowStampede extends SmashPerk
} }
// Upgrade Speed // Upgrade Speed
if (!UtilTime.elapsed(time, 3000)) if (!UtilTime.elapsed(time, _speedTime))
{ {
continue; continue;
} }

View File

@ -14,13 +14,21 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashCow extends SmashUltimate public class SmashCow extends SmashUltimate
{ {
private static final int DURATION = 30000; private int _damageBuff;
private static final int DAMAGE_BUFF = 1; private int _health;
private static final int HEALTH = 30;
public SmashCow() public SmashCow()
{ {
super("Mooshroom Madness", new String[] {}, Sound.COW_IDLE, DURATION); super("Mooshroom Madness", new String[] {}, Sound.COW_IDLE, 0);
}
@Override
public void setupValues()
{
super.setupValues();
_damageBuff = getPerkInt("Damage Buff");
_health = getPerkInt("Health");
} }
@Override @Override
@ -33,8 +41,8 @@ public class SmashCow extends SmashUltimate
kit.disguise(player, DisguiseMooshroom.class); kit.disguise(player, DisguiseMooshroom.class);
// Health // Health
player.setMaxHealth(HEALTH); player.setMaxHealth(_health);
player.setHealth(HEALTH); player.setHealth(_health);
// Sound // Sound
player.getWorld().playSound(player.getLocation(), Sound.COW_HURT, 5f, 0.25f); player.getWorld().playSound(player.getLocation(), Sound.COW_HURT, 5f, 0.25f);
@ -67,7 +75,7 @@ public class SmashCow extends SmashUltimate
if (isUsingUltimate(player)) if (isUsingUltimate(player))
{ {
event.AddMod(player.getName(), GetName(), DAMAGE_BUFF, false); event.AddMod(player.getName(), GetName(), _damageBuff, false);
} }
} }
} }

View File

@ -37,11 +37,11 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkTargetLazer extends SmashPerk public class PerkTargetLazer extends SmashPerk
{ {
private static final int COOLDOWN = 15000; private int _cooldown;
private static final int MAX_RANGE = 11; private int _maxRange;
private static final int MAX_TIME = 8000; private int _maxTime;
private static final int DAMAGE_INCREASE = 3; private int _damageIncrease;
private static final int KNOCKBACK_INCREASE = 1; private int _knockbackIncrease;
private Set<TargetLazerData> _data = new HashSet<>(); private Set<TargetLazerData> _data = new HashSet<>();
@ -50,6 +50,16 @@ public class PerkTargetLazer extends SmashPerk
super("Target Laser", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Pickaxe to use " + C.cGreen + "Target Laser" }); super("Target Laser", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Pickaxe to use " + C.cGreen + "Target Laser" });
} }
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_maxRange = getPerkInt("Max Range");
_maxTime = getPerkTime("Max Time");
_damageIncrease = getPerkInt("Damage Increase");
_knockbackIncrease = getPerkInt("Knockback Increase");
}
@EventHandler @EventHandler
public void activate(PlayerInteractEvent event) public void activate(PlayerInteractEvent event)
{ {
@ -103,7 +113,7 @@ public class PerkTargetLazer extends SmashPerk
double d = UtilMath.offset(player, other); double d = UtilMath.offset(player, other);
if (d > MAX_RANGE) if (d > _maxRange)
{ {
continue; continue;
} }
@ -121,7 +131,7 @@ public class PerkTargetLazer extends SmashPerk
{ {
if (data.getAttacker().equals(player)) if (data.getAttacker().equals(player))
{ {
if (data.getTimeElapsed() < MAX_TIME) if (data.getTimeElapsed() < _maxTime)
{ {
return; return;
} }
@ -180,7 +190,7 @@ public class PerkTargetLazer extends SmashPerk
UtilParticle.PlayParticle(ParticleType.MAGIC_CRIT, data.getTarget().getLocation().add(0, 0.5, 0.5), 1F, 0.5F, 1F, 0.1F, 10, ViewDist.LONG, data.getAttacker()); UtilParticle.PlayParticle(ParticleType.MAGIC_CRIT, data.getTarget().getLocation().add(0, 0.5, 0.5), 1F, 0.5F, 1F, 0.1F, 10, ViewDist.LONG, data.getAttacker());
if (UtilMath.offset(data.getTarget(), data.getAttacker()) > MAX_RANGE || data.getTimeElapsed() > MAX_TIME) if (UtilMath.offset(data.getTarget(), data.getAttacker()) > _maxRange || data.getTimeElapsed() > _maxTime)
{ {
long time = data.getTimeElapsed() / 1000; long time = data.getTimeElapsed() / 1000;
double damage = 0.5 * time; double damage = 0.5 * time;
@ -192,7 +202,7 @@ public class PerkTargetLazer extends SmashPerk
data.getAttacker().sendMessage(F.main("Game", "Your laser broke, dealing damage to " + F.name(data.getTarget().getName())) + "."); 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()); Manager.GetDamage().NewDamageEvent(data.getTarget(), data.getAttacker(), null, DamageCause.CUSTOM, damage, false, true, false, data.getAttacker().getName(), GetName());
Recharge.Instance.use(data.getAttacker(), GetName(), COOLDOWN, true, true); Recharge.Instance.use(data.getAttacker(), GetName(), _cooldown, true, true);
iterator.remove(); iterator.remove();
} }
@ -219,8 +229,8 @@ public class PerkTargetLazer extends SmashPerk
if (data.getAttacker().equals(damager) && data.getTarget().equals(damagee)) if (data.getAttacker().equals(damager) && data.getTarget().equals(damagee))
{ {
event.AddMod(GetName(), DAMAGE_INCREASE); event.AddMod(GetName(), _damageIncrease);
event.AddKnockback(GetName(), KNOCKBACK_INCREASE); event.AddKnockback(GetName(), _knockbackIncrease);
data.getAttacker().playEffect(damagee.getLocation().add(0, 0.5, 0), Effect.STEP_SOUND, Material.REDSTONE_BLOCK); data.getAttacker().playEffect(damagee.getLocation().add(0, 0.5, 0), Effect.STEP_SOUND, Material.REDSTONE_BLOCK);
} }
} }
@ -231,17 +241,7 @@ public class PerkTargetLazer extends SmashPerk
{ {
Player player = event.getEntity(); Player player = event.getEntity();
Iterator<TargetLazerData> iterator = _data.iterator(); _data.removeIf(data -> data.getTarget().equals(player) || data.getAttacker().equals(player));
while (iterator.hasNext())
{
TargetLazerData data = iterator.next();
if (data.getTarget().equals(player) || data.getAttacker().equals(player))
{
iterator.remove();
}
}
} }
private void setLazerTarget(Player disguised, Player target) private void setLazerTarget(Player disguised, Player target)

View File

@ -13,15 +13,23 @@ import nautilus.game.arcade.kit.Perk;
public class PerkThorns extends Perk public class PerkThorns extends Perk
{ {
private static final int MAX_HEALTH = 10; private int _maxHealth;
private static final float DAMAGE_DECREASE = 0.66F; private double _damageDecrease;
private static final float KNOCKBACK_DECREASE = 0.66F; private double _knockbackDecrease;
public PerkThorns() public PerkThorns()
{ {
super("Thorns", new String[] { C.cGray + "Takes 66% less damage and knockback from projectiles", C.cGray + "when under 10 health."}); super("Thorns", new String[] { C.cGray + "Takes 66% less damage and knockback from projectiles", C.cGray + "when under 10 health."});
} }
@Override
public void setupValues()
{
_maxHealth = getPerkInt("Max Health");
_damageDecrease = getPerkPercentage("Damage Decrease");
_knockbackDecrease = getPerkPercentage("Knockback Decrease");
}
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void damage(CustomDamageEvent event) public void damage(CustomDamageEvent event)
{ {
@ -38,10 +46,10 @@ public class PerkThorns extends Perk
return; return;
} }
if (player.getHealth() < MAX_HEALTH) if (player.getHealth() < _maxHealth)
{ {
event.AddMult(GetName(), null, DAMAGE_DECREASE, false); event.AddMult(GetName(), null, _damageDecrease, false);
event.AddKnockback(GetName(), KNOCKBACK_DECREASE); event.AddKnockback(GetName(), _knockbackDecrease);
} }
} }
} }

View File

@ -1,13 +1,15 @@
package nautilus.game.arcade.game.games.smash.perks.guardian; package nautilus.game.arcade.game.games.smash.perks.guardian;
import java.util.HashMap; import mineplex.core.common.util.*;
import java.util.HashSet; import mineplex.core.common.util.UtilEvent.ActionType;
import java.util.Iterator; import mineplex.core.common.util.UtilParticle.ParticleType;
import java.util.List; import mineplex.core.common.util.UtilParticle.ViewDist;
import java.util.Map; import mineplex.core.recharge.Recharge;
import java.util.Set; import mineplex.core.updater.UpdateType;
import java.util.UUID; import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.smash.TeamSuperSmash;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.Effect; import org.bukkit.Effect;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -17,36 +19,17 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import mineplex.core.common.util.C; import java.util.*;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
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;
import mineplex.core.common.util.UtilParticle;
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.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.games.smash.TeamSuperSmash;
import nautilus.game.arcade.kit.Perk;
public class PerkWaterSplash extends Perk public class PerkWaterSplash extends Perk
{ {
private static final int COOLDOWN = 12000; private int _cooldown;
private static final int VELOCITY_Y = 1; private float _velocityY;
private static final int RADIUS = 5; private int _radius;
private static final int MIN_AIR_TIME = 750; private int _minAirTime;
private static final int SECOND_BOOST_TIME = 800; private int _secondBoostTime;
private static final int DAMAGE = 12; private int _damage;
private Map<UUID, Long> _active = new HashMap<>(); private Map<UUID, Long> _active = new HashMap<>();
private Set<UUID> _usedSecondBoost = new HashSet<>(); private Set<UUID> _usedSecondBoost = new HashSet<>();
@ -56,6 +39,17 @@ public class PerkWaterSplash extends Perk
super("Water Splash", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Sword to use " + C.cGreen + "Water Splash", C.cYellow + "Hold Block" + C.cGray + " to " + C.cGreen + "Bounce higher with Water Splash" }); super("Water Splash", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Sword to use " + C.cGreen + "Water Splash", C.cYellow + "Hold Block" + C.cGray + " to " + C.cGreen + "Bounce higher with Water Splash" });
} }
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_velocityY = getPerkFloat("Y Velocity");
_radius = getPerkInt("Radius");
_minAirTime = getPerkInt("Min Air Time (ms)");
_secondBoostTime = getPerkInt("Second Boost Time (ms)");
_damage = getPerkInt("Damage");
}
@EventHandler @EventHandler
public void activate(PlayerInteractEvent event) public void activate(PlayerInteractEvent event)
{ {
@ -86,16 +80,16 @@ public class PerkWaterSplash extends Perk
return; return;
} }
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true)) if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{ {
return; return;
} }
UtilAction.velocity(player, new Vector(0, VELOCITY_Y, 0)); UtilAction.velocity(player, new Vector(0, _velocityY, 0));
_active.put(player.getUniqueId(), System.currentTimeMillis()); _active.put(player.getUniqueId(), System.currentTimeMillis());
List<Player> team = TeamSuperSmash.getTeam(Manager, player, true); List<Player> team = TeamSuperSmash.getTeam(Manager, player, true);
for (Player other : UtilPlayer.getNearby(player.getLocation(), RADIUS)) for (Player other : UtilPlayer.getNearby(player.getLocation(), _radius))
{ {
if (team.contains(other)) if (team.contains(other))
{ {
@ -144,14 +138,14 @@ public class PerkWaterSplash extends Perk
UtilParticle.PlayParticleToAll(ParticleType.DRIP_WATER, player.getLocation(), 0.5F, 0.5F, 0.5F, 0.01F, 10, ViewDist.LONG); UtilParticle.PlayParticleToAll(ParticleType.DRIP_WATER, player.getLocation(), 0.5F, 0.5F, 0.5F, 0.01F, 10, ViewDist.LONG);
if (UtilEnt.isGrounded(player) && UtilTime.elapsed(_active.get(uuid), MIN_AIR_TIME)) if (UtilEnt.isGrounded(player) && UtilTime.elapsed(_active.get(uuid), _minAirTime))
{ {
iterator.remove(); iterator.remove();
_usedSecondBoost.remove(uuid); _usedSecondBoost.remove(uuid);
UtilParticle.PlayParticleToAll(ParticleType.FIREWORKS_SPARK, player.getEyeLocation(), 0, 0, 0, 0.5F, 50, ViewDist.LONG); UtilParticle.PlayParticleToAll(ParticleType.FIREWORKS_SPARK, player.getEyeLocation(), 0, 0, 0, 0.5F, 50, ViewDist.LONG);
for (Block block : UtilBlock.getInRadius(player.getLocation(), RADIUS).keySet()) for (Block block : UtilBlock.getInRadius(player.getLocation(), _radius).keySet())
{ {
if (Math.random() > 0.5) if (Math.random() > 0.5)
{ {
@ -163,7 +157,7 @@ public class PerkWaterSplash extends Perk
player.getWorld().playSound(player.getLocation(), Sound.SPLASH2, 2, 0); player.getWorld().playSound(player.getLocation(), Sound.SPLASH2, 2, 0);
Map<Player, Double> nearby = UtilPlayer.getInRadius(player.getLocation(), RADIUS); Map<Player, Double> nearby = UtilPlayer.getInRadius(player.getLocation(), _radius);
List<Player> team = TeamSuperSmash.getTeam(Manager, player, true); List<Player> team = TeamSuperSmash.getTeam(Manager, player, true);
for (Player other : nearby.keySet()) for (Player other : nearby.keySet())
@ -175,11 +169,11 @@ public class PerkWaterSplash extends Perk
double power = nearby.get(other); double power = nearby.get(other);
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, DAMAGE * power, true, true, false, player.getName(), GetName()); Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage * power, true, true, false, player.getName(), GetName());
Manager.GetCondition().Factory().Falling(GetName(), other, player, DAMAGE, false, true); Manager.GetCondition().Factory().Falling(GetName(), other, player, _damage, false, true);
} }
} }
else if (UtilTime.elapsed(_active.get(uuid), SECOND_BOOST_TIME) && !_usedSecondBoost.contains(uuid) && player.isBlocking()) else if (UtilTime.elapsed(_active.get(uuid), _secondBoostTime) && !_usedSecondBoost.contains(uuid) && player.isBlocking())
{ {
_usedSecondBoost.add(uuid); _usedSecondBoost.add(uuid);

View File

@ -37,11 +37,11 @@ import nautilus.game.arcade.kit.Perk;
public class PerkWhirlpoolBlade extends Perk implements IThrown public class PerkWhirlpoolBlade extends Perk implements IThrown
{ {
private static final int COOLDOWN = 5000; private int _cooldown;
private static final int EXPIRE_TIME = 3000; private int _expireTime;
private static final float VELOCITY = 1.6F; private float _velocity;
private static final float HIT_BOX = 0.5F; private float _hitBox;
private static final int DAMAGE = 5; private int _damage;
private Set<Item> _items = new HashSet<>(); private Set<Item> _items = new HashSet<>();
@ -50,6 +50,16 @@ public class PerkWhirlpoolBlade extends Perk implements IThrown
super("Whirlpool Axe", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Whirlpool Axe" }); super("Whirlpool Axe", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Whirlpool Axe" });
} }
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_expireTime = getPerkTime("Expire Time");
_velocity = getPerkFloat("Velocity");
_hitBox = getPerkFloat("Hit Box");
_damage = getPerkInt("Damage");
}
@EventHandler @EventHandler
public void activate(PlayerInteractEvent event) public void activate(PlayerInteractEvent event)
{ {
@ -80,7 +90,7 @@ public class PerkWhirlpoolBlade extends Perk implements IThrown
return; return;
} }
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true)) if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{ {
return; return;
} }
@ -89,8 +99,8 @@ public class PerkWhirlpoolBlade extends Perk implements IThrown
Item item = player.getWorld().dropItem(player.getEyeLocation(), new ItemStack(Material.PRISMARINE_SHARD)); Item item = player.getWorld().dropItem(player.getEyeLocation(), new ItemStack(Material.PRISMARINE_SHARD));
item.setVelocity(player.getLocation().getDirection().multiply(VELOCITY)); item.setVelocity(player.getLocation().getDirection().multiply(_velocity));
Manager.GetProjectile().AddThrow(item, player, this, EXPIRE_TIME, true, true, true, false, false, HIT_BOX); Manager.GetProjectile().AddThrow(item, player, this, _expireTime, true, true, true, false, false, _hitBox);
_items.add(item); _items.add(item);
} }
@ -131,7 +141,7 @@ public class PerkWhirlpoolBlade extends Perk implements IThrown
return; return;
} }
CustomDamageEvent event = Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, DAMAGE, false, true, true, data.getThrower().getName(), GetName()); CustomDamageEvent event = Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, _damage, false, true, true, data.getThrower().getName(), GetName());
if(event.IsCancelled()) if(event.IsCancelled())
{ {
return; return;

View File

@ -27,16 +27,25 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashGuardian extends SmashUltimate public class SmashGuardian extends SmashUltimate
{ {
private static final int DURATION = 10000;
private static final int GUARDIANS = 4; private static final int GUARDIANS = 4;
private static final int RADIUS = 15;
private static final int DAMAGE = 40; private int _radius;
private int _damage;
private Set<SmashAnimationData> _data = new HashSet<>(); private Set<SmashAnimationData> _data = new HashSet<>();
public SmashGuardian() public SmashGuardian()
{ {
super("Rise of the Guardian", new String[] {}, Sound.AMBIENCE_THUNDER, DURATION); super("Rise of the Guardian", new String[] {}, Sound.AMBIENCE_THUNDER, 0);
}
@Override
public void setupValues()
{
super.setupValues();
_radius = getPerkInt("Radius");
_damage = getPerkInt("Damage");
} }
@Override @Override
@ -46,7 +55,7 @@ public class SmashGuardian extends SmashUltimate
Manager.GetGame().CreatureAllowOverride = true; Manager.GetGame().CreatureAllowOverride = true;
_data.add(new SmashAnimationData(Manager, player, GUARDIANS, DURATION)); _data.add(new SmashAnimationData(Manager, player, GUARDIANS, getLength()));
Manager.GetGame().CreatureAllowOverride = false; Manager.GetGame().CreatureAllowOverride = false;
} }
@ -64,7 +73,7 @@ public class SmashGuardian extends SmashUltimate
if (data.getPlayer().equals(player)) if (data.getPlayer().equals(player))
{ {
Map<Player, Double> inRadius = UtilPlayer.getInRadius(data.getTarget().getLocation(), RADIUS); Map<Player, Double> inRadius = UtilPlayer.getInRadius(data.getTarget().getLocation(), _radius);
List<Player> team = TeamSuperSmash.getTeam(Manager, player, true); List<Player> team = TeamSuperSmash.getTeam(Manager, player, true);
for (Player other : inRadius.keySet()) for (Player other : inRadius.keySet())
{ {
@ -73,11 +82,11 @@ public class SmashGuardian extends SmashUltimate
continue; continue;
} }
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, DAMAGE * inRadius.get(other), true, true, false, player.getName(), GetName()); Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage * inRadius.get(other), true, true, false, player.getName(), GetName());
} }
data.getTarget().getWorld().strikeLightningEffect(data.getTarget().getLocation()); data.getTarget().getWorld().strikeLightningEffect(data.getTarget().getLocation());
UtilParticle.PlayParticleToAll(ParticleType.HUGE_EXPLOSION, data.getTarget().getLocation().add(0, 2, 0), RADIUS, 1, RADIUS, 1F, 30, ViewDist.MAX); UtilParticle.PlayParticleToAll(ParticleType.HUGE_EXPLOSION, data.getTarget().getLocation().add(0, 2, 0), _radius, 1, _radius, 1F, 30, ViewDist.MAX);
player.getWorld().playSound(data.getTarget().getLocation(), Sound.EXPLODE, 5, 0.5F); player.getWorld().playSound(data.getTarget().getLocation(), Sound.EXPLODE, 5, 0.5F);
data.getElder().remove(); data.getElder().remove();

View File

@ -35,10 +35,10 @@ import nautilus.game.arcade.kit.perks.data.FireflyData;
public class PerkFlameDash extends Perk public class PerkFlameDash extends Perk
{ {
private static final int COOLDOWN = 8000; private int _cooldown;
private static final int TIME = 800; private int _time;
private static final int DAMAGE_RADIUS = 3; private int _damageRadius;
private static final int KNOCKBACK_MAGNITUDE = 2; private int _knockbackMagnitude;
private Set<FireflyData> _data = new HashSet<FireflyData>(); private Set<FireflyData> _data = new HashSet<FireflyData>();
@ -47,6 +47,15 @@ public class PerkFlameDash extends Perk
super("Flame Dash", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Spade to use " + C.cGreen + "Flame Dash" }); super("Flame Dash", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Spade to use " + C.cGreen + "Flame Dash" });
} }
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_time = getPerkInt("Time (ms)");
_damageRadius = getPerkInt("Damage Radius");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
}
@EventHandler @EventHandler
public void Skill(PlayerInteractEvent event) public void Skill(PlayerInteractEvent event)
{ {
@ -96,14 +105,14 @@ public class PerkFlameDash extends Perk
} }
else else
{ {
Recharge.Instance.use(player, GetName(), COOLDOWN, true, true); Recharge.Instance.use(player, GetName(), _cooldown, true, true);
} }
return; return;
} }
Recharge.Instance.recharge(player, GetName()); Recharge.Instance.recharge(player, GetName());
Recharge.Instance.use(player, GetName(), COOLDOWN, true, true); Recharge.Instance.use(player, GetName(), _cooldown, true, true);
_data.add(new FireflyData(player)); _data.add(new FireflyData(player));
@ -130,7 +139,7 @@ public class PerkFlameDash extends Perk
FireflyData data = dataIterator.next(); FireflyData data = dataIterator.next();
// Move // Move
if (!UtilTime.elapsed(data.Time, TIME)) if (!UtilTime.elapsed(data.Time, _time))
{ {
Vector vel = data.Location.getDirection(); Vector vel = data.Location.getDirection();
vel.setY(0); vel.setY(0);
@ -148,7 +157,7 @@ public class PerkFlameDash extends Perk
// End // End
else else
{ {
for (Player other : UtilPlayer.getNearby(data.Player.getLocation(), DAMAGE_RADIUS)) for (Player other : UtilPlayer.getNearby(data.Player.getLocation(), _damageRadius))
{ {
if (other.equals(data.Player)) if (other.equals(data.Player))
{ {
@ -191,6 +200,6 @@ public class PerkFlameDash extends Perk
return; return;
} }
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); event.AddKnockback(GetName(), _knockbackMagnitude);
} }
} }

View File

@ -43,13 +43,12 @@ import nautilus.game.arcade.kit.Perk;
public class PerkMagmaBlast extends Perk public class PerkMagmaBlast extends Perk
{ {
private static final int COOLDOWN = 6000; private int _cooldown = 6000;
private static final float FIREBALL_VELOCITY = 0.2F; private float _velocity = 0.2F;
private static final int FIRE_TICKS = 40; private int _fireTicks = 40;
private static final int VELOCITY_RADIUS = 8; private int _velocityRadius = 8;
private static final int FIRE_RADIUS = 2; private int _fireRadius = 2;
private static final int DAMAGE = 8; private int _damage = 8;
private Map<LargeFireball, Location> _proj = new HashMap<>(); private Map<LargeFireball, Location> _proj = new HashMap<>();
@ -58,6 +57,17 @@ public class PerkMagmaBlast extends Perk
super("Magma Blast", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Magma Blast" }); super("Magma Blast", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Magma Blast" });
} }
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_velocity = getPerkFloat("Velocity");
_fireTicks = getPerkInt("Fire Ticks");
_velocityRadius = getPerkInt("Velocity Radius");
_fireRadius = getPerkInt("Fire Radius");
_damage = getPerkInt("Damage");
}
@EventHandler @EventHandler
public void Shoot(PlayerInteractEvent event) public void Shoot(PlayerInteractEvent event)
{ {
@ -88,7 +98,7 @@ public class PerkMagmaBlast extends Perk
return; return;
} }
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true)) if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{ {
return; return;
} }
@ -103,7 +113,7 @@ public class PerkMagmaBlast extends Perk
ball.setBounce(false); ball.setBounce(false);
ball.teleport(player.getEyeLocation().add(player.getLocation().getDirection().multiply(1))); ball.teleport(player.getEyeLocation().add(player.getLocation().getDirection().multiply(1)));
Vector dir = player.getLocation().getDirection().multiply(FIREBALL_VELOCITY); Vector dir = player.getLocation().getDirection().multiply(_velocity);
EntityLargeFireball eFireball = ((CraftLargeFireball) ball).getHandle(); EntityLargeFireball eFireball = ((CraftLargeFireball) ball).getHandle();
eFireball.dirX = dir.getX(); eFireball.dirX = dir.getX();
@ -168,7 +178,7 @@ public class PerkMagmaBlast extends Perk
Player shooter = (Player) proj.getShooter(); Player shooter = (Player) proj.getShooter();
// Velocity Players // Velocity Players
Map<Player, Double> hitMap = UtilPlayer.getInRadius(proj.getLocation(), VELOCITY_RADIUS); Map<Player, Double> hitMap = UtilPlayer.getInRadius(proj.getLocation(), _velocityRadius);
List<Player> team = TeamSuperSmash.getTeam(Manager, shooter, false); List<Player> team = TeamSuperSmash.getTeam(Manager, shooter, false);
for (Player cur : hitMap.keySet()) for (Player cur : hitMap.keySet())
@ -182,7 +192,7 @@ public class PerkMagmaBlast extends Perk
double range = hitMap.get(cur); double range = hitMap.get(cur);
Manager.GetDamage().NewDamageEvent(cur, shooter, proj, DamageCause.PROJECTILE, range * DAMAGE, false, true, false, shooter.getName(), GetName()); Manager.GetDamage().NewDamageEvent(cur, shooter, proj, DamageCause.PROJECTILE, range * _damage, false, true, false, shooter.getName(), GetName());
// Velocity // Velocity
UtilAction.velocity(cur, UtilAlg.getTrajectory(proj.getLocation().add(0, -0.5, 0), cur.getEyeLocation()), 1 + 2 * range, false, 0, 0.2 + 0.4 * range, 1.2, true); UtilAction.velocity(cur, UtilAlg.getTrajectory(proj.getLocation().add(0, -0.5, 0), cur.getEyeLocation()), 1 + 2 * range, false, 0, 0.2 + 0.4 * range, 1.2, true);
@ -222,9 +232,9 @@ public class PerkMagmaBlast extends Perk
} }
} }
if (UtilMath.offset(player, proj) < FIRE_RADIUS) if (UtilMath.offset(player, proj) < _fireRadius)
{ {
player.setFireTicks(FIRE_TICKS); player.setFireTicks(_fireTicks);
} }
} }
} }

View File

@ -28,13 +28,21 @@ import nautilus.game.arcade.kit.Perk;
public class PerkMagmaBoost extends Perk public class PerkMagmaBoost extends Perk
{ {
private static final int MAX_STACKS = 3; private int _maxStacks;
private Map<UUID, Integer> _kills = new HashMap<>(); private Map<UUID, Integer> _kills = new HashMap<>();
public PerkMagmaBoost() public PerkMagmaBoost()
{ {
super("Fuel the Fire", new String[] { C.cGray + "Kills give +1 Damage, -15% Knockback Taken and +1 Size.", C.cGray + "Kill bonuses can stack " + MAX_STACKS + " times, and reset on death.", }); super("Fuel the Fire", new String[0]);
}
@Override
public void setupValues()
{
_maxStacks = getPerkInt("Max Stacks");
setDesc(C.cGray + "Kills give +1 Damage, -15% Knockback Taken and +1 Size.", C.cGray + "Kill bonuses can stack " + _maxStacks + " times, and reset on death.");
} }
@EventHandler @EventHandler
@ -80,14 +88,14 @@ public class PerkMagmaBoost extends Perk
size += _kills.get(key); size += _kills.get(key);
} }
size = Math.min(MAX_STACKS, size); size = Math.min(_maxStacks, size);
_kills.put(key, size); _kills.put(key, size);
slime.SetSize(size + 1); slime.SetSize(size + 1);
Manager.GetDisguise().updateDisguise(slime); Manager.GetDisguise().updateDisguise(slime);
killer.setExp(0.99F * (size / (float) MAX_STACKS)); killer.setExp(0.99F * (size / (float) _maxStacks));
} }
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)

View File

@ -18,8 +18,6 @@ import nautilus.game.arcade.kit.perks.data.MeteorShowerData;
public class SmashMagmacube extends SmashUltimate public class SmashMagmacube extends SmashUltimate
{ {
private static final int DURATION = 12000;
private List<MeteorShowerData> _meteors = new ArrayList<>(); private List<MeteorShowerData> _meteors = new ArrayList<>();
public SmashMagmacube() public SmashMagmacube()
@ -30,7 +28,7 @@ public class SmashMagmacube extends SmashUltimate
@Override @Override
public void activate(Player player) public void activate(Player player)
{ {
_meteors.add(new MeteorShowerData(player, UtilPlayer.getTarget(player, UtilBlock.blockPassSet, 128).getLocation(), DURATION)); _meteors.add(new MeteorShowerData(player, UtilPlayer.getTarget(player, UtilBlock.blockPassSet, 128).getLocation(), getLength()));
} }
@EventHandler @EventHandler
@ -41,16 +39,6 @@ public class SmashMagmacube extends SmashUltimate
return; return;
} }
Iterator<MeteorShowerData> meteorIter = _meteors.iterator(); _meteors.removeIf(MeteorShowerData::update);
while (meteorIter.hasNext())
{
MeteorShowerData data = meteorIter.next();
if (data.update())
{
meteorIter.remove();
}
}
} }
} }

View File

@ -40,14 +40,14 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkPigBaconBomb extends SmashPerk public class PerkPigBaconBomb extends SmashPerk
{ {
private static final float ENERGY_PER_PIG = 0.35F; private float _energyPig;
private static final float ENERGY_PER_PIG_DISGUISED_FACTOR = 0.7F; private float _energyPigDisguiseFactor;
private static final int COOLDOWN = 100; private int _cooldown;
private static final int PIG_MAX_TICKS = 80; private int _maxTicks;
private static final float PIG_SPEED = 1.2F; private float _pigSpeed;
private static final int PIG_EXPLODE_RADIUS = 2; private int _explodeRadius;
private static final int PIG_EXPLODE_DAMAGE = 4; private int _explodeDamage;
private static final int PIG_EXPLODE_DAMAGE_RADIUS = 4; private int _explodeDamageRadius;
private Map<UUID, Set<Pig>> _pigs = new HashMap<UUID, Set<Pig>>(); private Map<UUID, Set<Pig>> _pigs = new HashMap<UUID, Set<Pig>>();
@ -56,6 +56,19 @@ public class PerkPigBaconBomb extends SmashPerk
super("Baby Bacon Bomb", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Spade to " + C.cGreen + "Baby Bacon Bomb" }); super("Baby Bacon Bomb", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Spade to " + C.cGreen + "Baby Bacon Bomb" });
} }
@Override
public void setupValues()
{
_energyPig = getPerkFloat("Energy Per Pig");
_energyPigDisguiseFactor = getPerkFloat("Energy Per Pig Disguise Factor");
_cooldown = getPerkInt("Cooldown (ms)");
_maxTicks = getPerkInt("Pig Max Ticks");
_pigSpeed = getPerkFloat("Pig Speed");
_explodeRadius = getPerkInt("Pig Explode Radius");
_explodeDamage = getPerkInt("Pig Explode Damage");
_explodeDamageRadius = getPerkInt("Pig Explode Damage Radius");
}
@EventHandler @EventHandler
public void Skill(PlayerInteractEvent event) public void Skill(PlayerInteractEvent event)
{ {
@ -86,13 +99,13 @@ public class PerkPigBaconBomb extends SmashPerk
return; return;
} }
float energy = ENERGY_PER_PIG; float energy = _energyPig;
DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player); DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player);
if (disguise != null && disguise instanceof DisguisePigZombie) if (disguise != null && disguise instanceof DisguisePigZombie)
{ {
energy = energy * ENERGY_PER_PIG_DISGUISED_FACTOR; energy = energy * _energyPigDisguiseFactor;
} }
// Energy // Energy
@ -103,7 +116,7 @@ public class PerkPigBaconBomb extends SmashPerk
} }
// Recharge // Recharge
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, false, false)) if (!Recharge.Instance.use(player, GetName(), _cooldown, false, false))
{ {
return; return;
} }
@ -163,7 +176,7 @@ public class PerkPigBaconBomb extends SmashPerk
{ {
Pig pig = pigIterator.next(); Pig pig = pigIterator.next();
if (!pig.isValid() || pig.getTicksLived() > PIG_MAX_TICKS) if (!pig.isValid() || pig.getTicksLived() > _maxTicks)
{ {
PigExplode(pigIterator, pig, player); PigExplode(pigIterator, pig, player);
continue; continue;
@ -176,9 +189,9 @@ public class PerkPigBaconBomb extends SmashPerk
continue; continue;
} }
UtilEnt.CreatureMoveFast(pig, target.getLocation(), PIG_SPEED); UtilEnt.CreatureMoveFast(pig, target.getLocation(), _pigSpeed);
if (UtilMath.offset(target, pig) < PIG_EXPLODE_RADIUS) if (UtilMath.offset(target, pig) < _explodeRadius)
{ {
PigExplode(pigIterator, pig, player); PigExplode(pigIterator, pig, player);
} }
@ -196,7 +209,7 @@ public class PerkPigBaconBomb extends SmashPerk
pig.getWorld().playSound(pig.getLocation(), Sound.PIG_DEATH, 1f, 2f); pig.getWorld().playSound(pig.getLocation(), Sound.PIG_DEATH, 1f, 2f);
// Damage // Damage
Map<LivingEntity, Double> targets = UtilEnt.getInRadius(pig.getLocation(), PIG_EXPLODE_DAMAGE_RADIUS); Map<LivingEntity, Double> targets = UtilEnt.getInRadius(pig.getLocation(), _explodeDamageRadius);
for (LivingEntity cur : targets.keySet()) for (LivingEntity cur : targets.keySet())
{ {
@ -206,7 +219,7 @@ public class PerkPigBaconBomb extends SmashPerk
} }
// Damage Event // Damage Event
Manager.GetDamage().NewDamageEvent(cur, owner, null, DamageCause.CUSTOM, PIG_EXPLODE_DAMAGE, false, true, false, owner.getName(), GetName()); Manager.GetDamage().NewDamageEvent(cur, owner, null, DamageCause.CUSTOM, _explodeDamage, false, true, false, owner.getName(), GetName());
} }
// Remove // Remove

View File

@ -40,17 +40,27 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkPigBaconBounce extends SmashPerk implements IThrown public class PerkPigBaconBounce extends SmashPerk implements IThrown
{ {
private static final float ENERGY_PER_BACON = 0.2F; private float _energyBacon;
private static final float ENERGY_PER_BACON_DISGUISED_FACTOR = 0.7F; private float _energyBaconDisgtuiseFactor;
private static final int COOLDOWN = 100; private int _cooldown;
private static final int HEALTH_PER_BACON = 1; private int _healthBacon;
private static final int BACON_DAMAGE = 4; private int _damageBacon;
public PerkPigBaconBounce() public PerkPigBaconBounce()
{ {
super("Bouncy Bacon", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Bouncy Bacon", }); super("Bouncy Bacon", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Bouncy Bacon", });
} }
@Override
public void setupValues()
{
_energyBacon = getPerkFloat("Energy Per Bacon");
_energyBaconDisgtuiseFactor = getPerkFloat("Energy Per Bacon Disguise Factor");
_cooldown = getPerkInt("Cooldown (ms)");
_healthBacon = getPerkInt("Health Per Bacon");
_damageBacon = getPerkInt("Bacon Damage");
}
@EventHandler @EventHandler
public void Skill(PlayerInteractEvent event) public void Skill(PlayerInteractEvent event)
{ {
@ -81,13 +91,13 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
return; return;
} }
float energy = ENERGY_PER_BACON; float energy = _energyBacon;
DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player); DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player);
if (disguise != null && disguise instanceof DisguisePigZombie) if (disguise != null && disguise instanceof DisguisePigZombie)
{ {
energy = energy * ENERGY_PER_BACON_DISGUISED_FACTOR; energy = energy * _energyBaconDisgtuiseFactor;
} }
// Energy // Energy
@ -98,7 +108,7 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
} }
// Recharge // Recharge
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, false, false)) if (!Recharge.Instance.use(player, GetName(), _cooldown, false, false))
{ {
return; return;
} }
@ -130,7 +140,7 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
} }
// Damage Event // Damage Event
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, BACON_DAMAGE, true, true, false, UtilEnt.getName(data.getThrower()), GetName()); Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, _damageBacon, true, true, false, UtilEnt.getName(data.getThrower()), GetName());
Item item = (Item) data.getThrown(); Item item = (Item) data.getThrown();
item.setItemStack(new ItemStack(Material.GRILLED_PORK)); item.setItemStack(new ItemStack(Material.GRILLED_PORK));
@ -189,7 +199,7 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
// Heal // Heal
if (event.getItem().getItemStack().getType() == Material.GRILLED_PORK) if (event.getItem().getItemStack().getType() == Material.GRILLED_PORK)
{ {
UtilPlayer.health(event.getPlayer(), HEALTH_PER_BACON); UtilPlayer.health(event.getPlayer(), _healthBacon);
UtilParticle.PlayParticle(ParticleType.HEART, event.getPlayer().getLocation().add(0, 0.5, 0), 0.2f, 0.2f, 0.2f, 0, 4, ViewDist.LONG, UtilServer.getPlayers()); UtilParticle.PlayParticle(ParticleType.HEART, event.getPlayer().getLocation().add(0, 0.5, 0), 0.2f, 0.2f, 0.2f, 0, 4, ViewDist.LONG, UtilServer.getPlayers());
} }
} }

View File

@ -24,7 +24,7 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkPigZombie extends SmashPerk public class PerkPigZombie extends SmashPerk
{ {
private static final int MIN_HEALTH = 6; private int _minHealth;
public Set<UUID> _active = new HashSet<>(); public Set<UUID> _active = new HashSet<>();
@ -33,6 +33,12 @@ public class PerkPigZombie extends SmashPerk
super("Nether Pig", new String[] { C.cGray + "Become Nether Pig when HP is below 6.", C.cGray + "Return to Pig when HP is 10 or higher." }); super("Nether Pig", new String[] { C.cGray + "Become Nether Pig when HP is below 6.", C.cGray + "Return to Pig when HP is 10 or higher." });
} }
@Override
public void setupValues()
{
_minHealth = getPerkInt("Min Health");
}
@EventHandler @EventHandler
public void Check(UpdateEvent event) public void Check(UpdateEvent event)
{ {
@ -86,7 +92,7 @@ public class PerkPigZombie extends SmashPerk
// Not Active // Not Active
else else
{ {
if (player.getHealth() <= 0 || (!isSuperActive(player) && player.getHealth() > MIN_HEALTH)) if (player.getHealth() <= 0 || (!isSuperActive(player) && player.getHealth() > _minHealth))
{ {
continue; continue;
} }

View File

@ -8,11 +8,9 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashPig extends SmashUltimate public class SmashPig extends SmashUltimate
{ {
private static final int DURATION = 40000;
public SmashPig() public SmashPig()
{ {
super("Pig Stink", new String[] {}, Sound.PIG_IDLE, DURATION); super("Pig Stink", new String[] {}, Sound.PIG_IDLE, 0);
} }
@Override @Override
@ -24,7 +22,7 @@ public class SmashPig extends SmashUltimate
{ {
if (!player.equals(other)) if (!player.equals(other))
{ {
Manager.GetCondition().Factory().Confuse(GetName() + " " + player.getName(), other, player, DURATION / 1000, 0, false, false, false); Manager.GetCondition().Factory().Confuse(GetName() + " " + player.getName(), other, player, getLength() / 1000, 0, false, false, false);
} }
} }
} }

View File

@ -26,9 +26,9 @@ import nautilus.game.arcade.kit.perks.data.HomingSheepData;
public class SmashSheep extends SmashUltimate public class SmashSheep extends SmashUltimate
{ {
private static final int DAMAGE_RADIUS = 10; private int _damageRadius;
private static final int DAMAGE = 20; private int _damage;
private static final int KNOCKBACK_MAGNITUDE = 3; private int _knockbackMagnitude;
private List<HomingSheepData> _sheep = new ArrayList<>(); private List<HomingSheepData> _sheep = new ArrayList<>();
@ -37,6 +37,14 @@ public class SmashSheep extends SmashUltimate
super("Homing Sheeples", new String[] {}, Sound.SHEEP_IDLE, 0); super("Homing Sheeples", new String[] {}, Sound.SHEEP_IDLE, 0);
} }
@Override
public void setupValues()
{
_damageRadius = getPerkInt("Damage Radius");
_damage = getPerkInt("Damage");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
}
@Override @Override
public void activate(Player player) public void activate(Player player)
{ {
@ -91,7 +99,7 @@ public class SmashSheep extends SmashUltimate
double scale = 0.4 + 0.6 * Math.min(1, data.Sheep.getTicksLived() / 60d); double scale = 0.4 + 0.6 * Math.min(1, data.Sheep.getTicksLived() / 60d);
// Players // Players
Map<Player, Double> players = UtilPlayer.getInRadius(data.Sheep.getLocation(), DAMAGE_RADIUS); Map<Player, Double> players = UtilPlayer.getInRadius(data.Sheep.getLocation(), _damageRadius);
for (Player player : players.keySet()) for (Player player : players.keySet())
{ {
@ -101,7 +109,7 @@ public class SmashSheep extends SmashUltimate
} }
// Damage Event // Damage Event
Manager.GetDamage().NewDamageEvent(player, data.Shooter, null, DamageCause.CUSTOM, DAMAGE * scale, true, true, false, data.Shooter.getName(), GetName()); Manager.GetDamage().NewDamageEvent(player, data.Shooter, null, DamageCause.CUSTOM, _damage * scale, true, true, false, data.Shooter.getName(), GetName());
} }
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, data.Sheep.getLocation(), 0, 0, 0, 0, 1, ViewDist.MAX, UtilServer.getPlayers()); UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, data.Sheep.getLocation(), 0, 0, 0, 0, 1, ViewDist.MAX, UtilServer.getPlayers());
@ -118,6 +126,6 @@ public class SmashSheep extends SmashUltimate
return; return;
} }
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); event.AddKnockback(GetName(), _knockbackMagnitude);
} }
} }

View File

@ -29,11 +29,11 @@ import java.util.*;
public class PerkFishFlurry extends SmashPerk implements IThrown public class PerkFishFlurry extends SmashPerk implements IThrown
{ {
private static final int COOLDOWN = 24000; private int _cooldown;
private static final float DAMAGE = 2.6F; private float _damage;
private static final int START_TIME = 2000; private int _startTime;
private static final int END_TIME = 6000; private int _endTime;
private static final float KNOCKBACK_MAGNITUDE = 1.5F; private float _knockbackMagnitude;
private List<DataSquidGeyser> _active = new ArrayList<>(); private List<DataSquidGeyser> _active = new ArrayList<>();
@ -42,6 +42,16 @@ public class PerkFishFlurry extends SmashPerk implements IThrown
super("Fish Flurry", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Spade to use " + C.cGreen + "Fish Flurry" }); super("Fish Flurry", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Spade to use " + C.cGreen + "Fish Flurry" });
} }
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_damage = getPerkFloat("Damage");
_startTime = getPerkTime("Start Time");
_endTime = getPerkTime("End Time");
_knockbackMagnitude = getPerkFloat("Knockback Magnitude");
}
@EventHandler @EventHandler
public void shoot(PlayerInteractEvent event) public void shoot(PlayerInteractEvent event)
{ {
@ -111,7 +121,7 @@ public class PerkFishFlurry extends SmashPerk implements IThrown
if (!blocks.isEmpty()) if (!blocks.isEmpty())
{ {
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true)) if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{ {
return; return;
} }
@ -150,12 +160,12 @@ public class PerkFishFlurry extends SmashPerk implements IThrown
block.getWorld().playSound(block.getLocation(), Math.random() > 0.5 ? Sound.SPLASH : Sound.SPLASH2, 0.5f, 1f); block.getWorld().playSound(block.getLocation(), Math.random() > 0.5 ? Sound.SPLASH : Sound.SPLASH2, 0.5f, 1f);
} }
if (!UtilTime.elapsed(data.StartTime, START_TIME)) if (!UtilTime.elapsed(data.StartTime, _startTime))
{ {
continue; continue;
} }
if (!UtilTime.elapsed(data.StartTime, END_TIME)) if (!UtilTime.elapsed(data.StartTime, _endTime))
{ {
Item fish = block.getWorld().dropItem(block.getLocation().add(0.5, 1.5, 0.5), ItemStackFactory.Instance.CreateStack(Material.RAW_FISH, (byte) UtilMath.r(4), 1, "Fish" + Math.random())); Item fish = block.getWorld().dropItem(block.getLocation().add(0.5, 1.5, 0.5), ItemStackFactory.Instance.CreateStack(Material.RAW_FISH, (byte) UtilMath.r(4), 1, "Fish" + Math.random()));
@ -178,7 +188,7 @@ public class PerkFishFlurry extends SmashPerk implements IThrown
if (target != null) if (target != null)
{ {
// Damage Event // Damage Event
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, DAMAGE, false, true, false, UtilEnt.getName(data.getThrower()), GetName()); Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, _damage, false, true, false, UtilEnt.getName(data.getThrower()), GetName());
UtilParticle.PlayParticle(ParticleType.EXPLODE, target.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0, 12, ViewDist.LONG, UtilServer.getPlayers()); UtilParticle.PlayParticle(ParticleType.EXPLODE, target.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0, 12, ViewDist.LONG, UtilServer.getPlayers());
} }
@ -206,7 +216,7 @@ public class PerkFishFlurry extends SmashPerk implements IThrown
return; return;
} }
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); event.AddKnockback(GetName(), _knockbackMagnitude);
event.setKnockbackOrigin(event.GetDamageeEntity().getLocation().add(Math.random() - 0.5, -0.1, Math.random() - 0.5)); event.setKnockbackOrigin(event.GetDamageeEntity().getLocation().add(Math.random() - 0.5, -0.1, Math.random() - 0.5));
} }
} }

View File

@ -36,19 +36,25 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkInkBlast extends SmashPerk implements IThrown public class PerkInkBlast extends SmashPerk implements IThrown
{ {
private static final int COOLDOWN = 6000; private int _cooldown;
private static final float PROJECTILE_VELOCITY = 0.15F; private float _projectileVelocity;
private static final int KNOCKBACK_MAGNITUDE = 3; private int _knockbackMagnitude;
private int _bullets; private int _bullets;
private double _damagePerBullet; private double _damagePerBullet;
public PerkInkBlast(int bullets, double damagePerBullet) public PerkInkBlast()
{ {
super("Ink Shotgun", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Ink Shotgun" }); super("Ink Shotgun", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Ink Shotgun" });
}
_bullets = bullets; @Override
_damagePerBullet = damagePerBullet; public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_projectileVelocity = getPerkFloat("Projectile Velocity");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
_bullets = getPerkInt("Bullets");
_damagePerBullet = getPerkInt("Damage Per Bullet");
} }
@EventHandler @EventHandler
@ -86,7 +92,7 @@ public class PerkInkBlast extends SmashPerk implements IThrown
return; return;
} }
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true)) if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{ {
return; return;
} }
@ -102,7 +108,7 @@ public class PerkInkBlast extends SmashPerk implements IThrown
Vector random = new Vector(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5); Vector random = new Vector(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);
random.normalize(); random.normalize();
random.multiply(PROJECTILE_VELOCITY); random.multiply(_projectileVelocity);
if (i == 0) if (i == 0)
{ {
@ -164,6 +170,6 @@ public class PerkInkBlast extends SmashPerk implements IThrown
return; return;
} }
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); event.AddKnockback(GetName(), _knockbackMagnitude);
} }
} }

View File

@ -31,8 +31,8 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkSuperSquid extends SmashPerk public class PerkSuperSquid extends SmashPerk
{ {
private static final int COOLDOWN = 8000; private int _cooldown;
private static final int VELOCITY_TIME = 1100; private int _velocityTime;
private Map<UUID, Long> _active = new HashMap<>(); private Map<UUID, Long> _active = new HashMap<>();
@ -41,6 +41,13 @@ public class PerkSuperSquid extends SmashPerk
super("Super Squid", new String[] { C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Super Squid", }); super("Super Squid", new String[] { C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Super Squid", });
} }
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_velocityTime = getPerkInt("Velocity Time (ms)");
}
@EventHandler @EventHandler
public void Activate(PlayerInteractEvent event) public void Activate(PlayerInteractEvent event)
{ {
@ -76,7 +83,7 @@ public class PerkSuperSquid extends SmashPerk
return; return;
} }
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true)) if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{ {
return; return;
} }
@ -112,7 +119,7 @@ public class PerkSuperSquid extends SmashPerk
continue; continue;
} }
if (UtilTime.elapsed(_active.get(cur.getUniqueId()), VELOCITY_TIME)) if (UtilTime.elapsed(_active.get(cur.getUniqueId()), _velocityTime))
{ {
_active.remove(cur.getUniqueId()); _active.remove(cur.getUniqueId());
continue; continue;

View File

@ -38,16 +38,27 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashSquid extends SmashUltimate public class SmashSquid extends SmashUltimate
{ {
private static final int DURATION = 24000; private int _rate;
private static final int RATE = 1600; private int _maxRange;
private static final int MAX_RANGE = 100; private int _damage;
private static final int DAMAGE = 16; private int _damageRadius;
private static final int DAMAGE_RADIUS = 8; private int _knockbackMagnitude;
private static final int KNOCKBACK_MAGNITUDE = 3;
public SmashSquid() public SmashSquid()
{ {
super("Storm Squid", new String[] {}, Sound.SPLASH2, DURATION); super("Storm Squid", new String[] {}, Sound.SPLASH2, 0);
}
@Override
public void setupValues()
{
super.setupValues();
_rate = getPerkInt("Rate (ms)");
_maxRange = getPerkInt("Max Range");
_damage = getPerkInt("Damage");
_damageRadius = getPerkInt("Damage Radius");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
} }
@Override @Override
@ -98,7 +109,7 @@ public class SmashSquid extends SmashUltimate
return; return;
} }
Block block = UtilPlayer.getTarget(player, UtilBlock.blockAirFoliageSet, MAX_RANGE); Block block = UtilPlayer.getTarget(player, UtilBlock.blockAirFoliageSet, _maxRange);
if (block == null) if (block == null)
{ {
@ -107,7 +118,7 @@ public class SmashSquid extends SmashUltimate
final Location loc = block.getLocation().add(0.5, 0.5, 0.5); final Location loc = block.getLocation().add(0.5, 0.5, 0.5);
if (!Recharge.Instance.use(player, GetName() + " Strike", RATE, false, false)) if (!Recharge.Instance.use(player, GetName() + " Strike", _rate, false, false))
{ {
return; return;
} }
@ -124,7 +135,7 @@ public class SmashSquid extends SmashUltimate
// Warning // Warning
player.getWorld().spigot().strikeLightningEffect(loc, false); player.getWorld().spigot().strikeLightningEffect(loc, false);
Map<LivingEntity, Double> targets = UtilEnt.getInRadius(loc, DAMAGE_RADIUS); Map<LivingEntity, Double> targets = UtilEnt.getInRadius(loc, _damageRadius);
for (LivingEntity cur : targets.keySet()) for (LivingEntity cur : targets.keySet())
{ {
@ -134,7 +145,7 @@ public class SmashSquid extends SmashUltimate
} }
// Damage Event // Damage Event
Manager.GetDamage().NewDamageEvent(cur, player, null, DamageCause.CUSTOM, DAMAGE * targets.get(cur), false, true, false, player.getName(), GetName()); Manager.GetDamage().NewDamageEvent(cur, player, null, DamageCause.CUSTOM, _damage * targets.get(cur), false, true, false, player.getName(), GetName());
// Velocity // Velocity
UtilAction.velocity(cur, UtilAlg.getTrajectory(loc, cur.getLocation()), 3 * targets.get(cur), false, 0, 1 * targets.get(cur), 2, true); UtilAction.velocity(cur, UtilAlg.getTrajectory(loc, cur.getLocation()), 3 * targets.get(cur), false, 0, 1 * targets.get(cur), 2, true);
@ -245,6 +256,6 @@ public class SmashSquid extends SmashUltimate
return; return;
} }
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); event.AddKnockback(GetName(), _knockbackMagnitude);
} }
} }

View File

@ -5,6 +5,7 @@ import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
@ -36,9 +37,9 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkWitherImage extends SmashPerk public class PerkWitherImage extends SmashPerk
{ {
private static final int COOLDOWN = 12000; private int _cooldown;
private static final int SWAP_COOLDOWN = 2000; private int _swapCooldown;
private static final int TARGET_RADIUS = 15; private int _targetRadius;
private Map<UUID, Skeleton> _skeletons = new HashMap<>(); private Map<UUID, Skeleton> _skeletons = new HashMap<>();
@ -48,6 +49,14 @@ public class PerkWitherImage extends SmashPerk
+ "Wither Swap" }); + "Wither Swap" });
} }
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_swapCooldown = getPerkTime("Swap Cooldown");
_targetRadius = getPerkInt("Target Radius");
}
@EventHandler @EventHandler
public void activate(PlayerInteractEvent event) public void activate(PlayerInteractEvent event)
{ {
@ -85,7 +94,7 @@ public class PerkWitherImage extends SmashPerk
if (!_skeletons.containsKey(player.getUniqueId())) if (!_skeletons.containsKey(player.getUniqueId()))
{ {
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true)) if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{ {
return; return;
} }
@ -101,7 +110,7 @@ public class PerkWitherImage extends SmashPerk
skel.setMaxHealth(20); skel.setMaxHealth(20);
skel.setHealth(skel.getMaxHealth()); skel.setHealth(skel.getMaxHealth());
for (Player other : UtilPlayer.getNearby(skel.getLocation(), TARGET_RADIUS)) for (Player other : UtilPlayer.getNearby(skel.getLocation(), _targetRadius))
{ {
if (player.equals(other) || UtilPlayer.isSpectator(other) || isTeamDamage(player, other)) if (player.equals(other) || UtilPlayer.isSpectator(other) || isTeamDamage(player, other))
{ {
@ -127,7 +136,7 @@ public class PerkWitherImage extends SmashPerk
_skeletons.put(player.getUniqueId(), skel); _skeletons.put(player.getUniqueId(), skel);
Recharge.Instance.use(player, "Wither Swap", SWAP_COOLDOWN / 4, false, false); Recharge.Instance.use(player, "Wither Swap", _swapCooldown / 4, false, false);
// Sound // Sound
player.getWorld().playSound(player.getLocation(), Sound.WITHER_SPAWN, 1f, 1f); player.getWorld().playSound(player.getLocation(), Sound.WITHER_SPAWN, 1f, 1f);
@ -137,7 +146,7 @@ public class PerkWitherImage extends SmashPerk
} }
else else
{ {
if (!Recharge.Instance.use(player, "Wither Swap", SWAP_COOLDOWN, true, false)) if (!Recharge.Instance.use(player, "Wither Swap", _swapCooldown, true, false))
{ {
return; return;
} }

View File

@ -40,10 +40,10 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkWitherSkull extends SmashPerk public class PerkWitherSkull extends SmashPerk
{ {
private static final int COOLDOWN_NORMAL = 6000; private int _cooldownNormal;
private static final int COOLDOWN_SMASH = 1000; private int _cooldownSmash;
private static final int DAMAGE = 12; private int _damage;
private static final float KNOCKBACK_MAGNITUDE = 1.5F; private float _knockbackMagnitude;
private Map<WitherSkull, Vector> _active = new HashMap<>(); private Map<WitherSkull, Vector> _active = new HashMap<>();
private Set<UUID> _ignoreControl = new HashSet<>(); private Set<UUID> _ignoreControl = new HashSet<>();
@ -53,6 +53,15 @@ public class PerkWitherSkull extends SmashPerk
super("Wither Skull", new String[] { C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Wither Skull" }); super("Wither Skull", new String[] { C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Wither Skull" });
} }
@Override
public void setupValues()
{
_cooldownNormal = getPerkTime("Cooldown Normal");
_cooldownSmash = getPerkTime("Cooldown Smash");
_damage = getPerkInt("Damage");
_knockbackMagnitude = getPerkFloat("Knockback Magnitude");
}
@EventHandler(priority = EventPriority.LOW) // Happen BEFORE super is @EventHandler(priority = EventPriority.LOW) // Happen BEFORE super is
// triggered // triggered
public void activate(PlayerInteractEvent event) public void activate(PlayerInteractEvent event)
@ -88,7 +97,7 @@ public class PerkWitherSkull extends SmashPerk
return; return;
} }
if (!Recharge.Instance.use(player, GetName(), smash ? COOLDOWN_SMASH : COOLDOWN_NORMAL, !smash, !smash)) if (!Recharge.Instance.use(player, GetName(), smash ? _cooldownSmash : _cooldownNormal, !smash, !smash))
{ {
return; return;
} }
@ -211,7 +220,7 @@ public class PerkWitherSkull extends SmashPerk
} }
// Damage Event // Damage Event
Manager.GetDamage().NewDamageEvent(player, (LivingEntity) skull.getShooter(), null, DamageCause.CUSTOM, DAMAGE * players.get(player) * scale, true, true, false, UtilEnt.getName( Manager.GetDamage().NewDamageEvent(player, (LivingEntity) skull.getShooter(), null, DamageCause.CUSTOM, _damage * players.get(player) * scale, true, true, false, UtilEnt.getName(
(LivingEntity) skull.getShooter()), GetName()); (LivingEntity) skull.getShooter()), GetName());
} }
} }
@ -224,6 +233,6 @@ public class PerkWitherSkull extends SmashPerk
return; return;
} }
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); event.AddKnockback(GetName(), _knockbackMagnitude);
} }
} }

View File

@ -28,11 +28,9 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashWitherSkeleton extends SmashUltimate public class SmashWitherSkeleton extends SmashUltimate
{ {
private static final int DURAITON = 18000;
public SmashWitherSkeleton() public SmashWitherSkeleton()
{ {
super("Wither Form", new String[] {}, Sound.WITHER_SPAWN, DURAITON); super("Wither Form", new String[] {}, Sound.WITHER_SPAWN, 0);
} }
@Override @Override

View File

@ -40,13 +40,17 @@ public class PerkOvercharge extends SmashPerk
private int _tick; private int _tick;
private boolean _useExp; private boolean _useExp;
public PerkOvercharge(int max, int tick, boolean useExpBar) public PerkOvercharge()
{ {
super("Corrupted Arrow", new String[] { C.cYellow + "Charge" + C.cGray + " your Bow to use " + C.cGreen + "Corrupted Arrow" }); super("Corrupted Arrow", new String[] { C.cYellow + "Charge" + C.cGray + " your Bow to use " + C.cGreen + "Corrupted Arrow" });
}
_useExp = useExpBar; @Override
_max = max; public void setupValues()
_tick = tick; {
_max = getPerkInt("Max");
_tick = getPerkInt("Tick");
_useExp = getPerkBoolean("Use Exp");
} }
@EventHandler @EventHandler

View File

@ -39,10 +39,10 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkZombieBile extends SmashPerk implements IThrown public class PerkZombieBile extends SmashPerk implements IThrown
{ {
private static final int COOLDOWN = 10000; private int _cooldown;
private static final int ITEMS = 3; private int _items;
private static final int DAMAGE = 3; private int _damage;
private static final int KNOCKBACK_MAGNITUDE = 1; private int _knockbackMagnitude;
private Map<UUID, Long> _active = new HashMap<>(); private Map<UUID, Long> _active = new HashMap<>();
@ -51,6 +51,15 @@ public class PerkZombieBile extends SmashPerk implements IThrown
super("Spew Bile", new String[] { C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Spew Bile" }); super("Spew Bile", new String[] { C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Spew Bile" });
} }
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_items = getPerkInt("Items");
_damage = getPerkInt("Damage");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
}
@EventHandler @EventHandler
public void activate(PlayerInteractEvent event) public void activate(PlayerInteractEvent event)
{ {
@ -81,7 +90,7 @@ public class PerkZombieBile extends SmashPerk implements IThrown
return; return;
} }
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true)) if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{ {
return; return;
} }
@ -131,7 +140,7 @@ public class PerkZombieBile extends SmashPerk implements IThrown
} }
// Projectiles // Projectiles
for (int i = 0; i < ITEMS; i++) for (int i = 0; i < _items; i++)
{ {
Vector rand = new Vector((Math.random() - 0.5) * 0.525, (Math.random() - 0.5) * 0.525, (Math.random() - 0.5) * 0.525); Vector rand = new Vector((Math.random() - 0.5) * 0.525, (Math.random() - 0.5) * 0.525, (Math.random() - 0.5) * 0.525);
@ -164,7 +173,7 @@ public class PerkZombieBile extends SmashPerk implements IThrown
} }
// Damage Event // Damage Event
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, DAMAGE, true, false, false, UtilEnt.getName(data.getThrower()), GetName()); Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, _damage, true, false, false, UtilEnt.getName(data.getThrower()), GetName());
data.getThrown().remove(); data.getThrown().remove();
} }
@ -189,6 +198,6 @@ public class PerkZombieBile extends SmashPerk implements IThrown
return; return;
} }
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); event.AddKnockback(GetName(), _knockbackMagnitude);
} }
} }

View File

@ -41,10 +41,10 @@ import nautilus.game.arcade.kit.Perk;
public class PerkDeathsGrasp extends Perk public class PerkDeathsGrasp extends Perk
{ {
private Map<UUID, Long> _live = new HashMap<>(); private Map<UUID, Long> _live = new HashMap<>();
private HashMap<LivingEntity, Long> _weakness = new HashMap<LivingEntity, Long>(); private HashMap<LivingEntity, Long> _weakness = new HashMap<>();
private static final long LEAP_DURATION = 1000; private long _leapDuration;
private static final long WEAKNESS_DURATION = 1000; private long _weaknessDuration;
public PerkDeathsGrasp() public PerkDeathsGrasp()
{ {
@ -55,6 +55,13 @@ public class PerkDeathsGrasp extends Perk
}); });
} }
@Override
public void setupValues()
{
_leapDuration = getPerkInt("Leap Duration (ms)");
_weaknessDuration = getPerkInt("Weakness Duration (ms)");
}
@EventHandler @EventHandler
public void leap(PlayerInteractEvent event) public void leap(PlayerInteractEvent event)
{ {
@ -110,7 +117,7 @@ public class PerkDeathsGrasp extends Perk
return; return;
} }
if (UtilEnt.isGrounded(player) && UtilTime.elapsed(e.getValue(), LEAP_DURATION)) if (UtilEnt.isGrounded(player) && UtilTime.elapsed(e.getValue(), _leapDuration))
{ {
it.remove(); it.remove();
return; return;
@ -142,7 +149,7 @@ public class PerkDeathsGrasp extends Perk
continue; continue;
} }
if (!UtilTime.elapsed(_weakness.get(ent), WEAKNESS_DURATION)) if (!UtilTime.elapsed(_weakness.get(ent), _weaknessDuration))
{ {
continue; continue;
} }

View File

@ -51,6 +51,6 @@ public class PerkKnockbackArrow extends Perk
if (!Manager.IsAlive(damager)) if (!Manager.IsAlive(damager))
return; return;
event.AddKnockback("Knockback Arrow", _power); event.AddKnockback(GetName(), _power);
} }
} }

View File

@ -42,24 +42,33 @@ public class PerkLazer extends Perk
{ {
private static final float MAX_CHARGE = 0.99F; private static final float MAX_CHARGE = 0.99F;
private static final float CHARGE_PER_TICK = 0.035F;
private static final float INCREMENTATION = 0.2F; private static final float INCREMENTATION = 0.2F;
private static final float HIT_BOX_RADIUS = 2.5F;
private static final int DAMAGE_RADIUS = 3;
private static final int DAMAGE = 7;
private static final int KNOCKBACK_MAGNITUDE = 3;
private double _range;
private long _recharge; private long _recharge;
private float _chargePerTick;
private float _hitBoxRadius;
private int _damageRadius;
private int _damage;
private int _knockbackMagnitude;
private double _range;
private Set<UUID> _active = new HashSet<>(); private Set<UUID> _active = new HashSet<>();
public PerkLazer(double range, long recharge) public PerkLazer()
{ {
super("Static Laser", new String[] { C.cYellow + "Hold Block" + C.cGray + " with Sword to use " + C.cGreen + "Static Laser" }); super("Static Laser", new String[] { C.cYellow + "Hold Block" + C.cGray + " with Sword to use " + C.cGreen + "Static Laser" });
}
_range = range; @Override
_recharge = recharge; public void setupValues()
{
_recharge = getPerkTime("Cooldown");
_chargePerTick = getPerkFloat("Charge Per Tick");
_hitBoxRadius = getPerkFloat("Hit Box Radius");
_damageRadius = getPerkInt("Damage Radius");
_damage = getPerkInt("Damage");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
_range = getPerkInt("Range");
} }
@EventHandler @EventHandler
@ -122,7 +131,7 @@ public class PerkLazer extends Perk
if (player.isBlocking()) if (player.isBlocking())
{ {
player.setExp(Math.min(MAX_CHARGE, player.getExp() + CHARGE_PER_TICK)); player.setExp(Math.min(MAX_CHARGE, player.getExp() + _chargePerTick));
player.getWorld().playSound(player.getLocation(), Sound.FIZZ, 0.25f + player.getExp(), 0.75f + player.getExp()); player.getWorld().playSound(player.getLocation(), Sound.FIZZ, 0.25f + player.getExp(), 0.75f + player.getExp());
@ -175,7 +184,7 @@ public class PerkLazer extends Perk
particleLoop: while (!lineParticle.update()) particleLoop: while (!lineParticle.update())
{ {
for (Player other : UtilPlayer.getNearby(lineParticle.getLastLocation(), HIT_BOX_RADIUS)) for (Player other : UtilPlayer.getNearby(lineParticle.getLastLocation(), _hitBoxRadius))
{ {
if (player.equals(other)) if (player.equals(other))
{ {
@ -193,7 +202,7 @@ public class PerkLazer extends Perk
// Firework // Firework
UtilFirework.playFirework(target, Type.BURST, Color.YELLOW, false, false); UtilFirework.playFirework(target, Type.BURST, Color.YELLOW, false, false);
for (LivingEntity other : UtilEnt.getInRadius(target, DAMAGE_RADIUS).keySet()) for (LivingEntity other : UtilEnt.getInRadius(target, _damageRadius).keySet())
{ {
if (other.equals(player)) if (other.equals(player))
{ {
@ -201,7 +210,7 @@ public class PerkLazer extends Perk
} }
// Damage Event // Damage Event
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, player.getExp() * DAMAGE, true, true, false, player.getName(), GetName()); Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, player.getExp() * _damage, true, true, false, player.getName(), GetName());
} }
// Inform // Inform
@ -224,7 +233,7 @@ public class PerkLazer extends Perk
return; return;
} }
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); event.AddKnockback(GetName(), _knockbackMagnitude);
} }
public void setWoolColor(Player player, DyeColor color) public void setWoolColor(Player player, DyeColor color)

View File

@ -53,12 +53,12 @@ import nautilus.game.arcade.kit.perks.data.WoolBombData;
public class PerkWoolBomb extends Perk implements IThrown public class PerkWoolBomb extends Perk implements IThrown
{ {
private static final long RATE = 800; private long _cooldown;
private static final long COOLDOWN = 8000; private long _rate;
private static final int DAMAGE_RADIUS = 9; private int _damageRadius;
private static final int DAMAGE_EXPLODE = 14; private int _damageExplode;
private static final int DAMAGE_COLLIDE = 4; private int _damageCollide;
private static final int KNOCKBACK_MAGNITUDE = 2; private int _knockbackMagnitude;
private Map<UUID, Item> _thrown = new HashMap<>(); private Map<UUID, Item> _thrown = new HashMap<>();
private Map<UUID, WoolBombData> _active = new HashMap<>(); private Map<UUID, WoolBombData> _active = new HashMap<>();
@ -68,6 +68,17 @@ public class PerkWoolBomb extends Perk implements IThrown
super("Wool Mine", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Wool Mine" }); super("Wool Mine", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Wool Mine" });
} }
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_rate = getPerkInt("Rate (ms)");
_damageRadius = getPerkInt("Damage Radius");
_damageExplode = getPerkInt("Damage Explode");
_damageCollide = getPerkInt("Damage Collide");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
}
@EventHandler @EventHandler
public void skill(PlayerInteractEvent event) public void skill(PlayerInteractEvent event)
{ {
@ -148,7 +159,7 @@ public class PerkWoolBomb extends Perk implements IThrown
player.getWorld().playSound(player.getLocation(), Sound.SHEEP_IDLE, 2f, 1.5f); player.getWorld().playSound(player.getLocation(), Sound.SHEEP_IDLE, 2f, 1.5f);
// Rate // Rate
Recharge.Instance.useForce(player, GetName() + " Rate", RATE); Recharge.Instance.useForce(player, GetName() + " Rate", _rate);
// Disguise // Disguise
DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player); DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player);
@ -211,7 +222,7 @@ public class PerkWoolBomb extends Perk implements IThrown
thrown.remove(); thrown.remove();
// Rate // Rate
Recharge.Instance.useForce(player, GetName() + " Rate", RATE); Recharge.Instance.useForce(player, GetName() + " Rate", _rate);
// Inform // Inform
if (inform) if (inform)
@ -233,7 +244,7 @@ public class PerkWoolBomb extends Perk implements IThrown
return false; return false;
} }
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true)) if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{ {
return false; return false;
} }
@ -246,7 +257,7 @@ public class PerkWoolBomb extends Perk implements IThrown
data.Block.getWorld().playSound(data.Block.getLocation(), Sound.EXPLODE, 3f, 0.8f); data.Block.getWorld().playSound(data.Block.getLocation(), Sound.EXPLODE, 3f, 0.8f);
// Damage // Damage
Map<LivingEntity, Double> targets = UtilEnt.getInRadius(data.Block.getLocation().add(0.5, 0.5, 0.5), DAMAGE_RADIUS); Map<LivingEntity, Double> targets = UtilEnt.getInRadius(data.Block.getLocation().add(0.5, 0.5, 0.5), _damageRadius);
List<Player> team = TeamSuperSmash.getTeam(Manager, player, false); List<Player> team = TeamSuperSmash.getTeam(Manager, player, false);
for (LivingEntity cur : targets.keySet()) for (LivingEntity cur : targets.keySet())
@ -260,7 +271,7 @@ public class PerkWoolBomb extends Perk implements IThrown
} }
// Damage Event // Damage Event
Manager.GetDamage().NewDamageEvent(cur, player, null, DamageCause.CUSTOM, DAMAGE_EXPLODE * targets.get(cur) + 0.5, false, true, false, player.getName(), GetName()); Manager.GetDamage().NewDamageEvent(cur, player, null, DamageCause.CUSTOM, _damageExplode * targets.get(cur) + 0.5, false, true, false, player.getName(), GetName());
// Condition // Condition
Manager.GetCondition().Factory().Falling(GetName(), cur, player, 10, false, true); Manager.GetCondition().Factory().Falling(GetName(), cur, player, 10, false, true);
@ -277,7 +288,7 @@ public class PerkWoolBomb extends Perk implements IThrown
} }
// Rate // Rate
Recharge.Instance.useForce(player, GetName() + " Rate", RATE); Recharge.Instance.useForce(player, GetName() + " Rate", _rate);
// Inform // Inform
if (inform) if (inform)
@ -327,7 +338,7 @@ public class PerkWoolBomb extends Perk implements IThrown
} }
// Damage Event // Damage Event
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, DAMAGE_COLLIDE, true, true, false, UtilEnt.getName(data.getThrower()), GetName()); Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, _damageCollide, true, true, false, UtilEnt.getName(data.getThrower()), GetName());
} }
@Override @Override
@ -367,7 +378,7 @@ public class PerkWoolBomb extends Perk implements IThrown
WoolBombData data = _active.get(key); WoolBombData data = _active.get(key);
if (UtilTime.elapsed(data.Time, COOLDOWN)) if (UtilTime.elapsed(data.Time, _cooldown))
{ {
detonate.add(player); detonate.add(player);
continue; continue;
@ -400,6 +411,6 @@ public class PerkWoolBomb extends Perk implements IThrown
return; return;
} }
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); event.AddKnockback(GetName(), _knockbackMagnitude);
} }
} }

View File

@ -39,12 +39,12 @@ import nautilus.game.arcade.kit.Perk;
public class PerkWoolCloud extends Perk public class PerkWoolCloud extends Perk
{ {
private static final long COOLDOWN = 10000; private long _cooldown;
private static final long MIN_VELOCITY_TIME = 200; private long _minVelocityTime;
private static final long MAX_VELOCITY_TIME = 1200; private long _maxVelocityTime;
private static final int DAMAGE_RADIUS = 2; private int _damageRadius;
private static final int DAMAGE = 8; private int _damage;
private static final float KNOCKBACK_MAGNITUDE = 2.5F; private float _knockbackMangitude;
private Map<UUID, Long> _active = new HashMap<>(); private Map<UUID, Long> _active = new HashMap<>();
@ -53,6 +53,17 @@ public class PerkWoolCloud extends Perk
super("Wooly Rocket", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Spade to " + C.cGreen + "Wooly Rocket" }); super("Wooly Rocket", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Spade to " + C.cGreen + "Wooly Rocket" });
} }
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_minVelocityTime = getPerkInt("Min Velocity Time (ms)");
_maxVelocityTime = getPerkInt("Max Velocity Time (ms)");
_damageRadius = getPerkInt("Damage Radius");
_damage = getPerkInt("Damage");
_knockbackMangitude = getPerkFloat("Knockback Magnitude");
}
@EventHandler @EventHandler
public void Leap(PlayerInteractEvent event) public void Leap(PlayerInteractEvent event)
{ {
@ -84,7 +95,7 @@ public class PerkWoolCloud extends Perk
} }
// Recharge // Recharge
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true)) if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{ {
return; return;
} }
@ -131,7 +142,7 @@ public class PerkWoolCloud extends Perk
UtilParticle.PlayParticle(ParticleType.FLAME, player.getLocation(), 0.2f, 0.2f, 0.2f, 0, 4, ViewDist.LONGER, UtilServer.getPlayers()); UtilParticle.PlayParticle(ParticleType.FLAME, player.getLocation(), 0.2f, 0.2f, 0.2f, 0, 4, ViewDist.LONGER, UtilServer.getPlayers());
if (!UtilTime.elapsed(_active.get(key), MIN_VELOCITY_TIME)) if (!UtilTime.elapsed(_active.get(key), _minVelocityTime))
{ {
continue; continue;
} }
@ -143,17 +154,17 @@ public class PerkWoolCloud extends Perk
continue; continue;
} }
if (UtilMath.offset(player, other) < DAMAGE_RADIUS) if (UtilMath.offset(player, other) < _damageRadius)
{ {
// Damage Event // Damage Event
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, DAMAGE, true, false, false, player.getName(), GetName()); Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage, true, false, false, player.getName(), GetName());
UtilParticle.PlayParticle(ParticleType.EXPLODE, other.getLocation(), 0f, 0f, 0f, 0, 1, ViewDist.MAX, UtilServer.getPlayers()); UtilParticle.PlayParticle(ParticleType.EXPLODE, other.getLocation(), 0f, 0f, 0f, 0, 1, ViewDist.MAX, UtilServer.getPlayers());
UtilParticle.PlayParticle(ParticleType.LAVA, player.getLocation(), 0.2f, 0.2f, 0.2f, 0, 10, ViewDist.MAX, UtilServer.getPlayers()); UtilParticle.PlayParticle(ParticleType.LAVA, player.getLocation(), 0.2f, 0.2f, 0.2f, 0, 10, ViewDist.MAX, UtilServer.getPlayers());
} }
} }
if (UtilEnt.isGrounded(player) || UtilTime.elapsed(_active.get(key), MAX_VELOCITY_TIME)) if (UtilEnt.isGrounded(player) || UtilTime.elapsed(_active.get(key), _maxVelocityTime))
{ {
playerIterator.remove(); playerIterator.remove();
setWoolColor(player, DyeColor.WHITE); setWoolColor(player, DyeColor.WHITE);
@ -184,6 +195,6 @@ public class PerkWoolCloud extends Perk
return; return;
} }
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); event.AddKnockback(GetName(), _knockbackMangitude);
} }
} }