use of com.teamwizardry.wizardry.api.util.interp.InterpScale in project Wizardry by TeamWizardry.
the class ModuleEffectTelekinesis method render.
@Override
@SideOnly(Side.CLIENT)
public void render(@Nonnull SpellData spell, @Nonnull SpellRing spellRing) {
World world = spell.world;
Vec3d position = spell.getTarget();
if (position == null)
return;
ParticleBuilder glitter = new ParticleBuilder(50);
glitter.setColorFunction(new InterpColorHSV(getPrimaryColor(), getSecondaryColor()));
glitter.setScale(1);
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(position), 5, 0, (aFloat, particleBuilder) -> {
glitter.setLifetime(RandUtil.nextInt(10, 20));
glitter.setScale(RandUtil.nextFloat());
glitter.setScaleFunction(new InterpScale(1, 0));
glitter.setAlphaFunction(new InterpFadeInOut(0.3f, RandUtil.nextFloat()));
glitter.setMotion(new Vec3d(RandUtil.nextDouble(-0.1, 0.1), RandUtil.nextDouble(-0.1, 0.1), RandUtil.nextDouble(-0.1, 0.1)));
});
}
use of com.teamwizardry.wizardry.api.util.interp.InterpScale in project Wizardry by TeamWizardry.
the class ModuleEffectTimeSlow method render.
@Override
@SideOnly(Side.CLIENT)
public void render(@Nonnull SpellData spell, @Nonnull SpellRing spellRing) {
World world = spell.world;
Vec3d position = spell.getTarget();
if (position == null)
return;
ParticleBuilder glitter = new ParticleBuilder(30);
glitter.setColorFunction(new InterpColorHSV(getPrimaryColor(), getSecondaryColor()));
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.disableRandom();
glitter.setScaleFunction(new InterpScale(1, 0));
glitter.setCollision(true);
glitter.enableMotionCalculation();
glitter.setAcceleration(new Vec3d(0, -0.001, 0));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(position.addVector(0, 1, 0)), 3, 0, (aFloat, particleBuilder) -> {
glitter.setLifetime(RandUtil.nextInt(30, 40));
glitter.setScale(RandUtil.nextFloat());
glitter.setAlphaFunction(new InterpFadeInOut(0.5f, RandUtil.nextFloat()));
double radius = RandUtil.nextDouble(0, 1);
double theta = 2.0f * (float) Math.PI * RandUtil.nextFloat();
double r = radius * RandUtil.nextFloat();
double x = r * MathHelper.cos((float) theta);
double z = r * MathHelper.sin((float) theta);
Vec3d dest = new Vec3d(x, RandUtil.nextDouble(-radius, radius), z);
glitter.setPositionOffset(dest);
// glitter.setPositionFunction(new InterpSlowDown(Vec3d.ZERO, new Vec3d(0, RandUtil.nextDouble(-1, 1), 0)));
// glitter.setPositionFunction(new InterpBezier3D(Vec3d.ZERO, position.subtract(dest), dest.scale(2), new Vec3d(position.x, radius, position.z)));
});
}
use of com.teamwizardry.wizardry.api.util.interp.InterpScale in project Wizardry by TeamWizardry.
the class LibParticles method CRAFTING_ALTAR_IDLE.
public static void CRAFTING_ALTAR_IDLE(World world, Vec3d pos) {
ParticleBuilder glitter = new ParticleBuilder(30);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(1f, 1f));
glitter.addMotion(new Vec3d(RandUtil.nextDouble(-0.01, 0.01), RandUtil.nextDouble(0, 0.05), RandUtil.nextDouble(-0.01, 0.01)));
glitter.setColor(new Color(0x0022FF));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(pos), 1, 0, (i, build) -> {
double radius = 0.1;
double theta = 2.0f * (float) Math.PI * RandUtil.nextFloat();
double r = radius * RandUtil.nextFloat();
double x = r * MathHelper.cos((float) theta);
double z = r * MathHelper.sin((float) theta);
glitter.setScale((float) RandUtil.nextDouble(1, 2));
glitter.setLifetime(RandUtil.nextInt(5, 30));
glitter.setScaleFunction(new InterpScale((float) RandUtil.nextDouble(1, 1.5), 0));
glitter.setPositionOffset(new Vec3d(x, RandUtil.nextDouble(0, 0.3), z));
});
}
use of com.teamwizardry.wizardry.api.util.interp.InterpScale in project Wizardry by TeamWizardry.
the class LibParticles method COLORFUL_BATTERY_BEZIER.
public static void COLORFUL_BATTERY_BEZIER(World world, BlockPos pedestal, BlockPos center) {
ParticleBuilder glitter = new ParticleBuilder(200);
glitter.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.5f, 0.3f));
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(new Vec3d(pedestal).addVector(0.5, 1, 0.5)), 1, 0, (aFloat, particleBuilder) -> {
glitter.setColorFunction(new InterpColorHSV(ColorUtils.changeColorAlpha(Color.BLUE, RandUtil.nextInt(100, 150)), ColorUtils.changeColorAlpha(Color.CYAN, RandUtil.nextInt(100, 150))));
glitter.setScale(RandUtil.nextFloat());
glitter.setPositionFunction(new InterpBezier3D(Vec3d.ZERO, new Vec3d(center.subtract(pedestal)), new Vec3d(0, 3, 0), new Vec3d(0, 5, 0)));
glitter.setScaleFunction(new InterpScale(1, 0.4f));
glitter.setLifetime(RandUtil.nextInt(10, 30));
});
}
use of com.teamwizardry.wizardry.api.util.interp.InterpScale in project Wizardry by TeamWizardry.
the class LibParticles method CRAFTING_ALTAR_CLUSTER_SUCTION.
public static void CRAFTING_ALTAR_CLUSTER_SUCTION(World world, Vec3d pos, InterpFunction<Vec3d> bezier3D) {
ParticleBuilder helix = new ParticleBuilder(200);
helix.setRender(new ResourceLocation(Wizardry.MODID, MISC.SPARKLE_BLURRED));
helix.setAlphaFunction(new InterpFadeInOut(0.5f, 0.3f));
ParticleSpawner.spawn(helix, world, new StaticInterp<>(pos), 1, 0, (aFloat, particleBuilder) -> {
helix.setColorFunction(new InterpColorHSV(ColorUtils.changeColorAlpha(Color.BLUE, RandUtil.nextInt(100, 150)), ColorUtils.changeColorAlpha(Color.CYAN, RandUtil.nextInt(100, 150))));
helix.setScale(RandUtil.nextFloat());
helix.setPositionFunction(bezier3D);
helix.setScaleFunction(new InterpScale(1, 0));
helix.setLifetime(RandUtil.nextInt(10, 30));
});
}
Aggregations