Removed the drake enchantment. Nice idea, but meh in execution.

This commit is contained in:
Sollace 2020-05-28 18:32:06 +02:00
parent d712554639
commit 5dcb74981b
4 changed files with 0 additions and 149 deletions

View file

@ -1,134 +0,0 @@
package com.minelittlepony.unicopia.magic.spell;
import javax.annotation.Nullable;
import com.minelittlepony.unicopia.entity.FollowCasterGoal;
import com.minelittlepony.unicopia.entity.SpellcastEntity;
import com.minelittlepony.unicopia.magic.Affinity;
import com.minelittlepony.unicopia.magic.Caster;
import com.minelittlepony.unicopia.magic.Spell;
import net.minecraft.entity.ai.goal.SwimGoal;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.math.Box;
/**
* Spike The Dragon, but in rock form.
*
* It follows you around and can pick up/carry other gems.
*
* @Deprecated Replace with a minion mob
*/
@Deprecated
public class FaithfulAssistantSpell extends AbstractSpell {
private static final Box EFFECT_BOUNDS = new Box(-2, -2, -2, 2, 2, 2);
@Nullable
private Spell piggyBackSpell;
@Override
public String getName() {
return "drake";
}
@Override
public Affinity getAffinity() {
return Affinity.GOOD;
}
@Override
public int getTint() {
return 0xFAEBD7;
}
@Override
public void setDead() {
super.setDead();
if (piggyBackSpell != null) {
piggyBackSpell.setDead();
}
}
@Override
public boolean allowAI() {
return true;
}
@Override
public boolean isDead() {
return super.isDead();
}
@Override
public boolean isDirty() {
return super.isDirty() || (piggyBackSpell != null && piggyBackSpell.isDirty());
}
@SuppressWarnings("unchecked")
@Override
public void onPlaced(Caster<?> caster) {
if (caster.getEntity() instanceof SpellcastEntity) {
SpellcastEntity living = (SpellcastEntity)caster.getEntity();
living.getNavigation().setCanSwim(false);
living.getGoals().add(1, new SwimGoal(living));
living.getGoals().add(2, new FollowCasterGoal<>((Caster<SpellcastEntity>)caster, 1, 4, 70));
living.setPos(living.getX(), living.getY(), living.getZ());
}
}
@Override
public boolean update(Caster<?> source) {
if (piggyBackSpell == null) {
Box bb = EFFECT_BOUNDS.offset(source.getOriginVector());
source.getWorld().getEntities(source.getEntity(), bb, e -> e instanceof SpellcastEntity).stream()
.map(i -> (SpellcastEntity)i)
.filter(i -> i.hasSpell() && !(i.getSpell() instanceof FaithfulAssistantSpell))
.findFirst().ifPresent(i -> {
piggyBackSpell = i.getSpell().copy();
piggyBackSpell.onPlaced(source);
i.setSpell(null);
setDirty(true);
});
}
if (piggyBackSpell != null) {
piggyBackSpell.update(source);
}
return true;
}
@Override
public void render(Caster<?> source) {
if (piggyBackSpell != null) {
piggyBackSpell.render(source);
}
}
@Override
public void toNBT(CompoundTag compound) {
super.toNBT(compound);
if (piggyBackSpell != null) {
compound.put("effect", SpellRegistry.toNBT(piggyBackSpell));
}
}
@Override
public void fromNBT(CompoundTag compound) {
super.fromNBT(compound);
if (compound.contains("effect")) {
if (piggyBackSpell != null) {
piggyBackSpell.fromNBT(compound.getCompound("effect"));
} else {
piggyBackSpell = SpellRegistry.instance().createEffectFromNBT(compound.getCompound("effect"));
}
}
}
}

View file

@ -43,7 +43,6 @@ public class SpellRegistry {
register(PortalSpell::new);
register(AwkwardSpell::new);
register(InfernoSpell::new);
register(FaithfulAssistantSpell::new);
register(RevealingSpell::new);
register(DarknessSpell::new);
register(FlameSpell::new);

View file

@ -147,9 +147,6 @@
"spell.ice": "Frost",
"spell.ice.tagline": "Ice I",
"spell.drake": "Assistance",
"spell.drake.tagline": "Golomancy I",
"curse.shield": "Repulsion",
"curse.shield.tagline": "Hostility I",

View file

@ -1,11 +0,0 @@
{
"type": "unicopia:enchanting_spell",
"input": { "item": "unicopia:gem" },
"ingredients": [
{ "item": "unicopia:gem", "spell": "charge" },
{ "item": "unicopia:corrupted_gem" },
{ "tag": "unicopia:life_elementals" },
{ "item": "minecraft:poppy" }
],
"result": { "item": "unicopia:gem", "spell": "drake" }
}