Merge branch 'master' of ssh://dev1.mineplex.com:7999/min/Mineplex
This commit is contained in:
commit
9b4e1aa9eb
@ -95,7 +95,7 @@ public class Flash extends SkillActive
|
||||
int charges = _flash.get(cur);
|
||||
int level = getLevel(cur);
|
||||
|
||||
if (charges >= 1 + level)
|
||||
if (charges >= 2 + level)
|
||||
continue;
|
||||
|
||||
if (!mineplex.core.recharge.Recharge.Instance.use(cur, "Flash Recharge", 9000 - (1000 * level), false, false))
|
||||
|
@ -139,7 +139,7 @@ public class SmokeArrow extends SkillActive
|
||||
event.AddMod(damager.getName(), GetName(), 0, true);
|
||||
|
||||
//Effect
|
||||
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, projectile.getLocation(), 0, 0, 0, 0, 1);
|
||||
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, projectile.getLocation(), 0, 0, 0, 0, 1);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -44,14 +44,14 @@ public class Stealth extends Skill
|
||||
"Invisible, but also Slow #4#-1.",
|
||||
"",
|
||||
"Stealth ends if you an enemy comes",
|
||||
"within #8#-2 Blocks of you, or you attack.",
|
||||
"within #10#-2 Blocks of you, or you attack.",
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public String GetEnergyString()
|
||||
{
|
||||
return "Energy: 8 per Second";
|
||||
return "Energy: #13#1 per Second";
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -81,7 +81,7 @@ public class Stealth extends Skill
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UtilTime.elapsed(Factory.Combat().Get(player).LastCombat, 4000))
|
||||
if (!UtilTime.elapsed(Factory.Combat().Get(player).GetLastCombat(), 4000))
|
||||
{
|
||||
UtilPlayer.message(player, F.main(GetClassType().name(), "You cannot use " + F.skill(GetName()) + " while in Combat."));
|
||||
return;
|
||||
@ -222,7 +222,7 @@ public class Stealth extends Skill
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Factory.Energy().Use(cur, GetName(), 0.4, true, false))
|
||||
if (!Factory.Energy().Use(cur, GetName(), 0.9 - (0.1 * getLevel(cur)), true, false))
|
||||
{
|
||||
Remove(cur, null);
|
||||
continue;
|
||||
|
@ -22,7 +22,7 @@ public class ViperStrikes extends Skill
|
||||
SetDesc(new String[]
|
||||
{
|
||||
"Your attacks give enemies",
|
||||
"Poison 1 for #0#2 seconds,",
|
||||
"Poison 1 for #1#2 seconds,",
|
||||
"but deal #1#1 less damage."
|
||||
});
|
||||
}
|
||||
@ -49,7 +49,7 @@ public class ViperStrikes extends Skill
|
||||
if (damagee == null) return;
|
||||
|
||||
//Confuse
|
||||
Factory.Condition().Factory().Poison(GetName(), damagee, damager, 0 + 2*level, 0, false, false, false);
|
||||
Factory.Condition().Factory().Poison(GetName(), damagee, damager, 1 + 2*level, 0, false, false, false);
|
||||
|
||||
//Damage
|
||||
event.AddMod(damager.getName(), GetName(), -1 - level, true);
|
||||
|
@ -210,7 +210,7 @@ public class BlockToss extends SkillCharge implements IThrown
|
||||
Player damager = event.GetDamagerPlayer(true);
|
||||
if (damager == null) return;
|
||||
|
||||
if (event.GetReason() != null && !event.GetReason().equals(GetName()))
|
||||
if (event.GetReason() == null || !event.GetReason().equals(GetName()))
|
||||
return;
|
||||
|
||||
event.AddKnockback(GetName(), 1.5d);
|
||||
|
@ -108,15 +108,12 @@ public class SeismicSlam extends SkillActive
|
||||
_live.remove(player);
|
||||
|
||||
//Action
|
||||
HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(player.getLocation(), 5 + level);
|
||||
HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(player.getLocation(), 5d + level);
|
||||
for (LivingEntity cur : targets.keySet())
|
||||
{
|
||||
if (cur.equals(player))
|
||||
continue;
|
||||
|
||||
if (!UtilEnt.isGrounded(player))
|
||||
continue;
|
||||
|
||||
//Damage Event
|
||||
Factory.Damage().NewDamageEvent(cur, player, null,
|
||||
DamageCause.CUSTOM, (3+level) * targets.get(cur) + 0.5, false, true, false,
|
||||
|
@ -34,9 +34,13 @@ public class Resistance extends Skill
|
||||
event.GetCondition().GetType() != ConditionType.BLINDNESS)
|
||||
return;
|
||||
|
||||
double reduction = (0.25 * getLevel(event.GetCondition().GetEnt()));
|
||||
int level = getLevel(event.GetCondition().GetEnt());
|
||||
if (level <= 0)
|
||||
return;
|
||||
|
||||
double reduction = -(0.25f * level);
|
||||
|
||||
event.GetCondition().ModifyTicks((int) (event.GetCondition().GetTicksTotal() * (1 - reduction)));
|
||||
event.GetCondition().ModifyTicks((int) (event.GetCondition().GetTicksTotal() * reduction));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -61,7 +61,7 @@ public class Cleave extends Skill
|
||||
//Splash
|
||||
for (Player other : UtilPlayer.getNearby(damagee.getLocation(), 1.5 + (0.5 * level)))
|
||||
{
|
||||
if (!other.equals(damagee))
|
||||
if (!other.equals(damagee) && !other.equals(damager))
|
||||
if (Factory.Relation().CanHurt(damager, other))
|
||||
{
|
||||
//Damage Event
|
||||
|
@ -42,8 +42,8 @@ public class HoldPosition extends SkillActive
|
||||
SetDesc(new String[]
|
||||
{
|
||||
"Hold your position, gaining",
|
||||
"Protection 4, Slow 4 and no",
|
||||
"knockback for #3.5#1.5 seconds."
|
||||
"Protection 4, Slow 3 and no",
|
||||
"knockback for #2.5#1.5 seconds."
|
||||
});
|
||||
}
|
||||
|
||||
@ -62,10 +62,10 @@ public class HoldPosition extends SkillActive
|
||||
@Override
|
||||
public void Skill(Player player, int level)
|
||||
{
|
||||
double duration = 3.5 + (1.5 * level);
|
||||
double duration = 3 + (1 * level);
|
||||
|
||||
//Action
|
||||
Factory.Condition().Factory().Slow(GetName(), player, player, duration, 3, false, true, false, true);
|
||||
Factory.Condition().Factory().Slow(GetName(), player, player, duration, 2, false, true, false, true);
|
||||
Factory.Condition().Factory().Protection(GetName(), player, player, duration, 3, false, true, true);
|
||||
|
||||
//Inform
|
||||
|
@ -127,7 +127,7 @@ public class Blizzard extends SkillActive
|
||||
|
||||
//Snow
|
||||
if (target == null || target.getType() == Material.AIR || UtilMath.offset(target.getLocation(), cur.getLocation()) > 5)
|
||||
for (int i=0 ; i<4 ; i++)
|
||||
for (int i=0 ; i<1+level ; i++)
|
||||
{
|
||||
Projectile snow = cur.launchProjectile(Snowball.class);
|
||||
double x = 0.2 - (UtilMath.r(40)/100d);
|
||||
|
@ -41,7 +41,7 @@ public class FireBlast extends SkillActive
|
||||
{
|
||||
"Launch a fireball which explodes on impact",
|
||||
"dealing large knockback to enemies within",
|
||||
"#3.5#1.5 Blocks range. Also ignites enemies",
|
||||
"#6#0.5 Blocks range. Also ignites enemies",
|
||||
"for up to #2#2 seconds."
|
||||
});
|
||||
}
|
||||
@ -98,20 +98,20 @@ public class FireBlast extends SkillActive
|
||||
if (level == 0) return;
|
||||
|
||||
//Velocity Players
|
||||
HashMap<Player,Double> hitMap = UtilPlayer.getInRadius(proj.getLocation(), 4 + (2 * level));
|
||||
HashMap<Player,Double> hitMap = UtilPlayer.getInRadius(proj.getLocation(), 5.5 + (0.5 * level));
|
||||
for (Player cur : hitMap.keySet())
|
||||
{
|
||||
double range = hitMap.get(cur);
|
||||
|
||||
//Damage Event
|
||||
Factory.Condition().Factory().Ignite(GetName(), cur, player, (2 + (2 * level)) * range, false, false);
|
||||
Factory.Condition().Factory().Ignite(GetName(), cur, player, (2 + (1 * level)) * range, false, false);
|
||||
|
||||
//Condition
|
||||
Factory.Condition().Factory().Falling(GetName(), cur, player, 10, false, true);
|
||||
|
||||
//Velocity
|
||||
UtilAction.velocity(cur, UtilAlg.getTrajectory(proj.getLocation().add(0, -0.5, 0), cur.getEyeLocation()),
|
||||
0.5 + 1.5 * range, false, 0, 0.2 + 0.6 * range, 1.2, true);
|
||||
1.6 * range, false, 0, 0.8 * range, 1.2, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ public class MagmaBlade extends Skill
|
||||
if (level == 0) return;
|
||||
|
||||
//Damage
|
||||
event.AddMod(damager.getName(), GetName(), level, true);
|
||||
event.AddMod(damager.getName(), GetName(), 1 + level, true);
|
||||
|
||||
//Effect
|
||||
damager.getWorld().playSound(damager.getLocation(), Sound.FIZZ, 0.8f, 0f);
|
||||
|
@ -60,7 +60,7 @@ public class Rupture extends SkillActiveCharge
|
||||
{
|
||||
"Hold Block to create a rupture",
|
||||
"at your feet. It will snake through",
|
||||
"the ground with #1#0.1 velocity, moving" +
|
||||
"the ground with #1#0.1 velocity, moving",
|
||||
"towards where you are looking,",
|
||||
"giving Slow 2 to nearby opponents.",
|
||||
"",
|
||||
|
@ -36,8 +36,8 @@ public class Void extends Skill
|
||||
"Slow 3, take no knockback and",
|
||||
"use no energy to swing weapons.",
|
||||
"",
|
||||
"Reduces incoming damage by #2#1 , but",
|
||||
"burns #7#-1 Energy per 1 damage reduced."
|
||||
"Reduces incoming damage by #1#1 , but",
|
||||
"burns #9#-1 Energy per 1 damage reduced."
|
||||
});
|
||||
}
|
||||
|
||||
@ -129,7 +129,20 @@ public class Void extends Skill
|
||||
|
||||
//Energy
|
||||
Factory.Energy().ModifyEnergy(cur, -0.3);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Conditions(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
|
||||
for (Player cur : _active)
|
||||
{
|
||||
if (cur.isDead())
|
||||
continue;
|
||||
|
||||
//Condition
|
||||
Factory.Condition().Factory().Invisible(GetName(), cur, cur, 1.9, 0, false, true, true);
|
||||
Factory.Condition().Factory().Slow(GetName(), cur, cur, 1.9, 1, false, true, false, true);
|
||||
@ -151,7 +164,7 @@ public class Void extends Skill
|
||||
int level = getLevel(damagee);
|
||||
if (level == 0) return;
|
||||
|
||||
double dmgToEnergy = 7 - level;
|
||||
double dmgToEnergy = 9 - level;
|
||||
int dmgLower = 1 + level;
|
||||
|
||||
int currentEnergy = (int)Factory.Energy().GetCurrent(damagee);
|
||||
|
@ -24,7 +24,7 @@ public class VitalitySpores extends Skill
|
||||
{
|
||||
"After #12#-2 seconds of not taking damage,",
|
||||
"forest spores surround you, giving",
|
||||
"you Regeneration 1 for #4#2 seconds.",
|
||||
"you Regeneration 1 for #3#2 seconds.",
|
||||
"",
|
||||
"This remains until you take damage."
|
||||
});
|
||||
@ -40,11 +40,11 @@ public class VitalitySpores extends Skill
|
||||
{
|
||||
int level = getLevel(cur);
|
||||
if (level == 0) continue;
|
||||
|
||||
if (UtilTime.elapsed(Factory.Combat().Get(cur).LastDamaged, 10000))
|
||||
|
||||
if (UtilTime.elapsed(Factory.Combat().Get(cur).GetLastDamaged(), 12000 - 2000*level))
|
||||
{
|
||||
Factory.Condition().Factory().Regen(GetName(), cur, cur, 6.9, 0, false, true, true);
|
||||
UtilPlayer.health(cur, 1);
|
||||
Factory.Condition().Factory().Regen(GetName(), cur, cur, 3.9 + 2*level, 0, false, true, true);
|
||||
UtilPlayer.health(cur, 0.5);
|
||||
|
||||
if (Recharge.Instance.use(cur, GetName(), 2000, false, false))
|
||||
UtilParticle.PlayParticle(ParticleType.HEART, cur.getEyeLocation(), 0, 0.2f, 0, 0, 1);
|
||||
|
@ -72,7 +72,7 @@ public class WolfsFury extends SkillActive
|
||||
_active.put(player, System.currentTimeMillis() + 8000);
|
||||
|
||||
//Condition
|
||||
Factory.Condition().Factory().Strength(GetName(), player, player, 2 + 2*level, 2, false, true, true);
|
||||
Factory.Condition().Factory().Strength(GetName(), player, player, 2 + 2*level, level-1, false, true, true);
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));
|
||||
|
@ -190,10 +190,10 @@ public abstract class Skill implements ISkill, Listener
|
||||
|
||||
try
|
||||
{
|
||||
double base = Double.parseDouble(numberToks[0]);
|
||||
double bonus = Double.parseDouble(numberToks[1]);
|
||||
float base = Float.parseFloat(numberToks[0]);
|
||||
float bonus = Float.parseFloat(numberToks[1]);
|
||||
|
||||
double levelValue = base + ((double)level * bonus);
|
||||
float levelValue = base + (level * bonus);
|
||||
|
||||
String plusMinus = "+";
|
||||
if (bonus < 0)
|
||||
@ -211,7 +211,7 @@ public abstract class Skill implements ISkill, Listener
|
||||
//Only display what you'd get with level 1
|
||||
if (level == 0 )
|
||||
{
|
||||
levelValue = base + ((double)1 * bonus);
|
||||
levelValue = base + (1f * bonus);
|
||||
|
||||
totalString = levelValue + "";
|
||||
if (levelValue % 1 == 0)
|
||||
|
@ -154,7 +154,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
||||
AddSkill(new Resistance(this, "Resistance", ClassType.Global, SkillType.GlobalPassive, 5, 3));
|
||||
AddSkill(new Rations(this, "Rations", ClassType.Global, SkillType.GlobalPassive, 5, 2));
|
||||
|
||||
AddSkill(new Fitness(this, "Mana Pool", ClassType.Mage, SkillType.GlobalPassive, 5, 5));
|
||||
AddSkill(new Fitness(this, "Mana Pool", ClassType.Mage, SkillType.GlobalPassive, 5, 3));
|
||||
AddSkill(new Recharge(this, "Mana Regeneration", ClassType.Mage, SkillType.GlobalPassive, 5, 3));
|
||||
|
||||
AddSkill(new Fitness(this, "Fitness", ClassType.Assassin, SkillType.GlobalPassive, 5, 3));
|
||||
@ -418,7 +418,6 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
||||
AddSkill(new Void(this, "Void", ClassType.Mage, SkillType.PassiveA, 5, 3));
|
||||
AddSkill(new LifeBonds(this, "Life Bonds", ClassType.Mage, SkillType.PassiveA, 5, 3));
|
||||
|
||||
|
||||
//Passive B
|
||||
AddSkill(new GlacialBlade(this, "Glacial Blade", ClassType.Mage, SkillType.PassiveB,
|
||||
5, 3,
|
||||
|
@ -3,6 +3,8 @@ package mineplex.minecraft.game.core.combat;
|
||||
import java.util.LinkedList;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
|
||||
public class ClientCombat
|
||||
@ -13,7 +15,8 @@ public class ClientCombat
|
||||
|
||||
private WeakHashMap<LivingEntity, Long> _lastHurt = new WeakHashMap<LivingEntity, Long>();
|
||||
private WeakHashMap<LivingEntity, Long> _lastHurtBy = new WeakHashMap<LivingEntity, Long>();
|
||||
|
||||
private long _lastHurtByWorld = 0;
|
||||
|
||||
public LinkedList<CombatLog> GetKills()
|
||||
{
|
||||
return _kills;
|
||||
@ -32,8 +35,18 @@ public class ClientCombat
|
||||
public boolean CanBeHurtBy(LivingEntity damager)
|
||||
{
|
||||
if (damager == null)
|
||||
return true;
|
||||
|
||||
{
|
||||
if (UtilTime.elapsed(_lastHurtByWorld, 250))
|
||||
{
|
||||
_lastHurtByWorld = System.currentTimeMillis();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!_lastHurtBy.containsKey(damager))
|
||||
{
|
||||
_lastHurtBy.put(damager, System.currentTimeMillis());
|
||||
|
@ -23,8 +23,8 @@ public class CombatLog
|
||||
private String _killerColor = ChatColor.YELLOW + "";
|
||||
|
||||
protected CombatComponent LastDamager;
|
||||
public long LastDamaged;
|
||||
public long LastCombat;
|
||||
protected long _lastDamaged;
|
||||
protected long _lastCombat;
|
||||
|
||||
public CombatLog(Player player, long expireTime)
|
||||
{
|
||||
@ -49,11 +49,11 @@ public class CombatLog
|
||||
CombatComponent comp = GetEnemy(damagerName, damagerEnt);
|
||||
|
||||
comp.AddDamage(attackName, damage);
|
||||
|
||||
|
||||
// Set Last
|
||||
LastDamager = comp;
|
||||
LastDamaged = System.currentTimeMillis();
|
||||
LastCombat = System.currentTimeMillis();
|
||||
_lastDamaged = System.currentTimeMillis();
|
||||
_lastCombat = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public CombatComponent GetEnemy(String name, LivingEntity ent)
|
||||
@ -133,6 +133,21 @@ public class CombatLog
|
||||
{
|
||||
return LastDamager;
|
||||
}
|
||||
|
||||
public long GetLastDamaged()
|
||||
{
|
||||
return _lastDamaged;
|
||||
}
|
||||
|
||||
public long GetLastCombat()
|
||||
{
|
||||
return _lastCombat;
|
||||
}
|
||||
|
||||
public void SetLastCombat(long time)
|
||||
{
|
||||
_lastCombat = time;
|
||||
}
|
||||
|
||||
public long GetDeathTime()
|
||||
{
|
||||
@ -163,4 +178,6 @@ public class CombatLog
|
||||
{
|
||||
_killerColor = color;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ public class CombatManager extends MiniPlugin
|
||||
if (damagerEnt != null)
|
||||
{
|
||||
if (damagerEnt instanceof Player)
|
||||
Get((Player)damagerEnt).LastCombat = System.currentTimeMillis();
|
||||
Get((Player)damagerEnt).SetLastCombat(System.currentTimeMillis());
|
||||
|
||||
Get(damagee).Attacked(
|
||||
UtilEnt.getName(damagerEnt),
|
||||
@ -226,7 +226,7 @@ public class CombatManager extends MiniPlugin
|
||||
}
|
||||
|
||||
if (event.GetDamagerEntity(true) instanceof Player)
|
||||
Get((Player)event.GetDamagerEntity(true)).LastCombat = System.currentTimeMillis();
|
||||
Get((Player)event.GetDamagerEntity(true)).SetLastCombat(System.currentTimeMillis());
|
||||
|
||||
Get(event.GetDamageePlayer()).Attacked(
|
||||
UtilEnt.getName(event.GetDamagerEntity(true)),
|
||||
@ -521,7 +521,10 @@ public class CombatManager extends MiniPlugin
|
||||
public CombatLog Get(Player player)
|
||||
{
|
||||
if (!_active.containsKey(player))
|
||||
{
|
||||
Add(player);
|
||||
}
|
||||
|
||||
|
||||
return _active.get(player);
|
||||
}
|
||||
|
@ -339,6 +339,7 @@ public class ConditionEffect implements Listener
|
||||
event.SetDamager(condition.GetSource());
|
||||
event.AddMod(UtilEnt.getName(condition.GetSource()), condition.GetReason(), 0, true);
|
||||
event.SetIgnoreArmor(true);
|
||||
event.SetKnockback(false);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -139,7 +139,7 @@ public class DamageManager extends MiniPlugin
|
||||
public void NewDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile proj,
|
||||
DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor,
|
||||
String source, String reason, boolean cancelled)
|
||||
{
|
||||
{
|
||||
_plugin.getServer().getPluginManager().callEvent(
|
||||
new CustomDamageEvent(damagee, damager, proj, cause, damage,
|
||||
knockback, ignoreRate, ignoreArmor,
|
||||
@ -166,12 +166,12 @@ public class DamageManager extends MiniPlugin
|
||||
return;
|
||||
}
|
||||
|
||||
//Limit World Damage Rate
|
||||
//Limit Mob/World Damage Rate
|
||||
if (!event.IgnoreRate())
|
||||
{
|
||||
if (!_combatManager.Get(damagee.getName()).CanBeHurtBy(event.GetDamagerEntity(true)))
|
||||
{
|
||||
event.SetCancelled("Damage Rate");
|
||||
event.SetCancelled("World/Monster Damage Rate");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -192,7 +192,7 @@ public class DamageManager extends MiniPlugin
|
||||
if (!event.IgnoreRate())
|
||||
if (!_combatManager.Get(damager.getName()).CanHurt(event.GetDamageeEntity()))
|
||||
{
|
||||
event.SetCancelled("Damage Rate");
|
||||
event.SetCancelled("PvP Damage Rate");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -545,4 +545,9 @@ public class DamageManager extends MiniPlugin
|
||||
{
|
||||
_enabled = var;
|
||||
}
|
||||
|
||||
public CombatManager GetCombatManager()
|
||||
{
|
||||
return _combatManager;
|
||||
}
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
|
||||
if (serverConfig.GameList.contains(GameType.Dominate))
|
||||
{
|
||||
_skillFactory = new SkillFactory(plugin, damageManager, this, new CombatManager(plugin), conditionManager, _projectileManager, _blockRestore, _fire, new Movement(plugin), teleport, new Energy(plugin), webAddress);
|
||||
_skillFactory = new SkillFactory(plugin, damageManager, this, _damageManager.GetCombatManager(), conditionManager, _projectileManager, _blockRestore, _fire, new Movement(plugin), teleport, new Energy(plugin), webAddress);
|
||||
_classManager = new ClassManager(plugin, clientManager, donationManager, _skillFactory, webAddress);
|
||||
|
||||
_classShopManager = new ClassShopManager(_plugin, _classManager, _skillFactory, new ItemPackFactory(_plugin));
|
||||
|
@ -22,9 +22,7 @@ public class StopCommand extends CommandBase<ArcadeManager>
|
||||
return;
|
||||
|
||||
HandlerList.unregisterAll(Plugin.GetGame());
|
||||
Plugin.GetGame().SetState(GameState.Dead);
|
||||
Plugin.GetGame().WorldData.Uninitialize();
|
||||
Plugin.SetGame(null);
|
||||
Plugin.GetGame().SetState(GameState.End);
|
||||
|
||||
caller.sendMessage("Stopped Game!");
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.combat.DeathMessageType;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
@ -33,8 +34,8 @@ import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
|
||||
public class Dominate extends TeamGame
|
||||
{
|
||||
//Map Data
|
||||
{
|
||||
//Map Data
|
||||
private ArrayList<CapturePoint> _points = new ArrayList<CapturePoint>();
|
||||
private ArrayList<Emerald> _emerald = new ArrayList<Emerald>();
|
||||
private ArrayList<Resupply> _resupply = new ArrayList<Resupply>();
|
||||
@ -51,39 +52,49 @@ public class Dominate extends TeamGame
|
||||
{
|
||||
super(manager, GameType.Dominate,
|
||||
|
||||
new Kit[]
|
||||
new Kit[]
|
||||
{
|
||||
new KitBrute(manager),
|
||||
new KitRanger(manager),
|
||||
new KitKnight(manager),
|
||||
new KitMage(manager),
|
||||
new KitAssassin(manager),
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
new String[]
|
||||
{
|
||||
"Capture Beacons for Points",
|
||||
"+500 Points for Emerald Powerups",
|
||||
"+200 Point for Kills",
|
||||
"+50 Points for Kills",
|
||||
"First team to 15000 Points wins"
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
_help = new String[]
|
||||
{
|
||||
"Capture Beacons faster with more people!",
|
||||
|
||||
|
||||
};
|
||||
|
||||
this.DeathOut = false;
|
||||
this.PrepareFreeze = false;
|
||||
this.HungerSet = 20;
|
||||
|
||||
this.PrepareFreeze = false;
|
||||
this.HungerSet = 20;
|
||||
this.WorldTimeSet = 2000;
|
||||
|
||||
this.DeathSpectateSecs = 10;
|
||||
|
||||
this.Manager.GetDamage().UseSimpleWeaponDamage = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void ParseData()
|
||||
{
|
||||
{
|
||||
for (String pointName : WorldData.GetAllCustomLocs().keySet())
|
||||
{
|
||||
_points.add(new CapturePoint(this, pointName, WorldData.GetAllCustomLocs().get(pointName).get(0)));
|
||||
}
|
||||
|
||||
|
||||
for (Location loc : WorldData.GetDataLocs("YELLOW"))
|
||||
{
|
||||
_resupply.add(new Resupply(this, loc));
|
||||
@ -173,7 +184,7 @@ public class Dominate extends TeamGame
|
||||
if (killerTeam.equals(killedTeam))
|
||||
return;
|
||||
|
||||
AddScore(killerTeam, 200);
|
||||
AddScore(killerTeam, 50);
|
||||
}
|
||||
|
||||
public void AddScore(GameTeam team, int score)
|
||||
@ -245,12 +256,12 @@ public class Dominate extends TeamGame
|
||||
_lastScoreboard.add(out);
|
||||
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(5 - i);
|
||||
}
|
||||
}
|
||||
|
||||
public void EndCheckScore()
|
||||
}
|
||||
|
||||
public void EndCheckScore()
|
||||
{
|
||||
GameTeam winner = null;
|
||||
|
||||
|
||||
if (_redScore >= _victoryScore)
|
||||
winner = GetTeam(ChatColor.RED);
|
||||
else if (_blueScore >= _victoryScore)
|
||||
@ -258,7 +269,7 @@ public class Dominate extends TeamGame
|
||||
|
||||
if (winner == null)
|
||||
return;
|
||||
|
||||
|
||||
ScoreboardWrite();
|
||||
|
||||
//Announce
|
||||
@ -276,7 +287,7 @@ public class Dominate extends TeamGame
|
||||
if (player.isOnline())
|
||||
AddGems(player, 10, "Participation", false);
|
||||
}
|
||||
|
||||
|
||||
//End
|
||||
SetState(GameState.End);
|
||||
}
|
||||
@ -284,7 +295,7 @@ public class Dominate extends TeamGame
|
||||
@Override
|
||||
public double GetKillsGems(Player killer, Player killed, boolean assist)
|
||||
{
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -292,7 +303,7 @@ public class Dominate extends TeamGame
|
||||
{
|
||||
// NOTHING
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void InventoryLock(InventoryClickEvent event)
|
||||
{
|
||||
@ -302,4 +313,10 @@ public class Dominate extends TeamGame
|
||||
event.getWhoClicked().closeInventory();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeathMessageType GetDeathMessageType()
|
||||
{
|
||||
return DeathMessageType.Detailed;
|
||||
}
|
||||
}
|
||||
|
@ -72,4 +72,10 @@ public class KitAssassin extends Kit
|
||||
ent.getEquipment().setLeggings(new ItemStack(Material.LEATHER_LEGGINGS));
|
||||
ent.getEquipment().setBoots(new ItemStack(Material.LEATHER_BOOTS));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void DisplayDesc(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -72,4 +72,10 @@ public class KitBrute extends Kit
|
||||
ent.getEquipment().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
|
||||
ent.getEquipment().setBoots(new ItemStack(Material.DIAMOND_BOOTS));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void DisplayDesc(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -72,4 +72,10 @@ public class KitKnight extends Kit
|
||||
ent.getEquipment().setLeggings(new ItemStack(Material.IRON_LEGGINGS));
|
||||
ent.getEquipment().setBoots(new ItemStack(Material.IRON_BOOTS));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void DisplayDesc(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -72,4 +72,10 @@ public class KitMage extends Kit
|
||||
ent.getEquipment().setLeggings(new ItemStack(Material.GOLD_LEGGINGS));
|
||||
ent.getEquipment().setBoots(new ItemStack(Material.GOLD_BOOTS));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void DisplayDesc(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -72,4 +72,10 @@ public class KitRanger extends Kit
|
||||
ent.getEquipment().setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS));
|
||||
ent.getEquipment().setBoots(new ItemStack(Material.CHAINMAIL_BOOTS));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void DisplayDesc(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,25 @@ public class CapturePoint
|
||||
floor.setType(Material.WOOL);
|
||||
_floor.add(floor);
|
||||
}
|
||||
else
|
||||
{
|
||||
Block block = loc.getBlock().getRelative(x, -1, z);
|
||||
block.setType(Material.BEACON);
|
||||
}
|
||||
}
|
||||
|
||||
//Glass
|
||||
if (Math.abs(x) <= 2 && Math.abs(z) <= 2)
|
||||
{
|
||||
Block block = loc.getBlock().getRelative(x, -1, z);
|
||||
block.setType(Material.GLASS);
|
||||
}
|
||||
|
||||
//Iron
|
||||
if (Math.abs(x) <= 1 && Math.abs(z) <= 1)
|
||||
{
|
||||
Block block = loc.getBlock().getRelative(x, -3, z);
|
||||
block.setType(Material.IRON_BLOCK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
@ -260,6 +261,9 @@ public class GamePlayerManager implements Listener
|
||||
@EventHandler
|
||||
public void KitDamage(CustomDamageEvent event)
|
||||
{
|
||||
if (event.GetCause() != DamageCause.ENTITY_ATTACK)
|
||||
return;
|
||||
|
||||
Player player = event.GetDamagerPlayer(false);
|
||||
if (player == null) return;
|
||||
|
||||
|
@ -7,10 +7,13 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.material.Wool;
|
||||
|
||||
@ -19,7 +22,7 @@ public class WorldParser
|
||||
public void Parse(Player caller, String[] args)
|
||||
{
|
||||
HashSet<Integer> dataId = new HashSet<Integer>();
|
||||
|
||||
|
||||
if (args != null)
|
||||
for (String arg : args)
|
||||
{
|
||||
@ -32,11 +35,11 @@ public class WorldParser
|
||||
caller.sendMessage("Invalid Data ID: " + arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HashMap<String, ArrayList<Location>> TeamLocs = new HashMap<String, ArrayList<Location>>();
|
||||
HashMap<String, ArrayList<Location>> DataLocs = new HashMap<String, ArrayList<Location>>();
|
||||
HashMap<String, ArrayList<Location>> CustomLocs = new HashMap<String, ArrayList<Location>>();
|
||||
|
||||
|
||||
Location cornerA = null;
|
||||
Location cornerB = null;
|
||||
|
||||
@ -57,15 +60,45 @@ public class WorldParser
|
||||
if (dataId.contains(block.getTypeId()))
|
||||
{
|
||||
String key = ""+block.getTypeId();
|
||||
|
||||
|
||||
if (!CustomLocs.containsKey(key))
|
||||
CustomLocs.put(key, new ArrayList<Location>());
|
||||
|
||||
|
||||
CustomLocs.get(key).add(block.getLocation());
|
||||
continue;
|
||||
}
|
||||
|
||||
//Sign Post > Spawns
|
||||
|
||||
//Signs
|
||||
if (block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN)
|
||||
{
|
||||
if (block.getRelative(BlockFace.DOWN).getType() == Material.SPONGE)
|
||||
{
|
||||
Sign s = (Sign) block.getState();
|
||||
|
||||
String name = "";
|
||||
|
||||
try
|
||||
{
|
||||
name = s.getLine(0);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
caller.sendMessage("Invalid Sign Data: " + UtilWorld.locToStr(block.getLocation()));
|
||||
}
|
||||
|
||||
//Add
|
||||
if (!CustomLocs.containsKey(name))
|
||||
CustomLocs.put(name, new ArrayList<Location>());
|
||||
|
||||
CustomLocs.get(name).add(block.getRelative(BlockFace.DOWN).getLocation());
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
block.getRelative(BlockFace.DOWN).setTypeId(0);
|
||||
}
|
||||
}
|
||||
|
||||
//Spawns
|
||||
if (block.getTypeId() == 147)
|
||||
{
|
||||
Block wool = block.getRelative(BlockFace.DOWN);
|
||||
@ -78,200 +111,200 @@ public class WorldParser
|
||||
{
|
||||
if (!TeamLocs.containsKey("Red"))
|
||||
TeamLocs.put("Red", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("Red").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 4) //RED > Spawn
|
||||
{
|
||||
if (!TeamLocs.containsKey("Yellow"))
|
||||
TeamLocs.put("Yellow", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("Yellow").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 13) //RED > Spawn
|
||||
{
|
||||
if (!TeamLocs.containsKey("Green"))
|
||||
TeamLocs.put("Green", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("Green").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 11) //RED > Spawn
|
||||
{
|
||||
if (!TeamLocs.containsKey("Blue"))
|
||||
TeamLocs.put("Blue", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("Blue").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 1)
|
||||
{
|
||||
if (!TeamLocs.containsKey("Orange"))
|
||||
TeamLocs.put("Orange", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("Orange").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 2)
|
||||
{
|
||||
if (!TeamLocs.containsKey("Magenta"))
|
||||
TeamLocs.put("Magenta", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("Magenta").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 3)
|
||||
{
|
||||
if (!TeamLocs.containsKey("Sky"))
|
||||
TeamLocs.put("Sky", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("Sky").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 5)
|
||||
{
|
||||
if (!TeamLocs.containsKey("Lime"))
|
||||
TeamLocs.put("Lime", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("Lime").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 6)
|
||||
{
|
||||
if (!TeamLocs.containsKey("Pink"))
|
||||
TeamLocs.put("Pink", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("Pink").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 7)
|
||||
{
|
||||
if (!TeamLocs.containsKey("Gray"))
|
||||
TeamLocs.put("Gray", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("Gray").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 8)
|
||||
{
|
||||
if (!TeamLocs.containsKey("LGray"))
|
||||
TeamLocs.put("LGray", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("LGray").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 9)
|
||||
{
|
||||
if (!TeamLocs.containsKey("Cyan"))
|
||||
TeamLocs.put("Cyan", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("Cyan").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 10)
|
||||
{
|
||||
if (!TeamLocs.containsKey("Purple"))
|
||||
TeamLocs.put("Purple", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("Purple").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 11)
|
||||
{
|
||||
if (!TeamLocs.containsKey("DBlue"))
|
||||
TeamLocs.put("DBlue", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("DBlue").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 12)
|
||||
{
|
||||
if (!TeamLocs.containsKey("Brown"))
|
||||
TeamLocs.put("Brown", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("Brown").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 15)
|
||||
{
|
||||
if (!TeamLocs.containsKey("Black"))
|
||||
TeamLocs.put("Black", new ArrayList<Location>());
|
||||
|
||||
|
||||
TeamLocs.get("Black").add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
}
|
||||
|
||||
|
||||
if (wool.getData() == 0) //WHITE > Corner
|
||||
{
|
||||
if (cornerA == null) cornerA = wool.getLocation();
|
||||
else if (cornerB == null) cornerB = wool.getLocation();
|
||||
else caller.sendMessage("More than 2 Corner Locations found!");
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
@ -288,16 +321,16 @@ public class WorldParser
|
||||
|
||||
if (wool.getType() != Material.WOOL)
|
||||
continue;
|
||||
|
||||
|
||||
Wool woolData = new Wool(wool.getType(), wool.getData());
|
||||
|
||||
|
||||
String dataType = woolData.getColor().name();
|
||||
|
||||
if (!DataLocs.containsKey(dataType))
|
||||
DataLocs.put(dataType, new ArrayList<Location>());
|
||||
|
||||
|
||||
DataLocs.get(dataType).add(wool.getLocation());
|
||||
|
||||
|
||||
//Remove Blocks
|
||||
block.setTypeId(0);
|
||||
wool.setTypeId(0);
|
||||
@ -341,7 +374,7 @@ public class WorldParser
|
||||
out.write("\n");
|
||||
out.write("MAX_Y:"+Math.max(cornerA.getBlockY(), cornerB.getBlockY()));
|
||||
}
|
||||
|
||||
|
||||
//Teams
|
||||
for (String team : TeamLocs.keySet())
|
||||
{
|
||||
@ -351,7 +384,7 @@ public class WorldParser
|
||||
out.write("\n");
|
||||
out.write("TEAM_SPAWNS:" + LocationsToString(TeamLocs.get(team)));
|
||||
}
|
||||
|
||||
|
||||
//Data
|
||||
for (String data : DataLocs.keySet())
|
||||
{
|
||||
@ -371,7 +404,7 @@ public class WorldParser
|
||||
out.write("\n");
|
||||
out.write("CUSTOM_LOCS:" + LocationsToString(CustomLocs.get(data)));
|
||||
}
|
||||
|
||||
|
||||
out.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -392,7 +425,7 @@ public class WorldParser
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
public String LocationSignsToString(HashMap<Location, String> locs)
|
||||
{
|
||||
String out = "";
|
||||
|
Loading…
Reference in New Issue
Block a user