Champions achievement update
Wither update
This commit is contained in:
parent
4961b55986
commit
450cc9ada2
@ -519,7 +519,7 @@ public enum Achievement
|
|||||||
|
|
||||||
MICRO_BATTLE_ANNIHILATION("Annihilation", 1200,
|
MICRO_BATTLE_ANNIHILATION("Annihilation", 1200,
|
||||||
new String[]{"Micro Battle.Annihilation"},
|
new String[]{"Micro Battle.Annihilation"},
|
||||||
new String[]{"Kill 12 players in one game"},
|
new String[]{"Kill 9 players in one game"},
|
||||||
new int[]{1},
|
new int[]{1},
|
||||||
AchievementCategory.MICRO_BATTLE),
|
AchievementCategory.MICRO_BATTLE),
|
||||||
|
|
||||||
|
@ -857,9 +857,12 @@ public class ItemStackFactory extends MiniPlugin
|
|||||||
stack.setItemMeta(itemMeta);
|
stack.setItemMeta(itemMeta);
|
||||||
|
|
||||||
//Unbreakable
|
//Unbreakable
|
||||||
|
if (stack.getType().getMaxDurability() > 1)
|
||||||
|
{
|
||||||
ItemMeta meta = stack.getItemMeta();
|
ItemMeta meta = stack.getItemMeta();
|
||||||
meta.spigot().setUnbreakable(true);
|
meta.spigot().setUnbreakable(true);
|
||||||
stack.setItemMeta(meta);
|
stack.setItemMeta(meta);
|
||||||
|
}
|
||||||
|
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
@ -7,11 +7,15 @@ import net.minecraft.util.com.mojang.authlib.GameProfile;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Skeleton;
|
import org.bukkit.entity.Skeleton;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.entity.EntityDeathEvent;
|
import org.bukkit.event.entity.EntityDeathEvent;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
|
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
||||||
@ -19,12 +23,14 @@ import mineplex.core.updater.event.UpdateEvent;
|
|||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilAction;
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilBlock;
|
import mineplex.core.common.util.UtilBlock;
|
||||||
import mineplex.core.common.util.UtilEnt;
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilParticle;
|
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.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import mineplex.core.common.util.UtilWorld;
|
||||||
import mineplex.core.disguise.disguises.DisguisePlayer;
|
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||||
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;
|
||||||
@ -51,14 +57,17 @@ public class Illusion extends SkillActive
|
|||||||
|
|
||||||
SetDesc(new String[]
|
SetDesc(new String[]
|
||||||
{
|
{
|
||||||
"Block to go invisible, and create an",
|
"Hold Block to go invisible and create an",
|
||||||
"illusion of yourself that runs towards",
|
"illusion of yourself that runs towards",
|
||||||
"your target location.",
|
"your target location.",
|
||||||
"",
|
"",
|
||||||
"Invisibility ends if you release Block",
|
"Invisibility ends if you release Block",
|
||||||
"or your Illusion is killed.",
|
"or your Illusion is killed.",
|
||||||
"",
|
"",
|
||||||
"Lasts up to #2#2 seconds.",
|
"Illusion lasts up to #2#2 seconds.",
|
||||||
|
"",
|
||||||
|
"Gives Slow 2 for up to 4 seconds",
|
||||||
|
"to nearby players upon ending."
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +124,7 @@ public class Illusion extends SkillActive
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void Energy(UpdateEvent event)
|
public void update(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.TICK)
|
if (event.getType() != UpdateType.TICK)
|
||||||
return;
|
return;
|
||||||
@ -150,7 +159,7 @@ public class Illusion extends SkillActive
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void illusionDeath(EntityDeathEvent event)
|
public void illusionDeath(EntityDeathEvent event)
|
||||||
{
|
{
|
||||||
if (_active.containsValue(event.getEntity()))
|
if (_active.containsValue(event.getEntity()))
|
||||||
@ -160,20 +169,35 @@ public class Illusion extends SkillActive
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void end(Player cur)
|
private void end(Player player)
|
||||||
{
|
{
|
||||||
Factory.Condition().EndCondition(cur, null, GetName());
|
Factory.Condition().EndCondition(player, null, GetName());
|
||||||
|
|
||||||
Skeleton skel = _active.remove(cur);
|
Skeleton skel = _active.remove(player);
|
||||||
if (skel == null)
|
if (skel == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Ploop
|
//Level
|
||||||
|
int level = getLevel(player);
|
||||||
|
|
||||||
|
//Blind
|
||||||
|
HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(skel.getLocation(), 6d + 0.5 * level);
|
||||||
|
for (LivingEntity cur : targets.keySet())
|
||||||
|
{
|
||||||
|
if (cur.equals(player))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//Condition
|
||||||
|
Factory.Condition().Factory().Slow(GetName(), cur, player, 4 * targets.get(cur), 1, false, false, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Effect
|
||||||
UtilParticle.PlayParticle(ParticleType.LARGE_SMOKE, skel.getLocation().add(0, 1, 0), 0.3f, 0.3f, 0.3f, 0.06f, 30);
|
UtilParticle.PlayParticle(ParticleType.LARGE_SMOKE, skel.getLocation().add(0, 1, 0), 0.3f, 0.3f, 0.3f, 0.06f, 30);
|
||||||
|
|
||||||
for (int i=0 ; i<2 ; i++)
|
for (int i=0 ; i<2 ; i++)
|
||||||
skel.getWorld().playSound(skel.getLocation(), Sound.FIZZ, 2f, 0.4f);
|
skel.getWorld().playSound(skel.getLocation(), Sound.FIZZ, 2f, 0.4f);
|
||||||
|
|
||||||
|
skel.getEquipment().clear();
|
||||||
skel.remove();
|
skel.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,4 +37,6 @@ public interface ISkill
|
|||||||
|
|
||||||
Integer GetSalesPackageId();
|
Integer GetSalesPackageId();
|
||||||
int getMaxLevel();
|
int getMaxLevel();
|
||||||
|
|
||||||
|
boolean isAchievementSkill();
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,203 @@
|
|||||||
|
package mineplex.minecraft.game.classcombat.Skill.Knight;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import org.bukkit.Effect;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.Item;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
|
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
||||||
|
import mineplex.core.antistack.AntiStack;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilInv;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.projectile.IThrown;
|
||||||
|
import mineplex.core.projectile.ProjectileUser;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
||||||
|
|
||||||
|
public class AxeThrow extends SkillActive implements IThrown
|
||||||
|
{
|
||||||
|
private HashMap<Item, Player> _thrown = new HashMap<Item, Player>();
|
||||||
|
|
||||||
|
public AxeThrow(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[]
|
||||||
|
{
|
||||||
|
"Throw your axe with #0.8#0.1 velocity, ",
|
||||||
|
"dealing #7.5#0.5 damage.",
|
||||||
|
"",
|
||||||
|
"You pull your axe back to you when it",
|
||||||
|
"collides with anything.",
|
||||||
|
"",
|
||||||
|
"Your axe is returned to you if you do",
|
||||||
|
"not pick it up within #20#-2 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)
|
||||||
|
{
|
||||||
|
//Inform
|
||||||
|
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
|
||||||
|
|
||||||
|
//Throw
|
||||||
|
Item item = player.getWorld().dropItem(player.getEyeLocation(), player.getItemInHand());
|
||||||
|
UtilAction.velocity(item, player.getLocation().getDirection(), 0.8 + 0.1 * level, false, 0, 0.2, 10, true);
|
||||||
|
|
||||||
|
player.setItemInHand(null);
|
||||||
|
|
||||||
|
//Projectile
|
||||||
|
Factory.Projectile().AddThrow(item, player, this, -1, true, true, true, false, 2.5d);
|
||||||
|
|
||||||
|
//Store
|
||||||
|
_thrown.put(item, player);
|
||||||
|
|
||||||
|
//Inform
|
||||||
|
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||||
|
{
|
||||||
|
Rebound(data.GetThrower(), data.GetThrown());
|
||||||
|
|
||||||
|
if (target == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int level = getLevel(data.GetThrower());
|
||||||
|
if (level <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
double damage = 7.5 + 0.5 * level;
|
||||||
|
|
||||||
|
//Damage Event
|
||||||
|
Factory.Damage().NewDamageEvent(target, data.GetThrower(), null,
|
||||||
|
DamageCause.CUSTOM, damage, true, true, false,
|
||||||
|
UtilEnt.getName(data.GetThrower()), GetName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void Idle(ProjectileUser data)
|
||||||
|
{
|
||||||
|
Rebound(data.GetThrower(), data.GetThrown());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void Expire(ProjectileUser data)
|
||||||
|
{
|
||||||
|
Rebound(data.GetThrower(), data.GetThrown());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Rebound(LivingEntity player, Entity ent)
|
||||||
|
{
|
||||||
|
ent.getWorld().playSound(ent.getLocation(), Sound.ZOMBIE_WOOD, 0.6f, 0.5f);
|
||||||
|
|
||||||
|
double mult = 0.5 + (0.6 * (UtilMath.offset(player.getLocation(), ent.getLocation())/16d));
|
||||||
|
|
||||||
|
//Velocity
|
||||||
|
ent.setVelocity(player.getLocation().toVector().subtract(ent.getLocation().toVector()).normalize().add(new Vector(0, 0.4, 0)).multiply(mult));
|
||||||
|
|
||||||
|
//Ticks
|
||||||
|
if (ent instanceof Item)
|
||||||
|
((Item)ent).setPickupDelay(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void pickup(PlayerPickupItemEvent event)
|
||||||
|
{
|
||||||
|
if (!_thrown.containsKey(event.getItem()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
|
||||||
|
Player player = _thrown.remove(event.getItem());
|
||||||
|
|
||||||
|
AntiStack.removeUID(event.getItem());
|
||||||
|
player.getInventory().addItem(event.getItem().getItemStack());
|
||||||
|
|
||||||
|
UtilInv.Update(event.getPlayer());
|
||||||
|
|
||||||
|
event.getItem().remove();
|
||||||
|
|
||||||
|
player.playSound(player.getLocation(), Sound.CHICKEN_EGG_POP, 1f, 1f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void timeout(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.FAST)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Iterator<Item> itemIterator = _thrown.keySet().iterator();
|
||||||
|
|
||||||
|
while (itemIterator.hasNext())
|
||||||
|
{
|
||||||
|
Item item = itemIterator.next();
|
||||||
|
|
||||||
|
Player player = _thrown.get(item);
|
||||||
|
if (!player.isOnline())
|
||||||
|
{
|
||||||
|
item.remove();
|
||||||
|
itemIterator.remove();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int level = getLevel(player);
|
||||||
|
|
||||||
|
if (item.getTicksLived() > 400 - level * 40)
|
||||||
|
{
|
||||||
|
AntiStack.removeUID(item);
|
||||||
|
_thrown.get(item).getInventory().addItem(item.getItemStack());
|
||||||
|
item.remove();
|
||||||
|
itemIterator.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void Reset(Player player)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,152 @@
|
|||||||
|
package mineplex.minecraft.game.classcombat.Skill.Mage;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.NautHashMap;
|
||||||
|
import mineplex.core.common.util.UtilBlock;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilFirework;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.SkillChargeSword;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
||||||
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
|
|
||||||
|
import org.bukkit.Color;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.FireworkEffect.Type;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
|
|
||||||
|
public class StaticLazer extends SkillChargeSword
|
||||||
|
{
|
||||||
|
private NautHashMap<Player, Float> _chargeStore = new NautHashMap<Player, Float>();
|
||||||
|
|
||||||
|
public StaticLazer(SkillFactory skills, String name,
|
||||||
|
ClassType classType, SkillType skillType,
|
||||||
|
int cost, int maxLevel)
|
||||||
|
{
|
||||||
|
super(skills, name, classType, skillType, cost, maxLevel,
|
||||||
|
0.012f, 0.008f,
|
||||||
|
12000, -1000, true, true,
|
||||||
|
false, true);
|
||||||
|
|
||||||
|
SetDesc(new String[]
|
||||||
|
{
|
||||||
|
"Hold Block to charge static electricity.",
|
||||||
|
"Release Block to fire static lazer.",
|
||||||
|
"",
|
||||||
|
GetChargeString(),
|
||||||
|
"Taking damage cancels charge.",
|
||||||
|
"",
|
||||||
|
"Deals up to #7#1 damage and travels",
|
||||||
|
"up to #20#10 blocks.",
|
||||||
|
});
|
||||||
|
|
||||||
|
_fireOnFull = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String GetRechargeString()
|
||||||
|
{
|
||||||
|
return "Recharge: " + "#12#-1 Seconds";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void DoSkillCustom(Player player, float charge)
|
||||||
|
{
|
||||||
|
int level = getLevel(player);
|
||||||
|
if (level <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Action
|
||||||
|
double curRange = 0;
|
||||||
|
while (curRange <= 20 + 10 * level)
|
||||||
|
{
|
||||||
|
Location newTarget = player.getEyeLocation().add(player.getLocation().getDirection().multiply(curRange));
|
||||||
|
|
||||||
|
//Hit Player
|
||||||
|
HashMap<LivingEntity, Double> hits = UtilEnt.getInRadius(newTarget, 2);
|
||||||
|
hits.remove(player);
|
||||||
|
if (!hits.isEmpty())
|
||||||
|
break;
|
||||||
|
|
||||||
|
//Hit Block
|
||||||
|
if (!UtilBlock.airFoliage(newTarget.getBlock()))
|
||||||
|
break;
|
||||||
|
|
||||||
|
//Progress Forwards
|
||||||
|
curRange += 0.2;
|
||||||
|
|
||||||
|
//Smoke Trail
|
||||||
|
UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, newTarget, 0, 0, 0, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Destination
|
||||||
|
Location target = player.getLocation().add(player.getLocation().getDirection().multiply(curRange));
|
||||||
|
|
||||||
|
UtilParticle.PlayParticle(ParticleType.EXPLODE, target, 0, 0, 0, 0, 1);
|
||||||
|
|
||||||
|
//Firework
|
||||||
|
UtilFirework.playFirework(player.getLocation().add(player.getLocation().getDirection().multiply(Math.max(0, curRange - 0.6))), Type.BURST, Color.WHITE, false, false);
|
||||||
|
|
||||||
|
HashMap<LivingEntity, Double> hit = UtilEnt.getInRadius(target, 6);
|
||||||
|
for (LivingEntity other : hit.keySet())
|
||||||
|
{
|
||||||
|
if (other.equals(player))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//Do from center
|
||||||
|
if (UtilMath.offset(target, other.getLocation().add(0, 1, 0)) < 3)
|
||||||
|
{
|
||||||
|
//Damage Event
|
||||||
|
Factory.Damage().NewDamageEvent(other, player, null,
|
||||||
|
DamageCause.CUSTOM, 2 + (5 + level) * hit.get(other), true, true, false,
|
||||||
|
player.getName(), GetName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Inform
|
||||||
|
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(getLevel(player))) + "."));
|
||||||
|
|
||||||
|
//Effect
|
||||||
|
player.getWorld().playSound(player.getEyeLocation(), Sound.ZOMBIE_REMEDY, 0.5f + player.getExp(), 1.75f - charge);
|
||||||
|
|
||||||
|
_chargeStore.put(player, charge);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
|
public void damageCancelCharge(CustomDamageEvent event)
|
||||||
|
{
|
||||||
|
if (event.IsCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Damagee
|
||||||
|
Player damagee = event.GetDamageePlayer();
|
||||||
|
if (damagee == null) return;
|
||||||
|
|
||||||
|
if (_charge.remove(damagee) == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Inform
|
||||||
|
UtilPlayer.message(damagee, F.main(GetClassType().name(), F.skill(GetName()) + " was interrupted."));
|
||||||
|
|
||||||
|
//Effect
|
||||||
|
damagee.getWorld().playSound(damagee.getLocation(), Sound.ZOMBIE_REMEDY, 0.5f, 3f);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void Reset(Player player)
|
||||||
|
{
|
||||||
|
_charge.remove(player);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,252 @@
|
|||||||
|
package mineplex.minecraft.game.classcombat.Skill.Ranger;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Arrow;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Projectile;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.event.entity.EntityShootBowEvent;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
|
|
||||||
|
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.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
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.SkillFactory;
|
||||||
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
|
|
||||||
|
public class ExplosiveShot extends SkillActive
|
||||||
|
{
|
||||||
|
private HashSet<Arrow> _arrows = new HashSet<Arrow>();
|
||||||
|
private HashSet<Player> _active = new HashSet<Player>();
|
||||||
|
|
||||||
|
public ExplosiveShot(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[]
|
||||||
|
{
|
||||||
|
"Prepare an explosive shot;",
|
||||||
|
"Your next arrow will explode on",
|
||||||
|
"impact, dealing up to 12 damage",
|
||||||
|
"and knockback. ",
|
||||||
|
" ",
|
||||||
|
"Explosion radius of #5#1",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@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
|
||||||
|
_active.add(player);
|
||||||
|
|
||||||
|
//Inform
|
||||||
|
UtilPlayer.message(player, F.main(GetClassType().name(), "You prepared " + F.skill(GetName(level)) + "."));
|
||||||
|
|
||||||
|
//Effect
|
||||||
|
player.getWorld().playSound(player.getLocation(), Sound.BLAZE_BREATH, 2.5f, 2.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void BowShoot(EntityShootBowEvent event)
|
||||||
|
{
|
||||||
|
if (!(event.getEntity() instanceof Player))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!(event.getProjectile() instanceof Arrow))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player player = (Player)event.getEntity();
|
||||||
|
|
||||||
|
if (!_active.remove(player))
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Inform
|
||||||
|
UtilPlayer.message(player, F.main(GetClassType().name(), "You fired " + F.skill(GetName(getLevel(player))) + "."));
|
||||||
|
|
||||||
|
_arrows.add((Arrow)event.getProjectile());
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
|
public void hitEntityTrigger(CustomDamageEvent event)
|
||||||
|
{
|
||||||
|
if (event.IsCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.GetCause() != DamageCause.PROJECTILE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Projectile projectile = event.GetProjectile();
|
||||||
|
if (projectile == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!_arrows.remove(event.GetProjectile()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
event.SetCancelled(GetName());
|
||||||
|
|
||||||
|
Location loc = event.GetDamageeEntity().getLocation().subtract(event.GetProjectile().getVelocity().normalize().multiply(0.1));
|
||||||
|
|
||||||
|
trigger((Arrow)event.GetProjectile(), loc);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void hitBlockTrigger(ProjectileHitEvent event)
|
||||||
|
{
|
||||||
|
Projectile proj = event.getEntity();
|
||||||
|
|
||||||
|
if (!_arrows.contains(proj))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (proj.getShooter() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!(proj.getShooter() instanceof Player))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player damager = (Player)proj.getShooter();
|
||||||
|
int level = getLevel(damager);
|
||||||
|
if (level == 0) return;
|
||||||
|
|
||||||
|
final Arrow arrow = (Arrow)proj;
|
||||||
|
|
||||||
|
Factory.GetPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Factory.GetPlugin(), new Runnable()
|
||||||
|
{
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//If it hasnt already triggered (via damage)
|
||||||
|
if (_arrows.remove(arrow))
|
||||||
|
trigger(arrow, arrow.getLocation());
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
//Remove
|
||||||
|
proj.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void cleanTrigger(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.SEC)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Iterator<Arrow> arrowIterator = _arrows.iterator(); arrowIterator.hasNext();)
|
||||||
|
{
|
||||||
|
Arrow arrow = arrowIterator.next();
|
||||||
|
|
||||||
|
if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround() || arrow.getTicksLived() > 60)
|
||||||
|
{
|
||||||
|
arrowIterator.remove();
|
||||||
|
trigger(arrow, arrow.getLocation());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void trigger(Arrow arrow, Location loc)
|
||||||
|
{
|
||||||
|
if (arrow == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (arrow.getShooter() == null || !(arrow.getShooter() instanceof Player))
|
||||||
|
{
|
||||||
|
arrow.remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Player player = (Player)arrow.getShooter();
|
||||||
|
|
||||||
|
//Level
|
||||||
|
int level = getLevel(player);
|
||||||
|
if (level == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Velocity Players
|
||||||
|
HashMap<Player,Double> hitMap = UtilPlayer.getInRadius(loc, 5 + (level));
|
||||||
|
for (Player cur : hitMap.keySet())
|
||||||
|
{
|
||||||
|
double range = hitMap.get(cur);
|
||||||
|
|
||||||
|
//Condition
|
||||||
|
Factory.Condition().Factory().Falling(GetName(), cur, player, 6, false, true);
|
||||||
|
|
||||||
|
//Damage Event
|
||||||
|
Factory.Damage().NewDamageEvent(cur, player, null,
|
||||||
|
DamageCause.CUSTOM, 2 + 10 * range, false, true, false,
|
||||||
|
player.getName(), GetName());
|
||||||
|
|
||||||
|
//Velocity
|
||||||
|
UtilAction.velocity(cur, UtilAlg.getTrajectory2d(loc, cur.getLocation().add(0, 1, 0)),
|
||||||
|
0.4 + 1 * range, false, 0, 0.2 + 0.6 * range, 1.2, true);
|
||||||
|
|
||||||
|
//Inform
|
||||||
|
if (cur instanceof Player)
|
||||||
|
UtilPlayer.message((Player)cur, F.main(GetClassType().name(), F.name(player.getName()) +" hit you with " + F.skill(GetName(level)) + "."));
|
||||||
|
}
|
||||||
|
|
||||||
|
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, loc, 0, 0, 0, 0, 1);
|
||||||
|
loc.getWorld().playSound(loc, Sound.EXPLODE, 2f, 0.75f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void particle(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Entity ent : _arrows)
|
||||||
|
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, ent.getLocation(), 0, 0, 0, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void Reset(Player player)
|
||||||
|
{
|
||||||
|
_active.remove(player);
|
||||||
|
}
|
||||||
|
}
|
@ -48,8 +48,8 @@ public class NapalmShot extends SkillActive
|
|||||||
SetDesc(new String[]
|
SetDesc(new String[]
|
||||||
{
|
{
|
||||||
"Prepare a napalm shot;",
|
"Prepare a napalm shot;",
|
||||||
"Your next arrow will explode on",
|
"Your next arrow will burst into",
|
||||||
"impact, releasing #8#8 flames."
|
"#8#8 flames on impact."
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,6 +40,8 @@ public abstract class Skill implements ISkill, Listener
|
|||||||
private boolean _free;
|
private boolean _free;
|
||||||
private NautHashMap<Player, Integer> _users;
|
private NautHashMap<Player, Integer> _users;
|
||||||
|
|
||||||
|
private boolean _isAchievementSkill = false;
|
||||||
|
|
||||||
public SkillFactory Factory;
|
public SkillFactory Factory;
|
||||||
|
|
||||||
public Skill(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int maxLevel)
|
public Skill(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int maxLevel)
|
||||||
@ -327,4 +329,10 @@ public abstract class Skill implements ISkill, Listener
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAchievementSkill()
|
||||||
|
{
|
||||||
|
return _isAchievementSkill;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,8 @@ public abstract class SkillChargeSword extends SkillCharge implements Listener
|
|||||||
protected boolean _rechargeInform = false;
|
protected boolean _rechargeInform = false;
|
||||||
protected boolean _rechargeAttach = false;
|
protected boolean _rechargeAttach = false;
|
||||||
|
|
||||||
|
protected boolean _fireOnFull = false;
|
||||||
|
|
||||||
public SkillChargeSword(SkillFactory skills, String name, ClassType classType,
|
public SkillChargeSword(SkillFactory skills, String name, ClassType classType,
|
||||||
SkillType skillType, int cost, int maxLevel,
|
SkillType skillType, int cost, int maxLevel,
|
||||||
float base, float boost,
|
float base, float boost,
|
||||||
@ -62,7 +64,18 @@ public abstract class SkillChargeSword extends SkillCharge implements Listener
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
//Charge
|
//Charge
|
||||||
Charge(cur);
|
if (Charge(cur) && _fireOnFull)
|
||||||
|
{
|
||||||
|
//Action
|
||||||
|
float charge = _charge.remove(cur);
|
||||||
|
|
||||||
|
//Set Recharge
|
||||||
|
Recharge.Instance.recharge(cur, GetName());
|
||||||
|
Recharge.Instance.use(cur, GetName(), _recharge + (getLevel(cur) * _rechargePerLevel), true, true);
|
||||||
|
|
||||||
|
DoSkill(cur, charge);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//Release Charge
|
//Release Charge
|
||||||
else if (_charge.containsKey(cur))
|
else if (_charge.containsKey(cur))
|
||||||
|
@ -167,13 +167,13 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
|||||||
0, 0, true,
|
0, 0, true,
|
||||||
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
|
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
|
||||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||||
//
|
|
||||||
// AddSkill(new Illusion(this, "Illusion", ClassType.Assassin, SkillType.Sword,
|
AddSkill(new Illusion(this, "Illusion", ClassType.Assassin, SkillType.Sword,
|
||||||
// 1, 4,
|
1, 4,
|
||||||
// 30, -5,
|
30, -5,
|
||||||
// 0, 0, true,
|
12000, -1000, true,
|
||||||
// new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
|
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
|
||||||
// new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||||
|
|
||||||
//Axe
|
//Axe
|
||||||
AddSkill(new Blink(this, "Blink", ClassType.Assassin, SkillType.Axe,
|
AddSkill(new Blink(this, "Blink", ClassType.Assassin, SkillType.Axe,
|
||||||
@ -328,6 +328,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 AxeThrow(this, "Roped Axe Throw", ClassType.Knight, SkillType.Axe,
|
||||||
|
1, 5,
|
||||||
|
0, 0,
|
||||||
|
3000, -450, 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, 1, 3));
|
AddSkill(new Cleave(this, "Cleave", ClassType.Knight, SkillType.PassiveA, 1, 3));
|
||||||
@ -366,6 +373,8 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
|||||||
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
|
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
|
||||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||||
|
|
||||||
|
AddSkill(new StaticLazer(this, "Static Lazer", ClassType.Mage, SkillType.Sword, 1, 5));
|
||||||
|
|
||||||
//Axe
|
//Axe
|
||||||
AddSkill(new FireBlast(this, "Fire Blast", ClassType.Mage, SkillType.Axe,
|
AddSkill(new FireBlast(this, "Fire Blast", ClassType.Mage, SkillType.Axe,
|
||||||
1, 5,
|
1, 5,
|
||||||
@ -492,6 +501,13 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
|||||||
new Material[] {Material.BOW},
|
new Material[] {Material.BOW},
|
||||||
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
|
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
|
||||||
|
|
||||||
|
AddSkill(new ExplosiveShot(this, "Explosive Arrow", ClassType.Ranger, SkillType.Bow,
|
||||||
|
1, 4,
|
||||||
|
0, 0,
|
||||||
|
20000, -2000, false,
|
||||||
|
new Material[] {Material.BOW},
|
||||||
|
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
|
||||||
|
|
||||||
//Passive A
|
//Passive A
|
||||||
AddSkill(new Barrage(this, "Barrage", ClassType.Ranger, SkillType.PassiveA, 1, 3));
|
AddSkill(new Barrage(this, "Barrage", ClassType.Ranger, SkillType.PassiveA, 1, 3));
|
||||||
AddSkill(new Overcharge(this, "Overcharge", ClassType.Ranger, SkillType.PassiveA, 1, 3));
|
AddSkill(new Overcharge(this, "Overcharge", ClassType.Ranger, SkillType.PassiveA, 1, 3));
|
||||||
|
@ -1012,20 +1012,12 @@ public class Bridge extends TeamGame implements OreObsfucation
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Under Water
|
|
||||||
if (event.getBlock().getRelative(BlockFace.UP).isLiquid())
|
|
||||||
{
|
|
||||||
UtilPlayer.message(event.getPlayer(), F.main("Game",
|
|
||||||
"Cannot place blocks under liquids."));
|
|
||||||
event.setCancelled(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_bridgesDown)
|
if (_bridgesDown)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//In Liquid
|
//In Liquid
|
||||||
if (event.getBlockReplacedState().getTypeId() == 8 ||
|
if (event.getBlock().getRelative(BlockFace.UP).isLiquid() ||
|
||||||
|
event.getBlockReplacedState().getTypeId() == 8 ||
|
||||||
event.getBlockReplacedState().getTypeId() == 9 ||
|
event.getBlockReplacedState().getTypeId() == 9 ||
|
||||||
event.getBlockReplacedState().getTypeId() == 10 ||
|
event.getBlockReplacedState().getTypeId() == 10 ||
|
||||||
event.getBlockReplacedState().getTypeId() == 11)
|
event.getBlockReplacedState().getTypeId() == 11)
|
||||||
|
@ -60,7 +60,7 @@ public class Micro extends TeamGame
|
|||||||
this.BlockBreak = true;
|
this.BlockBreak = true;
|
||||||
this.BlockPlace = true;
|
this.BlockPlace = true;
|
||||||
|
|
||||||
registerStatTrackers(new KillsWithinGameStatTracker(this, 12, "Annihilation"));
|
registerStatTrackers(new KillsWithinGameStatTracker(this, 9, "Annihilation"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -99,7 +99,6 @@ public class Paintball extends TeamGame
|
|||||||
}
|
}
|
||||||
|
|
||||||
private HashMap<Player, PlayerCopy> _doubles = new HashMap<Player, PlayerCopy>();
|
private HashMap<Player, PlayerCopy> _doubles = new HashMap<Player, PlayerCopy>();
|
||||||
private HashSet<Projectile> _water = new HashSet<Projectile>();
|
|
||||||
|
|
||||||
public Paintball(ArcadeManager manager)
|
public Paintball(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
|
@ -3,21 +3,23 @@ package nautilus.game.arcade.game.games.paintball;
|
|||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.UtilEnt;
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.disguise.disguises.DisguisePlayer;
|
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||||
|
import nautilus.game.arcade.game.Game;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.EntityEffect;
|
import org.bukkit.EntityEffect;
|
||||||
|
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Skeleton;
|
import org.bukkit.entity.Skeleton;
|
||||||
|
|
||||||
public class PlayerCopy
|
public class PlayerCopy
|
||||||
{
|
{
|
||||||
private Paintball Host;
|
private Game Host;
|
||||||
|
|
||||||
private Skeleton _ent;
|
private Skeleton _ent;
|
||||||
private Player _owner;
|
private Player _owner;
|
||||||
|
|
||||||
public PlayerCopy(Paintball host, Player owner)
|
public PlayerCopy(Game host, Player owner)
|
||||||
{
|
{
|
||||||
Host = host;
|
Host = host;
|
||||||
|
|
||||||
@ -34,12 +36,12 @@ public class PlayerCopy
|
|||||||
//Armor
|
//Armor
|
||||||
_ent.getEquipment().setArmorContents(owner.getInventory().getArmorContents());
|
_ent.getEquipment().setArmorContents(owner.getInventory().getArmorContents());
|
||||||
|
|
||||||
_ent.setCustomName(C.cWhite + C.Bold + C.Scramble + "XX" + ChatColor.RESET + " " + host.GetTeam(owner).GetColor() + owner.getName() + " " + C.cWhite + C.Bold + C.Scramble + "XX");
|
_ent.setCustomName(C.cWhite + C.Bold + C.Scramble + "XX" + ChatColor.RESET + " " + C.cYellow + owner.getName() + " " + C.cWhite + C.Bold + C.Scramble + "XX");
|
||||||
_ent.setCustomNameVisible(true);
|
_ent.setCustomNameVisible(true);
|
||||||
|
|
||||||
//Disguise
|
//Disguise
|
||||||
////DisguisePlayer disguise = new DisguisePlayer(_ent, owner.getName());
|
// DisguisePlayer disguise = new DisguisePlayer(_ent, ((CraftPlayer)owner).getProfile());
|
||||||
//Host.Manager.GetDisguise().disguise(disguise);
|
// Host.Manager.GetDisguise().disguise(disguise);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LivingEntity GetEntity()
|
public LivingEntity GetEntity()
|
||||||
|
@ -6,13 +6,23 @@ import java.util.HashSet;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.EntityEffect;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.ThrownPotion;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.entity.EntityCombustEvent;
|
||||||
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
@ -22,12 +32,15 @@ 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.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.common.util.UtilTextMiddle;
|
import mineplex.core.common.util.UtilTextMiddle;
|
||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
import mineplex.core.data.BlockData;
|
import mineplex.core.data.BlockData;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
||||||
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
import nautilus.game.arcade.GameType;
|
import nautilus.game.arcade.GameType;
|
||||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||||
@ -35,6 +48,9 @@ import nautilus.game.arcade.events.PlayerDeathOutEvent;
|
|||||||
import nautilus.game.arcade.events.PlayerKitGiveEvent;
|
import nautilus.game.arcade.events.PlayerKitGiveEvent;
|
||||||
import nautilus.game.arcade.game.GameTeam;
|
import nautilus.game.arcade.game.GameTeam;
|
||||||
import nautilus.game.arcade.game.TeamGame;
|
import nautilus.game.arcade.game.TeamGame;
|
||||||
|
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
||||||
|
import nautilus.game.arcade.game.games.paintball.PlayerCopy;
|
||||||
|
import nautilus.game.arcade.game.games.paintball.Paintball.ReviveEvent;
|
||||||
import nautilus.game.arcade.game.games.wither.kit.*;
|
import nautilus.game.arcade.game.games.wither.kit.*;
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
import nautilus.game.arcade.kit.NullKit;
|
import nautilus.game.arcade.kit.NullKit;
|
||||||
@ -51,8 +67,10 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
|
|
||||||
private long _gameTime = 300000;
|
private long _gameTime = 300000;
|
||||||
|
|
||||||
private int _livesPerPlayer = 3;
|
private HashMap<Player, PlayerCopy> _doubles = new HashMap<Player, PlayerCopy>();
|
||||||
private HashMap<Player, Integer> _lives = new HashMap<Player, Integer>();
|
|
||||||
|
// private int _livesPerPlayer = 3;
|
||||||
|
// private HashMap<Player, Integer> _lives = new HashMap<Player, Integer>();
|
||||||
|
|
||||||
private HashSet<BlockData> _blocks = new HashSet<BlockData>();
|
private HashSet<BlockData> _blocks = new HashSet<BlockData>();
|
||||||
|
|
||||||
@ -62,10 +80,9 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
|
|
||||||
new Kit[]
|
new Kit[]
|
||||||
{
|
{
|
||||||
//new KitHumanRunner(manager),
|
|
||||||
new KitHumanArcher(manager),
|
new KitHumanArcher(manager),
|
||||||
new KitHumanBuilder(manager),
|
new KitHumanBuilder(manager),
|
||||||
new NullKit(manager),
|
new KitHumanRunner(manager),
|
||||||
new NullKit(manager),
|
new NullKit(manager),
|
||||||
new KitWitherMinion(manager),
|
new KitWitherMinion(manager),
|
||||||
//new KitWitherWeb(manager),
|
//new KitWitherWeb(manager),
|
||||||
@ -75,8 +92,8 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
|
|
||||||
C.cGreen + "Humans" + C.cWhite + " Find Armor Upgrades to help surive!",
|
C.cGreen + "Humans" + C.cWhite + " Run and hide from the Withers",
|
||||||
C.cGreen + "Humans" + C.cWhite + " 5 Lives per Player",
|
C.cGreen + "Humans" + C.cWhite + " Revive your dead allies!",
|
||||||
C.cGreen + "Humans" + C.cWhite + " Win by surviving for 5 minutes",
|
C.cGreen + "Humans" + C.cWhite + " Win by surviving for 5 minutes",
|
||||||
" ",
|
" ",
|
||||||
C.cRed + "Withers" + C.cWhite + " Moves very slowly when near ground",
|
C.cRed + "Withers" + C.cWhite + " Moves very slowly when near ground",
|
||||||
@ -95,6 +112,9 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
|
|
||||||
this.KitRegisterState = GameState.Prepare;
|
this.KitRegisterState = GameState.Prepare;
|
||||||
|
|
||||||
|
this.TeamArmor = true;
|
||||||
|
this.TeamArmorHotbar = false;
|
||||||
|
|
||||||
_help = new String[]
|
_help = new String[]
|
||||||
{
|
{
|
||||||
C.cRed + C.Bold + "This game is in early stages of development!",
|
C.cRed + C.Bold + "This game is in early stages of development!",
|
||||||
@ -164,7 +184,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
|
|
||||||
public void setWither(Player player, boolean forced)
|
public void setWither(Player player, boolean forced)
|
||||||
{
|
{
|
||||||
_lives.remove(player);
|
// _lives.remove(player);
|
||||||
|
|
||||||
SetPlayerTeam(player, _withers, true);
|
SetPlayerTeam(player, _withers, true);
|
||||||
|
|
||||||
@ -174,6 +194,8 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
SetKit(player, newKit, false);
|
SetKit(player, newKit, false);
|
||||||
newKit.ApplyKit(player);
|
newKit.ApplyKit(player);
|
||||||
|
|
||||||
|
player.teleport(_withers.GetSpawn());
|
||||||
|
|
||||||
if (forced)
|
if (forced)
|
||||||
{
|
{
|
||||||
AddGems(player, 10, "Forced Wither", false);
|
AddGems(player, 10, "Forced Wither", false);
|
||||||
@ -185,25 +207,25 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
// @EventHandler
|
||||||
public void playerDead(final PlayerDeathOutEvent event)
|
// public void playerLoseLife(final PlayerDeathOutEvent event)
|
||||||
{
|
// {
|
||||||
Player player = event.GetPlayer();
|
// Player player = event.GetPlayer();
|
||||||
|
//
|
||||||
if (_lives.containsKey(player))
|
// if (_lives.containsKey(player))
|
||||||
{
|
// {
|
||||||
int lives = _lives.get(player);
|
// int lives = _lives.get(player);
|
||||||
|
//
|
||||||
if (lives <= 1)
|
// if (lives <= 1)
|
||||||
return;
|
// return;
|
||||||
|
//
|
||||||
_lives.put(player, lives - 1);
|
// _lives.put(player, lives - 1);
|
||||||
|
//
|
||||||
UtilPlayer.message(player, F.main("Game", "You have " + F.elem(C.cGreen + C.Bold + lives + " Lives Remaining") + "."));
|
// UtilPlayer.message(player, F.main("Game", "You have " + F.elem(C.cGreen + C.Bold + lives + " Lives Remaining") + "."));
|
||||||
|
//
|
||||||
event.setCancelled(true);
|
// event.setCancelled(true);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void gameStart(GameStateChangeEvent event)
|
public void gameStart(GameStateChangeEvent event)
|
||||||
@ -211,31 +233,31 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
if (event.GetState() != GameState.Live)
|
if (event.GetState() != GameState.Live)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UtilTextMiddle.display(C.cGreen + "Humans Hiding", "12 Seconds until Assault", 10, 80, 10);
|
UtilTextMiddle.display(C.cGreen + "Humans Hiding", "15 Seconds until Assault", 10, 80, 10);
|
||||||
|
|
||||||
for (Player player : _withers.GetPlayers(true))
|
for (Player player : _withers.GetPlayers(true))
|
||||||
{
|
{
|
||||||
Manager.GetCondition().Factory().Blind("Game Start", player, null, 12, 0, false, false, false);
|
Manager.GetCondition().Factory().Blind("Game Start", player, null, 15, 0, false, false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
// @EventHandler
|
||||||
public void playerLivesDisplay(PlayerKitGiveEvent event)
|
// public void playerLivesDisplay(PlayerKitGiveEvent event)
|
||||||
{
|
// {
|
||||||
if (!_runners.HasPlayer(event.GetPlayer()))
|
// if (!_runners.HasPlayer(event.GetPlayer()))
|
||||||
return;
|
// return;
|
||||||
|
//
|
||||||
//Player Lives
|
// //Player Lives
|
||||||
if (!_lives.containsKey(event.GetPlayer()))
|
// if (!_lives.containsKey(event.GetPlayer()))
|
||||||
_lives.put(event.GetPlayer(), _livesPerPlayer);
|
// _lives.put(event.GetPlayer(), _livesPerPlayer);
|
||||||
|
//
|
||||||
int lives = _lives.get(event.GetPlayer());
|
// int lives = _lives.get(event.GetPlayer());
|
||||||
|
//
|
||||||
if (lives <= 0)
|
// if (lives <= 0)
|
||||||
return;
|
// return;
|
||||||
|
//
|
||||||
event.GetPlayer().getInventory().setItem(8, ItemStackFactory.Instance.CreateStack(Material.BONE, (byte)0, lives, C.cGreen + C.Bold + lives + " Lives Remaining"));
|
// event.GetPlayer().getInventory().setItem(8, ItemStackFactory.Instance.CreateStack(Material.BONE, (byte)0, lives, C.cGreen + C.Bold + lives + " Lives Remaining"));
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void EndCheck()
|
public void EndCheck()
|
||||||
@ -292,9 +314,9 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
if (event.getType() != UpdateType.FAST)
|
if (event.getType() != UpdateType.FAST)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int lives = 0;
|
// int lives = 0;
|
||||||
for (int i : _lives.values())
|
// for (int i : _lives.values())
|
||||||
lives += i;
|
// lives += i;
|
||||||
|
|
||||||
//Wipe Last
|
//Wipe Last
|
||||||
Scoreboard.Reset();
|
Scoreboard.Reset();
|
||||||
@ -307,9 +329,9 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
Scoreboard.Write(_withers.GetColor() + C.Bold + _withers.GetName());
|
Scoreboard.Write(_withers.GetColor() + C.Bold + _withers.GetName());
|
||||||
Scoreboard.Write(_withers.GetColor() + "" + _withers.GetPlayers(true).size() + " Players");
|
Scoreboard.Write(_withers.GetColor() + "" + _withers.GetPlayers(true).size() + " Players");
|
||||||
|
|
||||||
Scoreboard.WriteBlank();
|
// Scoreboard.WriteBlank();
|
||||||
Scoreboard.Write(C.cYellow + C.Bold + "Human Lives");
|
// Scoreboard.Write(C.cYellow + C.Bold + "Humans Alive");
|
||||||
Scoreboard.Write(lives + " / " + (_lives.size() * _livesPerPlayer));
|
// Scoreboard.Write(lives + " / " + (_lives.size() * _livesPerPlayer));
|
||||||
|
|
||||||
Scoreboard.WriteBlank();
|
Scoreboard.WriteBlank();
|
||||||
Scoreboard.Write(C.cYellow + C.Bold + "Time Left");
|
Scoreboard.Write(C.cYellow + C.Bold + "Time Left");
|
||||||
@ -357,7 +379,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
ArrayList<Location> collisions = new ArrayList<Location>();
|
ArrayList<Location> collisions = new ArrayList<Location>();
|
||||||
|
|
||||||
//Fly Speed
|
//Fly Speed
|
||||||
double speed = 0.06 - (_yLimit - player.getLocation().getY()) * 0.075;
|
double speed = 0.06 - (_yLimit - player.getLocation().getY()) * 0.0075;
|
||||||
|
|
||||||
if (speed > 0.16)
|
if (speed > 0.16)
|
||||||
speed = 0.16;
|
speed = 0.16;
|
||||||
@ -431,29 +453,214 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @EventHandler
|
||||||
|
// public void cleanLives(PlayerQuitEvent event)
|
||||||
|
// {
|
||||||
|
// _lives.remove(event.getPlayer());
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @EventHandler
|
||||||
|
// public void livesUpdate(UpdateEvent event)
|
||||||
|
// {
|
||||||
|
// if (!IsLive())
|
||||||
|
// return;
|
||||||
|
//
|
||||||
|
// if (event.getType() != UpdateType.FASTER)
|
||||||
|
// return;
|
||||||
|
//
|
||||||
|
// Iterator<Player> playerIter = _lives.keySet().iterator();
|
||||||
|
//
|
||||||
|
// while (playerIter.hasNext())
|
||||||
|
// {
|
||||||
|
// Player player = playerIter.next();
|
||||||
|
//
|
||||||
|
// if (!player.isOnline() || !_runners.HasPlayer(player))
|
||||||
|
// playerIter.remove();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void playerQuit(PlayerQuitEvent event)
|
public void arrowDamage(CustomDamageEvent event)
|
||||||
{
|
{
|
||||||
_lives.remove(event.getPlayer());
|
if (event.GetProjectile() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
event.AddMult(GetName(), "Arrow Mod", 0.75, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
|
public void damageOut(CustomDamageEvent event)
|
||||||
|
{
|
||||||
|
if (event.IsCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.GetDamageePlayer() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.GetDamage() < event.GetDamageePlayer().getHealth())
|
||||||
|
return;
|
||||||
|
|
||||||
|
event.SetCancelled("Fake Death");
|
||||||
|
|
||||||
|
event.GetDamageePlayer().playEffect(EntityEffect.HURT);
|
||||||
|
|
||||||
|
playerOut(event.GetDamageePlayer());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void playerOut(Player player)
|
||||||
|
{
|
||||||
|
//State
|
||||||
|
SetPlayerState(player, PlayerState.OUT);
|
||||||
|
player.setHealth(20);
|
||||||
|
|
||||||
|
//Conditions
|
||||||
|
Manager.GetCondition().Factory().Blind("Hit", player, player, 1.5, 0, false, false, false);
|
||||||
|
Manager.GetCondition().Factory().Cloak("Hit", player, player, 9999, false, false);
|
||||||
|
|
||||||
|
//Settings
|
||||||
|
player.setGameMode(GameMode.CREATIVE);
|
||||||
|
player.setFlying(true);
|
||||||
|
((CraftPlayer)player).getHandle().spectating = true;
|
||||||
|
((CraftPlayer)player).getHandle().k = false;
|
||||||
|
|
||||||
|
player.setVelocity(new Vector(0,1.2,0));
|
||||||
|
|
||||||
|
_doubles.put(player, new PlayerCopy(this, player));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void playerIn(final Player player, final LivingEntity copy)
|
||||||
|
{
|
||||||
|
//State
|
||||||
|
SetPlayerState(player, PlayerState.IN);
|
||||||
|
player.setHealth(20);
|
||||||
|
|
||||||
|
//Teleport
|
||||||
|
if (copy != null)
|
||||||
|
{
|
||||||
|
Location loc = player.getLocation();
|
||||||
|
loc.setX(copy.getLocation().getX());
|
||||||
|
loc.setY(copy.getLocation().getY());
|
||||||
|
loc.setZ(copy.getLocation().getZ());
|
||||||
|
player.teleport(loc);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Settings
|
||||||
|
player.setGameMode(GameMode.SURVIVAL);
|
||||||
|
player.setFlying(false);
|
||||||
|
((CraftPlayer)player).getHandle().spectating = false;
|
||||||
|
((CraftPlayer)player).getHandle().k = true;
|
||||||
|
|
||||||
|
//Items
|
||||||
|
player.getInventory().remove(Material.WATCH);
|
||||||
|
player.getInventory().remove(Material.COMPASS);
|
||||||
|
|
||||||
|
//Inform
|
||||||
|
UtilPlayer.message(player, F.main("Game", "You have been revived!"));
|
||||||
|
|
||||||
|
//Delayed Visibility
|
||||||
|
if (copy != null)
|
||||||
|
{
|
||||||
|
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable()
|
||||||
|
{
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
//Remove Invis
|
||||||
|
if (IsAlive(player))
|
||||||
|
Manager.GetCondition().EndCondition(player, ConditionType.CLOAK, null);
|
||||||
|
|
||||||
|
//Remove Copy
|
||||||
|
copy.remove();
|
||||||
|
}
|
||||||
|
}, 4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void livesUpdate(UpdateEvent event)
|
public void revive(ProjectileHitEvent event)
|
||||||
{
|
{
|
||||||
if (!IsLive())
|
if (!IsLive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (event.getType() != UpdateType.FASTER)
|
if (!(event.getEntity() instanceof ThrownPotion))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Iterator<Player> playerIter = _lives.keySet().iterator();
|
if (event.getEntity().getShooter() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
while (playerIter.hasNext())
|
if (!(event.getEntity().getShooter() instanceof Player))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player thrower = (Player)event.getEntity().getShooter();
|
||||||
|
|
||||||
|
GameTeam throwerTeam = GetTeam(thrower);
|
||||||
|
if (throwerTeam == null) return;
|
||||||
|
|
||||||
|
//Revive
|
||||||
|
Iterator<PlayerCopy> copyIterator = _doubles.values().iterator();
|
||||||
|
while (copyIterator.hasNext())
|
||||||
{
|
{
|
||||||
Player player = playerIter.next();
|
PlayerCopy copy = copyIterator.next();
|
||||||
|
|
||||||
if (!player.isOnline() || !_runners.HasPlayer(player))
|
GameTeam otherTeam = GetTeam(copy.GetPlayer());
|
||||||
playerIter.remove();
|
if (otherTeam == null || !otherTeam.equals(throwerTeam))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (UtilMath.offset(copy.GetEntity().getLocation().add(0,1,0), event.getEntity().getLocation()) > 3)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
playerIn(copy.GetPlayer(), copy.GetEntity());
|
||||||
|
copyIterator.remove();
|
||||||
|
|
||||||
|
AddGems(thrower, 3, "Revived Ally", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Revive
|
||||||
|
for (Player player : GetPlayers(true))
|
||||||
|
{
|
||||||
|
GameTeam otherTeam = GetTeam(player);
|
||||||
|
if (otherTeam == null || !otherTeam.equals(throwerTeam))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (UtilMath.offset(player.getLocation().add(0,1,0), event.getEntity().getLocation()) > 3)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
playerIn(player, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void removePotionEffect(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Player player : GetPlayers(true))
|
||||||
|
player.removePotionEffect(PotionEffectType.WATER_BREATHING);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void skeletonDamage(CustomDamageEvent event)
|
||||||
|
{
|
||||||
|
for (PlayerCopy copy : _doubles.values())
|
||||||
|
{
|
||||||
|
if (copy.GetEntity().equals(event.GetDamageeEntity()))
|
||||||
|
{
|
||||||
|
event.SetCancelled("Runner Copy Cancel");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void skeletonCombust(EntityCombustEvent event)
|
||||||
|
{
|
||||||
|
for (PlayerCopy copy : _doubles.values())
|
||||||
|
{
|
||||||
|
if (copy.GetEntity().equals(event.getEntity()))
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
package nautilus.game.arcade.game.games.wither.kit;
|
package nautilus.game.arcade.game.games.wither.kit;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.PotionMeta;
|
||||||
|
|
||||||
|
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
@ -28,7 +33,7 @@ public class KitHumanArcher extends Kit
|
|||||||
new Perk[]
|
new Perk[]
|
||||||
{
|
{
|
||||||
new PerkRopedArrow("Roped Arrow", 1, 4000),
|
new PerkRopedArrow("Roped Arrow", 1, 4000),
|
||||||
new PerkWitherArrowBlind(3),
|
new PerkWitherArrowBlind(6),
|
||||||
new PerkFletcher(4, 4, true),
|
new PerkFletcher(4, 4, true),
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -42,10 +47,15 @@ public class KitHumanArcher extends Kit
|
|||||||
{
|
{
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
|
||||||
|
|
||||||
Manager.GetCondition().Factory().Invulnerable("Spawn Invul", player, player, 6, false, false);
|
ItemStack potion = new ItemStack(Material.POTION, 3, (short)16429); // 16422
|
||||||
|
PotionMeta potionMeta = (PotionMeta)potion.getItemMeta();
|
||||||
|
potionMeta.setDisplayName(ChatColor.RESET + "Revival Potion");
|
||||||
|
potion.setItemMeta(potionMeta);
|
||||||
|
player.getInventory().addItem(potion);
|
||||||
|
|
||||||
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||||
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
package nautilus.game.arcade.game.games.wither.kit;
|
package nautilus.game.arcade.game.games.wither.kit;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.PotionMeta;
|
||||||
|
|
||||||
|
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
@ -39,10 +44,15 @@ public class KitHumanBuilder extends Kit
|
|||||||
{
|
{
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SPADE));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SPADE));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
|
||||||
|
|
||||||
Manager.GetCondition().Factory().Invulnerable("Spawn Invul", player, player, 6, false, false);
|
ItemStack potion = new ItemStack(Material.POTION, 3, (short)16429); // 16422
|
||||||
|
PotionMeta potionMeta = (PotionMeta)potion.getItemMeta();
|
||||||
|
potionMeta.setDisplayName(ChatColor.RESET + "Revival Potion");
|
||||||
|
potion.setItemMeta(potionMeta);
|
||||||
|
player.getInventory().addItem(potion);
|
||||||
|
|
||||||
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||||
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,24 +1,29 @@
|
|||||||
package nautilus.game.arcade.game.games.wither.kit;
|
package nautilus.game.arcade.game.games.wither.kit;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.PotionMeta;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
import nautilus.game.arcade.kit.KitAvailability;
|
import nautilus.game.arcade.kit.KitAvailability;
|
||||||
import nautilus.game.arcade.kit.Perk;
|
import nautilus.game.arcade.kit.Perk;
|
||||||
|
import nautilus.game.arcade.kit.perks.PerkDoubleJump;
|
||||||
import nautilus.game.arcade.kit.perks.PerkLeap;
|
import nautilus.game.arcade.kit.perks.PerkLeap;
|
||||||
|
|
||||||
public class KitHumanRunner extends Kit
|
public class KitHumanRunner extends Kit
|
||||||
{
|
{
|
||||||
public KitHumanRunner(ArcadeManager manager)
|
public KitHumanRunner(ArcadeManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Human Leaper", KitAvailability.Free,
|
super(manager, "Human Jumper", KitAvailability.Free,
|
||||||
|
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
@ -27,7 +32,7 @@ public class KitHumanRunner extends Kit
|
|||||||
|
|
||||||
new Perk[]
|
new Perk[]
|
||||||
{
|
{
|
||||||
new PerkLeap("Leap", 1, 1, 4000)
|
new PerkDoubleJump("Double Jump", 1, 0.8, true, 6000, true),
|
||||||
},
|
},
|
||||||
EntityType.ZOMBIE,
|
EntityType.ZOMBIE,
|
||||||
null);
|
null);
|
||||||
@ -38,10 +43,15 @@ public class KitHumanRunner extends Kit
|
|||||||
public void GiveItems(Player player)
|
public void GiveItems(Player player)
|
||||||
{
|
{
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
|
||||||
|
|
||||||
Manager.GetCondition().Factory().Invulnerable("Spawn Invul", player, player, 6, false, false);
|
ItemStack potion = new ItemStack(Material.POTION, 3, (short)16429); // 16422
|
||||||
|
PotionMeta potionMeta = (PotionMeta)potion.getItemMeta();
|
||||||
|
potionMeta.setDisplayName(ChatColor.RESET + "Revival Potion");
|
||||||
|
potion.setItemMeta(potionMeta);
|
||||||
|
player.getInventory().addItem(potion);
|
||||||
|
|
||||||
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||||
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -38,22 +38,22 @@ public class KitWitherMinion extends Kit
|
|||||||
new PerkWitherAttack(),
|
new PerkWitherAttack(),
|
||||||
new PerkWitherMinion()
|
new PerkWitherMinion()
|
||||||
},
|
},
|
||||||
EntityType.SKELETON,
|
EntityType.WITHER,
|
||||||
null);
|
null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void SpawnCustom(LivingEntity ent)
|
// public void SpawnCustom(LivingEntity ent)
|
||||||
{
|
// {
|
||||||
ent.setMaxHealth(300);
|
// ent.setMaxHealth(300);
|
||||||
ent.setHealth(300);
|
// ent.setHealth(300);
|
||||||
|
//
|
||||||
DisguiseWither disguise = new DisguiseWither(ent);
|
// DisguiseWither disguise = new DisguiseWither(ent);
|
||||||
disguise.SetName(C.cYellow + "Wither");
|
// disguise.SetName(C.cYellow + "Wither");
|
||||||
disguise.SetCustomNameVisible(true);
|
// disguise.SetCustomNameVisible(true);
|
||||||
Manager.GetDisguise().disguise(disguise);
|
// Manager.GetDisguise().disguise(disguise);
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void GiveItems(Player player)
|
public void GiveItems(Player player)
|
||||||
|
@ -96,7 +96,7 @@ public class PerkWitherArrowBlind extends Perk
|
|||||||
boolean hit = false;
|
boolean hit = false;
|
||||||
for (Player player : getWitherTeam().GetPlayers(true))
|
for (Player player : getWitherTeam().GetPlayers(true))
|
||||||
{
|
{
|
||||||
if (UtilMath.offset(player.getLocation().add(0, 1, 0), arrow.getLocation()) < _proximityHit)
|
if (UtilMath.offset(player.getLocation().add(0, 3, 0), arrow.getLocation()) < _proximityHit)
|
||||||
{
|
{
|
||||||
Manager.GetCondition().Factory().Blind(GetName(), player, null, 4, 0, false, false, false);
|
Manager.GetCondition().Factory().Blind(GetName(), player, null, 4, 0, false, false, false);
|
||||||
|
|
||||||
|
@ -41,11 +41,11 @@ public class PerkWitherArrows extends Perk
|
|||||||
|
|
||||||
if (!player.isBlocking())
|
if (!player.isBlocking())
|
||||||
{
|
{
|
||||||
player.setExp((float) Math.min(0.999, player.getExp()+(1f/30f)));
|
player.setExp((float) Math.min(0.999, player.getExp()+(1f/20f)));
|
||||||
}
|
}
|
||||||
else if (player.getExp() > 0)
|
else if (player.getExp() > 0)
|
||||||
{
|
{
|
||||||
player.setExp((float) Math.max(0, player.getExp()-(1f/30f)));
|
player.setExp((float) Math.max(0, player.getExp()-(1f/20f)));
|
||||||
|
|
||||||
for (int i=0 ; i<1 ; i++)
|
for (int i=0 ; i<1 ; i++)
|
||||||
{
|
{
|
||||||
|
@ -58,7 +58,7 @@ public class GameLootManager implements Listener
|
|||||||
false);
|
false);
|
||||||
|
|
||||||
//Chest
|
//Chest
|
||||||
_rewardManager.addReward(new InventoryReward(_rewardManager, Manager.getInventoryManager(), "Treasure Chest", "Treasure Chest", 1, 1,
|
_rewardManager.addReward(new InventoryReward(_rewardManager, Manager.getInventoryManager(), "Treasure Chest", "Treasure Chest", 1, 2,
|
||||||
new ItemStack(Material.CHEST), RewardRarity.COMMON, 4));
|
new ItemStack(Material.CHEST), RewardRarity.COMMON, 4));
|
||||||
|
|
||||||
//Key
|
//Key
|
||||||
|
Loading…
Reference in New Issue
Block a user