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
@@ -1,16 +1,8 @@
package electroblob.wizardry.spell;
import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.constants.Element;
import electroblob.wizardry.constants.SpellType;
import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.entity.living.ISummonedCreature;
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.EntityLivingBase;
@@ -19,10 +11,14 @@ import net.minecraft.item.EnumAction;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;
import java.util.List;
public class GroupHeal extends Spell {
public GroupHeal(){
super("group_heal", Tier.ADVANCED, Element.HEALING, SpellType.DEFENCE, 35, 150, EnumAction.BOW, false);
super("group_heal", EnumAction.BOW, false);
this.soundValues(0.7f, 1.2f, 0.4f);
addProperties(EFFECT_RADIUS, HEALTH);
}
@Override
@@ -30,64 +26,20 @@ public class GroupHeal extends Spell {
boolean flag = false;
List<EntityLivingBase> targets = WizardryUtilities.getEntitiesWithinRadius(
5 * modifiers.get(WizardryItems.blast_upgrade), caster.posX, caster.posY, caster.posZ, world);
List<EntityLivingBase> targets = WizardryUtilities.getEntitiesWithinRadius(getProperty(EFFECT_RADIUS).floatValue()
* modifiers.get(WizardryItems.blast_upgrade), caster.posX, caster.posY, caster.posZ, world);
for(EntityLivingBase target : targets){
if(target instanceof EntityPlayer){
if(target == caster || AllyDesignationSystem.isAllied(caster, target)){
if(WizardryUtilities.isPlayerAlly(caster, (EntityPlayer)target) || target == caster){
if(target.getHealth() < target.getMaxHealth() && target.getHealth() > 0){
if(((EntityPlayer)target).shouldHeal()){
target.heal(getProperty(HEALTH).floatValue() * modifiers.get(SpellModifiers.POTENCY));
target.heal(6 * modifiers.get(SpellModifiers.POTENCY));
if(world.isRemote){
for(int i = 0; i < 10; 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.1, 0).clr(1, 1, 0.3f).spawn(world);
}
ParticleBuilder.create(Type.BUFF).entity(caster).clr(1, 1, 0.3f).spawn(world);
}
WizardryUtilities.playSoundAtPlayer(caster, WizardrySounds.SPELL_HEAL, 0.7F,
world.rand.nextFloat() * 0.4F + 1.0F);
flag = true;
}
}
// Now also works on summoned creatures
}else if(target instanceof ISummonedCreature){
EntityLivingBase summoner = ((ISummonedCreature)target).getCaster();
if(summoner == caster || (summoner instanceof EntityPlayer
&& WizardryUtilities.isPlayerAlly(caster, (EntityPlayer)summoner))){
if(target.getHealth() < target.getMaxHealth() && target.getHealth() > 0){
target.heal(6 * modifiers.get(SpellModifiers.POTENCY));
if(world.isRemote){
for(int i = 0; i < 10; 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.1, 0).clr(1, 1, 0.3f).spawn(world);
}
ParticleBuilder.create(Type.BUFF).entity(caster).clr(1, 1, 0.3f).spawn(world);
}
WizardryUtilities.playSoundAtPlayer(caster, WizardrySounds.SPELL_HEAL, 0.7F,
world.rand.nextFloat() * 0.4F + 1.0F);
flag = true;
}
if(world.isRemote) ParticleBuilder.spawnHealParticles(world, target);
playSound(world, target, ticksInUse, -1, modifiers);
flag = true;
}
}
}