Fix the firebolt spell

This commit is contained in:
Sollace 2021-12-22 15:05:46 +02:00
parent c30eac20c3
commit e3bd201f0a
2 changed files with 6 additions and 2 deletions

View file

@ -61,7 +61,7 @@ public class CatapultSpell extends AbstractSpell implements ProjectileSpell {
} }
getTarget(caster, e -> apply(caster, e)); getTarget(caster, e -> apply(caster, e));
return situation == Situation.PROJECTILE; return false;
} }
protected void apply(Caster<?> caster, Entity e) { protected void apply(Caster<?> caster, Entity e) {

View file

@ -23,11 +23,14 @@ public class FireBoltSpell extends AbstractSpell implements ProjectileSpell {
@Override @Override
public boolean tick(Caster<?> caster, Situation situation) { public boolean tick(Caster<?> caster, Situation situation) {
if (situation == Situation.PROJECTILE) {
return true;
}
for (int i = 0; i < getNumberOfBalls(caster); i++) { for (int i = 0; i < getNumberOfBalls(caster); i++) {
getType().create(getTraits()).toThrowable().throwProjectile(caster); getType().create(getTraits()).toThrowable().throwProjectile(caster);
caster.playSound(SoundEvents.ENTITY_BLAZE_SHOOT, 0.7F, 0.4F / (caster.getWorld().random.nextFloat() * 0.4F + 0.8F)); caster.playSound(SoundEvents.ENTITY_BLAZE_SHOOT, 0.7F, 0.4F / (caster.getWorld().random.nextFloat() * 0.4F + 0.8F));
} }
return false; return false;
} }
@ -35,6 +38,7 @@ public class FireBoltSpell extends AbstractSpell implements ProjectileSpell {
public void configureProjectile(MagicProjectileEntity projectile, Caster<?> caster) { public void configureProjectile(MagicProjectileEntity projectile, Caster<?> caster) {
projectile.setItem(Items.FIRE_CHARGE.getDefaultStack()); projectile.setItem(Items.FIRE_CHARGE.getDefaultStack());
projectile.addThrowDamage(9); projectile.addThrowDamage(9);
projectile.setFireTicks(900000);
projectile.setVelocity(projectile.getVelocity().multiply(1.3)); projectile.setVelocity(projectile.getVelocity().multiply(1.3));
} }