Fixed dupe glitch (all games)

Some champions skill fixes
created GameSpectatorManager to handle spec stuffz
This commit is contained in:
Chiss 2014-11-18 16:43:39 +11:00
parent 2384b91b06
commit f5022ecf16
16 changed files with 144 additions and 20 deletions

View File

@ -53,7 +53,7 @@ public class CripplingBlow extends Skill
if (level == 0) return;
//Stun
Factory.Condition().Factory().Slow(GetName(), damagee, damager, 0.5 + 0.5 * 1, 1, false, true, false, true);
Factory.Condition().Factory().Slow(GetName(), damagee, damager, 0.5 + 0.5 * 1, 0, false, true, false, true);
//Damage
event.AddMod(damager.getName(), GetName(), 0, true);

View File

@ -9,6 +9,8 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
@ -71,13 +73,19 @@ public class Deflection extends Skill
if (!Recharge.Instance.use(cur, GetName(), 5000 - (1000 * level), false, false))
continue;
int max = 2 + (1 * level);
int charge = 1;
if (_charges.containsKey(cur))
charge += _charges.get(cur);
charge = Math.min(2 + (1 * level), charge);
if (charge <= max)
{
_charges.put(cur, charge);
_charges.put(cur, charge);
//Inform
UtilPlayer.message(cur, F.main(GetClassType().name(), "Deflection Charges: " + F.elem(charge+"")));
}
}
}

View File

@ -9,7 +9,9 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
@ -77,13 +79,19 @@ public class Swordsmanship extends Skill
if (!Recharge.Instance.use(cur, GetName(), 5000 - (1000 * level), false, false))
continue;
int max = level;
int charge = 1;
if (_charges.containsKey(cur))
charge += _charges.get(cur);
charge = Math.min(level, charge);
if (charge <= max)
{
_charges.put(cur, charge);
_charges.put(cur, charge);
//Inform
UtilPlayer.message(cur, F.main(GetClassType().name(), "Swordsmanship Charges: " + F.elem(charge+"")));
}
}
}

View File

@ -44,7 +44,7 @@ public class ArcticArmor extends Skill
"",
"Create a freezing area around you",
"in a #3#1 Block radius. Allies inside",
"this area receive Protection 1.",
"this area receive Protection 2.",
"",
"You are permanently immune to the",
"Slowing effect of snow."

View File

@ -68,7 +68,7 @@ public class Rupture extends SkillActiveCharge
"",
"Release Block to release the rupture,",
"causing earth and players to fly upward,",
"dealing up to #3#1 inital damage."
"dealing up to #4#1 inital damage."
});
}

View File

@ -33,7 +33,7 @@ public class Void extends Skill
"Drop Axe/Sword to Toggle.",
"",
"While in void form, you receive",
"Slow 3, take no knockback and",
"Slow 2, take no knockback and",
"use no energy to swing weapons.",
"",
"Reduces incoming damage by #1#1 , but",

View File

@ -46,7 +46,7 @@ public class PinDown extends SkillActive
SetDesc(new String[]
{
"Instantly fire an arrow, giving",
"target Slow 3 for #3#1 seconds."
"target Slow 4 for #3#1 seconds."
});
}

View File

@ -78,7 +78,7 @@ public class WolfsFury extends SkillActive
_active.put(player, System.currentTimeMillis() + 8000);
//Condition
Factory.Condition().Factory().Strength(GetName(), player, player, 2 + 2*level, level-1, false, true, true);
Factory.Condition().Factory().Strength(GetName(), player, player, 2 + 2*level, 2, false, true, true);
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));
@ -134,6 +134,9 @@ public class WolfsFury extends SkillActive
int level = getLevel(damager);
if (level == 0) return;
if (!_active.containsKey(damager))
return;
//Remove Swing
_swing.remove(damager);

View File

@ -1,8 +1,11 @@
package mineplex.minecraft.game.classcombat.shop;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
import mineplex.core.achievement.Achievement;
import mineplex.core.achievement.AchievementManager;
import mineplex.minecraft.game.classcombat.Class.ClassManager;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.item.ItemFactory;
@ -12,6 +15,7 @@ public class ClassShopManager extends MiniPlugin
private ClassManager _classManager;
private SkillFactory _skillFactory;
private ItemFactory _itemFactory;
private AchievementManager _achievementManager;
public ClassShopManager(JavaPlugin plugin, ClassManager classManager, SkillFactory skillFactory, ItemFactory itemFactory)
{
@ -20,6 +24,7 @@ public class ClassShopManager extends MiniPlugin
_classManager = classManager;
_skillFactory = skillFactory;
_itemFactory = itemFactory;
//_achievementManager = achievementManager;
}
public ClassManager GetClassManager()
@ -36,4 +41,18 @@ public class ClassShopManager extends MiniPlugin
{
return _itemFactory;
}
public boolean hasAchievements(Player player)
{
return _achievementManager.hasCategory(player, new Achievement[]
{
Achievement.CHAMPIONS_ACE,
Achievement.CHAMPIONS_ASSASSINATION,
Achievement.CHAMPIONS_EARTHQUAKE,
Achievement.CHAMPIONS_FLAWLESS_VICTORY,
Achievement.CHAMPIONS_MASS_ELECTROCUTION,
Achievement.CHAMPIONS_THE_LONGEST_SHOT,
Achievement.CHAMPIONS_WINS,
});
}
}

View File

@ -104,6 +104,7 @@ import nautilus.game.arcade.managers.GameLobbyManager;
import nautilus.game.arcade.managers.GameLootManager;
import nautilus.game.arcade.managers.GameManager;
import nautilus.game.arcade.managers.GamePlayerManager;
import nautilus.game.arcade.managers.GameSpectatorManager;
import nautilus.game.arcade.managers.GameStatManager;
import nautilus.game.arcade.managers.GameTournamentManager;
import nautilus.game.arcade.managers.GameWorldManager;
@ -263,6 +264,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
_gameTournamentManager = new GameTournamentManager(this);
new GameStatManager(this);
new GameLootManager(this, petManager);
new GameSpectatorManager(this);
_gameWorldManager = new GameWorldManager(this);
new MiscManager(this);
_idleManager = new IdleManager(this);

View File

@ -11,18 +11,27 @@ import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Hanging;
import org.bukkit.entity.Minecart;
import org.bukkit.entity.Player;
import org.bukkit.entity.minecart.CommandMinecart;
import org.bukkit.entity.minecart.ExplosiveMinecart;
import org.bukkit.entity.minecart.HopperMinecart;
import org.bukkit.entity.minecart.PoweredMinecart;
import org.bukkit.entity.minecart.StorageMinecart;
import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.hanging.HangingBreakEvent;
import org.bukkit.event.hanging.HangingPlaceEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.scoreboard.Objective;
import org.bukkit.util.Vector;
@ -31,11 +40,14 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTabTitle;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.classcombat.event.ClassCombatCreatureAllowSpawnEvent;
@ -1274,4 +1286,8 @@ public abstract class Game implements Listener
loc.getY() >= WorldData.MaxY ||
loc.getY() <= WorldData.MinY);
}
}

View File

@ -1597,7 +1597,7 @@ public class Bridge extends TeamGame implements OreObsfucation
// }
@EventHandler
public void boatDeny(PlayerInteractEvent event)
public void vehicleDeny(PlayerInteractEvent event)
{
if (!UtilEvent.isAction(event, ActionType.R))
return;

View File

@ -562,7 +562,7 @@ public class DragonEscape extends SoloGame
if (!UtilTime.elapsed(GetStateTime(), 10000))
{
UtilPlayer.message(player, F.main("Game", "You cannot dig for " + F.elem(UtilTime.MakeStr(6000 - (System.currentTimeMillis() - GetStateTime())) + ".")));
UtilPlayer.message(player, F.main("Game", "You cannot dig for " + F.elem(UtilTime.MakeStr(10000 - (System.currentTimeMillis() - GetStateTime())) + ".")));
return;
}

View File

@ -0,0 +1,72 @@
package nautilus.game.arcade.managers;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.Game.GameState;
import org.bukkit.Material;
import org.bukkit.entity.Minecart;
import org.bukkit.entity.Player;
import org.bukkit.entity.minecart.CommandMinecart;
import org.bukkit.entity.minecart.ExplosiveMinecart;
import org.bukkit.entity.minecart.HopperMinecart;
import org.bukkit.entity.minecart.PoweredMinecart;
import org.bukkit.entity.minecart.StorageMinecart;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.vehicle.VehicleDamageEvent;
public class GameSpectatorManager implements Listener
{
ArcadeManager Manager;
public GameSpectatorManager(ArcadeManager manager)
{
Manager = manager;
Manager.GetPluginManager().registerEvents(this, Manager.GetPlugin());
}
@EventHandler(priority = EventPriority.LOW)
public void interactCancel(PlayerInteractEvent event)
{
if (Manager.GetGame() == null)
return;
Player player = event.getPlayer();
if (!Manager.GetGame().IsAlive(player))
event.setCancelled(true);
}
@EventHandler(priority = EventPriority.LOW)
public void interactEntityCancel(PlayerInteractEntityEvent event)
{
if (Manager.GetGame() == null)
return;
Player player = event.getPlayer();
if (!Manager.GetGame().IsAlive(player))
event.setCancelled(true);
}
@EventHandler(priority = EventPriority.LOW)
public void vehicleDamage(VehicleDamageEvent event)
{
if (Manager.GetGame() == null)
return;
if (!(event.getAttacker() instanceof Player))
return;
Player player = (Player)event.getAttacker();
if (!Manager.GetGame().IsAlive(player))
event.setCancelled(true);
}
}

View File

@ -52,12 +52,8 @@ public class MiscManager implements Listener
Player player = event.getPlayer();
if (!Manager.GetGame().IsAlive(player))
{
event.setCancelled(true);
}
//BoneMeal
else if (event.getPlayer().getItemInHand().getType() == Material.INK_SACK && event.getPlayer().getItemInHand().getData().getData() == (byte)15)
if (event.getPlayer().getItemInHand().getType() == Material.INK_SACK && event.getPlayer().getItemInHand().getData().getData() == (byte)15)
{
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && Manager.GetGame().GetType() != GameType.UHC)
event.setCancelled(true);