fixed no damage on weapons

items not usable until game is live
fixed proxies not triggering
some skill balance/fixes
players with null kit are now given default knight
This commit is contained in:
Chiss 2014-04-21 10:48:04 +10:00
parent ddc8e435e8
commit 07098b0b82
26 changed files with 198 additions and 75 deletions

View File

@ -115,6 +115,7 @@ public class ShopItem implements IShopItem, Listener
return _deliveryName;
}
/*
@EventHandler
public void Damage(CustomDamageEvent event)
{
@ -127,6 +128,7 @@ public class ShopItem implements IShopItem, Listener
if (!_canDamage)
event.SetCancelled("Item Damage Cancel");
}
*/
@Override
public boolean IsFree()

View File

@ -46,7 +46,7 @@ public class Blink extends SkillActive
SetDesc(new String[]
{
"Instantly teleport forwards #5#3 Blocks.",
"Instantly teleport forwards #9#3 Blocks.",
"Cannot be used while Slowed.",
"",
"Using again within 5 seconds De-Blinks,",
@ -87,7 +87,7 @@ public class Blink extends SkillActive
//Smoke Trail
Block lastSmoke = player.getLocation().getBlock();
double maxRange = 5 + (level*3);
double maxRange = 9 + (level*3);
double curRange = 0;
while (curRange <= maxRange)
{

View File

@ -93,7 +93,7 @@ public class Recall extends Skill
while (UtilMath.offset(current, target) > 0.5)
{
UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, current, 0, 1f, 0, 0, 1);
UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, current, 0, 1f, 0, 0, 1);
current = current.add(UtilAlg.getTrajectory(current, target).multiply(0.1));
}
}

View File

@ -21,7 +21,7 @@ public class ShockingStrikes extends Skill
SetDesc(new String[]
{
"Your attacks shock targets for",
"#0#1 seconds, giving them Slow #0#1 and",
"#0#1 seconds, giving them Slow 1 and",
"Screen-Shake."
});
}
@ -49,7 +49,7 @@ public class ShockingStrikes extends Skill
//Confuse
Factory.Condition().Factory().Shock(GetName(), damagee, damager, level, false, false);
Factory.Condition().Factory().Slow(GetName(), damagee, damager, level, level-1, false, false, true, false);
Factory.Condition().Factory().Slow(GetName(), damagee, damager, level, 0, false, false, true, false);
//Damage
event.AddMod(damager.getName(), GetName(), 0, true);

View File

@ -14,7 +14,9 @@ import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilPlayer;
import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
import org.bukkit.Bukkit;
import org.bukkit.Effect;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
@ -60,6 +62,13 @@ public class SmokeBomb extends Skill
event.setCancelled(true);
//Check Allowed
SkillTriggerEvent trigger = new SkillTriggerEvent(player, GetName(), GetClassType());
Bukkit.getServer().getPluginManager().callEvent(trigger);
if (trigger.IsCancelled())
return;
if (!Recharge.Instance.use(player, GetName(), GetName(level), 90000 - (level * 15000), true, false))
return;

View File

@ -103,6 +103,9 @@ public class SeismicSlam extends SkillActive
if (!UtilTime.elapsed(_live.get(player), 1000))
continue;
if (!UtilTime.elapsed(_live.get(player), 4000) && !UtilEnt.isGrounded(player))
continue;
_live.remove(player);
//Action

View File

@ -1,5 +1,6 @@
package mineplex.minecraft.game.classcombat.item;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
@ -18,8 +19,10 @@ import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
import mineplex.minecraft.game.classcombat.item.Item;
import mineplex.minecraft.game.classcombat.item.ItemFactory;
import mineplex.minecraft.game.classcombat.item.event.ItemTriggerEvent;
public abstract class ItemUsable extends Item implements IThrown
{
@ -83,6 +86,13 @@ public abstract class ItemUsable extends Item implements IThrown
event.setCancelled(true);
//Check Allowed
ItemTriggerEvent trigger = new ItemTriggerEvent(player, this);
Bukkit.getServer().getPluginManager().callEvent(trigger);
if (trigger.IsCancelled())
return;
if (!EnergyRecharge(player, GetName(), _useEnergy, _useDelay))
return;
@ -123,6 +133,13 @@ public abstract class ItemUsable extends Item implements IThrown
event.setCancelled(true);
//Check Allowed
ItemTriggerEvent trigger = new ItemTriggerEvent(player, this);
Bukkit.getServer().getPluginManager().callEvent(trigger);
if (trigger.IsCancelled())
return;
if (!EnergyRecharge(player, GetName(), _throwEnergy, _throwDelay))
return;

View File

@ -25,8 +25,10 @@ import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.item.ItemFactory;
import mineplex.minecraft.game.classcombat.item.ItemUsable;
@ -87,9 +89,6 @@ public class ProximityExplosive extends ItemUsable
@EventHandler(priority = EventPriority.LOW)
public void Pickup(PlayerPickupItemEvent event)
{
if (event.isCancelled())
return;
if (((CraftPlayer)event.getPlayer()).getHandle().spectating)
return;
@ -135,7 +134,8 @@ public class ProximityExplosive extends ItemUsable
//Effect
ent.getWorld().playSound(ent.getLocation(), Sound.NOTE_PLING, 0.5f, 0.5f);
ent.getWorld().createExplosion(ent.getLocation(), 0f);
ent.getWorld().playSound(ent.getLocation(), Sound.EXPLODE, 4f, 0.8f);
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, ent.getLocation(), 0, 0.5f, 0, 0, 1);
}
@EventHandler
@ -148,7 +148,7 @@ public class ProximityExplosive extends ItemUsable
for (Entity ent : _armed.keySet())
{
if (ent.isDead() || !ent.isValid() || ent.getTicksLived() >= 6000)
if (ent.isDead() || !ent.isValid() || ent.getTicksLived() >= 3600)
expired.add(ent);
}

View File

@ -22,6 +22,8 @@ import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.minecraft.game.classcombat.item.ItemFactory;
@ -84,9 +86,6 @@ public class ProximityZapper extends ItemUsable
@EventHandler(priority = EventPriority.LOW)
public void Pickup(PlayerPickupItemEvent event)
{
if (event.isCancelled())
return;
if (((CraftPlayer)event.getPlayer()).getHandle().spectating)
return;
@ -129,7 +128,7 @@ public class ProximityZapper extends ItemUsable
//Effect
ent.getWorld().playSound(ent.getLocation(), Sound.NOTE_PLING, 0.5f, 0.5f);
ent.getWorld().createExplosion(ent.getLocation(), 0f);
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, ent.getLocation(), 0, 0.5f, 0, 0, 1);
}
@EventHandler
@ -142,7 +141,7 @@ public class ProximityZapper extends ItemUsable
for (Entity ent : _armed.keySet())
{
if (ent.isDead() || !ent.isValid() || ent.getTicksLived() >= 6000)
if (ent.isDead() || !ent.isValid() || ent.getTicksLived() >= 3600)
expired.add(ent);
}

View File

@ -0,0 +1,51 @@
package mineplex.minecraft.game.classcombat.item.event;
import mineplex.minecraft.game.classcombat.item.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class ItemTriggerEvent extends Event
{
private static final HandlerList handlers = new HandlerList();
private Player _player;
private Item _item;
private boolean _cancelled = false;
public ItemTriggerEvent(Player player, Item item)
{
_player = player;
_item = item;
}
public HandlerList getHandlers()
{
return handlers;
}
public static HandlerList getHandlerList()
{
return handlers;
}
public Player GetPlayer()
{
return _player;
}
public Item GetItemType()
{
return _item;
}
public boolean IsCancelled() {
return _cancelled;
}
public void SetCancelled(boolean cancelled)
{
this._cancelled = cancelled;
}
}

View File

@ -9,6 +9,6 @@ public class BoosterAxe extends Item
{
public BoosterAxe(ItemFactory factory, int gemCost, int tokenCost)
{
super(factory, "Booster Axe", new String [] { "Increases Axe Skill level by 1." }, Material.GOLD_AXE, 1, false, gemCost, tokenCost);
super(factory, "Booster Axe", new String [] { "Increases Axe Skill level by 1." }, Material.GOLD_AXE, 1, true, gemCost, tokenCost);
}
}

View File

@ -9,6 +9,6 @@ public class BoosterBow extends Item
{
public BoosterBow(ItemFactory factory, int gemCost, int tokenCost)
{
super(factory, "Booster Bow", new String [] { "Increases Bow Skill level by 1." }, Material.BOW, 1, false, gemCost, tokenCost);
super(factory, "Booster Bow", new String [] { "Increases Bow Skill level by 1." }, Material.BOW, 1, true, gemCost, tokenCost);
}
}

View File

@ -9,6 +9,6 @@ public class BoosterSword extends Item
{
public BoosterSword(ItemFactory factory, int gemCost, int tokenCost)
{
super(factory, "Booster Sword", new String[] { "Increases Sword Skill level by 1" }, Material.GOLD_SWORD, 1, false, gemCost, tokenCost);
super(factory, "Booster Sword", new String[] { "Increases Sword Skill level by 1" }, Material.GOLD_SWORD, 1, true, gemCost, tokenCost);
}
}

View File

@ -9,6 +9,6 @@ public class PowerAxe extends Item
{
public PowerAxe(ItemFactory factory, int gemCost, int tokenCost)
{
super(factory, "Power Axe", new String [] { "Increases Axe damage by 1." }, Material.DIAMOND_AXE, 1, false, gemCost, tokenCost);
super(factory, "Power Axe", new String [] { "Increases Axe damage by 1." }, Material.DIAMOND_AXE, 1, true, gemCost, tokenCost);
}
}

View File

@ -9,6 +9,6 @@ public class PowerBow extends Item
{
public PowerBow(ItemFactory factory, int gemCost, int tokenCost)
{
super(factory, "Power Bow", new String [] { "Increases Bow damage by 1." }, Material.BOW, 1, false, gemCost, tokenCost);
super(factory, "Power Bow", new String [] { "Increases Bow damage by 1." }, Material.BOW, 1, true, gemCost, tokenCost);
}
}

View File

@ -9,6 +9,6 @@ public class PowerSword extends Item
{
public PowerSword(ItemFactory factory, int gemCost, int tokenCost)
{
super(factory, "Power Sword", new String[] { "Increases sword damage by 1." }, Material.DIAMOND_SWORD, 1, false, gemCost, tokenCost);
super(factory, "Power Sword", new String[] { "Increases sword damage by 1." }, Material.DIAMOND_SWORD, 1, true, gemCost, tokenCost);
}
}

View File

@ -9,6 +9,6 @@ public class StandardAxe extends Item
{
public StandardAxe(ItemFactory factory, int gemCost, int tokenCost)
{
super(factory, "Standard Axe", new String[] { "Pretty standard." }, Material.IRON_AXE, 1, false, gemCost, tokenCost);
super(factory, "Standard Axe", new String[] { "Pretty standard." }, Material.IRON_AXE, 1, true, gemCost, tokenCost);
}
}

View File

@ -9,6 +9,6 @@ public class StandardBow extends Item
{
public StandardBow(ItemFactory factory, int gemCost, int tokenCost)
{
super(factory, "Standard Bow", new String[] { "Pretty standard." }, Material.BOW, 1, false, gemCost, tokenCost);
super(factory, "Standard Bow", new String[] { "Pretty standard." }, Material.BOW, 1, true, gemCost, tokenCost);
}
}

View File

@ -9,6 +9,6 @@ public class StandardSword extends Item
{
public StandardSword(ItemFactory factory, int gemCost, int tokenCost)
{
super(factory, "Standard Sword", new String[] { "Pretty standard." }, Material.IRON_SWORD, 1, false, gemCost, tokenCost);
super(factory, "Standard Sword", new String[] { "Pretty standard." }, Material.IRON_SWORD, 1, true, gemCost, tokenCost);
}
}

View File

@ -36,6 +36,7 @@ import mineplex.minecraft.game.classcombat.Condition.SkillConditionManager;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
import mineplex.minecraft.game.classcombat.item.ItemFactory;
import mineplex.minecraft.game.classcombat.item.event.ItemTriggerEvent;
import mineplex.minecraft.game.classcombat.shop.ClassCombatShop;
import mineplex.minecraft.game.classcombat.shop.ClassShopManager;
import mineplex.minecraft.game.core.IRelation;
@ -618,4 +619,13 @@ public class ArcadeManager extends MiniPlugin implements IRelation
event.SetCancelled(true);
}
}
@EventHandler
public void ItemTrigger(ItemTriggerEvent event)
{
if (_game == null || !_game.IsLive())
{
event.SetCancelled(true);
}
}
}

View File

@ -51,7 +51,12 @@ public class ChampionsDominate extends Domination
@Override
public void ValidateKit(Player player, GameTeam team)
{
// NOTHING
//Set to Default Knight
if (GetKit(player) == null)
{
SetKit(player, GetKits()[2], true);
player.closeInventory();
}
}
@Override

View File

@ -183,7 +183,12 @@ public class ChampionsTDM extends TeamGame
@Override
public void ValidateKit(Player player, GameTeam team)
{
// NOTHING
//Set to Default Knight
if (GetKit(player) == null)
{
SetKit(player, GetKits()[2], true);
player.closeInventory();
}
}
@Override

View File

@ -44,6 +44,13 @@ public class KitKnight extends Kit
@Override
public void Selected(Player player)
{
AddPlayer(player);
Manager.openClassShop(player);
}
public void AddPlayer(Player player)
{
_class.put(player, Manager.getClassManager().Get(player));
ClientClass clientClass = _class.get(player);
@ -56,8 +63,6 @@ public class KitKnight extends Kit
if (!Manager.GetGame().InProgress())
clientClass.SetActiveCustomBuild(pvpClass, pvpClass.getDefaultBuild());
Manager.openClassShop(player);
}
@Override

View File

@ -27,6 +27,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.events.PlayerGameRespawnEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.TeamGame;
@ -306,6 +307,13 @@ public class Domination extends TeamGame
return "Domination";
}
@EventHandler
public void RespawnRegen(PlayerGameRespawnEvent event)
{
Manager.GetCondition().Factory().Regen("Respawn", event.GetPlayer(), event.GetPlayer(), 8, 3, false, false, false);
Manager.GetCondition().Factory().Protection("Respawn", event.GetPlayer(), event.GetPlayer(), 8, 3, false, false, false);
}
public PlayerData GetStats(Player player)
{
if (!_stats.containsKey(player.getName()))

View File

@ -24,6 +24,7 @@ import nautilus.game.arcade.shop.KitPackage;
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityMetadata;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
@ -242,7 +243,7 @@ public class GamePlayerManager implements Listener
}
}
@EventHandler(priority = EventPriority.HIGH)
@EventHandler(priority = EventPriority.LOWEST)
public void KitInteract(PlayerInteractEntityEvent event)
{
if (event.getRightClicked() == null)
@ -250,12 +251,17 @@ public class GamePlayerManager implements Listener
Player player = event.getPlayer();
if (player.getGameMode() != GameMode.SURVIVAL)
return;
Kit kit = Manager.GetLobby().GetClickedKit(event.getRightClicked());
if (kit == null)
return;
KitClick(player, kit, event.getRightClicked());
event.setCancelled(true);
}
@EventHandler
@ -270,6 +276,9 @@ public class GamePlayerManager implements Listener
Player player = event.GetDamagerPlayer(false);
if (player == null) return;
if (player.getGameMode() != GameMode.SURVIVAL)
return;
LivingEntity target = event.GetDamageeEntity();
Kit kit = Manager.GetLobby().GetClickedKit(target);