Added 'Arrow Velocity' to bows

This commit is contained in:
ASangarin 2019-09-03 01:03:11 +01:00
parent 1efde635f0
commit fd4b649bbc
2 changed files with 4 additions and 1 deletions

View File

@ -249,6 +249,9 @@ public class ItemUse implements Listener {
return;
}
Arrow arrow = (Arrow) event.getProjectile();
if(!(item.getStat(ItemStat.ARROW_VELOCITY) <= 0))
arrow.setVelocity(arrow.getVelocity().multiply(1 + (item.getStat(ItemStat.ARROW_VELOCITY) / 2)));
MMOItems.plugin.getEntities().registerCustomProjectile(item, playerData.getStats().newTemporary(), (Arrow) event.getProjectile(), type != null, event.getForce());
}

View File

@ -99,7 +99,7 @@ public abstract class ItemStat {
public static final ItemStat RANGE = new DoubleStat(new ItemStack(Material.STICK), "Range", new String[] { "The range of your item attacks." }, "range", new String[] { "staff", "whip", "wand", "musket" });
public static final ItemStat MANA_COST = new DoubleStat(VersionMaterial.LAPIS_LAZULI.toItem(), "Mana Cost", new String[] { "Mana spent by your weapon to be used." }, "mana-cost", new String[] { "piercing", "slashing", "blunt", "range" });
public static final ItemStat STAMINA_COST = new DoubleStat(VersionMaterial.LIGHT_GRAY_DYE.toItem(), "Stamina Cost", new String[] { "Stamina spent by your weapon to be used." }, "stamina-cost", new String[] { "piercing", "slashing", "blunt", "range" });
public static final ItemStat ARROW_VELOCITY = new DoubleStat(new ItemStack(Material.ARROW), "Arrow Velocity", new String[] { "Determins how far your", "crossbow can shoot.", "Default: 1.0" }, "arrow-velocity", new String[] { "crossbow" });
public static final ItemStat ARROW_VELOCITY = new DoubleStat(new ItemStack(Material.ARROW), "Arrow Velocity", new String[] { "Determins how far your", "crossbow can shoot.", "Default: 1.0" }, "arrow-velocity", new String[] { "bow", "crossbow" });
public static final ItemStat PVE_DAMAGE = new DoubleStat(new ItemStack(VersionMaterial.PORKCHOP.toMaterial()), "PvE Damage", new String[] { "Additional damage against", "non human entities in %." }, "pve-damage", new String[] { "piercing", "slashing", "blunt", "offhand", "range", "tool", "armor", "gem_stone" });
public static final ItemStat PVP_DAMAGE = new DoubleStat(new ItemStack(VersionMaterial.SKELETON_SKULL.toMaterial()), "PvP Damage", new String[] { "Additional damage", "against players in %." }, "pvp-damage", new String[] { "piercing", "slashing", "blunt", "offhand", "range", "tool", "armor", "gem_stone" });
public static final ItemStat BLUNT_POWER = new DoubleStat(new ItemStack(Material.IRON_AXE), "Blunt Power", new String[] { "The radius of the AoE attack.", "If set to 2.0, enemies within 2 blocks", "around your target will take damage." }, "blunt-power", new String[] { "blunt", "gem_stone" });