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:
@@ -1,30 +1,49 @@
|
||||
package electroblob.wizardry.spell;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.constants.Element;
|
||||
import electroblob.wizardry.constants.SpellType;
|
||||
import electroblob.wizardry.constants.Tier;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
import electroblob.wizardry.util.ParticleBuilder;
|
||||
import electroblob.wizardry.util.ParticleBuilder.Type;
|
||||
import electroblob.wizardry.util.SpellModifiers;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class Levitation extends Spell {
|
||||
|
||||
public static final String SPEED = "speed";
|
||||
public static final String ACCELERATION = "acceleration";
|
||||
|
||||
public Levitation(){
|
||||
super("levitation", Tier.ADVANCED, Element.SORCERY, SpellType.UTILITY, 10, 0, EnumAction.BOW, true);
|
||||
super("levitation", EnumAction.BOW, true);
|
||||
addProperties(SPEED, ACCELERATION);
|
||||
soundValues(0.5f, 1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEvent[] createSounds(){
|
||||
return this.createContinuousSpellSounds();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void playSound(World world, EntityLivingBase entity, int ticksInUse, int duration, SpellModifiers modifiers, String... sounds){
|
||||
this.playSoundLoop(world, entity, ticksInUse);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void playSound(World world, double x, double y, double z, int ticksInUse, int duration, SpellModifiers modifiers, String... sounds){
|
||||
this.playSoundLoop(world, x, y, z, ticksInUse, duration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean cast(World world, EntityPlayer caster, EnumHand hand, int ticksInUse, SpellModifiers modifiers){
|
||||
|
||||
caster.fallDistance = 0;
|
||||
if(!Wizardry.settings.replaceVanillaFallDamage) caster.fallDistance = 0;
|
||||
|
||||
caster.motionY = caster.motionY < 0.5 ? caster.motionY + 0.1 : caster.motionY;
|
||||
caster.motionY = caster.motionY < getProperty(SPEED).floatValue() ? caster.motionY
|
||||
+ getProperty(ACCELERATION).floatValue() : caster.motionY;
|
||||
|
||||
if(world.isRemote){
|
||||
double x = caster.posX - 0.25 + world.rand.nextDouble() * 0.5;
|
||||
@@ -32,9 +51,9 @@ public class Levitation extends Spell {
|
||||
double z = caster.posZ - 0.25 + world.rand.nextDouble() * 0.5;
|
||||
ParticleBuilder.create(Type.SPARKLE).pos(x, y, z).vel(0, -0.1, 0).time(15).clr(0.5f, 1, 0.7f).spawn(world);
|
||||
}
|
||||
if(ticksInUse % 24 == 0 && world.isRemote){
|
||||
Wizardry.proxy.playMovingSound(caster, WizardrySounds.SPELL_LOOP_SPARKLE, 0.5f, 1, false);
|
||||
}
|
||||
|
||||
this.playSound(world, caster, ticksInUse, -1, modifiers);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user