From f9432c7c05af71c990a8d5be3dfc1ba0317f4fff Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Sun, 18 Oct 2020 01:17:31 +0100 Subject: [PATCH] Add celestial smite spell --- .../electroblob/wizardry/registry/Spells.java | 2 + .../wizardry/spell/CelestialSmite.java | 65 ++++++++++++++++++ .../assets/ebwizardry/lang/en_gb.lang | 4 +- .../assets/ebwizardry/lang/en_us.lang | 4 +- .../resources/assets/ebwizardry/sounds.json | 1 + .../ebwizardry/spells/celestial_smite.json | 25 +++++++ .../textures/spells/celestial_smite.png | Bin 0 -> 5457 bytes 7 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 src/main/java/electroblob/wizardry/spell/CelestialSmite.java create mode 100644 src/main/resources/assets/ebwizardry/spells/celestial_smite.json create mode 100644 src/main/resources/assets/ebwizardry/textures/spells/celestial_smite.png diff --git a/src/main/java/electroblob/wizardry/registry/Spells.java b/src/main/java/electroblob/wizardry/registry/Spells.java index 5827d72c..632a0852 100644 --- a/src/main/java/electroblob/wizardry/registry/Spells.java +++ b/src/main/java/electroblob/wizardry/registry/Spells.java @@ -255,6 +255,7 @@ public final class Spells { public static final Spell firestorm = placeholder(); public static final Spell zombie_apocalypse = placeholder(); public static final Spell boulder = placeholder(); + public static final Spell celestial_smite = placeholder(); @SubscribeEvent public static void register(RegistryEvent.Register event){ @@ -472,6 +473,7 @@ public final class Spells { registry.register(new Firestorm()); registry.register(new ZombieApocalypse()); registry.register(new Boulder()); + registry.register(new CelestialSmite()); } diff --git a/src/main/java/electroblob/wizardry/spell/CelestialSmite.java b/src/main/java/electroblob/wizardry/spell/CelestialSmite.java new file mode 100644 index 00000000..bc3e2566 --- /dev/null +++ b/src/main/java/electroblob/wizardry/spell/CelestialSmite.java @@ -0,0 +1,65 @@ +package electroblob.wizardry.spell; + +import electroblob.wizardry.item.SpellActions; +import electroblob.wizardry.registry.WizardryItems; +import electroblob.wizardry.util.*; +import electroblob.wizardry.util.MagicDamage.DamageType; +import electroblob.wizardry.util.ParticleBuilder.Type; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.World; + +import javax.annotation.Nullable; +import java.util.List; + +public class CelestialSmite extends SpellRay { + + public CelestialSmite(){ + super("celestial_smite", SpellActions.POINT, false); + addProperties(EFFECT_RADIUS, DAMAGE, BURN_DURATION); + } + + @Override + protected boolean onEntityHit(World world, Entity target, Vec3d hit, @Nullable EntityLivingBase caster, Vec3d origin, int ticksInUse, SpellModifiers modifiers){ + return false; + } + + @Override + protected boolean onBlockHit(World world, BlockPos pos, EnumFacing side, Vec3d hit, @Nullable EntityLivingBase caster, Vec3d origin, int ticksInUse, SpellModifiers modifiers){ + + double radius = getProperty(EFFECT_RADIUS).floatValue() * modifiers.get(WizardryItems.blast_upgrade); + + List targets = EntityUtils.getLivingWithinRadius(radius, hit.x, hit.y, hit.z, world); + + DamageSource source = caster == null ? DamageSource.MAGIC : MagicDamage.causeDirectMagicDamage(caster, DamageType.RADIANT); + float damage = getProperty(DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY); + + for(EntityLivingBase target : targets){ + target.attackEntityFrom(source, damage); + target.setFire(getProperty(BURN_DURATION).intValue()); + } + + if(world.isRemote){ + + ParticleBuilder.create(Type.BEAM).pos(hit.x, world.getActualHeight(), hit.z).target(hit).scale(8) + .clr(0xffbf00).time(10).spawn(world); + ParticleBuilder.create(Type.SPHERE).pos(hit).scale(4).clr(0xfff098).spawn(world); + + if(side == EnumFacing.UP){ + Vec3d vec = hit.add(new Vec3d(side.getDirectionVec()).scale(GeometryUtils.ANTI_Z_FIGHTING_OFFSET)); + ParticleBuilder.create(Type.SCORCH).pos(vec).face(side).scale(3).spawn(world); + } + } + + return true; + } + + @Override + protected boolean onMiss(World world, @Nullable EntityLivingBase caster, Vec3d origin, Vec3d direction, int ticksInUse, SpellModifiers modifiers){ + return false; + } +} diff --git a/src/main/resources/assets/ebwizardry/lang/en_gb.lang b/src/main/resources/assets/ebwizardry/lang/en_gb.lang index 82d1fc1e..2d28f970 100644 --- a/src/main/resources/assets/ebwizardry/lang/en_gb.lang +++ b/src/main/resources/assets/ebwizardry/lang/en_gb.lang @@ -785,6 +785,7 @@ spell.ebwizardry\:blink=Blink spell.ebwizardry\:blizzard=Blizzard spell.ebwizardry\:boulder=Boulder spell.ebwizardry\:bubble=Bubble +spell.ebwizardry\:celestial_smite=Celestial Smite spell.ebwizardry\:chain_lightning=Chain Lightning spell.ebwizardry\:charge=Charge spell.ebwizardry\:clairvoyance=Clairvoyance @@ -971,6 +972,7 @@ spell.ebwizardry\:blink.desc=Teleports the caster over a short distance to where 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\:boulder.desc="Let the world be my bowling alley, and my foes be the pins!" 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. +spell.ebwizardry\:celestial_smite.desc="Oh powers divine, I call upon thee now! Rid this land of dark creatures most foul!" spell.ebwizardry\:chain_lightning.desc=Fires a spark of lightning at the target, which then chains to additional targets up to twice. spell.ebwizardry\:charge.desc=Causes the caster to charge rapidly in the direction they are looking, damaging and knocking back anything in their path. spell.ebwizardry\:clairvoyance.desc=Reveals the path to a remembered location. With this spell selected, sneak-right-click on a block to set the location. Cast this spell normally to reveal the path. The path will fade after 90 seconds. @@ -1008,7 +1010,7 @@ spell.ebwizardry\:firebomb.desc=Lanches a firebomb in the direction you are poin spell.ebwizardry\:fire_resistance.desc=Grants the caster fire resistance for 30 seconds. spell.ebwizardry\:fire_sigil.desc=Places a magical fire trap on the ground which damages and sets on fire the creature that triggers it. spell.ebwizardry\:fireskin.desc=Cloaks the caster in flames for 30 seconds, causing anything that attacks them to catch fire. -spell.ebwizardry\:firestorm.desc="Purge the land and purge the soil!\nTrees shall burn and lakes shall boil!\nTorch the wood and scorch the stone!\nAll bow before the fiery throne!" +spell.ebwizardry\:firestorm.desc="Purge the land and purge the soil!\nTrees shall burn and lakes shall boil!\nTorch the wood and scorch the stone!\nAll bow before the infernal throne!" spell.ebwizardry\:fire_breath.desc="I am the dragon." spell.ebwizardry\:flame_ray.desc=Creates a stream of flames in the direction you are pointing which sets on fire and continually damages targets. spell.ebwizardry\:flaming_axe.desc=Creates a flaming axe which sets enemies on fire when hit. Lasts for 30 seconds. diff --git a/src/main/resources/assets/ebwizardry/lang/en_us.lang b/src/main/resources/assets/ebwizardry/lang/en_us.lang index f5515718..244eeb15 100644 --- a/src/main/resources/assets/ebwizardry/lang/en_us.lang +++ b/src/main/resources/assets/ebwizardry/lang/en_us.lang @@ -785,6 +785,7 @@ spell.ebwizardry\:blink=Blink spell.ebwizardry\:blizzard=Blizzard spell.ebwizardry\:boulder=Boulder spell.ebwizardry\:bubble=Bubble +spell.ebwizardry\:celestial_smite=Celestial Smite spell.ebwizardry\:chain_lightning=Chain Lightning spell.ebwizardry\:charge=Charge spell.ebwizardry\:clairvoyance=Clairvoyance @@ -971,6 +972,7 @@ spell.ebwizardry\:blink.desc=Teleports the caster over a short distance to where 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\:boulder.desc="Let the world be my bowling alley, and my foes be the pins!" 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. +spell.ebwizardry\:celestial_smite.desc="Oh powers divine, I call upon thee now! Rid this land of dark creatures most foul!" spell.ebwizardry\:chain_lightning.desc=Fires a spark of lightning at the target, which then chains to additional targets up to twice. spell.ebwizardry\:charge.desc=Causes the caster to charge rapidly in the direction they are looking, damaging and knocking back anything in their path. spell.ebwizardry\:clairvoyance.desc=Reveals the path to a remembered location. With this spell selected, sneak-right-click on a block to set the location. Cast this spell normally to reveal the path. The path will fade after 90 seconds. @@ -1008,7 +1010,7 @@ spell.ebwizardry\:firebomb.desc=Lanches a firebomb in the direction you are poin spell.ebwizardry\:fire_resistance.desc=Grants the caster fire resistance for 30 seconds. spell.ebwizardry\:fire_sigil.desc=Places a magical fire trap on the ground which damages and sets on fire the creature that triggers it. spell.ebwizardry\:fireskin.desc=Cloaks the caster in flames for 30 seconds, causing anything that attacks them to catch fire. -spell.ebwizardry\:firestorm.desc="Purge the land and purge the soil!\nTrees shall burn and lakes shall boil!\nTorch the wood and scorch the stone!\nAll bow before the fiery throne!" +spell.ebwizardry\:firestorm.desc="Purge the land and purge the soil!\nTrees shall burn and lakes shall boil!\nTorch the wood and scorch the stone!\nAll bow before the infernal throne!" spell.ebwizardry\:fire_breath.desc="I am the dragon." spell.ebwizardry\:flame_ray.desc=Creates a stream of flames in the direction you are pointing which sets on fire and continually damages targets. spell.ebwizardry\:flaming_axe.desc=Creates a flaming axe which sets enemies on fire when hit. Lasts for 30 seconds. diff --git a/src/main/resources/assets/ebwizardry/sounds.json b/src/main/resources/assets/ebwizardry/sounds.json index b7c338c3..0b177cdf 100644 --- a/src/main/resources/assets/ebwizardry/sounds.json +++ b/src/main/resources/assets/ebwizardry/sounds.json @@ -141,6 +141,7 @@ "spell.boulder": {"category": "spells", "sounds": ["mob/evocation_illager/prepare_attack1", "mob/evocation_illager/prepare_attack2"]}, "spell.bubble.shoot": {"category": "spells", "sounds": ["ebwizardry:ice"]}, "spell.bubble.splash": {"category": "spells", "sounds": ["liquid/swim1", "liquid/swim2", "liquid/swim3", "liquid/swim4"], "volume": 2}, + "spell.celestial_smite": {"category": "spells", "sounds": ["mob/illusion_illager/prepare_blind"]}, "spell.chain_lightning": {"category": "spells", "sounds": ["ebwizardry:arc1", "ebwizardry:arc2", "ebwizardry:arc3"]}, "spell.charge": {"category": "spells", "sounds": ["ebwizardry:shockwave"]}, "spell.clairvoyance": {"category": "spells", "sounds": ["ebwizardry:conjure"]}, diff --git a/src/main/resources/assets/ebwizardry/spells/celestial_smite.json b/src/main/resources/assets/ebwizardry/spells/celestial_smite.json new file mode 100644 index 00000000..00c571b2 --- /dev/null +++ b/src/main/resources/assets/ebwizardry/spells/celestial_smite.json @@ -0,0 +1,25 @@ +{ + "enabled": { + "book": true, + "scroll": true, + "wands": true, + "npcs": true, + "dispensers": true, + "commands": true, + "treasure": true, + "trades": true, + "looting": true + }, + "tier": "master", + "element": "healing", + "type": "attack", + "cost": 100, + "chargeup": 25, + "cooldown": 200, + "base_properties": { + "range": 40, + "effect_radius": 3, + "damage": 8, + "burn_duration": 10 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ebwizardry/textures/spells/celestial_smite.png b/src/main/resources/assets/ebwizardry/textures/spells/celestial_smite.png new file mode 100644 index 0000000000000000000000000000000000000000..a2858b74c1a24026d4af817ee15e3ab9e50cf8cd GIT binary patch literal 5457 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANMky;UI*B|(Yh3I#>^X_+~x z3MG{VsS2qTnQ06R6}Q&TNS~&BQn2~|bIp>Ll8MhOGVfpJEvc#1*mU;Hw{f zG(XOYlRsT~-+o74JablE{QUiK<)wR{XTI;e7hmHuW6P$n>igI42`~MzOYYwM*!q6y zpSKI|{SU64`{ePn`}WVdByR7Rv8Y?U^+}~(lui|KXqD?&|X0-}m^L z7cs7Ubg%uF#i`GI(&_>GE@;?j{qOz$wX#I6S6R>DdeP+LMGMgTDf)Gt=AbVpQf$dax3a}?w1?FLTP)yysCP=xBuXx z=9TP=*~@zjANv^l&rZE|Gi`pdDlflr<4M@mpyp1phNIrjnfusyX5bpJNNg@-uy@Y zsP4bWCv%*>|L>R+{Nmok-^q9CI&R7NyL$RJOlduIWqJ1o+4H~F*giXzYj|2?_R7P> zYkLd5JC`qsxfPLqpK zy-EA(xP&w9+lM@c4~eqHYp)(;j&m7xo`|Qf}T>ibk*W|@8T~tJ13orV9PS@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