Disable champions abilities in smash dom and disable supply chests, adjust peace announcement in Strike games, Absorbtion fix in OP MB, Countdown in CHanging Kits, more Arrows in OP MB, regen hunger in skysmash, scoped players drop helmets now, fix stuff with identifiers in GunModule

This commit is contained in:
xXVevzZXx 2016-07-07 15:08:57 +02:00
parent 36285ee101
commit 783b20a0dc
11 changed files with 120 additions and 18 deletions

View File

@ -71,10 +71,13 @@ public class SmashDom extends Domination
Manager.getCosmeticManager().setHideParticles(true); Manager.getCosmeticManager().setHideParticles(true);
Manager.getClassManager().GetItemFactory().getProximityManager().setProxyLimit(6); Manager.getClassManager().GetItemFactory().getProximityManager().setProxyLimit(6);
Manager.getClassManager().deregisterSelf();
this.StrictAntiHack = true; StrictAntiHack = true;
InventoryOpenChest = true; InventoryOpenChest = true;
EnableSupply = false;
} }
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.LOWEST)

View File

@ -48,6 +48,10 @@ import nautilus.game.arcade.kit.Kit;
public class Domination extends TeamGame public class Domination extends TeamGame
{ {
//Configuration
public boolean EnableEmerald = true;
public boolean EnableSupply = true;
//Map Data //Map Data
private ArrayList<CapturePoint> _points = new ArrayList<CapturePoint>(); private ArrayList<CapturePoint> _points = new ArrayList<CapturePoint>();
private ArrayList<Emerald> _emerald = new ArrayList<Emerald>(); private ArrayList<Emerald> _emerald = new ArrayList<Emerald>();
@ -179,10 +183,20 @@ public class Domination extends TeamGame
public void PowerupPickup(PlayerPickupItemEvent event) public void PowerupPickup(PlayerPickupItemEvent event)
{ {
for (Emerald cur : _emerald) for (Emerald cur : _emerald)
{
if (EnableEmerald)
cur.Pickup(event.getPlayer(), event.getItem()); cur.Pickup(event.getPlayer(), event.getItem());
else
return;
}
for (Resupply cur : _resupply) for (Resupply cur : _resupply)
{
if (EnableSupply)
cur.Pickup(event.getPlayer(), event.getItem()); cur.Pickup(event.getPlayer(), event.getItem());
else
return;
}
} }
@EventHandler @EventHandler

View File

@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.micro.modes;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType; import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.games.AbsorptionFix;
import nautilus.game.arcade.game.games.micro.Micro; import nautilus.game.arcade.game.games.micro.Micro;
import nautilus.game.arcade.game.games.micro.modes.kits.KitOverlord; import nautilus.game.arcade.game.games.micro.modes.kits.KitOverlord;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
@ -24,6 +25,8 @@ public class OverpoweredMicroBattles extends Micro
GameType.Brawl); GameType.Brawl);
TeamArmor = false; TeamArmor = false;
new AbsorptionFix(this);
} }
@Override @Override

View File

@ -19,7 +19,7 @@ public class KitOverlord extends ProgressingKit
}; };
private static final Perk[] PERKS = { private static final Perk[] PERKS = {
new PerkFletcher(20, 3, true) new PerkFletcher(4, 10, true)
}; };
private static final ItemStack IN_HAND = new ItemStack(Material.GOLDEN_APPLE); private static final ItemStack IN_HAND = new ItemStack(Material.GOLDEN_APPLE);

View File

@ -1173,6 +1173,9 @@ public class GunModule implements Listener
if (!_gunsEquipped.get(gun).equals(player)) if (!_gunsEquipped.get(gun).equals(player))
continue; continue;
if (player.getInventory().getItem(slot) == null)
continue;
if (gun.isStack(player.getInventory().getItem(slot))) if (gun.isStack(player.getInventory().getItem(slot)))
{ {
gun.drop(this, player, false, false); gun.drop(this, player, false, false);
@ -2025,4 +2028,9 @@ public class GunModule implements Listener
{ {
return _grenadesDropped; return _grenadesDropped;
} }
public HashMap<Player, ItemStack> getScoped()
{
return _scoped;
}
} }

View File

@ -207,6 +207,7 @@ public class ShopManager
if (hasItem(player, item)) if (hasItem(player, item))
return; return;
if (getMoney(player) < item.getCost()) if (getMoney(player) < item.getCost())
{ {
player.playSound(player.getLocation(), Sound.NOTE_BASS, 1f, 1f); player.playSound(player.getLocation(), Sound.NOTE_BASS, 1f, 1f);

View File

@ -1,6 +1,7 @@
package nautilus.game.arcade.game.games.minestrike.items; package nautilus.game.arcade.game.games.minestrike.items;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -17,6 +18,7 @@ import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.game.games.minestrike.GunModule; import nautilus.game.arcade.game.games.minestrike.GunModule;
@ -37,6 +39,8 @@ public abstract class StrikeItem
private ItemStack _stack = null; private ItemStack _stack = null;
private int _identifier;
public StrikeItem(StrikeItemType type, String name, String[] desc, int cost, int gemCost, Material skin) public StrikeItem(StrikeItemType type, String name, String[] desc, int cost, int gemCost, Material skin)
{ {
_type = type; _type = type;
@ -48,6 +52,11 @@ public abstract class StrikeItem
//Make Stack //Make Stack
_stack = new ItemStack(skin); _stack = new ItemStack(skin);
_identifier = UtilMath.r(9000) + 1000;
addID();
fixStackName(); fixStackName();
} }
@ -86,12 +95,20 @@ public abstract class StrikeItem
return _skinData; return _skinData;
} }
public void addID()
{
ItemMeta meta = _stack.getItemMeta();
meta.setLore(Arrays.asList(ChatColor.RED + "" + ChatColor.BOLD + "Identifier: " + _identifier));
_stack.setItemMeta(meta);
}
public void setSkin(Material skinMaterial, byte skinData) public void setSkin(Material skinMaterial, byte skinData)
{ {
_skinMaterial = skinMaterial; _skinMaterial = skinMaterial;
_skinData = skinData; _skinData = skinData;
_stack = new ItemStack(skinMaterial, 1, (short) 0, skinData); _stack = new ItemStack(skinMaterial, 1, (short) 0, skinData);
addID();
} }
public String getOwnerName() public String getOwnerName()
@ -170,6 +187,8 @@ public abstract class StrikeItem
{ {
if (UtilGear.isMat(stack, _skinMaterial)) if (UtilGear.isMat(stack, _skinMaterial))
return stack.getItemMeta().getLore().get(0).equalsIgnoreCase(getStack().getItemMeta().getLore().get(0)); return stack.getItemMeta().getLore().get(0).equalsIgnoreCase(getStack().getItemMeta().getLore().get(0));
else
return false;
} }
} }
} }

View File

@ -82,10 +82,6 @@ public class Gun extends StrikeItem
_loadedAmmo = gunStats.getClipSize(); _loadedAmmo = gunStats.getClipSize();
_reserveAmmo = gunStats.getClipReserve() * gunStats.getClipSize(); _reserveAmmo = gunStats.getClipReserve() * gunStats.getClipSize();
ItemMeta meta = getStack().getItemMeta();
meta.setLore(Arrays.asList(ChatColor.RED + "" + ChatColor.BOLD + "Identifier: " + UtilMath.r(1000) + 1));
getStack().setItemMeta(meta);
updateWeaponName(null, null); updateWeaponName(null, null);
} }

View File

@ -1,9 +1,12 @@
package nautilus.game.arcade.game.games.skywars.modes; package nautilus.game.arcade.game.games.skywars.modes;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.recharge.Recharge;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType; import nautilus.game.arcade.GameType;
@ -87,6 +90,29 @@ public class SkySmash extends SoloSkywars
event.AddKnockback("Smash Knockback", 1 + 0.1 * (20 - event.GetDamageePlayer().getHealth())); event.AddKnockback("Smash Knockback", 1 + 0.1 * (20 - event.GetDamageePlayer().getHealth()));
} }
@EventHandler(priority = EventPriority.MONITOR)
public void hungerOnHit(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
Player damager = event.GetDamagerPlayer(true);
if (damager == null)
return;
if (damager.equals(event.GetDamageeEntity()))
return;
if (!(event.GetDamageeEntity() instanceof Player))
return;
if (!Recharge.Instance.use(damager, "Hunger Restore", 250, false, false))
return;
int amount = Math.max(1, (int)(event.GetDamage()/2));
UtilPlayer.hunger(damager, amount);
}
@Override @Override
public String GetMode() public String GetMode()
{ {

View File

@ -1,5 +1,6 @@
package nautilus.game.arcade.game.games.survivalgames.modes; package nautilus.game.arcade.game.games.survivalgames.modes;
import org.bukkit.Sound;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
@ -8,6 +9,7 @@ import org.bukkit.event.entity.EntityDeathEvent;
import mineplex.core.common.util.UtilItem; import mineplex.core.common.util.UtilItem;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextBottom;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
@ -40,6 +42,7 @@ public class ChangingKits extends SoloSurvivalGames
private Kit[] _kits; private Kit[] _kits;
private long _lastChanged; private long _lastChanged;
private int _changeInterval;
public ChangingKits(ArcadeManager manager) public ChangingKits(ArcadeManager manager)
{ {
@ -72,6 +75,36 @@ public class ChangingKits extends SoloSurvivalGames
}; };
_lastChanged = 0; _lastChanged = 0;
_changeInterval = 60;
}
@EventHandler
public void countdown(UpdateEvent event)
{
if (!IsLive())
return;
if (event.getType() == UpdateType.SEC)
{
if (System.currentTimeMillis() > _lastChanged + 25000)
{
for (Player player : UtilServer.getPlayers())
{
player.playSound(player.getLocation(), Sound.NOTE_PLING, 2F, 2F);
}
}
}
if (event.getType() != UpdateType.TICK)
return;
double percentage = (double) (System.currentTimeMillis() - _lastChanged) / (_changeInterval*1000);
for (Player player : UtilServer.getPlayers())
{
UtilTextBottom.displayProgress("New Kit", percentage,
UtilTime.MakeStr(Math.max(0, (_changeInterval*1000) - (System.currentTimeMillis() - _lastChanged))), player);
}
} }
@EventHandler @EventHandler
@ -119,7 +152,7 @@ public class ChangingKits extends SoloSurvivalGames
if (!IsLive()) if (!IsLive())
return; return;
if (!UtilTime.elapsed(_lastChanged, 60000)) if (!UtilTime.elapsed(_lastChanged, _changeInterval*1000))
return; return;
_lastChanged = System.currentTimeMillis(); _lastChanged = System.currentTimeMillis();

View File

@ -129,6 +129,10 @@ public class StrikeGames extends SoloSurvivalGames
itemIterator.remove(); itemIterator.remove();
} }
} }
if (_gunModule.getScoped().containsKey(event.getEntity()))
{
event.getDrops().add(_gunModule.getScoped().get(event.getEntity()));
}
} }
@EventHandler @EventHandler
@ -402,14 +406,9 @@ public class StrikeGames extends SoloSurvivalGames
if (stat.getSkin() == stack.getType()) if (stat.getSkin() == stack.getType())
{ {
Gun gun = new Gun(stat, _gunModule); Gun gun = new Gun(stat, _gunModule);
ItemMeta meta = stack.getItemMeta();
if (gun.getStack().hasItemMeta() && gun.getStack().getItemMeta().hasLore())
meta.setLore(gun.getStack().getItemMeta().getLore());
stack.setItemMeta(meta);
gun.setStack(stack); gun.setStack(stack);
gun.updateWeaponName(player, null, false); gun.updateWeaponName(player, null, false);
gun.addID();
_gunModule.registerGun(gun, player); _gunModule.registerGun(gun, player);
return; return;
} }