mirror of
https://github.com/SimplexDevelopment/ArcanumOcculta.git
synced 2025-07-06 23:33:04 +00:00
API completed, Implementation required (#1)
New API, ready to go. Implementations required.
This commit is contained in:
@ -0,0 +1,63 @@
|
||||
package app.simplexdev.arcanumocculta.spells.soul;
|
||||
|
||||
import app.simplexdev.arcanumocculta.api.caster.Caster;
|
||||
import app.simplexdev.arcanumocculta.api.caster.CasterLevel;
|
||||
import app.simplexdev.arcanumocculta.api.spell.AbstractSpell;
|
||||
import app.simplexdev.arcanumocculta.api.spell.SpellEffect;
|
||||
import app.simplexdev.arcanumocculta.api.spell.enums.Damages;
|
||||
import app.simplexdev.arcanumocculta.api.spell.enums.Durations;
|
||||
import app.simplexdev.arcanumocculta.api.spell.enums.ManaCosts;
|
||||
import app.simplexdev.arcanumocculta.api.wand.Wand;
|
||||
import app.simplexdev.arcanumocculta.util.SpellUtils;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
public final class SoulPebble extends AbstractSpell
|
||||
{
|
||||
public SoulPebble()
|
||||
{
|
||||
super("Soul Pebble",
|
||||
"soul_pebble",
|
||||
"Fires a small soul pebble",
|
||||
CasterLevel.APPRENTICE,
|
||||
Damages.MINIMAL,
|
||||
Durations.INSTANT,
|
||||
ManaCosts.MINIMAL_CAST,
|
||||
5L);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpellEffect[] getSpellEffects()
|
||||
{
|
||||
final SpellEffect[] effects = new SpellEffect[1];
|
||||
effects[0] = SpellUtils.soulEffectBase(baseDamage());
|
||||
return effects;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cast(Caster caster, Wand wand)
|
||||
{
|
||||
if (!this.checkManaCosts(caster))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Entity projectile = prepareProjectile(caster, Material.AIR);
|
||||
|
||||
while (!projectile.isOnGround() || !projectile.isDead())
|
||||
{
|
||||
tracer(projectile.getWorld(), projectile.getLocation(), Particle.SOUL);
|
||||
|
||||
if (!projectile.getNearbyEntities(1, 1, 1).isEmpty())
|
||||
{
|
||||
applyEffects(projectile.getNearbyEntities(1, 1, 1),
|
||||
caster);
|
||||
projectile.remove();
|
||||
}
|
||||
|
||||
if (projectile.isOnGround())
|
||||
projectile.remove();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user