From 2186b03087d748197b7de230a78dac935f294c23 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 26 Jun 2023 12:12:02 -0500 Subject: [PATCH] Fix Charge Animations. Rename Fire Bomb to Magma Bomb --- .../ironsspellbooks/config/ServerConfigs.java | 2 +- .../mobs/wizards/pyromancer/PyromancerEntity.java | 2 +- .../entity/spells/magma_ball/FireBomb.java | 2 +- .../io/redspace/ironsspellbooks/spells/SpellType.java | 4 ++-- .../fire/{FireBombSpell.java => MagmaBombSpell.java} | 11 ++++++++--- .../spells/lightning/LightningLanceSpell.java | 6 ++++++ .../resources/assets/irons_spellbooks/lang/en_us.json | 10 +++++----- 7 files changed, 24 insertions(+), 13 deletions(-) rename src/main/java/io/redspace/ironsspellbooks/spells/fire/{FireBombSpell.java => MagmaBombSpell.java} (89%) diff --git a/src/main/java/io/redspace/ironsspellbooks/config/ServerConfigs.java b/src/main/java/io/redspace/ironsspellbooks/config/ServerConfigs.java index 34ab3e974..9a23f6910 100644 --- a/src/main/java/io/redspace/ironsspellbooks/config/ServerConfigs.java +++ b/src/main/java/io/redspace/ironsspellbooks/config/ServerConfigs.java @@ -128,7 +128,7 @@ public class ServerConfigs { createSpellConfig(SpellType.FIREBOLT_SPELL, FireboltSpell.defaultConfig, true); createSpellConfig(SpellType.FIRE_BREATH_SPELL, FireBreathSpell.defaultConfig, true); createSpellConfig(SpellType.WALL_OF_FIRE_SPELL, WallOfFireSpell.defaultConfig, true); - createSpellConfig(SpellType.FIRE_BOMB_SPELL, FireBombSpell.defaultConfig, true); + createSpellConfig(SpellType.MAGMA_BOMB_SPELL, MagmaBombSpell.defaultConfig, true); //Holy BUILDER.comment("Holy Spells"); createSpellConfig(SpellType.ANGEL_WING_SPELL, AngelWingsSpell.defaultConfig, true); diff --git a/src/main/java/io/redspace/ironsspellbooks/entity/mobs/wizards/pyromancer/PyromancerEntity.java b/src/main/java/io/redspace/ironsspellbooks/entity/mobs/wizards/pyromancer/PyromancerEntity.java index 148784836..527c27143 100644 --- a/src/main/java/io/redspace/ironsspellbooks/entity/mobs/wizards/pyromancer/PyromancerEntity.java +++ b/src/main/java/io/redspace/ironsspellbooks/entity/mobs/wizards/pyromancer/PyromancerEntity.java @@ -43,7 +43,7 @@ protected void registerGoals() { List.of() ) .setDrinksPotions() - .setSingleUseSpell(SpellType.FIRE_BOMB_SPELL, 80, 200, 4, 6) + .setSingleUseSpell(SpellType.MAGMA_BOMB_SPELL, 80, 200, 4, 6) ); this.goalSelector.addGoal(3, new PatrolNearLocationGoal(this, 30, .75f)); this.goalSelector.addGoal(8, new LookAtPlayerGoal(this, Player.class, 8.0F)); diff --git a/src/main/java/io/redspace/ironsspellbooks/entity/spells/magma_ball/FireBomb.java b/src/main/java/io/redspace/ironsspellbooks/entity/spells/magma_ball/FireBomb.java index 93877c51f..ee7a3e4c9 100644 --- a/src/main/java/io/redspace/ironsspellbooks/entity/spells/magma_ball/FireBomb.java +++ b/src/main/java/io/redspace/ironsspellbooks/entity/spells/magma_ball/FireBomb.java @@ -70,7 +70,7 @@ protected void onHit(HitResult hitresult) { if (Utils.hasLineOfSight(level, hitresult.getLocation(), entity.position().add(0, entity.getEyeHeight() * .5f, 0), true)) { double p = (1 - Math.pow(Math.sqrt(distance) / (explosionRadius), 3)); float damage = (float) (this.damage * p); - DamageSources.applyDamage(entity, damage, SpellType.FIRE_BOMB_SPELL.getDamageSource(this, getOwner()), SchoolType.FIRE); + DamageSources.applyDamage(entity, damage, SpellType.MAGMA_BOMB_SPELL.getDamageSource(this, getOwner()), SchoolType.FIRE); } } } diff --git a/src/main/java/io/redspace/ironsspellbooks/spells/SpellType.java b/src/main/java/io/redspace/ironsspellbooks/spells/SpellType.java index f051df4c1..c755df202 100644 --- a/src/main/java/io/redspace/ironsspellbooks/spells/SpellType.java +++ b/src/main/java/io/redspace/ironsspellbooks/spells/SpellType.java @@ -96,7 +96,7 @@ public enum SpellType { BLACK_HOLE_SPELL(56, BlackHoleSpell::new), BlOOD_NEEDLES_SPELL(57, BloodNeedlesSpell::new), ACUPUNCTURE_SPELL(58, AcupunctureSpell::new), - FIRE_BOMB_SPELL(59, FireBombSpell::new), + MAGMA_BOMB_SPELL(59, MagmaBombSpell::new), STARFALL_SPELL(60, StarfallSpell::new), HEALING_CIRCLE_SPELL(61, HealingCircleSpell::new), GUIDING_BOLT_SPELL(62, GuidingBoltSpell::new), @@ -141,7 +141,7 @@ public static SpellType getTypeFromValue(int value) { public CastType getCastType() { return switch (this) { - case FIREBALL_SPELL, WISP_SPELL, FANG_STRIKE_SPELL, FANG_WARD_SPELL, SUMMON_VEX_SPELL, RAISE_DEAD_SPELL, GREATER_HEAL_SPELL, CHAIN_CREEPER_SPELL, INVISIBILITY_SPELL, SUMMON_POLAR_BEAR_SPELL, BLESSING_OF_LIFE_SPELL, FORTIFY_SPELL, VOID_TENTACLES_SPELL, SUMMON_HORSE_SPELL, ICE_BLOCK_SPELL, POISON_SPLASH_SPELL, BLIGHT_SPELL, ROOT_SPELL, HEALING_CIRCLE_SPELL, SUNBEAM_SPELL, LIGHTNING_LANCE_SPELL, MAGIC_ARROW_SPELL, POISON_ARROW_SPELL, ACID_ORB_SPELL, BLACK_HOLE_SPELL, FIRE_BOMB_SPELL, GUST_SPELL -> + case FIREBALL_SPELL, WISP_SPELL, FANG_STRIKE_SPELL, FANG_WARD_SPELL, SUMMON_VEX_SPELL, RAISE_DEAD_SPELL, GREATER_HEAL_SPELL, CHAIN_CREEPER_SPELL, INVISIBILITY_SPELL, SUMMON_POLAR_BEAR_SPELL, BLESSING_OF_LIFE_SPELL, FORTIFY_SPELL, VOID_TENTACLES_SPELL, SUMMON_HORSE_SPELL, ICE_BLOCK_SPELL, POISON_SPLASH_SPELL, BLIGHT_SPELL, ROOT_SPELL, HEALING_CIRCLE_SPELL, SUNBEAM_SPELL, LIGHTNING_LANCE_SPELL, MAGIC_ARROW_SPELL, POISON_ARROW_SPELL, ACID_ORB_SPELL, BLACK_HOLE_SPELL, MAGMA_BOMB_SPELL, GUST_SPELL -> CastType.LONG; case ELECTROCUTE_SPELL, CONE_OF_COLD_SPELL, FIRE_BREATH_SPELL, WALL_OF_FIRE_SPELL, CLOUD_OF_REGENERATION_SPELL, RAY_OF_SIPHONING_SPELL, BLAZE_STORM_SPELL, DRAGON_BREATH_SPELL, POISON_BREATH_SPELL, STARFALL_SPELL -> CastType.CONTINUOUS; diff --git a/src/main/java/io/redspace/ironsspellbooks/spells/fire/FireBombSpell.java b/src/main/java/io/redspace/ironsspellbooks/spells/fire/MagmaBombSpell.java similarity index 89% rename from src/main/java/io/redspace/ironsspellbooks/spells/fire/FireBombSpell.java rename to src/main/java/io/redspace/ironsspellbooks/spells/fire/MagmaBombSpell.java index 1c6292ff9..2bd8f5599 100644 --- a/src/main/java/io/redspace/ironsspellbooks/spells/fire/FireBombSpell.java +++ b/src/main/java/io/redspace/ironsspellbooks/spells/fire/MagmaBombSpell.java @@ -4,6 +4,7 @@ import io.redspace.ironsspellbooks.entity.spells.magma_ball.FireBomb; import io.redspace.ironsspellbooks.registries.SoundRegistry; import io.redspace.ironsspellbooks.spells.*; +import io.redspace.ironsspellbooks.util.AnimationHolder; import io.redspace.ironsspellbooks.util.Utils; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; @@ -14,7 +15,7 @@ import java.util.List; import java.util.Optional; -public class FireBombSpell extends AbstractSpell { +public class MagmaBombSpell extends AbstractSpell { @Override public List getUniqueInfo(LivingEntity caster) { @@ -32,8 +33,8 @@ public List getUniqueInfo(LivingEntity caster) { .setCooldownSeconds(12) .build(); - public FireBombSpell(int level) { - super(SpellType.FIRE_BOMB_SPELL); + public MagmaBombSpell(int level) { + super(SpellType.MAGMA_BOMB_SPELL); this.setLevel(level); this.manaCostPerLevel = 5; this.baseSpellPower = 8; @@ -73,4 +74,8 @@ public float getDamage(LivingEntity caster) { return getSpellPower(caster); } + @Override + public AnimationHolder getCastStartAnimation() { + return ANIMATION_CHARGED_CAST; + } } diff --git a/src/main/java/io/redspace/ironsspellbooks/spells/lightning/LightningLanceSpell.java b/src/main/java/io/redspace/ironsspellbooks/spells/lightning/LightningLanceSpell.java index 5f450b60c..2a749d684 100644 --- a/src/main/java/io/redspace/ironsspellbooks/spells/lightning/LightningLanceSpell.java +++ b/src/main/java/io/redspace/ironsspellbooks/spells/lightning/LightningLanceSpell.java @@ -4,6 +4,7 @@ import io.redspace.ironsspellbooks.entity.spells.lightning_lance.LightningLanceProjectile; import io.redspace.ironsspellbooks.registries.SoundRegistry; import io.redspace.ironsspellbooks.spells.*; +import io.redspace.ironsspellbooks.util.AnimationHolder; import io.redspace.ironsspellbooks.util.Utils; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; @@ -64,4 +65,9 @@ public void onCast(Level level, LivingEntity entity, PlayerMagicData playerMagic level.addFreshEntity(lance); super.onCast(level, entity, playerMagicData); } + + @Override + public AnimationHolder getCastStartAnimation() { + return ANIMATION_CHARGED_CAST; + } } diff --git a/src/main/resources/assets/irons_spellbooks/lang/en_us.json b/src/main/resources/assets/irons_spellbooks/lang/en_us.json index 4abcb3e88..ca20d40f4 100644 --- a/src/main/resources/assets/irons_spellbooks/lang/en_us.json +++ b/src/main/resources/assets/irons_spellbooks/lang/en_us.json @@ -325,7 +325,7 @@ "spell.irons_spellbooks.root": "Root", "spell.irons_spellbooks.blood_needles": "Blood Needles", "spell.irons_spellbooks.acupuncture": "Acupuncture", - "spell.irons_spellbooks.fire_bomb": "Fire Bomb", + "spell.irons_spellbooks.magma_bomb": "Magma Bomb", "spell.irons_spellbooks.starfall": "Starfall", "spell.irons_spellbooks.healing_circle": "Healing Circle", "spell.irons_spellbooks.guiding_bolt": "Guiding Bolt", @@ -392,7 +392,7 @@ "spell.irons_spellbooks.root.guide": "Around a targeted creature, sprout magical roots than entangle them and completely prevent non-magical movement", "spell.irons_spellbooks.blood_needles.guide": "Create a ring of needles made from blood and fire them forward, skewering targets and healing you for 25% of damage done", "spell.irons_spellbooks.acupuncture.guide": "Around a targeted creature, create a field of blood needles in every direction, shooting down and healing you for 25% of damage done", - "spell.irons_spellbooks.fire_bomb.guide": "Launch a bomb made from magma, exploding on impact and leaving a field of fire where it lands", + "spell.irons_spellbooks.magma_bomb.guide": "Launch a bomb made from magma, exploding on impact and leaving a field of fire where it lands", "spell.irons_spellbooks.starfall.guide": "Target a single area and continuously rain down arcane comets from above for the duration of the spell", "spell.irons_spellbooks.healing_circle.guide": "Around a targeted creature or block, place a stationary circle of holy magic that heals allies within", "spell.irons_spellbooks.guiding_bolt.guide": "Fire a slow bolt of holy energy. Creatures hit will gain the Guided effect, homing nearby projectiles in towards them", @@ -445,7 +445,7 @@ "death.attack.blood_needles_spell": "%1$s was skewered by %2$s's blood needles", "death.attack.fire_field": "%1$s cooked in %2$s's fiery field", "death.attack.starfall_spell": "%1$s was struck by %2$s's shooting stars", - "death.attack.fire_bomb_spell": "%1$s was blasted away by %2$s", + "death.attack.magma_bomb_spell": "%1$s was blasted away by %2$s", "death.attack.guiding_bolt_spell": "%1$s was led to the grave by %2$s", "death.attack.chain_lightning_spell": "%1$s was zapped to death by %2$s", @@ -488,7 +488,7 @@ "death.attack.blood_needles_spell.item": "%1$s was skewered by %2$s's blood needles while using %3$s", "death.attack.fire_field.item": "%1$s cooked in %2$s's fiery field while using %3$s", "death.attack.starfall_spell.item": "%1$s was struck by %2$s's shooting stars while using %3$s", - "death.attack.fire_bomb_spell.item": "%1$s blasted away by %2$s while using %3$s", + "death.attack.magma_bomb_spell.item": "%1$s blasted away by %2$s while using %3$s", "death.attack.guiding_bolt_spell.item": "%1$s was led to the grave by %2$s's %3$s", "death.attack.chain_lightning_spell.item": "%1$s was zapped to death by %2$s's %3$s", @@ -585,7 +585,7 @@ "entity.irons_spellbooks.acid_orb": "Acid Orb", "entity.irons_spellbooks.black_hole": "Black Hole", "entity.irons_spellbooks.blood_needle": "Blood Needle", - "entity.irons_spellbooks.fire_bomb": "Fire Bomb", + "entity.irons_spellbooks.magma_ball": "Magma Bomb", "entity.irons_spellbooks.fire_field": "Fiery Field", "entity.irons_spellbooks.target_area": "Target Area", "entity.irons_spellbooks.healing_aoe": "Healing Aoe",