arcade map directory up up right left down up right update!

some paintball fixes
H&S start
This commit is contained in:
Chiss 2013-11-04 08:59:29 +11:00
parent 1545873f62
commit e14bc76639
14 changed files with 713 additions and 10 deletions

View File

@ -483,7 +483,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
public ArrayList<String> LoadFiles(String gameName)
{
File folder = new File("maps" + File.separatorChar + gameName);
File folder = new File("../../update/maps" + File.separatorChar + gameName);
if (!folder.exists()) folder.mkdirs();
ArrayList<String> maps = new ArrayList<String>();

View File

@ -16,6 +16,7 @@ import nautilus.game.arcade.game.games.dragonriders.DragonRiders;
import nautilus.game.arcade.game.games.dragons.Dragons;
import nautilus.game.arcade.game.games.evolution.Evolution;
import nautilus.game.arcade.game.games.halloween.Halloween;
import nautilus.game.arcade.game.games.hideseek.HideSeek;
import nautilus.game.arcade.game.games.hungergames.HungerGames;
import nautilus.game.arcade.game.games.milkcow.MilkCow;
import nautilus.game.arcade.game.games.mineware.MineWare;
@ -54,6 +55,7 @@ public class GameFactory
else if (gameType == GameType.DragonRiders) return new DragonRiders(_manager);
else if (gameType == GameType.Evolution) return new Evolution(_manager);
else if (gameType == GameType.Halloween) return new Halloween(_manager);
else if (gameType == GameType.HideSeek) return new HideSeek(_manager);
else if (gameType == GameType.HungerGames) return new HungerGames(_manager);
else if (gameType == GameType.MineWare) return new MineWare(_manager);
else if (gameType == GameType.MilkCow) return new MilkCow(_manager);

View File

@ -14,6 +14,7 @@ public enum GameType
Dragons("Dragons"),
Evolution("Evolution"),
Halloween("Halloween Horror"),
HideSeek("Hide and Seek"),
Horse("Horseback"),
HungerGames("Hunger Games"),
MineWare("MineWare"),

View File

@ -0,0 +1,192 @@
package nautilus.game.arcade.game.games.hideseek;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.hideseek.kits.*;
import nautilus.game.arcade.kit.Kit;
public class HideSeek extends TeamGame
{
private GameTeam _hiders;
private GameTeam _seekers;
private long _gameTime = 300000;
public HideSeek(ArcadeManager manager)
{
super(manager, GameType.HideSeek,
new Kit[]
{
new KitHiderAcrobat(manager),
new KitHiderSwapper(manager),
new KitHiderShocker(manager),
new KitSeekerRadar(manager),
},
new String[]
{
"Shoot enemies to paint them",
"Revive/heal with Water Bombs",
"Last team alive wins!"
});
this.DeathOut = false;
}
@EventHandler
public void CustomTeamGeneration(GameStateChangeEvent event)
{
if (event.GetState() != GameState.Recruit)
return;
_hiders = GetTeamList().get(0);
_hiders.SetColor(ChatColor.AQUA);
_hiders.SetName("Hiders");
_seekers = GetTeamList().get(1);
_seekers.SetColor(ChatColor.RED);
_seekers.SetName("Seekers");
}
/*
@Override
public GameTeam ChooseTeam(Player player)
{
return _hiders;
}
*/
@EventHandler
public void UpdateSeekers(UpdateEvent event)
{
if (!IsLive())
return;
if (event.getType() != UpdateType.FAST)
return;
int req = 1;
while (_seekers.GetPlayers(true).size() < req && _hiders.GetPlayers(true).size() > 0)
{
Player player = _hiders.GetPlayers(true).get(UtilMath.r(_hiders.GetPlayers(true).size()));
SetSeeker(player, true);
}
}
@EventHandler
public void PlayerDeath(PlayerDeathEvent event)
{
if (_hiders.HasPlayer(event.getEntity()))
SetSeeker(event.getEntity(), false);
}
public void SetSeeker(Player player, boolean forced)
{
SetPlayerTeam(player, _seekers);
//Kit
Kit newKit = GetKits()[5]; //Normal
if (forced) newKit = GetKits()[4]; //Alpha
SetKit(player, newKit, false);
newKit.ApplyKit(player);
//Refresh
for (Player other : UtilServer.getPlayers())
{
other.hidePlayer(player);
other.showPlayer(player);
}
if (forced)
{
AddGems(player, 10, "Forced Seeker", false);
Announce(F.main("Game", F.elem(_hiders.GetColor() + player.getName()) + " was moved to " +
F.elem(C.cRed + C.Bold + "Seekers") + "."));
player.getWorld().strikeLightningEffect(player.getLocation());
player.damage(1000);
}
UtilPlayer.message(player, C.cRed + C.Bold + "You are now a Seeker!");
}
@Override
public void EndCheck()
{
if (!IsLive())
return;
if (GetPlayers(true).isEmpty())
{
SetState(GameState.End);
return;
}
if (_hiders.GetPlayers(true).isEmpty())
{
SetState(GameState.End);
AnnounceEnd(_seekers);
for (Player player : GetPlayers(false))
if (player.isOnline())
AddGems(player, 10, "Participation", false);
}
}
@EventHandler
public void Timer(UpdateEvent event)
{
if (GetState() != GameState.Live)
return;
if (event.getType() != UpdateType.TICK)
return;
long timeLeft = _gameTime - (System.currentTimeMillis() - GetStateTime());
if (timeLeft > 0)
{
GetObjectiveSide().setDisplayName(
ChatColor.WHITE + "§lTime: " + C.cGreen + "§l"
+ UtilTime.MakeStr(timeLeft));
}
else
{
GetObjectiveSide().setDisplayName(
ChatColor.WHITE + "§lTime: " + C.cGreen + "§l"
+ UtilTime.MakeStr(0));
//XXX End
SetState(GameState.End);
AnnounceEnd(_hiders);
for (Player player : _hiders.GetPlayers(true))
AddGems(player, 10, "Winning Team", false);
for (Player player : GetPlayers(false))
if (player.isOnline())
AddGems(player, 10, "Participation", false);
}
}
}

View File

@ -0,0 +1,85 @@
package nautilus.game.arcade.game.games.hideseek.kits;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Slime;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.UtilServer;
import mineplex.core.disguise.disguises.DisguiseBlock;
import mineplex.core.disguise.disguises.DisguiseSlime;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.*;
public class KitHiderAcrobat extends Kit
{
public KitHiderAcrobat(ArcadeManager manager)
{
super(manager, "Acrobatic Hider", KitAvailability.Free,
new String[]
{
"Able to get to hard-to-reach places!"
},
new Perk[]
{
new PerkDoubleJump("Double Jump", 0.8, 0.8, false)
},
EntityType.SLIME,
new ItemStack(Material.IRON_BOOTS));
}
@Override
public void GiveItems(Player player)
{
}
@Override
public void SpawnCustom(LivingEntity ent)
{
((Slime)ent).setSize(2);
DisguiseSlime slime = new DisguiseSlime(ent);
slime.SetSize(2);
slime.SetName(GetAvailability().GetColor() + GetName() + " Kit" + (GetAvailability() == KitAvailability.Blue ? ChatColor.GRAY + " (" + ChatColor.WHITE + "Ultra" + ChatColor.GRAY + ")" : ""));
slime.SetCustomNameVisible(true);
DisguiseBlock block = new DisguiseBlock(ent, 20, 0);
ToBlock(block, slime);
}
public void ToBlock(final DisguiseBlock block, final DisguiseSlime slime)
{
Manager.GetDisguise().disguise(block);
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable()
{
public void run()
{
ToSlime(block, slime);
}
}, 60);
}
public void ToSlime(final DisguiseBlock block, final DisguiseSlime slime)
{
Manager.GetDisguise().disguise(slime);
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable()
{
public void run()
{
ToBlock(block, slime);
}
}, 60);
}
}

View File

@ -0,0 +1,84 @@
package nautilus.game.arcade.game.games.hideseek.kits;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Slime;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.UtilServer;
import mineplex.core.disguise.disguises.DisguiseBlock;
import mineplex.core.disguise.disguises.DisguiseSlime;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.*;
public class KitHiderShocker extends Kit
{
public KitHiderShocker(ArcadeManager manager)
{
super(manager, "Shocking Hider", KitAvailability.Free,
new String[]
{
"Shock and stun seekers!"
},
new Perk[]
{
},
EntityType.SLIME,
new ItemStack(Material.REDSTONE_LAMP_OFF));
}
@Override
public void GiveItems(Player player)
{
}
@Override
public void SpawnCustom(LivingEntity ent)
{
((Slime)ent).setSize(2);
DisguiseSlime slime = new DisguiseSlime(ent);
slime.SetSize(2);
slime.SetName(GetAvailability().GetColor() + GetName() + " Kit" + (GetAvailability() == KitAvailability.Blue ? ChatColor.GRAY + " (" + ChatColor.WHITE + "Ultra" + ChatColor.GRAY + ")" : ""));
slime.SetCustomNameVisible(true);
DisguiseBlock block = new DisguiseBlock(ent, 124, 0);
ToBlock(block, slime);
}
public void ToBlock(final DisguiseBlock block, final DisguiseSlime slime)
{
Manager.GetDisguise().disguise(block);
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable()
{
public void run()
{
ToSlime(block, slime);
}
}, 60);
}
public void ToSlime(final DisguiseBlock block, final DisguiseSlime slime)
{
Manager.GetDisguise().disguise(slime);
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable()
{
public void run()
{
ToBlock(block, slime);
}
}, 60);
}
}

View File

@ -0,0 +1,88 @@
package nautilus.game.arcade.game.games.hideseek.kits;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Slime;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.UtilServer;
import mineplex.core.disguise.disguises.DisguiseBlock;
import mineplex.core.disguise.disguises.DisguiseSlime;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.*;
public class KitHiderSwapper extends Kit
{
public KitHiderSwapper(ArcadeManager manager)
{
super(manager, "Swapper Hider", KitAvailability.Free,
new String[]
{
"Can transform between different blocks!"
},
new Perk[]
{
},
EntityType.SLIME,
new ItemStack(Material.BEACON));
}
@Override
public void GiveItems(Player player)
{
}
@Override
public void SpawnCustom(LivingEntity ent)
{
((Slime)ent).setSize(2);
DisguiseSlime slime = new DisguiseSlime(ent);
slime.SetSize(2);
slime.SetName(GetAvailability().GetColor() + GetName() + " Kit" + (GetAvailability() == KitAvailability.Blue ? ChatColor.GRAY + " (" + ChatColor.WHITE + "Ultra" + ChatColor.GRAY + ")" : ""));
slime.SetCustomNameVisible(true);
ToBlock(ent, slime);
}
public void ToBlock(final LivingEntity ent, final DisguiseSlime slime)
{
double r = Math.random();
if (r > 0.75) Manager.GetDisguise().disguise(new DisguiseBlock(ent, 54, 0));
else if (r > 0.5) Manager.GetDisguise().disguise(new DisguiseBlock(ent, 145, 0));
else if (r > 0.25) Manager.GetDisguise().disguise(new DisguiseBlock(ent, 140, 11));
else Manager.GetDisguise().disguise(new DisguiseBlock(ent, 47, 0));
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable()
{
public void run()
{
ToSlime(ent, slime);
}
}, 60);
}
public void ToSlime(final LivingEntity ent, final DisguiseSlime slime)
{
Manager.GetDisguise().disguise(slime);
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable()
{
public void run()
{
ToBlock(ent, slime);
}
}, 60);
}
}

View File

@ -0,0 +1,81 @@
package nautilus.game.arcade.game.games.hideseek.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkBarrage;
import nautilus.game.arcade.kit.perks.PerkFletcher;
public class KitSeekerArcher extends Kit
{
public KitSeekerArcher(ArcadeManager manager)
{
super(manager, "Castle Marksman", KitAvailability.Green,
new String[]
{
"Skilled human marksman, can fletch arrows."
},
new Perk[]
{
new PerkBarrage(5, 250, true, false),
new PerkFletcher(2, 4, false),
},
EntityType.ZOMBIE,
new ItemStack(Material.BOW));
}
@EventHandler
public void FireItemResist(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
if (Manager.GetGame() == null)
return;
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (!HasKit(player))
continue;
Manager.GetCondition().Factory().FireItemImmunity(GetName(), player, player, 1.9, false);
}
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.STONE_SWORD));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.ARROW, 32));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE));
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS));
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS));
}
@Override
public void SpawnCustom(LivingEntity ent)
{
ent.getEquipment().setHelmet(new ItemStack(Material.CHAINMAIL_HELMET));
ent.getEquipment().setChestplate(new ItemStack(Material.CHAINMAIL_CHESTPLATE));
ent.getEquipment().setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS));
ent.getEquipment().setBoots(new ItemStack(Material.CHAINMAIL_BOOTS));
}
}

View File

@ -0,0 +1,47 @@
package nautilus.game.arcade.game.games.hideseek.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.*;
public class KitSeekerRadar extends Kit
{
public KitSeekerRadar(ArcadeManager manager)
{
super(manager, "Radar Seeker", KitAvailability.Free,
new String[]
{
"Tick......tick...tick.tick.",
},
new Perk[]
{
new PerkRadar()
},
EntityType.ZOMBIE,
new ItemStack(Material.COMPASS));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.COMPASS, (byte)0, 1, "Radar Scanner"));
player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_HELMET));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_CHESTPLATE));
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_LEGGINGS));
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BOOTS));
}
}

View File

@ -0,0 +1,44 @@
package nautilus.game.arcade.game.games.hideseek.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.*;
public class KitSeekerTNT extends Kit
{
public KitSeekerTNT(ArcadeManager manager)
{
super(manager, "Bomber Seeker", KitAvailability.Free,
new String[]
{
"Throw TNT to flush out the Hiders!"
},
new Perk[]
{
new PerkBomber(10, 4, -1)
},
EntityType.ZOMBIE,
new ItemStack(Material.TNT));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD));
player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.GOLD_HELMET));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.GOLD_CHESTPLATE));
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.GOLD_LEGGINGS));
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.GOLD_BOOTS));
}
}

View File

@ -25,12 +25,10 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityRegainHealthEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.event.player.PlayerToggleSneakEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.util.Vector;
@ -223,21 +221,20 @@ public class Paintball extends TeamGame
//Out
if (Color(damagee, count))
{
PlayerOut(damagee);
for (Player player : UtilServer.getPlayers())
UtilPlayer.message(player, damageeTeam.GetColor() + damagee.getName() + ChatColor.RESET + " was painted by " +
damagerTeam.GetColor() + damager.getName() + ChatColor.RESET + "!");
AddGems(damager, 2, "Kill", true);
PlayerOut(damagee);
AddGems(damager, 2, "Kills", true);
}
//Hit Sound
Player player = event.GetDamagerPlayer(true);
if (player != null)
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 1f, 3f);
}
}
public boolean Color(Player player, int amount)
{
@ -296,6 +293,9 @@ public class Paintball extends TeamGame
@EventHandler
public void CleanThrow(PlayerInteractEvent event)
{
if (!IsLive())
return;
Player player = event.getPlayer();
if (!UtilGear.isMat(player.getItemInHand(), Material.POTION))

View File

@ -2,8 +2,10 @@ package nautilus.game.arcade.game.games.paintball;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.disguise.disguises.DisguisePlayer;
import org.bukkit.ChatColor;
import org.bukkit.EntityEffect;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Skeleton;
@ -34,7 +36,7 @@ public class PlayerCopy
_ent.setCustomNameVisible(true);
//Disguise
//DisguisePlayer disguise = new DisguisePlayer(_ent, owner.getName());
////DisguisePlayer disguise = new DisguisePlayer(_ent, owner.getName());
//Host.Manager.GetDisguise().disguise(disguise);
}

View File

@ -0,0 +1,77 @@
package nautilus.game.arcade.kit.perks;
import java.util.HashMap;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.kit.Perk;
public class PerkRadar extends Perk
{
private HashMap<Player, Long> _lastTick = new HashMap<Player, Long>();
public PerkRadar()
{
super("Radar Scanner", new String[]
{
C.cYellow + "Hold Compass" + C.cGray + " to use " + C.cGreen + "Radar Scanner",
"Ticks get faster when you are near a Hider!"
});
}
@EventHandler
public void Update(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : UtilServer.getPlayers())
{
if (!UtilGear.isMat(player.getItemInHand(), Material.COMPASS))
continue;
if (!Kit.HasKit(player) || !Manager.IsAlive(player))
continue;
double closest = 999;
for (Player other : UtilServer.getPlayers())
{
if (other.equals(player))
continue;
if (!Manager.IsAlive(other))
continue;
if (Manager.GetColor(other) != ChatColor.AQUA)
continue;
double dist = UtilMath.offset(other, player);
if (dist < closest)
closest = dist;
}
double scale = Math.max(0, Math.min(1, (closest - 2) / 8d));
//Bi-Directional Cooldown
if (_lastTick.containsKey(player) && !UtilTime.elapsed(_lastTick.get(player), (long)(2000 * scale)) && !Recharge.Instance.usable(player, "Radar"))
return;
_lastTick.put(player, System.currentTimeMillis());
Recharge.Instance.useForce(player, "Radar", (long)(2000 * scale));
player.getWorld().playSound(player.getLocation(), Sound.NOTE_STICKS, 1f, (float)(2 - 1*scale));
}
}
}

View File

@ -124,7 +124,7 @@ public class WorldData
new File(folder).mkdir();
new File(folder + java.io.File.separator + "region").mkdir();
new File(folder + java.io.File.separator + "data").mkdir();
ZipUtil.UnzipToDirectory("maps/" + Host.GetName() + "/" + GetFile() + ".zip", folder);
ZipUtil.UnzipToDirectory("../../update/maps/" + Host.GetName() + "/" + GetFile() + ".zip", folder);
}
public void LoadWorldConfig()