Tweaked MetalClips

Made the interval for 4-clip damage twice as fast by default.
Made the damage for 4-clip go through armor.
This commit is contained in:
Brendan Wilson 2014-11-20 18:57:45 -05:00
parent e278a62d03
commit ecb0fb340b
2 changed files with 18 additions and 14 deletions

View file

@ -460,7 +460,7 @@ public class ConfigManager {
config.addDefault("Abilities.Earth.MetalClips.Enabled", true);
config.addDefault("Abilities.Earth.MetalClips.Description", "Shoot multiple metal clips at your enemy to slowly encase them in metal, allowing you to control their movements. This ability only works on Zombies, Skeletons, and Players. You need iron in your inventory to use this ability.");
config.addDefault("Abilities.Earth.MetalClips.Damage", 2);
config.addDefault("Abilities.Earth.MetalClips.DamageInterval", 1000);
config.addDefault("Abilities.Earth.MetalClips.DamageInterval", 500);
config.addDefault("Abilities.Earth.MetalClips.MagnetRange", 20);
config.addDefault("Abilities.Earth.MetalClips.Cooldown", 1000);
config.addDefault("Abilities.Earth.MetalClips.Duration", 10000);

View file

@ -254,17 +254,7 @@ public class MetalClips
{
Vector v = Methods.getDirection(e.getLocation(), player.getLocation());
if(e instanceof Item)
{
Item iron = (Item) e;
if(Arrays.asList(metalItems).contains(iron.getItemStack().getType()))
{
iron.setVelocity(v.normalize().multiply(0.4));
}
}
else if(e instanceof Player && player.hasPermission("bending.ability.MetalClips.loot")
if(e instanceof Player && player.hasPermission("bending.ability.MetalClips.loot")
&& player.getInventory().getItemInHand().getType() == Material.IRON_BLOCK)
{
Player p = (Player) e;
@ -276,6 +266,9 @@ public class MetalClips
for(ItemStack is : inventory)
{
if(is == null)
continue;
if(Arrays.asList(metalItems).contains(is.getType()))
{
p.getWorld().dropItem(p.getLocation(), is);
@ -306,7 +299,7 @@ public class MetalClips
}
}
else if((e instanceof Zombie || e instanceof Skeleton) && player.hasPermission("bending.ability.MetalClips.loot")
if((e instanceof Zombie || e instanceof Skeleton) && player.hasPermission("bending.ability.MetalClips.loot")
&& player.getInventory().getItemInHand().getType() == Material.IRON_BLOCK)
{
LivingEntity le = (LivingEntity) e;
@ -331,6 +324,16 @@ public class MetalClips
le.getEquipment().setItemInHand(new ItemStack(Material.AIR, 1));
}
}
if(e instanceof Item)
{
Item iron = (Item) e;
if(Arrays.asList(metalItems).contains(iron.getItemStack().getType()))
{
iron.setVelocity(v.normalize().multiply(0.4));
}
}
}
}
@ -397,7 +400,8 @@ public class MetalClips
if(System.currentTimeMillis() > time + crushInterval)
{
time = System.currentTimeMillis();
Methods.damageEntity(player, target, crushDamage);
Methods.damageEntity(player, target, 0);
target.setHealth((target.getHealth() - crushDamage < 0) ? 0 : target.getHealth() - crushDamage);
}
}
}