mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 11:36:43 +01:00
Added Spell of Revealing
This commit is contained in:
parent
f7dc68b4bd
commit
78cfa7d515
3 changed files with 66 additions and 0 deletions
|
@ -0,0 +1,10 @@
|
|||
package com.minelittlepony.unicopia.spell;
|
||||
|
||||
public interface ISuppressable extends IMagicEffect {
|
||||
|
||||
boolean getSuppressed();
|
||||
|
||||
boolean isVulnerable(ICaster<?> otherSource, IMagicEffect other);
|
||||
|
||||
void onSuppressed(ICaster<?> otherSource);
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.minelittlepony.unicopia.spell;
|
||||
|
||||
import com.minelittlepony.unicopia.UParticles;
|
||||
import com.minelittlepony.unicopia.particle.Particles;
|
||||
import com.minelittlepony.util.shape.IShape;
|
||||
import com.minelittlepony.util.shape.Sphere;
|
||||
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
|
||||
public class SpellReveal extends AbstractSpell {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "reveal";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTint() {
|
||||
return 0x5CE81F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(ICaster<?> source) {
|
||||
source.findAllSpellsInRange(15).forEach(e -> {
|
||||
ISuppressable spell = e.getEffect(ISuppressable.class, false);
|
||||
|
||||
if (spell != null && spell.isVulnerable(source, this)) {
|
||||
spell.onSuppressed(source);
|
||||
source.getWorld().playSound(null, e.getOrigin(), SoundEvents.ENTITY_ZOMBIE_VILLAGER_CURE, SoundCategory.PLAYERS, 1, 1);
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(ICaster<?> source) {
|
||||
IShape area = new Sphere(false, 15);
|
||||
|
||||
source.spawnParticles(area, 5, pos -> {
|
||||
Particles.instance().spawnParticle(UParticles.UNICORN_MAGIC, false, pos, 0, 0, 0);
|
||||
});
|
||||
|
||||
source.spawnParticles(UParticles.UNICORN_MAGIC, 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpellAffinity getAffinity() {
|
||||
return SpellAffinity.GOOD;
|
||||
}
|
||||
|
||||
}
|
|
@ -44,6 +44,9 @@ spell.portal.tagline=Teleportation I
|
|||
spell.light.name=Illumination
|
||||
spell.light.tagline=Discovery I
|
||||
|
||||
spell.reveal.name=Revealing
|
||||
spell.reveal.tagline=Discovery II
|
||||
|
||||
spell.fire.name=Flame
|
||||
spell.fire.tagline=Fire I
|
||||
|
||||
|
|
Loading…
Reference in a new issue