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 = {
new PerkSmashStats(6, 1.1, 0.25, 6.5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkCowStampede(),
new PerkCowAngryHerd(),
new PerkCowMilkSpiral(),

View File

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

View File

@ -30,8 +30,8 @@ public class KitMagmaCube extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(5, 1.75, 0.35, 5),
new PerkDoubleJump("Double Jump", 1.2, 1, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkMagmaBoost(),
new PerkMagmaBlast(),
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 Perk[] PERKS = {
new PerkSmashStats(5, 1.5, 0.25, 5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkPigBaconBounce(),
new PerkPigBaconBomb(),
new PerkPigZombie(),

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -37,14 +37,14 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkCowAngryHerd extends SmashPerk
{
private static final int COOLDOWN_NORMAL = 13000;
private static final int COOLDOWN_SMASH = 6000;
private static final int MAX_TIME = 2500;
private static final int STUCK_TIME = 300;
private static final int FORCE_MOVE = 350;
private static final float HIT_BOX_RADIUS = 2.2F;
private static final int HIT_FREQUENCY = 600;
private static final int DAMAGE = 5;
private int _cooldownNormal;
private int _cooldownSmash;
private int _maxTime;
private int _stuckTime;
private int _forceMove;
private float _hitBoxRadius;
private int _hitFrequency;
private int _damage;
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" });
}
@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
public void shoot(PlayerInteractEvent event)
{
@ -83,7 +96,7 @@ public class PerkCowAngryHerd extends SmashPerk
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;
}
@ -129,7 +142,7 @@ public class PerkCowAngryHerd extends SmashPerk
DataCowCharge data = activeIter.next();
// Expire
if (UtilTime.elapsed(data.Time, MAX_TIME))
if (UtilTime.elapsed(data.Time, _maxTime))
{
if (data.Cow.isValid())
{
@ -149,7 +162,7 @@ public class PerkCowAngryHerd extends SmashPerk
}
// Stuck Remove
if (UtilTime.elapsed(data.LastMoveTime, STUCK_TIME))
if (UtilTime.elapsed(data.LastMoveTime, _stuckTime))
{
if (data.Cow.isValid())
{
@ -172,7 +185,7 @@ public class PerkCowAngryHerd extends SmashPerk
}
// 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)));
}
@ -199,12 +212,12 @@ public class PerkCowAngryHerd extends SmashPerk
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
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);

View File

@ -30,10 +30,10 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkCowMilkSpiral extends SmashPerk
{
private static final int COOLDOWN_NORMAL = 11000;
private static final int COOLDOWN_SMASH = 6000;
private static final int HIT_BOX_RADIUS = 2;
private static final int DAMAGE = 6;
private int _cooldownNormal;
private int _cooldownSmash;
private int _hitBoxRadius;
private int _damage;
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" });
}
@Override
public void setupValues()
{
_cooldownNormal = getPerkTime("Cooldown Normal");
_cooldownSmash = getPerkTime("Cooldown Smash");
_hitBoxRadius = getPerkInt("Hit Box Radius");
_damage = getPerkInt("Damage");
}
@EventHandler
public void activate(PlayerInteractEvent event)
{
@ -72,7 +81,7 @@ public class PerkCowMilkSpiral extends SmashPerk
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;
}
@ -109,9 +118,9 @@ public class PerkCowMilkSpiral extends SmashPerk
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,
ViewDist.LONG, UtilServer.getPlayers());

View File

@ -30,6 +30,9 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkCowStampede extends SmashPerk
{
private long _speedTime;
private Map<UUID, Long> _sprintTime = 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.", });
}
@Override
public void setupValues()
{
_speedTime = getPerkTime("Speed Time");
}
@EventHandler
public void update(UpdateEvent event)
{
@ -77,7 +86,7 @@ public class PerkCowStampede extends SmashPerk
}
// Upgrade Speed
if (!UtilTime.elapsed(time, 3000))
if (!UtilTime.elapsed(time, _speedTime))
{
continue;
}

View File

@ -14,13 +14,21 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashCow extends SmashUltimate
{
private static final int DURATION = 30000;
private static final int DAMAGE_BUFF = 1;
private static final int HEALTH = 30;
private int _damageBuff;
private int _health;
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
@ -33,8 +41,8 @@ public class SmashCow extends SmashUltimate
kit.disguise(player, DisguiseMooshroom.class);
// Health
player.setMaxHealth(HEALTH);
player.setHealth(HEALTH);
player.setMaxHealth(_health);
player.setHealth(_health);
// Sound
player.getWorld().playSound(player.getLocation(), Sound.COW_HURT, 5f, 0.25f);
@ -67,7 +75,7 @@ public class SmashCow extends SmashUltimate
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
{
private static final int COOLDOWN = 15000;
private static final int MAX_RANGE = 11;
private static final int MAX_TIME = 8000;
private static final int DAMAGE_INCREASE = 3;
private static final int KNOCKBACK_INCREASE = 1;
private int _cooldown;
private int _maxRange;
private int _maxTime;
private int _damageIncrease;
private int _knockbackIncrease;
private Set<TargetLazerData> _data = new HashSet<>();
@ -49,7 +49,17 @@ public class PerkTargetLazer extends SmashPerk
{
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
public void activate(PlayerInteractEvent event)
{
@ -103,7 +113,7 @@ public class PerkTargetLazer extends SmashPerk
double d = UtilMath.offset(player, other);
if (d > MAX_RANGE)
if (d > _maxRange)
{
continue;
}
@ -121,7 +131,7 @@ public class PerkTargetLazer extends SmashPerk
{
if (data.getAttacker().equals(player))
{
if (data.getTimeElapsed() < MAX_TIME)
if (data.getTimeElapsed() < _maxTime)
{
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());
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;
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())) + ".");
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();
}
@ -219,8 +229,8 @@ public class PerkTargetLazer extends SmashPerk
if (data.getAttacker().equals(damager) && data.getTarget().equals(damagee))
{
event.AddMod(GetName(), DAMAGE_INCREASE);
event.AddKnockback(GetName(), KNOCKBACK_INCREASE);
event.AddMod(GetName(), _damageIncrease);
event.AddKnockback(GetName(), _knockbackIncrease);
data.getAttacker().playEffect(damagee.getLocation().add(0, 0.5, 0), Effect.STEP_SOUND, Material.REDSTONE_BLOCK);
}
}
@ -230,18 +240,8 @@ public class PerkTargetLazer extends SmashPerk
public void death(PlayerDeathEvent event)
{
Player player = event.getEntity();
Iterator<TargetLazerData> iterator = _data.iterator();
while (iterator.hasNext())
{
TargetLazerData data = iterator.next();
if (data.getTarget().equals(player) || data.getAttacker().equals(player))
{
iterator.remove();
}
}
_data.removeIf(data -> data.getTarget().equals(player) || data.getAttacker().equals(player));
}
private void setLazerTarget(Player disguised, Player target)

View File

@ -13,15 +13,23 @@ import nautilus.game.arcade.kit.Perk;
public class PerkThorns extends Perk
{
private static final int MAX_HEALTH = 10;
private static final float DAMAGE_DECREASE = 0.66F;
private static final float KNOCKBACK_DECREASE = 0.66F;
private int _maxHealth;
private double _damageDecrease;
private double _knockbackDecrease;
public PerkThorns()
{
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)
public void damage(CustomDamageEvent event)
{
@ -38,10 +46,10 @@ public class PerkThorns extends Perk
return;
}
if (player.getHealth() < MAX_HEALTH)
if (player.getHealth() < _maxHealth)
{
event.AddMult(GetName(), null, DAMAGE_DECREASE, false);
event.AddKnockback(GetName(), KNOCKBACK_DECREASE);
event.AddMult(GetName(), null, _damageDecrease, false);
event.AddKnockback(GetName(), _knockbackDecrease);
}
}
}

View File

@ -1,13 +1,15 @@
package nautilus.game.arcade.game.games.smash.perks.guardian;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import mineplex.core.common.util.*;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
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;
import org.bukkit.Effect;
import org.bukkit.Sound;
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.util.Vector;
import mineplex.core.common.util.C;
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;
import java.util.*;
public class PerkWaterSplash extends Perk
{
private static final int COOLDOWN = 12000;
private static final int VELOCITY_Y = 1;
private static final int RADIUS = 5;
private static final int MIN_AIR_TIME = 750;
private static final int SECOND_BOOST_TIME = 800;
private static final int DAMAGE = 12;
private int _cooldown;
private float _velocityY;
private int _radius;
private int _minAirTime;
private int _secondBoostTime;
private int _damage;
private Map<UUID, Long> _active = new HashMap<>();
private Set<UUID> _usedSecondBoost = new HashSet<>();
@ -55,7 +38,18 @@ 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" });
}
@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
public void activate(PlayerInteractEvent event)
{
@ -86,16 +80,16 @@ public class PerkWaterSplash extends Perk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
UtilAction.velocity(player, new Vector(0, VELOCITY_Y, 0));
UtilAction.velocity(player, new Vector(0, _velocityY, 0));
_active.put(player.getUniqueId(), System.currentTimeMillis());
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))
{
@ -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);
if (UtilEnt.isGrounded(player) && UtilTime.elapsed(_active.get(uuid), MIN_AIR_TIME))
if (UtilEnt.isGrounded(player) && UtilTime.elapsed(_active.get(uuid), _minAirTime))
{
iterator.remove();
_usedSecondBoost.remove(uuid);
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)
{
@ -163,7 +157,7 @@ public class PerkWaterSplash extends Perk
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);
for (Player other : nearby.keySet())
@ -175,11 +169,11 @@ public class PerkWaterSplash extends Perk
double power = nearby.get(other);
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.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);
}
}
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);

View File

@ -37,11 +37,11 @@ import nautilus.game.arcade.kit.Perk;
public class PerkWhirlpoolBlade extends Perk implements IThrown
{
private static final int COOLDOWN = 5000;
private static final int EXPIRE_TIME = 3000;
private static final float VELOCITY = 1.6F;
private static final float HIT_BOX = 0.5F;
private static final int DAMAGE = 5;
private int _cooldown;
private int _expireTime;
private float _velocity;
private float _hitBox;
private int _damage;
private Set<Item> _items = new HashSet<>();
@ -49,7 +49,17 @@ 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" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_expireTime = getPerkTime("Expire Time");
_velocity = getPerkFloat("Velocity");
_hitBox = getPerkFloat("Hit Box");
_damage = getPerkInt("Damage");
}
@EventHandler
public void activate(PlayerInteractEvent event)
{
@ -80,7 +90,7 @@ public class PerkWhirlpoolBlade extends Perk implements IThrown
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
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.setVelocity(player.getLocation().getDirection().multiply(VELOCITY));
Manager.GetProjectile().AddThrow(item, player, this, EXPIRE_TIME, true, true, true, false, false, HIT_BOX);
item.setVelocity(player.getLocation().getDirection().multiply(_velocity));
Manager.GetProjectile().AddThrow(item, player, this, _expireTime, true, true, true, false, false, _hitBox);
_items.add(item);
}
@ -131,7 +141,7 @@ public class PerkWhirlpoolBlade extends Perk implements IThrown
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())
{
return;

View File

@ -27,16 +27,25 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashGuardian extends SmashUltimate
{
private static final int DURATION = 10000;
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<>();
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
@ -46,7 +55,7 @@ public class SmashGuardian extends SmashUltimate
Manager.GetGame().CreatureAllowOverride = true;
_data.add(new SmashAnimationData(Manager, player, GUARDIANS, DURATION));
_data.add(new SmashAnimationData(Manager, player, GUARDIANS, getLength()));
Manager.GetGame().CreatureAllowOverride = false;
}
@ -64,7 +73,7 @@ public class SmashGuardian extends SmashUltimate
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);
for (Player other : inRadius.keySet())
{
@ -73,11 +82,11 @@ public class SmashGuardian extends SmashUltimate
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());
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);
data.getElder().remove();

View File

@ -35,10 +35,10 @@ import nautilus.game.arcade.kit.perks.data.FireflyData;
public class PerkFlameDash extends Perk
{
private static final int COOLDOWN = 8000;
private static final int TIME = 800;
private static final int DAMAGE_RADIUS = 3;
private static final int KNOCKBACK_MAGNITUDE = 2;
private int _cooldown;
private int _time;
private int _damageRadius;
private int _knockbackMagnitude;
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" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_time = getPerkInt("Time (ms)");
_damageRadius = getPerkInt("Damage Radius");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
}
@EventHandler
public void Skill(PlayerInteractEvent event)
{
@ -96,14 +105,14 @@ public class PerkFlameDash extends Perk
}
else
{
Recharge.Instance.use(player, GetName(), COOLDOWN, true, true);
Recharge.Instance.use(player, GetName(), _cooldown, true, true);
}
return;
}
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));
@ -130,7 +139,7 @@ public class PerkFlameDash extends Perk
FireflyData data = dataIterator.next();
// Move
if (!UtilTime.elapsed(data.Time, TIME))
if (!UtilTime.elapsed(data.Time, _time))
{
Vector vel = data.Location.getDirection();
vel.setY(0);
@ -148,7 +157,7 @@ public class PerkFlameDash extends Perk
// End
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))
{
@ -191,6 +200,6 @@ public class PerkFlameDash extends Perk
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
{
private static final int COOLDOWN = 6000;
private static final float FIREBALL_VELOCITY = 0.2F;
private static final int FIRE_TICKS = 40;
private static final int VELOCITY_RADIUS = 8;
private static final int FIRE_RADIUS = 2;
private static final int DAMAGE = 8;
private int _cooldown = 6000;
private float _velocity = 0.2F;
private int _fireTicks = 40;
private int _velocityRadius = 8;
private int _fireRadius = 2;
private int _damage = 8;
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" });
}
@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
public void Shoot(PlayerInteractEvent event)
{
@ -88,7 +98,7 @@ public class PerkMagmaBlast extends Perk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -103,7 +113,7 @@ public class PerkMagmaBlast extends Perk
ball.setBounce(false);
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();
eFireball.dirX = dir.getX();
@ -168,7 +178,7 @@ public class PerkMagmaBlast extends Perk
Player shooter = (Player) proj.getShooter();
// 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);
for (Player cur : hitMap.keySet())
@ -182,7 +192,7 @@ public class PerkMagmaBlast extends Perk
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
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
{
private static final int MAX_STACKS = 3;
private int _maxStacks;
private Map<UUID, Integer> _kills = new HashMap<>();
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
@ -50,7 +58,7 @@ public class PerkMagmaBoost extends Perk
public void kill(CombatDeathEvent event)
{
Player killed = (Player) event.GetEvent().getEntity();
_kills.remove(killed.getUniqueId());
if (event.GetLog().GetKiller() == null)
@ -80,14 +88,14 @@ public class PerkMagmaBoost extends Perk
size += _kills.get(key);
}
size = Math.min(MAX_STACKS, size);
size = Math.min(_maxStacks, size);
_kills.put(key, size);
slime.SetSize(size + 1);
Manager.GetDisguise().updateDisguise(slime);
killer.setExp(0.99F * (size / (float) MAX_STACKS));
killer.setExp(0.99F * (size / (float) _maxStacks));
}
@EventHandler(priority = EventPriority.HIGHEST)
@ -104,7 +112,7 @@ public class PerkMagmaBoost extends Perk
}
Player damager = event.GetDamagerPlayer(false);
if (damager == null)
{
return;
@ -116,12 +124,12 @@ public class PerkMagmaBoost extends Perk
}
UUID key = damager.getUniqueId();
if (!_kills.containsKey(key))
{
return;
}
event.AddMod(damager.getName(), GetName(), _kills.get(key), false);
}
@ -132,12 +140,12 @@ public class PerkMagmaBoost extends Perk
{
return;
}
if (event.GetCause() != DamageCause.ENTITY_ATTACK)
{
return;
}
Player damagee = event.GetDamageePlayer();
if (damagee == null)

View File

@ -17,9 +17,7 @@ import nautilus.game.arcade.kit.perks.data.MeteorShowerData;
public class SmashMagmacube extends SmashUltimate
{
private static final int DURATION = 12000;
private List<MeteorShowerData> _meteors = new ArrayList<>();
public SmashMagmacube()
@ -30,7 +28,7 @@ public class SmashMagmacube extends SmashUltimate
@Override
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
@ -40,17 +38,7 @@ public class SmashMagmacube extends SmashUltimate
{
return;
}
Iterator<MeteorShowerData> meteorIter = _meteors.iterator();
while (meteorIter.hasNext())
{
MeteorShowerData data = meteorIter.next();
if (data.update())
{
meteorIter.remove();
}
}
_meteors.removeIf(MeteorShowerData::update);
}
}

View File

@ -40,14 +40,14 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkPigBaconBomb extends SmashPerk
{
private static final float ENERGY_PER_PIG = 0.35F;
private static final float ENERGY_PER_PIG_DISGUISED_FACTOR = 0.7F;
private static final int COOLDOWN = 100;
private static final int PIG_MAX_TICKS = 80;
private static final float PIG_SPEED = 1.2F;
private static final int PIG_EXPLODE_RADIUS = 2;
private static final int PIG_EXPLODE_DAMAGE = 4;
private static final int PIG_EXPLODE_DAMAGE_RADIUS = 4;
private float _energyPig;
private float _energyPigDisguiseFactor;
private int _cooldown;
private int _maxTicks;
private float _pigSpeed;
private int _explodeRadius;
private int _explodeDamage;
private int _explodeDamageRadius;
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" });
}
@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
public void Skill(PlayerInteractEvent event)
{
@ -86,13 +99,13 @@ public class PerkPigBaconBomb extends SmashPerk
return;
}
float energy = ENERGY_PER_PIG;
float energy = _energyPig;
DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player);
if (disguise != null && disguise instanceof DisguisePigZombie)
{
energy = energy * ENERGY_PER_PIG_DISGUISED_FACTOR;
energy = energy * _energyPigDisguiseFactor;
}
// Energy
@ -103,7 +116,7 @@ public class PerkPigBaconBomb extends SmashPerk
}
// Recharge
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, false, false))
if (!Recharge.Instance.use(player, GetName(), _cooldown, false, false))
{
return;
}
@ -163,7 +176,7 @@ public class PerkPigBaconBomb extends SmashPerk
{
Pig pig = pigIterator.next();
if (!pig.isValid() || pig.getTicksLived() > PIG_MAX_TICKS)
if (!pig.isValid() || pig.getTicksLived() > _maxTicks)
{
PigExplode(pigIterator, pig, player);
continue;
@ -176,9 +189,9 @@ public class PerkPigBaconBomb extends SmashPerk
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);
}
@ -196,7 +209,7 @@ public class PerkPigBaconBomb extends SmashPerk
pig.getWorld().playSound(pig.getLocation(), Sound.PIG_DEATH, 1f, 2f);
// 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())
{
@ -206,7 +219,7 @@ public class PerkPigBaconBomb extends SmashPerk
}
// 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

View File

@ -40,17 +40,27 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkPigBaconBounce extends SmashPerk implements IThrown
{
private static final float ENERGY_PER_BACON = 0.2F;
private static final float ENERGY_PER_BACON_DISGUISED_FACTOR = 0.7F;
private static final int COOLDOWN = 100;
private static final int HEALTH_PER_BACON = 1;
private static final int BACON_DAMAGE = 4;
private float _energyBacon;
private float _energyBaconDisgtuiseFactor;
private int _cooldown;
private int _healthBacon;
private int _damageBacon;
public PerkPigBaconBounce()
{
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
public void Skill(PlayerInteractEvent event)
{
@ -81,13 +91,13 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
return;
}
float energy = ENERGY_PER_BACON;
float energy = _energyBacon;
DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player);
if (disguise != null && disguise instanceof DisguisePigZombie)
{
energy = energy * ENERGY_PER_BACON_DISGUISED_FACTOR;
energy = energy * _energyBaconDisgtuiseFactor;
}
// Energy
@ -98,7 +108,7 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
}
// Recharge
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, false, false))
if (!Recharge.Instance.use(player, GetName(), _cooldown, false, false))
{
return;
}
@ -130,7 +140,7 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
}
// 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.setItemStack(new ItemStack(Material.GRILLED_PORK));
@ -189,7 +199,7 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
// Heal
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());
}
}

View File

@ -24,7 +24,7 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkPigZombie extends SmashPerk
{
private static final int MIN_HEALTH = 6;
private int _minHealth;
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." });
}
@Override
public void setupValues()
{
_minHealth = getPerkInt("Min Health");
}
@EventHandler
public void Check(UpdateEvent event)
{
@ -86,7 +92,7 @@ public class PerkPigZombie extends SmashPerk
// Not Active
else
{
if (player.getHealth() <= 0 || (!isSuperActive(player) && player.getHealth() > MIN_HEALTH))
if (player.getHealth() <= 0 || (!isSuperActive(player) && player.getHealth() > _minHealth))
{
continue;
}

View File

@ -8,11 +8,9 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashPig extends SmashUltimate
{
private static final int DURATION = 40000;
public SmashPig()
{
super("Pig Stink", new String[] {}, Sound.PIG_IDLE, DURATION);
super("Pig Stink", new String[] {}, Sound.PIG_IDLE, 0);
}
@Override
@ -24,7 +22,7 @@ public class SmashPig extends SmashUltimate
{
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
{
private static final int DAMAGE_RADIUS = 10;
private static final int DAMAGE = 20;
private static final int KNOCKBACK_MAGNITUDE = 3;
private int _damageRadius;
private int _damage;
private int _knockbackMagnitude;
private List<HomingSheepData> _sheep = new ArrayList<>();
@ -37,6 +37,14 @@ public class SmashSheep extends SmashUltimate
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
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);
// 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())
{
@ -101,7 +109,7 @@ public class SmashSheep extends SmashUltimate
}
// 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());
@ -118,6 +126,6 @@ public class SmashSheep extends SmashUltimate
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
{
private static final int COOLDOWN = 24000;
private static final float DAMAGE = 2.6F;
private static final int START_TIME = 2000;
private static final int END_TIME = 6000;
private static final float KNOCKBACK_MAGNITUDE = 1.5F;
private int _cooldown;
private float _damage;
private int _startTime;
private int _endTime;
private float _knockbackMagnitude;
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" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_damage = getPerkFloat("Damage");
_startTime = getPerkTime("Start Time");
_endTime = getPerkTime("End Time");
_knockbackMagnitude = getPerkFloat("Knockback Magnitude");
}
@EventHandler
public void shoot(PlayerInteractEvent event)
{
@ -111,7 +121,7 @@ public class PerkFishFlurry extends SmashPerk implements IThrown
if (!blocks.isEmpty())
{
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
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);
}
if (!UtilTime.elapsed(data.StartTime, START_TIME))
if (!UtilTime.elapsed(data.StartTime, _startTime))
{
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()));
@ -178,7 +188,7 @@ public class PerkFishFlurry extends SmashPerk implements IThrown
if (target != null)
{
// 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());
}
@ -206,7 +216,7 @@ public class PerkFishFlurry extends SmashPerk implements IThrown
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));
}
}

View File

@ -36,19 +36,25 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkInkBlast extends SmashPerk implements IThrown
{
private static final int COOLDOWN = 6000;
private static final float PROJECTILE_VELOCITY = 0.15F;
private static final int KNOCKBACK_MAGNITUDE = 3;
private int _cooldown;
private float _projectileVelocity;
private int _knockbackMagnitude;
private int _bullets;
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" });
}
_bullets = bullets;
_damagePerBullet = damagePerBullet;
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_projectileVelocity = getPerkFloat("Projectile Velocity");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
_bullets = getPerkInt("Bullets");
_damagePerBullet = getPerkInt("Damage Per Bullet");
}
@EventHandler
@ -86,7 +92,7 @@ public class PerkInkBlast extends SmashPerk implements IThrown
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
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);
random.normalize();
random.multiply(PROJECTILE_VELOCITY);
random.multiply(_projectileVelocity);
if (i == 0)
{
@ -164,6 +170,6 @@ public class PerkInkBlast extends SmashPerk implements IThrown
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
{
private static final int COOLDOWN = 8000;
private static final int VELOCITY_TIME = 1100;
private int _cooldown;
private int _velocityTime;
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", });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_velocityTime = getPerkInt("Velocity Time (ms)");
}
@EventHandler
public void Activate(PlayerInteractEvent event)
{
@ -76,7 +83,7 @@ public class PerkSuperSquid extends SmashPerk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -112,7 +119,7 @@ public class PerkSuperSquid extends SmashPerk
continue;
}
if (UtilTime.elapsed(_active.get(cur.getUniqueId()), VELOCITY_TIME))
if (UtilTime.elapsed(_active.get(cur.getUniqueId()), _velocityTime))
{
_active.remove(cur.getUniqueId());
continue;

View File

@ -38,18 +38,29 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashSquid extends SmashUltimate
{
private static final int DURATION = 24000;
private static final int RATE = 1600;
private static final int MAX_RANGE = 100;
private static final int DAMAGE = 16;
private static final int DAMAGE_RADIUS = 8;
private static final int KNOCKBACK_MAGNITUDE = 3;
private int _rate;
private int _maxRange;
private int _damage;
private int _damageRadius;
private int _knockbackMagnitude;
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
public void activate(Player player)
{
@ -98,7 +109,7 @@ public class SmashSquid extends SmashUltimate
return;
}
Block block = UtilPlayer.getTarget(player, UtilBlock.blockAirFoliageSet, MAX_RANGE);
Block block = UtilPlayer.getTarget(player, UtilBlock.blockAirFoliageSet, _maxRange);
if (block == null)
{
@ -107,7 +118,7 @@ public class SmashSquid extends SmashUltimate
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;
}
@ -124,7 +135,7 @@ public class SmashSquid extends SmashUltimate
// Warning
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())
{
@ -134,7 +145,7 @@ public class SmashSquid extends SmashUltimate
}
// 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
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;
}
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.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -36,9 +37,9 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkWitherImage extends SmashPerk
{
private static final int COOLDOWN = 12000;
private static final int SWAP_COOLDOWN = 2000;
private static final int TARGET_RADIUS = 15;
private int _cooldown;
private int _swapCooldown;
private int _targetRadius;
private Map<UUID, Skeleton> _skeletons = new HashMap<>();
@ -48,6 +49,14 @@ public class PerkWitherImage extends SmashPerk
+ "Wither Swap" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_swapCooldown = getPerkTime("Swap Cooldown");
_targetRadius = getPerkInt("Target Radius");
}
@EventHandler
public void activate(PlayerInteractEvent event)
{
@ -85,7 +94,7 @@ public class PerkWitherImage extends SmashPerk
if (!_skeletons.containsKey(player.getUniqueId()))
{
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -101,7 +110,7 @@ public class PerkWitherImage extends SmashPerk
skel.setMaxHealth(20);
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))
{
@ -127,7 +136,7 @@ public class PerkWitherImage extends SmashPerk
_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
player.getWorld().playSound(player.getLocation(), Sound.WITHER_SPAWN, 1f, 1f);
@ -137,7 +146,7 @@ public class PerkWitherImage extends SmashPerk
}
else
{
if (!Recharge.Instance.use(player, "Wither Swap", SWAP_COOLDOWN, true, false))
if (!Recharge.Instance.use(player, "Wither Swap", _swapCooldown, true, false))
{
return;
}

View File

@ -40,10 +40,10 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkWitherSkull extends SmashPerk
{
private static final int COOLDOWN_NORMAL = 6000;
private static final int COOLDOWN_SMASH = 1000;
private static final int DAMAGE = 12;
private static final float KNOCKBACK_MAGNITUDE = 1.5F;
private int _cooldownNormal;
private int _cooldownSmash;
private int _damage;
private float _knockbackMagnitude;
private Map<WitherSkull, Vector> _active = new HashMap<>();
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" });
}
@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
// triggered
public void activate(PlayerInteractEvent event)
@ -88,7 +97,7 @@ public class PerkWitherSkull extends SmashPerk
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;
}
@ -211,7 +220,7 @@ public class PerkWitherSkull extends SmashPerk
}
// 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());
}
}
@ -224,6 +233,6 @@ public class PerkWitherSkull extends SmashPerk
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
{
private static final int DURAITON = 18000;
public SmashWitherSkeleton()
{
super("Wither Form", new String[] {}, Sound.WITHER_SPAWN, DURAITON);
super("Wither Form", new String[] {}, Sound.WITHER_SPAWN, 0);
}
@Override

View File

@ -40,13 +40,17 @@ public class PerkOvercharge extends SmashPerk
private int _tick;
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" });
}
_useExp = useExpBar;
_max = max;
_tick = tick;
@Override
public void setupValues()
{
_max = getPerkInt("Max");
_tick = getPerkInt("Tick");
_useExp = getPerkBoolean("Use Exp");
}
@EventHandler

View File

@ -39,10 +39,10 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkZombieBile extends SmashPerk implements IThrown
{
private static final int COOLDOWN = 10000;
private static final int ITEMS = 3;
private static final int DAMAGE = 3;
private static final int KNOCKBACK_MAGNITUDE = 1;
private int _cooldown;
private int _items;
private int _damage;
private int _knockbackMagnitude;
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" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_items = getPerkInt("Items");
_damage = getPerkInt("Damage");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
}
@EventHandler
public void activate(PlayerInteractEvent event)
{
@ -81,7 +90,7 @@ public class PerkZombieBile extends SmashPerk implements IThrown
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -131,7 +140,7 @@ public class PerkZombieBile extends SmashPerk implements IThrown
}
// 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);
@ -164,7 +173,7 @@ public class PerkZombieBile extends SmashPerk implements IThrown
}
// 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();
}
@ -189,6 +198,6 @@ public class PerkZombieBile extends SmashPerk implements IThrown
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
{
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 static final long WEAKNESS_DURATION = 1000;
private long _leapDuration;
private long _weaknessDuration;
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
public void leap(PlayerInteractEvent event)
{
@ -110,7 +117,7 @@ public class PerkDeathsGrasp extends Perk
return;
}
if (UtilEnt.isGrounded(player) && UtilTime.elapsed(e.getValue(), LEAP_DURATION))
if (UtilEnt.isGrounded(player) && UtilTime.elapsed(e.getValue(), _leapDuration))
{
it.remove();
return;
@ -142,7 +149,7 @@ public class PerkDeathsGrasp extends Perk
continue;
}
if (!UtilTime.elapsed(_weakness.get(ent), WEAKNESS_DURATION))
if (!UtilTime.elapsed(_weakness.get(ent), _weaknessDuration))
{
continue;
}

View File

@ -51,6 +51,6 @@ public class PerkKnockbackArrow extends Perk
if (!Manager.IsAlive(damager))
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 CHARGE_PER_TICK = 0.035F;
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 float _chargePerTick;
private float _hitBoxRadius;
private int _damageRadius;
private int _damage;
private int _knockbackMagnitude;
private double _range;
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" });
}
_range = range;
_recharge = recharge;
@Override
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
@ -122,7 +131,7 @@ public class PerkLazer extends Perk
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());
@ -175,7 +184,7 @@ public class PerkLazer extends Perk
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))
{
@ -193,7 +202,7 @@ public class PerkLazer extends Perk
// Firework
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))
{
@ -201,7 +210,7 @@ public class PerkLazer extends Perk
}
// 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
@ -224,7 +233,7 @@ public class PerkLazer extends Perk
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
public void setWoolColor(Player player, DyeColor color)

View File

@ -52,13 +52,13 @@ import nautilus.game.arcade.kit.perks.data.WoolBombData;
public class PerkWoolBomb extends Perk implements IThrown
{
private static final long RATE = 800;
private static final long COOLDOWN = 8000;
private static final int DAMAGE_RADIUS = 9;
private static final int DAMAGE_EXPLODE = 14;
private static final int DAMAGE_COLLIDE = 4;
private static final int KNOCKBACK_MAGNITUDE = 2;
private long _cooldown;
private long _rate;
private int _damageRadius;
private int _damageExplode;
private int _damageCollide;
private int _knockbackMagnitude;
private Map<UUID, Item> _thrown = 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" });
}
@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
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);
// Rate
Recharge.Instance.useForce(player, GetName() + " Rate", RATE);
Recharge.Instance.useForce(player, GetName() + " Rate", _rate);
// Disguise
DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player);
@ -211,7 +222,7 @@ public class PerkWoolBomb extends Perk implements IThrown
thrown.remove();
// Rate
Recharge.Instance.useForce(player, GetName() + " Rate", RATE);
Recharge.Instance.useForce(player, GetName() + " Rate", _rate);
// Inform
if (inform)
@ -233,7 +244,7 @@ public class PerkWoolBomb extends Perk implements IThrown
return false;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
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);
// 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);
for (LivingEntity cur : targets.keySet())
@ -260,7 +271,7 @@ public class PerkWoolBomb extends Perk implements IThrown
}
// 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
Manager.GetCondition().Factory().Falling(GetName(), cur, player, 10, false, true);
@ -277,7 +288,7 @@ public class PerkWoolBomb extends Perk implements IThrown
}
// Rate
Recharge.Instance.useForce(player, GetName() + " Rate", RATE);
Recharge.Instance.useForce(player, GetName() + " Rate", _rate);
// Inform
if (inform)
@ -327,7 +338,7 @@ public class PerkWoolBomb extends Perk implements IThrown
}
// 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
@ -367,7 +378,7 @@ public class PerkWoolBomb extends Perk implements IThrown
WoolBombData data = _active.get(key);
if (UtilTime.elapsed(data.Time, COOLDOWN))
if (UtilTime.elapsed(data.Time, _cooldown))
{
detonate.add(player);
continue;
@ -400,6 +411,6 @@ public class PerkWoolBomb extends Perk implements IThrown
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
{
private static final long COOLDOWN = 10000;
private static final long MIN_VELOCITY_TIME = 200;
private static final long MAX_VELOCITY_TIME = 1200;
private static final int DAMAGE_RADIUS = 2;
private static final int DAMAGE = 8;
private static final float KNOCKBACK_MAGNITUDE = 2.5F;
private long _cooldown;
private long _minVelocityTime;
private long _maxVelocityTime;
private int _damageRadius;
private int _damage;
private float _knockbackMangitude;
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" });
}
@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
public void Leap(PlayerInteractEvent event)
{
@ -84,7 +95,7 @@ public class PerkWoolCloud extends Perk
}
// Recharge
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
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());
if (!UtilTime.elapsed(_active.get(key), MIN_VELOCITY_TIME))
if (!UtilTime.elapsed(_active.get(key), _minVelocityTime))
{
continue;
}
@ -143,17 +154,17 @@ public class PerkWoolCloud extends Perk
continue;
}
if (UtilMath.offset(player, other) < DAMAGE_RADIUS)
if (UtilMath.offset(player, other) < _damageRadius)
{
// 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.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();
setWoolColor(player, DyeColor.WHITE);
@ -184,6 +195,6 @@ public class PerkWoolCloud extends Perk
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMangitude);
}
}