diff --git a/src/main/java/electroblob/wizardry/registry/Spells.java b/src/main/java/electroblob/wizardry/registry/Spells.java index 697eaff6..79b5ab84 100644 --- a/src/main/java/electroblob/wizardry/registry/Spells.java +++ b/src/main/java/electroblob/wizardry/registry/Spells.java @@ -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()); diff --git a/src/main/java/electroblob/wizardry/spell/BlindingFlash.java b/src/main/java/electroblob/wizardry/spell/BlindingFlash.java new file mode 100644 index 00000000..21d10dd0 --- /dev/null +++ b/src/main/java/electroblob/wizardry/spell/BlindingFlash.java @@ -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); + } +} diff --git a/src/main/resources/assets/ebwizardry/lang/en_gb.lang b/src/main/resources/assets/ebwizardry/lang/en_gb.lang index 9c06ce6a..325c1eb2 100644 --- a/src/main/resources/assets/ebwizardry/lang/en_gb.lang +++ b/src/main/resources/assets/ebwizardry/lang/en_gb.lang @@ -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. diff --git a/src/main/resources/assets/ebwizardry/lang/en_us.lang b/src/main/resources/assets/ebwizardry/lang/en_us.lang index b633dd56..4156c4bc 100644 --- a/src/main/resources/assets/ebwizardry/lang/en_us.lang +++ b/src/main/resources/assets/ebwizardry/lang/en_us.lang @@ -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. diff --git a/src/main/resources/assets/ebwizardry/sounds.json b/src/main/resources/assets/ebwizardry/sounds.json index 5ca316eb..ab443ce2 100644 --- a/src/main/resources/assets/ebwizardry/sounds.json +++ b/src/main/resources/assets/ebwizardry/sounds.json @@ -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"]}, diff --git a/src/main/resources/assets/ebwizardry/sounds/flash.ogg b/src/main/resources/assets/ebwizardry/sounds/flash.ogg new file mode 100644 index 00000000..3323b004 Binary files /dev/null and b/src/main/resources/assets/ebwizardry/sounds/flash.ogg differ diff --git a/src/main/resources/assets/ebwizardry/spells/blinding_flash.json b/src/main/resources/assets/ebwizardry/spells/blinding_flash.json new file mode 100644 index 00000000..b716c742 --- /dev/null +++ b/src/main/resources/assets/ebwizardry/spells/blinding_flash.json @@ -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 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ebwizardry/textures/spells/blinding_flash.png b/src/main/resources/assets/ebwizardry/textures/spells/blinding_flash.png new file mode 100644 index 00000000..09298467 Binary files /dev/null and b/src/main/resources/assets/ebwizardry/textures/spells/blinding_flash.png differ