Skip to content

Commit

Permalink
Fix Charge Animations. Rename Fire Bomb to Magma Bomb
Browse files Browse the repository at this point in the history
  • Loading branch information
iron431 committed Jun 26, 2023
1 parent 4439764 commit 2186b03
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<MutableComponent> getUniqueInfo(LivingEntity caster) {
Expand All @@ -32,8 +33,8 @@ public List<MutableComponent> 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;
Expand Down Expand Up @@ -73,4 +74,8 @@ public float getDamage(LivingEntity caster) {
return getSpellPower(caster);
}

@Override
public AnimationHolder getCastStartAnimation() {
return ANIMATION_CHARGED_CAST;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
10 changes: 5 additions & 5 deletions src/main/resources/assets/irons_spellbooks/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",

Expand Down Expand Up @@ -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",

Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 2186b03

Please sign in to comment.