From 1c0e046236d67276151b79c2e9c57baf1af623ff Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Fri, 12 Jun 2020 23:27:20 +0100 Subject: [PATCH] Snowstorms! --- .../entity/construct/EntityBlizzard.java | 10 ++++++-- .../electroblob/wizardry/spell/IceAge.java | 25 +++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/main/java/electroblob/wizardry/entity/construct/EntityBlizzard.java b/src/main/java/electroblob/wizardry/entity/construct/EntityBlizzard.java index 9cc90a43..35ebe312 100644 --- a/src/main/java/electroblob/wizardry/entity/construct/EntityBlizzard.java +++ b/src/main/java/electroblob/wizardry/entity/construct/EntityBlizzard.java @@ -62,11 +62,17 @@ public class EntityBlizzard extends EntityMagicConstruct { }else{ - for(int i=1; i<12; i++){ - double speed = (rand.nextBoolean() ? 1 : -1) * 0.1 + 0.05 * rand.nextDouble(); + for(int i=0; i<6; i++){ + double speed = (rand.nextBoolean() ? 1 : -1) * (0.1 + 0.05 * rand.nextDouble()); ParticleBuilder.create(Type.SNOW).pos(this.posX, this.posY + rand.nextDouble() * 3, this.posZ).vel(0, 0, 0) .time(100).scale(2).spin(rand.nextDouble() * (radius - 0.5) + 0.5, speed).spawn(world); } + + for(int i=0; i<3; i++){ + double speed = (rand.nextBoolean() ? 1 : -1) * (0.05 + 0.02 * rand.nextDouble()); + ParticleBuilder.create(Type.CLOUD).pos(this.posX, this.posY + rand.nextDouble() * 2.5, this.posZ) + .clr(0xffffff).spin(rand.nextDouble() * (radius - 1) + 0.5, speed).spawn(world); + } } } } diff --git a/src/main/java/electroblob/wizardry/spell/IceAge.java b/src/main/java/electroblob/wizardry/spell/IceAge.java index 022817d5..07acbc2b 100644 --- a/src/main/java/electroblob/wizardry/spell/IceAge.java +++ b/src/main/java/electroblob/wizardry/spell/IceAge.java @@ -6,6 +6,8 @@ import electroblob.wizardry.registry.WizardryBlocks; import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.util.AllyDesignationSystem; +import electroblob.wizardry.util.ParticleBuilder; +import electroblob.wizardry.util.ParticleBuilder.Type; import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.WizardryUtilities; import net.minecraft.entity.EntityLiving; @@ -52,6 +54,7 @@ public class IceAge extends Spell { } } } + if(!world.isRemote && WizardryUtilities.canDamageBlocks(caster, world)){ for(int i = -(int)radius; i < (int)radius + 1; i++){ for(int j = -(int)radius; j < (int)radius + 1; j++){ @@ -83,6 +86,28 @@ public class IceAge extends Spell { } } + if(world.isRemote){ + + for(int i=0; i<100; i++){ + double speed = (world.rand.nextBoolean() ? 1 : -1) * (0.1 + 0.05 * world.rand.nextDouble()); + ParticleBuilder.create(Type.SNOW) + .pos(caster.posX, caster.getEntityBoundingBox().minY + world.rand.nextDouble() * 3, caster.posZ) + .vel(0, 0, 0) + .scale(2) + .spin(world.rand.nextDouble() * (radius - 0.5) + 0.5, speed) + .spawn(world); + } + + for(int i=0; i<60; i++){ + double speed = (world.rand.nextBoolean() ? 1 : -1) * (0.05 + 0.02 * world.rand.nextDouble()); + ParticleBuilder.create(Type.CLOUD) + .pos(caster.posX, caster.getEntityBoundingBox().minY + world.rand.nextDouble() * 2.5, caster.posZ) + .clr(0xffffff) + .spin(world.rand.nextDouble() * (radius - 1) + 0.5, speed) + .spawn(world); + } + } + this.playSound(world, caster, ticksInUse, -1, modifiers); return true; }