コード例 #1
0
 public WeaponShot createShot(ItemStack weapon, EntityLivingBase shooter, boolean zoomed) {
   WeaponShot shot =
       new WeaponShot(
           itemRand.nextInt(),
           getWeaponScaledDamage(weapon, shooter),
           getAccuracy(weapon, shooter, zoomed),
           WeaponHelper.getColor(weapon),
           getRange(weapon));
   shot.setCount(getShotCount(weapon, shooter));
   return shot;
 }
コード例 #2
0
 public PlasmaBolt[] spawnProjectile(
     ItemStack weapon, EntityLivingBase shooter, Vec3 position, Vec3 dir, WeaponShot shot) {
   // PlasmaBolt fire = new PlasmaBolt(entityPlayer.worldObj, entityPlayer,position,dir,
   // getWeaponScaledDamage(weapon), 2, getAccuracy(weapon, zoomed), getRange(weapon),
   // WeaponHelper.getColor(weapon).getColor(), zoomed,seed);
   PlasmaBolt[] bolts = new PlasmaBolt[shot.getCount()];
   for (int i = 0; i < shot.getCount(); i++) {
     WeaponShot newShot = new WeaponShot(shot);
     newShot.setSeed(shot.getSeed() + i);
     newShot.setDamage(shot.getDamage() / shot.getCount());
     bolts[i] =
         new PlasmaBolt(
             shooter.worldObj, shooter, position, dir, newShot, getShotSpeed(weapon, shooter));
     bolts[i].setWeapon(weapon);
     bolts[i].setRenderSize((getShotCount(weapon, shooter) / shot.getCount()) * 0.5f);
     bolts[i].setFireDamageMultiply(WeaponHelper.modifyStat(Reference.WS_FIRE_DAMAGE, weapon, 0));
     bolts[i].setKnockBack(0.5f);
     shooter.worldObj.spawnEntityInWorld(bolts[i]);
   }
   return bolts;
 }