Spider converted to Google Sheets

This commit is contained in:
Sam 2017-04-22 23:53:01 +01:00
parent 1d7fb77bc4
commit 43d703d9b7
6 changed files with 49 additions and 27 deletions

View File

@ -29,8 +29,8 @@ import java.util.function.Function;
public class SuperSmashTraining extends SuperSmash public class SuperSmashTraining extends SuperSmash
{ {
private static final long GAME_TIME = TimeUnit.MINUTES.toMillis(3); private static final long GAME_TIME = TimeUnit.HOURS.toMillis(3);
private static final long GAME_WARN_TIME = GAME_TIME - TimeUnit.MINUTES.toMillis(1); private static final long GAME_WARN_TIME = GAME_TIME - TimeUnit.MINUTES.toMillis(5);
private static final String[] INFO_HOLOGRAM = { private static final String[] INFO_HOLOGRAM = {
C.cYellow + "Select a " + C.cGreen + "Kit", C.cYellow + "Select a " + C.cGreen + "Kit",
C.cYellow + "Jump off the island to use your abilities", C.cYellow + "Jump off the island to use your abilities",

View File

@ -26,7 +26,7 @@ public class KitSpider extends SmashKit
{ {
private static final Perk[] PERKS = { private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.5, 0.25, 6), new PerkSmashStats(),
new PerkSpiderLeap(), new PerkSpiderLeap(),
new PerkNeedler(), new PerkNeedler(),
new PerkWebShot(), new PerkWebShot(),

View File

@ -31,10 +31,10 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkNeedler extends SmashPerk public class PerkNeedler extends SmashPerk
{ {
private static final int COOLDOWN_NORMAL = 2000; private long _cooldownNormal;
private static final int COOLDOWN_SMASH = 600; private long _cooldownSmash;
private static final float DAMAGE = 1.1F; private double _damage;
private static final int MAX_TICKS = 300; private int _maxTicks;
private Map<UUID, Integer> _active = new HashMap<>(); private Map<UUID, Integer> _active = new HashMap<>();
private Set<Arrow> _arrows = new HashSet<>(); private Set<Arrow> _arrows = new HashSet<>();
@ -44,6 +44,15 @@ public class PerkNeedler extends SmashPerk
super("Needler", new String[] { C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Needler" }); super("Needler", new String[] { C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Needler" });
} }
@Override
public void setupValues()
{
_cooldownNormal = getPerkTime("Cooldown Normal");
_cooldownSmash = getPerkInt("Cooldown Smash (ms)");
_damage = getPerkDouble("Damage");
_maxTicks = getPerkInt("Max Ticks");
}
@EventHandler @EventHandler
public void Activate(PlayerInteractEvent event) public void Activate(PlayerInteractEvent event)
{ {
@ -74,7 +83,7 @@ public class PerkNeedler extends SmashPerk
return; return;
} }
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? COOLDOWN_SMASH : COOLDOWN_NORMAL, !isSuperActive(player), !isSuperActive(player))) if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? _cooldownSmash : _cooldownNormal, !isSuperActive(player), !isSuperActive(player)))
{ {
return; return;
} }
@ -156,7 +165,7 @@ public class PerkNeedler extends SmashPerk
event.GetProjectile().remove(); event.GetProjectile().remove();
// Damage Event // Damage Event
Manager.GetDamage().NewDamageEvent(event.GetDamageeEntity(), damager, null, DamageCause.THORNS, DAMAGE, true, true, false, damager.getName(), GetName()); Manager.GetDamage().NewDamageEvent(event.GetDamageeEntity(), damager, null, DamageCause.THORNS, _damage, true, true, false, damager.getName(), GetName());
if (!isTeamDamage(damager, event.GetDamageePlayer())) if (!isTeamDamage(damager, event.GetDamageePlayer()))
{ {
@ -176,7 +185,7 @@ public class PerkNeedler extends SmashPerk
{ {
Arrow arrow = arrowIterator.next(); Arrow arrow = arrowIterator.next();
if (arrow.isOnGround() || !arrow.isValid() || arrow.getTicksLived() > MAX_TICKS) if (arrow.isOnGround() || !arrow.isValid() || arrow.getTicksLived() > _maxTicks)
{ {
arrowIterator.remove(); arrowIterator.remove();
arrow.remove(); arrow.remove();

View File

@ -26,8 +26,8 @@ import nautilus.game.arcade.kit.Perk;
public class PerkSpiderLeap extends Perk public class PerkSpiderLeap extends Perk
{ {
private static final float ENERGY_PER_TICK = 0.005F; private float _energyTick;
private static final float ENERGY_PER_LEAP = 0.17F; private float _energyJump;
private Set<UUID> _secondJump = new HashSet<>(); private Set<UUID> _secondJump = new HashSet<>();
private Set<UUID> _finalJump = new HashSet<>(); private Set<UUID> _finalJump = new HashSet<>();
@ -38,6 +38,13 @@ public class PerkSpiderLeap extends Perk
+ "Wall Climb requires Energy (Experience Bar)." }); + "Wall Climb requires Energy (Experience Bar)." });
} }
@Override
public void setupValues()
{
_energyTick = getPerkFloat("Energy Per Tick");
_energyJump = getPerkFloat("Energy Per Jump");
}
@EventHandler @EventHandler
public void WallClimb(UpdateEvent event) public void WallClimb(UpdateEvent event)
{ {
@ -62,19 +69,19 @@ public class PerkSpiderLeap extends Perk
_secondJump.remove(player.getUniqueId()); _secondJump.remove(player.getUniqueId());
} }
player.setExp(Math.min(0.999F, player.getExp() + (grounded ? ENERGY_PER_TICK * 2 : ENERGY_PER_TICK))); player.setExp(Math.min(0.999F, player.getExp() + (grounded ? _energyTick * 2 : _energyTick)));
continue; continue;
} }
player.setExp(Math.max(0, player.getExp() - ENERGY_PER_TICK)); player.setExp(Math.max(0, player.getExp() - _energyTick));
if (player.getExp() <= 0) if (player.getExp() <= 0)
{ {
continue; continue;
} }
if (player.getExp() >= ENERGY_PER_LEAP) if (player.getExp() >= _energyJump)
{ {
_finalJump.remove(player.getUniqueId()); _finalJump.remove(player.getUniqueId());
} }
@ -116,7 +123,7 @@ public class PerkSpiderLeap extends Perk
// Disable Flight // Disable Flight
player.setAllowFlight(false); player.setAllowFlight(false);
if (player.getExp() < ENERGY_PER_LEAP) if (player.getExp() < _energyJump)
{ {
if (!_finalJump.contains(player.getUniqueId())) if (!_finalJump.contains(player.getUniqueId()))
{ {
@ -132,7 +139,7 @@ public class PerkSpiderLeap extends Perk
UtilAction.velocity(player, 1.0, 0.2, 1.0, true); UtilAction.velocity(player, 1.0, 0.2, 1.0, true);
// Energy // Energy
player.setExp(Math.max(0, player.getExp() - ENERGY_PER_LEAP)); player.setExp(Math.max(0, player.getExp() - _energyJump));
// Sound // Sound
player.getWorld().playSound(player.getLocation(), Sound.SPIDER_IDLE, 1f, 1.5f); player.getWorld().playSound(player.getLocation(), Sound.SPIDER_IDLE, 1f, 1.5f);

View File

@ -30,15 +30,23 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkWebShot extends SmashPerk implements IThrown public class PerkWebShot extends SmashPerk implements IThrown
{ {
private static final int COOLDOWN_NORMAL = 10000; private int _cooldownNormal = 10000;
private static final int COOLDOWN_SMASH = 1000; private int _cooldownSmash = 1000;
private static final int WEBS = 20; private int _webs = 20;
public PerkWebShot() public PerkWebShot()
{ {
super("Spin Web", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Spin Web" }); super("Spin Web", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Spin Web" });
} }
@Override
public void setupValues()
{
_cooldownNormal = getPerkTime("Cooldown Normal");
_cooldownSmash = getPerkTime("Cooldown Smash");
_webs = getPerkInt("Webs");
}
@EventHandler @EventHandler
public void ShootWeb(PlayerInteractEvent event) public void ShootWeb(PlayerInteractEvent event)
{ {
@ -69,7 +77,7 @@ public class PerkWebShot extends SmashPerk implements IThrown
return; return;
} }
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? COOLDOWN_SMASH : COOLDOWN_NORMAL, !isSuperActive(player), !isSuperActive(player))) if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? _cooldownSmash : _cooldownNormal, !isSuperActive(player), !isSuperActive(player)))
{ {
return; return;
} }
@ -79,7 +87,7 @@ public class PerkWebShot extends SmashPerk implements IThrown
// Boost // Boost
UtilAction.velocity(player, 1.2, 0.2, 1.2, true); UtilAction.velocity(player, 1.2, 0.2, 1.2, true);
for (int i = 0; i < WEBS; i++) for (int i = 0; i < _webs; i++)
{ {
Item ent = player.getWorld().dropItem(player.getLocation().add(0, 0.5, 0), ItemStackFactory.Instance.CreateStack(Material.WEB, (byte) 0, 1, "Web " + player.getName() + " " + i)); Item ent = player.getWorld().dropItem(player.getLocation().add(0, 0.5, 0), ItemStackFactory.Instance.CreateStack(Material.WEB, (byte) 0, 1, "Web " + player.getName() + " " + i));

View File

@ -22,13 +22,11 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashSpider extends SmashUltimate public class SmashSpider extends SmashUltimate
{ {
private static final int DURATION = 30000;
private Map<LivingEntity, Double> _preHealth = new HashMap<>(); private Map<LivingEntity, Double> _preHealth = new HashMap<>();
public SmashSpider() public SmashSpider()
{ {
super("Spider Nest", new String[] {}, Sound.SPIDER_DEATH, DURATION); super("Spider Nest", new String[] {}, Sound.SPIDER_DEATH, 0);
} }
@Override @Override
@ -61,11 +59,11 @@ public class SmashSpider extends SmashUltimate
continue; continue;
} }
Manager.GetBlockRestore().add(block, 30, (byte) 0, (int) (DURATION + 5000 * Math.random())); Manager.GetBlockRestore().add(block, 30, (byte) 0, (int) (getLength() + 5000 * Math.random()));
} }
// Regen // Regen
Manager.GetCondition().Factory().Regen(GetName(), player, player, DURATION / 1000, 2, false, false, false); Manager.GetCondition().Factory().Regen(GetName(), player, player, getLength() / 1000, 2, false, false, false);
} }
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)