From 0db343c959dcc06cc14659c8408f6e135150ea58 Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Sat, 10 Oct 2020 19:15:15 +0100 Subject: [PATCH] Add enrage spell --- .../electroblob/wizardry/registry/Spells.java | 2 + .../electroblob/wizardry/spell/Enrage.java | 52 ++++++++++++++++++ .../assets/ebwizardry/lang/en_gb.lang | 2 + .../assets/ebwizardry/lang/en_us.lang | 2 + .../resources/assets/ebwizardry/sounds.json | 1 + .../assets/ebwizardry/spells/enrage.json | 22 ++++++++ .../ebwizardry/textures/spells/enrage.png | Bin 0 -> 5369 bytes 7 files changed, 81 insertions(+) create mode 100644 src/main/java/electroblob/wizardry/spell/Enrage.java create mode 100644 src/main/resources/assets/ebwizardry/spells/enrage.json create mode 100644 src/main/resources/assets/ebwizardry/textures/spells/enrage.png diff --git a/src/main/java/electroblob/wizardry/registry/Spells.java b/src/main/java/electroblob/wizardry/registry/Spells.java index 286a9ab2..e9c5f1a8 100644 --- a/src/main/java/electroblob/wizardry/registry/Spells.java +++ b/src/main/java/electroblob/wizardry/registry/Spells.java @@ -243,6 +243,7 @@ public final class Spells { public static final Spell frost_barrier = placeholder(); public static final Spell blinding_flash = placeholder(); + public static final Spell enrage = placeholder(); public static final Spell mark_sacrifice = placeholder(); public static final Spell stormcloud = placeholder(); @@ -458,6 +459,7 @@ public final class Spells { registry.register(new FrostBarrier()); registry.register(new BlindingFlash()); + registry.register(new Enrage()); registry.register(new MarkSacrifice()); registry.register(new Stormcloud()); diff --git a/src/main/java/electroblob/wizardry/spell/Enrage.java b/src/main/java/electroblob/wizardry/spell/Enrage.java new file mode 100644 index 00000000..45003b49 --- /dev/null +++ b/src/main/java/electroblob/wizardry/spell/Enrage.java @@ -0,0 +1,52 @@ +package electroblob.wizardry.spell; + +import electroblob.wizardry.item.SpellActions; +import electroblob.wizardry.util.ParticleBuilder; +import electroblob.wizardry.util.ParticleBuilder.Type; +import electroblob.wizardry.util.SpellModifiers; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.Mod; + +import javax.annotation.Nullable; + +@Mod.EventBusSubscriber +public class Enrage extends SpellAreaEffect { + + public Enrage(){ + super("enrage", SpellActions.SUMMON, false); + this.alwaysSucceed(true); + } + + @Override + public boolean canBeCastBy(TileEntityDispenser dispenser){ + return false; + } + + @Override + protected boolean affectEntity(World world, Vec3d origin, @Nullable EntityLivingBase caster, EntityLivingBase target, int targetCount, int ticksInUse, SpellModifiers modifiers){ + + if(caster != null && target instanceof EntityCreature){ + target.setRevengeTarget(caster); // Yours truly, angry mobs + } + + return true; + } + + @Override + protected void spawnParticleEffect(World world, Vec3d origin, double radius, @Nullable EntityLivingBase caster, SpellModifiers modifiers){ + + if(caster != null) origin = caster.getPositionEyes(1); + + for(int i = 0; i < 30; i++){ + double x = origin.x - 1 + world.rand.nextDouble() * 2; + double y = origin.y - 0.25 + world.rand.nextDouble() * 0.5; + double z = origin.z - 1 + world.rand.nextDouble() * 2; + ParticleBuilder.create(Type.DARK_MAGIC).pos(x, y, z).clr(0.9f, 0.1f, 0).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 9d09419e..ea03f69f 100644 --- a/src/main/resources/assets/ebwizardry/lang/en_gb.lang +++ b/src/main/resources/assets/ebwizardry/lang/en_gb.lang @@ -810,6 +810,7 @@ spell.ebwizardry\:divination=Divination spell.ebwizardry\:dragon_fireball=Dragon Fireball spell.ebwizardry\:earthquake=Earthquake spell.ebwizardry\:empowering_presence=Empowering Presence +spell.ebwizardry\:enrage=Enrage spell.ebwizardry\:entrapment=Entrapment spell.ebwizardry\:evade=Evade spell.ebwizardry\:fangs=Fangs @@ -994,6 +995,7 @@ spell.ebwizardry\:divination.desc=Guides the caster to nearby ores and resources spell.ebwizardry\:dragon_fireball.desc=Launches an enderdragon fireball in the direction you are pointing, which releases lingering poisonous clouds on impact. spell.ebwizardry\:earthquake.desc=A true master of earth magic can move mountains. spell.ebwizardry\:empowering_presence.desc=Grants the caster and nearby allies increased magic damage for 30 seconds. +spell.ebwizardry\:enrage.desc=Causes nearby creatures to become enraged, stopping whatever they are doing to attack the caster instead. spell.ebwizardry\:entrapment.desc=Traps the target in a sphere of darkness which pulls it helplessly upwards and continually damages it. spell.ebwizardry\:evade.desc=Causes the caster to quickly jump sideways to dodge incoming attacks. spell.ebwizardry\:fangs.desc=Summons a row of evoker fangs in front of the caster that rise from the ground, biting mobs in their path. diff --git a/src/main/resources/assets/ebwizardry/lang/en_us.lang b/src/main/resources/assets/ebwizardry/lang/en_us.lang index 62439a62..010a52fb 100644 --- a/src/main/resources/assets/ebwizardry/lang/en_us.lang +++ b/src/main/resources/assets/ebwizardry/lang/en_us.lang @@ -810,6 +810,7 @@ spell.ebwizardry\:divination=Divination spell.ebwizardry\:dragon_fireball=Dragon Fireball spell.ebwizardry\:earthquake=Earthquake spell.ebwizardry\:empowering_presence=Empowering Presence +spell.ebwizardry\:enrage=Enrage spell.ebwizardry\:entrapment=Entrapment spell.ebwizardry\:evade=Evade spell.ebwizardry\:fangs=Fangs @@ -994,6 +995,7 @@ spell.ebwizardry\:divination.desc=Guides the caster to nearby ores and resources spell.ebwizardry\:dragon_fireball.desc=Launches an enderdragon fireball in the direction you are pointing, which releases lingering poisonous clouds on impact. spell.ebwizardry\:earthquake.desc=A true master of earth magic can move mountains. spell.ebwizardry\:empowering_presence.desc=Grants the caster and nearby allies increased magic damage for 30 seconds. +spell.ebwizardry\:enrage.desc=Causes nearby creatures to become enraged, stopping whatever they are doing to attack the caster instead. spell.ebwizardry\:entrapment.desc=Traps the target in a sphere of darkness which pulls it helplessly upwards and continually damages it. spell.ebwizardry\:evade.desc=Causes the caster to quickly jump sideways to dodge incoming attacks. spell.ebwizardry\:fangs.desc=Summons a row of evoker fangs in front of the caster that rise from the ground, biting mobs in their path. diff --git a/src/main/resources/assets/ebwizardry/sounds.json b/src/main/resources/assets/ebwizardry/sounds.json index f74362cf..f967a670 100644 --- a/src/main/resources/assets/ebwizardry/sounds.json +++ b/src/main/resources/assets/ebwizardry/sounds.json @@ -169,6 +169,7 @@ "spell.dragon_fireball": {"category": "spells", "sounds": ["mob/ghast/fireball4"]}, "spell.earthquake": {"category": "spells", "sounds": ["ebwizardry:rumble"]}, "spell.empowering_presence": {"category": "spells", "sounds": ["ebwizardry:buff"]}, + "spell.enrage": {"category": "spells", "sounds": ["mob/wither/idle1", "mob/wither/idle2", "mob/wither/idle3", "mob/wither/idle4"]}, "spell.entrapment": {"category": "spells", "sounds": ["mob/evocation_illager/prepare_attack1", "mob/evocation_illager/prepare_attack2"]}, "spell.evade": {"category": "spells", "sounds": ["random/bow"]}, "spell.fangs": {"category": "spells", "sounds": ["mob/evocation_illager/prepare_attack1", "mob/evocation_illager/prepare_attack2"]}, diff --git a/src/main/resources/assets/ebwizardry/spells/enrage.json b/src/main/resources/assets/ebwizardry/spells/enrage.json new file mode 100644 index 00000000..af7ce24a --- /dev/null +++ b/src/main/resources/assets/ebwizardry/spells/enrage.json @@ -0,0 +1,22 @@ +{ + "enabled": { + "book": true, + "scroll": true, + "wands": true, + "npcs": true, + "dispensers": true, + "commands": true, + "treasure": true, + "trades": true, + "looting": true + }, + "tier": "apprentice", + "element": "necromancy", + "type": "alteration", + "cost": 20, + "chargeup": 0, + "cooldown": 100, + "base_properties": { + "effect_radius": 8 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ebwizardry/textures/spells/enrage.png b/src/main/resources/assets/ebwizardry/textures/spells/enrage.png new file mode 100644 index 0000000000000000000000000000000000000000..6fcf177abd9b4f1ff14b9f88cce151ed1fa44178 GIT binary patch literal 5369 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANMks#PHoB|(Yh3I#>^X_+~x z3MG{VsS2qTnQ06R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