Add blinding flash spell

This commit is contained in:
Electroblob77
2020-06-20 21:43:10 +01:00
parent 46a467de46
commit c6a3f090cd
8 changed files with 73 additions and 0 deletions
@@ -240,6 +240,8 @@ public final class Spells {
// Wizardry 4.3 spells
public static final Spell blinding_flash = placeholder();
public static final Spell stormcloud = placeholder();
public static final Spell zombie_apocalypse = placeholder();
@@ -445,6 +447,8 @@ public final class Spells {
// Wizardry 4.3 spells
registry.register(new BlindingFlash());
registry.register(new Stormcloud());
registry.register(new ZombieApocalypse());
@@ -0,0 +1,41 @@
package electroblob.wizardry.spell;
import electroblob.wizardry.item.SpellActions;
import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.util.EntityUtils;
import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.SpellModifiers;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.MobEffects;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import javax.annotation.Nullable;
public class BlindingFlash extends SpellAreaEffect {
public BlindingFlash(){
super("blinding_flash", SpellActions.POINT_UP, false);
this.alwaysSucceed(true);
addProperties(EFFECT_DURATION); // No effect strength, you're either blinded or you're not!
}
@Override
protected boolean affectEntity(World world, Vec3d origin, @Nullable EntityLivingBase caster, EntityLivingBase target, int targetCount, int ticksInUse, SpellModifiers modifiers){
if(EntityUtils.isLiving(target)){
int duration = (int)(getProperty(EFFECT_DURATION).floatValue() * modifiers.get(WizardryItems.duration_upgrade));
target.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, duration, 0));
}
return true;
}
@Override
protected void spawnParticleEffect(World world, Vec3d origin, double radius, @Nullable EntityLivingBase caster, SpellModifiers modifiers){
if(caster != null) origin = origin.add(0, caster.height + 1, 0);
ParticleBuilder.create(Type.SPHERE).pos(origin).scale((float)radius * 0.8f).spawn(world);
}
}
@@ -742,6 +742,7 @@ spell.ebwizardry\:arcane_lock=Arcane Lock
spell.ebwizardry\:arrow_rain=Arrow Rain
spell.ebwizardry\:banish=Banish
spell.ebwizardry\:black_hole=Black Hole
spell.ebwizardry\:blinding_flash=Blinding Flash
spell.ebwizardry\:blink=Blink
spell.ebwizardry\:blizzard=Blizzard
spell.ebwizardry\:bubble=Bubble
@@ -918,6 +919,7 @@ spell.ebwizardry\:arcane_lock.desc=Creates an impenetrable barrier of force arou
spell.ebwizardry\:arrow_rain.desc="Archers, fire!"
spell.ebwizardry\:banish.desc=Teleports the target against its will to a random location within a certain range.
spell.ebwizardry\:black_hole.desc=Tear reality asunder.
spell.ebwizardry\:blinding_flash.desc=Emits an intense flash of light that blinds all nearby creatures.
spell.ebwizardry\:blink.desc=Teleports the caster over a short distance to where they are pointing.
spell.ebwizardry\:blizzard.desc=Creates a zone of swirling icy wind which slows and continually damages anything trapped inside. The caster is immune to the damage but is still slowed.
spell.ebwizardry\:bubble.desc=Fires a jet of bubbles which causes anything it hits to float upwards helplessly. The target will fall after a certain time or if it is damaged.
@@ -742,6 +742,7 @@ spell.ebwizardry\:arcane_lock=Arcane Lock
spell.ebwizardry\:arrow_rain=Arrow Rain
spell.ebwizardry\:banish=Banish
spell.ebwizardry\:black_hole=Black Hole
spell.ebwizardry\:blinding_flash=Blinding Flash
spell.ebwizardry\:blink=Blink
spell.ebwizardry\:blizzard=Blizzard
spell.ebwizardry\:bubble=Bubble
@@ -918,6 +919,7 @@ spell.ebwizardry\:arcane_lock.desc=Creates an impenetrable barrier of force arou
spell.ebwizardry\:arrow_rain.desc="Archers, fire!"
spell.ebwizardry\:banish.desc=Teleports the target against its will to a random location within a certain range.
spell.ebwizardry\:black_hole.desc=Tear reality asunder.
spell.ebwizardry\:blinding_flash.desc=Emits an intense flash of light that blinds all nearby creatures.
spell.ebwizardry\:blink.desc=Teleports the caster over a short distance to where they are pointing.
spell.ebwizardry\:blizzard.desc=Creates a zone of swirling icy wind which slows and continually damages anything trapped inside. The caster is immune to the damage but is still slowed.
spell.ebwizardry\:bubble.desc=Fires a jet of bubbles which causes anything it hits to float upwards helplessly. The target will fall after a certain time or if it is damaged.
@@ -125,6 +125,7 @@
"spell.arrow_rain": {"category": "spells", "sounds": ["mob/illusion_illager/prepare_blind"]},
"spell.banish": {"category": "spells", "sounds": ["mob/endermen/portal", "mob/endermen/portal2"]},
"spell.black_hole": {"category": "spells", "sounds": ["mob/evocation_illager/prepare_attack1", "mob/evocation_illager/prepare_attack2"]},
"spell.blinding_flash": {"category": "spells", "sounds": ["ebwizardry:flash"]},
"spell.blink": {"category": "spells", "sounds": ["mob/endermen/portal", "mob/endermen/portal2"]},
"spell.blizzard": {"category": "spells", "sounds": ["ebwizardry:ice_age"]},
"spell.bubble.shoot": {"category": "spells", "sounds": ["ebwizardry:ice"]},
@@ -0,0 +1,23 @@
{
"enabled": {
"book": true,
"scroll": true,
"wands": true,
"npcs": true,
"dispensers": true,
"commands": true,
"treasure": true,
"trades": true,
"looting": true
},
"tier": "apprentice",
"element": "lightning",
"type": "alteration",
"cost": 20,
"chargeup": 0,
"cooldown": 60,
"base_properties": {
"effect_radius": 5,
"effect_duration": 300
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB