Merge branch 'master' of ssh://dev1.mineplex.com:7999/min/Mineplex

This commit is contained in:
Jonathan Williams 2014-04-04 15:02:42 -04:00
commit ddcc8a26b3
52 changed files with 681 additions and 202 deletions

View File

@ -254,15 +254,15 @@ public class UtilBlock
return blockUseSet.contains(block); return blockUseSet.contains(block);
} }
public static HashMap<Block, Double> getInRadius(Location loc, Double dR) public static HashMap<Block, Double> getInRadius(Location loc, double dR)
{ {
return getInRadius(loc, dR, 999); return getInRadius(loc, dR, 999);
} }
public static HashMap<Block, Double> getInRadius(Location loc, Double dR, double heightLimit) public static HashMap<Block, Double> getInRadius(Location loc, double dR, double heightLimit)
{ {
HashMap<Block, Double> blockList = new HashMap<Block, Double>(); HashMap<Block, Double> blockList = new HashMap<Block, Double>();
int iR = dR.intValue() + 1; int iR = (int)dR + 1;
for (int x=-iR ; x <= iR ; x++) for (int x=-iR ; x <= iR ; x++)
for (int z=-iR ; z <= iR ; z++) for (int z=-iR ; z <= iR ; z++)
@ -282,6 +282,26 @@ public class UtilBlock
return blockList; return blockList;
} }
public static HashMap<Block, Double> getInRadius(Block block, double dR)
{
HashMap<Block, Double> blockList = new HashMap<Block, Double>();
int iR = (int)dR + 1;
for (int x=-iR ; x <= iR ; x++)
for (int z=-iR ; z <= iR ; z++)
for (int y=-iR ; y <= iR ; y++)
{
Block curBlock = block.getRelative(x, y, z);
double offset = UtilMath.offset(block.getLocation(), curBlock.getLocation());
if (offset <= dR)
blockList.put(curBlock, 1 - (offset/dR));
}
return blockList;
}
public static boolean isBlock(ItemStack item) public static boolean isBlock(ItemStack item)
{ {
if (item == null) if (item == null)

View File

@ -49,13 +49,6 @@ public class Energy extends MiniClientPlugin<ClientEnergy>
//Get Exp Attribs //Get Exp Attribs
double energy = 0.4; double energy = 0.4;
//Sprint Reduce
if (cur.isSprinting())
{
Get(cur).LastEnergy = System.currentTimeMillis();
energy -= 0.2;
}
//Modify Energy //Modify Energy
EnergyEvent energyEvent = new EnergyEvent(cur, energy, EnergyChangeReason.Recharge); EnergyEvent energyEvent = new EnergyEvent(cur, energy, EnergyChangeReason.Recharge);
_plugin.getServer().getPluginManager().callEvent(energyEvent); _plugin.getServer().getPluginManager().callEvent(energyEvent);
@ -155,6 +148,7 @@ public class Energy extends MiniClientPlugin<ClientEnergy>
Get(player).MaxEnergyMods.remove(reason); Get(player).MaxEnergyMods.remove(reason);
} }
/* ENERGY NO LONGER USED ON ATTACK
public void AddEnergySwingMod(Player player, String reason, int amount) public void AddEnergySwingMod(Player player, String reason, int amount)
{ {
Get(player).SwingEnergyMods.put(reason, amount); Get(player).SwingEnergyMods.put(reason, amount);
@ -188,4 +182,5 @@ public class Energy extends MiniClientPlugin<ClientEnergy>
if (event.getEntity() instanceof Player) if (event.getEntity() instanceof Player)
ModifyEnergy((Player)event.getEntity(), -10); ModifyEnergy((Player)event.getEntity(), -10);
} }
*/
} }

View File

@ -55,7 +55,7 @@ public class PvpClass implements IPvpClass
_skillSet = new HashSet<ISkill>(); _skillSet = new HashSet<ISkill>();
_skillSet.addAll(_classes.GetSkillFactory().GetSkillsFor(this)); _skillSet.addAll(_classes.GetSkillFactory().GetSkillsFor(this));
_skillSet.addAll(_classes.GetSkillFactory().GetGlobalSkills()); _skillSet.addAll(_classes.GetSkillFactory().GetGlobalSkillsFor(this));
_skillDefault = _classes.GetSkillFactory().GetDefaultSkillsFor(this); _skillDefault = _classes.GetSkillFactory().GetDefaultSkillsFor(this);

View File

@ -1,5 +1,6 @@
package mineplex.minecraft.game.classcombat.Skill.Assassin; package mineplex.minecraft.game.classcombat.Skill.Assassin;
import org.bukkit.Effect;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -60,6 +61,7 @@ public class BackStab extends Skill
//Effect //Effect
damagee.getWorld().playSound(damagee.getLocation(), Sound.HURT_FLESH, 1f, 2f); damagee.getWorld().playSound(damagee.getLocation(), Sound.HURT_FLESH, 1f, 2f);
damagee.getWorld().playEffect(damagee.getLocation(), Effect.STEP_SOUND, 55);
return; return;
} }

View File

@ -17,9 +17,11 @@ import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilWorld; import mineplex.core.common.util.UtilWorld;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -119,8 +121,7 @@ public class Blink extends SkillActive
curRange += 0.2; curRange += 0.2;
//Smoke Trail //Smoke Trail
if (!lastSmoke.equals(newTarget.getBlock())) UtilParticle.PlayParticle(ParticleType.LARGE_SMOKE, newTarget.clone().add(0, 0.5, 0), 0, 0, 0, 0, 1);
lastSmoke.getWorld().playEffect(lastSmoke.getLocation(), Effect.SMOKE, 4);
lastSmoke = newTarget.getBlock(); lastSmoke = newTarget.getBlock();
} }
@ -182,8 +183,7 @@ public class Blink extends SkillActive
curRange += 0.2; curRange += 0.2;
//Smoke Trail //Smoke Trail
if (!lastSmoke.equals(newTarget.getBlock())) UtilParticle.PlayParticle(ParticleType.LARGE_SMOKE, newTarget.clone().add(0, 0.5, 0), 0, 0, 0, 0, 1);
lastSmoke.getWorld().playEffect(lastSmoke.getLocation(), Effect.SMOKE, 4);
lastSmoke = newTarget.getBlock(); lastSmoke = newTarget.getBlock();

View File

@ -3,6 +3,7 @@ package mineplex.minecraft.game.classcombat.Skill.Assassin;
import java.util.HashSet; import java.util.HashSet;
import java.util.WeakHashMap; import java.util.WeakHashMap;
import org.bukkit.Sound;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
@ -61,6 +62,9 @@ public class ComboAttack extends Skill
//Increase Repeat //Increase Repeat
_repeat.put(damager, Math.min(1 + level, _repeat.get(damager) + 1)); _repeat.put(damager, Math.min(1 + level, _repeat.get(damager) + 1));
_last.put(damager, System.currentTimeMillis()); _last.put(damager, System.currentTimeMillis());
//Sound
damager.getWorld().playSound(damager.getLocation(), Sound.NOTE_STICKS, 1f, 0.7f + (0.3f * _repeat.get(damager)));
} }
@EventHandler @EventHandler

View File

@ -21,7 +21,9 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -143,6 +145,10 @@ public class Evade extends SkillActive
if (target == null) if (target == null)
return; return;
//Effect
UtilParticle.PlayParticle(ParticleType.LARGE_SMOKE, damagee.getLocation(),
(float)(Math.random() - 0.5), (float)(Math.random() * 1.4), (float)(Math.random() - 0.5), 0, 10);
//Action //Action
Factory.Teleport().TP(damagee, target); Factory.Teleport().TP(damagee, target);

View File

@ -18,7 +18,9 @@ import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -116,9 +118,6 @@ public class Flash extends SkillActive
_flash.put(player, _flash.get(player) - 1); _flash.put(player, _flash.get(player) - 1);
//Smoke Trail
Block lastSmoke = player.getLocation().getBlock();
double maxRange = 6; double maxRange = 6;
double curRange = 0; double curRange = 0;
while (curRange <= maxRange) while (curRange <= maxRange)
@ -133,10 +132,7 @@ public class Flash extends SkillActive
curRange += 0.2; curRange += 0.2;
//Smoke Trail //Smoke Trail
if (!lastSmoke.equals(newTarget.getBlock())) UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, newTarget.clone().add(0, 0.5, 0), 0, 0, 0, 0, 1);
lastSmoke.getWorld().playEffect(lastSmoke.getLocation(), Effect.SMOKE, 4);
lastSmoke = newTarget.getBlock();
} }
//Modify Range //Modify Range

View File

@ -174,7 +174,7 @@ public class MarkedForDeath extends SkillActive
for (Entity ent : _arrows) for (Entity ent : _arrows)
{ {
UtilParticle.PlayParticle(ParticleType.RED_DUST, ent.getLocation(), 0, 0, 0, 0, 1); UtilParticle.PlayParticle(ParticleType.MOB_SPELL, ent.getLocation(), 0, 0, 0, 0, 1);
} }
} }

View File

@ -21,8 +21,10 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilTime.TimeUnit; import mineplex.core.common.util.UtilTime.TimeUnit;
import mineplex.minecraft.game.classcombat.Skill.Skill; import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -58,7 +60,7 @@ public class Recall extends Skill
} }
@EventHandler @EventHandler
public void Crouch(PlayerDropItemEvent event) public void Activate(PlayerDropItemEvent event)
{ {
Player player = event.getPlayer(); Player player = event.getPlayer();
@ -78,7 +80,7 @@ public class Recall extends Skill
return; return;
//Use Recharge //Use Recharge
if (!Recharge.Instance.use(player, GetName(), GetName(level), 90000 - (15000 - level), true, true)) if (!Recharge.Instance.use(player, GetName(), GetName(level), 90000 - (15000 - level), true, false))
return; return;
//Use Energy //Use Energy
@ -106,6 +108,8 @@ public class Recall extends Skill
//Effect //Effect
player.getWorld().playEffect(player.getLocation(), Effect.STEP_SOUND, 133); player.getWorld().playEffect(player.getLocation(), Effect.STEP_SOUND, 133);
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_UNFECT, 2f, 2f); player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_UNFECT, 2f, 2f);
UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, player.getLocation(),
(float)(Math.random() - 0.5), (float)(Math.random() * 1.4), (float)(Math.random() - 0.5), 0, 20);
//Return //Return
Item item = _items.remove(player); Item item = _items.remove(player);
@ -116,8 +120,9 @@ public class Recall extends Skill
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + ".")); UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));
//Effect //Effect
player.getWorld().playEffect(player.getLocation(), Effect.STEP_SOUND, 133);
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_UNFECT, 2f, 2f); player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_UNFECT, 2f, 2f);
UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, player.getLocation(),
(float)(Math.random() - 0.5), (float)(Math.random() * 1.4), (float)(Math.random() - 0.5), 0, 20);
Reset(player); Reset(player);

View File

@ -60,7 +60,7 @@ public class SmokeBomb extends Skill
event.setCancelled(true); event.setCancelled(true);
if (!Recharge.Instance.use(player, GetName(), GetName(level), 120000 - (level * 30000), true, true)) if (!Recharge.Instance.use(player, GetName(), GetName(level), 120000 - (level * 30000), true, false))
return; return;
//Action //Action

View File

@ -19,9 +19,11 @@ import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.Skill; import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent; import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
@ -108,6 +110,10 @@ public class Stealth extends Skill
//Sound //Sound
player.getWorld().playSound(player.getLocation(), Sound.BLAZE_BREATH, 0.5f, 0.5f); player.getWorld().playSound(player.getLocation(), Sound.BLAZE_BREATH, 0.5f, 0.5f);
//Effect
UtilParticle.PlayParticle(ParticleType.LARGE_SMOKE, player.getLocation(),
(float)(Math.random() - 0.5), (float)(Math.random() * 1.4), (float)(Math.random() - 0.5), 0, 10);
} }
public void Remove(Player player, LivingEntity source) public void Remove(Player player, LivingEntity source)
@ -119,6 +125,10 @@ public class Stealth extends Skill
//Conditions //Conditions
Factory.Condition().EndCondition(player, null, GetName()); Factory.Condition().EndCondition(player, null, GetName());
//Effect
UtilParticle.PlayParticle(ParticleType.LARGE_SMOKE, player.getLocation(),
(float)(Math.random() - 0.5), (float)(Math.random() * 1.4), (float)(Math.random() - 0.5), 0, 10);
} }
@EventHandler @EventHandler

View File

@ -3,6 +3,7 @@ package mineplex.minecraft.game.classcombat.Skill.Brute;
import java.util.WeakHashMap; import java.util.WeakHashMap;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
@ -12,8 +13,10 @@ import mineplex.core.common.util.F;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.Skill; import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
@ -112,6 +115,19 @@ public class Bloodlust extends Skill
return false; return false;
} }
@EventHandler
public void Particle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Entity ent : _str.keySet())
{
UtilParticle.PlayParticle(ParticleType.RED_DUST, ent.getLocation(),
(float)(Math.random() - 0.5), 0.2f + (float)Math.random(), (float)(Math.random() - 0.5), 0, _str.get(ent) * 2);
}
}
@Override @Override
public void Reset(Player player) public void Reset(Player player)
{ {

View File

@ -115,7 +115,7 @@ public class FleshHook extends SkillActiveCharge implements IThrown
base + (charge * base), false, 0, 0.2, 20, false); base + (charge * base), false, 0, 0.2, 20, false);
Factory.Projectile().AddThrow(item, cur, this, -1, true, true, true, Factory.Projectile().AddThrow(item, cur, this, -1, true, true, true,
Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.FIREWORKS_SPARK, UpdateType.TICK, 1.5d); Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, UpdateType.TICK, 1.5d);
//Inform //Inform
UtilPlayer.message(cur, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + ".")); UtilPlayer.message(cur, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));

View File

@ -10,14 +10,17 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.Skill; import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.Skill.event.SkillEvent; import mineplex.minecraft.game.classcombat.Skill.event.SkillEvent;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -106,6 +109,18 @@ public class Stampede extends Skill
} }
} }
@EventHandler
public void Particle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Entity ent : _sprintStr.keySet())
{
UtilParticle.PlayParticle(ParticleType.CRIT, ent.getLocation(),
(float)(Math.random() - 0.5), 0.2f + (float)Math.random(), (float)(Math.random() - 0.5), 0, _sprintStr.get(ent) * 2);
}
}
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void Damage(CustomDamageEvent event) public void Damage(CustomDamageEvent event)

View File

@ -4,6 +4,8 @@ import java.util.HashMap;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -19,8 +21,10 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -177,6 +181,22 @@ public class Takedown extends SkillActive
//Inform //Inform
UtilPlayer.message(damager, F.main(GetClassType().name(), "You hit " + F.name(UtilEnt.getName(damagee)) + " with " + F.skill(GetName(level)) + ".")); UtilPlayer.message(damager, F.main(GetClassType().name(), "You hit " + F.name(UtilEnt.getName(damagee)) + " with " + F.skill(GetName(level)) + "."));
UtilPlayer.message(damagee, F.main(GetClassType().name(), F.name(damager.getName()) + " hit you with " + F.skill(GetName(level)) + ".")); UtilPlayer.message(damagee, F.main(GetClassType().name(), F.name(damager.getName()) + " hit you with " + F.skill(GetName(level)) + "."));
//Sound
damager.getWorld().playSound(damager.getLocation(), Sound.ZOMBIE_WOOD, 1f, 0.5f);
}
@EventHandler
public void Particle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Entity ent : _live.keySet())
{
UtilParticle.PlayParticle(ParticleType.CRIT, ent.getLocation(),
(float)(Math.random() - 0.5), (float)(Math.random() * 1.4), (float)(Math.random() - 0.5), 0, 4);
}
} }
@Override @Override

View File

@ -19,7 +19,7 @@ public class BreakFall extends Skill
SetDesc(new String[] SetDesc(new String[]
{ {
"You roll when you hit the ground;", "You roll when you hit the ground;",
"Fall damage is reduced by 2.", "Fall damage is reduced by #0#2.",
}); });
} }
@ -38,7 +38,7 @@ public class BreakFall extends Skill
int level = getLevel(player); int level = getLevel(player);
if (level == 0) return; if (level == 0) return;
event.AddMod(null, GetName(), -2, false); event.AddMod(null, GetName(), -(2 * level), false);
} }
@Override @Override

View File

@ -14,8 +14,7 @@ public class Fitness extends Skill
SetDesc(new String[] SetDesc(new String[]
{ {
"You are extremely fit;", "Maximum Energy is increased by #0#30 ( #0#16 %)."
"Maximum Energy is increased by 60 (33%)."
}); });
} }

View File

@ -20,9 +20,9 @@ public class Rations extends Skill
SetDesc(new String[] SetDesc(new String[]
{ {
"After not moving for 3 seconds,", "After not moving for #4#-1 seconds,",
"you snack on rations, slowly", "you snack on rations, replenishing",
"replenishing your hunger." "#0#1 hunger every second."
}); });
} }
@ -38,11 +38,11 @@ public class Rations extends Skill
if (level > 0) if (level > 0)
{ {
if (UtilTime.elapsed(Factory.Movement().Get(cur).LastMovement, 3000)) if (UtilTime.elapsed(Factory.Movement().Get(cur).LastMovement, 7000 - (1000 * level)))
{ {
cur.setSaturation(0f); cur.setSaturation(0f);
cur.setExhaustion(0f); cur.setExhaustion(0f);
UtilPlayer.hunger(cur, 1); UtilPlayer.hunger(cur, level);
} }
} }
} }

View File

@ -17,11 +17,11 @@ public class Recharge extends Skill
SetDesc(new String[] SetDesc(new String[]
{ {
"For every 1.5 seconds since you", "For every second since you",
"last used Energy, you receive", "last used Energy, you receive",
"+50% Energy regenerate rate.", "+ #0#20 % Energy regenerate rate.",
"", "",
"Maximum of +300% bonus." "Maximum of + #0#100 % bonus."
}); });
} }
@ -31,17 +31,18 @@ public class Recharge extends Skill
if (event.GetReason() != EnergyChangeReason.Recharge) if (event.GetReason() != EnergyChangeReason.Recharge)
return; return;
if (getLevel(event.GetPlayer()) <= 0) int level = getLevel(event.GetPlayer());
if (level <= 0)
return; return;
long duration = System.currentTimeMillis() - Factory.Energy().Get(event.GetPlayer()).LastEnergy; long duration = System.currentTimeMillis() - Factory.Energy().Get(event.GetPlayer()).LastEnergy;
int bonus = (int) (duration / 1500); int bonus = (int) (duration / 1000);
if (bonus > 6) if (bonus > 5)
bonus = 6; bonus = 5;
event.AddMod(bonus * 0.2); event.AddMod(bonus * (level * 0.08));
} }
@Override @Override

View File

@ -18,7 +18,7 @@ public class Resistance extends Skill
SetDesc(new String[] SetDesc(new String[]
{ {
"Your body and mind is exceptionally resistant.", "Your body and mind is exceptionally resistant.",
"Durations on you are 50% shorter for;", "Durations on you are #20#20 % shorter for;",
"Slow, Fire, Shock, Confusion, Poison, Blindness." "Slow, Fire, Shock, Confusion, Poison, Blindness."
}); });
} }
@ -27,13 +27,16 @@ public class Resistance extends Skill
public void Resist(ConditionApplyEvent event) public void Resist(ConditionApplyEvent event)
{ {
if (event.GetCondition().GetType() != ConditionType.BURNING && if (event.GetCondition().GetType() != ConditionType.BURNING &&
event.GetCondition().GetType() != ConditionType.SLOW &&
event.GetCondition().GetType() != ConditionType.SHOCK && event.GetCondition().GetType() != ConditionType.SHOCK &&
event.GetCondition().GetType() != ConditionType.CONFUSION && event.GetCondition().GetType() != ConditionType.CONFUSION &&
event.GetCondition().GetType() != ConditionType.POISON && event.GetCondition().GetType() != ConditionType.POISON &&
event.GetCondition().GetType() != ConditionType.BLINDNESS) event.GetCondition().GetType() != ConditionType.BLINDNESS)
return; return;
event.GetCondition().ModifyTicks((int) (event.GetCondition().GetTicksTotal() * 0.5)); double reduction = 0.2 + (0.2 * getLevel(event.GetCondition().GetEnt()));
event.GetCondition().ModifyTicks((int) (event.GetCondition().GetTicksTotal() * (1 - reduction)));
} }
@Override @Override

View File

@ -1,33 +0,0 @@
package mineplex.minecraft.game.classcombat.Skill.Global;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import org.bukkit.entity.Player;
public class Stamina extends Skill
{
public Stamina(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels)
{
super(skills, name, classType, skillType, cost, levels);
SetDesc(new String[]
{
"You have exceptional Stamina;",
"Swinging weapons uses 75% less Energy."
});
}
@Override
public void OnPlayerAdd(Player player)
{
Factory.Energy().AddEnergySwingMod(player, GetName(), -3);
}
@Override
public void Reset(Player player)
{
Factory.Energy().RemoveEnergySwingMod(player, GetName());
}
}

View File

@ -7,7 +7,7 @@ import mineplex.minecraft.game.classcombat.Class.IPvpClass;
public interface ISkillFactory public interface ISkillFactory
{ {
List<ISkill> GetGlobalSkills(); List<ISkill> GetGlobalSkillsFor(IPvpClass gameClass);
List<ISkill> GetSkillsFor(IPvpClass gameClass); List<ISkill> GetSkillsFor(IPvpClass gameClass);
HashMap<ISkill, Integer> GetDefaultSkillsFor(IPvpClass gameClass); HashMap<ISkill, Integer> GetDefaultSkillsFor(IPvpClass gameClass);
} }

View File

@ -3,19 +3,25 @@ package mineplex.minecraft.game.classcombat.Skill.Knight;
import org.bukkit.Effect; import org.bukkit.Effect;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action; import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.potion.PotionEffectType;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.core.condition.Condition.ConditionType; import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -113,6 +119,19 @@ public class BullsCharge extends SkillActive
"You hit " + F.name(UtilEnt.getName(damagee)) +" with " + F.skill(GetName(level)) + ".")); "You hit " + F.name(UtilEnt.getName(damagee)) +" with " + F.skill(GetName(level)) + "."));
} }
@EventHandler
public void Particle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : GetUsers())
{
if (player.hasPotionEffect(PotionEffectType.SPEED))
UtilParticle.PlayParticle(ParticleType.CRIT, player.getLocation(),
(float)(Math.random() - 0.5), 0.2f + (float)(Math.random() * 1), (float)(Math.random() - 0.5), 0, 3);
}
}
@Override @Override
public void Reset(Player player) public void Reset(Player player)

View File

@ -11,8 +11,10 @@ import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.Skill; import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -72,8 +74,6 @@ public class Fortitude extends Skill
double diff = _preHealth.remove(damagee) - damagee.getHealth(); double diff = _preHealth.remove(damagee) - damagee.getHealth();
System.out.println("Fortitude Diff: " + diff);
_health.put(damagee, Math.min(level,(int)(diff + 0.5))); _health.put(damagee, Math.min(level,(int)(diff + 0.5)));
_last.put(damagee, System.currentTimeMillis()); _last.put(damagee, System.currentTimeMillis());
} }
@ -101,6 +101,9 @@ public class Fortitude extends Skill
//Heal //Heal
UtilPlayer.health(cur, 1); UtilPlayer.health(cur, 1);
//Effect
UtilParticle.PlayParticle(ParticleType.HEART, cur.getEyeLocation(), 0, 0.2f, 0, 0, 1);
} }
} }

View File

@ -135,6 +135,9 @@ public class HiltSmash extends SkillActive
Factory.Damage().NewDamageEvent((LivingEntity)ent, player, null, Factory.Damage().NewDamageEvent((LivingEntity)ent, player, null,
DamageCause.ENTITY_ATTACK, 3 + level, false, true, false, DamageCause.ENTITY_ATTACK, 3 + level, false, true, false,
player.getName(), GetName()); player.getName(), GetName());
//Sound
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_WOOD, 1f, 1.4f);
} }
@EventHandler @EventHandler

View File

@ -7,13 +7,19 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action; import org.bukkit.event.block.Action;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.core.condition.Condition; import mineplex.minecraft.game.core.condition.Condition;
import mineplex.minecraft.game.core.condition.Condition.ConditionType; import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -93,6 +99,25 @@ public class HoldPosition extends SkillActive
event.SetKnockback(false); event.SetKnockback(false);
} }
@EventHandler
public void Particle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : GetUsers())
{
Condition data = Factory.Condition().GetActiveCondition(player, ConditionType.DAMAGE_RESISTANCE);
if (data == null) continue;
if (!data.GetReason().equals(GetName()))
continue;
UtilParticle.PlayParticle(ParticleType.MOB_SPELL, player.getLocation(),
(float)(Math.random() - 0.5), 0.2f + (float)(Math.random() * 1), (float)(Math.random() - 0.5), 0, 3 + getLevel(player));
}
}
@Override @Override
public void Reset(Player player) public void Reset(Player player)
{ {

View File

@ -15,9 +15,11 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -154,6 +156,8 @@ public class Riposte extends SkillActive
Factory.Energy().ModifyEnergy(damager, 20); Factory.Energy().ModifyEnergy(damager, 20);
UtilPlayer.health(damager, 1); UtilPlayer.health(damager, 1);
UtilParticle.PlayParticle(ParticleType.HEART, damager.getEyeLocation(), 0, 0.3f, 0, 0, 1);
//Inform //Inform
UtilPlayer.message(damager, F.main(GetClassType().name(), "You countered with " + F.skill(GetName(level)) + ".")); UtilPlayer.message(damager, F.main(GetClassType().name(), "You countered with " + F.skill(GetName(level)) + "."));
UtilPlayer.message(target, F.main(GetClassType().name(), F.name(damager.getName()) + " countered with " + F.skill(GetName(level)) + ".")); UtilPlayer.message(target, F.main(GetClassType().name(), F.name(damager.getName()) + " countered with " + F.skill(GetName(level)) + "."));

View File

@ -0,0 +1,122 @@
package mineplex.minecraft.game.classcombat.Skill.Knight;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.block.Action;
import org.bukkit.util.Vector;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilPlayer;
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
public class ShieldSmash extends SkillActive
{
public ShieldSmash(SkillFactory skills, String name, ClassType classType, SkillType skillType,
int cost, int levels,
int energy, int energyMod,
long recharge, long rechargeMod, boolean rechargeInform,
Material[] itemArray,
Action[] actionArray)
{
super(skills, name, classType, skillType,
cost, levels,
energy, energyMod,
recharge, rechargeMod, rechargeInform,
itemArray,
actionArray);
SetDesc(new String[]
{
"Smash your shield into an enemy,",
"dealing #1.6#0.2 knockback."
});
}
@Override
public boolean CustomCheck(Player player, int level)
{
if (player.getLocation().getBlock().getTypeId() == 8 || player.getLocation().getBlock().getTypeId() == 9)
{
UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " in water."));
return false;
}
if (!mineplex.core.recharge.Recharge.Instance.use(player, GetName() + " Cooldown", 250, false, false))
return false;
return true;
}
@Override
public void Skill(Player player, int level)
{
//AoE Area
Location loc = player.getLocation();
loc.add(player.getLocation().getDirection().setY(0).normalize().multiply(1.5));
loc.add(0, 0.8, 0);
//Particle
UtilParticle.PlayParticle(ParticleType.LARGE_SMOKE, loc, 0, 0, 0, 0, 1);
boolean hit = false;
for (Entity other : player.getWorld().getEntities())
{
if (!(other instanceof LivingEntity))
continue;
LivingEntity cur = (LivingEntity)other;
if (cur.equals(player))
continue;
if (UtilMath.offset(loc, cur.getLocation()) > 2)
continue;
hit = true;
Vector dir = player.getLocation().getDirection();
if (dir.getY() < 0)
dir.setY(0);
//Velocity
UtilAction.velocity(cur, dir, 1.6 + 0.2 * level, false, 0, 0.3, 0.8 + 0.05 * level, true);
//Condition
Factory.Condition().Factory().Falling(GetName(), cur, player, 10, false, true);
//Inform
UtilPlayer.message((Player)cur, F.main(GetClassType().name(), F.name(player.getName()) +" hit you with " + F.skill(GetName(level)) + "."));
}
if (hit)
{
//Inform
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName(level)) + "."));
//Sound
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_METAL, 1f, 0.9f);
}
else
{
//Inform
UtilPlayer.message(player, F.main("Skill", "You missed " + F.skill(GetName(level)) + "."));
}
}
@Override
public void Reset(Player player)
{
}
}

View File

@ -7,6 +7,7 @@ import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerDropItemEvent;
@ -17,8 +18,10 @@ import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.Skill; import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent; import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
@ -211,6 +214,19 @@ public class ArcticArmor extends Skill
} }
} }
@EventHandler
public void Particle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Entity ent : _active)
{
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, ent.getLocation(),
(float)(Math.random() - 0.5), 0.2f + (float)Math.random(), (float)(Math.random() - 0.5), 0, 3);
}
}
@Override @Override
public void Reset(Player player) public void Reset(Player player)
{ {

View File

@ -41,9 +41,8 @@ public class FireBlast extends SkillActive
{ {
"Launch a fireball which explodes on impact", "Launch a fireball which explodes on impact",
"dealing large knockback to enemies within", "dealing large knockback to enemies within",
"#3.5#1.5 Blocks range.", "#3.5#1.5 Blocks range. Also ignites enemies",
"", "for up to #2#2 seconds."
"#20#8 flames are spewed out, igniting players.",
}); });
} }
@ -107,17 +106,12 @@ public class FireBlast extends SkillActive
//Damage Event //Damage Event
Factory.Condition().Factory().Ignite(GetName(), cur, player, (2 + (2 * level)) * range, false, false); Factory.Condition().Factory().Ignite(GetName(), cur, player, (2 + (2 * level)) * range, false, false);
//Condition
Factory.Condition().Factory().Falling(GetName(), cur, player, 10, false, true);
//Velocity //Velocity
UtilAction.velocity(cur, UtilAlg.getTrajectory(proj.getLocation().add(0, -0.5, 0), cur.getEyeLocation()), UtilAction.velocity(cur, UtilAlg.getTrajectory(proj.getLocation().add(0, -0.5, 0), cur.getEyeLocation()),
0.5 + 1.5 * range, false, 0, 0.2 + 0.4 * range, 1.2, true); 0.5 + 1.5 * range, false, 0, 0.2 + 0.6 * range, 1.2, true);
}
//Fire
for (int i=0 ; i<20 * (level * 8) ; i++)
{
Item fire = player.getWorld().dropItem(proj.getLocation().add(0, 0.5, 0), ItemStackFactory.Instance.CreateStack(Material.FIRE));
fire.setVelocity(new Vector((Math.random() - 0.5)/2,Math.random()/2+0.5,(Math.random() - 0.5)/2));
Factory.Fire().Add(fire, player, 8, 2, 3, 0, GetName());
} }
} }

View File

@ -40,11 +40,12 @@ public class Fissure extends SkillActive
"creating an impassable wall.", "creating an impassable wall.",
"", "",
"Players struck by the initial slam", "Players struck by the initial slam",
"receive Slow 2 for 4 seconds", "receive Slow 3 for #2#0.5 seconds",
"", "",
"Players struck by the fissure", "Players struck by the fissure",
"receive (4 + Power) damage.", "receive #2#0.4 damage plus an ",
"Fissure gains Power as it extends" "additional #0.6#0.2 damage for",
"every block fissure has travelled."
}); });
} }

View File

@ -99,7 +99,7 @@ public class FissureData
if (UtilMath.offset(block.getLocation().add(0.5, 0.5, 0.5), cur.getLocation()) < 1.5) if (UtilMath.offset(block.getLocation().add(0.5, 0.5, 0.5), cur.getLocation()) < 1.5)
{ {
//Condition //Condition
Host.Factory.Condition().Factory().Slow("Fissure", cur, _player, 4, 1, false, true, true, true); Host.Factory.Condition().Factory().Slow("Fissure", cur, _player, 1 + _level, 2, false, true, true, true);
} }
} }
} }
@ -149,15 +149,15 @@ public class FissureData
//Damage //Damage
if (!_hit.contains(cur)) if (!_hit.contains(cur))
if (UtilMath.offset(up.getLocation().add(0.5, 0.5, 0.5), cur.getLocation()) < 1.5) if (UtilMath.offset(up.getLocation().add(0.5, 0.5, 0.5), cur.getLocation()) < 1.8)
{ {
_hit.add(cur); _hit.add(cur);
int damage = 4 + _handled; double damage = 2 + (0.4 * _level) + (_handled * (0.7 + 0.1 * _level));
//Damage Event //Damage Event
Host.Factory.Damage().NewDamageEvent(cur, _player, null, Host.Factory.Damage().NewDamageEvent(cur, _player, null,
DamageCause.CUSTOM, damage, false, false, false, DamageCause.CUSTOM, damage, true, false, false,
_player.getName(), "Fissure"); _player.getName(), "Fissure");
//Inform //Inform

View File

@ -14,9 +14,11 @@ import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.projectile.IThrown; import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser; import mineplex.core.projectile.ProjectileUser;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -39,7 +41,7 @@ public class GlacialBlade extends SkillActive implements IThrown
SetDesc(new String[] SetDesc(new String[]
{ {
"Swinging your sword releases a", "Swinging your sword releases a",
"shard of ice, dealing 5 damage", "shard of ice, dealing 4 damage",
"to anything it hits.", "to anything it hits.",
"", "",
"Will not work if enemies are close." "Will not work if enemies are close."
@ -63,8 +65,9 @@ public class GlacialBlade extends SkillActive implements IThrown
{ {
//Action //Action
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()).subtract(0, 0.2, 0), ItemStackFactory.Instance.CreateStack(370)); Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()).subtract(0, 0.2, 0), ItemStackFactory.Instance.CreateStack(370));
UtilAction.velocity(item, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false); UtilAction.velocity(item, player.getLocation().getDirection(), 1.6, false, 0, 0.2, 10, false);
Factory.Projectile().AddThrow(item, player, this, -1, true, true, true, 1.5d); Factory.Projectile().AddThrow(item, player, this, -1, true, true, true,
null, 0, 0, ParticleType.SNOW_SHOVEL, UpdateType.TICK, 1.5d);
//Effect //Effect
item.getWorld().playSound(item.getLocation(), Sound.ORB_PICKUP, 1f, 2f); item.getWorld().playSound(item.getLocation(), Sound.ORB_PICKUP, 1f, 2f);
@ -84,7 +87,7 @@ public class GlacialBlade extends SkillActive implements IThrown
//Damage //Damage
Factory.Damage().NewDamageEvent(target, data.GetThrower(), null, Factory.Damage().NewDamageEvent(target, data.GetThrower(), null,
DamageCause.CUSTOM, 5, true, true, false, DamageCause.CUSTOM, 4, true, true, false,
UtilEnt.getName(data.GetThrower()), GetName()); UtilEnt.getName(data.GetThrower()), GetName());
} }

View File

@ -0,0 +1,165 @@
package mineplex.minecraft.game.classcombat.Skill.Mage;
import java.util.HashMap;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.block.Action;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.common.util.F;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilPlayer;
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
public class IcePrison extends SkillActive implements IThrown
{
public IcePrison(SkillFactory skills, String name, ClassType classType, SkillType skillType,
int cost, int levels,
int energy, int energyMod,
long recharge, long rechargeMod, boolean rechargeInform,
Material[] itemArray,
Action[] actionArray)
{
super(skills, name, classType, skillType,
cost, levels,
energy, energyMod,
recharge, rechargeMod, rechargeInform,
itemArray,
actionArray);
SetDesc(new String[]
{
"Launch an icy orb. When it collides,",
"it creates a hollow sphere of ice",
"thats lasts for #2#1 seconds.",
});
}
@Override
public boolean CustomCheck(Player player, int level)
{
if (player.getLocation().getBlock().getTypeId() == 8 || player.getLocation().getBlock().getTypeId() == 9)
{
UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " in water."));
return false;
}
return true;
}
@Override
public void Skill(Player player, int level)
{
//Action
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(79));
item.setVelocity(player.getLocation().getDirection());
Factory.Projectile().AddThrow(item, player, this, System.currentTimeMillis() + 2000, true, false, false,
Sound.FIZZ, 0.6f, 1.6f, ParticleType.SNOW_SHOVEL, UpdateType.TICK, 2d);
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));
//Effect
item.getWorld().playSound(item.getLocation(), Sound.SILVERFISH_HIT, 2f, 1f);
}
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
Action(target, data);
}
@Override
public void Idle(ProjectileUser data)
{
Action(null, data);
}
@Override
public void Expire(ProjectileUser data)
{
Action(null, data);
}
public void Action(LivingEntity target, ProjectileUser data)
{
//Effect
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 79);
//Remove
data.GetThrown().remove();
//Thrower
if (!(data.GetThrower() instanceof Player))
return;
Player player = (Player)data.GetThrower();
//Level
int level = getLevel(player);
if (level == 0) return;
Block block = data.GetThrown().getLocation().getBlock();
//Sphere
HashMap<Block, Double> blocks = UtilBlock.getInRadius(block, 3.8d);
for (Block cur : blocks.keySet())
{
if (!UtilBlock.airFoliage(cur))
continue;
if (UtilMath.offset(block.getLocation(), cur.getLocation()) <= 2.9)
continue;
//Leave roof hole
if (cur.getX() == block.getX() && cur.getZ() == block.getZ() && cur.getY() > block.getY())
continue;
FreezeBlock(cur, block, level);
}
/*
FreezeBlock(block.getRelative(3, 0, 3), block, level);
FreezeBlock(block.getRelative(-3, 0, -3), block, level);
FreezeBlock(block.getRelative(-3, 0, 3), block, level);
FreezeBlock(block.getRelative(3, 0, -3), block, level);
*/
}
public void FreezeBlock(Block freeze, Block mid, int level)
{
if (!UtilBlock.airFoliage(freeze))
return;
long time = 4000 + (1000 * level);
int yDiff = freeze.getY() - mid.getY();
time -= yDiff * 1000 - Math.random() * 1000;
Factory.BlockRestore().Add(freeze, 79, (byte)0, time);
freeze.getWorld().playEffect(freeze.getLocation(), Effect.STEP_SOUND, 79);
}
@Override
public void Reset(Player player)
{
}
}

View File

@ -103,7 +103,7 @@ public class Inferno extends SkillActive
} }
//Fire //Fire
Item fire = cur.getWorld().dropItem(cur.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.FIRE)); Item fire = cur.getWorld().dropItem(cur.getEyeLocation().add(cur.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(Material.FIRE));
Factory.Fire().Add(fire, cur, 0.7, 0, 0.3 + (0.1 * level), 1, GetName()); Factory.Fire().Add(fire, cur, 0.7, 0, 0.3 + (0.1 * level), 1, GetName());
fire.teleport(cur.getEyeLocation()); fire.teleport(cur.getEyeLocation());

View File

@ -44,10 +44,10 @@ public class LightningOrb extends SkillActive implements IThrown
SetDesc(new String[] SetDesc(new String[]
{ {
"Launch a lightning orb. Upon a direct", "Launch a lightning orb. Upon a direct",
"hit with player, or 4 seconds, it will", "hit with player, or #5#-0.4 seconds, it will",
"strike all enemies with #3#1 Blocks ", "strike all enemies with #3#0.5 Blocks ",
"with lightning, giving them Slow 3", "with lightning, giving them Slow 3",
"for #2#2 seconds." "for #2#1 seconds."
}); });
} }
@ -69,7 +69,7 @@ public class LightningOrb extends SkillActive implements IThrown
//Action //Action
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(57)); Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(57));
item.setVelocity(player.getLocation().getDirection()); item.setVelocity(player.getLocation().getDirection());
Factory.Projectile().AddThrow(item, player, this, System.currentTimeMillis() + 4000, true, false, false, Factory.Projectile().AddThrow(item, player, this, System.currentTimeMillis() + 5000 - (400 * level), true, false, false,
Sound.FIZZ, 0.6f, 1.6f, ParticleType.FIREWORKS_SPARK, UpdateType.TICK, 1.5d); Sound.FIZZ, 0.6f, 1.6f, ParticleType.FIREWORKS_SPARK, UpdateType.TICK, 1.5d);
//Inform //Inform
@ -113,18 +113,18 @@ public class LightningOrb extends SkillActive implements IThrown
if (level == 0) return; if (level == 0) return;
HashMap<Player, Double> hit = UtilPlayer.getInRadius(data.GetThrown().getLocation(), 3 + level); HashMap<Player, Double> hit = UtilPlayer.getInRadius(data.GetThrown().getLocation(), 3 + 0.5 * level);
//Lightning Condition //Lightning Condition
for (Player cur : hit.keySet()) for (Player cur : hit.keySet())
{ {
Factory.Condition().Factory().Lightning(GetName(), cur, player, 2, 1, false, true); Factory.Condition().Factory().Lightning(GetName(), cur, player, 0, 0.5, false, true);
} }
//Lightning //Lightning
for (Player cur : hit.keySet()) for (Player cur : hit.keySet())
{ {
if (!UtilAlg.HasSight(data.GetThrown().getLocation(), cur)) if (cur.equals(player))
continue; continue;
//Inform //Inform
@ -137,8 +137,7 @@ public class LightningOrb extends SkillActive implements IThrown
//Apply Conditions //Apply Conditions
for (Player cur : hit.keySet()) for (Player cur : hit.keySet())
{ {
Factory.Condition().Factory().Shock(GetName(), cur, player, 1, false, true); Factory.Condition().Factory().Slow(GetName(), cur, player, 2 + (1 * level), 2, false, true, true, true);
Factory.Condition().Factory().Slow(GetName(), cur, player, 2 + (2 * level), 2, false, true, true, true);
} }
} }

View File

@ -23,7 +23,6 @@ import org.bukkit.util.Vector;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
@ -33,17 +32,14 @@ import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillActiveCharge;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
public class Rupture extends SkillActive public class Rupture extends SkillActiveCharge
{ {
private int maxPower = 5;
private HashSet<Item> _items = new HashSet<Item>(); private HashSet<Item> _items = new HashSet<Item>();
private WeakHashMap<Player, Location> _target = new WeakHashMap<Player, Location>(); private WeakHashMap<Player, Location> _target = new WeakHashMap<Player, Location>();
private WeakHashMap<Player, Integer> _charge = new WeakHashMap<Player, Integer>();
public Rupture(SkillFactory skills, String name, ClassType classType, SkillType skillType, public Rupture(SkillFactory skills, String name, ClassType classType, SkillType skillType,
int cost, int levels, int cost, int levels,
@ -57,7 +53,8 @@ public class Rupture extends SkillActive
energy, energyMod, energy, energyMod,
recharge, rechargeMod, rechargeInform, recharge, rechargeMod, rechargeInform,
itemArray, itemArray,
actionArray); actionArray,
0.01f, 0.005f);
SetDesc(new String[] SetDesc(new String[]
{ {
@ -67,9 +64,12 @@ public class Rupture extends SkillActive
"towards where you are looking,", "towards where you are looking,",
"giving Slow 2 to nearby opponents.", "giving Slow 2 to nearby opponents.",
"", "",
GetChargeString(),
"",
"Release Block to release the rupture,", "Release Block to release the rupture,",
"causing earth and players to fly upward,", "causing earth and players to fly upward,",
"dealing up to #3#1 inital damage." "dealing up to #3#1 inital damage."
}); });
} }
@ -79,6 +79,7 @@ public class Rupture extends SkillActive
return "Energy: #14#-2 per Second"; return "Energy: #14#-2 per Second";
} }
@SuppressWarnings("deprecation")
@Override @Override
public boolean CustomCheck(Player player, int level) public boolean CustomCheck(Player player, int level)
{ {
@ -101,7 +102,7 @@ public class Rupture extends SkillActive
public void Skill(Player player, int level) public void Skill(Player player, int level)
{ {
_target.put(player, player.getLocation().subtract(0, 1, 0)); _target.put(player, player.getLocation().subtract(0, 1, 0));
_charge.put(player, 0); _charge.put(player, 0f);
} }
public void Clean(Player player) public void Clean(Player player)
@ -157,21 +158,7 @@ public class Rupture extends SkillActive
continue; continue;
} }
//Charge Charge(cur);
if (Recharge.Instance.use(cur, GetName() + " Charge", 600, false, false))
{
int charge = 0;
if (_charge.containsKey(cur))
charge += _charge.get(cur);
if (charge < maxPower)
{
_charge.put(cur, charge + 1);
//Inform
UtilPlayer.message(cur, F.main(GetClassType().name(), GetName() + ": " + F.elem((_charge.get(cur) * (100/maxPower)) + "% Power")));
}
}
MoveRupture(cur); MoveRupture(cur);
} }
@ -269,12 +256,12 @@ public class Rupture extends SkillActive
public void DoRupture(Player player) public void DoRupture(Player player)
{ {
Location loc = _target.get(player); Location loc = _target.get(player);
int power = _charge.get(player); float charge = _charge.get(player);
Clean(player); Clean(player);
double range = 2 + 2 * (power/5d); double range = 2 + 2 * charge;
double mult = 0.5 + 0.5 * (power/maxPower); double mult = 0.5 + 0.5 * charge;
int level = getLevel(player); int level = getLevel(player);
@ -296,7 +283,7 @@ public class Rupture extends SkillActive
//Damage Event //Damage Event
Factory.Damage().NewDamageEvent(cur, player, null, Factory.Damage().NewDamageEvent(cur, player, null,
DamageCause.CUSTOM, 1 + ( ((double)power/(double)maxPower) * (3 + level)), false, true, false, DamageCause.CUSTOM, 1 + (charge * (3 + level)), false, true, false,
player.getName(), GetName()); player.getName(), GetName());
} }
@ -306,7 +293,7 @@ public class Rupture extends SkillActive
Block locBlock = loc.getBlock(); Block locBlock = loc.getBlock();
while (done < power * 12 && attempts < power * 100) while (done < charge * 40 && attempts < charge * 200)
{ {
attempts++; attempts++;
@ -325,7 +312,7 @@ public class Rupture extends SkillActive
vec.normalize(); vec.normalize();
//Scale //Scale
vec.multiply(0.1 + 0.3 * Math.random() + 0.6 * ((double)power/(double)maxPower)); vec.multiply(0.1 + 0.3 * Math.random() + 0.6 * charge);
//Block! //Block!
Item item = loc.getWorld().dropItem(side, ItemStackFactory.Instance.CreateStack(locBlock.getTypeId(), locBlock.getData())); Item item = loc.getWorld().dropItem(side, ItemStackFactory.Instance.CreateStack(locBlock.getTypeId(), locBlock.getData()));

View File

@ -73,8 +73,6 @@ public class Void extends Skill
//Remove Condition //Remove Condition
Factory.Condition().EndCondition(event.getPlayer(), null, GetName()); Factory.Condition().EndCondition(event.getPlayer(), null, GetName());
Factory.Energy().RemoveEnergySwingMod(player, GetName());
} }
else else
{ {
@ -86,8 +84,6 @@ public class Void extends Skill
//Remove Condition //Remove Condition
Factory.Condition().EndCondition(event.getPlayer(), null, GetName()); Factory.Condition().EndCondition(event.getPlayer(), null, GetName());
Factory.Energy().AddEnergySwingMod(player, GetName(), -4);
} }
} }

View File

@ -12,11 +12,15 @@ import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionEffectType;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.core.condition.Condition;
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -133,6 +137,20 @@ public class Agility extends SkillActive
_active.remove(cur); _active.remove(cur);
} }
@EventHandler
public void Particle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : _active)
{
if (player.isSprinting())
UtilParticle.PlayParticle(ParticleType.SPELL, player.getLocation(),
(float)(Math.random() - 0.5), 0.2f + (float)(Math.random() * 1), (float)(Math.random() - 0.5), 0, 4);
}
}
@Override @Override
public void Reset(Player player) public void Reset(Player player)
{ {

View File

@ -19,7 +19,9 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -113,6 +115,7 @@ public class Disengage extends SkillActive
//Effect //Effect
damagee.getWorld().playSound(damager.getLocation(), Sound.ZOMBIE_METAL, 0.5f, 1.6f); damagee.getWorld().playSound(damager.getLocation(), Sound.ZOMBIE_METAL, 0.5f, 1.6f);
UtilParticle.PlayParticle(ParticleType.ANGRY_VILLAGER, damager.getEyeLocation(), 0, 0, 0, 0, 1);
//Inform //Inform
UtilPlayer.message(damagee, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + ".")); UtilPlayer.message(damagee, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));

View File

@ -149,7 +149,7 @@ public class NapalmShot extends SkillActive
{ {
Entity arrow = arrowIterator.next(); Entity arrow = arrowIterator.next();
if (arrow.isDead() || !arrow.isValid()) if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround())
arrowIterator.remove(); arrowIterator.remove();
} }
} }

View File

@ -5,7 +5,9 @@ import java.util.WeakHashMap;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.minecraft.game.classcombat.Skill.SkillChargeBow; import mineplex.minecraft.game.classcombat.Skill.SkillChargeBow;
@ -14,6 +16,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.entity.Arrow; import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile; import org.bukkit.entity.Projectile;
@ -82,6 +85,18 @@ public class Overcharge extends SkillChargeBow
damagee.getWorld().playSound(damagee.getLocation(), Sound.HURT_FLESH, 1f, 0.5f); damagee.getWorld().playSound(damagee.getLocation(), Sound.HURT_FLESH, 1f, 0.5f);
} }
@EventHandler
public void Particle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Entity ent : _arrows.keySet())
{
UtilParticle.PlayParticle(ParticleType.RED_DUST, ent.getLocation(), 0, 0, 0, 0, 1);
}
}
@EventHandler @EventHandler
public void Clean(UpdateEvent event) public void Clean(UpdateEvent event)
{ {

View File

@ -4,10 +4,13 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.Skill; import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -42,6 +45,9 @@ public class VitalitySpores extends Skill
{ {
Factory.Condition().Factory().Regen(GetName(), cur, cur, 6.9, 0, false, true, true); Factory.Condition().Factory().Regen(GetName(), cur, cur, 6.9, 0, false, true, true);
UtilPlayer.health(cur, 1); UtilPlayer.health(cur, 1);
if (Recharge.Instance.use(cur, GetName(), 2000, false, false))
UtilParticle.PlayParticle(ParticleType.HEART, cur.getEyeLocation(), 0, 0.2f, 0, 0, 1);
} }
} }
} }

View File

@ -18,10 +18,12 @@ import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
@ -179,6 +181,19 @@ public class WolfsFury extends SkillActive
player.getWorld().playSound(player.getLocation(), Sound.WOLF_WHINE, 0.6f, 0.8f); player.getWorld().playSound(player.getLocation(), Sound.WOLF_WHINE, 0.6f, 0.8f);
} }
@EventHandler
public void Particle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : _active.keySet())
{
UtilParticle.PlayParticle(ParticleType.RED_DUST, player.getLocation(),
(float)(Math.random() - 0.5), 0.2f + (float)(Math.random() * 1), (float)(Math.random() - 0.5), 0, 4);
}
}
@Override @Override
public void Reset(Player player) public void Reset(Player player)
{ {

View File

@ -313,14 +313,14 @@ public abstract class Skill implements ISkill, Listener
public void DisplayProgress(Player player, String ability, float amount) public void DisplayProgress(Player player, String ability, float amount)
{ {
player.setExp(amount); //player.setExp(amount);
//UtilDisplay.displayTextBar(Factory.GetPlugin(), player, amount, C.cYellow + C.Bold + ability + ChatColor.RESET + " - " + C.cGreen + C.Bold + (int)(amount*100) + "%"); UtilDisplay.displayTextBar(Factory.GetPlugin(), player, amount, C.cYellow + C.Bold + ability + ChatColor.RESET + " - " + C.cGreen + C.Bold + (int)(amount*100) + "%");
player.playSound(player.getLocation(), Sound.NOTE_PIANO, 0.5f, 0.5f + (amount * 1.5f)); player.playSound(player.getLocation(), Sound.NOTE_PIANO, 0.5f, 0.5f + (amount * 1.5f));
} }
public void ResetProgress(Player player) public void ResetProgress(Player player)
{ {
player.setExp(0f); //player.setExp(0f);
} }
} }

View File

@ -150,12 +150,18 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
public void AddGlobal() public void AddGlobal()
{ {
//Passive C //Passive C
AddSkill(new BreakFall(this, "Break Fall", ClassType.Global, SkillType.GlobalPassive, 1, 1)); AddSkill(new BreakFall(this, "Break Fall", ClassType.Global, SkillType.GlobalPassive, 5, 3));
AddSkill(new Fitness(this, "Fitness", ClassType.Global, SkillType.GlobalPassive, 1, 1)); AddSkill(new Resistance(this, "Resistance", ClassType.Global, SkillType.GlobalPassive, 5, 4));
AddSkill(new Stamina(this, "Stamina", ClassType.Global, SkillType.GlobalPassive, 1, 1)); AddSkill(new Rations(this, "Rations", ClassType.Global, SkillType.GlobalPassive, 5, 2));
AddSkill(new Recharge(this, "Recharge", ClassType.Global, SkillType.GlobalPassive, 1, 1));
AddSkill(new Resistance(this, "Resistance", ClassType.Global, SkillType.GlobalPassive, 1, 1)); AddSkill(new Fitness(this, "Mana Pool", ClassType.Mage, SkillType.GlobalPassive, 5, 5));
AddSkill(new Rations(this, "Rations", ClassType.Global, SkillType.GlobalPassive, 1, 1)); AddSkill(new Recharge(this, "Mana Regeneration", ClassType.Mage, SkillType.GlobalPassive, 5, 3));
AddSkill(new Fitness(this, "Fitness", ClassType.Assassin, SkillType.GlobalPassive, 5, 3));
AddSkill(new Recharge(this, "Quick Recovery", ClassType.Assassin, SkillType.GlobalPassive, 5, 3));
//AddSkill(new Stamina(this, "Stamina", ClassType.Global, SkillType.GlobalPassive, 1, 1));
//AddSkill(new Swim(this, "Swim", ClassType.Global, SkillType.GlobalPassive, 1, 1)); //AddSkill(new Swim(this, "Swim", ClassType.Global, SkillType.GlobalPassive, 1, 1));
} }
@ -319,6 +325,13 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE}, new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK})); new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
AddSkill(new ShieldSmash(this, "Shield Smash", ClassType.Knight, SkillType.Axe,
5, 5,
0, 0,
8000, -1000, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
//Passive A //Passive A
AddSkill(new Cleave(this, "Cleave", ClassType.Knight, SkillType.PassiveA, 5, 3)); AddSkill(new Cleave(this, "Cleave", ClassType.Knight, SkillType.PassiveA, 5, 3));
@ -361,30 +374,40 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new FireBlast(this, "Fire Blast", ClassType.Mage, SkillType.Axe, AddSkill(new FireBlast(this, "Fire Blast", ClassType.Mage, SkillType.Axe,
5, 5, 5, 5,
40, -2, 40, -2,
4000, 0, true, 8000, -1000, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
AddSkill(new IcePrison(this, "Ice Prison", ClassType.Mage, SkillType.Axe,
5, 5,
40, -2,
21000, -1000, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE}, new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK})); new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
AddSkill(new LightningOrb(this, "Lightning Orb", ClassType.Mage, SkillType.Axe, AddSkill(new LightningOrb(this, "Lightning Orb", ClassType.Mage, SkillType.Axe,
5, 5, 5, 5,
40, -2, 40, -2,
4000, 0, true, 8000, -1000, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE}, new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK})); new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
AddSkill(new Fissure(this, "Fissure", ClassType.Mage, SkillType.Axe,
5, 5,
40, -3,
8000, -1000, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
/*
AddSkill(new FreezingBlast(this, "Freezing Blast", ClassType.Mage, SkillType.Axe, AddSkill(new FreezingBlast(this, "Freezing Blast", ClassType.Mage, SkillType.Axe,
5, 5, 5, 5,
40, -2, 40, -2,
4000, 0, true, 4000, 0, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE}, new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK})); new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
*/
AddSkill(new Fissure(this, "Fissure", ClassType.Mage, SkillType.Axe,
5, 5,
40, -2,
4000, 0, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
// AddSkill(new Tundra(this, "Tundra", ClassType.Mage, SkillType.Axe, 830, 200, 1)); // AddSkill(new Tundra(this, "Tundra", ClassType.Mage, SkillType.Axe, 830, 200, 1));
@ -636,13 +659,13 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
} }
@Override @Override
public List<ISkill> GetGlobalSkills() public List<ISkill> GetGlobalSkillsFor(IPvpClass gameClass)
{ {
List<ISkill> skills = new LinkedList<ISkill>(); List<ISkill> skills = new LinkedList<ISkill>();
for (ISkill cur : _skillMap.values()) for (ISkill cur : _skillMap.values())
{ {
if (cur.GetClassType() == ClassType.Global) if (cur.GetSkillType() == SkillType.GlobalPassive && (cur.GetClassType() == ClassType.Global || (gameClass != null && cur.GetClassType() == gameClass.GetType())))
{ {
skills.add(cur); skills.add(cur);
} }
@ -658,7 +681,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
for (ISkill cur : _skillMap.values()) for (ISkill cur : _skillMap.values())
{ {
if (cur.GetClassType() == gameClass.GetType()) if (cur.GetClassType() == gameClass.GetType() && cur.GetSkillType() != SkillType.GlobalPassive)
{ {
skills.add(cur); skills.add(cur);
} }

View File

@ -119,7 +119,7 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
int slotNumber = 46; int slotNumber = 46;
for (ISkill skill : Plugin.GetSkillFactory().GetGlobalSkills()) for (ISkill skill : Plugin.GetSkillFactory().GetGlobalSkillsFor(clientClass.GetGameClass()))
{ {
BuildSkillItem(skill, slotNumber++, clientClass); BuildSkillItem(skill, slotNumber++, clientClass);
} }

View File

@ -234,7 +234,7 @@ public class ConditionEffect implements Listener
ent.playEffect(EntityEffect.HURT); ent.playEffect(EntityEffect.HURT);
} }
@EventHandler @EventHandler(priority = EventPriority.LOWEST)
public void Lightning(CustomDamageEvent event) public void Lightning(CustomDamageEvent event)
{ {
if (event.IsCancelled()) if (event.IsCancelled())

View File

@ -72,7 +72,7 @@ public class Dominate extends TeamGame
this.DeathOut = false; this.DeathOut = false;
this.PrepareFreeze = false; this.PrepareFreeze = false;
this.DeathSpectateSecs = 8; this.DeathSpectateSecs = 10;
} }
@Override @Override

View File

@ -60,6 +60,9 @@ public class Emerald
_ent.setVelocity(new Vector(0,0,0)); _ent.setVelocity(new Vector(0,0,0));
_ent.teleport(_loc); _ent.teleport(_loc);
//Firework
UtilFirework.playFirework(_loc, FireworkEffect.builder().flicker(false).withColor(Color.GREEN).with(Type.BURST).trail(true).build());
//Block //Block
_loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.EMERALD_BLOCK); _loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.EMERALD_BLOCK);