Initial 1.11.2 update
This commit is contained in:
@@ -18,30 +18,34 @@ import net.minecraft.world.World;
|
||||
|
||||
public class HealAlly extends Spell {
|
||||
|
||||
public HealAlly() {
|
||||
public HealAlly(){
|
||||
super(Tier.APPRENTICE, 10, Element.HEALING, "heal_ally", SpellType.DEFENCE, 20, EnumAction.NONE, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean cast(World world, EntityPlayer caster, EnumHand hand, int ticksInUse, SpellModifiers modifiers) {
|
||||
public boolean cast(World world, EntityPlayer caster, EnumHand hand, int ticksInUse, SpellModifiers modifiers){
|
||||
|
||||
RayTraceResult rayTrace = WizardryUtilities.standardEntityRayTrace(world, caster, 10*modifiers.get(WizardryItems.range_upgrade), 8.0f);
|
||||
RayTraceResult rayTrace = WizardryUtilities.standardEntityRayTrace(world, caster,
|
||||
10 * modifiers.get(WizardryItems.range_upgrade), 8.0f);
|
||||
|
||||
if(rayTrace != null && rayTrace.entityHit != null && rayTrace.entityHit instanceof EntityLivingBase){
|
||||
EntityLivingBase target = (EntityLivingBase)rayTrace.entityHit;
|
||||
if(target.getHealth() < target.getMaxHealth()){
|
||||
target.heal((int)(5*modifiers.get(SpellModifiers.DAMAGE)));
|
||||
|
||||
target.heal((int)(5 * modifiers.get(SpellModifiers.DAMAGE)));
|
||||
|
||||
if(world.isRemote){
|
||||
for(int i=0; i<10; i++){
|
||||
double d0 = (double)((float)target.posX + world.rand.nextFloat()*2 - 1.0F);
|
||||
// Apparently the client side spawns the particles 1 block higher than it should... hence the - 0.5F.
|
||||
double d1 = (double)((float)target.getEntityBoundingBox().minY + target.height - 0.5f + world.rand.nextFloat());
|
||||
double d2 = (double)((float)target.posZ + world.rand.nextFloat()*2 - 1.0F);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, d0, d1, d2, 0, 0.1F, 0, 48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f);
|
||||
for(int i = 0; i < 10; i++){
|
||||
double d0 = (double)((float)target.posX + world.rand.nextFloat() * 2 - 1.0F);
|
||||
// Apparently the client side spawns the particles 1 block higher than it should... hence the -
|
||||
// 0.5F.
|
||||
double d1 = (double)((float)target.getEntityBoundingBox().minY + target.height - 0.5f
|
||||
+ world.rand.nextFloat());
|
||||
double d2 = (double)((float)target.posZ + world.rand.nextFloat() * 2 - 1.0F);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, d0, d1, d2, 0, 0.1F, 0,
|
||||
48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
caster.swingArm(hand);
|
||||
target.playSound(WizardrySounds.SPELL_HEAL, 0.7F, world.rand.nextFloat() * 0.4F + 1.0F);
|
||||
return true;
|
||||
@@ -50,5 +54,4 @@ public class HealAlly extends Spell {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user