Skeletal Horse converted to Google Sheets

This commit is contained in:
Sam 2017-04-26 19:11:48 +01:00
parent 7f1b1d72b9
commit d3cb99f431
5 changed files with 75 additions and 55 deletions

View File

@ -32,8 +32,8 @@ public class KitSkeletalHorse extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.4, 0.3, 6.5),
new PerkDoubleJump("Double Jump", 1, 1, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkHorseKick(),
new PerkBoneRush(),
new PerkDeadlyBones(),

View File

@ -39,13 +39,13 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkBoneRush extends SmashPerk implements IThrown
{
private static final int COOLDOWN = 10000;
private static final float DAMAGE_NORMAL = 0.7F;
private static final int DAMAGE_SMASH = 3;
private static final int KNOCKBACK_NORMAL = 10;
private static final int KNOCKBACK_SMASH = 6;
private static final int EXPIRE_TIME = 2000;
private static final float Y_LIMIT = 0.25F;
private int _cooldown;
private float _damageNormal;
private int _damageSmash;
private int _knockbackNormal;
private int _knockbackSmash;
private int _expireTime;
private float _yLimit;
private Map<UUID, Long> _active = new HashMap<>();
@ -54,6 +54,18 @@ public class PerkBoneRush extends SmashPerk implements IThrown
super("Bone Rush", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Spade to use " + C.cGreen + "Bone Rush", C.cGray + "Crouch to avoid movement with " + C.cGreen + "Bone Rush" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_damageNormal = getPerkFloat("Damage Normal");
_damageSmash = getPerkInt("Damage Smash");
_knockbackNormal = getPerkInt("Knockback Normal");
_knockbackSmash = getPerkInt("Knockback Smash");
_expireTime = getPerkTime("Expire Time");
_yLimit = getPerkFloat("Y Limit");
}
@EventHandler
public void Skill(PlayerInteractEvent event)
{
@ -89,7 +101,7 @@ public class PerkBoneRush extends SmashPerk implements IThrown
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -141,7 +153,7 @@ public class PerkBoneRush extends SmashPerk implements IThrown
// Velocity
Vector dir = player.getLocation().getDirection();
double limit = isSuperActive(player) ? Y_LIMIT + 0.1 : Y_LIMIT;
double limit = isSuperActive(player) ? _yLimit + 0.1 : _yLimit;
if (dir.getY() > limit)
{
@ -159,7 +171,7 @@ public class PerkBoneRush extends SmashPerk implements IThrown
{
Item bone = player.getWorld().dropItem(player.getLocation().add(Math.random() * 5 - 2.5, Math.random() * 3, Math.random() * 5 - 2.5), new ItemStack(Material.BONE));
UtilAction.velocity(bone, dir, 0.6 + 0.3 * Math.random(), false, 0, 0.1 + Math.random() * 0.05, 0.3, false);
Manager.GetProjectile().AddThrow(bone, player, this, EXPIRE_TIME, true, true, true, true, 0.5f);
Manager.GetProjectile().AddThrow(bone, player, this, _expireTime, true, true, true, true, 0.5f);
}
}
}
@ -174,12 +186,12 @@ public class PerkBoneRush extends SmashPerk implements IThrown
if (event.GetReason().contains(GetName()))
{
event.AddKnockback(GetName(), KNOCKBACK_NORMAL);
event.AddKnockback(GetName(), _knockbackNormal);
}
if (event.GetReason().contains("Bone Storm"))
{
event.AddKnockback(GetName(), KNOCKBACK_SMASH);
event.AddKnockback(GetName(), _knockbackSmash);
}
}
@ -216,7 +228,7 @@ public class PerkBoneRush extends SmashPerk implements IThrown
}
// Damage Event
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, isSuperActive(damager) ? DAMAGE_SMASH : DAMAGE_NORMAL, false, true, false, UtilEnt.getName(data.getThrower()), reason);
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, isSuperActive(damager) ? _damageSmash : _damageNormal, false, true, false, UtilEnt.getName(data.getThrower()), reason);
UtilAction.velocity(target, data.getThrown().getVelocity());
}

View File

@ -1,11 +1,14 @@
package nautilus.game.arcade.game.games.smash.perks.skeletalhorse;
import java.util.ArrayList;
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.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.itemstack.ItemStackFactory;
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.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Item;
@ -14,28 +17,16 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.itemstack.ItemStackFactory;
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.*;
public class PerkDeadlyBones extends SmashPerk
{
private static final int RATE = 400;
private static final int TICKS = 50;
private static final int DAMAGE_RADIUS = 4;
private static final int DAMAGE = 4;
private static final float KNOCKBACK_MAGNITUDE = 2.5F;
private int _rate;
private int _ticks ;
private int _damageRadius;
private int _damage;
private float _knockbackMagnitude;
private Map<Item, UUID> _active = new HashMap<>();
@ -44,6 +35,16 @@ public class PerkDeadlyBones extends SmashPerk
super("Deadly Bones", new String[] { C.cGray + "Drop explosive bones when you take damage." });
}
@Override
public void setupValues()
{
_rate = getPerkInt("Rate (ms)");
_ticks = getPerkInt("Ticks");
_damageRadius = getPerkInt("Damage Radius");
_damage = getPerkInt("Damage");
_knockbackMagnitude = getPerkFloat("Knockback Magnitude");
}
@EventHandler
public void damageActivate(CustomDamageEvent event)
{
@ -64,7 +65,7 @@ public class PerkDeadlyBones extends SmashPerk
return;
}
if (!Recharge.Instance.use(player, GetName(), RATE, false, false))
if (!Recharge.Instance.use(player, GetName(), _rate, false, false))
{
return;
}
@ -91,7 +92,7 @@ public class PerkDeadlyBones extends SmashPerk
for (Item item : itemListCopy)
{
// Not Ready
if (item.isValid() && item.getTicksLived() < TICKS)
if (item.isValid() && item.getTicksLived() < _ticks)
{
continue;
}
@ -109,7 +110,7 @@ public class PerkDeadlyBones extends SmashPerk
}
// Damage
Map<LivingEntity, Double> targets = UtilEnt.getInRadius(item.getLocation(), DAMAGE_RADIUS);
Map<LivingEntity, Double> targets = UtilEnt.getInRadius(item.getLocation(), _damageRadius);
for (LivingEntity cur : targets.keySet())
{
@ -118,7 +119,7 @@ public class PerkDeadlyBones extends SmashPerk
continue;
}
Manager.GetDamage().NewDamageEvent(cur, player, null, DamageCause.CUSTOM, DAMAGE * targets.get(cur) + 1, true, true, false, player.getName(), GetName());
Manager.GetDamage().NewDamageEvent(cur, player, null, DamageCause.CUSTOM, _damage * targets.get(cur) + 1, true, true, false, player.getName(), GetName());
}
// Remove
@ -135,6 +136,6 @@ public class PerkDeadlyBones extends SmashPerk
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
}

View File

@ -37,10 +37,10 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkHorseKick extends SmashPerk
{
private static final int COOLDOWN = 6000;
private static final float DAMAGE = 6.5F;
private static final int KICK_TIME = 1000;
private static final int KNOCKBACK_MAGNITUDE = 4;
private int _cooldown;
private float _damage;
private int _kickTime;
private int _knockbackMagnitude;
private Map<UUID, Long> _active = new HashMap<>();
@ -49,6 +49,15 @@ public class PerkHorseKick extends SmashPerk
super("Bone Kick", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Bone Kick" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_damage = getPerkFloat("Damage");
_kickTime = getPerkInt("Kick Time (ms)");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
}
@EventHandler
public void Activate(PlayerInteractEvent event)
{
@ -84,7 +93,7 @@ public class PerkHorseKick extends SmashPerk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -119,7 +128,7 @@ public class PerkHorseKick extends SmashPerk
}
// 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());
// Sound
player.getWorld().playSound(player.getLocation(), Sound.SKELETON_HURT, 4f, 0.6f);
@ -158,7 +167,7 @@ public class PerkHorseKick extends SmashPerk
continue;
}
if (!player.isValid() || player.getHealth() <= 0 || UtilTime.elapsed(_active.get(key), KICK_TIME))
if (!player.isValid() || player.getHealth() <= 0 || UtilTime.elapsed(_active.get(key), _kickTime))
{
playerIterator.remove();
@ -192,6 +201,6 @@ public class PerkHorseKick extends SmashPerk
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
}

View File

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