That's one heck of a commit you've got there...

I may have got a bit behind with version control. A lot behind, in fact. Maybe I'll go back and split this sometime - then again, I probably won't. But hey, at least it's here!
This commit is contained in:
Electroblob77
2019-08-18 00:04:18 +01:00
parent 2680d02304
commit f37812be3e
1564 changed files with 47652 additions and 12984 deletions
@@ -0,0 +1,53 @@
package electroblob.wizardry.spell;
import electroblob.wizardry.potion.Curse;
import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.SpellModifiers;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
public class RemoveCurse extends SpellBuff {
public RemoveCurse(){
super("remove_curse", 1, 1, 0.3f);
this.soundValues(0.7f, 1.2f, 0.4f);
}
@Override
protected boolean applyEffects(EntityLivingBase caster, SpellModifiers modifiers){
if(!caster.getActivePotionEffects().isEmpty()){
boolean flag = false;
for(PotionEffect effect : caster.getActivePotionEffects()){
// The PotionEffect version (as opposed to Potion) does not call cleanup callbacks
if(effect.getPotion() instanceof Curse){
caster.removePotionEffect(effect.getPotion());
flag = true;
}
}
return flag;
}
return false;
}
@Override
protected void spawnParticles(World world, EntityLivingBase caster, SpellModifiers modifiers){
super.spawnParticles(world, caster, modifiers);
for(int i = 0; i < particleCount*2; i++){
double x = caster.posX + world.rand.nextDouble() * 2 - 1;
double y = caster.getEntityBoundingBox().minY + caster.getEyeHeight() - 0.5 + world.rand.nextDouble();
double z = caster.posZ + world.rand.nextDouble() * 2 - 1;
ParticleBuilder.create(Type.SPARKLE).pos(x, y, z).vel(0, 0.14, 0).clr(0x0f001b)
.time(20 + world.rand.nextInt(12)).spawn(world);
ParticleBuilder.create(Type.DARK_MAGIC).pos(x, y, z).clr(0x0f001b).spawn(world);
}
}
}