Enderman converted to Google Sheets
This commit is contained in:
parent
24b73d27e7
commit
9e6ab9a696
@ -36,9 +36,9 @@ public class KitEnderman extends SmashKit
|
||||
{
|
||||
|
||||
private static final Perk[] PERKS = {
|
||||
new PerkSmashStats(7, 1.3, 0.25, 6),
|
||||
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
|
||||
new PerkBlink("Blink", 16, 6000),
|
||||
new PerkSmashStats(),
|
||||
new PerkDoubleJump("Double Jump"),
|
||||
new PerkBlink("Blink"),
|
||||
new PerkBlockToss(),
|
||||
new PerkEndermanTeleport(),
|
||||
new SmashEnderman()
|
||||
|
@ -24,12 +24,17 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
|
||||
public class PerkBlink extends SmashPerk
|
||||
{
|
||||
|
||||
private static final float INCREMENTAITON = 0.2F;
|
||||
private static final float INCREMENTATION = 0.2F;
|
||||
|
||||
private String _name;
|
||||
private double _range;
|
||||
private int _recharge;
|
||||
|
||||
public PerkBlink(String name)
|
||||
{
|
||||
this(name, 0, 0);
|
||||
}
|
||||
|
||||
public PerkBlink(String name, double range, int recharge)
|
||||
{
|
||||
super(name, new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + name });
|
||||
@ -39,6 +44,13 @@ public class PerkBlink extends SmashPerk
|
||||
_recharge = recharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupValues()
|
||||
{
|
||||
_range = getPerkDouble("Range");
|
||||
_recharge = getPerkTime("Cooldown");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Blink(PlayerInteractEvent event)
|
||||
{
|
||||
@ -79,7 +91,7 @@ public class PerkBlink extends SmashPerk
|
||||
return;
|
||||
}
|
||||
|
||||
LineParticle lineParticle = new LineParticle(player.getEyeLocation(), player.getLocation().getDirection(), INCREMENTAITON, _range, null, ParticleType.SMOKE, UtilServer.getPlayers());
|
||||
LineParticle lineParticle = new LineParticle(player.getEyeLocation(), player.getLocation().getDirection(), INCREMENTATION, _range, null, ParticleType.SMOKE, UtilServer.getPlayers());
|
||||
|
||||
while (!lineParticle.update())
|
||||
{
|
||||
|
@ -42,10 +42,10 @@ import nautilus.game.arcade.kit.perks.event.PerkBlockThrowEvent;
|
||||
public class PerkBlockToss extends SmashPerk implements IThrown
|
||||
{
|
||||
|
||||
private static final int COOLDOWN = 2000;
|
||||
private static final int CHARGE_TIME = 1200;
|
||||
private static final int DAMAGE = 9;
|
||||
private static final float KNOCKBACK_MAGNITUDE = 2.5F;
|
||||
private int _cooldown;
|
||||
private int _chargeTime;
|
||||
private int _damage;
|
||||
private float _knockbackMagnitude;
|
||||
|
||||
private Map<UUID, BlockTossData> _hold = new HashMap<>();
|
||||
private Set<UUID> _charged = new HashSet<>();
|
||||
@ -56,6 +56,15 @@ public class PerkBlockToss extends SmashPerk implements IThrown
|
||||
super("Block Toss", new String[] { C.cYellow + "Hold Block" + C.cGray + " to " + C.cGreen + "Grab Block", C.cYellow + "Release Block" + C.cGray + " to " + C.cGreen + "Throw Block" });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupValues()
|
||||
{
|
||||
_cooldown = getPerkTime("Cooldown");
|
||||
_chargeTime = getPerkInt("Charge Time (ms)");
|
||||
_damage = getPerkInt("Damage");
|
||||
_knockbackMagnitude = getPerkFloat("Knockback Magnitude");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Grab(PlayerInteractEvent event)
|
||||
{
|
||||
@ -154,7 +163,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
|
||||
// Charged Tick
|
||||
if (!_charged.contains(key))
|
||||
{
|
||||
if (System.currentTimeMillis() - _hold.get(key).Time > CHARGE_TIME)
|
||||
if (System.currentTimeMillis() - _hold.get(key).Time > _chargeTime)
|
||||
{
|
||||
_charged.add(key);
|
||||
player.getWorld().playEffect(player.getLocation(), Effect.CLICK1, 0);
|
||||
@ -167,7 +176,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
|
||||
UUID key = cur.getUniqueId();
|
||||
|
||||
Recharge.Instance.recharge(cur, GetName());
|
||||
Recharge.Instance.use(cur, GetName(), COOLDOWN, false, true);
|
||||
Recharge.Instance.use(cur, GetName(), _cooldown, false, true);
|
||||
|
||||
BlockTossData data = _hold.remove(key);
|
||||
|
||||
@ -180,7 +189,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
|
||||
long charge = System.currentTimeMillis() - data.Time;
|
||||
|
||||
// Throw
|
||||
double mult = Math.min(1.4, 1.4 * ((double) charge / CHARGE_TIME));
|
||||
double mult = Math.min(1.4, 1.4 * ((double) charge / _chargeTime));
|
||||
|
||||
// Action
|
||||
UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0.2, 0, 1, true);
|
||||
@ -201,7 +210,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
|
||||
}
|
||||
|
||||
// Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, data.getThrown().getVelocity().length() * DAMAGE, true, true, false, UtilEnt.getName(data
|
||||
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, data.getThrown().getVelocity().length() * _damage, true, true, false, UtilEnt.getName(data
|
||||
.getThrower()), GetName());
|
||||
|
||||
// Block to Item
|
||||
@ -260,6 +269,6 @@ public class PerkBlockToss extends SmashPerk implements IThrown
|
||||
return;
|
||||
}
|
||||
|
||||
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
|
||||
event.AddKnockback(GetName(), _knockbackMagnitude);
|
||||
}
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
|
||||
public class PerkEndermanTeleport extends SmashPerk
|
||||
{
|
||||
|
||||
private static final int COOLDOWN = 5000;
|
||||
private static final float CHARGE_PER_TICK = 0.015F;
|
||||
private int _cooldown = 5000;
|
||||
private float _chargeTick = 0.015F;
|
||||
|
||||
private Map<UUID, Block> _target = new HashMap<>();
|
||||
private Map<UUID, Float> _charge = new HashMap<>();
|
||||
@ -39,6 +39,13 @@ public class PerkEndermanTeleport extends SmashPerk
|
||||
super("Teleport", new String[] { C.cYellow + "Hold Sneak" + C.cGray + " to " + C.cGreen + "Teleport" });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupValues()
|
||||
{
|
||||
_cooldown = getPerkTime("Cooldown");
|
||||
_chargeTick = getPerkFloat("Charge Per Tick");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void update(UpdateEvent event)
|
||||
{
|
||||
@ -86,14 +93,14 @@ public class PerkEndermanTeleport extends SmashPerk
|
||||
// Same Block - Increase Charge
|
||||
else if (block.equals(_target.get(key)))
|
||||
{
|
||||
_charge.put(key, _charge.get(key) + CHARGE_PER_TICK);
|
||||
_charge.put(key, _charge.get(key) + _chargeTick);
|
||||
|
||||
UtilTextMiddle.display(null, UtilTextMiddle.progress(_charge.get(key)), 0, 10, 10, player);
|
||||
|
||||
if (_charge.get(key) >= 1)
|
||||
{
|
||||
UtilTextMiddle.display(null, C.cGreen + "Teleported", 0, 10, 10, player);
|
||||
Recharge.Instance.useForce(player, GetName(), COOLDOWN);
|
||||
Recharge.Instance.useForce(player, GetName(), _cooldown);
|
||||
|
||||
while (block.getRelative(BlockFace.UP).getType() != Material.AIR)
|
||||
{
|
||||
|
@ -33,18 +33,29 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
|
||||
public class SmashEnderman extends SmashUltimate
|
||||
{
|
||||
|
||||
private static final int DURATION = 30000;
|
||||
private static final int DRAGON_VELOCITY_MAGNITUDE = 40;
|
||||
private static final int HIT_COOLDOWN = 1000;
|
||||
private static final int DAMAGE_RADIUS = 6;
|
||||
private static final int DAMAGE = 20;
|
||||
private static final int KNOCKBACK_MAGNITUDE = 4;
|
||||
private int _dragonVelocity;
|
||||
private int _hitCooldown;
|
||||
private int _damageRadius;
|
||||
private int _damage;
|
||||
private int _knockbackMagnitude;
|
||||
|
||||
private Map<UUID, EnderDragon> _dragons = new HashMap<>();
|
||||
|
||||
public SmashEnderman()
|
||||
{
|
||||
super("Ender Dragon", new String[] {}, Sound.ENDERDRAGON_GROWL, DURATION);
|
||||
super("Ender Dragon", new String[] {}, Sound.ENDERDRAGON_GROWL, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupValues()
|
||||
{
|
||||
super.setupValues();
|
||||
|
||||
_dragonVelocity = getPerkInt("Dragon Velocity");
|
||||
_hitCooldown = getPerkTime("Hit Cooldown");
|
||||
_damageRadius = getPerkInt("Damage Radius");
|
||||
_damage = getPerkInt("Damage");
|
||||
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -105,7 +116,7 @@ public class SmashEnderman extends SmashUltimate
|
||||
}
|
||||
|
||||
// Move
|
||||
Location target = player.getLocation().add(player.getLocation().getDirection().multiply(DRAGON_VELOCITY_MAGNITUDE));
|
||||
Location target = player.getLocation().add(player.getLocation().getDirection().multiply(_dragonVelocity));
|
||||
((CraftEnderDragon) dragon).getHandle().setTargetBlock(target.getBlockX(), target.getBlockY(), target.getBlockZ());
|
||||
}
|
||||
}
|
||||
@ -179,10 +190,10 @@ public class SmashEnderman extends SmashUltimate
|
||||
continue;
|
||||
}
|
||||
|
||||
if (UtilMath.offset(dragon.getLocation().add(0, 4, 0), other.getLocation()) < DAMAGE_RADIUS && Recharge.Instance.use(other, "Hit By Dragon", HIT_COOLDOWN, false, false))
|
||||
if (UtilMath.offset(dragon.getLocation().add(0, 4, 0), other.getLocation()) < _damageRadius && Recharge.Instance.use(other, "Hit By Dragon", _hitCooldown, false, false))
|
||||
{
|
||||
// Damage Event
|
||||
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, DAMAGE, true, true, false, player.getName(), GetName());
|
||||
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage, true, true, false, player.getName(), GetName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -196,7 +207,7 @@ public class SmashEnderman extends SmashUltimate
|
||||
return;
|
||||
}
|
||||
|
||||
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
|
||||
event.AddKnockback(GetName(), _knockbackMagnitude);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
|
Loading…
Reference in New Issue
Block a user