Implement blast modifier support for all applicable constructs, plus misc construct-related cleanup and fixes

This commit is contained in:
Electroblob77
2020-06-28 16:56:18 +01:00
parent 97c21b5057
commit 3a68ba8927
36 changed files with 296 additions and 201 deletions
@@ -15,14 +15,19 @@ import net.minecraft.world.World;
import java.util.List;
public class EntityLightningSigil extends EntityMagicConstruct {
public class EntityLightningSigil extends EntityScaledConstruct {
public static final String SECONDARY_RANGE = "secondary_range";
public static final String SECONDARY_MAX_TARGETS = "secondary_max_targets";
public EntityLightningSigil(World world){
super(world);
this.height = 0.2f;
this.width = 2.0f;
setSize(Spells.frost_sigil.getProperty(Spell.EFFECT_RADIUS).floatValue() * 2, 0.2f);
}
@Override
protected boolean shouldScaleHeight(){
return false;
}
@Override
@@ -34,7 +39,7 @@ public class EntityLightningSigil extends EntityMagicConstruct {
this.setDead();
}
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(1.0d, this.posX, this.posY,
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(width/2, this.posX, this.posY,
this.posZ, this.world);
for(EntityLivingBase target : targets){
@@ -58,7 +63,7 @@ public class EntityLightningSigil extends EntityMagicConstruct {
this.playSound(WizardrySounds.ENTITY_LIGHTNING_SIGIL_TRIGGER, 1.0f, 1.0f);
// Secondary chaining effect
double seekerRange = Spells.lightning_sigil.getProperty(Spell.EFFECT_RADIUS).doubleValue();
double seekerRange = Spells.lightning_sigil.getProperty(SECONDARY_RANGE).doubleValue();
List<EntityLivingBase> secondaryTargets = EntityUtils.getLivingWithinRadius(seekerRange,
target.posX, target.posY + target.height / 2, target.posZ, world);
@@ -96,8 +101,8 @@ public class EntityLightningSigil extends EntityMagicConstruct {
}
if(this.world.isRemote && this.rand.nextInt(15) == 0){
double radius = 0.5 + rand.nextDouble() * 0.3;
float angle = rand.nextFloat() * (float)Math.PI * 2;;
double radius = (0.5 + rand.nextDouble() * 0.3) * width/2;
float angle = rand.nextFloat() * (float)Math.PI * 2;
ParticleBuilder.create(Type.SPARK)
.pos(this.posX + radius * MathHelper.cos(angle), this.posY + 0.1, this.posZ + radius * MathHelper.sin(angle))
.spawn(world);