forked from Upstream/mmocore
test
This commit is contained in:
parent
87331e11ff
commit
e653bf32e3
@ -1,6 +1,14 @@
|
|||||||
package net.Indyuce.mmocore.skill.list;
|
package net.Indyuce.mmocore.skill.list;
|
||||||
|
|
||||||
|
import io.lumine.mythic.lib.damage.DamageType;
|
||||||
|
import io.lumine.mythic.lib.version.VersionSound;
|
||||||
|
import net.Indyuce.mmocore.MMOCore;
|
||||||
|
import net.Indyuce.mmocore.api.util.math.formula.LinearValue;
|
||||||
|
import net.Indyuce.mmocore.api.util.math.particle.ParabolicProjectile;
|
||||||
import net.Indyuce.mmocore.skill.CasterMetadata;
|
import net.Indyuce.mmocore.skill.CasterMetadata;
|
||||||
|
import net.Indyuce.mmocore.skill.Skill;
|
||||||
|
import net.Indyuce.mmocore.skill.metadata.SkillMetadata;
|
||||||
|
import net.Indyuce.mmocore.skill.metadata.TargetSkillMetadata;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Particle;
|
import org.bukkit.Particle;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
@ -9,23 +17,13 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import net.Indyuce.mmocore.MMOCore;
|
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
|
||||||
import net.Indyuce.mmocore.skill.Skill;
|
|
||||||
import net.Indyuce.mmocore.skill.metadata.SkillMetadata;
|
|
||||||
import net.Indyuce.mmocore.skill.metadata.TargetSkillMetadata;
|
|
||||||
import net.Indyuce.mmocore.api.util.math.formula.LinearValue;
|
|
||||||
import net.Indyuce.mmocore.api.util.math.particle.ParabolicProjectile;
|
|
||||||
import io.lumine.mythic.lib.MythicLib;
|
|
||||||
import io.lumine.mythic.lib.api.AttackResult;
|
|
||||||
import io.lumine.mythic.lib.damage.DamageType;;
|
|
||||||
import io.lumine.mythic.lib.version.VersionSound;
|
|
||||||
|
|
||||||
public class Fire_Storm extends Skill {
|
public class Fire_Storm extends Skill {
|
||||||
public Fire_Storm() {
|
public Fire_Storm() {
|
||||||
super();
|
super();
|
||||||
setMaterial(Material.BLAZE_POWDER);
|
setMaterial(Material.BLAZE_POWDER);
|
||||||
setLore("Casts a flurry of 6 fire projectiles onto", "nearby enemies, proritizing the initial", "target. Each projectile deals &c{damage} &7damage", "and ignite the target for &c{ignite} &7seconds.", "", "&e{cooldown}s Cooldown", "&9Costs {mana} {mana_name}");
|
setLore("Casts a flurry of 6 fire projectiles onto", "nearby enemies, proritizing the initial",
|
||||||
|
"target. Each projectile deals &c{damage} &7damage", "and ignite the target for &c{ignite} &7seconds.", "",
|
||||||
|
"&e{cooldown}s Cooldown", "&9Costs {mana} {mana_name}");
|
||||||
|
|
||||||
addModifier("mana", new LinearValue(15, 2));
|
addModifier("mana", new LinearValue(15, 2));
|
||||||
addModifier("damage", new LinearValue(5, 3));
|
addModifier("damage", new LinearValue(5, 3));
|
||||||
@ -36,8 +34,7 @@ public class Fire_Storm extends Skill {
|
|||||||
@Override
|
@Override
|
||||||
public SkillMetadata whenCast(CasterMetadata caster, SkillInfo skill) {
|
public SkillMetadata whenCast(CasterMetadata caster, SkillInfo skill) {
|
||||||
TargetSkillMetadata cast = new TargetSkillMetadata(caster, skill, 20);
|
TargetSkillMetadata cast = new TargetSkillMetadata(caster, skill, 20);
|
||||||
if (!cast.isSuccessful() )
|
if (!cast.isSuccessful()) return cast;
|
||||||
return cast;
|
|
||||||
|
|
||||||
LivingEntity target = cast.getTarget();
|
LivingEntity target = cast.getTarget();
|
||||||
|
|
||||||
@ -50,7 +47,8 @@ public class Fire_Storm extends Skill {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (j++ > 5 || caster.getPlayer().isDead() || !caster.getPlayer().isOnline() || target.isDead() || !caster.getPlayer().getWorld().equals(target.getWorld())) {
|
if (j++ > 5 || caster.getPlayer().isDead() || !caster.getPlayer().isOnline() || target.isDead() || !caster.getPlayer().getWorld()
|
||||||
|
.equals(target.getWorld())) {
|
||||||
cancel();
|
cancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -58,7 +56,8 @@ public class Fire_Storm extends Skill {
|
|||||||
// TODO dynamic target location
|
// TODO dynamic target location
|
||||||
|
|
||||||
caster.getPlayer().getWorld().playSound(caster.getPlayer().getLocation(), Sound.BLOCK_FIRE_AMBIENT, 1, 1);
|
caster.getPlayer().getWorld().playSound(caster.getPlayer().getLocation(), Sound.BLOCK_FIRE_AMBIENT, 1, 1);
|
||||||
new ParabolicProjectile(caster.getPlayer().getLocation().add(0, 1, 0), target.getLocation().add(0, target.getHeight() / 2, 0), randomVector(caster.getPlayer()), () -> {
|
new ParabolicProjectile(caster.getPlayer().getLocation().add(0, 1, 0), target.getLocation().add(0, target.getHeight() / 2, 0),
|
||||||
|
randomVector(caster.getPlayer()), () -> {
|
||||||
target.getWorld().playSound(target.getLocation(), VersionSound.ENTITY_FIREWORK_ROCKET_TWINKLE.toSound(), 1, 2);
|
target.getWorld().playSound(target.getLocation(), VersionSound.ENTITY_FIREWORK_ROCKET_TWINKLE.toSound(), 1, 2);
|
||||||
target.getWorld().spawnParticle(Particle.SMOKE_NORMAL, target.getLocation().add(0, target.getHeight() / 2, 0), 8, 0, 0, 0, .15);
|
target.getWorld().spawnParticle(Particle.SMOKE_NORMAL, target.getLocation().add(0, target.getHeight() / 2, 0), 8, 0, 0, 0, .15);
|
||||||
caster.attack(target, damage, DamageType.SKILL, DamageType.PROJECTILE, DamageType.MAGIC);
|
caster.attack(target, damage, DamageType.SKILL, DamageType.PROJECTILE, DamageType.MAGIC);
|
||||||
|
Loading…
Reference in New Issue
Block a user