Merge branch 'master' of ssh://184.154.0.242:7999/min/mineplex

This commit is contained in:
libraryaddict 2015-11-24 23:45:42 +13:00
commit 5799edae50
40 changed files with 240 additions and 141 deletions

View File

@ -97,11 +97,11 @@ public class LagMeter extends MiniPlugin
_count++;
if (System.currentTimeMillis() - _start > 60000)
if (System.currentTimeMillis() - _start > 30000)
{
if (_timingsRunning)
{
if (_ticksPerSecond > 15 || System.currentTimeMillis() - _timingsStarted > 60000)
if (System.currentTimeMillis() - _timingsStarted > 30000)
{
getPlugin().getServer().dispatchCommand(Bukkit.getConsoleSender(), "timings paste");
_timingsRunning = false;

View File

@ -130,8 +130,10 @@ public class Hub extends JavaPlugin implements IRelation
PartyManager partyManager = new PartyManager(this, portal, clientManager, preferenceManager);
SkillConditionManager conditionManager = new SkillConditionManager(this);
PersonalServerManager personalServerManager = new PersonalServerManager(this, clientManager);
HubManager hubManager = new HubManager(this, blockRestore, clientManager, donationManager, inventoryManager, new ConditionManager(this), disguiseManager, new TaskManager(this, clientManager, webServerAddress), portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, new HologramManager(this), npcManager, personalServerManager, packetHandler, punish, serverStatusManager, giveawayManager);
HubManager hubManager = new HubManager(this, blockRestore, clientManager, donationManager, inventoryManager, conditionManager, disguiseManager, new TaskManager(this, clientManager, webServerAddress), portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, new HologramManager(this), npcManager, personalServerManager, packetHandler, punish, serverStatusManager, giveawayManager);
QueueManager queueManager = new QueueManager(this, clientManager, donationManager, new EloManager(this, clientManager), partyManager);
@ -157,9 +159,11 @@ public class Hub extends JavaPlugin implements IRelation
CombatManager combatManager = new CombatManager(this);
ProjectileManager throwManager = new ProjectileManager(this);
SkillConditionManager conditionManager = new SkillConditionManager(this);
DamageManager damage = new DamageManager(this, combatManager, npcManager, disguiseManager, conditionManager);
conditionManager.setDamageManager(damage);
Fire fire = new Fire(this, conditionManager, damage);
Teleport teleport = new Teleport(this);
Energy energy = new Energy(this);

View File

@ -27,6 +27,7 @@ public enum GameType
Draw("Draw My Thing"),
Evolution("Evolution"),
FlappyBird("Flappy Bird"),
Gladiators("Gladiators"),
Gravity("Gravity"),
Halloween("Halloween Horror"),
HideSeek("Block Hunt"),

View File

@ -90,6 +90,13 @@ public class Assassin extends Skill
event.AddMod(null, GetName(), -1.5, false);
}
@EventHandler
public void CancelEnergy(EnergyEvent event)
{
if (getLevel(event.GetPlayer()) > 0)
event.setCancelled(true);
}
@Override
public void Reset(Player player)
{

View File

@ -1,6 +1,8 @@
package mineplex.minecraft.game.classcombat.Skill.Assassin;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import org.bukkit.Effect;
import org.bukkit.Location;
@ -24,6 +26,7 @@ import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
@ -31,7 +34,7 @@ import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
public class Evade extends SkillActive
{
private HashSet<Player> _active = new HashSet<Player>();
private HashMap<Player, Long> _active = new HashMap<Player, Long>();
public Evade(SkillFactory skills, String name, ClassType classType, SkillType skillType,
int cost, int levels,
@ -56,12 +59,6 @@ public class Evade extends SkillActive
});
}
@Override
public String GetEnergyString()
{
return "Energy: #26#-2 and #18#-2 per Second";
}
@Override
public boolean CustomCheck(Player player, int level)
{
@ -77,36 +74,12 @@ public class Evade extends SkillActive
@Override
public void Skill(Player player, int level)
{
_active.add(player);
_active.put(player, System.currentTimeMillis());
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You prepared to " + F.skill(GetName()) + "."));
}
@EventHandler
public void Energy(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player cur : GetUsers())
{
if (!_active.contains(cur))
continue;
if (!cur.isBlocking())
{
_active.remove(cur);
continue;
}
if (!Factory.Energy().Use(cur, GetName(), 0.9 - (getLevel(cur) * 0.1), true, true))
{
_active.remove(cur);
}
}
}
@EventHandler(priority = EventPriority.NORMAL)
public void Damage(CustomDamageEvent event)
{
@ -125,7 +98,7 @@ public class Evade extends SkillActive
return;
//Active
if (!_active.contains(damagee))
if (!_active.containsKey(damagee))
return;
//Damager
@ -136,9 +109,6 @@ public class Evade extends SkillActive
int level = getLevel(damagee);
if (level == 0) return;
if (!mineplex.core.recharge.Recharge.Instance.use(damagee, GetName(), 500, false, false))
return;
//Cancel
event.SetCancelled(GetName());
@ -230,4 +200,24 @@ public class Evade extends SkillActive
{
_active.remove(player);
}
@EventHandler
public void clean(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
Iterator<Player> activeIter = _active.keySet().iterator();
while (activeIter.hasNext())
{
Player player = activeIter.next();
if (!player.isOnline() || !player.isBlocking() || UtilTime.elapsed(_active.get(player), 750))
{
activeIter.remove();
UtilPlayer.message(player, F.main(GetClassType().name(), "You failed to " + F.skill(GetName()) + "."));
}
}
}
}

View File

@ -77,12 +77,6 @@ public class Illusion extends SkillActive
setAchievementSkill(true);
}
@Override
public String GetEnergyString()
{
return "Energy: #40#-3 and #12.5#-0.5 per Second";
}
@Override
public boolean CustomCheck(Player player, int level)
{
@ -107,8 +101,8 @@ public class Illusion extends SkillActive
UtilEnt.Vegetate(skel);
UtilEnt.silence(skel, true);
skel.setMaxHealth(7);
skel.setHealth(7);
skel.setMaxHealth(14);
skel.setHealth(14);
ClassCombatCreatureAllowSpawnEvent disableEvent = new ClassCombatCreatureAllowSpawnEvent(false);
UtilServer.getServer().getPluginManager().callEvent(disableEvent);

View File

@ -39,8 +39,8 @@ public class Leap extends SkillActive
"Take a great leap forwards.",
"",
"Wall Kick by using Leap with your",
"back against a wall. This uses no",
"Energy or Recharge.",
"back against a wall. This doesn't",
"trigger Leaps Recharge.",
"",
"Cannot be used while Slowed."
});

View File

@ -41,8 +41,9 @@ public class Recall extends Skill
{
"Drop Axe/Sword to Use.",
"",
"Instantly teleport back to where",
"you were #2#2 seconds ago.",
"Go back in time #2#2 seconds,",
"restoring your location and",
"up to #3#1 health."
});
}
@ -85,7 +86,8 @@ public class Recall extends Skill
return;
//Heal
player.setHealth(health.getLast());
double newHealth = Math.min(health.getLast(), player.getHealth() + 3 + level);
player.setHealth(newHealth);
//Effect
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_UNFECT, 2f, 2f);

View File

@ -22,7 +22,8 @@ public class ViperStrikes extends Skill
SetDesc(new String[]
{
"Your attacks give enemies",
"Poison 1 for #1#2 seconds."
"Shock, Slow 1 and Poison 1",
"for #0#1 seconds."
});
}
@ -48,10 +49,8 @@ public class ViperStrikes extends Skill
if (damagee == null) return;
//Confuse
Factory.Condition().Factory().Poison(GetName(), damagee, damager, 1 + 2*level, 0, false, false, false);
//Damage
//event.AddMod(damager.getName(), GetName(), -1 - level, true);
Factory.Condition().Factory().PoisonShock(GetName(), damagee, damager, level, false);
Factory.Condition().Factory().Slow(GetName(), damagee, damager, level, 0, false, false, true, false);
//Sound
damager.getWorld().playSound(damager.getLocation(), Sound.SPIDER_IDLE, 1f, 2f);

View File

@ -64,7 +64,7 @@ public class BlockToss extends SkillCharge implements IThrown
@Override
public String GetRechargeString()
{
return "Recharge: " + "#" + UtilMath.trim(1, 4000/1000d) + "#" + UtilMath.trim(1, -500/1000d) + " Seconds";
return "Recharge: " + "#4#-0.5 Seconds";
}
@EventHandler
@ -92,6 +92,10 @@ public class BlockToss extends SkillCharge implements IThrown
int level = getLevel(player);
if (level == 0) return;
//Recharge
if (!Recharge.Instance.usable(player, GetName()))
return;
//Water
if (player.getLocation().getBlock().getTypeId() == 8 || player.getLocation().getBlock().getTypeId() == 9)
{
@ -100,11 +104,7 @@ public class BlockToss extends SkillCharge implements IThrown
}
Block grab = event.getClickedBlock();
//Recharge
if (!Recharge.Instance.use(player, GetName(), 1000, false, false))
return;
//Door and Banner
if (grab.getRelative(BlockFace.UP).getTypeId() == 64 || grab.getRelative(BlockFace.UP).getTypeId() == 71 || grab.getRelative(BlockFace.UP).getType() == Material.STANDING_BANNER)
{
@ -202,6 +202,9 @@ public class BlockToss extends SkillCharge implements IThrown
for (Player cur : throwSet)
{
Recharge.Instance.recharge(cur, GetName());
Recharge.Instance.use(cur, GetName(), 4000 - (500 * getLevel(cur)), false, true);
FallingBlock block = _holding.remove(cur);
float charge = _charge.remove(cur);

View File

@ -36,7 +36,7 @@ public class Colossus extends Skill
//Damage
event.AddMod(damagee.getName(), GetName(), 0, false);
event.AddKnockback(GetName(), 0.35);
event.AddKnockback(GetName(), 0.65);
}
@Override

View File

@ -14,6 +14,7 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.vehicle.VehicleExitEvent;
import org.spigotmc.event.entity.EntityDismountEvent;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
@ -115,19 +116,23 @@ public class DwarfToss extends SkillActive
return true;
}
//getEntity is the vehicle
@EventHandler
public void PreventDismount(VehicleExitEvent event)
public void PreventDismount(EntityDismountEvent event)
{
if (event.isCancelled())
return;
if (!(event.getExited() instanceof Player))
System.out.println(UtilEnt.getName(event.getDismounted()));
System.out.println(UtilEnt.getName(event.getEntity()));
if (!(event.getDismounted() instanceof Player))
return;
if (!(event.getVehicle() instanceof Player))
if (!(event.getEntity() instanceof Player))
return;
if (_holding.containsKey((Player)event.getVehicle()) && _holding.get((Player)event.getVehicle()) == event.getExited())
if (_holding.containsKey((Player)event.getEntity()) && _holding.get((Player)event.getEntity()) == event.getDismounted())
event.setCancelled(true);
}

View File

@ -44,7 +44,7 @@ public class HoldPosition extends SkillActive
SetDesc(new String[]
{
"Hold your position, gaining",
"Protection 3, Slow 4 and no",
"Protection 3, Slow 3 and no",
"knockback for #3#1 seconds."
});
}
@ -69,7 +69,7 @@ public class HoldPosition extends SkillActive
//Action
Factory.Condition().Factory().Slow(GetName(), player, player, duration, 2, false, true, false, true);
Factory.Condition().Factory().Protection(GetName(), player, player, duration, 2, false, false, true);
Factory.Condition().Factory().Jump(GetName(), player, player, duration, 250, false, false, true);
Factory.Condition().Factory().ArcadeHungerDisable(GetName(), player, player, duration, false);
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));
@ -119,6 +119,9 @@ public class HoldPosition extends SkillActive
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),
ViewDist.NORMAL, UtilServer.getPlayers());
player.setFoodLevel(2);
player.setSprinting(false);
}
}

View File

@ -119,7 +119,7 @@ public class Riposte extends SkillActive
//Effect
damager.getWorld().playSound(damager.getLocation(), Sound.ZOMBIE_METAL, 0.5f, 1.6f);
Factory.Condition().Factory().Invulnerable(GetName(), damagee, damagee, 0.4, false, false);
Factory.Condition().Factory().Invulnerable(GetName(), damagee, damagee, 0.3, false, false);
//Inform
UtilPlayer.message(damagee, F.main(GetClassType().name(), "You parried with " + F.skill(GetName(level)) + "."));

View File

@ -128,7 +128,7 @@ public class Disengage extends SkillActive
//Condition
Factory.Condition().Factory().Slow(GetName(), damager, damagee, 2.5 + (0.5 * level), 3, false, true, true, true);
Factory.Condition().Factory().Invulnerable(GetName(), damagee, damagee, 1, false, false);
Factory.Condition().Factory().Invulnerable(GetName(), damagee, damagee, 0.3, false, false);
_fall.put(damagee, System.currentTimeMillis());

View File

@ -61,7 +61,9 @@ public class HealingShot extends SkillActive
"Regeneration 3 for #3#1 seconds,",
"and remove all negative effects.",
"",
"Gives Nausea to enemies for #5#1 seconds."
"Self hits give Regeneration 2.",
"",
"Gives Nausea to enemies for #5#1 seconds.",
});
}
@ -153,9 +155,9 @@ public class HealingShot extends SkillActive
projectile.remove();
//Regen
if (!Factory.Relation().canHurt(damager, damagee))
if (!Factory.Relation().canHurt(damager, damagee) || damager.equals(damagee))
{
Factory.Condition().Factory().Regen(GetName(), damagee, damager, 3 + level, 2, false, false, false);
Factory.Condition().Factory().Regen(GetName(), damagee, damager, 3 + level, damager.equals(damagee) ? 1 : 2, false, false, false);
//Remove Bad
damagee.setFireTicks(0);

View File

@ -40,8 +40,9 @@ public class HeavyArrows extends Skill
"an additional #10#10 % knockback",
"as well as #1#1 additional damage.",
"",
"You also receive #10#10 % knockback",
"when firing arrows if not sneaking.",
"You also receive #12#6 % reversed",
"velocity of your arrows while not",
"sneaking.",
});
}
@ -63,7 +64,7 @@ public class HeavyArrows extends Skill
//Backboost
if (!player.isSneaking() && Recharge.Instance.use(player, GetName(), 750, false, false))
{
double vel = (event.getProjectile().getVelocity().length() * (0.1 + 0.1 * level));
double vel = (event.getProjectile().getVelocity().length() * (0.12 + 0.06 * level));
UtilAction.velocity(player, player.getLocation().getDirection().multiply(-1), vel,
false, 0, 0.3, 0.6, true);
}

View File

@ -25,7 +25,7 @@ public class Longshot extends Skill
SetDesc(new String[]
{
"Arrows do an additional 1 damage",
"for every #4#-0.5 Blocks they travelled,",
"for every #4.5#-0.5 Blocks they travelled,",
"however, their base damage is",
"reduced by 5.",
"",
@ -74,7 +74,7 @@ public class Longshot extends Skill
double length = UtilMath.offset(loc, projectile.getLocation());
// Damage
double damage = Math.min(6 + 6 * level, (length / (4 - 0.5 * level)) - 5);
double damage = Math.min(6 + 6 * level, (length / (4.5 - 0.5 * level)) - 5);
if (damage < 0)
damage = 0;

View File

@ -49,7 +49,7 @@ public class Overcharge extends SkillChargeBow
@Override
public void DoSkillCustom(Player player, float charge, Arrow arrow)
{
double damage = charge * (getLevel(player));
double damage = charge * (1.5 + 1.5 * getLevel(player));
_arrows.put(arrow, damage);
}

View File

@ -9,6 +9,7 @@ import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
@ -78,25 +79,26 @@ public class Sharpshooter extends Skill
if (event.GetDamagerEntity(true) != null && event.GetDamagerEntity(true).equals(event.GetDamageeEntity()))
return;
int bonus = 1;
int bonus = 0;
if (_hitCount.containsKey(player))
bonus = _hitCount.get(player);
//Increase
bonus = Math.min(bonus + 1, 2 * level);
_hitCount.put(player, bonus);
//Damage
event.AddMod(player.getName(), GetName(), bonus, true);
//Increase
bonus = Math.min(bonus + 1, 2 * level);
_hitCount.put(player, bonus);
//Inform
UtilPlayer.message((Entity)projectile.getShooter(), F.main(GetClassType().name(), GetName() + ": " +
F.elem(bonus + " Consecutive Hits") + C.cGray + " (" + F.skill("+" + bonus + "Damage" ) + C.cGray + ")" ) );
UtilPlayer.message(event.GetDamagerPlayer(true), F.main(GetClassType().name(), GetName() + ": " +
F.elem(bonus + " Consecutive Hits") + C.cGray + " (" + F.skill("+" + bonus + " Damage" ) + C.cGray + ")" ) );
player.playSound(player.getLocation(), Sound.NOTE_PLING, 1f, 0.8f + (float)(bonus * 0.2));
projectile.remove();
Recharge.Instance.useForce(player, GetName() + " Timer", 5000);
}
@EventHandler

View File

@ -38,7 +38,7 @@ public class VitalitySpores extends Skill
@EventHandler
public void playerMove(PlayerMoveEvent event)
{
if (UtilMath.offset(event.getFrom(), event.getTo()) > 0)
if (doesUserHaveSkill(event.getPlayer()) && UtilMath.offset(event.getFrom(), event.getTo()) > 0)
_lastMove.put(event.getPlayer(), System.currentTimeMillis());
}
@ -71,6 +71,6 @@ public class VitalitySpores extends Skill
@Override
public void Reset(Player player)
{
_lastMove.remove(player);
}
}

View File

@ -45,7 +45,7 @@ public class WolfsPounce extends SkillChargeSword
"Taking damage cancels charge.",
"",
"Colliding with another player",
"mid-air deals up to 6 damage",
"mid-air deals up to #4#1 damage",
"and Slow 2 for 3 seconds."
});
@ -61,7 +61,7 @@ public class WolfsPounce extends SkillChargeSword
public void DoSkillCustom(Player player, float charge)
{
//Action
UtilAction.velocity(player, 0.4 + (1.4*charge), 0.2, 0.3 + (0.8*charge), true);
UtilAction.velocity(player, 0.4 + (1.4*charge), 0.2, 0.4 + (0.9*charge), true);
_live.put(player, System.currentTimeMillis());
//Inform
@ -128,7 +128,7 @@ public class WolfsPounce extends SkillChargeSword
if (_chargeStore.containsKey(damager))
charge = _chargeStore.remove(damager);
int damage = (int)(6 * charge);
int damage = (int)((4 + getLevel(damager)) * charge);
//Damage Event
Factory.Damage().NewDamageEvent(damagee, damager, null,

View File

@ -257,6 +257,11 @@ public abstract class Skill implements ISkill, Listener
return null;
}
protected boolean doesUserHaveSkill(Player player)
{
return _users.containsKey(player);
}
@Override
public Set<Player> GetUsers()
{

View File

@ -236,14 +236,14 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
//Sword
AddSkill(new Evade(this, "Evade", ClassType.Assassin, SkillType.Sword,
1, 4,
26, -2,
0, 0, true,
0, 0,
6500, -500, true,
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
AddSkill(new Illusion(this, "Illusion", ClassType.Assassin, SkillType.Sword,
1, 4,
50, -4,
0, 0,
17000, -1000, true,
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
@ -251,21 +251,21 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
//Axe
AddSkill(new Blink(this, "Blink", ClassType.Assassin, SkillType.Axe,
1, 4,
64, -4,
0, 0,
12000, 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 Flash(this, "Flash", ClassType.Assassin, SkillType.Axe,
1, 4,
30, -2,
0, 0,
0, 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 Leap(this, "Leap", ClassType.Assassin, SkillType.Axe,
1, 4,
36, -3,
0, 0,
10500, -1500, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
@ -273,21 +273,21 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
//Bow
AddSkill(new MarkedForDeath(this, "Marked for Death", ClassType.Assassin, SkillType.Bow,
1, 4,
40, 0,
0, 0,
20000, -2000, true,
new Material[] {Material.BOW},
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
AddSkill(new SmokeArrow(this, "Smoke Arrow", ClassType.Assassin, SkillType.Bow,
1, 4,
40, 0,
0, 0,
20000, -2000, true,
new Material[] {Material.BOW},
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
AddSkill(new SilencingArrow(this, "Silencing Arrow", ClassType.Assassin, SkillType.Bow,
1, 4,
40, 0,
0, 0,
20000, -2000, true,
new Material[] {Material.BOW},
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
@ -330,21 +330,21 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new SeismicSlam(this, "Seismic Slam", ClassType.Brute, SkillType.Axe,
1, 5,
0, 0,
24000, -2000, true,
21000, -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 Takedown(this, "Takedown", ClassType.Brute, SkillType.Axe,
1, 5,
0, 0,
24000, -2000, true,
21000, -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 WhirlwindAxe(this, "Whirlwind Axe", ClassType.Brute, SkillType.Axe,
1, 5,
0, 0,
24000, -2000, true,
21000, -1000, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
@ -411,7 +411,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new AxeThrow(this, "Roped Axe Throw", ClassType.Knight, SkillType.Axe,
1, 5,
0, 0,
2200, -200, true,
3300, -300, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));

View File

@ -12,6 +12,7 @@ public class Condition
{
CLOAK,
SHOCK,
POISON_SHOCK,
SILENCE,
BURNING,
FALLING,
@ -19,6 +20,7 @@ public class Condition
INVULNERABLE,
EXPLOSION,
FIRE_ITEM_IMMUNITY,
ARCADE_HUNGER_DISABLE,
CUSTOM,

View File

@ -346,16 +346,42 @@ public class ConditionEffect implements Listener
LivingEntity ent = event.GetDamageeEntity();
if (ent == null) return;
//Ignore Poison Shock
Condition poisonShock = Manager.GetActiveCondition(ent, ConditionType.POISON_SHOCK);
if (poisonShock != null)
{
event.SetCancelled("Poison Shock - Poison Cancel");
return;
}
Condition condition = Manager.GetActiveCondition(ent, ConditionType.POISON);
if (condition == null) return;
if (condition == null)
return;
//Damage
event.SetDamager(condition.GetSource());
event.AddMod(UtilEnt.getName(condition.GetSource()), condition.GetReason(), 0, true);
event.SetIgnoreArmor(true);
event.SetKnockback(false);
}
@EventHandler
public void PoisonShock(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (LivingEntity ent : Manager.GetActiveConditions().keySet())
{
Condition condition = Manager.GetActiveCondition(ent, ConditionType.POISON_SHOCK);
if (condition == null)
continue;
Manager.getDamagerManager().NewDamageEvent(ent, condition.GetSource(), null,
DamageCause.CUSTOM, 0.1, false, true, false,
condition.GetSource().getName(), "Poison");
}
}
@EventHandler
public void Fall(CustomDamageEvent event)

View File

@ -246,6 +246,14 @@ public class ConditionFactory
Material.SLIME_BALL, (byte)14, showIndicator, ambient));
}
public Condition PoisonShock(String reason, LivingEntity ent, LivingEntity source,
double duration, boolean extend)
{
return Manager.AddCondition(new Condition(Manager, reason, ent, source,
ConditionType.POISON_SHOCK, 0, (int)(20 * duration), extend,
Material.SLIME_BALL, (byte)14, false, false));
}
public Condition Confuse(String reason, LivingEntity ent, LivingEntity source,
double duration, int mult, boolean extend, boolean showIndicator, boolean ambient)
{
@ -277,4 +285,12 @@ public class ConditionFactory
ConditionType.HEALTH_BOOST, mult, (int)(20 * duration), extend,
Material.APPLE, (byte)0, showIndicator, ambient));
}
public Condition ArcadeHungerDisable(String reason, LivingEntity ent, LivingEntity source,
double duration, boolean extend)
{
return Manager.AddCondition(new Condition(Manager, reason, ent, source,
ConditionType.ARCADE_HUNGER_DISABLE, 0, (int)(20 * duration), extend,
Material.COAL, (byte)0, false, false));
}
}

View File

@ -18,6 +18,7 @@ import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilTime.TimeUnit;
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import mineplex.minecraft.game.core.condition.events.ConditionApplyEvent;
import mineplex.minecraft.game.core.damage.DamageManager;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -39,6 +40,8 @@ public class ConditionManager extends MiniPlugin
private ConditionFactory _factory;
private ConditionApplicator _applicator;
protected ConditionEffect Effect;
private DamageManager _damageManager;
private WeakHashMap<LivingEntity, LinkedList<Condition>> _conditions = new WeakHashMap<LivingEntity, LinkedList<Condition>>();
private WeakHashMap<LivingEntity, LinkedList<ConditionActive>> _activeConditions = new WeakHashMap<LivingEntity, LinkedList<ConditionActive>>();
@ -53,6 +56,16 @@ public class ConditionManager extends MiniPlugin
Applicator();
Effect();
}
public void setDamageManager(DamageManager damageManager)
{
_damageManager = damageManager;
}
public DamageManager getDamagerManager()
{
return _damageManager;
}
public ConditionFactory Factory()
{

View File

@ -253,6 +253,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
_damageManager = damageManager;
_damageManager.UseSimpleWeaponDamage = true;
_damageManager.setConditionManager(_conditionManager);
_conditionManager.setDamageManager(_damageManager);
_disguiseManager = disguiseManager;

View File

@ -90,7 +90,7 @@ public enum GameType
Lobbers(BombLobbers.class, GameDisplay.Lobbers),
Micro(Micro.class, GameDisplay.Micro),
MilkCow(MilkCow.class, GameDisplay.MilkCow),
MineStrike(MineStrike.class, GameDisplay.MineStrike, "http://chivebox.com/file/c/ResMinestrike.zip", true),
MineStrike(MineStrike.class, GameDisplay.MineStrike, "http://chivebox.com/mineplex/ResMinestrike.zip", true),
MineWare(MineWare.class, GameDisplay.MineWare),
OldMineWare(OldMineWare.class, GameDisplay.OldMineWare),
Paintball(Paintball.class, GameDisplay.Paintball),

View File

@ -363,7 +363,7 @@ public class MineStrike extends TeamGame
event.getPlayer().getInventory().setItem(2, ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1, "Knife"));
//Armor
giveTeamArmor(event.getPlayer(), Color.fromRGB(255, 0, 0));
giveTeamArmor(event.getPlayer(), Color.fromRGB(255, 75, 75));
}
}
else if (team.GetColor() == ChatColor.AQUA)
@ -379,7 +379,7 @@ public class MineStrike extends TeamGame
event.getPlayer().getInventory().setItem(2, ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1, "Knife"));
//Armor
giveTeamArmor(event.getPlayer(), Color.fromRGB(0, 0, 255));
giveTeamArmor(event.getPlayer(), Color.fromRGB(125, 200, 255));
}
}
@ -1233,8 +1233,6 @@ public class MineStrike extends TeamGame
//Effect
damagee.getWorld().playSound(damagee.getLocation(), Sound.IRONGOLEM_DEATH, 1f, 1f);
event.SetKnockback(false);
}
//Standard
else
@ -1243,9 +1241,9 @@ public class MineStrike extends TeamGame
event.AddMod(damager.getName(), "Knife", 6 - event.GetDamage(), false);
event.GetDamageeEntity().getWorld().playSound(event.GetDamageeEntity().getLocation(), Sound.BAT_HURT, 1f, 1f);
event.AddKnockback("Knife", 1.2);
}
event.SetKnockback(false);
}
}
@ -1307,12 +1305,11 @@ public class MineStrike extends TeamGame
if (Armor.isArmor(event.GetDamageePlayer().getInventory().getHelmet()) ||
(_scoped.containsKey(event.GetDamageePlayer()) && UtilGear.isMat(_scoped.get(event.GetDamageePlayer()), Material.LEATHER_HELMET)))
{
event.AddMod(event.GetDamageePlayer().getName(), "Helmet", -damage*1, false);
event.AddMod(event.GetDamageePlayer().getName(), "Helmet", -damage*0.5, false);
event.GetDamageePlayer().getWorld().playSound(event.GetDamageePlayer().getEyeLocation(), Sound.SPIDER_DEATH, 1f, 1f);
}
else
{
event.GetDamageePlayer().getWorld().playSound(event.GetDamageePlayer().getEyeLocation(), Sound.SLIME_ATTACK, 1f, 1f);
}
}
@ -1384,16 +1381,16 @@ public class MineStrike extends TeamGame
public boolean hitBody(Player player, Location loc)
{
return UtilMath.offset2d(loc, player.getLocation()) < 0.6 && //0.6 is ideal
loc.getY() > player.getLocation().getY() &&
loc.getY() < player.getEyeLocation().getY() - 0.1;
return UtilMath.offset2d(loc, player.getLocation()) < 0.6 &&
loc.getY() >= player.getLocation().getY() &&
loc.getY() <= player.getEyeLocation().getY();
}
public boolean hitHead(Player player, Location loc)
{
return UtilMath.offset2d(loc, player.getLocation()) < 0.2 && //0.3 was old value, too large
loc.getY() >= player.getEyeLocation().getY() - 0.1 &&
loc.getY() < player.getEyeLocation().getY() + 0.1; //0.2 was old value, too large
return UtilMath.offset2d(loc, player.getLocation()) < 0.2 &&
loc.getY() >= player.getEyeLocation().getY() + 0.0 &&
loc.getY() < player.getEyeLocation().getY() + 0.2;
}
@ -2722,7 +2719,7 @@ public class MineStrike extends TeamGame
public void fireDamage(CustomDamageEvent event)
{
if (event.GetCause() == DamageCause.FIRE)
event.AddMod(this.GetName(), "Fire", 3, false);
event.AddMod(this.GetName(), "Fire", 1, false);
}
@EventHandler
@ -3043,4 +3040,23 @@ public class MineStrike extends TeamGame
return SpectatorSpawn;
}
@EventHandler
public void enableScpResPack(PlayerCommandPreprocessEvent event)
{
if (event.getMessage().equalsIgnoreCase("/rpoff"))
{
event.getPlayer().setResourcePack("http://file.mineplex.com/ResReset.zip");
UtilPlayer.message(event.getPlayer(), F.main("Resource Pack", "Resource Pack: " + C.cRed + "Disabled"));
UtilPlayer.message(event.getPlayer(), F.main("Resource Pack", "Type " + F.elem("/rpon") + " to enable."));
}
else if (event.getMessage().equalsIgnoreCase("/rpon"))
{
event.getPlayer().setResourcePack(GetType().getResourcePackUrl());
UtilPlayer.message(event.getPlayer(), F.main("Resource Pack", "Resource Pack: " + C.cGreen + "Enabled"));
UtilPlayer.message(event.getPlayer(), F.main("Resource Pack", "Type " + F.elem("/rpoff") + " to disable."));
}
}
}

View File

@ -238,12 +238,12 @@ public class ShopManager
else if (item instanceof Helmet)
{
((Helmet)item).giveToPlayer(player, (team.GetColor() == ChatColor.RED) ? Color.fromRGB(100, 0, 0) : Color.fromRGB(0, 0, 100));
((Helmet)item).giveToPlayer(player, (team.GetColor() == ChatColor.RED) ? Color.fromRGB(255, 75, 75) : Color.fromRGB(125, 200, 255));
}
else if (item instanceof Kevlar)
{
((Kevlar)item).giveToPlayer(player, (team.GetColor() == ChatColor.RED) ? Color.fromRGB(100, 0, 0) : Color.fromRGB(0, 0, 100));
((Kevlar)item).giveToPlayer(player, (team.GetColor() == ChatColor.RED) ? Color.fromRGB(255, 75, 75) : Color.fromRGB(125, 200, 255));
}
else if (item instanceof DefusalKit)

View File

@ -84,7 +84,7 @@ public abstract class FireGrenadeBase extends Grenade
game.Manager.GetBlockRestore().Add(block, 51, (byte)0, (long) time);
}
}
}, 60 - (int)(60d * blocks.get(block)));
}, 30 - (int)(30d * blocks.get(block)));
}
//Initial Burn Sound

View File

@ -68,8 +68,8 @@ public class FlashBang extends Grenade
double flashIntensity = 2 - UtilMath.offset(player.getEyeLocation().add(player.getLocation().getDirection()), eyeToGrenade);
//Duration
double duration = (2 + (3 * (players.get(player)))) * flashIntensity;
duration += 1;
double duration = (2 + (2 * (players.get(player)))) * flashIntensity;
duration = (Math.min(5, duration));
//Blind
game.Manager.GetCondition().Factory().Blind(getName(), player, _thrower, duration, 0, false, false, false);

View File

@ -87,7 +87,7 @@ public abstract class Grenade extends StrikeItem
int alreadyHas = 0;
int bestSlot = -1;
for (int i = 5 ; i >= 3 ; i--)
for (int i = 6 ; i >= 3 ; i--)
{
if (UtilInv.IsItem(player.getInventory().getItem(i), getSkin(), (byte) -1))
alreadyHas++;

View File

@ -43,7 +43,7 @@ public class HighExplosive extends Grenade
ent.getWorld().playSound(ent.getLocation(),
Sound.EXPLODE, 3f, 0.8f);
HashMap<Player, Double> players = UtilPlayer.getInRadius(ent.getLocation(), 10);
HashMap<Player, Double> players = UtilPlayer.getInRadius(ent.getLocation(), 9);
List<Player> damagedPlayers = new ArrayList<>();
for (Player player : players.keySet())
{

View File

@ -31,8 +31,12 @@ public class Smoke extends Grenade
{
if (ent.getTicksLived() > 60)
{
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, ent.getLocation(), 0.3f, 0.3f, 0.3f, 0, 1,
// UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, ent.getLocation(), 0.3f, 0.3f, 0.3f, 0, 1,
// ViewDist.MAX, UtilServer.getPlayers());
UtilParticle.PlayParticle(ParticleType.CLOUD, ent.getLocation(), 1.5f, 1.5f, 1.5f, 0, 100,
ViewDist.MAX, UtilServer.getPlayers());
ent.getWorld().playSound(ent.getLocation(), Sound.FIZZ, 0.1f, 0.1f);

View File

@ -273,8 +273,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
return;
}
_maxY = GetTeamList().get(1).GetSpawn().getBlockY() - 4;
if(event.getBlock().getLocation().getBlockY() < _maxY)
if(event.getBlock().getLocation().getBlockY() < _maxY - 4)
{
event.getPlayer().sendMessage(F.main("BlockChecker", "You may not build under this height!"));
event.setCancelled(true);
@ -298,7 +297,6 @@ public class WitherGame extends TeamGame implements IBlockRestorer
}
Location blockLocation = event.getBlock().getLocation();
_maxY = GetTeamList().get(1).GetSpawn().getBlockY() - 3;
if(blockLocation.add(0,1,0).getBlock().getType() == Material.AIR)
{
for(Player humans: _runners.GetPlayers(true))
@ -317,7 +315,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
}
}
if(blockLocation.getBlockY() < _maxY)
if(blockLocation.getBlockY() < _maxY - 3)
{
event.getPlayer().sendMessage(F.main("BlockChecker", "You may not build under this height!"));
event.setCancelled(true);
@ -435,6 +433,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
if (event.GetState() != GameState.Live)
return;
_maxY = GetTeamList().get(1).GetSpawn().getBlockY();
UtilTextMiddle.display(C.cGreen + "Humans Hiding",
"15 Seconds until Assault", 10, 80, 10);

View File

@ -60,7 +60,7 @@ public class PerkBlockRestorer extends Perk implements IThrown
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.COMMAND));
UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(ent, player, this, -1, false, false, true, false, 0.5f);
Manager.GetProjectile().AddThrow(ent, player, this, -1, false, false, true, true, 0.5f);
}
@Override

View File

@ -20,6 +20,7 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.teleport.event.MineplexTeleportEvent;
import mineplex.core.updater.UpdateType;
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.GameType;
@ -854,6 +855,9 @@ public class GameFlagManager implements Listener
if (game.HungerSet != -1)
for (Player player : game.GetPlayers(true))
{
if (Manager.GetCondition().HasCondition(player, ConditionType.ARCADE_HUNGER_DISABLE, null))
continue;
player.setFoodLevel(game.HungerSet);
player.setSaturation(1F);
}