Search in sources :

Example 1 with LightningBolt

use of am2.codechicken.LightningBolt in project ArsMagica2 by Mithion.

the class ParticleManagerClient method BoltFromEntityToEntity.

@Override
public void BoltFromEntityToEntity(World world, Entity caster, Entity source, Entity target, int damage, int type, int color) {
    double xx = target.posX;
    double yy = target.posY + target.getEyeHeight();
    double zz = target.posZ;
    double px = source.posX;
    double py = source.posY + source.getEyeHeight();
    double pz = source.posZ;
    px -= MathHelper.cos(source.rotationYaw / 180.0F * 3.141593F) * 0.16F;
    py -= 0.1000000014901161D;
    pz -= MathHelper.sin(source.rotationYaw / 180.0F * 3.141593F) * 0.16F;
    AMVector3 vec3d = MathUtilities.getLook(source, 1.0F);
    px += vec3d.x * 0.25D;
    py += vec3d.y * 0.25D;
    pz += vec3d.z * 0.25D;
    LightningBolt bolt = new LightningBolt(world, px, py, pz, xx, target.boundingBox.minY + target.height / 2.0F, zz, world.rand.nextLong(), 6, 0.3F, 6);
    bolt.defaultFractal();
    bolt.setSourceEntity(caster);
    bolt.setType(type);
    bolt.setDamage(0);
    bolt.setOverrideColor(color);
    bolt.finalizeBolt();
}
Also used : AMVector3(am2.api.math.AMVector3) LightningBolt(am2.codechicken.LightningBolt)

Example 2 with LightningBolt

use of am2.codechicken.LightningBolt in project ArsMagica2 by Mithion.

the class ParticleManagerClient method BoltFromPointToPoint.

@Override
public void BoltFromPointToPoint(World world, double startX, double startY, double startZ, double endX, double endY, double endZ, int type, int color) {
    if (AMCore.config.NoGFX()) {
        return;
    }
    LightningBolt bolt = new LightningBolt(world, startX, startY, startZ, endX, endY, endZ, world.rand.nextLong(), 6, 0.3F, 6);
    bolt.defaultFractal();
    bolt.setSourceEntity(null);
    bolt.setType(type);
    bolt.setDamage(0);
    bolt.finalizeBolt();
}
Also used : LightningBolt(am2.codechicken.LightningBolt)

Aggregations

LightningBolt (am2.codechicken.LightningBolt)2 AMVector3 (am2.api.math.AMVector3)1