Slime converted to Google Sheets

This commit is contained in:
Sam 2017-04-23 14:37:29 +01:00
parent 43d703d9b7
commit f1b45bc29e
4 changed files with 70 additions and 53 deletions

View File

@ -25,8 +25,8 @@ public class KitSlime extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.75, 0.35, 3),
new PerkDoubleJump("Double Jump", 1.2, 1, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkSlimeSlam(),
new PerkSlimeRocket(),
new SmashSlime()

View File

@ -43,11 +43,11 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkSlimeRocket extends SmashPerk implements IThrown
{
private static final int COOLDOWN = 6000;
private static final float ENERGY_PER_TICK = 0.004F;
private static final int KNOCKBACK_MAGNITUDE = 3;
private static final int MAX_ENERGY_TIME = 3000;
private static final int MAX_HOLD_TIME = 5000;
private int _cooldown = 6000;
private float _energyTick = 0.004F;
private int _knockbackMagnitude = 3;
private int _maxEnergyTime = 3000;
private int _maxHoldTime = 5000;
private Map<UUID, Long> _charge = new HashMap<>();
private Map<Slime, UUID> _owner = new HashMap<>();
@ -58,6 +58,16 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
super("Slime Rocket", new String[] { C.cYellow + "Hold/Release Block" + C.cGray + " to use " + C.cGreen + "Slime Rocket" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_energyTick = getPerkFloat("Energy Per Tick");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
_maxEnergyTime = getPerkTime("Max Energy Time");
_maxHoldTime = getPerkTime("Max Hold Time");
}
@EventHandler
public void EnergyUpdate(UpdateEvent event)
{
@ -101,7 +111,7 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
continue;
}
player.setExp((float) Math.min(0.999, player.getExp() + ENERGY_PER_TICK));
player.setExp((float) Math.min(0.999, player.getExp() + _energyTick));
}
}
@ -140,7 +150,7 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -187,13 +197,13 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
double elapsed = Math.min(3, (double) (System.currentTimeMillis() - time) / 1000d);
// Use Energy
if (!UtilTime.elapsed(time, MAX_ENERGY_TIME))
if (!UtilTime.elapsed(time, _maxEnergyTime))
{
player.setExp((float) Math.max(0, player.getExp() - 0.01f));
}
// AutoFire
if (UtilTime.elapsed(time, MAX_HOLD_TIME))
if (UtilTime.elapsed(time, _maxHoldTime))
{
FireRocket(player);
chargeIterator.remove();
@ -310,7 +320,7 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
@Override

View File

@ -1,42 +1,32 @@
package nautilus.game.arcade.game.games.smash.perks.slime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import mineplex.core.common.util.*;
import mineplex.core.common.util.UtilEvent.ActionType;
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.perks.SmashPerk;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
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.UtilMath;
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.perks.SmashPerk;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
public class PerkSlimeSlam extends SmashPerk
{
private static final int COOLDOWN = 6000;
private static final int HIT_BOX = 2;
private static final int START_TIME = 1000;
private static final int DAMAGE_RATE_LIMIT = 500;
private static final int DAMAGE = 7;
private static final int KNOCKBACK_MAGNITUDE = 2;
private int _cooldown;
private int _hitBox;
private int _startTime;
private int _damageRateLimit;
private int _damage;
private int _knockbackMagnitude;
private Map<UUID, Long> _live = new HashMap<>();
@ -45,6 +35,17 @@ public class PerkSlimeSlam extends SmashPerk
super("Slime Slam", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Slime Slam" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_hitBox = getPerkInt("Hit Box");
_startTime = getPerkTime("Start Time");
_damageRateLimit = getPerkInt("Damage Rate Limit (ms)");
_damage = getPerkInt("Damage");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
}
@EventHandler
public void Leap(PlayerInteractEvent event)
{
@ -75,7 +76,7 @@ public class PerkSlimeSlam extends SmashPerk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -114,7 +115,7 @@ public class PerkSlimeSlam extends SmashPerk
continue;
}
if (UtilMath.offset(player, other) < HIT_BOX)
if (UtilMath.offset(player, other) < _hitBox)
{
doSlam(player, other);
_live.remove(player.getUniqueId());
@ -138,7 +139,7 @@ public class PerkSlimeSlam extends SmashPerk
continue;
}
if (!UtilTime.elapsed(_live.get(key), START_TIME))
if (!UtilTime.elapsed(_live.get(key), _startTime))
{
continue;
}
@ -151,7 +152,7 @@ public class PerkSlimeSlam extends SmashPerk
{
if (damagee instanceof Player)
{
if (!Recharge.Instance.use((Player) damagee, GetName() + " Hit", DAMAGE_RATE_LIMIT, false, false))
if (!Recharge.Instance.use((Player) damagee, GetName() + " Hit", _damageRateLimit, false, false))
{
return;
}
@ -160,10 +161,10 @@ public class PerkSlimeSlam extends SmashPerk
// Recoil Event
if (!isSuperActive(damager))
{
Manager.GetDamage().NewDamageEvent(damager, damagee, null, DamageCause.CUSTOM, DAMAGE / 4, true, true, false, damager.getName(), GetName() + " Recoil");
Manager.GetDamage().NewDamageEvent(damager, damagee, null, DamageCause.CUSTOM, _damage / 4, true, true, false, damager.getName(), GetName() + " Recoil");
// Damage Event
Manager.GetDamage().NewDamageEvent(damagee, damager, null, DamageCause.CUSTOM, DAMAGE, true, true, false, damager.getName(), GetName());
Manager.GetDamage().NewDamageEvent(damagee, damager, null, DamageCause.CUSTOM, _damage, true, true, false, damager.getName(), GetName());
}
// Inform
@ -179,6 +180,6 @@ public class PerkSlimeSlam extends SmashPerk
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
}

View File

@ -26,13 +26,19 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashSlime extends SmashUltimate
{
private static final int DURATION = 19000;
private static final int HIT_BOX = 5;
private static final int DAMAGE = 8;
private int _hitBox;
private int _damage;
public SmashSlime()
{
super("Giga Slime", new String[] {}, Sound.SLIME_ATTACK, DURATION);
super("Giga Slime", new String[] {}, Sound.SLIME_ATTACK, 0);
}
@Override
public void setupValues()
{
_hitBox = getPerkInt("Hit Box");
_damage = getPerkInt("Damage");
}
@Override
@ -53,7 +59,7 @@ public class SmashSlime extends SmashUltimate
player.setExp(0.99f);
Manager.GetCondition().Factory().Speed(GetName(), player, player, DURATION / 1000, 2, false, false, false);
Manager.GetCondition().Factory().Speed(GetName(), player, player, getLength() / 1000, 2, false, false, false);
}
@ -128,9 +134,9 @@ public class SmashSlime extends SmashUltimate
continue;
}
if (UtilMath.offset(player.getLocation().add(0, 3, 0), other.getLocation()) < HIT_BOX)
if (UtilMath.offset(player.getLocation().add(0, 3, 0), other.getLocation()) < _hitBox)
{
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.SLIME, other.getLocation().add(0, 0.6, 0), 1f, 1f, 1f, 0, 20, ViewDist.LONG, UtilServer.getPlayers());