Merge remote-tracking branch 'refs/remotes/origin/develop' into update/uhc-moppletop
This commit is contained in:
commit
07cd716cf7
@ -1,8 +1,5 @@
|
||||
package mineplex.core.common.util;
|
||||
|
||||
import org.apache.commons.lang.WordUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
@ -11,6 +8,9 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.commons.lang.WordUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
|
||||
public class UtilText
|
||||
{
|
||||
private static HashMap<Character, Integer> _characters = new HashMap<>();
|
||||
|
@ -176,8 +176,12 @@ public enum AchievementCategory
|
||||
Material.EXPLOSIVE_MINECART, 0, GameCategory.CLASSICS, "Sky Warrior Kit", false, GameDisplay.QuiverPayload.getGameId()),
|
||||
|
||||
SKYFALL("Skyfall", null,
|
||||
new StatDisplay[] {StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.GEMS_EARNED, null, new StatDisplay("Booster Rings", "Rings")},
|
||||
Material.BOW, 0, GameCategory.SURVIVAL, null, false, GameDisplay.Skyfall.getGameId());
|
||||
new StatDisplay[] {StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED, null, new StatDisplay("Booster Rings", "Rings"),
|
||||
null, null, new StatDisplay(C.Bold + "Team Stats", true), null,
|
||||
StatDisplay.fromGame("Wins", GameDisplay.SkyfallTeams, "Wins"), StatDisplay.fromGame("Games Played", GameDisplay.SkyfallTeams, "Wins", "Losses"),
|
||||
StatDisplay.fromGame("Kills", GameDisplay.SkyfallTeams, "Kills"), StatDisplay.fromGame("Deaths", GameDisplay.SkyfallTeams, "Deaths"),
|
||||
StatDisplay.fromGame("Gems Earned", GameDisplay.SkyfallTeams, "GemsEarned"), null, StatDisplay.fromGame("Booster Rings", GameDisplay.SkyfallTeams, "Rings")},
|
||||
Material.BOW, 0, GameCategory.SURVIVAL, null, false, GameDisplay.Skyfall.getGameId(), GameDisplay.SkyfallTeams.getGameId());
|
||||
|
||||
private String _name;
|
||||
private String[] _statsToPull;
|
||||
|
@ -85,6 +85,7 @@ public enum GameDisplay
|
||||
Valentines("Valentines Vendetta", Material.LEATHER, (byte)0, GameCategory.EXTRA, 61),
|
||||
|
||||
Skyfall("Skyfall", Material.DIAMOND_BOOTS, (byte)0, GameCategory.SURVIVAL, 62),
|
||||
SkyfallTeams("Skyfall Teams", Material.DIAMOND_BOOTS, (byte)0, GameCategory.SURVIVAL, 65),
|
||||
|
||||
Basketball("Hoops", Material.SLIME_BALL, (byte)0, GameCategory.EXTRA, 63),
|
||||
|
||||
|
@ -252,16 +252,16 @@ public class RewardManager
|
||||
|
||||
|
||||
//Music Discs
|
||||
addMusicReward(Type.NORMAL, "Blocks Disk", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Cat Disk", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Chirp Disk", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Far Disk", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Mall Disk", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Mellohi Disk", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Stal Disk", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Strad Disk", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Wait Disk", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Ward Disk", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Blocks Disc", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Cat Disc", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Chirp Disc", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Far Disc", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Mall Disc", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Mellohi Disc", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Stal Disc", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Strad Disc", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Wait Disc", rarity, 25);
|
||||
addMusicReward(Type.NORMAL, "Ward Disc", rarity, 25);
|
||||
|
||||
|
||||
// VALENTINES Gadgets
|
||||
@ -275,17 +275,20 @@ public class RewardManager
|
||||
addHat(Type.WINTER_HOLIDAY, HatType.SNOWMAN, rarity, 5);
|
||||
|
||||
// Omega items
|
||||
addMusicReward(Type.OMEGA, "Block Disk", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Cat Disk", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Chirp Disk", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Far Disk", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Mall Disk", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Mellohi Disk", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Stal Disk", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Stard Disk", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Wait Disk", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Ward Disk", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Blocks Disc", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Cat Disc", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Chirp Disc", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Far Disc", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Mall Disc", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Mellohi Disc", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Stal Disc", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Strad Disc", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Wait Disc", rarity, 25);
|
||||
addMusicReward(Type.OMEGA, "Ward Disc", rarity, 25);
|
||||
|
||||
addGadget(Type.OMEGA, getGadget(ArrowTrailHalloween.class), rarity, 50);
|
||||
|
||||
addHat(Type.OMEGA, HatType.PUMPKIN, rarity, 75);
|
||||
addHat(Type.OMEGA, HatType.PRESENT, rarity, 5);
|
||||
addHat(Type.OMEGA, HatType.SNOWMAN, rarity, 5);
|
||||
|
||||
@ -393,6 +396,7 @@ public class RewardManager
|
||||
addGadget(Type.OMEGA, getGadget(DoubleJumpShadow.class), rarity, 15);
|
||||
addGadget(Type.OMEGA, getGadget(DoubleJumpStorm.class), rarity, 30);
|
||||
addGadget(Type.OMEGA, getGadget(DoubleJumpCandyCane.class), rarity, 20);
|
||||
addGadget(Type.OMEGA, getGadget(DoubleJumpHalloween.class), rarity, 50);
|
||||
|
||||
addGadget(Type.OMEGA, getGadget(DeathFreedom.class), rarity, 15);
|
||||
addGadget(Type.OMEGA, getGadget(DeathStorm.class), rarity, 30);
|
||||
@ -514,9 +518,7 @@ public class RewardManager
|
||||
addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.FAMAS_Pulse, rarity, 33);
|
||||
addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.SG553_Pulse, rarity, 33);
|
||||
addMineStrikeSkin(Type.NORMAL, MineStrikeSkin.AK_47_Vulcan, rarity, 5);
|
||||
|
||||
|
||||
|
||||
|
||||
//WINTER
|
||||
|
||||
//Arrow Trails
|
||||
@ -527,10 +529,7 @@ public class RewardManager
|
||||
addHat(Type.WINTER_HOLIDAY, HatType.GRINCH, rarity, 5);
|
||||
addGadget(Type.WINTER_HOLIDAY, getGadget(MorphSnowman.class), rarity, 5);
|
||||
addMount(Type.WINTER_HOLIDAY, getMount(MountBabyReindeer.class), rarity, 5);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//VALENTINES
|
||||
|
||||
//Cupid Set
|
||||
@ -539,16 +538,17 @@ public class RewardManager
|
||||
addGadget(Type.VALENTINES_GIFT, getGadget(DoubleJumpCupidsWings.class), rarity, 100);
|
||||
addGadget(Type.VALENTINES_GIFT, getGadget(ParticleHeart.class), rarity, 100, 0);
|
||||
|
||||
|
||||
// FREEDOM
|
||||
addMount(Type.FREEDOM, getMount(MountFreedomHorse.class), rarity, 1);
|
||||
addGadget(Type.FREEDOM, getGadget(MorphUncleSam.class), rarity, 5);
|
||||
addGadget(Type.FREEDOM, getGadget(ParticleFreedom.class), rarity, 50);
|
||||
|
||||
// Omega items
|
||||
// OMEGA
|
||||
addPetReward(Type.OMEGA, EntityType.VILLAGER, rarity, 1);
|
||||
addPetReward(Type.OMEGA, EntityType.ZOMBIE, rarity, 10);
|
||||
addPetReward(Type.OMEGA, EntityType.PIG_ZOMBIE, rarity, 1);
|
||||
addPetReward(Type.OMEGA, EntityType.RABBIT, rarity, 10);
|
||||
addPetReward(Type.OMEGA, EntityType.BLAZE, rarity, 2);
|
||||
|
||||
addGadget(Type.OMEGA, getGadget(MorphBunny.class), rarity, 1);
|
||||
addGadget(Type.OMEGA, getGadget(MorphUncleSam.class), rarity, 5);
|
||||
@ -557,6 +557,7 @@ public class RewardManager
|
||||
addGadget(Type.OMEGA, getGadget(MorphSlime.class), rarity, 10);
|
||||
addGadget(Type.OMEGA, getGadget(MorphBlock.class), rarity, 20);
|
||||
addGadget(Type.OMEGA, getGadget(MorphSnowman.class), rarity, 10);
|
||||
addGadget(Type.OMEGA, getGadget(MorphGrimReaper.class), rarity, 25);
|
||||
|
||||
addGadget(Type.OMEGA, getGadget(ParticleFreedom.class), rarity, 15);
|
||||
addGadget(Type.OMEGA, getGadget(ParticleWingsAngel.class), rarity, 15);
|
||||
@ -583,12 +584,14 @@ public class RewardManager
|
||||
addMount(Type.OMEGA, getMount(MountUndead.class), rarity, 1);
|
||||
addMount(Type.OMEGA, getMount(MountValentinesSheep.class), rarity, 33);
|
||||
addMount(Type.OMEGA, getMount(MountBabyReindeer.class), rarity, 1);
|
||||
addMount(Type.OMEGA, getMount(MountNightmareSteed.class), rarity, 10);
|
||||
|
||||
addGadget(Type.OMEGA, getGadget(WinEffectBabyChicken.class), rarity, 10);
|
||||
addGadget(Type.OMEGA, getGadget(WinEffectLavaTrap.class), rarity, 20);
|
||||
addGadget(Type.OMEGA, getGadget(WinEffectRiseOfTheElderGuardian.class), rarity, 4);
|
||||
addGadget(Type.OMEGA, getGadget(WinEffectLightningStrike.class), rarity, 20);
|
||||
addGadget(Type.OMEGA, getGadget(WinEffectMrPunchMan.class), rarity, 33);
|
||||
addGadget(Type.OMEGA, getGadget(WinEffectHalloween.class), rarity, 75);
|
||||
|
||||
addGadget(Type.OMEGA, getGadget(DeathEnchant.class), rarity, 10);
|
||||
addGadget(Type.OMEGA, getGadget(DeathCupidsBrokenHeart.class), rarity, 25);
|
||||
@ -614,7 +617,7 @@ public class RewardManager
|
||||
addReward(Type.TRICK_OR_TREAT, new ChestReward(_inventoryManager, TreasureType.MYTHICAL, 1, 3, rarity, 50, 0));
|
||||
addReward(Type.TRICK_OR_TREAT, new ChestReward(_inventoryManager, TreasureType.ILLUMINATED, 1, 1, rarity, 30, 0));
|
||||
addMount(Type.TRICK_OR_TREAT, getMount(MountZombie.class), rarity, 25);
|
||||
addPetReward(Type.HAUNTED, EntityType.ZOMBIE, rarity, 10);
|
||||
addPetReward(Type.TRICK_OR_TREAT, EntityType.ZOMBIE, rarity, 10);
|
||||
addGadget(Type.TRICK_OR_TREAT, getGadget(MorphPumpkinKing.class), rarity, 5);
|
||||
}
|
||||
|
||||
@ -640,7 +643,7 @@ public class RewardManager
|
||||
{
|
||||
for(Gadget gadget : _gadgetManager.getGadgets(GadgetType.MUSIC_DISC))
|
||||
{
|
||||
if(gadget.getName().equals(musicDisk) || gadget.getName().equals(musicDisk + " Disk"))
|
||||
if(gadget.getName().equals(musicDisk) || gadget.getName().equals(musicDisk + " Disc"))
|
||||
{
|
||||
return addGadget(type, gadget, rarity, weight, shards);
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ public enum RewardType
|
||||
ILLUMINATED_CHEST( 0, 2, 16, 72),
|
||||
FREEDOM_CHEST( 0, 5, 18, 0),
|
||||
HAUNTED_CHEST( 0, 5, 18, 0),
|
||||
OMEGA_CHEST( 0, 2, 16, 32),
|
||||
OMEGA_CHEST( 0, 32, 16, 2),
|
||||
TRICK_OR_TREAT_CHEST(0.1, 2, 16, 0),
|
||||
VALENTINES_GIFT( 0, 7, 20, 20),
|
||||
|
||||
|
@ -57,7 +57,7 @@ public class BuyChestButton implements IButton
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (_chestType == TreasureType.FREEDOM)
|
||||
if (_chestType == TreasureType.FREEDOM || _chestType == TreasureType.HAUNTED)
|
||||
{
|
||||
if (!_page.getPlugin().hasItemsToGivePlayer(_chestType.getRewardPool(), player))
|
||||
{
|
||||
|
@ -204,15 +204,13 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
||||
hauntedLore.add(C.cGray + "during the month of October when the");
|
||||
hauntedLore.add(C.cGray + "veil between this world and the shadow is thin...");
|
||||
hauntedLore.add(" ");
|
||||
if (hauntedCount > 0)
|
||||
if (hauntedCount > 0 && !hasAllHauntedItems(getPlayer()))
|
||||
{
|
||||
hauntedLore.add(ChatColor.RESET + C.cGreen + "Click to Open!");
|
||||
}
|
||||
else
|
||||
{
|
||||
hauntedLore.add(ChatColor.RESET + "Click to craft for " + C.cAqua + "35000 Treasure Shards");
|
||||
hauntedLore.add(" ");
|
||||
hauntedLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop");
|
||||
hauntedLore.add(C.cRed + "This item is no longer available!");
|
||||
}
|
||||
|
||||
List<String> trickLore = Lists.newArrayList();
|
||||
@ -278,6 +276,16 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
||||
return !getPlugin().hasItemsToGivePlayer(TreasureType.FREEDOM.getRewardPool(), player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the player has all the items for the halloween chest
|
||||
* @param player
|
||||
* @return
|
||||
*/
|
||||
public boolean hasAllHauntedItems(Player player)
|
||||
{
|
||||
return !getPlugin().hasItemsToGivePlayer(TreasureType.HAUNTED.getRewardPool(), player);
|
||||
}
|
||||
|
||||
public int getFreedomUnlockedAmount(Player player)
|
||||
{
|
||||
if (hasAllFreedomItems(player))
|
||||
|
@ -1,4 +1,46 @@
|
||||
package mineplex.hub;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
import net.md_5.bungee.api.chat.HoverEvent;
|
||||
import net.md_5.bungee.api.chat.HoverEvent.Action;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.minecraft.server.v1_8_R3.EntityInsentient;
|
||||
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
||||
import org.bukkit.entity.Egg;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerLoginEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.event.player.PlayerVelocityEvent;
|
||||
import org.bukkit.event.server.ServerListPingEvent;
|
||||
import org.bukkit.event.world.ChunkLoadEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import mineplex.core.Managers;
|
||||
import mineplex.core.MiniClientPlugin;
|
||||
import mineplex.core.TimingsFix;
|
||||
@ -16,7 +58,13 @@ import mineplex.core.chat.ChatFormat;
|
||||
import mineplex.core.chat.IChatMessageFormatter;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.currency.GlobalCurrency;
|
||||
import mineplex.core.common.util.*;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
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.cosmetic.CosmeticManager;
|
||||
import mineplex.core.customdata.CustomDataManager;
|
||||
import mineplex.core.disguise.DisguiseManager;
|
||||
@ -36,12 +84,7 @@ import mineplex.core.locations.LocationConstants;
|
||||
import mineplex.core.menu.MenuManager;
|
||||
import mineplex.core.message.PrivateMessageEvent;
|
||||
import mineplex.core.mount.MountManager;
|
||||
import mineplex.core.noteblock.INoteVerifier;
|
||||
import mineplex.core.noteblock.MusicManager;
|
||||
import mineplex.core.noteblock.NBSReader;
|
||||
import mineplex.core.noteblock.NotePlayer;
|
||||
import mineplex.core.noteblock.NoteSong;
|
||||
import mineplex.core.noteblock.event.SongFinishEvent;
|
||||
import mineplex.core.notifier.NotificationManager;
|
||||
import mineplex.core.npc.NpcManager;
|
||||
import mineplex.core.packethandler.PacketHandler;
|
||||
@ -72,7 +115,16 @@ import mineplex.hub.commands.ForcefieldRadius;
|
||||
import mineplex.hub.commands.GadgetToggle;
|
||||
import mineplex.hub.commands.GameModeCommand;
|
||||
import mineplex.hub.commands.NewsCommand;
|
||||
import mineplex.hub.modules.*;
|
||||
import mineplex.hub.modules.ForcefieldManager;
|
||||
import mineplex.hub.modules.HubVisibilityManager;
|
||||
import mineplex.hub.modules.JumpManager;
|
||||
import mineplex.hub.modules.KothManager;
|
||||
import mineplex.hub.modules.MavericksManager;
|
||||
import mineplex.hub.modules.NewsManager;
|
||||
import mineplex.hub.modules.ParkourManager;
|
||||
import mineplex.hub.modules.SoccerManager;
|
||||
import mineplex.hub.modules.ValentinesManager;
|
||||
import mineplex.hub.modules.WorldManager;
|
||||
import mineplex.hub.modules.nonpremium.NonPremiumManager;
|
||||
import mineplex.hub.profile.gui.GUIProfile;
|
||||
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
|
||||
@ -80,41 +132,11 @@ import mineplex.minecraft.game.classcombat.item.event.ItemTriggerEvent;
|
||||
import mineplex.minecraft.game.core.combat.DeathMessageType;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import mineplex.minecraft.game.core.condition.ConditionManager;
|
||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
import net.md_5.bungee.api.chat.HoverEvent;
|
||||
import net.md_5.bungee.api.chat.HoverEvent.Action;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.minecraft.server.v1_8_R3.EntityInsentient;
|
||||
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
||||
import org.bukkit.entity.Egg;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.player.*;
|
||||
import org.bukkit.event.server.ServerListPingEvent;
|
||||
import org.bukkit.event.world.ChunkLoadEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.*;
|
||||
|
||||
public class HubManager extends MiniClientPlugin<HubClient> implements IChatMessageFormatter
|
||||
{
|
||||
// ☃❅ Snowman!
|
||||
public HubType Type = HubType.Halloween;
|
||||
public HubType Type = HubType.Normal;
|
||||
|
||||
private BlockRestore _blockRestore;
|
||||
private CoreClientManager _clientManager;
|
||||
|
@ -263,9 +263,9 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable
|
||||
{
|
||||
if (transaction.Coins == 0 && transaction.Gems == 0)
|
||||
{
|
||||
if (transaction.SalesPackageName.split(" ").length == 3)
|
||||
trickOrTreatChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[2]);
|
||||
else if (transaction.SalesPackageName.split(" ").length == 2)
|
||||
if (transaction.SalesPackageName.split(" ").length == 5)
|
||||
trickOrTreatChestsReceived += Integer.parseInt(transaction.SalesPackageName.split(" ")[4]);
|
||||
else if (transaction.SalesPackageName.split(" ").length == 4)
|
||||
trickOrTreatChestsReceived += 1;
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,6 @@ import nautilus.game.arcade.managers.GameStatManager;
|
||||
import nautilus.game.arcade.managers.GameTestingManager;
|
||||
import nautilus.game.arcade.managers.GameTournamentManager;
|
||||
import nautilus.game.arcade.managers.GameWorldManager;
|
||||
import nautilus.game.arcade.managers.HolidayManager;
|
||||
import nautilus.game.arcade.managers.IdleManager;
|
||||
import nautilus.game.arcade.managers.MiscManager;
|
||||
import nautilus.game.arcade.managers.NextBestGameManager;
|
||||
@ -345,8 +344,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
_idleManager = new IdleManager(this);
|
||||
TitanGiveawayManager titanGiveaway = new TitanGiveawayManager(getPlugin(), clientManager, serverStatusManager);
|
||||
|
||||
new HolidayManager(this, titanGiveaway);
|
||||
IsHolidayEnabled = true;
|
||||
//new HolidayManager(this, titanGiveaway);
|
||||
IsHolidayEnabled = false;
|
||||
|
||||
new ValentinesGiftManager(plugin, clientManager, _bonusManager.getRewardManager(), inventoryManager, _cosmeticManager.getGadgetManager(), statsManager);
|
||||
new GameTestingManager(this);
|
||||
|
@ -14,9 +14,12 @@ import nautilus.game.arcade.game.games.basketball.Basketball;
|
||||
import nautilus.game.arcade.game.games.bossbattles.BossBattles;
|
||||
import nautilus.game.arcade.game.games.bouncyballs.BouncyBalls;
|
||||
import nautilus.game.arcade.game.games.bridge.Bridge;
|
||||
import nautilus.game.arcade.game.games.bridge.modes.AppleAttack;
|
||||
import nautilus.game.arcade.game.games.bridge.modes.InsaneBridges;
|
||||
import nautilus.game.arcade.game.games.bridge.modes.LuckyBridges;
|
||||
import nautilus.game.arcade.game.games.bridge.modes.OverpoweredBridge;
|
||||
import nautilus.game.arcade.game.games.bridge.modes.SpeedBridges;
|
||||
import nautilus.game.arcade.game.games.bridge.modes.UHCBridges;
|
||||
import nautilus.game.arcade.game.games.build.Build;
|
||||
import nautilus.game.arcade.game.games.build.modes.DukesOfDecoration;
|
||||
import nautilus.game.arcade.game.games.build.modes.TeamBuild;
|
||||
@ -57,6 +60,7 @@ import nautilus.game.arcade.game.games.micro.modes.TinyWinners;
|
||||
import nautilus.game.arcade.game.games.milkcow.MilkCow;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague;
|
||||
import nautilus.game.arcade.game.games.minestrike.Minestrike;
|
||||
import nautilus.game.arcade.game.games.minestrike.modes.SuperPaintstrike;
|
||||
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
|
||||
import nautilus.game.arcade.game.games.monsterleague.MonsterLeague;
|
||||
import nautilus.game.arcade.game.games.monstermaze.MonsterMaze;
|
||||
@ -66,6 +70,7 @@ import nautilus.game.arcade.game.games.quiver.Quiver;
|
||||
import nautilus.game.arcade.game.games.quiver.QuiverTeamBase;
|
||||
import nautilus.game.arcade.game.games.quiver.QuiverTeams;
|
||||
import nautilus.game.arcade.game.games.quiver.modes.BunnyHop;
|
||||
import nautilus.game.arcade.game.games.quiver.modes.UltimateOITQ;
|
||||
import nautilus.game.arcade.game.games.rings.ElytraRings;
|
||||
import nautilus.game.arcade.game.games.runner.Runner;
|
||||
import nautilus.game.arcade.game.games.runner.modes.FasterThanLight;
|
||||
@ -73,10 +78,13 @@ import nautilus.game.arcade.game.games.searchanddestroy.SearchAndDestroy;
|
||||
import nautilus.game.arcade.game.games.sheep.SheepGame;
|
||||
import nautilus.game.arcade.game.games.sheep.modes.EweHeroes;
|
||||
import nautilus.game.arcade.game.games.sheep.modes.OverpoweredSheepQuest;
|
||||
import nautilus.game.arcade.game.games.sheep.modes.SheepMania;
|
||||
import nautilus.game.arcade.game.games.sheep.modes.SmashSheep;
|
||||
import nautilus.game.arcade.game.games.skyfall.Skyfall;
|
||||
import nautilus.game.arcade.game.games.skyfall.SoloSkyfall;
|
||||
import nautilus.game.arcade.game.games.skyfall.TeamSkyfall;
|
||||
import nautilus.game.arcade.game.games.skywars.SoloSkywars;
|
||||
import nautilus.game.arcade.game.games.skywars.TeamSkywars;
|
||||
import nautilus.game.arcade.game.games.skywars.modes.Elementalist;
|
||||
import nautilus.game.arcade.game.games.skywars.modes.OverpoweredSkywars;
|
||||
import nautilus.game.arcade.game.games.skywars.modes.SkySmash;
|
||||
import nautilus.game.arcade.game.games.skywars.modes.UHCSkywars;
|
||||
@ -200,7 +208,8 @@ public enum GameType
|
||||
MonsterMaze(MonsterMaze.class, GameDisplay.MonsterMaze),
|
||||
MonsterLeague(MonsterLeague.class, GameDisplay.MonsterLeague),
|
||||
Gladiators(Gladiators.class, GameDisplay.Gladiators),
|
||||
Skyfall(Skyfall.class, GameDisplay.Skyfall),
|
||||
Skyfall(SoloSkyfall.class, GameDisplay.Skyfall),
|
||||
SkyfallTeams(TeamSkyfall.class, GameDisplay.SkyfallTeams, new GameType[]{GameType.Skyfall}, false),
|
||||
|
||||
BouncyBalls(BouncyBalls.class, GameDisplay.BouncyBalls),
|
||||
|
||||
@ -221,13 +230,17 @@ public enum GameType
|
||||
Brawl(null, new GameMode[]{
|
||||
new GameMode(OverpoweredBridge.class, GameType.Bridge, "OP Bridges"),
|
||||
new GameMode(SpeedBridges.class, GameType.Bridge, "Speed Bridges"),
|
||||
new GameMode(LuckyBridges.class, GameType.Bridge, "Lucky Bridges"),
|
||||
new GameMode(LuckyBridges.class, GameType.Bridge, "Lucky Bridges"),
|
||||
new GameMode(AppleAttack.class, GameType.Bridge, "Apple Attack"),
|
||||
new GameMode(UHCBridges.class, GameType.Bridge, "UHC Bridges"),
|
||||
new GameMode(InsaneBridges.class, GameType.Bridge, "Insane Bridges"),
|
||||
new GameMode(OverpoweredGladiators.class, GameType.Gladiators, "OP Gladiators"),
|
||||
new GameMode(ChampionsGladiators.class, GameType.Gladiators, "Champions Gladiators"),
|
||||
new GameMode(SmashGladiators.class, GameType.Gladiators, "Smash Gladiators"),
|
||||
new GameMode(OverpoweredSkywars.class, GameType.Skywars, "OP Skywars"),
|
||||
new GameMode(UHCSkywars.class, GameType.Skywars, "UHC Skywars"),
|
||||
new GameMode(SkySmash.class, GameType.Skywars, "Sky Smash"),
|
||||
new GameMode(Elementalist.class, GameType.Skywars, "Elementalist"),
|
||||
new GameMode(TeamBuild.class, GameType.Build, "Team Master Builders"),
|
||||
new GameMode(DukesOfDecoration.class, GameType.Build, "Dukes Of Decoration"),
|
||||
new GameMode(GodBattles.class, GameType.UHC, "God Battles"),
|
||||
@ -248,12 +261,19 @@ public enum GameType
|
||||
new GameMode(UltraSpleef.class, GameType.Spleef, "Ultra Spleef"),
|
||||
new GameMode(RandomKitSSM.class, GameType.Smash, "Random Kit SSM"),
|
||||
new GameMode(EweHeroes.class, GameType.Sheep, "Heroes Of The Ewe"),
|
||||
new GameMode(SheepMania.class, GameType.Sheep, "Sheep Mania"),
|
||||
new GameMode(SmashSheep.class, GameType.Sheep, "Smash Sheep"),
|
||||
new GameMode(OverpoweredSheepQuest.class, GameType.Sheep, "OP Sheep Quest"),
|
||||
new GameMode(FasterThanLight.class, GameType.Runner, "Faster Than Light"),
|
||||
new GameMode(BunnyHop.class, GameType.Quiver, "Bunny Hop"),
|
||||
new GameMode(BunnyHop.class, GameType.Quiver, "Bunny Hop"),
|
||||
new GameMode(UltimateOITQ.class, GameType.Quiver, "Ultimate OITQ"),
|
||||
new GameMode(Countdown.class, GameType.HideSeek, "Countdown"),
|
||||
new GameMode(SmashDom.class, GameType.ChampionsDominate, "Smash Dominate"),
|
||||
new GameMode(SmashDom.class, GameType.ChampionsDominate, "Smash Dominate"),
|
||||
new GameMode(SuperPaintstrike.class, GameType.MineStrike, "Super Paintstrike", new Pair[]
|
||||
{
|
||||
Pair.create(MinecraftVersion.Version1_8, "http://file.mineplex.com/ResMinestrike.zip"),
|
||||
Pair.create(MinecraftVersion.Version1_9, "http://file.mineplex.com/ResMinestrike19.zip")
|
||||
}, true),
|
||||
}, GameDisplay.Brawl, null, false, null, false, true);
|
||||
|
||||
GameDisplay _display;
|
||||
|
@ -884,11 +884,43 @@ public abstract class Game implements Listener
|
||||
|
||||
HandlerList.unregisterAll(kit);
|
||||
|
||||
for (Perk perk : kit.GetPerks())
|
||||
if (kit instanceof ProgressingKit)
|
||||
{
|
||||
HandlerList.unregisterAll(perk);
|
||||
perk.unregisteredEvents();
|
||||
if (((ProgressingKit) kit).hasUpgrades())
|
||||
{
|
||||
ProgressingKit pKit = (ProgressingKit) kit;
|
||||
for (Perk[] perks : pKit.getPerks())
|
||||
{
|
||||
for (Perk perk : perks)
|
||||
{
|
||||
if (perk == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
HandlerList.unregisterAll(perk);
|
||||
perk.unregisteredEvents();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Perk perk : kit.GetPerks())
|
||||
{
|
||||
HandlerList.unregisterAll(perk);
|
||||
perk.unregisteredEvents();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Perk perk : kit.GetPerks())
|
||||
{
|
||||
HandlerList.unregisterAll(perk);
|
||||
perk.unregisteredEvents();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,19 +130,22 @@ public class Bridge extends TeamGame implements OreObsfucation
|
||||
|
||||
public Bridge(ArcadeManager manager, GameType type)
|
||||
{
|
||||
super(manager, type,
|
||||
|
||||
new Kit[]
|
||||
{
|
||||
new KitApple(manager),
|
||||
new KitBerserker(manager),
|
||||
new KitBrawler(manager),
|
||||
new KitMammoth(manager),
|
||||
new KitArcher(manager),
|
||||
new KitMiner(manager),
|
||||
new KitBomber(manager),
|
||||
new KitDestructor(manager),
|
||||
},
|
||||
this(manager, new Kit[]
|
||||
{
|
||||
new KitApple(manager),
|
||||
new KitBerserker(manager),
|
||||
new KitBrawler(manager),
|
||||
new KitMammoth(manager),
|
||||
new KitArcher(manager),
|
||||
new KitMiner(manager),
|
||||
new KitBomber(manager),
|
||||
new KitDestructor(manager),
|
||||
}, type);
|
||||
}
|
||||
|
||||
public Bridge(ArcadeManager manager, Kit[] kitarray, GameType type)
|
||||
{
|
||||
super(manager, type, kitarray,
|
||||
|
||||
new String[] {
|
||||
"Gather resources and prepare for combat.",
|
||||
|
@ -21,7 +21,7 @@ public class KitApple extends ProgressingKit
|
||||
};
|
||||
|
||||
private static final Perk[] PERKS = {
|
||||
new PerkApple()
|
||||
new PerkApple(10000)
|
||||
};
|
||||
|
||||
private static final ItemStack IN_HAND = new ItemStack(Material.APPLE);
|
||||
|
@ -0,0 +1,28 @@
|
||||
package nautilus.game.arcade.game.games.bridge.modes;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.game.games.bridge.Bridge;
|
||||
import nautilus.game.arcade.game.games.bridge.modes.kits.KitBrawlAppler;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
|
||||
/**
|
||||
* AppleAttack is a mode for [{@link Bridge} which will remove all kits except for a custom appler {@link KitBrawlAppler}
|
||||
*
|
||||
* @author xXVevzZXx
|
||||
*/
|
||||
public class AppleAttack extends Bridge
|
||||
{
|
||||
|
||||
public AppleAttack(ArcadeManager manager)
|
||||
{
|
||||
super(manager, new Kit[]{new KitBrawlAppler(manager)}, GameType.Brawl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String GetMode()
|
||||
{
|
||||
return "Apple Attack";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,197 @@
|
||||
package nautilus.game.arcade.game.games.bridge.modes;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Chest;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.EnchantmentStorageMeta;
|
||||
import org.bukkit.potion.Potion;
|
||||
import org.bukkit.potion.PotionType;
|
||||
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.games.AbsorptionFix;
|
||||
import nautilus.game.arcade.game.games.bridge.Bridge;
|
||||
|
||||
/**
|
||||
* InsaneBridges is a mode of {@link Bridge} which provides players with starting equipement, better loot and shorter bridge time
|
||||
*
|
||||
* @author xXVevzZXx
|
||||
*/
|
||||
public class InsaneBridges extends Bridge
|
||||
{
|
||||
private int _untilBridges;
|
||||
|
||||
public InsaneBridges(ArcadeManager manager)
|
||||
{
|
||||
super(manager, GameType.Brawl);
|
||||
|
||||
new AbsorptionFix(this);
|
||||
|
||||
Manager.GetDamage().SetEnabled(false);
|
||||
|
||||
_untilBridges = 60000; // 60 Seconds
|
||||
|
||||
WorldBoundaryKill = true;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void fallBridges(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() == GameState.Live)
|
||||
{
|
||||
setBridgeTime(_untilBridges);
|
||||
|
||||
for (Player player : GetPlayers(true))
|
||||
{
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD, 4, Enchantment.DAMAGE_ALL));
|
||||
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_HELMET, 2, Enchantment.PROTECTION_ENVIRONMENTAL));
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_CHESTPLATE, 2, Enchantment.PROTECTION_ENVIRONMENTAL));
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_LEGGINGS, 2, Enchantment.PROTECTION_ENVIRONMENTAL));
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_BOOTS, 2, Enchantment.PROTECTION_ENVIRONMENTAL));
|
||||
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW, 2, Enchantment.ARROW_DAMAGE));
|
||||
player.getInventory().addItem(new ItemStack(Material.ARROW, 64));
|
||||
|
||||
player.getInventory().addItem(new ItemStack(Material.GOLDEN_APPLE, 5));
|
||||
player.getInventory().addItem(new ItemStack(Material.FISHING_ROD));
|
||||
player.getInventory().addItem(new ItemStack(Material.COOKED_BEEF, 32));
|
||||
|
||||
|
||||
player.getInventory().addItem(new ItemStack(Material.IRON_PICKAXE));
|
||||
player.getInventory().addItem(new ItemStack(Material.COBBLESTONE, 32));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void ParseChests()
|
||||
{
|
||||
for (Location loc : WorldData.GetCustomLocs("54"))
|
||||
{
|
||||
if (loc.getBlock().getType() != Material.CHEST)
|
||||
loc.getBlock().setType(Material.CHEST);
|
||||
|
||||
Chest chest = (Chest) loc.getBlock().getState();
|
||||
|
||||
chest.getBlockInventory().clear();
|
||||
|
||||
int count = 22 + UtilMath.r(4);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
chest.getBlockInventory().addItem(GetChestItem());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ItemStack GetChestItem()
|
||||
{
|
||||
if (getChestLoot().isEmpty())
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
getChestLoot().add(new ItemStack(Material.DIAMOND_HELMET));
|
||||
for (int i = 0; i < 2; i++)
|
||||
getChestLoot().add(new ItemStack(Material.DIAMOND_CHESTPLATE));
|
||||
for (int i = 0; i < 2; i++)
|
||||
getChestLoot().add(new ItemStack(Material.DIAMOND_LEGGINGS));
|
||||
for (int i = 0; i < 2; i++)
|
||||
getChestLoot().add(new ItemStack(Material.DIAMOND_BOOTS));
|
||||
for (int i = 0; i < 2; i++)
|
||||
getChestLoot().add(new ItemStack(Material.DIAMOND_SWORD));
|
||||
for (int i = 0; i < 2; i++)
|
||||
getChestLoot().add(new ItemStack(Material.DIAMOND_AXE));
|
||||
for (int i = 0; i < 2; i++)
|
||||
getChestLoot().add(new ItemStack(Material.DIAMOND_PICKAXE));
|
||||
|
||||
for (int i = 0; i < 13; i++)
|
||||
{
|
||||
getChestLoot().add(new ItemStack(Material.GOLDEN_APPLE));
|
||||
getChestLoot().add(new ItemStack(Material.ANVIL));
|
||||
}
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
Potion potionHealth = new Potion(PotionType.INSTANT_HEAL);
|
||||
potionHealth.setLevel(2);
|
||||
potionHealth.setSplash(true);
|
||||
getChestLoot().add(potionHealth.toItemStack(1));
|
||||
|
||||
Potion potionDamage = new Potion(PotionType.INSTANT_DAMAGE);
|
||||
potionDamage.setLevel(2);
|
||||
potionDamage.setSplash(true);
|
||||
getChestLoot().add(potionDamage.toItemStack(1));
|
||||
|
||||
Potion potionStrenght = new Potion(PotionType.STRENGTH);
|
||||
potionStrenght.setLevel(1);
|
||||
potionStrenght.setSplash(true);
|
||||
getChestLoot().add(potionStrenght.toItemStack(1));
|
||||
}
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
|
||||
ItemStack sharpness = new ItemStack(Material.ENCHANTED_BOOK);
|
||||
EnchantmentStorageMeta sharpnessMeta = (EnchantmentStorageMeta) sharpness
|
||||
.getItemMeta();
|
||||
sharpnessMeta.addStoredEnchant(Enchantment.DAMAGE_ALL, 1 + UtilMath.r(5), true);
|
||||
sharpness.setItemMeta(sharpnessMeta);
|
||||
getChestLoot().add(sharpness);
|
||||
|
||||
ItemStack protection = new ItemStack(Material.ENCHANTED_BOOK);
|
||||
EnchantmentStorageMeta protectionMeta = (EnchantmentStorageMeta) protection
|
||||
.getItemMeta();
|
||||
protectionMeta.addStoredEnchant(Enchantment.PROTECTION_ENVIRONMENTAL,
|
||||
1 + UtilMath.r(4), true);
|
||||
protection.setItemMeta(protectionMeta);
|
||||
getChestLoot().add(protection);
|
||||
|
||||
ItemStack power = new ItemStack(Material.ENCHANTED_BOOK);
|
||||
EnchantmentStorageMeta powerMeta = (EnchantmentStorageMeta) power.getItemMeta();
|
||||
powerMeta.addStoredEnchant(Enchantment.ARROW_DAMAGE, 1 + UtilMath.r(5), true);
|
||||
power.setItemMeta(powerMeta);
|
||||
getChestLoot().add(power);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
getChestLoot().add(new ItemStack(Material.EXP_BOTTLE, 10));
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
getChestLoot().add(new ItemStack(Material.BOW));
|
||||
for (int i = 0; i < 8; i++)
|
||||
getChestLoot().add(new ItemStack(Material.ARROW, 8));
|
||||
|
||||
for (int i = 0; i < 12; i++)
|
||||
getChestLoot().add(new ItemStack(Material.MUSHROOM_SOUP));
|
||||
for (int i = 0; i < 12; i++)
|
||||
getChestLoot().add(new ItemStack(Material.COOKED_CHICKEN, 2));
|
||||
}
|
||||
|
||||
ItemStack stack = getChestLoot().get(UtilMath.r(getChestLoot().size()));
|
||||
|
||||
int amount = 1;
|
||||
|
||||
if (stack.getType().getMaxStackSize() > 1)
|
||||
amount = stack.getAmount() + UtilMath.r(stack.getAmount());
|
||||
|
||||
ItemStack item = stack.clone();
|
||||
item.setAmount(amount);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String GetMode()
|
||||
{
|
||||
return "Insane Bridges";
|
||||
}
|
||||
|
||||
}
|
@ -5,6 +5,8 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.minecraft.game.core.condition.ConditionManager;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
@ -24,7 +26,7 @@ public class SpeedBridges extends Bridge
|
||||
{
|
||||
super(manager, GameType.Brawl);
|
||||
|
||||
_untilBridges = 20000;
|
||||
_untilBridges = 10000;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -36,11 +38,15 @@ public class SpeedBridges extends Bridge
|
||||
|
||||
for (Player player : GetPlayers(true))
|
||||
{
|
||||
player.getInventory().addItem(new ItemStack(Material.WOOD_SWORD));
|
||||
player.getInventory().addItem(new ItemStack(Material.LEATHER_HELMET));
|
||||
player.getInventory().addItem(new ItemStack(Material.LEATHER_CHESTPLATE));
|
||||
player.getInventory().addItem(new ItemStack(Material.LEATHER_LEGGINGS));
|
||||
player.getInventory().addItem(new ItemStack(Material.LEATHER_BOOTS));
|
||||
player.getInventory().addItem(new ItemStack(Material.IRON_SWORD));
|
||||
player.getInventory().addItem(new ItemStack(Material.IRON_HELMET));
|
||||
player.getInventory().addItem(new ItemStack(Material.IRON_CHESTPLATE));
|
||||
player.getInventory().addItem(new ItemStack(Material.IRON_LEGGINGS));
|
||||
player.getInventory().addItem(new ItemStack(Material.IRON_BOOTS));
|
||||
|
||||
player.getInventory().addItem(new ItemStack(Material.COOKED_BEEF, 10));
|
||||
|
||||
Manager.GetCondition().Factory().Speed("Game", player, player, GameTimeout, 2, true, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,146 @@
|
||||
package nautilus.game.arcade.game.games.bridge.modes;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
||||
import org.bukkit.event.inventory.PrepareItemCraftEvent;
|
||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
import org.bukkit.inventory.CraftingInventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.ShapedRecipe;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.bukkit.scoreboard.DisplaySlot;
|
||||
import org.bukkit.scoreboard.Objective;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.games.AbsorptionFix;
|
||||
import nautilus.game.arcade.game.games.bridge.Bridge;
|
||||
|
||||
/**
|
||||
* UHCBridges is a mode of {@link Bridge} which is a UHC like gamemode
|
||||
*
|
||||
* @author xXVevzZXx
|
||||
*/
|
||||
public class UHCBridges extends Bridge
|
||||
{
|
||||
|
||||
public UHCBridges(ArcadeManager manager)
|
||||
{
|
||||
super(manager, GameType.Brawl);
|
||||
|
||||
SoupEnabled = false;
|
||||
|
||||
new AbsorptionFix(this);
|
||||
|
||||
ShapedRecipe headApple = new ShapedRecipe(new ItemStack(Material.GOLDEN_APPLE, 1));
|
||||
headApple.shape("GGG", "GHG", "GGG");
|
||||
headApple.setIngredient('G', Material.GOLD_INGOT);
|
||||
headApple.setIngredient('H', new MaterialData(Material.SKULL_ITEM, (byte) 3));
|
||||
UtilServer.getServer().addRecipe(headApple);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void registerObj(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Prepare)
|
||||
return;
|
||||
|
||||
Objective objective = Scoreboard.getScoreboard().registerNewObjective("Health", "health");
|
||||
objective.setDisplaySlot(DisplaySlot.PLAYER_LIST);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void regenHealth(EntityRegainHealthEvent event)
|
||||
{
|
||||
if (event.getRegainReason() == RegainReason.SATIATED)
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void gappleDrop(EntityDeathEvent event)
|
||||
{
|
||||
if (event.getEntity() instanceof Player)
|
||||
{
|
||||
event.getDrops().add(new ItemStack(Material.GOLDEN_APPLE, 1));
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void giveItems(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() == GameState.Live)
|
||||
{
|
||||
for (Player player : GetPlayers(true))
|
||||
{
|
||||
player.getInventory().addItem(new ItemStack(Material.GOLDEN_APPLE, 3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void headPlaceCancel(BlockPlaceEvent event)
|
||||
{
|
||||
if (event.getItemInHand().getType() == Material.SKULL || event.getItemInHand().getType() == Material.SKULL_ITEM)
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void headPickup(PlayerPickupItemEvent event)
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
if (event.getItem().getItemStack().getType() == Material.SKULL_ITEM)
|
||||
{
|
||||
UtilPlayer.message(event.getPlayer(), " ");
|
||||
UtilPlayer.message(event.getPlayer(), C.cGreen + C.Bold + "You picked up a Player Head!");
|
||||
UtilPlayer.message(event.getPlayer(), C.cWhite + "Use the recipe for Golden Apple, but Head replaces Apple.");
|
||||
UtilPlayer.message(event.getPlayer(), " ");
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void craftGoldenAppleDeny(PrepareItemCraftEvent event)
|
||||
{
|
||||
if (event.getRecipe().getResult() == null)
|
||||
return;
|
||||
|
||||
Material type = event.getRecipe().getResult().getType();
|
||||
|
||||
if (type != Material.GOLDEN_APPLE)
|
||||
return;
|
||||
|
||||
if (!(event.getInventory() instanceof CraftingInventory))
|
||||
return;
|
||||
|
||||
CraftingInventory inv = (CraftingInventory) event.getInventory();
|
||||
|
||||
for (ItemStack item : inv.getMatrix())
|
||||
if (item != null && item.getType() != Material.AIR)
|
||||
if (item.getType() == Material.GOLD_INGOT)
|
||||
return;
|
||||
|
||||
inv.setResult(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String GetMode()
|
||||
{
|
||||
return "UHC Bridges";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package nautilus.game.arcade.game.games.bridge.modes.kits;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.game.games.bridge.kits.KitApple;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.ProgressingKit;
|
||||
import nautilus.game.arcade.kit.perks.PerkApple;
|
||||
|
||||
/**
|
||||
* KitBrawlAppler is a variation of the Kit [{@link KitApple} which has a shorter delay of spawning apples
|
||||
*
|
||||
* @author xXVevzZXx
|
||||
*/
|
||||
public class KitBrawlAppler extends ProgressingKit
|
||||
{
|
||||
private static final String[] DESCRIPTION =
|
||||
{
|
||||
"Possess the rare skill of finding apples frequently!",
|
||||
"",
|
||||
receiveItem("apple", 1, 3, 0), click(true, "the apple to throw it")
|
||||
};
|
||||
|
||||
private static final Perk[] PERKS =
|
||||
{
|
||||
new PerkApple(3000)
|
||||
};
|
||||
|
||||
private static final ItemStack IN_HAND = new ItemStack(Material.APPLE);
|
||||
|
||||
public KitBrawlAppler(ArcadeManager manager)
|
||||
{
|
||||
super(manager, "Apple", "bridgeapple", KitAvailability.Free, DESCRIPTION, PERKS, EntityType.ZOMBIE, IN_HAND);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -130,7 +130,7 @@ public class Build extends Game
|
||||
protected String[] _christmasWords;
|
||||
protected String[] _halloweenWords;
|
||||
protected boolean _useChristmasWords = false;
|
||||
protected boolean _useHalloweenWords = true;
|
||||
protected boolean _useHalloweenWords = false;
|
||||
|
||||
protected String _word = "?";
|
||||
|
||||
|
@ -8,7 +8,6 @@ import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import mineplex.core.common.Pair;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
@ -27,6 +26,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import mineplex.core.common.Pair;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
@ -44,6 +44,7 @@ import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
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;
|
||||
@ -94,7 +95,7 @@ public class Draw extends SoloGame
|
||||
private String[] _christmasWords;
|
||||
private String[] _halloweenWords;
|
||||
private boolean _useChristmasWords = false;
|
||||
private boolean _useHalloweenWords = true;
|
||||
private boolean _useHalloweenWords = false;
|
||||
private HashSet<String> _usedWords = new HashSet<String>();
|
||||
|
||||
public Draw(ArcadeManager manager)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5,6 +5,8 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityArrow;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Effect;
|
||||
@ -76,8 +78,8 @@ import mineplex.core.recharge.RechargedEvent;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
@ -91,7 +93,6 @@ import nautilus.game.arcade.game.games.minestrike.items.equipment.armor.Armor;
|
||||
import nautilus.game.arcade.game.games.minestrike.items.grenades.Grenade;
|
||||
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
|
||||
import nautilus.game.arcade.game.games.minestrike.items.guns.GunType;
|
||||
import net.minecraft.server.v1_8_R3.EntityArrow;
|
||||
|
||||
public class GunModule implements Listener
|
||||
{
|
||||
@ -141,6 +142,7 @@ public class GunModule implements Listener
|
||||
public boolean EnablePickup = true;
|
||||
public boolean EnableDrop = true;
|
||||
public boolean EnableCleaning = true;
|
||||
private boolean _disableDamage;
|
||||
|
||||
private long _freezeTime = -1;
|
||||
|
||||
@ -878,6 +880,9 @@ public class GunModule implements Listener
|
||||
@EventHandler(priority=EventPriority.HIGH)
|
||||
public void damage(CustomDamageEvent event)
|
||||
{
|
||||
if (_disableDamage)
|
||||
return;
|
||||
|
||||
if (event.GetDamageePlayer() == null)
|
||||
return;
|
||||
|
||||
@ -2068,4 +2073,9 @@ public class GunModule implements Listener
|
||||
{
|
||||
return _scoped;
|
||||
}
|
||||
|
||||
public void setDisableDamage(boolean disabled)
|
||||
{
|
||||
_disableDamage = disabled;
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,7 @@ import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
@ -121,25 +122,18 @@ public class Minestrike extends TeamGame
|
||||
//Scoreboard
|
||||
private Objective _scoreObj;
|
||||
|
||||
public Minestrike(ArcadeManager manager)
|
||||
public Minestrike(ArcadeManager manager, Kit[] kits, GameType type)
|
||||
{
|
||||
super(manager, GameType.MineStrike,
|
||||
|
||||
new Kit[]
|
||||
{
|
||||
new KitPlayer(manager),
|
||||
},
|
||||
|
||||
super(manager, type, kits,
|
||||
new String[]
|
||||
{
|
||||
C.cAqua + "SWAT" + C.cWhite + " Defend the Bomb Sites",
|
||||
C.cAqua + "SWAT" + C.cWhite + " Kill the Bombers",
|
||||
" ",
|
||||
C.cRed + "Bombers" + C.cWhite + " Plant the Bomb at Bomb Site",
|
||||
C.cRed + "Bombers" + C.cWhite + " Kill the SWAT Team",
|
||||
});
|
||||
{
|
||||
C.cAqua + "SWAT" + C.cWhite + " Defend the Bomb Sites",
|
||||
C.cAqua + "SWAT" + C.cWhite + " Kill the Bombers",
|
||||
" ",
|
||||
C.cRed + "Bombers" + C.cWhite + " Plant the Bomb at Bomb Site",
|
||||
C.cRed + "Bombers" + C.cWhite + " Kill the SWAT Team",
|
||||
});
|
||||
|
||||
_shopManager = new ShopManager(this);
|
||||
Manager.getCosmeticManager().setHideParticles(true);
|
||||
|
||||
this.StrictAntiHack = true;
|
||||
@ -181,6 +175,14 @@ public class Minestrike extends TeamGame
|
||||
"Pick up better weapons from dead players"
|
||||
};
|
||||
|
||||
_gunModule = new GunModule(this);
|
||||
_shopManager = new ShopManager(this);
|
||||
}
|
||||
|
||||
public Minestrike(ArcadeManager manager)
|
||||
{
|
||||
this(manager, new Kit[]{new KitPlayer(manager)}, GameType.MineStrike);
|
||||
|
||||
registerStatTrackers(
|
||||
new KillReasonStatTracker(this, "Headshot", "BoomHeadshot", true),
|
||||
new KillAllOpposingMineStrikeRoundStatTracker(this),
|
||||
@ -204,8 +206,6 @@ public class Minestrike extends TeamGame
|
||||
new ChatStatData("BoomHeadshot", "Headshots", true),
|
||||
Assists
|
||||
);
|
||||
|
||||
_gunModule = new GunModule(this);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -313,6 +313,15 @@ public class Minestrike extends TeamGame
|
||||
|
||||
public void giveTeamArmor(Player player, Color color)
|
||||
{
|
||||
if (_shopManager.isDisabled())
|
||||
{
|
||||
ItemStack armor = new ItemStack(Material.LEATHER_HELMET);
|
||||
LeatherArmorMeta meta = (LeatherArmorMeta)armor.getItemMeta();
|
||||
meta.setColor(color);
|
||||
armor.setItemMeta(meta);
|
||||
player.getInventory().setHelmet(armor);
|
||||
}
|
||||
|
||||
ItemStack armor = new ItemStack(Material.LEATHER_CHESTPLATE);
|
||||
LeatherArmorMeta meta = (LeatherArmorMeta)armor.getItemMeta();
|
||||
meta.setColor(color);
|
||||
@ -934,9 +943,13 @@ public class Minestrike extends TeamGame
|
||||
{
|
||||
player.playSound(player.getLocation(), Sound.HORSE_ARMOR, 1f, 2f);
|
||||
Manager.GetCondition().Factory().Blind("Respawn", player, null, 2, 0, false, false, false);
|
||||
UtilPlayer.message(player, F.main("Game", "You have " + F.elem(C.cGreen + "$" + _shopManager.getMoney(player)) + ". Open your Inventory to spend it."));
|
||||
|
||||
if (!_shopManager.isDisabled())
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", "You have " + F.elem(C.cGreen + "$" + _shopManager.getMoney(player)) + ". Open your Inventory to spend it."));
|
||||
|
||||
UtilTextMiddle.display(C.cGreen + "$" + _shopManager.getMoney(player), "Open your Inventory to buy new equipment", 10, 120, 10, player);
|
||||
UtilTextMiddle.display(C.cGreen + "$" + _shopManager.getMoney(player), "Open your Inventory to buy new equipment", 10, 120, 10, player);
|
||||
}
|
||||
}
|
||||
|
||||
//Reset grenades
|
||||
@ -1362,4 +1375,9 @@ public class Minestrike extends TeamGame
|
||||
{
|
||||
return _gunModule;
|
||||
}
|
||||
|
||||
public ShopManager getShopManager()
|
||||
{
|
||||
return _shopManager;
|
||||
}
|
||||
}
|
@ -50,6 +50,8 @@ public class ShopManager
|
||||
private HashSet<Player> _inShop = new HashSet<Player>();
|
||||
|
||||
private Map<UUID, Integer> _boughtGrenades = new HashMap<>();
|
||||
|
||||
private boolean _disabled;
|
||||
|
||||
public ShopManager(Minestrike minestrike)
|
||||
{
|
||||
@ -58,6 +60,9 @@ public class ShopManager
|
||||
|
||||
public void enterShop(Player player)
|
||||
{
|
||||
if (_disabled)
|
||||
return;
|
||||
|
||||
GameTeam team = Host.GetTeam(player);
|
||||
if (team == null)
|
||||
return;
|
||||
@ -174,6 +179,9 @@ public class ShopManager
|
||||
|
||||
public int getMoney(Player player)
|
||||
{
|
||||
if (_disabled)
|
||||
return 0;
|
||||
|
||||
if (!_money.containsKey(player))
|
||||
_money.put(player, 800);
|
||||
|
||||
@ -182,6 +190,9 @@ public class ShopManager
|
||||
|
||||
public void addMoney(Player player, int amount, String reason)
|
||||
{
|
||||
if (_disabled)
|
||||
return;
|
||||
|
||||
_money.put(player, Math.min(16000, getMoney(player) + amount));
|
||||
|
||||
UtilPlayer.message(player, F.main("Game", "Received " + F.elem(C.cDGreen + "$" + amount) + " for " + reason + "."));
|
||||
@ -189,6 +200,9 @@ public class ShopManager
|
||||
|
||||
public void inventoryClick(InventoryClickEvent event)
|
||||
{
|
||||
if (_disabled)
|
||||
return;
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
Player player = UtilPlayer.searchExact(event.getWhoClicked().getName());
|
||||
@ -282,6 +296,9 @@ public class ShopManager
|
||||
|
||||
public void leaveShop(Player player, boolean showShopItem, boolean wipeMoney)
|
||||
{
|
||||
if (_disabled)
|
||||
return;
|
||||
|
||||
_shop.remove(player);
|
||||
|
||||
_inShop.remove(player);
|
||||
@ -310,7 +327,10 @@ public class ShopManager
|
||||
}
|
||||
|
||||
public void update()
|
||||
{
|
||||
{
|
||||
if (_disabled)
|
||||
return;
|
||||
|
||||
for (Player player : Host.GetPlayers(false))
|
||||
{
|
||||
GameTeam team = Host.GetTeam(player);
|
||||
@ -345,8 +365,18 @@ public class ShopManager
|
||||
}
|
||||
}
|
||||
|
||||
public void setDisabled(boolean disabled)
|
||||
{
|
||||
_disabled = disabled;
|
||||
}
|
||||
|
||||
public void resetGrenades()
|
||||
{
|
||||
_boughtGrenades.clear();
|
||||
}
|
||||
|
||||
public boolean isDisabled()
|
||||
{
|
||||
return _disabled;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,657 @@
|
||||
package nautilus.game.arcade.game.games.minestrike.modes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.EnderPearl;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Snowball;
|
||||
import org.bukkit.entity.ThrownPotion;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
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.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.LeatherArmorMeta;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.scoreboard.NameTagVisibility;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.hologram.Hologram.HologramTarget;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
||||
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.PlayerKitGiveEvent;
|
||||
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
||||
import nautilus.game.arcade.game.games.minestrike.Minestrike;
|
||||
import nautilus.game.arcade.game.games.paintball.Paintball;
|
||||
import nautilus.game.arcade.game.games.paintball.PlayerCopyPaintball;
|
||||
import nautilus.game.arcade.game.games.paintball.events.PaintballEvent;
|
||||
import nautilus.game.arcade.game.games.paintball.events.ReviveEvent;
|
||||
import nautilus.game.arcade.game.games.paintball.kits.KitMachineGun;
|
||||
import nautilus.game.arcade.game.games.paintball.kits.KitRifle;
|
||||
import nautilus.game.arcade.game.games.paintball.kits.KitShotgun;
|
||||
import nautilus.game.arcade.game.games.paintball.kits.KitSniper;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
|
||||
/**
|
||||
* SuperPaintstrike is a mode of {@link Minestrike} which implements {@link Paintball} kits
|
||||
*
|
||||
* @author xXVevzZXx
|
||||
*/
|
||||
public class SuperPaintstrike extends Minestrike
|
||||
{
|
||||
private HashMap<Player, PlayerCopyPaintball> _doubles = new HashMap<Player, PlayerCopyPaintball>();
|
||||
|
||||
public SuperPaintstrike(ArcadeManager manager)
|
||||
{
|
||||
super(manager, new Kit[]
|
||||
{
|
||||
new KitRifle(manager),
|
||||
new KitShotgun(manager),
|
||||
new KitMachineGun(manager),
|
||||
new KitSniper(manager),
|
||||
|
||||
}, GameType.Brawl);
|
||||
|
||||
getShopManager().setDisabled(true);
|
||||
getGunModule().setDisableDamage(true);
|
||||
getGunModule().setEnableCleaning(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler
|
||||
public void giveStartEquipment(PlayerKitGiveEvent event)
|
||||
{
|
||||
GameTeam team = GetTeam(event.getPlayer());
|
||||
if (team == null)
|
||||
return;
|
||||
|
||||
if (team.GetColor() == ChatColor.RED)
|
||||
{
|
||||
if (IsAlive(event.getPlayer()))
|
||||
{
|
||||
//Armor
|
||||
giveTeamArmor(event.getPlayer(), Color.RED);
|
||||
}
|
||||
}
|
||||
else if (team.GetColor() == ChatColor.AQUA)
|
||||
{
|
||||
if (IsAlive(event.getPlayer()))
|
||||
{
|
||||
//Armor
|
||||
giveTeamArmor(event.getPlayer(), Color.AQUA);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onHeal(PlayerInteractEvent event)
|
||||
{
|
||||
if (!UtilEvent.isAction(event, ActionType.R))
|
||||
return;
|
||||
|
||||
LaunchPotion(event.getPlayer(), event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onHeal(PlayerInteractEntityEvent event)
|
||||
{
|
||||
LaunchPotion(event.getPlayer(), event);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = false)
|
||||
public void onHeal(PlayerInteractAtEntityEvent event)
|
||||
{
|
||||
LaunchPotion(event.getPlayer(), event);
|
||||
}
|
||||
|
||||
public void LaunchPotion(Player player, Cancellable event)
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
if (!UtilGear.isMat(player.getItemInHand(), Material.POTION))
|
||||
return;
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
if (!IsAlive(player) || UtilPlayer.isSpectator(player))
|
||||
return;
|
||||
|
||||
if (!Recharge.Instance.use(player, "Water Potion", 250, false, false))
|
||||
return;
|
||||
|
||||
UtilInv.UseItemInHand(player);
|
||||
|
||||
ThrownPotion potion = player.launchProjectile(ThrownPotion.class);
|
||||
potion.getEffects().clear();
|
||||
potion.getEffects().add(new PotionEffect(PotionEffectType.WATER_BREATHING, 100, 100));
|
||||
|
||||
Manager.runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
UtilInv.Update(player);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void removePotionEffect(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
for (Player player : GetPlayers(true))
|
||||
player.removePotionEffect(PotionEffectType.WATER_BREATHING);
|
||||
}
|
||||
|
||||
public void cleanColorArmor(Player player)
|
||||
{
|
||||
Color color = Color.RED;
|
||||
if (Manager.GetColor(player) != ChatColor.RED)
|
||||
color = Color.AQUA;
|
||||
|
||||
for (ItemStack stack : player.getEquipment().getArmorContents())
|
||||
{
|
||||
if (!(stack.getItemMeta() instanceof LeatherArmorMeta))
|
||||
continue;
|
||||
|
||||
LeatherArmorMeta meta = (LeatherArmorMeta)stack.getItemMeta();
|
||||
meta.setColor(color);
|
||||
stack.setItemMeta(meta);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void cleanHit(ProjectileHitEvent event)
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
if (!(event.getEntity() instanceof ThrownPotion))
|
||||
return;
|
||||
|
||||
if (event.getEntity().getShooter() == null)
|
||||
return;
|
||||
|
||||
if (!(event.getEntity().getShooter() instanceof Player))
|
||||
return;
|
||||
|
||||
Player thrower = (Player)event.getEntity().getShooter();
|
||||
if (!IsAlive(thrower))
|
||||
return;
|
||||
|
||||
GameTeam throwerTeam = GetTeam(thrower);
|
||||
if (throwerTeam == null) return;
|
||||
|
||||
//Revive
|
||||
Iterator<PlayerCopyPaintball> copyIterator = _doubles.values().iterator();
|
||||
while (copyIterator.hasNext())
|
||||
{
|
||||
PlayerCopyPaintball copy = copyIterator.next();
|
||||
|
||||
GameTeam otherTeam = GetTeam(copy.GetPlayer());
|
||||
if (otherTeam == null || !otherTeam.equals(throwerTeam))
|
||||
continue;
|
||||
|
||||
if (UtilMath.offset(copy.GetEntity().getLocation().add(0,1,0), event.getEntity().getLocation()) > 3)
|
||||
continue;
|
||||
|
||||
playerIn(copy.GetPlayer(), copy);
|
||||
|
||||
copyIterator.remove();
|
||||
|
||||
AddGems(thrower, 3, "Revived Ally", true, true);
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new ReviveEvent(thrower, copy.GetPlayer()));
|
||||
}
|
||||
|
||||
//Clean
|
||||
for (Player player : GetPlayers(true))
|
||||
{
|
||||
GameTeam otherTeam = GetTeam(player);
|
||||
if (otherTeam == null || !otherTeam.equals(throwerTeam))
|
||||
continue;
|
||||
|
||||
if (UtilMath.offset(player.getLocation().add(0,1,0), event.getEntity().getLocation()) > 3)
|
||||
continue;
|
||||
|
||||
playerIn(player, null);
|
||||
}
|
||||
}
|
||||
|
||||
public void playerIn(final Player player, final PlayerCopyPaintball copy)
|
||||
{
|
||||
//State
|
||||
SetPlayerState(player, PlayerState.IN);
|
||||
player.setHealth(20);
|
||||
|
||||
//Teleport
|
||||
if (copy != null)
|
||||
{
|
||||
Location loc = player.getLocation();
|
||||
loc.setX(copy.GetEntity().getLocation().getX());
|
||||
loc.setY(copy.GetEntity().getLocation().getY());
|
||||
loc.setZ(copy.GetEntity().getLocation().getZ());
|
||||
player.teleport(loc);
|
||||
}
|
||||
|
||||
//Settings
|
||||
if (player.getGameMode() == GameMode.SPECTATOR)
|
||||
player.setSpectatorTarget(null);
|
||||
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
player.setAllowFlight(false);
|
||||
player.setFlying(false);
|
||||
((CraftPlayer)player).getHandle().spectating = false;
|
||||
((CraftPlayer)player).getHandle().k = true;
|
||||
|
||||
//Items
|
||||
player.getInventory().remove(Material.WATCH);
|
||||
player.getInventory().remove(Material.COMPASS);
|
||||
|
||||
//Clean Armor
|
||||
cleanColorArmor(player);
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(player, F.main("Game", "You have been cleaned!"));
|
||||
|
||||
//Delayed Visibility
|
||||
if (copy != null)
|
||||
{
|
||||
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
//Remove Invis
|
||||
if (IsAlive(player))
|
||||
Manager.GetCondition().EndCondition(player, ConditionType.CLOAK, null);
|
||||
|
||||
//Remove Copy
|
||||
copy.GetEntity().remove();
|
||||
copy.GetHolo().stop();
|
||||
copy.GetSaveMe().stop();
|
||||
}
|
||||
}, 4);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void updateCloneHolograms(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
|
||||
for (PlayerCopyPaintball clone : _doubles.values())
|
||||
{
|
||||
if (clone.GetHolo().getHologramTarget() == HologramTarget.WHITELIST)
|
||||
{
|
||||
//Other team blacklist
|
||||
clone.GetHolo().setHologramTarget(HologramTarget.BLACKLIST);
|
||||
|
||||
for (Player cur : GetPlayers(false))
|
||||
{
|
||||
if (!IsAlive(cur))
|
||||
{
|
||||
if (clone.GetHolo().containsPlayer(cur))
|
||||
clone.GetHolo().removePlayer(cur);
|
||||
}
|
||||
}
|
||||
clone.GetHolo().start();
|
||||
}
|
||||
|
||||
clone.setSaveMeFlop(!clone.getSaveMeFlop());
|
||||
clone.GetSaveMe().setText((clone.getSaveMeFlop() ? C.cRedB : C.cWhiteB) + "SAVE ME!");
|
||||
|
||||
for (Player player : GetTeam(clone.GetPlayer()).GetPlayers(false))
|
||||
{
|
||||
if (!IsAlive(player)) // Remove if it's not alive
|
||||
{
|
||||
if (clone.GetSaveMe().containsPlayer(player))
|
||||
clone.GetSaveMe().removePlayer(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
boolean hasPotion = UtilInv.contains(player, Material.POTION, (byte) -1, 1);
|
||||
if (clone.GetSaveMe().containsPlayer(player))
|
||||
{
|
||||
if (!hasPotion) // No potions left
|
||||
{
|
||||
clone.GetSaveMe().removePlayer(player);
|
||||
}
|
||||
}
|
||||
else if (hasPotion)
|
||||
{
|
||||
clone.GetSaveMe().addPlayer(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void CustomTeamGeneration(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Recruit)
|
||||
return;
|
||||
|
||||
this.GetTeamList().get(0).SetColor(ChatColor.AQUA);
|
||||
this.GetTeamList().get(0).SetName("Frost");
|
||||
|
||||
this.GetTeamList().get(1).SetColor(ChatColor.RED);
|
||||
this.GetTeamList().get(1).SetName("Nether");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onNameTag(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() == GameState.Prepare)
|
||||
for (Team team : Scoreboard.getScoreboard().getTeams())
|
||||
team.setNameTagVisibility(NameTagVisibility.HIDE_FOR_OTHER_TEAMS);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void colorArmor(PlayerPrepareTeleportEvent event)
|
||||
{
|
||||
cleanColorArmor(event.GetPlayer());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void healthRegen(EntityRegainHealthEvent event)
|
||||
{
|
||||
if (event.getRegainReason() == RegainReason.SATIATED)
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void teleport(PlayerTeleportEvent event)
|
||||
{
|
||||
if (event.getCause() == TeleportCause.ENDER_PEARL)
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@EventHandler
|
||||
public void paint(final ProjectileHitEvent event)
|
||||
{
|
||||
if (IsLive() || GetState() == GameState.End)
|
||||
{
|
||||
if (event.getEntity() instanceof ThrownPotion)
|
||||
return;
|
||||
|
||||
final byte color = (byte) (event.getEntity() instanceof EnderPearl || (event.getEntity() instanceof Arrow && event.getEntity().hasMetadata("color") && ChatColor.values()[event.getEntity().getMetadata("color").get(0).asInt()] == ChatColor.RED) ? 14 : 3);
|
||||
|
||||
event.getEntity().setVelocity(event.getEntity().getVelocity().normalize().multiply(1.2));
|
||||
|
||||
PacketPlayOutEntityDestroy destroy = new PacketPlayOutEntityDestroy(new int[]{event.getEntity().getEntityId()});
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
UtilPlayer.sendPacket(player, destroy);
|
||||
|
||||
Manager.runSyncLater(new Runnable() // Stupid thing I have to do to make sure the arrow's location is accounted for. Stupid mojang. - Myst
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
Location loc = event.getEntity().getLocation();
|
||||
// loc.add(event.getEntity().getVelocity().clone().normalize().multiply(.5));
|
||||
|
||||
for (Block block : UtilBlock.getInRadius(loc, 1.5d).keySet())
|
||||
{
|
||||
if (block.getType() != Material.WOOL && block.getType() != Material.STAINED_CLAY && block.getType() != Material.HARD_CLAY)
|
||||
continue;
|
||||
|
||||
if (block.getType() == Material.HARD_CLAY)
|
||||
block.setType(Material.STAINED_CLAY);
|
||||
|
||||
block.setData(color);
|
||||
}
|
||||
|
||||
if (color == 3) loc.getWorld().playEffect(loc, Effect.STEP_SOUND, 8);
|
||||
else loc.getWorld().playEffect(loc, Effect.STEP_SOUND, 10);
|
||||
|
||||
event.getEntity().remove();
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onQuit(PlayerQuitEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (_doubles.containsKey(player))
|
||||
{
|
||||
PlayerCopyPaintball copy = _doubles.remove(player);
|
||||
copy.GetEntity().remove();
|
||||
copy.GetHolo().stop();
|
||||
copy.GetSaveMe().stop();
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void damageCancel(CustomDamageEvent event)
|
||||
{
|
||||
if (event.GetDamageePlayer() == null)
|
||||
event.SetCancelled("Not Player");
|
||||
|
||||
// Fixed void damage being blocked from this check.
|
||||
|
||||
if (event.GetProjectile() == null && event.GetCause() != DamageCause.VOID)
|
||||
event.SetCancelled("No Projectile");
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void paintballDamage(CustomDamageEvent event)
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
if (event.GetProjectile() == null)
|
||||
return;
|
||||
|
||||
if (!(event.GetProjectile() instanceof Snowball) && !(event.GetProjectile() instanceof EnderPearl) && !(event.GetProjectile() instanceof Arrow))
|
||||
return;
|
||||
|
||||
//Negate
|
||||
|
||||
event.AddMod("Negate", "Negate", -event.GetDamageInitial(), false);
|
||||
|
||||
event.AddMod("Paintball", "Paintball", 2, true);
|
||||
event.AddKnockback("Paintball", 2);
|
||||
|
||||
event.setShowArrows(false);
|
||||
|
||||
Player damagee = event.GetDamageePlayer();
|
||||
if (damagee == null)
|
||||
return;
|
||||
|
||||
Player damager = event.GetDamagerPlayer(true);
|
||||
if (damager == null)
|
||||
return;
|
||||
|
||||
GameTeam damageeTeam = GetTeam(damagee);
|
||||
if (damageeTeam == null)
|
||||
return;
|
||||
|
||||
GameTeam damagerTeam = GetTeam(damager);
|
||||
if (damagerTeam == null)
|
||||
return;
|
||||
|
||||
if (damagerTeam.equals(damageeTeam))
|
||||
return;
|
||||
|
||||
//Count
|
||||
int count = 1;
|
||||
if (GetKit(damager) != null)
|
||||
{
|
||||
if (GetKit(damager) instanceof KitRifle)
|
||||
{
|
||||
count = 3;
|
||||
}
|
||||
if (GetKit(damager) instanceof KitSniper && event.GetProjectile() instanceof Arrow)
|
||||
{
|
||||
count = ((KitSniper) GetKit(damager)).getPaintDamage((Arrow) event.GetProjectile());
|
||||
|
||||
if (count == -1)
|
||||
count = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//Out
|
||||
if (color(damagee, count))
|
||||
{
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
UtilPlayer.message(player, damageeTeam.GetColor() + damagee.getName() + ChatColor.RESET + " was painted by " +
|
||||
damagerTeam.GetColor() + damager.getName() + ChatColor.RESET + "!");
|
||||
|
||||
playerOut(damagee, damager);
|
||||
|
||||
AddGems(damager, 2, "Kills", true, true);
|
||||
|
||||
AddStat(damager, "Kills", 1, false, false);
|
||||
AddStat(damagee, "Deaths", 1, false, false);
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new PaintballEvent(damagee, damager));
|
||||
}
|
||||
|
||||
//Hit Sound
|
||||
Player player = event.GetDamagerPlayer(true);
|
||||
if (player != null)
|
||||
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 1f, 3f);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void armorRemoveCancel(InventoryClickEvent event)
|
||||
{
|
||||
if (IsLive())
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
public boolean color(Player player, int amount)
|
||||
{
|
||||
//Get Non-Coloured
|
||||
ArrayList<ItemStack> nonColored = new ArrayList<ItemStack>();
|
||||
for (ItemStack stack : player.getInventory().getArmorContents())
|
||||
{
|
||||
if (!(stack.getItemMeta() instanceof LeatherArmorMeta))
|
||||
continue;
|
||||
|
||||
LeatherArmorMeta meta = (LeatherArmorMeta)stack.getItemMeta();
|
||||
|
||||
if (meta.getColor().equals(Color.RED) || meta.getColor().equals(Color.AQUA))
|
||||
nonColored.add(stack);
|
||||
}
|
||||
|
||||
//Color Piece
|
||||
for (int i=0 ; i<amount ; i++)
|
||||
{
|
||||
if (nonColored.isEmpty())
|
||||
break;
|
||||
|
||||
ItemStack armor = nonColored.remove(UtilMath.r(nonColored.size()));
|
||||
|
||||
LeatherArmorMeta meta = (LeatherArmorMeta)armor.getItemMeta();
|
||||
meta.setColor(Color.PURPLE);
|
||||
armor.setItemMeta(meta);
|
||||
}
|
||||
|
||||
player.setHealth(Math.min(20, Math.max(2, nonColored.size() * 5 + 1)));
|
||||
|
||||
return nonColored.isEmpty();
|
||||
}
|
||||
|
||||
public void playerOut(Player player, Player killer)
|
||||
{
|
||||
//State
|
||||
SetPlayerState(player, PlayerState.OUT);
|
||||
player.setHealth(20);
|
||||
|
||||
//Conditions
|
||||
Manager.GetCondition().Factory().Blind("Hit", player, player, 1.5, 0, false, false, false);
|
||||
Manager.GetCondition().Factory().Cloak("Hit", player, player, 9999, false, false);
|
||||
|
||||
_doubles.put(player, new PlayerCopyPaintball(this, player, killer, GetTeam(player).GetColor()));
|
||||
|
||||
//Settings
|
||||
player.setAllowFlight(true);
|
||||
player.setFlying(true);
|
||||
((CraftPlayer)player).getHandle().spectating = true;
|
||||
((CraftPlayer)player).getHandle().k = false;
|
||||
|
||||
UtilAction.velocity(player, new Vector(0,1.2,0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restartRound()
|
||||
{
|
||||
super.restartRound();
|
||||
|
||||
Iterator<PlayerCopyPaintball> copyIterator = _doubles.values().iterator();
|
||||
while (copyIterator.hasNext())
|
||||
{
|
||||
PlayerCopyPaintball copy = copyIterator.next();
|
||||
|
||||
copy.GetEntity().remove();
|
||||
copy.GetHolo().stop();
|
||||
copy.GetSaveMe().stop();
|
||||
|
||||
copyIterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String GetMode()
|
||||
{
|
||||
return "Super Paintstrike";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package nautilus.game.arcade.game.games.quiver.modes;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
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.game.games.quiver.Quiver;
|
||||
import nautilus.game.arcade.game.games.quiver.QuiverTeamBase;
|
||||
import nautilus.game.arcade.game.games.quiver.kits.KitBarrage;
|
||||
import nautilus.game.arcade.game.games.quiver.kits.KitBeserker;
|
||||
import nautilus.game.arcade.game.games.quiver.kits.KitNecromancer;
|
||||
import nautilus.game.arcade.game.games.quiver.kits.KitNewNinja;
|
||||
import nautilus.game.arcade.game.games.quiver.kits.KitPyromancer;
|
||||
import nautilus.game.arcade.game.games.quiver.kits.KitSkyWarrior;
|
||||
import nautilus.game.arcade.game.games.quiver.modes.module.ModuleStandaloneUltimate;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
|
||||
/**
|
||||
* UltimateOITQ is a mode of {@link Quiver} which implements the ultimate kits from {@link QuiverTeamBase}
|
||||
*
|
||||
* @author xXVevzZXx
|
||||
*/
|
||||
public class UltimateOITQ extends Quiver
|
||||
{
|
||||
|
||||
public UltimateOITQ(ArcadeManager manager)
|
||||
{
|
||||
super(manager, new Kit[]
|
||||
{
|
||||
new KitBeserker(manager),
|
||||
new KitNewNinja(manager),
|
||||
new KitBarrage(manager),
|
||||
new KitSkyWarrior(manager),
|
||||
new KitPyromancer(manager),
|
||||
new KitNecromancer(manager)
|
||||
}, GameType.Brawl);
|
||||
|
||||
registerModule(new ModuleStandaloneUltimate(30F));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void clearArmor(UpdateEvent event)
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
if (Manager.GetGame() == null)
|
||||
return;
|
||||
|
||||
if (event.getType() != UpdateType.FASTER)
|
||||
return;
|
||||
|
||||
for (Player player : GetPlayers(true))
|
||||
{
|
||||
if (player.getInventory().getBoots() != null && player.getInventory().getBoots().getType() == Material.LEATHER_BOOTS)
|
||||
player.getInventory().setBoots(null);
|
||||
|
||||
if (player.getInventory().getLeggings() != null && player.getInventory().getLeggings().getType() == Material.LEATHER_LEGGINGS)
|
||||
player.getInventory().setLeggings(null);
|
||||
|
||||
if (player.getInventory().getChestplate() != null && player.getInventory().getChestplate().getType() == Material.LEATHER_CHESTPLATE)
|
||||
player.getInventory().setChestplate(null);
|
||||
|
||||
if (player.getInventory().getHelmet() != null && player.getInventory().getHelmet().getType() == Material.LEATHER_HELMET)
|
||||
player.getInventory().setHelmet(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String GetMode()
|
||||
{
|
||||
return "Ultimate OITQ";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,247 @@
|
||||
package nautilus.game.arcade.game.games.quiver.modes.module;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerToggleSneakEvent;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTextBottom;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.combat.CombatComponent;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
|
||||
import nautilus.game.arcade.game.games.quiver.QuiverTeamBase;
|
||||
import nautilus.game.arcade.game.games.quiver.module.ModuleUltimate;
|
||||
import nautilus.game.arcade.game.games.quiver.ultimates.UltimatePerk;
|
||||
import nautilus.game.arcade.game.modules.Module;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.ProgressingKit;
|
||||
|
||||
/**
|
||||
* Stanalone version of the QuiverTeamBase Module {@link ModuleUltimate}
|
||||
* This needed to be done because the {@link QuiverTeamBase} Module
|
||||
* is made for QuiverTeamBase only
|
||||
*
|
||||
* @author xXVevzZXx
|
||||
*/
|
||||
public class ModuleStandaloneUltimate extends Module
|
||||
{
|
||||
private static final int ULTIMATE_PERCENTAGE_INCREASE_KILL = 5;
|
||||
private static final int ULTIMATE_PERCENTAGE_INCREASE_ASSIST = 2;
|
||||
|
||||
private float _percentage;
|
||||
|
||||
private Map<UUID, Float> _ultimatePercentage = new HashMap<>();
|
||||
|
||||
private boolean _colouredMessage;
|
||||
|
||||
public ModuleStandaloneUltimate(float percentage)
|
||||
{
|
||||
_percentage = percentage;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void update(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SEC)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_colouredMessage = !_colouredMessage;
|
||||
|
||||
for (Player player : getGame().GetPlayers(true))
|
||||
{
|
||||
Kit kit = getGame().GetKit(player);
|
||||
|
||||
if (kit == null || UtilPlayer.isSpectator(player))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!_ultimatePercentage.containsKey(player.getUniqueId()))
|
||||
{
|
||||
_ultimatePercentage.put(player.getUniqueId(), 0F);
|
||||
}
|
||||
|
||||
double percentage = _ultimatePercentage.get(player.getUniqueId());
|
||||
|
||||
if (percentage >= _percentage)
|
||||
{
|
||||
UtilTextBottom.display((_colouredMessage ? C.cWhiteB : C.cAquaB) + "ULTIMATE READY (PRESS SNEAK)", player);
|
||||
player.setExp(0.999F);
|
||||
player.setLevel(100);
|
||||
continue;
|
||||
}
|
||||
|
||||
String percentageFormatted = new DecimalFormat("0.0").format(percentage/_percentage*100);
|
||||
|
||||
UtilTextBottom.displayProgress("Ultimate", percentage / _percentage, percentageFormatted + "%", player);
|
||||
player.setExp((float) percentage / _percentage);
|
||||
player.setLevel((int) Math.round(percentage/_percentage*100));
|
||||
|
||||
for (Perk perk : kit.GetPerks())
|
||||
{
|
||||
if (perk instanceof UltimatePerk)
|
||||
{
|
||||
UltimatePerk ultimate = (UltimatePerk) perk;
|
||||
|
||||
if (ultimate.isUsingUltimate(player))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
incrementUltimate(player, ultimate.getChargePassive());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onCombatDeath(CombatDeathEvent event)
|
||||
{
|
||||
if (event.GetEvent().getEntity() == null || event.GetLog().GetKiller() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(event.GetEvent().getEntity() instanceof Player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
incrementUltimate(player, ULTIMATE_PERCENTAGE_INCREASE_KILL);
|
||||
|
||||
for (CombatComponent combatComponent : event.GetLog().GetAttackers())
|
||||
{
|
||||
if (event.GetLog().GetKiller() != null && combatComponent.equals(event.GetLog().GetKiller()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (combatComponent.IsPlayer())
|
||||
{
|
||||
Player assitedPlayer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
|
||||
|
||||
if (assitedPlayer != null)
|
||||
{
|
||||
incrementUltimate(assitedPlayer, ULTIMATE_PERCENTAGE_INCREASE_ASSIST);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void incrementUltimate(Player player, float percentage)
|
||||
{
|
||||
ProgressingKit kit = (ProgressingKit) getGame().GetKit(player);
|
||||
|
||||
for (Perk perk : kit.getPerks()[kit.getUpgradeLevel(player.getUniqueId())])
|
||||
{
|
||||
if (perk instanceof UltimatePerk)
|
||||
{
|
||||
UltimatePerk ultimate = (UltimatePerk) perk;
|
||||
|
||||
if (ultimate.isUsingUltimate(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_ultimatePercentage.put(player.getUniqueId(), _ultimatePercentage.get(player.getUniqueId()) + percentage);
|
||||
}
|
||||
|
||||
public void resetUltimate(Player player, boolean inform)
|
||||
{
|
||||
if (inform)
|
||||
{
|
||||
player.sendMessage(F.main("Game", "Your Ultimate charge has been reset!"));
|
||||
}
|
||||
|
||||
_ultimatePercentage.put(player.getUniqueId(), 0F);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerToggleSneak(PlayerToggleSneakEvent event)
|
||||
{
|
||||
if (!getGame().IsLive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = event.getPlayer();
|
||||
ProgressingKit kit = (ProgressingKit) getGame().GetKit(player);
|
||||
|
||||
if (!event.isSneaking())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (kit == null || UtilPlayer.isSpectator(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_ultimatePercentage.get(player.getUniqueId()) < _percentage)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (Perk perk : kit.getPerks()[kit.getUpgradeLevel(player.getUniqueId())])
|
||||
{
|
||||
if (perk instanceof UltimatePerk)
|
||||
{
|
||||
UltimatePerk ultimate = (UltimatePerk) perk;
|
||||
|
||||
if (ultimate.isUsable(player))
|
||||
{
|
||||
ultimate.activate(player);
|
||||
resetUltimate(player, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanup()
|
||||
{
|
||||
UtilServer.Unregister(this);
|
||||
|
||||
for (UUID uuid : _ultimatePercentage.keySet())
|
||||
{
|
||||
Player player = UtilPlayer.searchExact(uuid);
|
||||
|
||||
for (Perk perk : getGame().GetKit(player).GetPerks())
|
||||
{
|
||||
if (!(perk instanceof UltimatePerk))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
UltimatePerk ultimate = (UltimatePerk) perk;
|
||||
|
||||
if (ultimate.isUsingUltimate(player))
|
||||
{
|
||||
ultimate.cancel(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package nautilus.game.arcade.game.games.quiver.ultimates;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
@ -122,7 +123,13 @@ public class UltimateNecromancer extends UltimatePerk
|
||||
entities.add(livingEntity);
|
||||
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, livingEntity.getEyeLocation(), 1F, 1F, 1F, 0.1F, 20, ViewDist.NORMAL);
|
||||
|
||||
((Creature) livingEntity).setTarget(UtilPlayer.getClosest(livingEntity.getLocation(), Manager.GetGame().GetTeam(player).GetPlayers(true)));
|
||||
ArrayList<Player> players = Manager.GetGame().GetTeam(player).GetPlayers(true);
|
||||
if (Manager.GetGame().GetTeamList().size() == 1)
|
||||
{
|
||||
players.clear();
|
||||
players.add(player);
|
||||
}
|
||||
((Creature) livingEntity).setTarget(UtilPlayer.getClosest(livingEntity.getLocation(), players));
|
||||
}
|
||||
|
||||
Manager.GetGame().CreatureAllowOverride = false;
|
||||
|
@ -4,16 +4,15 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
import mineplex.core.common.Pair;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.FireworkEffect;
|
||||
import org.bukkit.FireworkEffect.Type;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.FireworkEffect.Type;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -22,37 +21,41 @@ import org.bukkit.entity.Sheep;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerItemHeldEvent;
|
||||
|
||||
import mineplex.core.common.Pair;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilFirework;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilFirework;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilTextTop;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
||||
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.GameTeam;
|
||||
import nautilus.game.arcade.game.TeamGame;
|
||||
import nautilus.game.arcade.game.games.sheep.kits.*;
|
||||
import nautilus.game.arcade.game.games.sheep.kits.KitArcher;
|
||||
import nautilus.game.arcade.game.games.sheep.kits.KitBeserker;
|
||||
import nautilus.game.arcade.game.games.sheep.kits.KitBrute;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.managers.chat.ChatStatData;
|
||||
import nautilus.game.arcade.stats.SheepDropStatTracker;
|
||||
@ -149,6 +152,16 @@ public class SheepGame extends TeamGame
|
||||
);
|
||||
}
|
||||
|
||||
public SheepGame(ArcadeManager manager, GameType type)
|
||||
{
|
||||
this(manager, new Kit[]
|
||||
{
|
||||
new KitBeserker(manager),
|
||||
new KitArcher(manager),
|
||||
new KitBrute(manager)
|
||||
}, type);
|
||||
}
|
||||
|
||||
public SheepGame(ArcadeManager manager, Kit[] kits, GameType type)
|
||||
{
|
||||
super(manager, type, kits,
|
||||
@ -752,6 +765,11 @@ public class SheepGame extends TeamGame
|
||||
{
|
||||
event.SetCancelled("True");
|
||||
}*/
|
||||
|
||||
public void setSheepDelay(long delay)
|
||||
{
|
||||
_sheepDelay = delay;
|
||||
}
|
||||
|
||||
public int getSheepCount(GameTeam team)
|
||||
{
|
||||
@ -765,4 +783,19 @@ public class SheepGame extends TeamGame
|
||||
|
||||
return score;
|
||||
}
|
||||
|
||||
public HashMap<GameTeam, ArrayList<Block>> getSheepPens()
|
||||
{
|
||||
return _sheepPens;
|
||||
}
|
||||
|
||||
public long getGameTime()
|
||||
{
|
||||
return _gameTime;
|
||||
}
|
||||
|
||||
public HashMap<GameTeam, Integer> getTeamScores()
|
||||
{
|
||||
return _teamScore;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,77 @@
|
||||
package nautilus.game.arcade.game.games.sheep.modes;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
import mineplex.core.common.Pair;
|
||||
import mineplex.core.common.util.C;
|
||||
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.games.sheep.SheepGame;
|
||||
|
||||
/**
|
||||
* SheepMania is a mode of {@link SheepGame} in which only one Sheep will spawn
|
||||
*
|
||||
* @author xXVevzZXx
|
||||
*/
|
||||
public class SheepMania extends SheepGame
|
||||
{
|
||||
|
||||
public SheepMania(ArcadeManager manager)
|
||||
{
|
||||
super(manager, GameType.Brawl);
|
||||
|
||||
setSheepDelay(GameTimeout);
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler
|
||||
public void ScoreboardUpdate(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
|
||||
if (!InProgress())
|
||||
return;
|
||||
|
||||
Scoreboard.reset();
|
||||
Scoreboard.writeNewLine();
|
||||
|
||||
Scoreboard.writeGroup(getSheepPens().keySet(), team ->
|
||||
{
|
||||
getTeamScores().put(team, getSheepCount(team));
|
||||
return Pair.create(team.GetColor() + team.GetName(), getSheepCount(team));
|
||||
}, true);
|
||||
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
long time = getGameTime()
|
||||
- (System.currentTimeMillis() - this.GetStateTime());
|
||||
|
||||
Scoreboard.writeNewLine();
|
||||
Scoreboard.write(C.cYellow + C.Bold + "Time Left");
|
||||
Scoreboard.write(UtilTime.MakeStr(Math.max(0, time), 0));
|
||||
|
||||
Scoreboard.draw();
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler
|
||||
public void SheepSpawnStart(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() == GameState.Live)
|
||||
SheepSpawn();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String GetMode()
|
||||
{
|
||||
return "Sheep Mania";
|
||||
}
|
||||
|
||||
}
|
@ -27,6 +27,7 @@ import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.hologram.Hologram;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.Game.GameState;
|
||||
@ -353,7 +354,12 @@ public class BoosterRing extends Crumbleable implements Listener
|
||||
if (i >= _sortedBorder.size())
|
||||
return;
|
||||
|
||||
_sortedBorder.get(i).getBlock().setTypeIdAndData(_material.getType().getId(), _material.getData().getData(), true);
|
||||
Block block = _sortedBorder.get(i).getBlock();
|
||||
|
||||
if (block.getType() == _material.getType() && block.getData() == _material.getData().getData())
|
||||
continue;
|
||||
|
||||
block.setTypeIdAndData(_material.getType().getId(), _material.getData().getData(), true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -469,6 +475,11 @@ public class BoosterRing extends Crumbleable implements Listener
|
||||
return false;
|
||||
}
|
||||
|
||||
public Material getType()
|
||||
{
|
||||
return _material.getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void crumbledAway()
|
||||
{
|
||||
|
@ -68,6 +68,9 @@ public class HomingArrow
|
||||
{
|
||||
if (_shooter == player)
|
||||
continue;
|
||||
|
||||
if (_host.TeamMode && _host.GetTeam(_shooter) == _host.GetTeam(player))
|
||||
continue;
|
||||
|
||||
if (!UtilPlayer.isGliding(player))
|
||||
continue;
|
||||
@ -111,6 +114,7 @@ public class HomingArrow
|
||||
arrowToPlayer.multiply(1.9);
|
||||
|
||||
UtilAction.velocity(_arrow, arrowToPlayer);
|
||||
|
||||
if (_updates % firework == 0)
|
||||
UtilFirework.playFirework(_arrow.getLocation(), Type.BALL, Color.RED, true, false);
|
||||
|
||||
|
@ -25,30 +25,30 @@ public class LootTable
|
||||
new RandomItem(Material.PORK, 30, 1, 4),
|
||||
new RandomItem(Material.ROTTEN_FLESH, 40, 1, 6),
|
||||
|
||||
new RandomItem(Material.WOOD_AXE, 80),
|
||||
new RandomItem(Material.WOOD_SWORD, 70),
|
||||
new RandomItem(Material.STONE_AXE, 60),
|
||||
new RandomItem(Material.STONE_SWORD, 30),
|
||||
new RandomItem(Material.WOOD_AXE, 100),
|
||||
new RandomItem(Material.WOOD_SWORD, 80),
|
||||
new RandomItem(Material.STONE_AXE, 70),
|
||||
new RandomItem(Material.STONE_SWORD, 50),
|
||||
new RandomItem(Material.IRON_AXE, 40),
|
||||
|
||||
new RandomItem(Material.LEATHER_BOOTS, 30),
|
||||
new RandomItem(Material.LEATHER_HELMET, 30),
|
||||
new RandomItem(Material.LEATHER_LEGGINGS, 30),
|
||||
new RandomItem(Material.LEATHER_BOOTS, 40),
|
||||
new RandomItem(Material.LEATHER_HELMET, 40),
|
||||
new RandomItem(Material.LEATHER_LEGGINGS, 40),
|
||||
|
||||
new RandomItem(Material.GOLD_BOOTS, 25),
|
||||
new RandomItem(Material.GOLD_HELMET, 25),
|
||||
new RandomItem(Material.GOLD_LEGGINGS, 25),
|
||||
new RandomItem(Material.GOLD_BOOTS, 35),
|
||||
new RandomItem(Material.GOLD_HELMET, 35),
|
||||
new RandomItem(Material.GOLD_LEGGINGS, 35),
|
||||
|
||||
new RandomItem(Material.CHAINMAIL_BOOTS, 20),
|
||||
new RandomItem(Material.CHAINMAIL_HELMET, 20),
|
||||
new RandomItem(Material.CHAINMAIL_LEGGINGS, 20),
|
||||
new RandomItem(Material.CHAINMAIL_BOOTS, 30),
|
||||
new RandomItem(Material.CHAINMAIL_HELMET, 30),
|
||||
new RandomItem(Material.CHAINMAIL_LEGGINGS, 30),
|
||||
|
||||
new RandomItem(Material.FISHING_ROD, 30),
|
||||
new RandomItem(Material.BOW, 20),
|
||||
new RandomItem(Material.ARROW, 20, 1, 3),
|
||||
new RandomItem(Material.BOW, 50),
|
||||
new RandomItem(Material.ARROW, 50, 1, 3),
|
||||
new RandomItem(Material.SNOW_BALL, 30, 1, 2),
|
||||
new RandomItem(Material.EGG, 30, 1, 2),
|
||||
|
||||
new RandomItem(Material.COMPASS, 20),
|
||||
new RandomItem(Material.STICK, 30, 1, 2),
|
||||
new RandomItem(Material.FLINT, 30, 1, 2),
|
||||
new RandomItem(Material.FEATHER, 30, 1, 2),
|
||||
@ -57,33 +57,26 @@ public class LootTable
|
||||
Material.TNT, (byte) 0, 1, F.item("Throwing TNT")), 15),
|
||||
new RandomItem(Material.MUSHROOM_SOUP, 15),
|
||||
|
||||
new RandomItem(Material.BAKED_POTATO, 30, 1, 5),
|
||||
new RandomItem(Material.MUSHROOM_SOUP, 30, 1, 1),
|
||||
new RandomItem(Material.BAKED_POTATO, 20, 1, 5),
|
||||
new RandomItem(Material.MUSHROOM_SOUP, 20, 1, 1),
|
||||
new RandomItem(Material.COOKED_BEEF, 30, 1, 3),
|
||||
new RandomItem(Material.COOKED_CHICKEN, 30, 1, 3),
|
||||
new RandomItem(Material.COOKED_FISH, 30, 1, 6),
|
||||
new RandomItem(Material.GRILLED_PORK, 30, 1, 3),
|
||||
new RandomItem(Material.GRILLED_PORK, 20, 1, 3),
|
||||
new RandomItem(Material.COOKIE, 30),
|
||||
new RandomItem(Material.PUMPKIN_PIE, 30, 1, 3),
|
||||
new RandomItem(Material.APPLE, 30, 2, 6),
|
||||
new RandomItem(Material.PUMPKIN_PIE, 20, 1, 3),
|
||||
new RandomItem(Material.APPLE, 20, 2, 6),
|
||||
|
||||
new RandomItem(Material.STONE_SWORD, 30),
|
||||
new RandomItem(Material.IRON_AXE, 30),
|
||||
new RandomItem(Material.IRON_INGOT, 30, 1, 2),
|
||||
new RandomItem(Material.DIAMOND, 30)
|
||||
);
|
||||
|
||||
public final static LootTable SUPPLY_DROP = new LootTable(
|
||||
new RandomItem(Material.DIAMOND_HELMET, 10),
|
||||
new RandomItem(Material.DIAMOND_LEGGINGS, 8),
|
||||
new RandomItem(Material.DIAMOND_BOOTS, 10),
|
||||
|
||||
new RandomItem(Material.IRON_HELMET, 30),
|
||||
new RandomItem(Material.IRON_LEGGINGS, 27),
|
||||
new RandomItem(Material.IRON_BOOTS, 30),
|
||||
new RandomItem(Material.IRON_SWORD, 24),
|
||||
new RandomItem(Material.DIAMOND_SWORD, 8),
|
||||
new RandomItem(Material.DIAMOND_AXE, 16)
|
||||
public final static LootTable SUPPLY_DROP = new LootTable(
|
||||
new RandomItem(Material.DIAMOND_HELMET, 30),
|
||||
new RandomItem(Material.DIAMOND_LEGGINGS, 27),
|
||||
new RandomItem(Material.DIAMOND_BOOTS, 30),
|
||||
new RandomItem(Material.DIAMOND_SWORD, 16),
|
||||
new RandomItem(Material.DIAMOND_AXE, 24)
|
||||
// new RandomItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD, 1, Enchantment.DAMAGE_ALL), 8),
|
||||
// new RandomItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD, 1, Enchantment.DAMAGE_ALL), 4),
|
||||
//
|
||||
|
@ -8,11 +8,8 @@ import java.util.Iterator;
|
||||
import java.util.TreeMap;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.mineplex.anticheat.checks.move.Glide;
|
||||
import com.mineplex.anticheat.checks.move.HeadRoll;
|
||||
import com.mineplex.anticheat.checks.move.Speed;
|
||||
import mineplex.core.Managers;
|
||||
import mineplex.core.antihack.AntiHack;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.FireworkEffect;
|
||||
import org.bukkit.FireworkEffect.Type;
|
||||
@ -36,7 +33,14 @@ import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import com.mineplex.anticheat.checks.move.Glide;
|
||||
import com.mineplex.anticheat.checks.move.HeadRoll;
|
||||
import com.mineplex.anticheat.checks.move.Speed;
|
||||
|
||||
import mineplex.core.Managers;
|
||||
import mineplex.core.antihack.AntiHack;
|
||||
import mineplex.core.common.MinecraftVersion;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
@ -54,18 +58,16 @@ import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilTime.TimeUnit;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
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.game.GameTeam;
|
||||
import nautilus.game.arcade.game.SoloGame;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.games.skyfall.kits.KitAeronaught;
|
||||
import nautilus.game.arcade.game.games.skyfall.kits.KitBooster;
|
||||
import nautilus.game.arcade.game.games.skyfall.kits.KitDeadeye;
|
||||
import nautilus.game.arcade.game.games.skyfall.kits.KitJouster;
|
||||
import nautilus.game.arcade.game.games.skyfall.kits.KitSpeeder;
|
||||
@ -79,17 +81,16 @@ import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.stats.FirstSupplyDropOpenStatTracker;
|
||||
import nautilus.game.arcade.stats.KillsWithinTimeLimitStatTracker;
|
||||
import nautilus.game.arcade.stats.WinWithoutWearingArmorStatTracker;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
|
||||
/**
|
||||
* GameObject of the game Skyfall
|
||||
*
|
||||
* @author xXVevzZXx
|
||||
*/
|
||||
public class Skyfall extends SoloGame
|
||||
public abstract class Skyfall extends Game
|
||||
{
|
||||
private static final long MAP_CRUMBLE_DELAY = 1000*30; // 30 Seconds
|
||||
private static final long CHEST_REFILL_TIME = 1000*60*6; // 5 minutes
|
||||
private static final long CHEST_REFILL_TIME = 1000*60*3; // 3 minutes
|
||||
private static final long CHEST_REFILL_ANNOUNCE_TIME = 1000*60*3; // 3 minutes
|
||||
private static final int BIG_ISLAND_BOUNDS = 30;
|
||||
private static final int BIG_ISLAND_HEIGHT = 40;
|
||||
@ -103,9 +104,11 @@ public class Skyfall extends SoloGame
|
||||
|
||||
private static final long BOOSTER_COOLDOWN_TIME = 1000*20; // 20 Seconds
|
||||
|
||||
private static final long SUPPLY_DROP_TIME = 1000*60*4; // 5 Minutes
|
||||
private static final long SUPPLY_DROP_TIME = 1000*60*5; // 5 Minutes
|
||||
private static final long DEATHMATCH_START_TIME = 1000*30; // 30 Seconds
|
||||
private static final long DEATHMATCH_WAIT_TIME = 1000*10; // 10 Seconds
|
||||
|
||||
private static final int TNT_EXPLOSION_RADIUS = 14;
|
||||
|
||||
private static final long EAT_RECHARGE = 500; // 0.5 Second
|
||||
|
||||
@ -137,15 +140,14 @@ public class Skyfall extends SoloGame
|
||||
private boolean _teleportedDeathmatch;
|
||||
private long _deathMatchStartTime;
|
||||
|
||||
private boolean _crumbleRings;
|
||||
private boolean _refillAnnounced;
|
||||
|
||||
private int _currentCrumble = 300;
|
||||
private boolean _supplyOpened;
|
||||
|
||||
public Skyfall(ArcadeManager manager)
|
||||
public Skyfall(ArcadeManager manager, GameType type)
|
||||
{
|
||||
super(manager, GameType.Skyfall,
|
||||
super(manager, type,
|
||||
|
||||
new Kit[]
|
||||
{
|
||||
@ -198,7 +200,6 @@ public class Skyfall extends SoloGame
|
||||
|
||||
PrepareFreeze = true;
|
||||
AnnounceStay = false;
|
||||
HideTeamSheep = true;
|
||||
DeathDropItems = true;
|
||||
QuitDropItems = true;
|
||||
DamageSelf = true;
|
||||
@ -213,10 +214,14 @@ public class Skyfall extends SoloGame
|
||||
InventoryOpenChest = true;
|
||||
DamageFall = false;
|
||||
SoupEnabled = true;
|
||||
ReplaceTeamsWithKits = true;
|
||||
StrictAntiHack = false;
|
||||
<<<<<<< HEAD
|
||||
|
||||
new CompassModule().register(this);
|
||||
=======
|
||||
CompassEnabled = true;
|
||||
CompassGiveItem = false;
|
||||
>>>>>>> refs/remotes/origin/develop
|
||||
|
||||
SpeedMeasurement = true;
|
||||
|
||||
@ -224,63 +229,6 @@ public class Skyfall extends SoloGame
|
||||
_islandHeight = 15;
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler
|
||||
public void ScoreboardUpdate(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
|
||||
if (GetTeamList().isEmpty())
|
||||
return;
|
||||
|
||||
Scoreboard.reset();
|
||||
|
||||
GameTeam team = GetTeamList().get(0);
|
||||
|
||||
if (IsLive())
|
||||
{
|
||||
Scoreboard.writeNewLine();
|
||||
Scoreboard.write(C.cGreen + C.Bold + "Time");
|
||||
Scoreboard.write(UtilTime.convertString(System.currentTimeMillis() - GetStateTime(), 0, TimeUnit.FIT));
|
||||
Scoreboard.writeNewLine();
|
||||
}
|
||||
|
||||
Scoreboard.write(C.cYellow + C.Bold + "Players");
|
||||
if (team.GetPlayers(true).size() > 7)
|
||||
{
|
||||
Scoreboard.write("" + team.GetPlayers(true).size());
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Player player : team.GetPlayers(true))
|
||||
{
|
||||
Scoreboard.write(C.cWhite + player.getName());
|
||||
}
|
||||
}
|
||||
|
||||
if (IsLive() && !_deathmatch)
|
||||
{
|
||||
Scoreboard.writeNewLine();
|
||||
Scoreboard.write(C.cGold + C.Bold + "Chest Refill");
|
||||
Scoreboard.write(C.cWhite + UtilTime.MakeStr((_chestsRefilled + CHEST_REFILL_TIME) - System.currentTimeMillis()));
|
||||
}
|
||||
else if (_deathmatch && !_deathMatchStarted)
|
||||
{
|
||||
Scoreboard.writeNewLine();
|
||||
Scoreboard.write(C.cRed + C.Bold + "Deathmatch");
|
||||
Scoreboard.write(F.time(UtilTime.MakeStr(_teleportedDeathmatch ? (_deathMatchStartTime + DEATHMATCH_START_TIME + DEATHMATCH_WAIT_TIME) - System.currentTimeMillis() : (_deathMatchStartTime + DEATHMATCH_START_TIME) - System.currentTimeMillis())));
|
||||
}
|
||||
else if (_deathMatchStarted)
|
||||
{
|
||||
Scoreboard.writeNewLine();
|
||||
Scoreboard.write(C.cRed + C.Bold + "Game End");
|
||||
Scoreboard.write(UtilTime.convertString(Math.max(0, (GetStateTime() + GameTimeout) - System.currentTimeMillis()), 0, TimeUnit.FIT));
|
||||
}
|
||||
|
||||
Scoreboard.draw();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void gameStart(GameStateChangeEvent event)
|
||||
{
|
||||
@ -292,6 +240,17 @@ public class Skyfall extends SoloGame
|
||||
{
|
||||
spawn.clone().subtract(0, 1, 0).getBlock().setType(Material.AIR);
|
||||
}
|
||||
|
||||
for (Player player : GetPlayers(true))
|
||||
{
|
||||
ItemStack stack = new ItemStack(Material.COMPASS);
|
||||
|
||||
ItemMeta itemMeta = stack.getItemMeta();
|
||||
itemMeta.setDisplayName(C.cGreen + C.Bold + "Tracking Compass");
|
||||
stack.setItemMeta(itemMeta);
|
||||
|
||||
player.getInventory().addItem(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -366,7 +325,6 @@ public class Skyfall extends SoloGame
|
||||
{
|
||||
Announce(C.cGreenB + "As time passes, the world begins to rot...", true);
|
||||
_crumbleAnnounced = true;
|
||||
_crumbleRings = true;
|
||||
}
|
||||
|
||||
for (Island island : islandCrumble())
|
||||
@ -521,7 +479,6 @@ public class Skyfall extends SoloGame
|
||||
Location loc = UtilAlg.getLocationNearPlayers(_deathMatchSpawns, GetPlayers(true), GetPlayers(true));
|
||||
player.teleport(loc);
|
||||
}
|
||||
_crumbleRings = true;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -530,9 +487,6 @@ public class Skyfall extends SoloGame
|
||||
if (event.getType() != UpdateType.FASTER)
|
||||
return;
|
||||
|
||||
if (!_crumbleRings)
|
||||
return;
|
||||
|
||||
for (BoosterRing ring : _boosterRings)
|
||||
{
|
||||
if (ring.getMiddle().getBlockY() < _currentCrumble)
|
||||
@ -580,6 +534,7 @@ public class Skyfall extends SoloGame
|
||||
Announce(C.cYellow + C.Bold + "Supply Drop Incoming");
|
||||
_supplyEffect = _supplyDrop.clone();
|
||||
_supplyEffect.setY(250);
|
||||
_supplyDrop.getBlock().getRelative(BlockFace.DOWN).setType(Material.GLASS);
|
||||
_supplyDrop.getBlock().getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN).setType(Material.BEACON);
|
||||
for (int x = -1; x <= 1; x++)
|
||||
for (int z = -1; z <= 1; z++)
|
||||
@ -910,6 +865,9 @@ public class Skyfall extends SoloGame
|
||||
{
|
||||
if (!IsLive())
|
||||
UtilPlayer.removeWorldBorder(player);
|
||||
|
||||
if (!IsAlive(player))
|
||||
UtilPlayer.removeWorldBorder(player);
|
||||
|
||||
if (player.getInventory().getChestplate() == null)
|
||||
continue;
|
||||
@ -942,18 +900,16 @@ public class Skyfall extends SoloGame
|
||||
|
||||
@EventHandler
|
||||
public void TNTExplosion(ExplosionPrimeEvent event)
|
||||
{
|
||||
{
|
||||
if (!_tntMap.containsKey(event.getEntity()))
|
||||
return;
|
||||
|
||||
Player player = _tntMap.remove(event.getEntity());
|
||||
|
||||
for (Player other : UtilPlayer.getNearby(event.getEntity()
|
||||
.getLocation(), 14))
|
||||
Manager.GetCondition()
|
||||
.Factory()
|
||||
.Explosion("Throwing TNT", other, player, 50, 0.1, false,
|
||||
false);
|
||||
for (Player other : UtilPlayer.getNearby(event.getEntity().getLocation(), TNT_EXPLOSION_RADIUS))
|
||||
Manager.GetCondition().Factory().Explosion("Throwing TNT", other, player, 50, 0.1, false, false);
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -1064,7 +1020,7 @@ public class Skyfall extends SoloGame
|
||||
{
|
||||
if (player.getInventory().getChestplate() != null)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", C.cRed + "You're Elytra is disabled!"));
|
||||
UtilPlayer.message(player, F.main("Game", C.cRed + "Your Elytra is disabled!"));
|
||||
}
|
||||
player.getInventory().setChestplate(null);
|
||||
}
|
||||
@ -1072,6 +1028,46 @@ public class Skyfall extends SoloGame
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isDeathMatch()
|
||||
{
|
||||
return _deathmatch;
|
||||
}
|
||||
|
||||
public boolean isDeathMatchStarted()
|
||||
{
|
||||
return _deathMatchStarted;
|
||||
}
|
||||
|
||||
public boolean isTeleportedDeathmatch()
|
||||
{
|
||||
return _teleportedDeathmatch;
|
||||
}
|
||||
|
||||
public long getDeathmatchStartTime()
|
||||
{
|
||||
return _deathMatchStartTime;
|
||||
}
|
||||
|
||||
public long getChestsRefilled()
|
||||
{
|
||||
return _chestsRefilled;
|
||||
}
|
||||
|
||||
public long getChestRefillTime()
|
||||
{
|
||||
return CHEST_REFILL_TIME;
|
||||
}
|
||||
|
||||
public long getDeathmatchStartingTime()
|
||||
{
|
||||
return DEATHMATCH_START_TIME;
|
||||
}
|
||||
|
||||
public long getDeathmatchWaitTime()
|
||||
{
|
||||
return DEATHMATCH_WAIT_TIME;
|
||||
}
|
||||
|
||||
private class IslandSorter implements Comparator<Island>
|
||||
{
|
||||
private HashMap<Island, Integer> _map;
|
||||
|
@ -0,0 +1,178 @@
|
||||
package nautilus.game.arcade.game.games.skyfall;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilTime.TimeUnit;
|
||||
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.Game.GameState;
|
||||
|
||||
/**
|
||||
* SoloSkyfall
|
||||
*
|
||||
* @author xXVevzZXx
|
||||
*/
|
||||
public class SoloSkyfall extends Skyfall
|
||||
{
|
||||
private GameTeam _players;
|
||||
|
||||
public SoloSkyfall(ArcadeManager manager)
|
||||
{
|
||||
super(manager, GameType.Skyfall);
|
||||
|
||||
this.DamageTeamSelf = true;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void CustomTeamGeneration(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Recruit)
|
||||
return;
|
||||
|
||||
_players = GetTeamList().get(0);
|
||||
_players.SetColor(ChatColor.YELLOW);
|
||||
_players.SetName("Players");
|
||||
_players.setDisplayName(C.cYellow + C.Bold + "Players");
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler
|
||||
public void ScoreboardUpdate(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
|
||||
if (GetTeamList().isEmpty())
|
||||
return;
|
||||
|
||||
Scoreboard.reset();
|
||||
|
||||
GameTeam team = GetTeamList().get(0);
|
||||
|
||||
if (IsLive())
|
||||
{
|
||||
Scoreboard.writeNewLine();
|
||||
Scoreboard.write(C.cGreen + C.Bold + "Time");
|
||||
Scoreboard.write(UtilTime.convertString(System.currentTimeMillis() - GetStateTime(), 0, TimeUnit.FIT));
|
||||
Scoreboard.writeNewLine();
|
||||
}
|
||||
|
||||
Scoreboard.write(C.cYellow + C.Bold + "Players");
|
||||
if (team.GetPlayers(true).size() > 7)
|
||||
{
|
||||
Scoreboard.write("" + team.GetPlayers(true).size());
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Player player : team.GetPlayers(true))
|
||||
{
|
||||
Scoreboard.write(C.cWhite + player.getName());
|
||||
}
|
||||
}
|
||||
|
||||
if (IsLive() && !isDeathMatch())
|
||||
{
|
||||
Scoreboard.writeNewLine();
|
||||
Scoreboard.write(C.cGold + C.Bold + "Chest Refill");
|
||||
Scoreboard.write(C.cWhite + UtilTime.MakeStr((getChestsRefilled() + getChestRefillTime()) - System.currentTimeMillis()));
|
||||
}
|
||||
else if (isDeathMatch() && !isDeathMatchStarted())
|
||||
{
|
||||
Scoreboard.writeNewLine();
|
||||
Scoreboard.write(C.cRed + C.Bold + "Deathmatch");
|
||||
Scoreboard.write(F.time(UtilTime.MakeStr(isTeleportedDeathmatch() ? (getDeathmatchStartTime() + getDeathmatchStartingTime() + getDeathmatchWaitTime()) - System.currentTimeMillis() : (getDeathmatchStartTime() + getDeathmatchStartingTime()) - System.currentTimeMillis())));
|
||||
}
|
||||
else if (isDeathMatchStarted())
|
||||
{
|
||||
Scoreboard.writeNewLine();
|
||||
Scoreboard.write(C.cRed + C.Bold + "Game End");
|
||||
Scoreboard.write(UtilTime.convertString(Math.max(0, (GetStateTime() + GameTimeout) - System.currentTimeMillis()), 0, TimeUnit.FIT));
|
||||
}
|
||||
|
||||
Scoreboard.draw();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void EndCheck()
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
if (GetPlayers(true).size() <= 1)
|
||||
{
|
||||
ArrayList<Player> places = GetTeamList().get(0).GetPlacements(true);
|
||||
|
||||
//Announce
|
||||
AnnounceEnd(places);
|
||||
|
||||
//Gems
|
||||
if (places.size() >= 1)
|
||||
AddGems(places.get(0), 20, "1st Place", false, false);
|
||||
|
||||
if (places.size() >= 2)
|
||||
AddGems(places.get(1), 15, "2nd Place", false, false);
|
||||
|
||||
if (places.size() >= 3)
|
||||
AddGems(places.get(2), 10, "3rd Place", false, false);
|
||||
|
||||
for (Player player : GetPlayers(false))
|
||||
if (player.isOnline())
|
||||
AddGems(player, 10, "Participation", false, false);
|
||||
|
||||
//End
|
||||
SetState(GameState.End);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Player> getWinners()
|
||||
{
|
||||
if (GetState().ordinal() >= GameState.End.ordinal())
|
||||
{
|
||||
List<Player> places = GetTeamList().get(0).GetPlacements(true);
|
||||
|
||||
if (places.isEmpty() || !places.get(0).isOnline())
|
||||
return Arrays.asList();
|
||||
else
|
||||
return Arrays.asList(places.get(0));
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Player> getLosers()
|
||||
{
|
||||
List<Player> winners = getWinners();
|
||||
|
||||
if (winners == null)
|
||||
return null;
|
||||
|
||||
List<Player> losers = GetTeamList().get(0).GetPlayers(false);
|
||||
|
||||
losers.removeAll(winners);
|
||||
|
||||
return losers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String GetMode()
|
||||
{
|
||||
return "Solo Mode";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,190 @@
|
||||
package nautilus.game.arcade.game.games.skyfall;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilTime.TimeUnit;
|
||||
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.game.GameTeam;
|
||||
import nautilus.game.arcade.game.modules.TeamModule;
|
||||
|
||||
/**
|
||||
* TeamSkyfall
|
||||
*
|
||||
* @author xXVevzZXx
|
||||
*/
|
||||
public class TeamSkyfall extends Skyfall
|
||||
{
|
||||
|
||||
public TeamSkyfall(ArcadeManager manager)
|
||||
{
|
||||
super(manager, GameType.SkyfallTeams);
|
||||
|
||||
PlayersPerTeam = 2;
|
||||
FillTeamsInOrderToCount = 2;
|
||||
|
||||
SpawnNearAllies = true;
|
||||
SpawnNearEnemies = true;
|
||||
|
||||
DamageTeamSelf = false;
|
||||
|
||||
DontAllowOverfill = true;
|
||||
TeamMode = true;
|
||||
|
||||
HideTeamSheep = true;
|
||||
|
||||
registerModule(new TeamModule());
|
||||
}
|
||||
|
||||
@Override
|
||||
@EventHandler
|
||||
public void ScoreboardUpdate(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
|
||||
if (GetTeamList().isEmpty())
|
||||
return;
|
||||
|
||||
Scoreboard.reset();
|
||||
|
||||
if (IsLive())
|
||||
{
|
||||
Scoreboard.writeNewLine();
|
||||
Scoreboard.write(C.cGreen + C.Bold + "Time");
|
||||
Scoreboard.write(UtilTime.convertString(System.currentTimeMillis() - GetStateTime(), 0, TimeUnit.FIT));
|
||||
Scoreboard.writeNewLine();
|
||||
}
|
||||
|
||||
Scoreboard.write(C.cYellow + C.Bold + "Teams");
|
||||
|
||||
ArrayList<GameTeam> alive = new ArrayList<GameTeam>();
|
||||
for (GameTeam team : GetTeamList())
|
||||
{
|
||||
if (team.IsTeamAlive())
|
||||
alive.add(team);
|
||||
}
|
||||
|
||||
if (GetPlayers(true).size() <= 7)
|
||||
{
|
||||
for (GameTeam team : GetTeamList())
|
||||
{
|
||||
for (Player player : team.GetPlayers(true))
|
||||
{
|
||||
Scoreboard.write(team.GetColor() + player.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (alive.size() <= 7)
|
||||
{
|
||||
for (GameTeam team : alive)
|
||||
{
|
||||
Scoreboard.write(C.cWhite + team.GetPlayers(true).size() + " " + team.GetColor() + team.GetName());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Scoreboard.write(C.cWhite + alive.size() + " Alive");
|
||||
}
|
||||
|
||||
if (IsLive() && !isDeathMatch())
|
||||
{
|
||||
Scoreboard.writeNewLine();
|
||||
Scoreboard.write(C.cGold + C.Bold + "Chest Refill");
|
||||
Scoreboard.write(C.cWhite + UtilTime.MakeStr((getChestsRefilled() + getChestRefillTime()) - System.currentTimeMillis()));
|
||||
}
|
||||
else if (isDeathMatch() && !isDeathMatchStarted())
|
||||
{
|
||||
Scoreboard.writeNewLine();
|
||||
Scoreboard.write(C.cRed + C.Bold + "Deathmatch");
|
||||
Scoreboard.write(F.time(UtilTime.MakeStr(isTeleportedDeathmatch() ? (getDeathmatchStartTime() + getDeathmatchStartingTime() + getDeathmatchWaitTime()) - System.currentTimeMillis() : (getDeathmatchStartTime() + getDeathmatchStartingTime()) - System.currentTimeMillis())));
|
||||
}
|
||||
else if (isDeathMatchStarted())
|
||||
{
|
||||
Scoreboard.writeNewLine();
|
||||
Scoreboard.write(C.cRed + C.Bold + "Game End");
|
||||
Scoreboard.write(UtilTime.convertString(Math.max(0, (GetStateTime() + GameTimeout) - System.currentTimeMillis()), 0, TimeUnit.FIT));
|
||||
}
|
||||
|
||||
Scoreboard.draw();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void EndCheck()
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
ArrayList<GameTeam> teamsAlive = new ArrayList<GameTeam>();
|
||||
|
||||
for (GameTeam team : GetTeamList())
|
||||
if (team.GetPlayers(true).size() > 0)
|
||||
teamsAlive.add(team);
|
||||
|
||||
if (teamsAlive.size() <= 1)
|
||||
{
|
||||
//Announce
|
||||
if (teamsAlive.size() > 0)
|
||||
AnnounceEnd(teamsAlive.get(0));
|
||||
|
||||
for (GameTeam team : GetTeamList())
|
||||
{
|
||||
if (WinnerTeam != null && team.equals(WinnerTeam))
|
||||
{
|
||||
for (Player player : team.GetPlayers(false))
|
||||
AddGems(player, 10, "Winning Team", false, false);
|
||||
}
|
||||
|
||||
for (Player player : team.GetPlayers(false))
|
||||
if (player.isOnline())
|
||||
AddGems(player, 10, "Participation", false, false);
|
||||
}
|
||||
|
||||
//End
|
||||
SetState(GameState.End);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Player> getWinners()
|
||||
{
|
||||
if (WinnerTeam == null)
|
||||
return null;
|
||||
|
||||
return WinnerTeam.GetPlayers(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Player> getLosers()
|
||||
{
|
||||
if (WinnerTeam == null)
|
||||
return null;
|
||||
|
||||
List<Player> players = new ArrayList<>();
|
||||
|
||||
for (GameTeam team : GetTeamList())
|
||||
{
|
||||
if (team != WinnerTeam)
|
||||
players.addAll(team.GetPlayers(false));
|
||||
}
|
||||
|
||||
return players;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String GetMode()
|
||||
{
|
||||
return "Team Mode";
|
||||
}
|
||||
|
||||
}
|
@ -6,6 +6,7 @@ import org.bukkit.event.EventHandler;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
/**
|
||||
|
@ -13,6 +13,7 @@ import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
import nautilus.game.arcade.game.games.skyfall.HomingArrow;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
@ -53,7 +54,7 @@ public class PerkDeadeye extends Perk
|
||||
return;
|
||||
|
||||
Player shooter = (Player) event.getEntity();
|
||||
|
||||
|
||||
if (!hasPerk(shooter))
|
||||
return;
|
||||
|
||||
|
@ -45,6 +45,9 @@ public class PerkElytraKnockback extends Perk
|
||||
if (!UtilPlayer.isGliding(player))
|
||||
return;
|
||||
|
||||
if (Manager.GetGame().TeamMode && Manager.GetGame().GetTeam(player) == Manager.GetGame().GetTeam(event.GetDamageePlayer()))
|
||||
return;
|
||||
|
||||
event.AddKnockback("Kit Effect", event.getKnockbackValue()*2);
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
|
||||
import nautilus.game.arcade.game.games.skyfall.BoosterRing;
|
||||
import nautilus.game.arcade.game.games.skyfall.PlayerBoostRingEvent;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
@ -36,6 +37,8 @@ public class PerkIncreaseBoosters extends Perk
|
||||
if (!hasPerk(player))
|
||||
return;
|
||||
|
||||
player.sendMessage("Increasing strength of booster ring to " + _strength + " for " + player.getName());
|
||||
|
||||
event.multiplyStrength(_strength);
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
/**
|
||||
@ -59,7 +60,10 @@ public class PerkRemoveElytra extends Perk
|
||||
if (!hasPerk(player))
|
||||
return;
|
||||
|
||||
Recharge.Instance.useForce(player, "Elytra Removal", _duration, true);
|
||||
if (Manager.GetGame().TeamMode && Manager.GetGame().GetTeam(player) == Manager.GetGame().GetTeam(event.GetDamageePlayer()))
|
||||
return;
|
||||
|
||||
Recharge.Instance.useForce(event.GetDamageePlayer(), "Elytra Removal", _duration, true);
|
||||
_disabled.put(event.GetDamageePlayer().getUniqueId(), System.currentTimeMillis() + _duration);
|
||||
}
|
||||
|
||||
@ -84,7 +88,7 @@ public class PerkRemoveElytra extends Perk
|
||||
{
|
||||
if (player.getInventory().getChestplate() != null)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", C.cRed + "You're Elytra is disabled!"));
|
||||
UtilPlayer.message(player, F.main("Game", C.cRed + "Your Elytra is disabled!"));
|
||||
}
|
||||
player.getInventory().setChestplate(null);
|
||||
}
|
||||
|
@ -73,6 +73,7 @@ import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.combat.CombatComponent;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
@ -85,7 +86,11 @@ import nautilus.game.arcade.game.games.skywars.kits.KitEarth;
|
||||
import nautilus.game.arcade.game.games.skywars.kits.KitFire;
|
||||
import nautilus.game.arcade.game.games.skywars.kits.KitIce;
|
||||
import nautilus.game.arcade.game.games.skywars.kits.KitMetal;
|
||||
<<<<<<< HEAD
|
||||
import nautilus.game.arcade.game.modules.compass.CompassModule;
|
||||
=======
|
||||
import nautilus.game.arcade.game.games.skywars.modes.kits.KitElementalist;
|
||||
>>>>>>> refs/remotes/origin/develop
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.ore.OreHider;
|
||||
|
||||
@ -520,7 +525,7 @@ public abstract class Skywars extends Game
|
||||
|
||||
for (Player player : GetPlayers(true))
|
||||
{
|
||||
if (GetKit(player) instanceof KitAir)
|
||||
if (GetKit(player) instanceof KitAir || GetKit(player) instanceof KitElementalist)
|
||||
{
|
||||
player.sendMessage(F.main("Game", "Your " + F.skill("Leap") + " is on a 30 second cooldown."));
|
||||
Recharge.Instance.use(player, "Leap", 30000, true, false);
|
||||
|
@ -0,0 +1,29 @@
|
||||
package nautilus.game.arcade.game.games.skywars.modes;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.game.games.skywars.Skywars;
|
||||
import nautilus.game.arcade.game.games.skywars.SoloSkywars;
|
||||
import nautilus.game.arcade.game.games.skywars.modes.kits.KitElementalist;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
|
||||
/**
|
||||
* Elementalist is a mode of {@link Skywars} which combines all kits to one
|
||||
*
|
||||
* @author xXVevzZXx
|
||||
*/
|
||||
public class Elementalist extends SoloSkywars
|
||||
{
|
||||
|
||||
public Elementalist(ArcadeManager manager)
|
||||
{
|
||||
super(manager, new Kit[]{new KitElementalist(manager)}, GameType.Brawl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String GetMode()
|
||||
{
|
||||
return "Elementalist";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package nautilus.game.arcade.game.games.skywars.modes.kits;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.itemstack.ItemBuilder;
|
||||
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.game.games.skywars.Skywars;
|
||||
import nautilus.game.arcade.game.games.skywars.modes.Elementalist;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.ProgressingKit;
|
||||
import nautilus.game.arcade.kit.perks.PerkDirtCannon;
|
||||
import nautilus.game.arcade.kit.perks.PerkDoubleJump;
|
||||
import nautilus.game.arcade.kit.perks.PerkFireBurst;
|
||||
import nautilus.game.arcade.kit.perks.PerkIceBridge;
|
||||
import nautilus.game.arcade.kit.perks.PerkKnockback;
|
||||
import nautilus.game.arcade.kit.perks.PerkMagnetism;
|
||||
import nautilus.game.arcade.kit.perks.PerkVoidSaver;
|
||||
|
||||
/**
|
||||
* KitElementalist is a kit for the Brawl mode {@link Elementalist} which combines all {@link Skywars} kits
|
||||
*
|
||||
* @author xXVevzZXx
|
||||
*/
|
||||
public class KitElementalist extends ProgressingKit
|
||||
{
|
||||
private static final String DOUBLE_JUMP = "Leap";
|
||||
|
||||
private static final String[] DESCRIPTION = {
|
||||
"You have the power of a true Elementalist which can",
|
||||
"use all sorts of Elements for their own use"
|
||||
};
|
||||
|
||||
private static final Perk[] PERKS =
|
||||
{
|
||||
new PerkVoidSaver(),
|
||||
new PerkDoubleJump(DOUBLE_JUMP, 1.2, 1, true, 27000, true),
|
||||
new PerkDirtCannon(1.5),
|
||||
new PerkKnockback(0.75, true),
|
||||
new PerkFireBurst(35000, 4, 6),
|
||||
new PerkIceBridge(25000, 6000),
|
||||
//new PerkMagnetism(15000, 10, 1.5)
|
||||
};
|
||||
|
||||
private static final ItemStack[] PLAYER_ITEMS =
|
||||
{
|
||||
new ItemStack(Material.WOOD_SWORD), new ItemBuilder(Material.EYE_OF_ENDER).setTitle(C.cGreen + "Eye of Ender").build(),
|
||||
//new ItemStack(Material.WOOD_SPADE),
|
||||
new ItemBuilder(Material.BLAZE_ROD).setTitle(C.cGreen + "Fire Burst").build(),
|
||||
new ItemBuilder(Material.ICE).setTitle(C.cGreen + "Ice Bridge").build(),
|
||||
};
|
||||
|
||||
private static final ItemStack IN_HAND = new ItemStack(Material.EYE_OF_ENDER);
|
||||
|
||||
public KitElementalist(ArcadeManager manager)
|
||||
{
|
||||
super(manager, "Avatar", "avatar", KitAvailability.Free, DESCRIPTION, PERKS, EntityType.SKELETON, IN_HAND);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
{
|
||||
player.getInventory().addItem(PLAYER_ITEMS);
|
||||
}
|
||||
|
||||
}
|
@ -330,7 +330,7 @@ public class PerkBarrage extends SmashPerk
|
||||
{
|
||||
if (_remove)
|
||||
{
|
||||
if (_arrows.remove(event.getEntity().getUniqueId()))
|
||||
if (_arrows.remove(event.getEntity()))
|
||||
{
|
||||
event.getEntity().remove();
|
||||
}
|
||||
|
@ -26,13 +26,17 @@ import org.bukkit.event.player.PlayerInteractEvent;
|
||||
public class PerkApple extends Perk implements IThrown
|
||||
{
|
||||
|
||||
public PerkApple()
|
||||
private long _spawnDelay;
|
||||
|
||||
public PerkApple(long delay)
|
||||
{
|
||||
super("Apple Thrower", new String[]
|
||||
{
|
||||
C.cGray + "Receive 1 Apple every 10 seconds",
|
||||
C.cYellow + "Left-Click" + C.cGray + " with Apple to " + C.cGreen + "Throw Apple",
|
||||
});
|
||||
|
||||
_spawnDelay = delay;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -52,7 +56,7 @@ public class PerkApple extends Perk implements IThrown
|
||||
if (!Manager.GetGame().IsAlive(player))
|
||||
continue;
|
||||
|
||||
if (!Recharge.Instance.use(player, getMessage(player), 10000, false, false))
|
||||
if (!Recharge.Instance.use(player, getMessage(player), _spawnDelay, false, false))
|
||||
continue;
|
||||
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(getMaterial(player)));
|
||||
|
@ -8,6 +8,8 @@ import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@ -98,6 +100,20 @@ public class PerkHorsePet extends Perk
|
||||
horse.getWorld().playSound(horse.getLocation(), Sound.HORSE_ANGRY, 2f, 1f);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onGameEnd(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() == Game.GameState.End)
|
||||
{
|
||||
// Players alive at the end of the game don't die, so their horse sticks around.
|
||||
// We need to iterate through them just in case they have a horse to kill.
|
||||
for(Player player : event.GetGame().GetPlayers(true))
|
||||
{
|
||||
this.despawnHorse(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void horseUpdate(UpdateEvent event)
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ public class GamePlayerManager implements Listener
|
||||
}
|
||||
for (Player player : Manager.GetGame().GetPlayers(true))
|
||||
{
|
||||
if (!Manager.GetCondition().HasCondition(player, ConditionType.INVISIBILITY) && Manager.GetGame().IsAlive(player) && !UtilPlayer.isSpectator(player))
|
||||
if (!Manager.GetCondition().HasCondition(player, ConditionType.INVISIBILITY) && !Manager.GetCondition().HasCondition(player, ConditionType.CLOAK) && Manager.GetGame().IsAlive(player) && !UtilPlayer.isSpectator(player))
|
||||
{
|
||||
for (Player viewer : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
|
@ -4,17 +4,18 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
|
||||
public class WinWithoutWearingArmorStatTracker extends StatTracker<Game>
|
||||
{
|
||||
private final Set<String> _wearing = new HashSet<String>();
|
||||
@ -41,7 +42,7 @@ public class WinWithoutWearingArmorStatTracker extends StatTracker<Game>
|
||||
|
||||
for (ItemStack armor : player.getInventory().getArmorContents())
|
||||
{
|
||||
if (armor != null && armor.getType() != Material.AIR)
|
||||
if (armor != null && armor.getType() != Material.AIR && armor.getType() != Material.ELYTRA)
|
||||
{
|
||||
_wearing.add(player.getUniqueId().toString());
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user