Witch converted to Google Sheets

This commit is contained in:
Sam 2017-04-25 18:20:34 +01:00
parent 044a3754cf
commit af25aa0b00
4 changed files with 78 additions and 43 deletions

View File

@ -25,8 +25,8 @@ public class KitWitch extends SmashKit
{ {
private static final Perk[] PERKS = { private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.5, 0.3, 5), new PerkSmashStats(),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false), new PerkDoubleJump("Double Jump"),
new PerkWitchPotion(), new PerkWitchPotion(),
new PerkBatWave(), new PerkBatWave(),
new SmashWitch() new SmashWitch()

View File

@ -44,14 +44,15 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkBatWave extends SmashPerk public class PerkBatWave extends SmashPerk
{ {
private static final int COOLDOWN = 8000;
private static final int LEASH_COOLDOWN = 500; private static final int LEASH_COOLDOWN = 500;
private static final int HIT_COOLDOWN = 200;
private static final int HIT_BOX = 2; private int _cooldown;
private static final int DAMAGE = 3; private int _hitCooldown;
private static final int DISABLE_DAMAGE = 20; private int _hitBox;
private static final float KNOCKBACK_MAGNITUDE = 1.75F; private int _damage;
private int _disableDamage;
private float _knockbackMagnitude;
private static final String LEASH = "Leash Bats"; private static final String LEASH = "Leash Bats";
private static final String HIT = "Hit By Bat"; private static final String HIT = "Hit By Bat";
@ -69,6 +70,17 @@ public class PerkBatWave extends SmashPerk
+ C.cGreen + "Bat Leash" }); + C.cGreen + "Bat Leash" });
} }
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_hitCooldown = getPerkInt("Hit Cooldown (ms)");
_hitBox = getPerkInt("Hit Box");
_damage = getPerkInt("Damage");
_disableDamage = getPerkInt("Disable Damage");
_knockbackMagnitude = getPerkFloat("Knockback Magnitude");
}
@EventHandler @EventHandler
public void Activate(PlayerInteractEvent event) public void Activate(PlayerInteractEvent event)
{ {
@ -106,7 +118,7 @@ public class PerkBatWave extends SmashPerk
UUID key = player.getUniqueId(); UUID key = player.getUniqueId();
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, false, true)) if (!Recharge.Instance.use(player, GetName(), _cooldown, false, true))
{ {
if (_active.containsKey(key)) if (_active.containsKey(key))
{ {
@ -138,7 +150,7 @@ public class PerkBatWave extends SmashPerk
else else
{ {
// Inform // Inform
Recharge.Instance.use(player, GetName(), COOLDOWN, true, true); Recharge.Instance.use(player, GetName(), _cooldown, true, true);
} }
} }
else else
@ -219,10 +231,10 @@ public class PerkBatWave extends SmashPerk
continue; continue;
} }
if (UtilEnt.hitBox(bat.getLocation(), other, HIT_BOX, null)) if (UtilEnt.hitBox(bat.getLocation(), other, _hitBox, null))
{ {
// Damage Event // Damage Event
Manager.GetDamage().NewDamageEvent(other, cur, null, DamageCause.CUSTOM, DAMAGE, true, true, false, cur.getName(), GetName()); Manager.GetDamage().NewDamageEvent(other, cur, null, DamageCause.CUSTOM, _damage, true, true, false, cur.getName(), GetName());
// Effect // Effect
bat.getWorld().playSound(bat.getLocation(), Sound.BAT_HURT, 1f, 1f); bat.getWorld().playSound(bat.getLocation(), Sound.BAT_HURT, 1f, 1f);
@ -231,7 +243,7 @@ public class PerkBatWave extends SmashPerk
bat.remove(); bat.remove();
// Recharge on hit // Recharge on hit
Recharge.Instance.useForce(other, HIT, HIT_COOLDOWN); Recharge.Instance.useForce(other, HIT, _hitCooldown);
} }
} }
} }
@ -299,7 +311,7 @@ public class PerkBatWave extends SmashPerk
{ {
_damageTaken.put(key, (_damageTaken.get(key) + event.GetDamage())); _damageTaken.put(key, (_damageTaken.get(key) + event.GetDamage()));
if (_damageTaken.get(key) >= DISABLE_DAMAGE) if (_damageTaken.get(key) >= _disableDamage)
{ {
Clear(player); Clear(player);
} }
@ -311,6 +323,6 @@ public class PerkBatWave extends SmashPerk
return; return;
} }
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); event.AddKnockback(GetName(), _knockbackMagnitude);
} }
} }

View File

@ -40,11 +40,11 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkWitchPotion extends SmashPerk implements IThrown public class PerkWitchPotion extends SmashPerk implements IThrown
{ {
private static final int COOLDOWN = 2000; private int _cooldown;
private static final int RANGE_NOMRAL = 3; private int _range;
private static final int DAMAGE_DIRECT = 7; private int _damageDirect;
private static final int DAMAGE_DISTANCE = 6; private int _damageDistance;
private static final int KNOCKBACK_MAGNITUDE = 2; private int _knockbackMagnitude;
private List<Projectile> _proj = new ArrayList<>(); private List<Projectile> _proj = new ArrayList<>();
@ -53,6 +53,16 @@ public class PerkWitchPotion extends SmashPerk implements IThrown
super("Daze Potion", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Daze Potion" }); super("Daze Potion", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Daze Potion" });
} }
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_range = getPerkInt( "Range");
_damageDirect = getPerkInt("Damage Direct");
_damageDistance = getPerkInt("Damage Distance");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
}
@EventHandler @EventHandler
public void Activate(PlayerInteractEvent event) public void Activate(PlayerInteractEvent event)
{ {
@ -88,7 +98,7 @@ public class PerkWitchPotion 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;
} }
@ -137,7 +147,7 @@ public class PerkWitchPotion extends SmashPerk implements IThrown
return; return;
} }
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); event.AddKnockback(GetName(), _knockbackMagnitude);
} }
@Override @Override
@ -153,18 +163,18 @@ public class PerkWitchPotion extends SmashPerk implements IThrown
for (Player player : directHit) for (Player player : directHit)
{ {
Manager.GetDamage().NewDamageEvent(player, thrower, null, DamageCause.CUSTOM, DAMAGE_DIRECT, true, true, false, thrower.getName(), GetName()); Manager.GetDamage().NewDamageEvent(player, thrower, null, DamageCause.CUSTOM, _damageDirect, true, true, false, thrower.getName(), GetName());
} }
players.removeAll(directHit); players.removeAll(directHit);
Vector a = data.getThrown().getLocation().subtract(RANGE_NOMRAL, RANGE_NOMRAL, RANGE_NOMRAL).toVector(); Vector a = data.getThrown().getLocation().subtract(_range, _range, _range).toVector();
Vector b = data.getThrown().getLocation().add(RANGE_NOMRAL, RANGE_NOMRAL, RANGE_NOMRAL).toVector(); Vector b = data.getThrown().getLocation().add(_range, _range, _range).toVector();
for (Player player : players) for (Player player : players)
{ {
if(!UtilEnt.isInsideBoundingBox(player, a, b)) continue; if(!UtilEnt.isInsideBoundingBox(player, a, b)) continue;
Manager.GetDamage().NewDamageEvent(player, thrower, null, DamageCause.CUSTOM, DAMAGE_DISTANCE, true, true, false, thrower.getName(), GetName()); Manager.GetDamage().NewDamageEvent(player, thrower, null, DamageCause.CUSTOM, _damageDistance, true, true, false, thrower.getName(), GetName());
} }
} }

View File

@ -43,20 +43,33 @@ import nautilus.game.arcade.kit.perks.data.SonicBoomData;
public class SmashWitch extends SmashUltimate public class SmashWitch extends SmashUltimate
{ {
private static final int DURATION = 20000; private int _cooldown;
private static final int COOLDOWN = 1200; private int _maxTime;
private static final int MAX_TIME = 12000; private int _hitBox;
private static final int HIT_BOX = 4; private int _damageRadius;
private static final int DAMAGE_RADIUS = 10; private int _damage;
private static final int DAMAGE = 12; private int _flapCooldown;
private static final int FLAP_COOLDOWN = 40; private int _knockbackMagnitude;
private static final int KNOCKBACK_MAGNITUDE = 2;
private List<SonicBoomData> _sonic = new ArrayList<>(); private List<SonicBoomData> _sonic = new ArrayList<>();
public SmashWitch() public SmashWitch()
{ {
super("Bat Form", new String[] {}, Sound.BAT_HURT, DURATION); super("Bat Form", new String[] {}, Sound.BAT_HURT, 0);
}
@Override
public void setupValues()
{
super.setupValues();
_cooldown = getPerkInt("Cooldown (ms)");
_maxTime = getPerkTime("Max Time");
_hitBox = getPerkInt("Hit Box");
_damageRadius = getPerkInt("Damage Radius");
_damage = getPerkInt("Damage");
_flapCooldown = getPerkInt("Flap Cooldown (ms)");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
} }
@Override @Override
@ -148,7 +161,7 @@ public class SmashWitch extends SmashUltimate
return; return;
} }
if (!Recharge.Instance.use(player, GetName() + " Screech", COOLDOWN, false, false)) if (!Recharge.Instance.use(player, GetName() + " Screech", _cooldown, false, false))
{ {
return; return;
} }
@ -174,7 +187,7 @@ public class SmashWitch extends SmashUltimate
SonicBoomData data = sonicIter.next(); SonicBoomData data = sonicIter.next();
// Time Boom // Time Boom
if (UtilTime.elapsed(data.Time, MAX_TIME)) if (UtilTime.elapsed(data.Time, _maxTime))
{ {
sonicIter.remove(); sonicIter.remove();
explode(data); explode(data);
@ -202,7 +215,7 @@ public class SmashWitch extends SmashUltimate
continue; continue;
} }
if (UtilMath.offset(player.getLocation().add(0, 1, 0), data.Location) < HIT_BOX) if (UtilMath.offset(player.getLocation().add(0, 1, 0), data.Location) < _hitBox)
{ {
sonicIter.remove(); sonicIter.remove();
explode(data); explode(data);
@ -226,7 +239,7 @@ public class SmashWitch extends SmashUltimate
data.Location.getWorld().playSound(data.Location, Sound.EXPLODE, 1f, 1.5f); data.Location.getWorld().playSound(data.Location, Sound.EXPLODE, 1f, 1.5f);
// Damage // Damage
Map<LivingEntity, Double> targets = UtilEnt.getInRadius(data.Location, DAMAGE_RADIUS); Map<LivingEntity, Double> targets = UtilEnt.getInRadius(data.Location, _damageRadius);
for (LivingEntity cur : targets.keySet()) for (LivingEntity cur : targets.keySet())
{ {
@ -235,7 +248,7 @@ public class SmashWitch extends SmashUltimate
continue; continue;
} }
Manager.GetDamage().NewDamageEvent(cur, data.Shooter, null, DamageCause.CUSTOM, DAMAGE * targets.get(cur) + 0.5, true, false, false, data.Shooter.getName(), GetName()); Manager.GetDamage().NewDamageEvent(cur, data.Shooter, null, DamageCause.CUSTOM, _damage * targets.get(cur) + 0.5, true, false, false, data.Shooter.getName(), GetName());
} }
} }
@ -272,7 +285,7 @@ public class SmashWitch extends SmashUltimate
player.getWorld().playSound(player.getLocation(), Sound.BAT_TAKEOFF, (float) (0.3 + player.getExp()), (float) (Math.random() / 2 + 0.5)); player.getWorld().playSound(player.getLocation(), Sound.BAT_TAKEOFF, (float) (0.3 + player.getExp()), (float) (Math.random() / 2 + 0.5));
// Set Recharge // Set Recharge
Recharge.Instance.use(player, GetName() + " Flap", FLAP_COOLDOWN, false, false); Recharge.Instance.use(player, GetName() + " Flap", _flapCooldown, false, false);
} }
@EventHandler @EventHandler
@ -316,6 +329,6 @@ public class SmashWitch extends SmashUltimate
return; return;
} }
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE); event.AddKnockback(GetName(), _knockbackMagnitude);
} }
} }