Blazr converted to Google Sheets

This commit is contained in:
Sam 2017-04-24 23:13:03 +01:00
parent 99fa347cf1
commit f16ea648f9
5 changed files with 92 additions and 55 deletions

View File

@ -29,9 +29,9 @@ import nautilus.game.arcade.kit.perks.PerkSpeed;
public class KitBlaze extends SmashKit public class KitBlaze 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", 1, 1, false), new PerkDoubleJump("Double Jump"),
new PerkKnockbackFire(1.50), new PerkKnockbackFire(),
new PerkSpeed(0), new PerkSpeed(0),
new PerkInferno(), new PerkInferno(),
new PerkFirefly(), new PerkFirefly(),

View File

@ -35,28 +35,44 @@ import nautilus.game.arcade.kit.perks.data.FireflyData;
public class PerkFirefly extends SmashPerk public class PerkFirefly extends SmashPerk
{ {
private static final int COOLDOWN = 12000; private int _cooldown;
private static final int DURATION = 2750; private int _duration ;
private static final int DAMAGE = 7; private int _damage;
private static final int RADIUS_NORMAL = 4; private int _radiusNormal;
private static final float VELOCITY_NORMAL = 0.7F; private float _velocityNormal;
private static final int RADIUS_SMASH = 7; private int _radiusSmash;
private static final float VELOCITY_SMASH = 0.79F; private float _velocitySmash;
private static final int HIT_FREQUENCY = 2000; private int _hitFrequency;
private static final int WARMUP_TIME = 1500; private int _warmupTime;
private static final int MIN_CANCEL_DAMAGE = 4; private int _minCancelDamage;
private static final int KNOCKBACK_MAGNITUDE = 2; private int _knockbackMagnitude;
private Set<FireflyData> _data = new HashSet<FireflyData>(); private Set<FireflyData> _data = new HashSet<>();
private int _tick = 0; private int _tick = 0;
public PerkFirefly() public PerkFirefly()
{ {
super("Firefly", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Firefly" }); super("Firefly", new String[]{C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Firefly"});
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_duration = getPerkInt("Duration (ms)");
_damage = getPerkInt("Damage");
_radiusNormal = getPerkInt("Radius Normal");
_velocityNormal = getPerkFloat("Velocity Normal");
_radiusSmash = getPerkInt("Radius Smash");
_velocitySmash = getPerkFloat("Velocity Smash");
_hitFrequency = getPerkInt("Hit Frequency (ms)");
_warmupTime = getPerkInt("Warmup Time (ms)");
_minCancelDamage = getPerkInt("Cancel Damage");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
} }
@EventHandler @EventHandler
@ -94,7 +110,7 @@ public class PerkFirefly extends SmashPerk
return; return;
} }
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true)) if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{ {
return; return;
} }
@ -142,7 +158,7 @@ public class PerkFirefly extends SmashPerk
} }
// Warmup // Warmup
if (!UtilTime.elapsed(data.Time, WARMUP_TIME) && !superActive) if (!UtilTime.elapsed(data.Time, _warmupTime) && !superActive)
{ {
UtilAction.zeroVelocity(player); UtilAction.zeroVelocity(player);
player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, 0.2f, 0.6f); player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, 0.2f, 0.6f);
@ -151,14 +167,14 @@ public class PerkFirefly extends SmashPerk
// Sound and Effect // Sound and Effect
UtilParticle.PlayParticleToAll(ParticleType.FIREWORKS_SPARK, player.getLocation().add(0, 1, 0), 0.6f, 0.6f, 0.6f, 0, 10, ViewDist.LONG); UtilParticle.PlayParticleToAll(ParticleType.FIREWORKS_SPARK, player.getLocation().add(0, 1, 0), 0.6f, 0.6f, 0.6f, 0, 10, ViewDist.LONG);
float progress = (float) (System.currentTimeMillis() - data.Time) / WARMUP_TIME; float progress = (float) (System.currentTimeMillis() - data.Time) / _warmupTime;
player.getWorld().playSound(player.getLocation(), Sound.BLAZE_BREATH, 0.5f, 1f + progress); player.getWorld().playSound(player.getLocation(), Sound.BLAZE_BREATH, 0.5f, 1f + progress);
} }
// Velocity // Velocity
else if (!UtilTime.elapsed(data.Time, DURATION) || superActive) else if (!UtilTime.elapsed(data.Time, _duration) || superActive)
{ {
UtilAction.velocity(player, player.getLocation().getDirection().multiply(superActive ? VELOCITY_SMASH : VELOCITY_NORMAL).add(new Vector(0, 0.15, 0))); UtilAction.velocity(player, player.getLocation().getDirection().multiply(superActive ? _velocitySmash : _velocityNormal).add(new Vector(0, 0.15, 0)));
player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, 0.6f, 1.2f); player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, 0.6f, 1.2f);
// Sound and Effect // Sound and Effect
@ -176,7 +192,7 @@ public class PerkFirefly extends SmashPerk
player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, 0.75f, 0.75f); player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, 0.75f, 0.75f);
} }
for (Player other : UtilPlayer.getNearby(player.getLocation(), superActive ? RADIUS_SMASH : RADIUS_NORMAL)) for (Player other : UtilPlayer.getNearby(player.getLocation(), superActive ? _radiusSmash : _radiusNormal))
{ {
if (other.equals(player)) if (other.equals(player))
{ {
@ -192,10 +208,10 @@ public class PerkFirefly extends SmashPerk
if (_tick % 12 == 0) if (_tick % 12 == 0)
{ {
if (Recharge.Instance.use(other, GetName() + " hit by " + player.getName(), HIT_FREQUENCY, false, false)) if (Recharge.Instance.use(other, GetName() + " hit by " + player.getName(), _hitFrequency, false, false))
{ {
// Damage Event // Damage Event
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, DAMAGE, true, true, false, player.getName(), skillName); Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage, true, true, false, player.getName(), skillName);
UtilPlayer.message(other, F.main("Game", F.elem(Manager.GetColor(player) + player.getName()) + " hit you with " + F.elem(skillName) + ".")); UtilPlayer.message(other, F.main("Game", F.elem(Manager.GetColor(player) + player.getName()) + " hit you with " + F.elem(skillName) + "."));
} }
@ -212,7 +228,7 @@ public class PerkFirefly extends SmashPerk
@EventHandler @EventHandler
public void FireflyDamage(CustomDamageEvent event) public void FireflyDamage(CustomDamageEvent event)
{ {
if (event.GetDamage() < MIN_CANCEL_DAMAGE) if (event.GetDamage() < _minCancelDamage)
{ {
return; return;
} }
@ -257,6 +273,6 @@ public class PerkFirefly extends SmashPerk
return; return;
} }
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); event.AddKnockback(GetName(), _knockbackMagnitude);
} }
} }

View File

@ -30,13 +30,14 @@ public class PerkInferno extends SmashPerk
{ {
private static final float MAX_ENERGY = 0.999F; private static final float MAX_ENERGY = 0.999F;
private static final float ENERGY_PER_TICK = 0.025F;
private static final float ENERGY_PER_ITEM = 0.035F;
private static final double ITEM_EXPIRE_TIME = 0.7; private float _energyTick = 0.025F;
private static final double ITEM_BURN_TIME = 0.5; private float _energyItem = 0.035F;
private static final double ITEM_DAMAGE = 0.25;
private static final float ITEM_VELOCITY_MAGNITUDE = 1.6F; private double _itemExpireTime = 0.7;
private double _itemBurnTime = 0.5;
private double _itemDamage = 0.25;
private float _itemVelocityMagnitude = 1.6F;
private Map<UUID, Long> _active = new HashMap<>(); private Map<UUID, Long> _active = new HashMap<>();
@ -45,6 +46,17 @@ public class PerkInferno extends SmashPerk
super("Inferno", new String[] { C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Inferno" }); super("Inferno", new String[] { C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Inferno" });
} }
@Override
public void setupValues()
{
_energyTick = getPerkFloat("Energy Tick");
_energyItem = getPerkFloat("Energy Item");
_itemExpireTime = getPerkDouble("Expire Time");
_itemBurnTime = getPerkDouble("Burn Time");
_itemDamage = getPerkDouble("Damage");
_itemVelocityMagnitude = getPerkFloat("Velocity Magnitude");
}
@EventHandler @EventHandler
public void EnergyUpdate(UpdateEvent event) public void EnergyUpdate(UpdateEvent event)
{ {
@ -62,7 +74,7 @@ public class PerkInferno extends SmashPerk
if (!player.isBlocking()) if (!player.isBlocking())
{ {
player.setExp(Math.min(MAX_ENERGY, player.getExp() + ENERGY_PER_TICK)); player.setExp(Math.min(MAX_ENERGY, player.getExp() + _energyTick));
} }
} }
} }
@ -130,7 +142,7 @@ public class PerkInferno extends SmashPerk
continue; continue;
} }
cur.setExp(cur.getExp() - ENERGY_PER_ITEM); cur.setExp(cur.getExp() - _energyItem);
if (cur.getExp() <= 0) if (cur.getExp() <= 0)
{ {
@ -140,10 +152,10 @@ public class PerkInferno extends SmashPerk
// Fire // Fire
Item fire = cur.getWorld().dropItem(cur.getEyeLocation(), new ItemStack(Material.BLAZE_POWDER)); Item fire = cur.getWorld().dropItem(cur.getEyeLocation(), new ItemStack(Material.BLAZE_POWDER));
Manager.GetFire().Add(fire, cur, ITEM_EXPIRE_TIME, 0, ITEM_BURN_TIME, ITEM_DAMAGE, GetName(), false); Manager.GetFire().Add(fire, cur, _itemExpireTime, 0, _itemBurnTime, _itemDamage, GetName(), false);
fire.teleport(cur.getEyeLocation()); fire.teleport(cur.getEyeLocation());
fire.setVelocity(cur.getLocation().getDirection().add(getRandomVector()).multiply(ITEM_VELOCITY_MAGNITUDE)); fire.setVelocity(cur.getLocation().getDirection().add(getRandomVector()).multiply(_itemVelocityMagnitude));
// Effect // Effect
cur.getWorld().playSound(cur.getLocation(), Sound.GHAST_FIREBALL, 0.1f, 1f); cur.getWorld().playSound(cur.getLocation(), Sound.GHAST_FIREBALL, 0.1f, 1f);

View File

@ -10,11 +10,9 @@ import nautilus.game.arcade.kit.Perk;
public class SmashBlaze extends SmashUltimate public class SmashBlaze extends SmashUltimate
{ {
private static final int DURATION = 18000;
public SmashBlaze() public SmashBlaze()
{ {
super("Phoenix", new String[] {}, Sound.BLAZE_DEATH, DURATION); super("Phoenix", new String[] {}, Sound.BLAZE_DEATH, 0);
} }
@Override @Override

View File

@ -12,6 +12,11 @@ public class PerkKnockbackFire extends Perk
{ {
private double _power; private double _power;
public PerkKnockbackFire()
{
this(0);
}
public PerkKnockbackFire(double power) public PerkKnockbackFire(double power)
{ {
super("Flaming Knockback", new String[] super("Flaming Knockback", new String[]
@ -22,6 +27,12 @@ public class PerkKnockbackFire extends Perk
_power = power; _power = power;
} }
@Override
public void setupValues()
{
_power = getPerkDouble("Power");
}
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void Knockback(CustomDamageEvent event) public void Knockback(CustomDamageEvent event)
{ {