use of net.silentchaos512.gems.entity.EntityChaosProjectileSweep in project SilentGems by SilentChaos512.
the class ItemGemSword method getShots.
private List<EntityChaosProjectile> getShots(EntityPlayer player, ItemStack stack) {
List<EntityChaosProjectile> list = Lists.newArrayList();
if (ToolHelper.getToolTier(stack).ordinal() < EnumMaterialTier.SUPER.ordinal()) {
return list;
}
EnumMagicType magicType = EnumMagicType.getMagicType(stack);
int shotCount = magicType.getShotCount(stack);
// Calculate magic damage.
// Includes player "magic strength" (currently just a constant 1, might do something with it later).
float damage = 1f + getMagicDamage(stack);
// Magic damage enchantment
int magicEnchLevel = EnchantmentHelper.getEnchantmentLevel(ModEnchantments.magicDamage, stack);
if (magicEnchLevel > 0)
damage += ModEnchantments.magicDamage.calcDamage(magicEnchLevel);
damage *= magicType.getDamagePerShotMultiplier();
Item item = stack.getItem();
// Dagger
if (item instanceof ItemGemDagger) {
for (int i = 0; i < shotCount; ++i) {
list.add(new EntityChaosProjectileHoming(player, stack, damage, false, 0.0325, 0.25));
}
} else // Scepter
if (item instanceof ItemGemScepter) {
for (int i = 0; i < shotCount; ++i) {
list.add(new EntityChaosProjectileHoming(player, stack, damage, true, 0.075, 0.35));
}
} else // Katana
if (item instanceof ItemGemKatana) {
final float maxAngle = 0.05f;
for (float angle = -maxAngle; angle <= maxAngle; angle += maxAngle / (shotCount / 2)) {
list.add(new EntityChaosProjectileSweep(player, stack, damage, angle));
}
} else // Machete
if (item instanceof ItemGemMachete) {
for (int i = 0; i < shotCount; ++i) {
list.add(new EntityChaosProjectileScatter(player, stack, damage));
}
} else // Classic sword (default)
{
for (int i = 0; i < shotCount; ++i) {
EntityChaosProjectile e = new EntityChaosProjectile(player, stack, damage);
e.motionY += 0.2 * i;
list.add(e);
}
}
return list;
}
Aggregations