Merge remote-tracking branch 'refs/remotes/origin/develop' into feature/moba

This commit is contained in:
Sam 2017-05-20 17:45:19 +01:00
commit 1db7454e81
159 changed files with 3980 additions and 1831 deletions

View File

@ -694,9 +694,9 @@ public class UtilEnt
return ent.isOnGround();
}
AxisAlignedBB box = ((CraftEntity)ent).getHandle().getBoundingBox().shrink(0.05, 0, 0.05);
Location bottom_corner_1 = new Location(ent.getWorld(), box.a, ent.getLocation().getY()-0.05, box.c);
Location bottom_corner_2 = new Location(ent.getWorld(), box.d, ent.getLocation().getY()-0.05, box.f);
AxisAlignedBB box = ((CraftEntity)ent).getHandle().getBoundingBox();
Location bottom_corner_1 = new Location(ent.getWorld(), box.a, ent.getLocation().getY()-0.1, box.c);
Location bottom_corner_2 = new Location(ent.getWorld(), box.d, ent.getLocation().getY()-0.1, box.f);
for(Block b : UtilBlock.getInBoundingBox(bottom_corner_1, bottom_corner_2)){
if(UtilBlock.solid(b)) return true;

View File

@ -68,7 +68,6 @@ import mineplex.core.antihack.commands.AnticheatOnCommand;
import mineplex.core.antihack.commands.DetailedMessagesCommand;
import mineplex.core.antihack.commands.GetVlsCommand;
import mineplex.core.antihack.commands.TestBanCommand;
import mineplex.core.antihack.compedaccount.CompromisedAccountManager;
import mineplex.core.antihack.gep.GwenExtremePrejudice;
import mineplex.core.antihack.guardians.GuardianManager;
import mineplex.core.antihack.logging.AntihackLogger;
@ -150,8 +149,6 @@ public class AntiHack extends MiniPlugin
private BanWaveManager _banWaveManager;
private final CompromisedAccountManager _compromisedAccountManager;
private AntiHack()
{
super("AntiHack");
@ -160,7 +157,6 @@ public class AntiHack extends MiniPlugin
require(GuardianManager.class);
_banWaveManager = require(BanWaveManager.class);
_compromisedAccountManager = require(CompromisedAccountManager.class);
Bukkit.getServicesManager().register(MineplexLink.class, new MineplexLinkImpl(), this._plugin, ServicePriority.Normal);
@ -205,7 +201,7 @@ public class AntiHack extends MiniPlugin
runSync(() -> _banned.remove(uuid));
}
public void doBan(Player player, Class<? extends Check> cause, boolean gep)
public void doBan(Player player, Class<? extends Check> cause, boolean gep, int hoursBanned)
{
runSync(() ->
{
@ -214,7 +210,7 @@ public class AntiHack extends MiniPlugin
CoreClient coreClient = _clientManager.Get(player);
String id = generateId();
String finalMessage = "[GWEN Cheat Detection]\n\nToken: " + id;
String finalMessage = "[GWEN Cheat Detection]\n\nBan Token:\n" + org.bukkit.ChatColor.GRAY + id;
JsonObject custom = new JsonObject();
custom.addProperty("ban-reason", CheckManager.getCheckSimpleName(cause));
if (gep)
@ -231,9 +227,7 @@ public class AntiHack extends MiniPlugin
new GwenBanNotification(_thisServer, player.getName(), player.getUniqueId().toString(), coreClient.GetRank().name(), CheckManager.getCheckSimpleName(cause), id, gep).publish();
});
_compromisedAccountManager.submitImmediateBan(player);
_punish.AddPunishment(coreClient.getName(), Category.Hacking, finalMessage, AntiHack.NAME, 3, true, getDaysBanned(player, cause), true, after);
_punish.AddPunishment(coreClient.getName(), Category.Hacking, finalMessage, AntiHack.NAME, 3, true, hoursBanned, true, after);
};
if (coreClient.GetRank().has(Rank.TWITCH))
@ -272,7 +266,7 @@ public class AntiHack extends MiniPlugin
Consumer<Consumer<PunishmentResponse>> doPunish = after ->
{
_punish.AddPunishment(coreClient.getName(), Category.Hacking, info.getMessage(), AntiHack.NAME, 3, true, getDaysBanned(player, CheckManager.getCheckBySimpleName(info.getHackType())), true, after);
_punish.AddPunishment(coreClient.getName(), Category.Hacking, info.getMessage(), AntiHack.NAME, 3, true, getHoursBanned(player), true, after);
};
if (coreClient.GetRank().has(Rank.TWITCH))
@ -352,13 +346,18 @@ public class AntiHack extends MiniPlugin
{
PunishClient punishClient = require(Punish.class).GetClient(player.getName());
if (punishClient == null)
{
return -1;
}
int totalPunishments = 0;
if (punishClient.GetPunishments().containsKey(Category.Hacking))
{
for (Punishment punishment : punishClient.GetPunishments().get(Category.Hacking))
{
if (punishment.GetAdmin().equalsIgnoreCase(NAME) && punishment.GetReason().contains("[GWEN]"))
if (punishment.GetAdmin().equalsIgnoreCase(NAME) && punishment.GetReason().contains("[GWEN"))
{
totalPunishments++;
}
@ -368,37 +367,18 @@ public class AntiHack extends MiniPlugin
return totalPunishments;
}
public int getDaysBanned(Player player, Class<? extends Check> check)
public int getHoursBanned(Player player)
{
if (check == null) // old banwaves
{
switch (getPunishments(player))
{
case 0:
return 5;
case 1:
return 14;
case 2:
return 30;
default:
return -1;
}
}
switch (check.getSimpleName())
switch (getPunishments(player))
{
case 0:
return 5 * 24;
case 1:
return 14 * 24;
case 2:
return 30 * 24;
default:
switch (getPunishments(player))
{
case 0:
return 5;
case 1:
return 14;
case 2:
return 30;
default:
return -1;
}
return -1;
}
}

View File

@ -12,6 +12,7 @@ import mineplex.core.common.util.UtilServer;
public class BanwaveAction extends AntiHackAction
{
private final AntiHack _antiHack = Managers.require(AntiHack.class);
private static final int BAN_DELAY_MINIMUM_MINUTES = 30;
private static final int BAN_DELAY_MAXIMUM_MINUTES = (int) TimeUnit.MINUTES.convert(2, TimeUnit.HOURS);
@ -25,7 +26,7 @@ public class BanwaveAction extends AntiHackAction
{
if (event.getViolations() >= (Math.floor(getMinVl() * .9)) && event.getPlayer().getMetadata("GWENEXTREMEPREJUDICE").get(0).asBoolean())
{
Managers.get(AntiHack.class).doBan(event.getPlayer(), event.getCheckClass(), true);
_antiHack.doBan(event.getPlayer(), event.getCheckClass(), true, _antiHack.getHoursBanned(event.getPlayer()));
return;
}
if (event.getViolations() >= this.getMinVl())

View File

@ -7,6 +7,8 @@ import mineplex.core.antihack.AntiHack;
public class GEPBanAction extends AntiHackAction
{
private final AntiHack _antiHack = Managers.require(AntiHack.class);
public GEPBanAction(int vl)
{
super(vl);
@ -17,7 +19,7 @@ public class GEPBanAction extends AntiHackAction
{
if (event.getViolations() >= this.getMinVl() && event.getPlayer().getMetadata("GWENEXTREMEPREJUDICE").get(0).asBoolean())
{
Managers.get(AntiHack.class).doBan(event.getPlayer(), event.getCheckClass(), true);
_antiHack.doBan(event.getPlayer(), event.getCheckClass(), true, _antiHack.getHoursBanned(event.getPlayer()));
}
}
}

View File

@ -7,6 +7,8 @@ import mineplex.core.antihack.AntiHack;
public class ImmediateBanAction extends AntiHackAction
{
private final AntiHack _antiHack = Managers.require(AntiHack.class);
public ImmediateBanAction(int vl)
{
super(vl);
@ -17,12 +19,12 @@ public class ImmediateBanAction extends AntiHackAction
{
if (event.getViolations() >= (Math.floor(getMinVl() * .9)) && event.getPlayer().getMetadata("GWENEXTREMEPREJUDICE").get(0).asBoolean())
{
Managers.get(AntiHack.class).doBan(event.getPlayer(), event.getCheckClass(), true);
_antiHack.doBan(event.getPlayer(), event.getCheckClass(), true, _antiHack.getHoursBanned(event.getPlayer()));
return;
}
if (event.getViolations() >= this.getMinVl())
{
Managers.get(AntiHack.class).doBan(event.getPlayer(), event.getCheckClass(), false);
_antiHack.doBan(event.getPlayer(), event.getCheckClass(), false, _antiHack.getHoursBanned(event.getPlayer()));
}
}
}

View File

@ -1,17 +1,5 @@
package mineplex.core.antihack.banwave;
import mineplex.core.MiniPlugin;
import mineplex.core.ReflectivelyCreateMiniPlugin;
import mineplex.core.account.CoreClient;
import mineplex.core.account.CoreClientManager;
import mineplex.core.antihack.AntiHack;
import mineplex.core.antihack.compedaccount.CompromisedAccountManager;
import mineplex.core.antihack.logging.AntihackLogger;
import mineplex.core.antihack.redisnotifications.GwenBanwaveNotification;
import mineplex.core.common.util.UtilServer;
import mineplex.serverdata.commands.ServerCommandManager;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent;
@ -20,6 +8,15 @@ import com.google.gson.JsonObject;
import com.mineplex.anticheat.checks.Check;
import com.mineplex.anticheat.checks.CheckManager;
import mineplex.core.MiniPlugin;
import mineplex.core.ReflectivelyCreateMiniPlugin;
import mineplex.core.account.CoreClient;
import mineplex.core.account.CoreClientManager;
import mineplex.core.antihack.AntiHack;
import mineplex.core.antihack.logging.AntihackLogger;
import mineplex.core.antihack.redisnotifications.GwenBanwaveNotification;
import mineplex.core.common.util.UtilServer;
@ReflectivelyCreateMiniPlugin
public class BanWaveManager extends MiniPlugin
{
@ -75,7 +72,6 @@ public class BanWaveManager extends MiniPlugin
JsonObject custom = new JsonObject();
custom.addProperty("is-banwave", true);
require(CompromisedAccountManager.class).submitPendingDelayedBan(player);
require(AntihackLogger.class).saveMetadata(player, id, after, custom);
}
});

View File

@ -7,6 +7,7 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import mineplex.core.MiniPlugin;
import mineplex.core.blockrestore.BlockRestore;
@ -38,10 +39,11 @@ import org.bukkit.util.Vector;
public class Explosion extends MiniPlugin
{
private boolean _regenerateGround = false;
private boolean _regenerateGround;
private long _regenerateTime;
private boolean _temporaryDebris = true;
private boolean _enableDebris = false;
private boolean _tntSpread = true;
private boolean _tntSpread;
private boolean _liquidDamage = true;
private HashSet<FallingBlock> _explosionBlocks = new HashSet<FallingBlock>();
@ -52,6 +54,8 @@ public class Explosion extends MiniPlugin
super("Block Restore", plugin);
_blockRestore = blockRestore;
resetConfiguration();
}
@EventHandler
@ -134,7 +138,7 @@ public class Explosion extends MiniPlugin
else
{
int heightDiff = cur.getLocation().getBlockY() - event.getEntity().getLocation().getBlockY();
_blockRestore.add(cur, 0, (byte) 0, (long) (20000 + (heightDiff * 3000) + Math.random() * 2900));
_blockRestore.add(cur, 0, (byte) 0, (long) (_regenerateTime + (heightDiff * 3000) + Math.random() * 2900));
}
}
@ -276,6 +280,11 @@ public class Explosion extends MiniPlugin
_regenerateGround = regenerate;
}
public void setRegenerateTime(long time)
{
_regenerateTime = time;
}
public void SetDebris(boolean value)
{
_enableDebris = value;
@ -296,6 +305,13 @@ public class Explosion extends MiniPlugin
_temporaryDebris = value;
}
public void resetConfiguration()
{
_regenerateGround = false;
_regenerateTime = TimeUnit.SECONDS.toMillis(20);
_tntSpread = true;
}
public HashSet<FallingBlock> GetExplosionBlocks()
{
return _explosionBlocks;
@ -326,7 +342,14 @@ public class Explosion extends MiniPlugin
if (removeBlock)
{
cur.setType(Material.AIR);
if (_regenerateGround)
{
_blockRestore.add(cur, 0, (byte) 0, (long) (_regenerateTime + (cur.getLocation().getBlockY() * 3000) + (Math.random() * 1500)));
}
else
{
cur.setType(Material.AIR);
}
}
}
@ -356,12 +379,16 @@ public class Explosion extends MiniPlugin
_explosionBlocks.add(fall);
}
}
}
}, 1);
}
private void addToRegenerate(Block block)
{
}
public void setEnabled(boolean var)
{
if (var)

View File

@ -51,6 +51,7 @@ public enum GameDisplay
Smash("Super Smash Mobs", Material.SKULL_ITEM, (byte)4, GameCategory.CLASSICS, 34, true),
SmashDomination("Super Smash Mobs Domination", "Super Smash Mobs", Material.SKULL_ITEM, (byte)4, GameCategory.EXTRA, 36, false),
SmashTeams("Super Smash Mobs Teams", "Super Smash Mobs", Material.SKULL_ITEM, (byte)4, GameCategory.TEAM_VARIANT, 35, false),
SmashTraining("Super Smash Mobs Training", "Super Smash Mobs", Material.SKULL_ITEM, (byte)4, GameCategory.EXTRA, 34, false),
Snake("Snake", Material.WOOL, (byte)0, GameCategory.ARCADE, 37, true),
SneakyAssassins("Sneaky Assassins", Material.INK_SACK, (byte)0, GameCategory.ARCADE, 38, true),
SnowFight("Snow Fight", Material.SNOW_BALL, (byte)0, GameCategory.EXTRA, 39, false),

View File

@ -792,6 +792,11 @@ public class ServerManager extends MiniPlugin implements BrawlShopProvider
{
return _serverNpcShopMap.get("Castle Assault");
}
public ShopBase<ServerManager> getCastleAssaultTDMShop()
{
return _serverNpcShopMap.get("Castle Assault TDM");
}
public ShopBase<ServerManager> getCastleSiegeShop()
{

View File

@ -22,6 +22,7 @@ import mineplex.hub.server.ui.button.SelectBLDButton;
import mineplex.hub.server.ui.button.SelectBRButton;
import mineplex.hub.server.ui.button.SelectBawkButton;
import mineplex.hub.server.ui.button.SelectCAButton;
import mineplex.hub.server.ui.button.SelectCATDMButton;
import mineplex.hub.server.ui.button.SelectCLANSButton;
import mineplex.hub.server.ui.button.SelectCSButton;
import mineplex.hub.server.ui.button.SelectCTFButton;
@ -62,7 +63,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
@Override
protected void buildPage()
{
add(1, Material.EGG, C.cYellowB + "Bawk Bawk Battles " + C.cGray + "Challenges", new String[]
add(0, Material.EGG, C.cYellowB + "Bawk Bawk Battles " + C.cGray + "Challenges", new String[]
{
C.Reset + "",
C.Reset + "Follow Bawk Bawk's instructions",
@ -70,16 +71,25 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
C.Reset + "If you lose, chickens will devour you!"
}, "BBB", "Bawk_Bawk_Battles", new SelectBawkButton(this));
add(3, Material.DIAMOND_CHESTPLATE, C.cYellowB + "Castle Assault " + C.cGray + "Fast Paced PvP", new String[]
add(2, Material.DIAMOND_CHESTPLATE, C.cYellowB + "Castle Assault " + C.cGray + "Fast Paced PvP", new String[]
{
(_extraValue ? C.cAquaB : C.cWhiteB) + "NEW GAME",
(_extraValue ? C.cAquaB : C.cWhiteB) + "NEW UPDATES",
C.Reset + "",
C.Reset + "Combatants must battle to",
C.Reset + "win the day for their king",
C.Reset + "at all costs!",
}, "CA", "Castle_Assault", new SelectCAButton(this));
add(4, Material.DIAMOND_CHESTPLATE, C.cYellowB + "Castle Assault TDM " + C.cGray + "Team PvP", new String[]
{
(_extraValue ? C.cAquaB : C.cWhiteB) + "NEW GAME",
C.Reset + "",
C.Reset + "Combatants must battle to",
C.Reset + "win glory for their team",
C.Reset + "by slaying the enemy!",
}, "CATDM", "Castle_Assault_TDM", new SelectCATDMButton(this));
add(5, Material.QUARTZ_BLOCK, C.cYellowB + "Speed Builders " + C.cGray + "Competitive Building", new String[]
add(6, Material.QUARTZ_BLOCK, C.cYellowB + "Speed Builders " + C.cGray + "Competitive Building", new String[]
{
C.Reset + "",
C.Reset + "Memorize Gwen the Guardian's builds",
@ -87,7 +97,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
C.Reset + "The least correct builder is eliminated.",
}, "SB", "Speed_Builders", new SelectSBButton(this));
add(7, Material.TNT, C.cYellowB + "Dragon Escape " + C.cGray + "Fast Paced Parkour", new String[]
add(8, Material.TNT, C.cYellowB + "Dragon Escape " + C.cGray + "Fast Paced Parkour", new String[]
{
(_extraValue ? C.cAquaB : C.cWhiteB) + "FEATURED ARCADE GAME",
C.Reset + "",
@ -645,6 +655,11 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
{
getPlugin().getCastleAssaultShop().attemptShopOpen(player);
}
public void openCATDM(Player player)
{
getPlugin().getCastleAssaultTDMShop().attemptShopOpen(player);
}
public void openCS(Player player)
{

View File

@ -25,7 +25,6 @@ public class ServerNpcShop extends ShopBase<ServerManager>
{
switch (_serverGroup.getPrefix().toUpperCase())
{
case "SSM":
case "SKY":
case "HG":
return new ServerTypePage(getPlugin(), this, getClientManager(), getDonationManager(), player, _serverGroup);
@ -39,6 +38,9 @@ public class ServerNpcShop extends ShopBase<ServerManager>
case "SF":
return new SkyfallServerTypePage(getPlugin(), this, getClientManager(), getDonationManager(), player);
case "SSM":
return new SuperSmashMobsServerTypePage(getPlugin(), this, getClientManager(), getDonationManager(), player, _serverGroup);
default:
return new ServerNpcPage(getPlugin(), this, getClientManager(), getDonationManager(), _serverGroup.getServerNpcName(), player, _serverGroup.getPrefix());
}

View File

@ -0,0 +1,54 @@
package mineplex.hub.server.ui;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.C;
import mineplex.core.donation.DonationManager;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.shop.page.ShopPageBase;
import mineplex.hub.server.ServerManager;
import mineplex.serverdata.data.ServerGroup;
public class SuperSmashMobsServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
{
private final ServerGroup _serverGroup;
public SuperSmashMobsServerTypePage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager,
DonationManager donationManager, Player player, ServerGroup group)
{
super(plugin, shop, clientManager, donationManager, "Super Smash Mobs ", player, 27);
_serverGroup = group;
buildPage();
}
@Override
protected void buildPage()
{
setItem(12, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 4).setTitle(C.Reset + C.cGold + "Play " + C.cYellow + "Super Smash Mobs")
.addLore(new String[]
{
C.Reset + "",
C.Reset + C.cGreen + "Click to Play",
}).build());
setItem(14, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setTitle(C.Reset + C.cYellow + "Super Smash Mobs " + C.cGold + "Training")
.addLore(new String[]
{
C.Reset + "",
C.Reset + C.cGreen + "Click to Play",
}).build());
getButtonMap().put(12, (player, __) -> getShop().openPageForPlayer(player, new ServerTypePage(getPlugin(), getShop(), getClientManager(), getDonationManager(), player, _serverGroup)));
getButtonMap().put(14, (player, __) -> getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "SSM Training", player, "SSMT")));
}
public void Update()
{
getButtonMap().clear();
buildPage();
}
}

View File

@ -0,0 +1,23 @@
package mineplex.hub.server.ui.button;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import mineplex.core.shop.item.IButton;
import mineplex.hub.server.ui.ServerGameMenu;
public class SelectCATDMButton implements IButton
{
private ServerGameMenu _menu;
public SelectCATDMButton(ServerGameMenu menu)
{
_menu = menu;
}
@Override
public void onClick(Player player, ClickType clickType)
{
_menu.openCATDM(player);
}
}

View File

@ -4,6 +4,7 @@ import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
import mineplex.core.google.GoogleSheetsManager;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
@ -37,7 +38,6 @@ import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClient;
import mineplex.core.account.CoreClientManager;
import mineplex.core.achievement.AchievementManager;
import mineplex.core.antihack.compedaccount.CompromisedAccountManager;
import mineplex.core.antihack.compedaccount.PriorityCause;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.blood.Blood;
@ -233,6 +233,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
private ScoreboardManager _scoreboardManager;
private NextBestGameManager _nextBestGameManager;
private TrackManager _trackManager;
private GoogleSheetsManager _sheetsManager;
private IncognitoManager _incognitoManager;
@ -262,14 +263,13 @@ public class ArcadeManager extends MiniPlugin implements IRelation
public final boolean IsHolidayEnabled;
private final Titles _titles;
private final CompromisedAccountManager _compromisedAccountManager = require(CompromisedAccountManager.class);
public ArcadeManager(Arcade plugin, ServerStatusManager serverStatusManager, GameServerConfig serverConfig,
CoreClientManager clientManager, DonationManager donationManager, DamageManager damageManager,
StatsManager statsManager, IncognitoManager incognitoManager, AchievementManager achievementManager, DisguiseManager disguiseManager, Creature creature, Teleport teleport, Blood blood, Chat chat,
Portal portal, PreferencesManager preferences, InventoryManager inventoryManager, PacketHandler packetHandler,
CosmeticManager cosmeticManager, ProjectileManager projectileManager, PetManager petManager, HologramManager hologramManager, PollManager pollManager,
NpcManager npcManager, CustomDataManager customDataManager, Punish punish, EloManager eloManager, ThankManager thankManager, BoosterManager boosterManager)
CoreClientManager clientManager, DonationManager donationManager, DamageManager damageManager,
StatsManager statsManager, IncognitoManager incognitoManager, AchievementManager achievementManager, DisguiseManager disguiseManager, Creature creature, Teleport teleport, Blood blood, Chat chat,
Portal portal, PreferencesManager preferences, InventoryManager inventoryManager, PacketHandler packetHandler,
CosmeticManager cosmeticManager, ProjectileManager projectileManager, PetManager petManager, HologramManager hologramManager, PollManager pollManager,
NpcManager npcManager, CustomDataManager customDataManager, Punish punish, EloManager eloManager, ThankManager thankManager, BoosterManager boosterManager)
{
super("Game Manager", plugin);
@ -592,6 +592,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
_trackManager = require(TrackManager.class);
_titles = require(Titles.class);
Titles.BOOK_SLOT = 4;
_sheetsManager = require(GoogleSheetsManager.class);
}
@Override
@ -957,21 +959,21 @@ public class ArcadeManager extends MiniPlugin implements IRelation
}
//Recruiting
else */if (_game == null || _game.GetState() == GameState.Recruit)
{
if (_game != null && _game.GetCountdown() != -1)
{
if (_game != null && _game.GetCountdown() != -1)
{
event.setMotd(ChatColor.GREEN + "Starting in " + _game.GetCountdown() + " Seconds" + extrainformation);
}
else
{
event.setMotd(ChatColor.GREEN + "Recruiting" + extrainformation);
}
event.setMotd(ChatColor.GREEN + "Starting in " + _game.GetCountdown() + " Seconds" + extrainformation);
}
//In Progress
else
{
event.setMotd(ChatColor.YELLOW + "In Progress" + extrainformation);
event.setMotd(ChatColor.GREEN + "Recruiting" + extrainformation);
}
}
//In Progress
else
{
event.setMotd(ChatColor.YELLOW + "In Progress" + extrainformation);
}
if (UtilServer.isTestServer(false))
event.setMotd(ChatColor.GOLD + "Private Mineplex Test Server");
@ -986,8 +988,6 @@ public class ArcadeManager extends MiniPlugin implements IRelation
@EventHandler
public void MessageJoin(PlayerJoinEvent event)
{
_compromisedAccountManager.triggerPriorityBan(event.getPlayer(), PriorityCause.JOIN_GAME);
if (_incognitoManager.Get(event.getPlayer()).Status)
{
event.setJoinMessage(null);
@ -2081,8 +2081,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
return this._titles;
}
public CompromisedAccountManager getCompromisedAccountManager()
public GoogleSheetsManager getSheetsManager()
{
return _compromisedAccountManager;
return _sheetsManager;
}
}

View File

@ -1,6 +1,7 @@
package nautilus.game.arcade;
import nautilus.game.arcade.game.games.moba.Moba;
import nautilus.game.arcade.game.games.smash.SuperSmashTraining;
import org.bukkit.Material;
import mineplex.core.common.MinecraftVersion;
@ -186,6 +187,7 @@ public enum GameType
Smash(SoloSuperSmash.class, GameDisplay.Smash),
SmashDomination(SuperSmashDominate.class, GameDisplay.SmashDomination),
SmashTeams(TeamSuperSmash.class, GameDisplay.SmashTeams, new GameType[]{GameType.Smash}, false),
SmashTraining(SuperSmashTraining.class, GameDisplay.SmashTraining),
Snake(Snake.class, GameDisplay.Snake),
SneakyAssassins(SneakyAssassins.class, GameDisplay.SneakyAssassins),
SnowFight(SnowFight.class, GameDisplay.SnowFight),

View File

@ -1,27 +1,52 @@
package nautilus.game.arcade.game;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import com.google.common.collect.Lists;
import com.mojang.authlib.GameProfile;
import mineplex.core.Managers;
import mineplex.core.antihack.AntiHack;
import mineplex.core.arcadeevents.CoreGameStartEvent;
import mineplex.core.arcadeevents.CoreGameStopEvent;
import mineplex.core.command.CommandCenter;
import mineplex.core.common.Rank;
import mineplex.core.common.util.*;
import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.core.elo.EloPlayer;
import mineplex.core.elo.EloTeam;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.lifetimes.Lifetimed;
import mineplex.core.lifetimes.ListenerComponent;
import mineplex.core.lifetimes.PhasedLifetime;
import mineplex.core.packethandler.IPacketHandler;
import mineplex.core.packethandler.PacketInfo;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.utils.UtilGameProfile;
import mineplex.minecraft.game.classcombat.event.ClassCombatCreatureAllowSpawnEvent;
import mineplex.minecraft.game.core.combat.DeathMessageType;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import nautilus.game.arcade.ArcadeFormat;
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.events.PlayerStateChangeEvent;
import nautilus.game.arcade.game.GameTeam.PlayerState;
import nautilus.game.arcade.game.games.build.Build;
import nautilus.game.arcade.game.games.draw.Draw;
import nautilus.game.arcade.game.games.speedbuilders.SpeedBuilders;
import nautilus.game.arcade.game.modules.AntiExpOrbModule;
import nautilus.game.arcade.game.modules.Module;
import nautilus.game.arcade.kit.*;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.managers.lobby.LobbyManager;
import nautilus.game.arcade.scoreboard.GameScoreboard;
import nautilus.game.arcade.stats.*;
import nautilus.game.arcade.wineffect.WinEffectManager;
import nautilus.game.arcade.world.WorldData;
import net.minecraft.server.v1_8_R3.EntityItem;
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
import org.apache.commons.lang3.tuple.Triple;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
@ -41,79 +66,12 @@ import org.bukkit.event.hanging.HangingPlaceEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.world.WorldLoadEvent;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.scoreboard.NameTagVisibility;
import org.bukkit.scoreboard.Team;
import org.bukkit.util.Vector;
import com.google.common.collect.Lists;
import com.mojang.authlib.GameProfile;
import mineplex.core.Managers;
import mineplex.core.antihack.AntiHack;
import mineplex.core.arcadeevents.CoreGameStartEvent;
import mineplex.core.arcadeevents.CoreGameStopEvent;
import mineplex.core.command.CommandCenter;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTabTitle;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime;
import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.core.elo.EloPlayer;
import mineplex.core.elo.EloTeam;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.lifetimes.Lifetimed;
import mineplex.core.lifetimes.ListenerComponent;
import mineplex.core.lifetimes.PhasedLifetime;
import mineplex.core.packethandler.IPacketHandler;
import mineplex.core.packethandler.PacketInfo;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.utils.UtilGameProfile;
import mineplex.minecraft.game.classcombat.event.ClassCombatCreatureAllowSpawnEvent;
import mineplex.minecraft.game.core.combat.DeathMessageType;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import nautilus.game.arcade.ArcadeFormat;
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.events.PlayerStateChangeEvent;
import nautilus.game.arcade.game.GameTeam.PlayerState;
import nautilus.game.arcade.game.games.build.Build;
import nautilus.game.arcade.game.games.draw.Draw;
import nautilus.game.arcade.game.games.speedbuilders.SpeedBuilders;
import nautilus.game.arcade.game.modules.AntiExpOrbModule;
import nautilus.game.arcade.game.modules.Module;
import nautilus.game.arcade.kit.ChampionsKit;
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.managers.chat.ChatStatData;
import nautilus.game.arcade.managers.lobby.LobbyManager;
import nautilus.game.arcade.scoreboard.GameScoreboard;
import nautilus.game.arcade.stats.AssistsStatTracker;
import nautilus.game.arcade.stats.DamageDealtStatTracker;
import nautilus.game.arcade.stats.DamageTakenStatTracker;
import nautilus.game.arcade.stats.DeathsStatTracker;
import nautilus.game.arcade.stats.ExperienceStatTracker;
import nautilus.game.arcade.stats.GamesPlayedStatTracker;
import nautilus.game.arcade.stats.KillsStatTracker;
import nautilus.game.arcade.stats.LoseStatTracker;
import nautilus.game.arcade.stats.StatTracker;
import nautilus.game.arcade.stats.WinStatTracker;
import nautilus.game.arcade.wineffect.WinEffectManager;
import nautilus.game.arcade.world.WorldData;
import java.util.*;
import java.util.Map.Entry;
public abstract class Game extends ListenerComponent implements Lifetimed
{
@ -2467,8 +2425,8 @@ public abstract class Game extends ListenerComponent implements Lifetimed
public void cleanupCommands()
{
this._debugCommands.forEach(command -> CommandCenter.Instance.removeCommand(command));
this._debugCommands.clear();
_debugCommands.forEach(command -> CommandCenter.Instance.removeCommand(command));
_debugCommands.clear();
}
public <T extends Module> T getModule(Class<T> clazz)

View File

@ -239,7 +239,38 @@ public class Build extends Game
"Clown", "Windmill", "Alligator",
"Police", "Igloo", "Gift", "Bumblebee", "Jellyfish", "Speedboat",
"Fall", "Summer", "Autumn", "Winter", "Disco", "Moose",
"Water Gun", "Astronaut", "Wither", "Meteor"
"Water Gun", "Astronaut", "Wither", "Meteor",
"Airplane", "Alarm clock", "Alien", "Alligator", "Ant", "Apple", "Arm", "Autumn", "Baby", "Ball",
"Balloon", "Banana", "Barn", "Base", "Baseball", "Basketball", "Bat", "Bathroom", "Battery", "Beach",
"Bear", "Beaver", "Bed", "Beehive", "Bell", "Bicycle", "Bike", "Bird", "Birthday cake", "Blocks",
"Boat", "Bone", "Book", "Boot", "Bottle", "Bowtie", "Boy", "Bracelet", "Brain", "Branch",
"Bread", "Bridge", "Bubble", "Bug", "Bunny", "Bus", "Cage", "Cake", "Camera", "Cape",
"Carrot", "Castle", "Cat", "Cave", "Chair", "Chalk", "Cheek", "Cheese", "Cheeseburger", "Cherry",
"Chess", "Chicken", "Chin", "Christmas", "Circle", "Circus", "Clock", "Cloud", "Coal", "Coat",
"Coconut", "Computer", "Cone", "Cookie", "Corn", "Cow", "Crab", "Crib", "Cup", "Cupcake",
"Desert", "Desk", "Dinosaur", "Dog", "Doll", "Dominoes", "Door", "Doormat", "Drum", "Duck",
"Ear", "Ears", "Egg", "Electricity", "Elephant", "Eraser", "Eyes", "Face", "Farm", "Fishing pole",
"Fist", "Flamingo", "Flashlight", "Flower", "Flute", "Fly", "Football", "Forest", "Fountain", "Frenchfries",
"Frog", "Garbage", "Garden", "Gate", "Ghost", "Gingerbread man", "Giraffe", "Girl", "Glasses", "Grapes",
"Grass", "Graveyard", "Hair dryer", "Halloween", "Hat", "Head", "Heart", "Hippo", "Hockey", "Hook",
"Hopscotch", "Horse", "Hospital", "House", "Hula hoop", "Ice", "Icecream", "Jacket", "Jar", "Jellyfish",
"Jungle", "Kangaroo", "Key", "Kitchen", "Kite", "Knot", "Lamp", "Lawnmower", "Leaf", "Light",
"Lightbulb", "Lighthouse", "Lightsaber", "Lips", "Lipstick", "Lobster", "Lollipop", "Mail", "Mailman", "Mattress",
"Milk", "Money", "Monkey", "Moon", "Mosquito", "Mouse", "Mouth", "Muffin", "Mushroom", "Music",
"Nail", "Newspaper", "Nightmare", "Nose", "Ocean", "Orange", "Owl", "Pajamas", "Palace", "Park",
"Party", "Peach", "Peanut", "Pen", "Pencil", "Penguin", "Person", "Photograph", "Piano", "Pie",
"Pig", "Pillow", "Pineapple", "Ping pong", "Pinwheel", "Pirate", "Pizza", "Plate", "Pool Party", "Popcorn",
"Popsicle", "Potato", "Pretzel", "Prison", "Puppet", "Purse", "Queen", "Rain", "Rainbow", "Restaurant",
"Rhinoceros", "Ring", "River", "Road", "Robot", "Rocket", "Rocking chair", "Roof", "Round", "Rug",
"Ruins", "Saddle", "Sailboat", "Salt and pepper", "Scale", "School", "Scissors", "Seahorse", "Seashell", "Seesaw",
"Shark", "Sheep", "Shirt", "Shoe", "Shopping cart", "Shovel", "Skate", "Skateboard", "Ski", "Skirt",
"Slide", "Smile", "Snail", "Snake", "Snowball", "Snowflake", "Snowman", "Soap", "Socks", "Soda",
"Song", "Spaceship", "Spider", "Spider web", "Spoon", "Spring", "Stage", "Stairs", "Star", "State",
"Statue", "Stingray", "Stoplight", "Storm", "Suitcase", "Summer", "Sun", "Sunflower", "Swimming pool", "Swing",
"Swordfish", "Tail", "Taxi", "Teapot", "Telephone", "Thief", "Toast", "Toothbrush", "Torch", "Treasure",
"Tree", "Truck", "Trumpet", "Turtle", "TV", "Vest", "Violin", "Volcano", "Washing machine", "Water",
"Waterfall", "Watering can", "Whale", "Whisk", "Whistle", "Windmill", "Winter", "Worm", "Wrench", "Yo-yo",
"Zoo",
};
_christmasWords = new String[]

View File

@ -131,9 +131,12 @@ public class CastleAssault extends TeamGame
private ChestLoot _miscGear = new ChestLoot();
private ObjectiveTNTSpawner _tntSpawner;
private Map<GameTeam, Integer> _teamKills = new HashMap<>();
private boolean _writeScoreboard = true;
private boolean _killsAreObjective = false;
@SuppressWarnings("deprecation")
public CastleAssault(ArcadeManager manager)
{
@ -186,6 +189,7 @@ public class CastleAssault extends TeamGame
this.CrownsEnabled = true;
this.FirstKillReward = 20;
this.GemKillDeathRespawn = 1;
this.GameTimeout = -1;
new CompassModule()
.setGiveCompass(true)
@ -237,7 +241,7 @@ public class CastleAssault extends TeamGame
_rodsAndGaps.addLoot(new ItemBuilder(Material.GOLDEN_APPLE).setTitle(C.cPurple + "Golden Applegate").build(), 3);
}
{
_potionGearCommon.addLoot(new ItemBuilder(Material.POTION).setData((short)16418).build(), 2);
_potionGearCommon.addLoot(new ItemBuilder(Material.POTION).setData((short)8194).build(), 2);
_potionGearCommon.addLoot(new ItemBuilder(Material.POTION).setData((short)16417).build(), 2);
}
{
@ -634,6 +638,13 @@ public class CastleAssault extends TeamGame
}
_tntSpawner.update();
if (!_killsAreObjective)
{
if (_tntSpawner.isSpawned())
{
_killsAreObjective = true;
}
}
}
if (InProgress())
{
@ -862,6 +873,58 @@ public class CastleAssault extends TeamGame
}
AddStat(player, GetKit(player).GetName() + "KitKills", 1, false, false);
if (_killsAreObjective)
{
_teamKills.merge(GetTeam(player), 1, Integer::sum);
if (GetTeam(player).GetColor() == ChatColor.RED)
{
GameTeam enemy = GetTeam(ChatColor.AQUA);
TeamCrystal[] crystals = _crystals.get(enemy).stream().filter(TeamCrystal::isActive).toArray(size -> new TeamCrystal[size]);
if (crystals.length > 0)
{
if (_teamKills.getOrDefault(GetTeam(player), 0) % 20 == 0)
{
crystals[UtilMath.r(crystals.length)].destroy();
if (crystals.length > 1)
{
Bukkit.broadcastMessage(F.main("Game", "One of " + F.elem(enemy.GetFormattedName() + "'s Crystals") + " has been destroyed!"));
}
else
{
Bukkit.broadcastMessage(F.main("Game", "All of " + F.elem(enemy.GetFormattedName() + "'s Crystals") + " have been destroyed and " + F.elem(_kings.get(enemy).getName(false)) + " is now vulnerable!"));
}
}
}
else
{
_kings.get(enemy).handleDamage(player.getName(), 10, true);
}
}
else
{
GameTeam enemy = GetTeam(ChatColor.RED);
TeamCrystal[] crystals = _crystals.get(enemy).stream().filter(TeamCrystal::isActive).toArray(size -> new TeamCrystal[size]);
if (crystals.length > 0)
{
if (_teamKills.getOrDefault(GetTeam(player), 0) % 20 == 0)
{
crystals[UtilMath.r(crystals.length)].destroy();
if (crystals.length > 1)
{
Bukkit.broadcastMessage(F.main("Game", "One of " + F.elem(enemy.GetFormattedName() + "'s Crystals") + " has been destroyed!"));
}
else
{
Bukkit.broadcastMessage(F.main("Game", "All of " + F.elem(enemy.GetFormattedName() + "'s Crystals") + " have been destroyed and " + F.elem(_kings.get(enemy).getName(false)) + " is now vulnerable!"));
}
}
}
else
{
_kings.get(enemy).handleDamage(player.getName(), 10, true);
}
}
}
if (UtilPlayer.isSpectator(player))
{
@ -970,7 +1033,7 @@ public class CastleAssault extends TeamGame
}
else
{
Bukkit.broadcastMessage(F.main("Game", "All of " + F.elem(crystal.getOwner().GetFormattedName() + "'s Crystals") + " has been destroyed and " + F.elem(_kings.get(crystal.getOwner()).getName(false)) + " is now vulnerable!"));
Bukkit.broadcastMessage(F.main("Game", "All of " + F.elem(crystal.getOwner().GetFormattedName() + "'s Crystals") + " have been destroyed and " + F.elem(_kings.get(crystal.getOwner()).getName(false)) + " is now vulnerable!"));
}
}
}

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.WeakHashMap;
import org.bukkit.Bukkit;
@ -48,6 +49,7 @@ import org.bukkit.material.MaterialData;
import org.bukkit.metadata.MetadataValue;
import mineplex.core.Managers;
import mineplex.core.common.Pair;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
@ -60,7 +62,9 @@ import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.leaderboard.Leaderboard;
import mineplex.core.leaderboard.LeaderboardManager;
import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType;
import mineplex.core.loot.ChestLoot;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
@ -83,12 +87,14 @@ import nautilus.game.arcade.game.games.castleassault.kits.KitPlayer;
import nautilus.game.arcade.game.games.castleassault.kits.KitTank;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.lobby.current.NewGameLobbyManager;
public class CastleAssaultTDM extends TeamGame
{
private static final int MAX_FLINT_AND_STEEL_USES = 4;
private static final int ITEMS_PER_CHEST = 5;
private static final long TIME_TILL_REFILL = 2 * 60 * 1000;
private static final int KILLS_TO_WIN = 50;
private long _lastRefill;
@ -122,7 +128,22 @@ public class CastleAssaultTDM extends TeamGame
//new KitNinja(manager),
new KitTank(manager)
},
new String[] {"AlexTheCoder is awesome!"});
new String[]
{
"Work with your team",
"To slay the enemy.",
"First team to 50 kills",
"Wins the game and glory!"
}
);
_help = new String[]
{
"Purchase kit upgrades by earning and spending crowns from games",
"Each kit has special starter items, be sure to use them to your advantage in fights",
"Go on Kill Streaks to earn Kill Streak Rewards to obtain better armor & weapons!",
"Chests refill every 2 minutes with potions, golden applegates, fishing rods, and other useful PvP items!"
};
this.StrictAntiHack = true;
this.HungerSet = 20;
@ -143,6 +164,7 @@ public class CastleAssaultTDM extends TeamGame
this.CrownsEnabled = true;
this.FirstKillReward = 20;
this.GemKillDeathRespawn = 1;
this.GameTimeout = -1;
new CompassModule()
.setGiveCompass(true)
@ -153,33 +175,33 @@ public class CastleAssaultTDM extends TeamGame
_flintAndSteel = new ItemBuilder(Material.FLINT_AND_STEEL).setData((short) (Material.FLINT_AND_STEEL.getMaxDurability() - MAX_FLINT_AND_STEEL_USES));
generateLoot();
// if (manager.IsRewardStats())
// {
// if (manager.GetLobby() instanceof NewGameLobbyManager)
// {
// Map<String, List<Location>> lobbyCustomLocs = ((NewGameLobbyManager)manager.GetLobby()).getCustomLocs();
// if (lobbyCustomLocs.containsKey("TOP_DAILY_WINS"))
// {
// Location loc = lobbyCustomLocs.get("TOP_DAILY_WINS").get(0);
// Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULT_DAILY_WINS", new Leaderboard("Top Daily Wins", Pair.create("Win", "Wins"), new String[] {"Castle Assault TDM.Wins"}, LeaderboardSQLType.DAILY_SEASON, loc, 10));
// }
// if (lobbyCustomLocs.containsKey("TOP_DAILY_KILLS"))
// {
// Location loc = lobbyCustomLocs.get("TOP_DAILY_KILLS").get(0);
// Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULT_DAILY_KILLS", new Leaderboard("Top Daily Kills", Pair.create("Kill", "Kills"), new String[] {"Castle Assault TDM.Kills"}, LeaderboardSQLType.DAILY_SEASON, loc, 10));
// }
// if (lobbyCustomLocs.containsKey("TOP_WINS"))
// {
// Location loc = lobbyCustomLocs.get("TOP_WINS").get(0);
// Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULT_WINS", new Leaderboard("Top Wins", Pair.create("Win", "Wins"), new String[] {"Castle Assault TDM.Wins"}, LeaderboardSQLType.ALL_SEASON, loc, 10));
// }
// if (lobbyCustomLocs.containsKey("TOP_KILLS"))
// {
// Location loc = lobbyCustomLocs.get("TOP_KILLS").get(0);
// Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULT_KILLS", new Leaderboard("Top Kills", Pair.create("Kill", "Kills"), new String[] {"Castle Assault TDM.Kills"}, LeaderboardSQLType.ALL_SEASON, loc, 10));
// }
// }
// }
if (manager.IsRewardStats())
{
if (manager.GetLobby() instanceof NewGameLobbyManager)
{
Map<String, List<Location>> lobbyCustomLocs = ((NewGameLobbyManager)manager.GetLobby()).getCustomLocs();
if (lobbyCustomLocs.containsKey("TOP_DAILY_WINS"))
{
Location loc = lobbyCustomLocs.get("TOP_DAILY_WINS").get(0);
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULTTDM_DAILY_WINS", new Leaderboard("Top Daily Wins", Pair.create("Win", "Wins"), new String[] {"Castle Assault TDM.Wins"}, LeaderboardSQLType.DAILY, loc, 10));
}
if (lobbyCustomLocs.containsKey("TOP_DAILY_KILLS"))
{
Location loc = lobbyCustomLocs.get("TOP_DAILY_KILLS").get(0);
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULTTDM_DAILY_KILLS", new Leaderboard("Top Daily Kills", Pair.create("Kill", "Kills"), new String[] {"Castle Assault TDM.Kills"}, LeaderboardSQLType.DAILY, loc, 10));
}
if (lobbyCustomLocs.containsKey("TOP_WINS"))
{
Location loc = lobbyCustomLocs.get("TOP_WINS").get(0);
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULTTDM_WINS", new Leaderboard("Top Wins", Pair.create("Win", "Wins"), new String[] {"Castle Assault TDM.Wins"}, LeaderboardSQLType.ALL_SEASON, loc, 10));
}
if (lobbyCustomLocs.containsKey("TOP_KILLS"))
{
Location loc = lobbyCustomLocs.get("TOP_KILLS").get(0);
Managers.get(LeaderboardManager.class).registerLeaderboard("TOP_CASTLEASSAULTTDM_KILLS", new Leaderboard("Top Kills", Pair.create("Kill", "Kills"), new String[] {"Castle Assault TDM.Kills"}, LeaderboardSQLType.ALL_SEASON, loc, 10));
}
}
}
}
private void generateLoot()
@ -193,7 +215,7 @@ public class CastleAssaultTDM extends TeamGame
_rodsAndGaps.addLoot(new ItemBuilder(Material.GOLDEN_APPLE).setTitle(C.cPurple + "Golden Applegate").build(), 3);
}
{
_potionGearCommon.addLoot(new ItemBuilder(Material.POTION).setData((short)16418).build(), 2);
_potionGearCommon.addLoot(new ItemBuilder(Material.POTION).setData((short)8194).build(), 2);
_potionGearCommon.addLoot(new ItemBuilder(Material.POTION).setData((short)16417).build(), 2);
}
{
@ -274,10 +296,10 @@ public class CastleAssaultTDM extends TeamGame
GameTeam red = GetTeam(ChatColor.RED);
GameTeam blue = GetTeam(ChatColor.AQUA);
Scoreboard.write(red.GetFormattedName() + " Team Kills");
Scoreboard.write(_teamKills.get(red) + "/50");
Scoreboard.write(_teamKills.get(red) + "/" + KILLS_TO_WIN);
Scoreboard.writeNewLine();
Scoreboard.write(blue.GetFormattedName() + " Team Kills");
Scoreboard.write(_teamKills.get(blue) + "/50");
Scoreboard.write(_teamKills.get(blue) + "/" + KILLS_TO_WIN);
Scoreboard.draw();
}
@ -363,12 +385,16 @@ public class CastleAssaultTDM extends TeamGame
AddGems(player, 10, "Participation", false, false);
}
int crowns = 0;
for (Entry<String, GemData> data : GetGems(player).entrySet())
{
int crowns = 0;
for (GemData data : GetGems(player).values())
if (data.getKey().equals("Kills"))
{
crowns += data.Gems;
crowns += data.getValue().Gems;
}
}
{
int streak = _streakData.getOrDefault(player, new KillStreakData()).getBestStreak();
if (streak >= 2 && streak < 4)
{
@ -376,7 +402,7 @@ public class CastleAssaultTDM extends TeamGame
}
else if (streak >= 4 && streak < 6)
{
AddGems(player, crowns, streak + " Player Kill Streak", false, false);
AddGems(player, 1 * crowns, streak + " Player Kill Streak", false, false);
}
else if (streak >= 6 && streak < 8)
{
@ -387,22 +413,6 @@ public class CastleAssaultTDM extends TeamGame
AddGems(player, 2 * crowns, streak + " Player Kill Streak", false, false);
}
}
if (GetKit(player) != null)
{
KitPlayer kit = (KitPlayer) GetKit(player);
int kitLevel = kit.getUpgradeLevel(player.getUniqueId());
if (kitLevel > 0)
{
int crowns = 0;
for (GemData data : GetGems(player).values())
{
crowns += data.Gems;
}
AddGems(player, (0.5 * kitLevel) * crowns, kit.GetName() + " Kit Level Bonus", false, false);
}
}
}
}
SetState(GameState.End);
@ -433,7 +443,7 @@ public class CastleAssaultTDM extends TeamGame
GameTeam red = GetTeam(ChatColor.RED);
GameTeam blue = GetTeam(ChatColor.AQUA);
if (_teamKills.get(blue).intValue() >= 50)
if (_teamKills.get(blue).intValue() >= KILLS_TO_WIN)
{
AnnounceEnd(blue);
writeFinalScoreboard(blue.GetColor() + blue.GetName(), _teamKills.get(blue));
@ -454,12 +464,16 @@ public class CastleAssaultTDM extends TeamGame
AddGems(player, 10, "Participation", false, false);
}
int crowns = 0;
for (Entry<String, GemData> data : GetGems(player).entrySet())
{
int crowns = 0;
for (GemData data : GetGems(player).values())
if (data.getKey().equals("Kills"))
{
crowns += data.Gems;
crowns += data.getValue().Gems;
}
}
{
int streak = _streakData.getOrDefault(player, new KillStreakData()).getBestStreak();
if (streak >= 2 && streak < 4)
{
@ -467,7 +481,7 @@ public class CastleAssaultTDM extends TeamGame
}
else if (streak >= 4 && streak < 6)
{
AddGems(player, crowns, streak + " Player Kill Streak", false, false);
AddGems(player, 1 * crowns, streak + " Player Kill Streak", false, false);
}
else if (streak >= 6 && streak < 8)
{
@ -478,25 +492,12 @@ public class CastleAssaultTDM extends TeamGame
AddGems(player, 2 * crowns, streak + " Player Kill Streak", false, false);
}
}
KitPlayer kit = (KitPlayer) GetKit(player);
int kitLevel = kit.getUpgradeLevel(player.getUniqueId());
if (kitLevel > 0)
{
int crowns = 0;
for (GemData data : GetGems(player).values())
{
crowns += data.Gems;
}
AddGems(player, (0.5 * kitLevel) * crowns, kit.GetName() + " Kit Level Bonus", false, false);
}
}
}
SetState(GameState.End);
return;
}
if (_teamKills.get(red).intValue() >= 50)
if (_teamKills.get(red).intValue() >= KILLS_TO_WIN)
{
AnnounceEnd(red);
writeFinalScoreboard(red.GetColor() + red.GetName(), _teamKills.get(red));
@ -517,12 +518,16 @@ public class CastleAssaultTDM extends TeamGame
AddGems(player, 10, "Participation", false, false);
}
int crowns = 0;
for (Entry<String, GemData> data : GetGems(player).entrySet())
{
int crowns = 0;
for (GemData data : GetGems(player).values())
if (data.getKey().equals("Kills"))
{
crowns += data.Gems;
crowns += data.getValue().Gems;
}
}
{
int streak = _streakData.getOrDefault(player, new KillStreakData()).getBestStreak();
if (streak >= 2 && streak < 4)
{
@ -530,7 +535,7 @@ public class CastleAssaultTDM extends TeamGame
}
else if (streak >= 4 && streak < 6)
{
AddGems(player, crowns, streak + " Player Kill Streak", false, false);
AddGems(player, 1 * crowns, streak + " Player Kill Streak", false, false);
}
else if (streak >= 6 && streak < 8)
{
@ -541,19 +546,6 @@ public class CastleAssaultTDM extends TeamGame
AddGems(player, 2 * crowns, streak + " Player Kill Streak", false, false);
}
}
KitPlayer kit = (KitPlayer) GetKit(player);
int kitLevel = kit.getUpgradeLevel(player.getUniqueId());
if (kitLevel > 0)
{
int crowns = 0;
for (GemData data : GetGems(player).values())
{
crowns += data.Gems;
}
AddGems(player, (0.5 * kitLevel) * crowns, kit.GetName() + " Kit Level Bonus", false, false);
}
}
}
SetState(GameState.End);
@ -587,10 +579,10 @@ public class CastleAssaultTDM extends TeamGame
Manager.GetDamage().SetEnabled(true);
Manager.GetExplosion().setEnabled(true);
Manager.GetCreature().SetDisableCustomDrops(false);
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULT_DAILY_WINS");
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULT_DAILY_KILLS");
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULT_WINS");
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULT_KILLS");
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULTTDM_DAILY_WINS");
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULTTDM_DAILY_KILLS");
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULTTDM_WINS");
Managers.get(LeaderboardManager.class).unregisterLeaderboard("TOP_CASTLEASSAULTTDM_KILLS");
}
}

View File

@ -104,10 +104,16 @@ public class TeamKing
public boolean handleDamage(String player, double damage)
{
if (!UtilTime.elapsed(_lastDamage, 400))
return handleDamage(player, damage, false);
}
public boolean handleDamage(String player, double damage, boolean force)
{
if (!UtilTime.elapsed(_lastDamage, 400) && !force)
{
return false;
}
_lastDamager = player;
_lastDamage = System.currentTimeMillis();
@ -119,4 +125,4 @@ public class TeamKing
return true;
}
}
}

View File

@ -65,36 +65,36 @@ public class KitFighter extends KitPlayer
if (level == 0)
{
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
player.getInventory().setItem(1, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(1).setTitle(C.cPurple + "Golden Applegate").setLore(C.cGold + "Kit Item").build());
player.getInventory().setItem(1, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(1).setTitle(C.cPurple + "Golden Applegate").build());
}
else if (level == 1)
{
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
player.getInventory().setItem(1, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(2).setTitle(C.cPurple + "Golden Applegate").setLore(C.cGold + "Kit Item").build());
player.getInventory().setItem(1, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(2).setTitle(C.cPurple + "Golden Applegate").build());
}
else if (level == 2)
{
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
player.getInventory().setItem(1, new ItemBuilder(Material.FISHING_ROD).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(2).setTitle(C.cPurple + "Golden Applegate").setLore(C.cGold + "Kit Item").build());
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(2).setTitle(C.cPurple + "Golden Applegate").build());
}
else if (level == 3)
{
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).addEnchantment(Enchantment.DAMAGE_ALL, 1).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
player.getInventory().setItem(1, new ItemBuilder(Material.FISHING_ROD).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(2).setTitle(C.cPurple + "Golden Applegate").setLore(C.cGold + "Kit Item").build());
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(2).setTitle(C.cPurple + "Golden Applegate").build());
}
else if (level == 4)
{
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).addEnchantment(Enchantment.DAMAGE_ALL, 1).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
player.getInventory().setItem(1, new ItemBuilder(Material.FISHING_ROD).addEnchantment(Enchantment.KNOCKBACK, 2).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(3).setTitle(C.cPurple + "Golden Applegate").setLore(C.cGold + "Kit Item").build());
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(3).setTitle(C.cPurple + "Golden Applegate").build());
}
else if (level == 5)
{
player.getInventory().setItem(0, new ItemBuilder(Material.DIAMOND_SWORD).addEnchantment(Enchantment.DAMAGE_ALL, 2).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
player.getInventory().setItem(1, new ItemBuilder(Material.FISHING_ROD).addEnchantment(Enchantment.KNOCKBACK, 2).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(3).setTitle(C.cPurple + "Golden Applegate").setLore(C.cGold + "Kit Item").build());
player.getInventory().setItem(2, new ItemBuilder(Material.GOLDEN_APPLE).setAmount(3).setTitle(C.cPurple + "Golden Applegate").build());
}
player.getInventory().setHelmet(new ItemBuilder(Material.DIAMOND_HELMET).setLore(C.cGold + "Kit Item").setUnbreakable(true).build());

View File

@ -39,7 +39,7 @@ public abstract class KitPlayer extends ProgressingKit
protected void giveRegeneration(Player player)
{
player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 20 * 3, 3));
player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 20 * 5, 3));
}
@Override

View File

@ -188,7 +188,38 @@ public class Draw extends SoloGame
"Piano", "Guitar", "Trumpet", "Drums", "Flute", "Helicopter", "Plane", "Football", "Tennis", "Hockey",
"Water", "Ocean", "Microsoft", "Twitter", "Godzilla", "Building", "House", "Rainbow", "Barbie", "Girl", "Boy",
"Children", "Bomb", "Explosion", "Gun", "Tank", "Penguin", "Eagle", "America", "Kangaroo", "Sea", "Raspberry",
"Strawberry", "Jam", "Sandwich", "Owl", "Watermelon", "Australia", "Canada", "United States", "Diary"
"Strawberry", "Jam", "Sandwich", "Owl", "Watermelon", "Australia", "Canada", "United States", "Diary",
"Airplane", "Alarm clock", "Alien", "Alligator", "Ant", "Apple", "Arm", "Autumn", "Baby", "Ball",
"Balloon", "Banana", "Barn", "Base", "Baseball", "Basketball", "Bat", "Bathroom", "Battery", "Beach",
"Bear", "Beaver", "Bed", "Beehive", "Bell", "Bicycle", "Bike", "Bird", "Birthday cake", "Blocks",
"Boat", "Bone", "Book", "Boot", "Bottle", "Bowtie", "Boy", "Bracelet", "Brain", "Branch",
"Bread", "Bridge", "Bubble", "Bug", "Bunny", "Bus", "Cage", "Cake", "Camera", "Cape",
"Carrot", "Castle", "Cat", "Cave", "Chair", "Chalk", "Cheek", "Cheese", "Cheeseburger", "Cherry",
"Chess", "Chicken", "Chin", "Christmas", "Circle", "Circus", "Clock", "Cloud", "Coal", "Coat",
"Coconut", "Computer", "Cone", "Cookie", "Corn", "Cow", "Crab", "Crib", "Cup", "Cupcake",
"Desert", "Desk", "Dinosaur", "Dog", "Doll", "Dominoes", "Door", "Doormat", "Drum", "Duck",
"Ear", "Ears", "Egg", "Electricity", "Elephant", "Eraser", "Eyes", "Face", "Farm", "Fishing pole",
"Fist", "Flamingo", "Flashlight", "Flower", "Flute", "Fly", "Football", "Forest", "Fountain", "Frenchfries",
"Frog", "Garbage", "Garden", "Gate", "Ghost", "Gingerbread man", "Giraffe", "Girl", "Glasses", "Grapes",
"Grass", "Graveyard", "Hair dryer", "Halloween", "Hat", "Head", "Heart", "Hippo", "Hockey", "Hook",
"Hopscotch", "Horse", "Hospital", "House", "Hula hoop", "Ice", "Icecream", "Jacket", "Jar", "Jellyfish",
"Jungle", "Kangaroo", "Key", "Kitchen", "Kite", "Knot", "Lamp", "Lawnmower", "Leaf", "Light",
"Lightbulb", "Lighthouse", "Lightsaber", "Lips", "Lipstick", "Lobster", "Lollipop", "Mail", "Mailman", "Mattress",
"Milk", "Money", "Monkey", "Moon", "Mosquito", "Mouse", "Mouth", "Muffin", "Mushroom", "Music",
"Nail", "Newspaper", "Nightmare", "Nose", "Ocean", "Orange", "Owl", "Pajamas", "Palace", "Park",
"Party", "Peach", "Peanut", "Pen", "Pencil", "Penguin", "Person", "Photograph", "Piano", "Pie",
"Pig", "Pillow", "Pineapple", "Ping pong", "Pinwheel", "Pirate", "Pizza", "Plate", "Pool Party", "Popcorn",
"Popsicle", "Potato", "Pretzel", "Prison", "Puppet", "Purse", "Queen", "Rain", "Rainbow", "Restaurant",
"Rhinoceros", "Ring", "River", "Road", "Robot", "Rocket", "Rocking chair", "Roof", "Round", "Rug",
"Ruins", "Saddle", "Sailboat", "Salt and pepper", "Scale", "School", "Scissors", "Seahorse", "Seashell", "Seesaw",
"Shark", "Sheep", "Shirt", "Shoe", "Shopping cart", "Shovel", "Skate", "Skateboard", "Ski", "Skirt",
"Slide", "Smile", "Snail", "Snake", "Snowball", "Snowflake", "Snowman", "Soap", "Socks", "Soda",
"Song", "Spaceship", "Spider", "Spider web", "Spoon", "Spring", "Stage", "Stairs", "Star", "State",
"Statue", "Stingray", "Stoplight", "Storm", "Suitcase", "Summer", "Sun", "Sunflower", "Swimming pool", "Swing",
"Swordfish", "Tail", "Taxi", "Teapot", "Telephone", "Thief", "Toast", "Toothbrush", "Torch", "Treasure",
"Tree", "Truck", "Trumpet", "Turtle", "TV", "Vest", "Violin", "Volcano", "Washing machine", "Water",
"Waterfall", "Watering can", "Whale", "Whisk", "Whistle", "Windmill", "Winter", "Worm", "Wrench", "Yo-yo",
"Zoo"
};
_christmasWords = new String[]

View File

@ -1,16 +1,36 @@
package nautilus.game.arcade.game.games.smash;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.bukkit.ChatColor;
import org.bukkit.Color;
import com.google.common.collect.Sets;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.common.Rank;
import mineplex.core.common.util.*;
import mineplex.core.disguise.disguises.DisguiseBase;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetType;
import mineplex.core.hologram.Hologram;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.mount.Mount;
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.ArcadeFormat;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.DebugCommand;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.GameTeam.PlayerState;
import nautilus.game.arcade.game.games.smash.events.SmashActivateEvent;
import nautilus.game.arcade.game.games.smash.kits.*;
import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.managers.PerkSpreadsheetModule;
import org.bukkit.*;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.entity.EnderCrystal;
import org.bukkit.entity.LivingEntity;
@ -18,70 +38,18 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockFadeEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.*;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.scheduler.BukkitRunnable;
import com.google.common.collect.Sets;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilFirework;
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.UtilTextMiddle;
import mineplex.core.hologram.Hologram;
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.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeFormat;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.GameTeam.PlayerState;
import nautilus.game.arcade.game.games.smash.kits.KitBlaze;
import nautilus.game.arcade.game.games.smash.kits.KitChicken;
import nautilus.game.arcade.game.games.smash.kits.KitCow;
import nautilus.game.arcade.game.games.smash.kits.KitCreeper;
import nautilus.game.arcade.game.games.smash.kits.KitEnderman;
import nautilus.game.arcade.game.games.smash.kits.KitGolem;
import nautilus.game.arcade.game.games.smash.kits.KitGuardian;
import nautilus.game.arcade.game.games.smash.kits.KitMagmaCube;
import nautilus.game.arcade.game.games.smash.kits.KitPig;
import nautilus.game.arcade.game.games.smash.kits.KitSheep;
import nautilus.game.arcade.game.games.smash.kits.KitSkeletalHorse;
import nautilus.game.arcade.game.games.smash.kits.KitSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitSkySquid;
import nautilus.game.arcade.game.games.smash.kits.KitSlime;
import nautilus.game.arcade.game.games.smash.kits.KitSnowman;
import nautilus.game.arcade.game.games.smash.kits.KitSpider;
import nautilus.game.arcade.game.games.smash.kits.KitWitch;
import nautilus.game.arcade.game.games.smash.kits.KitWitherSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitWolf;
import nautilus.game.arcade.game.games.smash.kits.KitZombie;
import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.Perk;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
public abstract class SuperSmash extends Game
{
@ -125,9 +93,89 @@ public abstract class SuperSmash extends Game
WorldWaterDamage = 1000;
HideTeamSheep = true;
ReplaceTeamsWithKits = true;
manager.GetExplosion().SetRegenerate(true);
manager.GetExplosion().setRegenerateTime(TimeUnit.SECONDS.toMillis(30));
new CompassModule()
.setGiveCompassToAlive(true)
.register(this);
new PerkSpreadsheetModule(this, "SMASH_KITS");
registerDebugCommand(new DebugCommand("cooldown", Rank.ADMIN)
{
@Override
public void Execute(Player caller, String[] args)
{
for (Player other : UtilServer.getPlayers())
{
Recharge.Instance.Reset(other);
}
Announce(C.cWhiteB + caller.getName() + C.cAquaB + " reset cooldowns!");
}
});
registerDebugCommand(new DebugCommand("nextsmash", Rank.ADMIN)
{
@Override
public void Execute(Player caller, String[] args)
{
_nextPowerup = System.currentTimeMillis() + 1000;
Announce(C.cWhiteB + caller.getName() + C.cAquaB + " spawned a smash crystal!");
}
});
registerDebugCommand(new DebugCommand("smash", Rank.ADMIN)
{
@Override
public void Execute(Player caller, String[] args)
{
giveSmashItem(caller);
}
});
registerDebugCommand(new DebugCommand("kit", Rank.ADMIN)
{
@Override
public void Execute(Player caller, String[] args)
{
String kit = "";
for (int i = 0; i < args.length; i++)
{
kit += args[i] + " ";
}
kit = kit.trim();
for (Kit kits : GetKits())
{
if (kit.equalsIgnoreCase(kits.GetName()))
{
SetKit(caller, kits, true);
return;
}
}
caller.sendMessage(F.main("Kit", "Sorry that is not a kit!"));
}
});
registerDebugCommand(new DebugCommand("lives", Rank.ADMIN)
{
@Override
public void Execute(Player caller, String[] args)
{
Announce(C.cWhiteB + caller.getName() + C.cAquaB + " reset their lives!");
if (!IsAlive(caller))
{
SetPlayerState(caller, PlayerState.IN);
RespawnPlayer(caller);
caller.sendMessage(F.main("Revive", "You are back in the game!"));
}
_lives.put(caller, MAX_LIVES);
}
});
}
@EventHandler(priority = EventPriority.HIGH)
@ -153,18 +201,6 @@ public abstract class SuperSmash extends Game
{
SetPlayerState(event.getEntity(), PlayerState.OUT);
}
// I think this causes players to sometimes be invisible
// DisguiseManager disguiseManager = Manager.GetDisguise();
// DisguiseBase disguise =
// disguiseManager.getActiveDisguise(event.getEntity());
//
// if (disguise == null)
// {
// return;
// }
//
// disguiseManager.undisguise(disguise);
}
@EventHandler
@ -227,12 +263,12 @@ public abstract class SuperSmash extends Game
@EventHandler
public void triggerSuper(PlayerInteractEvent event)
{
if (!IsLive())
if (!IsLive() || !UtilEvent.isAction(event, UtilEvent.ActionType.R))
{
return;
}
if (event.getMaterial() != Material.NETHER_STAR)
if (event.getMaterial() != null && event.getMaterial() != Material.NETHER_STAR)
{
return;
}
@ -251,6 +287,15 @@ public abstract class SuperSmash extends Game
continue;
}
SmashActivateEvent smashActivateEvent = new SmashActivateEvent(player);
UtilServer.CallEvent(smashActivateEvent);
if (smashActivateEvent.isCancelled())
{
return;
}
UtilInv.remove(player, Material.NETHER_STAR, (byte) 0, 1);
player.setHealth(player.getMaxHealth());
@ -507,6 +552,13 @@ public abstract class SuperSmash extends Game
}
}
// Deactivate morph if active
Gadget gadget = Manager.getCosmeticManager().getGadgetManager().getActive(player, GadgetType.MORPH);
if (gadget != null)
{
gadget.disable(player);
}
_playerKit.put(player, kit);
if (announce)
@ -522,37 +574,15 @@ public abstract class SuperSmash extends Game
@EventHandler(priority = EventPriority.LOWEST)
public void abilityDescription(PlayerInteractEvent event)
{
if (event.isCancelled())
{
return;
}
Player player = event.getPlayer();
ItemStack itemStack = player.getItemInHand();
if (itemStack == null)
if (itemStack == null || itemStack.getItemMeta() == null || itemStack.getItemMeta().getDisplayName() == null || itemStack.getItemMeta().getLore() == null || !displayKitInfo(player))
{
return;
}
if (itemStack.getItemMeta() == null)
{
return;
}
ItemMeta itemMeta = itemStack.getItemMeta();
if (itemMeta.getDisplayName() == null)
{
return;
}
if (itemMeta.getLore() == null)
{
return;
}
if (GetState() != GameState.Recruit)
if (itemStack.getType() == Material.WATCH || itemStack.getType() == Material.BED)
{
return;
}
@ -697,81 +727,9 @@ public abstract class SuperSmash extends Game
return _lives;
}
@EventHandler
public void debugCommands(PlayerCommandPreprocessEvent event)
protected boolean displayKitInfo(Player player)
{
if (!UtilServer.isTestServer())
{
return;
}
String message = event.getMessage();
Player player = event.getPlayer();
if (message.startsWith("/cooldown"))
{
event.setCancelled(true);
for (Player other : UtilServer.getPlayers())
{
Recharge.Instance.Reset(other);
}
Announce(C.cWhiteB + player.getName() + C.cAquaB + " reset cooldowns!");
}
else if (message.startsWith("/nextsmash"))
{
event.setCancelled(true);
_nextPowerup = System.currentTimeMillis() + 1000;
Announce(C.cWhiteB + player.getName() + C.cAquaB + " spawned a smash crystal!");
}
else if (message.startsWith("/smash"))
{
event.setCancelled(true);
giveSmashItem(player);
}
else if (message.startsWith("/kit"))
{
event.setCancelled(true);
String[] args = message.split(" ");
String kit = "";
for (int i = 1; i < args.length; i++)
{
kit += args[i] + " ";
}
kit = kit.trim();
for (Kit kits : GetKits())
{
if (kit.equalsIgnoreCase(kits.GetName()))
{
SetKit(player, kits, true);
return;
}
}
player.sendMessage(F.main("Kit", "Sorry that is not a kit!"));
}
else if (message.startsWith("/lives"))
{
event.setCancelled(true);
Announce(C.cWhiteB + player.getName() + C.cAquaB + " reset their lives!");
if (!IsAlive(player))
{
SetPlayerState(player, PlayerState.IN);
RespawnPlayer(player);
player.sendMessage(F.main("Revive", "You are back in the game!"));
}
_lives.put(player, MAX_LIVES);
}
return GetState() == GameState.Recruit;
}
public void setNextPowerupTime(long time)

View File

@ -0,0 +1,233 @@
package nautilus.game.arcade.game.games.smash;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilAlg;
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.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.games.smash.events.SmashActivateEvent;
import nautilus.game.arcade.game.modules.TrainingGameModule;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
public class SuperSmashTraining extends SuperSmash
{
private static final long GAME_TIME = TimeUnit.HOURS.toMillis(3);
private static final long GAME_WARN_TIME = GAME_TIME - TimeUnit.MINUTES.toMillis(5);
private static final String[] INFO_HOLOGRAM = {
C.cYellow + "Select a " + C.cGreen + "Kit",
C.cYellow + "Jump off the island to use your abilities",
C.cYellow + "You can then " + C.cGreen + "PVP" + C.cYellow + " other players",
C.cYellow + "Click the " + C.cGreen + "Bed" + C.cYellow + " to return to this island"
};
private Location _borderA;
private Location _borderB;
private Function<Player, Boolean> _safeFunction = player -> !UtilAlg.inBoundingBox(player.getLocation(), _borderA, _borderB);
private Map<UUID, Long> _lastDeath;
private boolean _announceEnd;
public SuperSmashTraining(ArcadeManager manager)
{
super(manager, GameType.SmashTraining, new String[]{
"Super Smash Mobs Training Ground"
});
DamageTeamSelf = true;
DeathSpectateSecs = 0;
PrepareTime = 500;
GiveClock = false;
HungerSet = 20;
_lastDeath = new HashMap<>();
new TrainingGameModule()
.setSkillFunction(_safeFunction)
.setDamageFunction(_safeFunction)
.register(this);
}
@Override
public void ParseData()
{
List<Location> locations = WorldData.GetDataLocs("BROWN");
_borderA = locations.get(0);
_borderB = locations.get(1);
}
@EventHandler
public void customTeamGeneration(GameStateChangeEvent event)
{
if (event.GetState() != GameState.Recruit)
{
return;
}
GameTeam players = GetTeamList().get(0);
players.SetColor(ChatColor.YELLOW);
players.SetName("Players");
players.setDisplayName(C.cYellowB + "Players");
}
@EventHandler
public void live(GameStateChangeEvent event)
{
if (event.GetState() != GameState.Live)
{
return;
}
List<Location> locations = WorldData.GetDataLocs("BLUE");
for (Location location : locations)
{
spawnInfoHologram(location);
}
}
@Override
@EventHandler
public void ScoreboardUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
{
return;
}
Scoreboard.writeNewLine();
List<Player> alive = GetPlayers(true);
Scoreboard.write(C.cYellowB + "Players");
if (alive.size() > 9)
{
Scoreboard.write(alive.size() + " Alive");
}
else
{
for (Player player : alive)
{
Scoreboard.write(player.getName());
}
}
Scoreboard.writeNewLine();
Scoreboard.write(C.cYellowB + "Time");
Scoreboard.write(UtilTime.MakeStr(System.currentTimeMillis() - GetStateTime()));
Scoreboard.writeNewLine();
Scoreboard.draw();
}
@Override
public List<Player> getWinners()
{
return null;
}
@Override
public List<Player> getLosers()
{
return null;
}
@Override
@EventHandler
public void playerDeath(PlayerDeathEvent event)
{
_lastDeath.put(event.getEntity().getUniqueId(), System.currentTimeMillis());
}
@EventHandler
public void cleanlastDeath(UpdateEvent event)
{
if (!IsLive() || event.getType() != UpdateType.FAST)
{
return;
}
for (Player player : GetPlayers(true))
{
if (_safeFunction.apply(player))
{
_lastDeath.remove(player.getUniqueId());
}
}
}
@EventHandler
public void smashActivate(SmashActivateEvent event)
{
if (!_safeFunction.apply(event.getPlayer()))
{
event.setCancelled(true);
}
}
@Override
public void EndCheck()
{
if (!IsLive())
{
return;
}
if (UtilTime.elapsed(GetStateTime(), GAME_TIME))
{
SetState(GameState.Dead);
Announce(C.cRedB + "Game Over! Resetting the map, you will be able to play again.");
}
else if (UtilTime.elapsed(GetStateTime(), GAME_WARN_TIME) && !_announceEnd)
{
_announceEnd = true;
Announce(C.cRedB + "The Game Will End In 5 Minutes.");
}
}
@Override
public long getNewSmashTime()
{
return (long) (System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(2) + TimeUnit.MINUTES.toMillis(2) * Math.random());
}
@Override
protected boolean displayKitInfo(Player player)
{
if (_lastDeath.containsKey(player.getUniqueId()))
{
return UtilTime.elapsed(_lastDeath.get(player.getUniqueId()), 4000);
}
return super.displayKitInfo(player) || !_safeFunction.apply(player);
}
private void spawnInfoHologram(Location location)
{
CreatureAllowOverride = true;
new Hologram(getArcadeManager().getHologramManager(), location, true, INFO_HOLOGRAM).start();
CreatureAllowOverride = false;
}
}

View File

@ -0,0 +1,42 @@
package nautilus.game.arcade.game.games.smash.events;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
public class SmashActivateEvent extends PlayerEvent implements Cancellable
{
private static final HandlerList HANDLERS = new HandlerList();
private boolean _cancelled;
public SmashActivateEvent(Player who)
{
super(who);
}
@Override
public boolean isCancelled()
{
return _cancelled;
}
@Override
public void setCancelled(boolean b)
{
_cancelled = b;
}
public HandlerList getHandlers()
{
return HANDLERS;
}
public static HandlerList getHandlerList()
{
return HANDLERS;
}
}

View File

@ -29,9 +29,9 @@ import nautilus.game.arcade.kit.perks.PerkSpeed;
public class KitBlaze extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.5, 0.25, 5),
new PerkDoubleJump("Double Jump", 1, 1, false),
new PerkKnockbackFire(1.50),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkKnockbackFire(),
new PerkSpeed(0),
new PerkInferno(),
new PerkFirefly(),
@ -70,6 +70,7 @@ public class KitBlaze extends SmashKit
new ItemStack(Material.CHAINMAIL_BOOTS),
new ItemStack(Material.CHAINMAIL_LEGGINGS),
new ItemStack(Material.CHAINMAIL_CHESTPLATE),
new ItemStack(Material.CHAINMAIL_HELMET)
};

View File

@ -25,8 +25,8 @@ public class KitChicken extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(4.5, 2.0, 0.2, 2),
new PerkFlap(0.8, 0.8, false),
new PerkSmashStats(),
new PerkFlap(),
new PerkEggGun(),
new PerkChickenRocket(),
new SmashChicken()

View File

@ -26,8 +26,8 @@ public class KitCow extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.1, 0.25, 6.5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkCowStampede(),
new PerkCowAngryHerd(),
new PerkCowMilkSpiral(),

View File

@ -25,8 +25,8 @@ import nautilus.game.arcade.kit.perks.PerkDoubleJump;
public class KitCreeper extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.65, 0.4, 3.5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkCreeperElectricity(),
new PerkCreeperSulphurBomb(),
new PerkCreeperExplode(),

View File

@ -1,23 +1,11 @@
package nautilus.game.arcade.game.games.smash.kits;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilInv;
import mineplex.core.disguise.disguises.DisguiseBase;
import mineplex.core.disguise.disguises.DisguiseEnderman;
import mineplex.core.itemstack.ItemStackFactory;
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.game.Game.GameState;
import nautilus.game.arcade.game.games.smash.perks.PerkSmashStats;
@ -31,14 +19,21 @@ import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.perks.PerkDoubleJump;
import nautilus.game.arcade.kit.perks.event.PerkBlockGrabEvent;
import nautilus.game.arcade.kit.perks.event.PerkBlockThrowEvent;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.inventory.ItemStack;
public class KitEnderman extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(7, 1.3, 0.25, 6),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkBlink("Blink", 16, 6000),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkBlink("Blink"),
new PerkBlockToss(),
new PerkEndermanTeleport(),
new SmashEnderman()
@ -82,8 +77,6 @@ public class KitEnderman extends SmashKit
};
public HashMap<Player, DisguiseEnderman> _disguises = new HashMap<Player, DisguiseEnderman>();
public KitEnderman(ArcadeManager manager)
{
super(manager, "Enderman", KitAvailability.Gem, 3000, PERKS, EntityType.ENDERMAN, IN_HAND, DisguiseEnderman.class);
@ -93,9 +86,7 @@ public class KitEnderman extends SmashKit
public void GiveItems(Player player)
{
disguise(player);
_disguises.put(player, (DisguiseEnderman) Manager.GetDisguise().getActiveDisguise(player));
UtilInv.Clear(player);
player.getInventory().addItem(PLAYER_ITEMS[0], PLAYER_ITEMS[1]);
@ -111,54 +102,51 @@ public class KitEnderman extends SmashKit
@EventHandler
public void BlockGrab(PerkBlockGrabEvent event)
{
SetBlock(_disguises.get(event.GetPlayer()), event.GetId(), event.GetData());
setBlock(event.GetPlayer(), event.GetId(), event.GetData());
}
@EventHandler
public void BlockThrow(PerkBlockThrowEvent event)
{
SetBlock(_disguises.get(event.GetPlayer()), 0, (byte) 0);
setBlock(event.GetPlayer(), 0, (byte) 0);
}
@EventHandler
public void Death(PlayerDeathEvent event)
{
SetBlock(_disguises.get(event.getEntity()), 0, (byte) 0);
}
public void SetBlock(DisguiseEnderman disguise, int id, byte data)
{
if (disguise == null)
{
return;
}
disguise.SetCarriedId(id);
disguise.SetCarriedData(data);
Manager.GetDisguise().updateDisguise(disguise);
setBlock(event.getEntity(), 0, (byte) 0);
}
@EventHandler
public void cleanDisguises(UpdateEvent event)
public void damage(CustomDamageEvent event)
{
if (event.getType() != UpdateType.FAST)
Player player = event.GetDamageePlayer();
if (player == null)
{
return;
}
for (Iterator<Entry<Player, DisguiseEnderman>> iterator = _disguises.entrySet().iterator(); iterator.hasNext();)
{
Entry<Player, DisguiseEnderman> current = iterator.next();
if (!Manager.GetDisguise().isDisguised(current.getKey()))
{
iterator.remove();
}
else if (Manager.GetDisguise().getActiveDisguise(current.getKey()) != current.getValue())
{
iterator.remove();
}
DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player);
if (player != null && disguise != null && disguise instanceof DisguiseEnderman)
{
// Endermen drop their held block when damaged. This means the client renders it this way, so we need to resend the correct data on the next tick.
Manager.runSyncLater(() -> Manager.GetDisguise().updateDisguise(disguise), 1);
}
}
public void setBlock(Player player, int id, byte data)
{
DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player);
if (player != null && disguise != null && disguise instanceof DisguiseEnderman)
{
DisguiseEnderman disguiseEnderman = (DisguiseEnderman) disguise;
disguiseEnderman.SetCarriedId(id);
disguiseEnderman.SetCarriedData(data);
Manager.GetDisguise().updateDisguise(disguiseEnderman);
}
}
}

View File

@ -27,8 +27,8 @@ public class KitGolem extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(7, 1.0, 0.2, 8),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkSlow(0),
new PerkFissure(),
new PerkIronHook(),

View File

@ -26,8 +26,8 @@ public class KitGuardian extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(4, 1.25, 0.25, 4.5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkWhirlpoolBlade(),
new PerkWaterSplash(),
new PerkTargetLazer(),

View File

@ -30,8 +30,8 @@ public class KitMagmaCube extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(5, 1.75, 0.35, 5),
new PerkDoubleJump("Double Jump", 1.2, 1, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkMagmaBoost(),
new PerkMagmaBlast(),
new PerkFlameDash(),
@ -63,6 +63,14 @@ public class KitMagmaCube extends SmashKit
ChatColor.RESET + "",
ChatColor.RESET + "Right-Click again to end Flame Dash early.",
}),
ItemStackFactory.Instance.CreateStack(Material.BLAZE_POWDER, (byte) 0, 1,
C.cYellow + C.Bold + "Passive" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Fuel the Fire",
new String[]
{
ChatColor.RESET + "Each kill increases your size, damage",
ChatColor.RESET + "armor and decreases your knockback taken.",
ChatColor.RESET + "Resets on death.",
}),
ItemStackFactory.Instance.CreateStack(Material.NETHER_STAR, (byte) 0, 1,
C.cYellow + C.Bold + "Smash Crystal" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Meteor Shower",
new String[]
@ -89,21 +97,21 @@ public class KitMagmaCube extends SmashKit
public void GiveItems(Player player)
{
disguise(player);
DisguiseMagmaCube disguise = (DisguiseMagmaCube) Manager.GetDisguise().getActiveDisguise(player);
disguise.SetSize(1);
UtilInv.Clear(player);
player.getInventory().addItem(PLAYER_ITEMS[0], PLAYER_ITEMS[1]);
if (Manager.GetGame().GetState() == GameState.Recruit)
player.getInventory().addItem(PLAYER_ITEMS[2]);
player.getInventory().addItem(PLAYER_ITEMS[2], PLAYER_ITEMS[3]);
player.getInventory().setArmorContents(PLAYER_ARMOR);;
player.getInventory().setArmorContents(PLAYER_ARMOR);
}
@EventHandler
public void fireResistance(UpdateEvent event)
{
@ -111,19 +119,19 @@ public class KitMagmaCube extends SmashKit
{
return;
}
if (Manager.GetGame() == null)
{
return;
}
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (!HasKit(player))
{
continue;
}
player.setFireTicks(0);
}
}

View File

@ -33,8 +33,8 @@ public class KitPig extends SmashKit
private static final float ENERGY_PER_TICK_SMASH = 0.02F;
private static final Perk[] PERKS = {
new PerkSmashStats(5, 1.5, 0.25, 5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkPigBaconBounce(),
new PerkPigBaconBomb(),
new PerkPigZombie(),

View File

@ -27,9 +27,9 @@ public class KitSheep extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(5, 1.7, 0.25, 5),
new PerkDoubleJump("Double Jump", 1, 1, false),
new PerkLazer(40, 7000),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkLazer(),
new PerkWoolBomb(),
new PerkWoolCloud(),
new SmashSheep()

View File

@ -32,8 +32,8 @@ public class KitSkeletalHorse extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.4, 0.3, 6.5),
new PerkDoubleJump("Double Jump", 1, 1, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkHorseKick(),
new PerkBoneRush(),
new PerkDeadlyBones(),

View File

@ -35,13 +35,13 @@ public class KitSkeleton extends SmashKit
private static double ARROW_DAMAGE = 6;
private static final Perk[] PERKS = {
new PerkSmashStats(5, 1.25, 0.2, 6),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkFletcher(3, 3, false),
new PerkKnockbackArrow(1.5),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkFletcher(),
new PerkKnockbackArrow(),
new PerkBoneExplosion(),
new PerkRopedArrow("Roped Arrow", 1, 5000),
new PerkBarrage(5, 300, true, false, true),
new PerkRopedArrow("Roped Arrow"),
new PerkBarrage(),
new SmashSkeleton()
};

View File

@ -26,10 +26,10 @@ public class KitSkySquid extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.5, 0.25, 5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkSuperSquid(),
new PerkInkBlast(7, 2),
new PerkInkBlast(),
new PerkFishFlurry(),
new SmashSquid()
};

View File

@ -25,8 +25,8 @@ public class KitSlime extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.75, 0.35, 3),
new PerkDoubleJump("Double Jump", 1.2, 1, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkSlimeSlam(),
new PerkSlimeRocket(),
new SmashSlime()
@ -66,7 +66,7 @@ public class KitSlime extends SmashKit
};
private static final ItemStack[] PLAYER_ARMOR = {
null,
new ItemStack(Material.CHAINMAIL_BOOTS),
null,
new ItemStack(Material.CHAINMAIL_CHESTPLATE),
new ItemStack(Material.CHAINMAIL_HELMET),

View File

@ -26,16 +26,6 @@ import nautilus.game.arcade.kit.perks.PerkDoubleJump;
public class KitSnowman extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.4, 0.3, 6),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkDamageSnow(1, 0.4),
new PerkArcticAura(),
new PerkBlizzard(),
new PerkIcePath(),
new SmashSnowman()
};
private static final ItemStack IN_HAND = new ItemStack(Material.SNOW_BALL);
private static final ItemStack[] PLAYER_ITEMS = {
@ -80,7 +70,15 @@ public class KitSnowman extends SmashKit
public KitSnowman(ArcadeManager manager)
{
super(manager, "Snowman", KitAvailability.Gem, 5000, PERKS, EntityType.SNOWMAN, IN_HAND, DisguiseSnowman.class);
super(manager, "Snowman", KitAvailability.Gem, 5000, new Perk[] {
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkDamageSnow(),
new PerkArcticAura(),
new PerkBlizzard(),
new PerkIcePath(),
new SmashSnowman() },
EntityType.SNOWMAN, IN_HAND, DisguiseSnowman.class);
}
@Override

View File

@ -26,7 +26,7 @@ public class KitSpider extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.5, 0.25, 6),
new PerkSmashStats(),
new PerkSpiderLeap(),
new PerkNeedler(),
new PerkWebShot(),

View File

@ -25,8 +25,8 @@ public class KitWitch extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.5, 0.3, 5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkWitchPotion(),
new PerkBatWave(),
new SmashWitch()

View File

@ -27,8 +27,8 @@ public class KitWitherSkeleton extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.2, 0.3, 6),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkWitherSkull(),
new PerkWitherImage(),
new SmashWitherSkeleton()

View File

@ -24,8 +24,8 @@ public class KitWolf extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(5, 1.6, 0.25, 5),
new PerkDoubleJump("Wolf Jump", 1.0, 1.0, true),
new PerkSmashStats(),
new PerkDoubleJump("Wolf Jump"),
new PerkWolf(),
new SmashWolf()
};
@ -68,7 +68,7 @@ public class KitWolf extends SmashKit
private static final ItemStack[] PLAYER_ARMOR = {
null,
new ItemStack(Material.CHAINMAIL_LEGGINGS),
new ItemStack(Material.IRON_CHESTPLATE),
new ItemStack(Material.CHAINMAIL_CHESTPLATE),
null
};

View File

@ -32,11 +32,11 @@ public class KitZombie extends SmashKit
{
private static final Perk[] PERKS = {
new PerkSmashStats(6, 1.25, 0.25, 5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkFletcher(2, 2, false),
new PerkKnockbackArrow(1.5),
new PerkOvercharge(6, 250, true),
new PerkSmashStats(),
new PerkDoubleJump("Double Jump"),
new PerkFletcher(),
new PerkKnockbackArrow(),
new PerkOvercharge(),
new PerkZombieBile(),
new PerkDeathsGrasp(),
new SmashZombie()

View File

@ -17,68 +17,95 @@ public class PerkSmashStats extends Perk
private double _damage;
private double _knockbackTaken;
private double _regen;
public PerkSmashStats(double damage, double knockbackTaken, double regen, double armor)
private double _armor;
public PerkSmashStats()
{
super("Smash Stats", new String[]
{
(C.cAqua + "Damage: " + C.cWhite + damage) + C.cWhite + " " + (C.cAqua + "Knockback Taken: " + C.cWhite + (int)(knockbackTaken*100) + "%"),
(C.cAqua + "Armor: " + C.cWhite + armor) + C.cWhite + " " + (C.cAqua + "Health Regeneration: " + C.cWhite + regen + " per Second"),
});
_damage = damage;
_knockbackTaken = knockbackTaken;
_regen = regen;
}
super("Smash Stats");
}
@Override
public void setupValues()
{
_damage = getPerkDouble("Damage", _damage);
_knockbackTaken = getPerkPercentage("Knockback Taken", _knockbackTaken);
_regen = getPerkDouble("Regeneration", _regen);
_armor = getPerkDouble("Armor", _armor);
setDesc(
(C.cAqua + "Damage: " + C.cWhite + _damage) + C.cWhite + " " + (C.cAqua + "Knockback Taken: " + C.cWhite + (int) (_knockbackTaken * 100) + "%"),
(C.cAqua + "Armor: " + C.cWhite + _armor) + C.cWhite + " " + (C.cAqua + "Health Regeneration: " + C.cWhite + _regen + " per Second")
);
}
@EventHandler(priority = EventPriority.HIGH)
public void Damage(CustomDamageEvent event)
{
if (event.GetCause() != DamageCause.ENTITY_ATTACK)
{
return;
}
Player damager = event.GetDamagerPlayer(false);
if (damager == null) return;
if (!Kit.HasKit(damager))
if (damager == null || !Kit.HasKit(damager) || !Manager.IsAlive(damager))
{
return;
if (!Manager.IsAlive(damager))
return;
}
double mod = _damage - event.GetDamageInitial();
event.AddMod(damager.getName(), "Attack", mod, true);
}
@EventHandler(priority = EventPriority.HIGH)
public void Knockback(CustomDamageEvent event)
{
Player damagee = event.GetDamageePlayer();
if (damagee == null) return;
if (damagee == null)
{
return;
}
if (!Kit.HasKit(damagee))
{
return;
}
if (!Manager.IsAlive(damagee))
{
return;
}
event.AddKnockback("Knockback Multiplier", _knockbackTaken);
}
@EventHandler
public void Regeneration(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC)
{
return;
}
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (!Kit.HasKit(player))
{
continue;
}
UtilPlayer.health(player, _regen);
}
}
public double getArmour()
{
return _armor;
}
public void setArmor(double armor)
{
_armor = armor;
}
}

View File

@ -1,15 +1,5 @@
package nautilus.game.arcade.game.games.smash.perks;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
@ -17,10 +7,14 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import java.util.*;
public class SmashUltimate extends Perk
{
@ -40,6 +34,12 @@ public class SmashUltimate extends Perk
_length = length;
}
@Override
public void setupValues()
{
_length = getPerkTime("Duration", _length);
}
public void activate(Player player)
{
_lastUltimate.put(player.getUniqueId(), System.currentTimeMillis());

View File

@ -34,29 +34,45 @@ import nautilus.game.arcade.kit.perks.data.FireflyData;
public class PerkFirefly extends SmashPerk
{
private static final int COOLDOWN = 12000;
private static final int DURATION = 2750;
private static final int DAMAGE = 7;
private static final int RADIUS_NORMAL = 4;
private static final float VELOCITY_NORMAL = 0.7F;
private static final int RADIUS_SMASH = 7;
private static final float VELOCITY_SMASH = 0.79F;
private static final int HIT_FREQUENCY = 2000;
private static final int WARMUP_TIME = 1500;
private static final int MIN_CANCEL_DAMAGE = 4;
private static final int KNOCKBACK_MAGNITUDE = 2;
private Set<FireflyData> _data = new HashSet<FireflyData>();
private int _cooldown;
private int _duration ;
private int _damage;
private int _radiusNormal;
private float _velocityNormal;
private int _radiusSmash;
private float _velocitySmash;
private int _hitFrequency;
private int _warmupTime;
private int _minCancelDamage;
private int _knockbackMagnitude;
private Set<FireflyData> _data = new HashSet<>();
private int _tick = 0;
public PerkFirefly()
{
super("Firefly", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Firefly" });
super("Firefly", new String[]{C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Firefly"});
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_duration = getPerkInt("Duration (ms)");
_damage = getPerkInt("Damage");
_radiusNormal = getPerkInt("Radius Normal");
_velocityNormal = getPerkFloat("Velocity Normal");
_radiusSmash = getPerkInt("Radius Smash");
_velocitySmash = getPerkFloat("Velocity Smash");
_hitFrequency = getPerkInt("Hit Frequency (ms)");
_warmupTime = getPerkInt("Warmup Time (ms)");
_minCancelDamage = getPerkInt("Min Cancel Damage");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
}
@EventHandler
@ -94,7 +110,7 @@ public class PerkFirefly extends SmashPerk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -126,7 +142,7 @@ public class PerkFirefly extends SmashPerk
Iterator<FireflyData> dataIterator = _data.iterator();
//There are a lot of magic numbers here, they are all arbitrary sound and particle values.
while (dataIterator.hasNext())
{
FireflyData data = dataIterator.next();
@ -134,15 +150,15 @@ public class PerkFirefly extends SmashPerk
Player player = data.Player;
boolean superActive = isSuperActive(data.Player);
String skillName = superActive ? "Phoenix" : GetName();
if (UtilPlayer.isSpectator(player))
{
dataIterator.remove();
continue;
}
// Warmup
if (!UtilTime.elapsed(data.Time, WARMUP_TIME) && !superActive)
if (!UtilTime.elapsed(data.Time, _warmupTime) && !superActive)
{
UtilAction.zeroVelocity(player);
player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, 0.2f, 0.6f);
@ -151,14 +167,14 @@ public class PerkFirefly extends SmashPerk
// Sound and Effect
UtilParticle.PlayParticleToAll(ParticleType.FIREWORKS_SPARK, player.getLocation().add(0, 1, 0), 0.6f, 0.6f, 0.6f, 0, 10, ViewDist.LONG);
float progress = (float) (System.currentTimeMillis() - data.Time) / WARMUP_TIME;
float progress = (float) (System.currentTimeMillis() - data.Time) / _warmupTime;
player.getWorld().playSound(player.getLocation(), Sound.BLAZE_BREATH, 0.5f, 1f + progress);
}
// Velocity
else if (!UtilTime.elapsed(data.Time, DURATION) || superActive)
else if (!UtilTime.elapsed(data.Time, _duration) || superActive)
{
UtilAction.velocity(player, player.getLocation().getDirection().multiply(superActive ? VELOCITY_SMASH : VELOCITY_NORMAL).add(new Vector(0, 0.15, 0)));
UtilAction.velocity(player, player.getLocation().getDirection().multiply(superActive ? _velocitySmash : _velocityNormal).add(new Vector(0, 0.15, 0)));
player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, 0.6f, 1.2f);
// Sound and Effect
@ -176,7 +192,7 @@ public class PerkFirefly extends SmashPerk
player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, 0.75f, 0.75f);
}
for (Player other : UtilPlayer.getNearby(player.getLocation(), superActive ? RADIUS_SMASH : RADIUS_NORMAL))
for (Player other : UtilPlayer.getNearby(player.getLocation(), superActive ? _radiusSmash : _radiusNormal))
{
if (other.equals(player))
{
@ -192,10 +208,10 @@ public class PerkFirefly extends SmashPerk
if (_tick % 12 == 0)
{
if (Recharge.Instance.use(other, GetName() + " hit by " + player.getName(), HIT_FREQUENCY, false, false))
{
if (Recharge.Instance.use(other, GetName() + " hit by " + player.getName(), _hitFrequency, false, false))
{
// Damage Event
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, DAMAGE, true, true, false, player.getName(), skillName);
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage, true, true, false, player.getName(), skillName);
UtilPlayer.message(other, F.main("Game", F.elem(Manager.GetColor(player) + player.getName()) + " hit you with " + F.elem(skillName) + "."));
}
@ -212,11 +228,11 @@ public class PerkFirefly extends SmashPerk
@EventHandler
public void FireflyDamage(CustomDamageEvent event)
{
if (event.GetDamage() < MIN_CANCEL_DAMAGE)
if (event.GetDamage() < _minCancelDamage)
{
return;
}
if (!(event.GetDamagerEntity(true) instanceof Player))
{
return;
@ -232,7 +248,7 @@ public class PerkFirefly extends SmashPerk
{
continue;
}
if (!UtilTime.elapsed(data.Time, 1250) && !isSuperActive(data.Player))
{
if (isTeamDamage(data.Player, event.GetDamagerPlayer(true)))
@ -256,7 +272,7 @@ public class PerkFirefly extends SmashPerk
{
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
}

View File

@ -30,13 +30,14 @@ public class PerkInferno extends SmashPerk
{
private static final float MAX_ENERGY = 0.999F;
private static final float ENERGY_PER_TICK = 0.025F;
private static final float ENERGY_PER_ITEM = 0.035F;
private float _energyTick = 0.025F;
private float _energyItem = 0.035F;
private static final double ITEM_EXPIRE_TIME = 0.7;
private static final double ITEM_BURN_TIME = 0.5;
private static final double ITEM_DAMAGE = 0.25;
private static final float ITEM_VELOCITY_MAGNITUDE = 1.6F;
private double _itemExpireTime = 0.7;
private double _itemBurnTime = 0.5;
private double _itemDamage = 0.25;
private float _itemVelocityMagnitude = 1.6F;
private Map<UUID, Long> _active = new HashMap<>();
@ -45,6 +46,17 @@ public class PerkInferno extends SmashPerk
super("Inferno", new String[] { C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Inferno" });
}
@Override
public void setupValues()
{
_energyTick = getPerkFloat("Energy Tick");
_energyItem = getPerkFloat("Energy Item");
_itemExpireTime = getPerkDouble("Expire Time");
_itemBurnTime = getPerkDouble("Burn Time");
_itemDamage = getPerkDouble("Damage");
_itemVelocityMagnitude = getPerkFloat("Velocity Magnitude");
}
@EventHandler
public void EnergyUpdate(UpdateEvent event)
{
@ -62,7 +74,7 @@ public class PerkInferno extends SmashPerk
if (!player.isBlocking())
{
player.setExp(Math.min(MAX_ENERGY, player.getExp() + ENERGY_PER_TICK));
player.setExp(Math.min(MAX_ENERGY, player.getExp() + _energyTick));
}
}
}
@ -130,7 +142,7 @@ public class PerkInferno extends SmashPerk
continue;
}
cur.setExp(cur.getExp() - ENERGY_PER_ITEM);
cur.setExp(cur.getExp() - _energyItem);
if (cur.getExp() <= 0)
{
@ -140,10 +152,10 @@ public class PerkInferno extends SmashPerk
// Fire
Item fire = cur.getWorld().dropItem(cur.getEyeLocation(), new ItemStack(Material.BLAZE_POWDER));
Manager.GetFire().Add(fire, cur, ITEM_EXPIRE_TIME, 0, ITEM_BURN_TIME, ITEM_DAMAGE, GetName(), false);
Manager.GetFire().Add(fire, cur, _itemExpireTime, 0, _itemBurnTime, _itemDamage, GetName(), false);
fire.teleport(cur.getEyeLocation());
fire.setVelocity(cur.getLocation().getDirection().add(getRandomVector()).multiply(ITEM_VELOCITY_MAGNITUDE));
fire.setVelocity(cur.getLocation().getDirection().add(getRandomVector()).multiply(_itemVelocityMagnitude));
// Effect
cur.getWorld().playSound(cur.getLocation(), Sound.GHAST_FIREBALL, 0.1f, 1f);

View File

@ -10,13 +10,11 @@ import nautilus.game.arcade.kit.Perk;
public class SmashBlaze extends SmashUltimate
{
private static final int DURATION = 18000;
public SmashBlaze()
{
super("Phoenix", new String[] {}, Sound.BLAZE_DEATH, DURATION);
super("Phoenix", new String[] {}, Sound.BLAZE_DEATH, 0);
}
@Override
public void activate(Player player)
{

View File

@ -44,12 +44,12 @@ import nautilus.game.arcade.kit.perks.data.ChickenMissileData;
public class PerkChickenRocket extends SmashPerk
{
private static final int COOLDOWN = 7000;
private static final int MIN_TIME = 200;
private static final int MAX_TIME = 4000;
private static final int HIT_BOX_RADIUS = 2;
private static final int DAMAGE_RADIUS = 3;
private static final int DAMAGE = 8;
private int _cooldown;
private int _minTime;
private int _maxTime;
private int _hitBoxRadius;
private int _damageRadius;
private int _damage;
private Set<ChickenMissileData> _data = new HashSet<>();
@ -59,6 +59,17 @@ public class PerkChickenRocket extends SmashPerk
+ " instantly recharges if you hit a player." });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_minTime = getPerkInt("Min Time (ms)");
_maxTime = getPerkTime("Max Time (ms)");
_hitBoxRadius = getPerkInt("Hit Box Radius");
_damageRadius = getPerkInt("Damage Radius");
_damage = getPerkInt("Damage");
}
@EventHandler
public void Missile(PlayerInteractEvent event)
{
@ -94,7 +105,7 @@ public class PerkChickenRocket extends SmashPerk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -131,14 +142,14 @@ public class PerkChickenRocket extends SmashPerk
data.Chicken.setVelocity(data.Direction);
data.Chicken.getWorld().playSound(data.Chicken.getLocation(), Sound.CHICKEN_HURT, 0.3f, 1.5f);
if (!UtilTime.elapsed(data.Time, MIN_TIME))
if (!UtilTime.elapsed(data.Time, _minTime))
{
continue;
}
boolean detonate = false;
if (UtilTime.elapsed(data.Time, MAX_TIME))
if (UtilTime.elapsed(data.Time, _maxTime))
{
detonate = true;
}
@ -146,11 +157,11 @@ public class PerkChickenRocket extends SmashPerk
{
List<Player> team = TeamSuperSmash.getTeam(Manager, data.Player, true);
// Hit Entity
for (Entity ent : UtilEnt.getInRadius(data.Chicken.getLocation(), HIT_BOX_RADIUS).keySet())
for (Entity ent : UtilEnt.getInRadius(data.Chicken.getLocation(), _hitBoxRadius).keySet())
{
if (ent instanceof Arrow)
{
if (((Arrow) ent).isOnGround())
if (ent.isOnGround())
{
continue;
}
@ -192,7 +203,7 @@ public class PerkChickenRocket extends SmashPerk
{
List<Player> team = TeamSuperSmash.getTeam(Manager, data.Player, true);
// Damage
for (LivingEntity ent : UtilEnt.getInRadius(data.Chicken.getLocation(), DAMAGE_RADIUS).keySet())
for (LivingEntity ent : UtilEnt.getInRadius(data.Chicken.getLocation(), _damageRadius).keySet())
{
if (ent.equals(data.Player))
{
@ -212,7 +223,7 @@ public class PerkChickenRocket extends SmashPerk
}
// Damage Event
Manager.GetDamage().NewDamageEvent(ent, data.Player, null, DamageCause.PROJECTILE, DAMAGE, false, true, false, data.Player.getName(), GetName());
Manager.GetDamage().NewDamageEvent(ent, data.Player, null, DamageCause.PROJECTILE, _damage, false, true, false, data.Player.getName(), GetName());
UtilAction.velocity(ent, UtilAlg.getTrajectory2d(data.Chicken, ent), 1.6, true, 0.8, 0, 10, true);
}
@ -226,7 +237,6 @@ public class PerkChickenRocket extends SmashPerk
data.Chicken.remove();
dataIterator.remove();
continue;
}
}
}

View File

@ -33,9 +33,9 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkEggGun extends SmashPerk
{
private static final int COOLDOWN = 2500;
private static final int DURATION = 750;
private static final int DAMAGE = 1;
private int _cooldown;
private int _duration;
private int _damage;
private Map<UUID, Long> _active = new HashMap<>();
@ -44,6 +44,14 @@ public class PerkEggGun extends SmashPerk
super("Egg Blaster", new String[] { C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Egg Blaster" });
}
@Override
public void setupValues()
{
_cooldown = getPerkInt("Cooldown (ms)");
_duration = getPerkInt("Duration (ms)");
_damage = getPerkInt("Damage");
}
@EventHandler
public void Activate(PlayerInteractEvent event)
{
@ -79,7 +87,7 @@ public class PerkEggGun extends SmashPerk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -114,7 +122,7 @@ public class PerkEggGun extends SmashPerk
continue;
}
if (UtilTime.elapsed(_active.get(key), DURATION))
if (UtilTime.elapsed(_active.get(key), _duration))
{
_active.remove(key);
continue;
@ -150,7 +158,7 @@ public class PerkEggGun extends SmashPerk
return;
}
if (event.GetDamage() >= DAMAGE)
if (event.GetDamage() >= _damage)
{
return;
}
@ -160,7 +168,7 @@ public class PerkEggGun extends SmashPerk
Egg egg = (Egg) event.GetProjectile();
// Damage Event
Manager.GetDamage().NewDamageEvent(event.GetDamageeEntity(), (LivingEntity) egg.getShooter(), egg, DamageCause.PROJECTILE, DAMAGE, true, true, false, UtilEnt.getName((LivingEntity) egg
Manager.GetDamage().NewDamageEvent(event.GetDamageeEntity(), (LivingEntity) egg.getShooter(), egg, DamageCause.PROJECTILE, _damage, true, true, false, UtilEnt.getName((LivingEntity) egg
.getShooter()), GetName());
UtilAction.zeroVelocity(event.GetDamageeEntity());

View File

@ -21,19 +21,26 @@ public class PerkFlap extends SmashPerk
{
private static final float MAX_ENERGY = 0.999F;
private static final float ENERGY_PER_TICK = 0.03F;
private static final float ENERGY_PER_FLAP = 0.17F;
private static final int COOLDOWN = 80;
private int _cooldown;
private float _energyPerTick;
private float _energyPerFlap;
private double _power;
private boolean _control;
public PerkFlap(double power, double heightLimit, boolean control)
public PerkFlap()
{
super("Flap", new String[] { C.cYellow + "Tap Jump Twice" + C.cGray + " to " + C.cGreen + "Flap" });
}
_power = power;
_control = control;
@Override
public void setupValues()
{
_cooldown = getPerkInt("Cooldown (ms)");
_energyPerTick = getPerkFloat("Energy Per Tick");
_energyPerFlap = getPerkFloat("Energy Per Flap");
_power = getPerkDouble("Power");
_control = getPerkBoolean("Control");
}
@EventHandler
@ -78,12 +85,12 @@ public class PerkFlap extends SmashPerk
player.getWorld().playSound(player.getLocation(), Sound.BAT_TAKEOFF, (float) (0.3 + player.getExp()), (float) (Math.random() / 2 + 1));
// Set Recharge
Recharge.Instance.use(player, GetName(), COOLDOWN, false, false);
Recharge.Instance.use(player, GetName(), _cooldown, false, false);
// Energy
if (!isSuperActive(player))
{
player.setExp(Math.max(0f, player.getExp() - ENERGY_PER_FLAP));
player.setExp(Math.max(0f, player.getExp() - _energyPerFlap));
}
}
@ -109,7 +116,7 @@ public class PerkFlap extends SmashPerk
if (UtilEnt.isGrounded(player) || UtilBlock.solid(player.getLocation().subtract(0, 2, 0).getBlock()))
{
player.setExp(Math.min(MAX_ENERGY, player.getExp() + ENERGY_PER_TICK));
player.setExp(Math.min(MAX_ENERGY, player.getExp() + _energyPerTick));
player.setAllowFlight(true);
}
else if (Recharge.Instance.usable(player, GetName()) && player.getExp() > 0)

View File

@ -9,11 +9,9 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashChicken extends SmashUltimate
{
private static final int DURATION = 20000;
public SmashChicken()
{
super("Aerial Gunner", new String[] {}, Sound.CHICKEN_IDLE, DURATION);
super("Aerial Gunner", new String[] {}, Sound.CHICKEN_IDLE, 0);
}
/**

View File

@ -37,14 +37,14 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkCowAngryHerd extends SmashPerk
{
private static final int COOLDOWN_NORMAL = 13000;
private static final int COOLDOWN_SMASH = 6000;
private static final int MAX_TIME = 2500;
private static final int STUCK_TIME = 300;
private static final int FORCE_MOVE = 350;
private static final float HIT_BOX_RADIUS = 2.2F;
private static final int HIT_FREQUENCY = 600;
private static final int DAMAGE = 5;
private int _cooldownNormal;
private int _cooldownSmash;
private int _maxTime;
private int _stuckTime;
private int _forceMove;
private float _hitBoxRadius;
private int _hitFrequency;
private int _damage;
private List<DataCowCharge> _active = new ArrayList<>();
@ -53,6 +53,19 @@ public class PerkCowAngryHerd extends SmashPerk
super("Angry Herd", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Angry Herd" });
}
@Override
public void setupValues()
{
_cooldownNormal = getPerkTime("Cooldown Normal");
_cooldownSmash = getPerkTime("Cooldown Smash");
_maxTime = getPerkInt("Max Time (ms)");
_stuckTime = getPerkInt("Stuck Time (ms)");
_forceMove = getPerkInt("Force Move (ms)");
_hitBoxRadius = getPerkFloat("Hit Box Radius");
_hitFrequency = getPerkInt("Hit Frequency (ms)");
_damage = getPerkInt("Damage");
}
@EventHandler
public void shoot(PlayerInteractEvent event)
{
@ -83,7 +96,7 @@ public class PerkCowAngryHerd extends SmashPerk
return;
}
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? COOLDOWN_SMASH : COOLDOWN_NORMAL, true, true))
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? _cooldownSmash : _cooldownNormal, true, true))
{
return;
}
@ -129,7 +142,7 @@ public class PerkCowAngryHerd extends SmashPerk
DataCowCharge data = activeIter.next();
// Expire
if (UtilTime.elapsed(data.Time, MAX_TIME))
if (UtilTime.elapsed(data.Time, _maxTime))
{
if (data.Cow.isValid())
{
@ -149,7 +162,7 @@ public class PerkCowAngryHerd extends SmashPerk
}
// Stuck Remove
if (UtilTime.elapsed(data.LastMoveTime, STUCK_TIME))
if (UtilTime.elapsed(data.LastMoveTime, _stuckTime))
{
if (data.Cow.isValid())
{
@ -172,7 +185,7 @@ public class PerkCowAngryHerd extends SmashPerk
}
// Move
if (UtilTime.elapsed(data.LastMoveTime, FORCE_MOVE) && UtilEnt.isGrounded(data.Cow))
if (UtilTime.elapsed(data.LastMoveTime, _forceMove) && UtilEnt.isGrounded(data.Cow))
{
data.Cow.setVelocity(data.Direction.clone().add(new Vector(0, 0.75, 0)));
}
@ -199,12 +212,12 @@ public class PerkCowAngryHerd extends SmashPerk
continue;
}
if (UtilMath.offset(player, data.Cow) < HIT_BOX_RADIUS)
if (UtilMath.offset(player, data.Cow) < _hitBoxRadius)
{
if (Recharge.Instance.use(player, "Hit by " + data.Player.getName(), HIT_FREQUENCY, false, false))
if (Recharge.Instance.use(player, "Hit by " + data.Player.getName(), _hitFrequency, false, false))
{
// Damage Event
Manager.GetDamage().NewDamageEvent(player, data.Player, null, data.Cow.getLocation(), DamageCause.CUSTOM, DAMAGE, true, true, false, UtilEnt.getName(data.Player), GetName());
Manager.GetDamage().NewDamageEvent(player, data.Player, null, data.Cow.getLocation(), DamageCause.CUSTOM, _damage, true, true, false, UtilEnt.getName(data.Player), GetName());
UtilParticle.PlayParticleToAll(ParticleType.LARGE_EXPLODE, data.Cow.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0, 12, ViewDist.LONG);

View File

@ -30,10 +30,10 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkCowMilkSpiral extends SmashPerk
{
private static final int COOLDOWN_NORMAL = 11000;
private static final int COOLDOWN_SMASH = 6000;
private static final int HIT_BOX_RADIUS = 2;
private static final int DAMAGE = 6;
private int _cooldownNormal;
private int _cooldownSmash;
private int _hitBoxRadius;
private int _damage;
private Set<DataCowMilkSpiral> _active = new HashSet<>();
@ -42,6 +42,15 @@ public class PerkCowMilkSpiral extends SmashPerk
super("Milk Spiral", new String[] { C.cYellow + "Right Click" + C.cGray + " with Spade to " + C.cGreen + "Milk Spiral", C.cGray + "Crouch to cancel movement for Milk Spiral" });
}
@Override
public void setupValues()
{
_cooldownNormal = getPerkTime("Cooldown Normal");
_cooldownSmash = getPerkTime("Cooldown Smash");
_hitBoxRadius = getPerkInt("Hit Box Radius");
_damage = getPerkInt("Damage");
}
@EventHandler
public void activate(PlayerInteractEvent event)
{
@ -72,7 +81,7 @@ public class PerkCowMilkSpiral extends SmashPerk
return;
}
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? COOLDOWN_SMASH : COOLDOWN_NORMAL, true, true))
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? _cooldownSmash : _cooldownNormal, true, true))
{
return;
}
@ -104,14 +113,14 @@ public class PerkCowMilkSpiral extends SmashPerk
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (player.equals(data.Player))
if (player.equals(data.Player) || !Recharge.Instance.use(player, GetName() + " Rate", 3000, false, false))
{
continue;
}
if (UtilMath.offset(player.getLocation().add(0, 1, 0), data.Spiral) < HIT_BOX_RADIUS)
if (UtilMath.offset(player.getLocation().add(0, 1, 0), data.Spiral) < _hitBoxRadius)
{
Manager.GetDamage().NewDamageEvent(player, data.Player, null, DamageCause.CUSTOM, DAMAGE, true, false, false, player.getName(), GetName());
Manager.GetDamage().NewDamageEvent(player, data.Player, null, DamageCause.CUSTOM, _damage, true, false, false, player.getName(), GetName());
UtilParticle.PlayParticle(isSuperActive(player) ? ParticleType.RED_DUST : ParticleType.FIREWORKS_SPARK, player.getLocation().add(0, 1, 0), 0.2f, 0.2f, 0.2f, 0.3f, 30,
ViewDist.LONG, UtilServer.getPlayers());

View File

@ -30,6 +30,9 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkCowStampede extends SmashPerk
{
private long _speedTime;
private Map<UUID, Long> _sprintTime = new HashMap<>();
private Map<UUID, Integer> _sprintStr = new HashMap<>();
@ -38,6 +41,12 @@ public class PerkCowStampede extends SmashPerk
super("Stampede", new String[] { C.cGray + "Build up Speed Levels as you sprint.", C.cGray + "+1 damage for each Speed Level.", });
}
@Override
public void setupValues()
{
_speedTime = getPerkTime("Speed Time");
}
@EventHandler
public void update(UpdateEvent event)
{
@ -77,7 +86,7 @@ public class PerkCowStampede extends SmashPerk
}
// Upgrade Speed
if (!UtilTime.elapsed(time, 3000))
if (!UtilTime.elapsed(time, _speedTime))
{
continue;
}

View File

@ -14,13 +14,21 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashCow extends SmashUltimate
{
private static final int DURATION = 30000;
private static final int DAMAGE_BUFF = 1;
private static final int HEALTH = 30;
private int _damageBuff;
private int _health;
public SmashCow()
{
super("Mooshroom Madness", new String[] {}, Sound.COW_IDLE, DURATION);
super("Mooshroom Madness", new String[] {}, Sound.COW_IDLE, 0);
}
@Override
public void setupValues()
{
super.setupValues();
_damageBuff = getPerkInt("Damage Buff");
_health = getPerkInt("Health");
}
@Override
@ -33,8 +41,8 @@ public class SmashCow extends SmashUltimate
kit.disguise(player, DisguiseMooshroom.class);
// Health
player.setMaxHealth(HEALTH);
player.setHealth(HEALTH);
player.setMaxHealth(_health);
player.setHealth(_health);
// Sound
player.getWorld().playSound(player.getLocation(), Sound.COW_HURT, 5f, 0.25f);
@ -67,7 +75,7 @@ public class SmashCow extends SmashUltimate
if (isUsingUltimate(player))
{
event.AddMod(player.getName(), GetName(), DAMAGE_BUFF, false);
event.AddMod(player.getName(), GetName(), _damageBuff, false);
}
}
}

View File

@ -25,10 +25,10 @@ import nautilus.game.arcade.kit.Perk;
public class PerkCreeperElectricity extends Perk
{
private static final int DURATION = 2000;
private static final int SHOCK = 1;
private static final int DAMAGE = 4;
private static final float KNOCKBACK_MAGNITUDE = 2.5F;
private int _duration;
private int _shock;
private int _damage;
private float _knockbackMagnitude;
private Map<UUID, Long> _active = new HashMap<>();
@ -37,6 +37,15 @@ public class PerkCreeperElectricity extends Perk
super("Lightning Shield", new String[] { "When hit by a non-melee attack, you gain " + C.cGreen + "Lightning Shield" });
}
@Override
public void setupValues()
{
_duration = getPerkTime("Duration");
_shock = getPerkInt("Shock");
_damage = getPerkInt("Damage");
_knockbackMagnitude = getPerkFloat("Knockback Magnitude");
}
@EventHandler
public void Shield(CustomDamageEvent event)
{
@ -103,7 +112,7 @@ public class PerkCreeperElectricity extends Perk
continue;
}
if (UtilTime.elapsed(_active.get(key), DURATION))
if (UtilTime.elapsed(_active.get(key), _duration))
{
shieldIterator.remove();
@ -152,12 +161,12 @@ public class PerkCreeperElectricity extends Perk
// Elec
damagee.getWorld().strikeLightningEffect(damagee.getLocation());
Manager.GetCondition().Factory().Shock(GetName(), event.GetDamagerEntity(false), event.GetDamageeEntity(), SHOCK, false, false);
Manager.GetCondition().Factory().Shock(GetName(), event.GetDamagerEntity(false), event.GetDamageeEntity(), _shock, false, false);
SetPowered(damagee, false);
// Damage Event
Manager.GetDamage().NewDamageEvent(event.GetDamagerEntity(false), damagee, null, DamageCause.LIGHTNING, DAMAGE, true, true, false, damagee.getName(), GetName());
Manager.GetDamage().NewDamageEvent(event.GetDamagerEntity(false), damagee, null, DamageCause.LIGHTNING, _damage, true, true, false, damagee.getName(), GetName());
}
public DisguiseCreeper GetDisguise(Player player)
@ -211,6 +220,6 @@ public class PerkCreeperElectricity extends Perk
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
}

View File

@ -1,36 +1,9 @@
package nautilus.game.arcade.game.games.smash.perks.creeper;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.UUID;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
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.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.*;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilItem;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
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.disguise.disguises.DisguiseBase;
import mineplex.core.disguise.disguises.DisguiseCreeper;
import mineplex.core.recharge.Recharge;
@ -40,24 +13,56 @@ import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerToggleSneakEvent;
import java.util.*;
public class PerkCreeperExplode extends SmashPerk
{
private static final int COOLDOWN = 8000;
private static final int WARMUP = 1500;
private static final int RADIUS_NORMAL = 8;
private static final int RADIUS_SMASH = 24;
private static final int DAMAGE_NORMAL = 20;
private static final int DAMAGE_SMASH = 30;
private static final int SPAWN_REMOVAL_RADIUS = 14;
private static final float KNOCKBACK_MAGNITUDE = 2.5F;
private int _cooldown;
private int _warmup;
private int _radiusNormal;
private int _radiusSmash;
private int _damageNormal;
private int _damageSmash;
private double _damageReduction;
private int _spawnRemovalRadius;
private float _knockbackMagnitude;
private int _blockDestroyRadius;
private int _blockRegeneration;
private Map<UUID, Long> _active = new HashMap<>();
private Map<Location, Long> _removedSpawns = new HashMap<>();
public PerkCreeperExplode()
{
super("Explode", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Shovel use " + C.cGreen + "Explosive Leap" });
super("Explode", new String[]{C.cYellow + "Right-Click" + C.cGray + " with Shovel use " + C.cGreen + "Explosive Leap"});
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_warmup = getPerkInt("Warmup (ms)");
_radiusNormal = getPerkInt("Radius Normal");
_radiusSmash = getPerkInt("Radius Smash");
_damageNormal = getPerkInt("Damage Normal");
_damageSmash = getPerkInt("Damage Smash");
_damageReduction = getPerkPercentage("Damage Reduction");
_spawnRemovalRadius = (int) Math.pow(getPerkInt("Spawn Removal Radius"), 2);
_knockbackMagnitude = getPerkFloat("Knockback Magnitude");
_blockDestroyRadius = getPerkInt("Block Destroy Radius");
_blockRegeneration = getPerkTime("Block Regeneration Time");
}
@EventHandler
@ -95,7 +100,7 @@ public class PerkCreeperExplode extends SmashPerk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -134,18 +139,19 @@ public class PerkCreeperExplode extends SmashPerk
UtilAction.zeroVelocity(player);
// Sound
player.getWorld().playSound(player.getLocation(), Sound.CREEPER_HISS, (float) (0.5 + elapsed), (float) (0.5 + elapsed));
float volume = (float) 0.5F + elapsed / 1000F;
player.getWorld().playSound(player.getLocation(), Sound.CREEPER_HISS, volume, volume);
IncreaseSize(player);
player.setExp(Math.min(0.999f, elapsed / (float) WARMUP));
player.setExp(Math.min(0.999f, elapsed / (float) _warmup));
// Not Detonated
if (!UtilTime.elapsed(_active.get(key), WARMUP))
if (!UtilTime.elapsed(_active.get(key), _warmup))
{
continue;
}
player.setExp(0);
chargeIterator.remove();
@ -172,29 +178,23 @@ public class PerkCreeperExplode extends SmashPerk
}
// Blocks
Collection<Block> blocks = UtilBlock.getInRadius(player.getLocation(), 12).keySet();
Iterator<Block> iter = blocks.iterator();
Collection<Block> blocks = UtilBlock.getInRadius(player.getLocation(), _blockDestroyRadius).keySet();
while (iter.hasNext())
{
Block b = iter.next();
blocks.removeIf(b -> b.getType() == Material.STATIONARY_LAVA || b.getType() == Material.LAVA || b.getType() == Material.BEDROCK);
if (b.getType() == Material.STATIONARY_LAVA || b.getType() == Material.LAVA || b.getType() == Material.BEDROCK)
{
iter.remove();
}
}
Manager.GetExplosion().BlockExplosion(blocks, player.getLocation(), false);
// Remove Spawns
Iterator<Location> spawnIterator = Manager.GetGame().GetTeam(player).GetSpawns().iterator();
while (spawnIterator.hasNext())
{
Location spawn = spawnIterator.next();
Iterator<Location> iterator = Manager.GetGame().GetTeam(player).GetSpawns().iterator();
if (UtilMath.offset(player.getLocation(), spawn) < SPAWN_REMOVAL_RADIUS)
while (iterator.hasNext())
{
Location spawn = iterator.next();
if (UtilMath.offsetSquared(player.getLocation(), spawn) < _spawnRemovalRadius)
{
spawnIterator.remove();
_removedSpawns.put(spawn, System.currentTimeMillis());
iterator.remove();
}
}
@ -209,8 +209,8 @@ public class PerkCreeperExplode extends SmashPerk
}
}
double maxRange = isSuperActive(player) ? RADIUS_SMASH : RADIUS_NORMAL;
double damage = isSuperActive(player) ? DAMAGE_SMASH : DAMAGE_NORMAL;
double maxRange = isSuperActive(player) ? _radiusSmash : _radiusNormal;
double damage = isSuperActive(player) ? _damageSmash : _damageNormal;
// Damage
for (LivingEntity ent : UtilEnt.getInRadius(player.getLocation(), maxRange).keySet())
@ -245,7 +245,22 @@ public class PerkCreeperExplode extends SmashPerk
}
}
}
@EventHandler
public void toggleSneak(PlayerToggleSneakEvent event)
{
Player player = event.getPlayer();
if (!_active.containsKey(player.getUniqueId()) || isSuperActive(player))
{
return;
}
_active.remove(player.getUniqueId());
DecreaseSize(player);
UtilPlayer.message(player, F.main("Skill", "You cancelled " + F.skill(GetName()) + "."));
}
public void activate(Player player)
{
_active.put(player.getUniqueId(), System.currentTimeMillis());
@ -316,7 +331,8 @@ public class PerkCreeperExplode extends SmashPerk
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddMod(GetName(), event.GetDamage() * -0.25);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
@EventHandler
@ -338,4 +354,43 @@ public class PerkCreeperExplode extends SmashPerk
DecreaseSize(player);
}
@EventHandler
public void damageReduction(CustomDamageEvent event)
{
Player player = event.GetDamageePlayer();
if (player == null)
{
return;
}
if (_active.containsKey(player.getUniqueId()))
{
event.AddMod("Damage Reduction", -event.GetDamage() * _damageReduction);
}
}
@EventHandler
public void addDestroyedSpawns(UpdateEvent event)
{
if (event.getType() != UpdateType.SLOW)
{
return;
}
GameTeam team = Manager.GetGame().GetTeamList().get(0);
Iterator<Location> iterator = _removedSpawns.keySet().iterator();
while (iterator.hasNext())
{
Location spawn = iterator.next();
if (UtilTime.elapsed(_removedSpawns.get(spawn), _blockRegeneration))
{
team.GetSpawns().add(spawn);
iterator.remove();
}
}
}
}

View File

@ -1,5 +1,17 @@
package nautilus.game.arcade.game.games.smash.perks.creeper;
import mineplex.core.common.util.*;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
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.game.games.smash.perks.SmashPerk;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
@ -9,41 +21,110 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
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.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilItem;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
public class PerkCreeperSulphurBomb extends SmashPerk implements IThrown
public class PerkCreeperSulphurBomb extends SmashPerk
{
private static final int COOLDOWN = 3000;
private static final float DAMAGE = 6.5F;
private static final float KNOCKBACK_MAGNITUDE = 2.5F;
private static ItemStack POWDER = new ItemStack(Material.SULPHUR);
private int _cooldown;
private float _damage;
private float _knockbackMagnitude;
private float _damagePowder;
private final IThrown _sulphurThrown = new IThrown()
{
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
Explode(data);
if (target == null)
{
return;
}
// Damage Event
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, _damage, true, true, false, UtilEnt.getName(data.getThrower()), GetName());
}
@Override
public void Idle(ProjectileUser data)
{
Explode(data);
}
@Override
public void Expire(ProjectileUser data)
{
Explode(data);
}
private void Explode(ProjectileUser data)
{
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, data.getThrown().getLocation(), 0, 0, 0, 0, 1, ViewDist.MAX, UtilServer.getPlayers());
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.EXPLODE, 1f, 1.5f);
data.getThrown().remove();
}
};
private final IThrown _powderThrown = new IThrown()
{
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
Explode(data);
if (target == null)
{
return;
}
// Damage Event
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, _damagePowder, false, true, false, UtilEnt.getName(data.getThrower()), GetName());
}
@Override
public void Idle(ProjectileUser data)
{
Explode(data);
}
@Override
public void Expire(ProjectileUser data)
{
Explode(data);
}
private void Explode(ProjectileUser data)
{
UtilParticle.PlayParticleToAll(ParticleType.EXPLODE, data.getThrown().getLocation(), 0, 0, 0, 0, 1, ViewDist.LONG);
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.EXPLODE, 1f, 2f);
data.getThrown().remove();
_sulphur.remove(data.getThrower().getUniqueId());
}
};
private Map<UUID, Item> _sulphur = new HashMap<>();
public PerkCreeperSulphurBomb()
{
super("Sulphur Bomb", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Sulphur Bomb" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_damage = getPerkFloat("Damage");
_knockbackMagnitude = getPerkFloat("Knockback Magnitude");
_damagePowder = getPerkFloat("Damage Powder");
}
@EventHandler
public void ShootWeb(PlayerInteractEvent event)
{
@ -79,7 +160,7 @@ public class PerkCreeperSulphurBomb extends SmashPerk implements IThrown
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -90,9 +171,10 @@ public class PerkCreeperSulphurBomb extends SmashPerk implements IThrown
Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.COAL, (byte) 0));
UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false);
_sulphur.put(player.getUniqueId(), ent);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, true, null, 1f, 1f, null, 1, UpdateType.SLOW, 0.6f);
UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(ent, player, _sulphurThrown, -1, true, true, true, true, null, 1f, 1f, null, 1, UpdateType.SLOW, 0.6f);
// Inform
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
@ -101,37 +183,27 @@ public class PerkCreeperSulphurBomb extends SmashPerk implements IThrown
player.getWorld().playSound(player.getLocation(), Sound.CREEPER_DEATH, 2f, 1.5f);
}
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
@EventHandler
public void dropPowder(UpdateEvent event)
{
Explode(data);
if (target == null)
if (event.getType() != UpdateType.FASTER)
{
return;
}
// Damage Event
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, DAMAGE, true, true, false, UtilEnt.getName(data.getThrower()), GetName());
}
@Override
public void Idle(ProjectileUser data)
{
Explode(data);
}
for (Map.Entry<UUID, Item> entry : _sulphur.entrySet())
{
Player player = UtilPlayer.searchExact(entry.getKey());
@Override
public void Expire(ProjectileUser data)
{
Explode(data);
}
if (player == null)
{
continue;
}
public void Explode(ProjectileUser data)
{
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, data.getThrown().getLocation(), 0, 0, 0, 0, 1, ViewDist.MAX, UtilServer.getPlayers());
data.getThrown().getWorld().playSound(data.getThrown().getLocation(), Sound.EXPLODE, 1f, 1.5f);
data.getThrown().remove();
Item item = entry.getValue();
Item powder = item.getWorld().dropItem(item.getLocation(), POWDER);
Manager.GetProjectile().AddThrow(powder, player, _powderThrown, -1, true, true, true, true, 1F);
}
}
@EventHandler
@ -142,6 +214,6 @@ public class PerkCreeperSulphurBomb extends SmashPerk implements IThrown
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
}

View File

@ -11,7 +11,7 @@ public class SmashCreeper extends SmashUltimate
public SmashCreeper()
{
super("Atomic Blast", new String[] {}, Sound.CREEPER_HISS, 1600);
super("Atomic Blast", new String[] {}, Sound.CREEPER_HISS, 0);
}
@Override

View File

@ -24,12 +24,17 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkBlink extends SmashPerk
{
private static final float INCREMENTAITON = 0.2F;
private static final float INCREMENTATION = 0.2F;
private String _name;
private double _range;
private int _recharge;
public PerkBlink(String name)
{
this(name, 0, 0);
}
public PerkBlink(String name, double range, int recharge)
{
super(name, new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + name });
@ -39,6 +44,13 @@ public class PerkBlink extends SmashPerk
_recharge = recharge;
}
@Override
public void setupValues()
{
_range = getPerkDouble("Range");
_recharge = getPerkTime("Cooldown");
}
@EventHandler
public void Blink(PlayerInteractEvent event)
{
@ -79,7 +91,7 @@ public class PerkBlink extends SmashPerk
return;
}
LineParticle lineParticle = new LineParticle(player.getEyeLocation(), player.getLocation().getDirection(), INCREMENTAITON, _range, null, ParticleType.SMOKE, UtilServer.getPlayers());
LineParticle lineParticle = new LineParticle(player.getEyeLocation(), player.getLocation().getDirection(), INCREMENTATION, _range, null, ParticleType.SMOKE, UtilServer.getPlayers());
while (!lineParticle.update())
{

View File

@ -42,10 +42,11 @@ import nautilus.game.arcade.kit.perks.event.PerkBlockThrowEvent;
public class PerkBlockToss extends SmashPerk implements IThrown
{
private static final int COOLDOWN = 2000;
private static final int CHARGE_TIME = 1200;
private static final int DAMAGE = 9;
private static final float KNOCKBACK_MAGNITUDE = 2.5F;
private int _cooldown;
private int _chargeTime;
private int _damage;
private int _maxDamage;
private float _knockbackMagnitude;
private Map<UUID, BlockTossData> _hold = new HashMap<>();
private Set<UUID> _charged = new HashSet<>();
@ -56,6 +57,16 @@ public class PerkBlockToss extends SmashPerk implements IThrown
super("Block Toss", new String[] { C.cYellow + "Hold Block" + C.cGray + " to " + C.cGreen + "Grab Block", C.cYellow + "Release Block" + C.cGray + " to " + C.cGreen + "Throw Block" });
}
@Override
public void setupValues()
{
_cooldown = getPerkInt("Cooldown (ms)");
_chargeTime = getPerkInt("Charge Time (ms)");
_damage = getPerkInt("Damage");
_maxDamage = getPerkInt("Max Damage");
_knockbackMagnitude = getPerkFloat("Knockback Magnitude");
}
@EventHandler
public void Grab(PlayerInteractEvent event)
{
@ -154,7 +165,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
// Charged Tick
if (!_charged.contains(key))
{
if (System.currentTimeMillis() - _hold.get(key).Time > CHARGE_TIME)
if (System.currentTimeMillis() - _hold.get(key).Time > _chargeTime)
{
_charged.add(key);
player.getWorld().playEffect(player.getLocation(), Effect.CLICK1, 0);
@ -167,7 +178,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
UUID key = cur.getUniqueId();
Recharge.Instance.recharge(cur, GetName());
Recharge.Instance.use(cur, GetName(), COOLDOWN, false, true);
Recharge.Instance.use(cur, GetName(), _cooldown, false, true);
BlockTossData data = _hold.remove(key);
@ -180,7 +191,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
long charge = System.currentTimeMillis() - data.Time;
// Throw
double mult = Math.min(1.4, 1.4 * ((double) charge / CHARGE_TIME));
double mult = Math.min(1.4, 1.4 * ((double) charge / _chargeTime));
// Action
UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0.2, 0, 1, true);
@ -201,7 +212,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
}
// Damage Event
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, data.getThrown().getVelocity().length() * DAMAGE, true, true, false, UtilEnt.getName(data
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.PROJECTILE, Math.min(_maxDamage, data.getThrown().getVelocity().length() * _damage), true, true, false, UtilEnt.getName(data
.getThrower()), GetName());
// Block to Item
@ -260,6 +271,6 @@ public class PerkBlockToss extends SmashPerk implements IThrown
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
}

View File

@ -28,8 +28,8 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkEndermanTeleport extends SmashPerk
{
private static final int COOLDOWN = 5000;
private static final float CHARGE_PER_TICK = 0.015F;
private int _cooldown = 5000;
private float _chargeTick = 0.015F;
private Map<UUID, Block> _target = new HashMap<>();
private Map<UUID, Float> _charge = new HashMap<>();
@ -39,6 +39,13 @@ public class PerkEndermanTeleport extends SmashPerk
super("Teleport", new String[] { C.cYellow + "Hold Sneak" + C.cGray + " to " + C.cGreen + "Teleport" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_chargeTick = getPerkFloat("Charge Per Tick");
}
@EventHandler
public void update(UpdateEvent event)
{
@ -86,14 +93,14 @@ public class PerkEndermanTeleport extends SmashPerk
// Same Block - Increase Charge
else if (block.equals(_target.get(key)))
{
_charge.put(key, _charge.get(key) + CHARGE_PER_TICK);
_charge.put(key, _charge.get(key) + _chargeTick);
UtilTextMiddle.display(null, UtilTextMiddle.progress(_charge.get(key)), 0, 10, 10, player);
if (_charge.get(key) >= 1)
{
UtilTextMiddle.display(null, C.cGreen + "Teleported", 0, 10, 10, player);
Recharge.Instance.useForce(player, GetName(), COOLDOWN);
Recharge.Instance.useForce(player, GetName(), _cooldown);
while (block.getRelative(BlockFace.UP).getType() != Material.AIR)
{

View File

@ -33,18 +33,29 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashEnderman extends SmashUltimate
{
private static final int DURATION = 30000;
private static final int DRAGON_VELOCITY_MAGNITUDE = 40;
private static final int HIT_COOLDOWN = 1000;
private static final int DAMAGE_RADIUS = 6;
private static final int DAMAGE = 20;
private static final int KNOCKBACK_MAGNITUDE = 4;
private int _dragonVelocity;
private int _hitCooldown;
private int _damageRadius;
private int _damage;
private int _knockbackMagnitude;
private Map<UUID, EnderDragon> _dragons = new HashMap<>();
public SmashEnderman()
{
super("Ender Dragon", new String[] {}, Sound.ENDERDRAGON_GROWL, DURATION);
super("Ender Dragon", new String[] {}, Sound.ENDERDRAGON_GROWL, 0);
}
@Override
public void setupValues()
{
super.setupValues();
_dragonVelocity = getPerkInt("Dragon Velocity");
_hitCooldown = getPerkTime("Hit Cooldown");
_damageRadius = getPerkInt("Damage Radius");
_damage = getPerkInt("Damage");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
}
@Override
@ -105,7 +116,7 @@ public class SmashEnderman extends SmashUltimate
}
// Move
Location target = player.getLocation().add(player.getLocation().getDirection().multiply(DRAGON_VELOCITY_MAGNITUDE));
Location target = player.getLocation().add(player.getLocation().getDirection().multiply(_dragonVelocity));
((CraftEnderDragon) dragon).getHandle().setTargetBlock(target.getBlockX(), target.getBlockY(), target.getBlockZ());
}
}
@ -179,10 +190,10 @@ public class SmashEnderman extends SmashUltimate
continue;
}
if (UtilMath.offset(dragon.getLocation().add(0, 4, 0), other.getLocation()) < DAMAGE_RADIUS && Recharge.Instance.use(other, "Hit By Dragon", HIT_COOLDOWN, false, false))
if (UtilMath.offset(dragon.getLocation().add(0, 4, 0), other.getLocation()) < _damageRadius && Recharge.Instance.use(other, "Hit By Dragon", _hitCooldown, false, false))
{
// Damage Event
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, DAMAGE, true, true, false, player.getName(), GetName());
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage, true, true, false, player.getName(), GetName());
}
}
}
@ -196,7 +207,7 @@ public class SmashEnderman extends SmashUltimate
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
@EventHandler(priority = EventPriority.LOW)

View File

@ -24,7 +24,7 @@ import nautilus.game.arcade.kit.perks.data.FissureData;
public class PerkFissure extends Perk
{
private static final int COOLDOWN = 8000;
private int _cooldown;
private Set<FissureData> _active = new HashSet<>();
@ -33,6 +33,12 @@ public class PerkFissure extends Perk
super("Fissure", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Fissure" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
}
@EventHandler
public void Leap(PlayerInteractEvent event)
{
@ -69,7 +75,7 @@ public class PerkFissure extends Perk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}

View File

@ -25,14 +25,23 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashGolem extends SmashUltimate
{
private static final int DURATION = 16000;
private static final int HIT_FREQUENCY = 400;
private static final int DAMAGE_RADIUS = 2;
private static final int EFFECT_RADIUS = 5;
private int _hitFrequency;
private int _damageRadius;
private int _effectRadius;
public SmashGolem()
{
super("Earthquake", new String[] {}, Sound.IRONGOLEM_HIT, DURATION);
super("Earthquake", new String[] {}, Sound.IRONGOLEM_HIT, 0);
}
@Override
public void setupValues()
{
super.setupValues();
_hitFrequency = getPerkInt("Hit Frequency (ms)");
_damageRadius = getPerkInt("Damage Radius");
_effectRadius = getPerkInt("Effect Radius");
}
@Override
@ -71,7 +80,7 @@ public class SmashGolem extends SmashUltimate
boolean grounded = false;
for (Block block : UtilBlock.getInRadius(other.getLocation(), DAMAGE_RADIUS).keySet())
for (Block block : UtilBlock.getInRadius(other.getLocation(), _damageRadius).keySet())
{
if (block.getType() != Material.AIR)
{
@ -89,13 +98,13 @@ public class SmashGolem extends SmashUltimate
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, 1 + 2 * Math.random(), false, false, false, other.getName(), GetName());
// Velocity
if (Recharge.Instance.use(other, GetName() + " Hit", HIT_FREQUENCY, false, false))
if (Recharge.Instance.use(other, GetName() + " Hit", _hitFrequency, false, false))
{
UtilAction.velocity(other, new Vector(Math.random() - 0.5, Math.random() * 0.2, Math.random() - 0.5), Math.random() * 1 + 1, false, 0, 0.1 + Math.random() * 0.2, 2, true);
}
// Effect
for (Block block : UtilBlock.getInRadius(other.getLocation(), EFFECT_RADIUS).keySet())
for (Block block : UtilBlock.getInRadius(other.getLocation(), _effectRadius).keySet())
{
if (Math.random() < 0.98)
{

View File

@ -37,11 +37,11 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkTargetLazer extends SmashPerk
{
private static final int COOLDOWN = 15000;
private static final int MAX_RANGE = 11;
private static final int MAX_TIME = 8000;
private static final int DAMAGE_INCREASE = 3;
private static final int KNOCKBACK_INCREASE = 1;
private int _cooldown;
private int _maxRange;
private int _maxTime;
private int _damageIncrease;
private int _knockbackIncrease;
private Set<TargetLazerData> _data = new HashSet<>();
@ -49,7 +49,17 @@ public class PerkTargetLazer extends SmashPerk
{
super("Target Laser", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Pickaxe to use " + C.cGreen + "Target Laser" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_maxRange = getPerkInt("Max Range");
_maxTime = getPerkTime("Max Time");
_damageIncrease = getPerkInt("Damage Increase");
_knockbackIncrease = getPerkInt("Knockback Increase");
}
@EventHandler
public void activate(PlayerInteractEvent event)
{
@ -103,7 +113,7 @@ public class PerkTargetLazer extends SmashPerk
double d = UtilMath.offset(player, other);
if (d > MAX_RANGE)
if (d > _maxRange)
{
continue;
}
@ -121,7 +131,7 @@ public class PerkTargetLazer extends SmashPerk
{
if (data.getAttacker().equals(player))
{
if (data.getTimeElapsed() < MAX_TIME)
if (data.getTimeElapsed() < _maxTime)
{
return;
}
@ -180,7 +190,7 @@ public class PerkTargetLazer extends SmashPerk
UtilParticle.PlayParticle(ParticleType.MAGIC_CRIT, data.getTarget().getLocation().add(0, 0.5, 0.5), 1F, 0.5F, 1F, 0.1F, 10, ViewDist.LONG, data.getAttacker());
if (UtilMath.offset(data.getTarget(), data.getAttacker()) > MAX_RANGE || data.getTimeElapsed() > MAX_TIME)
if (UtilMath.offset(data.getTarget(), data.getAttacker()) > _maxRange || data.getTimeElapsed() > _maxTime)
{
long time = data.getTimeElapsed() / 1000;
double damage = 0.5 * time;
@ -192,7 +202,7 @@ public class PerkTargetLazer extends SmashPerk
data.getAttacker().sendMessage(F.main("Game", "Your laser broke, dealing damage to " + F.name(data.getTarget().getName())) + ".");
Manager.GetDamage().NewDamageEvent(data.getTarget(), data.getAttacker(), null, DamageCause.CUSTOM, damage, false, true, false, data.getAttacker().getName(), GetName());
Recharge.Instance.use(data.getAttacker(), GetName(), COOLDOWN, true, true);
Recharge.Instance.use(data.getAttacker(), GetName(), _cooldown, true, true);
iterator.remove();
}
@ -219,8 +229,8 @@ public class PerkTargetLazer extends SmashPerk
if (data.getAttacker().equals(damager) && data.getTarget().equals(damagee))
{
event.AddMod(GetName(), DAMAGE_INCREASE);
event.AddKnockback(GetName(), KNOCKBACK_INCREASE);
event.AddMod(GetName(), _damageIncrease);
event.AddKnockback(GetName(), _knockbackIncrease);
data.getAttacker().playEffect(damagee.getLocation().add(0, 0.5, 0), Effect.STEP_SOUND, Material.REDSTONE_BLOCK);
}
}
@ -230,18 +240,8 @@ public class PerkTargetLazer extends SmashPerk
public void death(PlayerDeathEvent event)
{
Player player = event.getEntity();
Iterator<TargetLazerData> iterator = _data.iterator();
while (iterator.hasNext())
{
TargetLazerData data = iterator.next();
if (data.getTarget().equals(player) || data.getAttacker().equals(player))
{
iterator.remove();
}
}
_data.removeIf(data -> data.getTarget().equals(player) || data.getAttacker().equals(player));
}
private void setLazerTarget(Player disguised, Player target)

View File

@ -13,15 +13,23 @@ import nautilus.game.arcade.kit.Perk;
public class PerkThorns extends Perk
{
private static final int MAX_HEALTH = 10;
private static final float DAMAGE_DECREASE = 0.66F;
private static final float KNOCKBACK_DECREASE = 0.66F;
private int _maxHealth;
private double _damageDecrease;
private double _knockbackDecrease;
public PerkThorns()
{
super("Thorns", new String[] { C.cGray + "Takes 66% less damage and knockback from projectiles", C.cGray + "when under 10 health."});
}
@Override
public void setupValues()
{
_maxHealth = getPerkInt("Max Health");
_damageDecrease = getPerkPercentage("Damage Decrease");
_knockbackDecrease = getPerkPercentage("Knockback Decrease");
}
@EventHandler(priority = EventPriority.HIGHEST)
public void damage(CustomDamageEvent event)
{
@ -38,10 +46,10 @@ public class PerkThorns extends Perk
return;
}
if (player.getHealth() < MAX_HEALTH)
if (player.getHealth() < _maxHealth)
{
event.AddMult(GetName(), null, DAMAGE_DECREASE, false);
event.AddKnockback(GetName(), KNOCKBACK_DECREASE);
event.AddMult(GetName(), null, _damageDecrease, false);
event.AddKnockback(GetName(), _knockbackDecrease);
}
}
}

View File

@ -1,13 +1,15 @@
package nautilus.game.arcade.game.games.smash.perks.guardian;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import mineplex.core.common.util.*;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
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.game.games.smash.TeamSuperSmash;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.Effect;
import org.bukkit.Sound;
import org.bukkit.block.Block;
@ -17,36 +19,18 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilItem;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
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.game.games.smash.TeamSuperSmash;
import nautilus.game.arcade.kit.Perk;
import java.util.*;
public class PerkWaterSplash extends Perk
{
private static final int COOLDOWN = 12000;
private static final int VELOCITY_Y = 1;
private static final int RADIUS = 5;
private static final int MIN_AIR_TIME = 750;
private static final int SECOND_BOOST_TIME = 800;
private static final int DAMAGE = 12;
private int _cooldown;
private float _velocityY;
private int _radius;
private int _minAirTime;
private int _secondBoostTime;
private float _secondBoostVelocity;
private int _damage;
private Map<UUID, Long> _active = new HashMap<>();
private Set<UUID> _usedSecondBoost = new HashSet<>();
@ -55,7 +39,19 @@ public class PerkWaterSplash extends Perk
{
super("Water Splash", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Sword to use " + C.cGreen + "Water Splash", C.cYellow + "Hold Block" + C.cGray + " to " + C.cGreen + "Bounce higher with Water Splash" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_velocityY = getPerkFloat("Y Velocity");
_radius = getPerkInt("Radius");
_minAirTime = getPerkInt("Min Air Time (ms)");
_secondBoostTime = getPerkInt("Second Boost Time (ms)");
_secondBoostVelocity = getPerkFloat("Second Boost Velocity");
_damage = getPerkInt("Damage");
}
@EventHandler
public void activate(PlayerInteractEvent event)
{
@ -86,16 +82,16 @@ public class PerkWaterSplash extends Perk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
UtilAction.velocity(player, new Vector(0, VELOCITY_Y, 0));
UtilAction.velocity(player, new Vector(0, _velocityY, 0));
_active.put(player.getUniqueId(), System.currentTimeMillis());
List<Player> team = TeamSuperSmash.getTeam(Manager, player, true);
for (Player other : UtilPlayer.getNearby(player.getLocation(), RADIUS))
for (Player other : UtilPlayer.getNearby(player.getLocation(), _radius))
{
if (team.contains(other))
{
@ -144,14 +140,14 @@ public class PerkWaterSplash extends Perk
UtilParticle.PlayParticleToAll(ParticleType.DRIP_WATER, player.getLocation(), 0.5F, 0.5F, 0.5F, 0.01F, 10, ViewDist.LONG);
if (UtilEnt.isGrounded(player) && UtilTime.elapsed(_active.get(uuid), MIN_AIR_TIME))
if (UtilEnt.isGrounded(player) && UtilTime.elapsed(_active.get(uuid), _minAirTime))
{
iterator.remove();
_usedSecondBoost.remove(uuid);
UtilParticle.PlayParticleToAll(ParticleType.FIREWORKS_SPARK, player.getEyeLocation(), 0, 0, 0, 0.5F, 50, ViewDist.LONG);
for (Block block : UtilBlock.getInRadius(player.getLocation(), RADIUS).keySet())
for (Block block : UtilBlock.getInRadius(player.getLocation(), _radius).keySet())
{
if (Math.random() > 0.5)
{
@ -163,7 +159,7 @@ public class PerkWaterSplash extends Perk
player.getWorld().playSound(player.getLocation(), Sound.SPLASH2, 2, 0);
Map<Player, Double> nearby = UtilPlayer.getInRadius(player.getLocation(), RADIUS);
Map<Player, Double> nearby = UtilPlayer.getInRadius(player.getLocation(), _radius);
List<Player> team = TeamSuperSmash.getTeam(Manager, player, true);
for (Player other : nearby.keySet())
@ -175,15 +171,15 @@ public class PerkWaterSplash extends Perk
double power = nearby.get(other);
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, DAMAGE * power, true, true, false, player.getName(), GetName());
Manager.GetCondition().Factory().Falling(GetName(), other, player, DAMAGE, false, true);
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage * power, true, true, false, player.getName(), GetName());
Manager.GetCondition().Factory().Falling(GetName(), other, player, _damage, false, true);
}
}
else if (UtilTime.elapsed(_active.get(uuid), SECOND_BOOST_TIME) && !_usedSecondBoost.contains(uuid) && player.isBlocking())
else if (UtilTime.elapsed(_active.get(uuid), _secondBoostTime) && !_usedSecondBoost.contains(uuid) && player.isBlocking())
{
_usedSecondBoost.add(uuid);
Vector direction = player.getLocation().getDirection().setY(0.2);
Vector direction = player.getLocation().getDirection().multiply(_secondBoostVelocity);
UtilAction.velocity(player, direction);
}

View File

@ -37,11 +37,11 @@ import nautilus.game.arcade.kit.Perk;
public class PerkWhirlpoolBlade extends Perk implements IThrown
{
private static final int COOLDOWN = 5000;
private static final int EXPIRE_TIME = 3000;
private static final float VELOCITY = 1.6F;
private static final float HIT_BOX = 0.5F;
private static final int DAMAGE = 5;
private int _cooldown;
private int _expireTime;
private float _velocity;
private float _hitBox;
private int _damage;
private Set<Item> _items = new HashSet<>();
@ -49,7 +49,17 @@ public class PerkWhirlpoolBlade extends Perk implements IThrown
{
super("Whirlpool Axe", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Whirlpool Axe" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_expireTime = getPerkTime("Expire Time");
_velocity = getPerkFloat("Velocity");
_hitBox = getPerkFloat("Hit Box");
_damage = getPerkInt("Damage");
}
@EventHandler
public void activate(PlayerInteractEvent event)
{
@ -80,7 +90,7 @@ public class PerkWhirlpoolBlade extends Perk implements IThrown
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -89,8 +99,8 @@ public class PerkWhirlpoolBlade extends Perk implements IThrown
Item item = player.getWorld().dropItem(player.getEyeLocation(), new ItemStack(Material.PRISMARINE_SHARD));
item.setVelocity(player.getLocation().getDirection().multiply(VELOCITY));
Manager.GetProjectile().AddThrow(item, player, this, EXPIRE_TIME, true, true, true, false, false, HIT_BOX);
item.setVelocity(player.getLocation().getDirection().multiply(_velocity));
Manager.GetProjectile().AddThrow(item, player, this, _expireTime, true, true, true, false, false, _hitBox);
_items.add(item);
}
@ -131,7 +141,7 @@ public class PerkWhirlpoolBlade extends Perk implements IThrown
return;
}
CustomDamageEvent event = Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, DAMAGE, false, true, true, data.getThrower().getName(), GetName());
CustomDamageEvent event = Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, _damage, false, true, true, data.getThrower().getName(), GetName());
if(event.IsCancelled())
{
return;

View File

@ -98,7 +98,7 @@ public class SmashAnimationData
{
_ticks++;
if (_ticks % 10 == 0)
if (_ticks % 5 == 0)
{
_blockRadius++;
@ -133,13 +133,13 @@ public class SmashAnimationData
}
LineParticle lineParticle = new LineParticle(player.getEyeLocation(), _target.getEyeLocation(), vector, 0.2, offset, null, ParticleType.WITCH_MAGIC, UtilServer.getPlayers());
while (!lineParticle.update())
{
}
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_REMEDY, 1, 0.75F);
UtilAction.velocity(player, vector.setY(player.getLocation().getY() - 3 > _target.getLocation().getY() ? 0 : 0.5).multiply(0.5));
UtilAction.velocity(player, vector.setY(player.getLocation().getY() - 3 > _target.getLocation().getY() ? 0 : 0.5).multiply(0.7));
_manager.GetDamage().NewDamageEvent(player, _player, null, DamageCause.CUSTOM, VELOCITY_DAMAGE, false, true, false, _player.getName(), "Mini Guardian");
}
}

View File

@ -27,16 +27,25 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashGuardian extends SmashUltimate
{
private static final int DURATION = 10000;
private static final int GUARDIANS = 4;
private static final int RADIUS = 15;
private static final int DAMAGE = 40;
private int _radius;
private int _damage;
private Set<SmashAnimationData> _data = new HashSet<>();
public SmashGuardian()
{
super("Rise of the Guardian", new String[] {}, Sound.AMBIENCE_THUNDER, DURATION);
super("Rise of the Guardian", new String[] {}, Sound.AMBIENCE_THUNDER, 0);
}
@Override
public void setupValues()
{
super.setupValues();
_radius = getPerkInt("Radius");
_damage = getPerkInt("Damage");
}
@Override
@ -46,7 +55,7 @@ public class SmashGuardian extends SmashUltimate
Manager.GetGame().CreatureAllowOverride = true;
_data.add(new SmashAnimationData(Manager, player, GUARDIANS, DURATION));
_data.add(new SmashAnimationData(Manager, player, GUARDIANS, getLength()));
Manager.GetGame().CreatureAllowOverride = false;
}
@ -64,7 +73,7 @@ public class SmashGuardian extends SmashUltimate
if (data.getPlayer().equals(player))
{
Map<Player, Double> inRadius = UtilPlayer.getInRadius(data.getTarget().getLocation(), RADIUS);
Map<Player, Double> inRadius = UtilPlayer.getInRadius(data.getTarget().getLocation(), _radius);
List<Player> team = TeamSuperSmash.getTeam(Manager, player, true);
for (Player other : inRadius.keySet())
{
@ -73,11 +82,11 @@ public class SmashGuardian extends SmashUltimate
continue;
}
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, DAMAGE * inRadius.get(other), true, true, false, player.getName(), GetName());
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage * inRadius.get(other), true, true, false, player.getName(), GetName());
}
data.getTarget().getWorld().strikeLightningEffect(data.getTarget().getLocation());
UtilParticle.PlayParticleToAll(ParticleType.HUGE_EXPLOSION, data.getTarget().getLocation().add(0, 2, 0), RADIUS, 1, RADIUS, 1F, 30, ViewDist.MAX);
UtilParticle.PlayParticleToAll(ParticleType.HUGE_EXPLOSION, data.getTarget().getLocation().add(0, 2, 0), _radius, 1, _radius, 1F, 30, ViewDist.MAX);
player.getWorld().playSound(data.getTarget().getLocation(), Sound.EXPLODE, 5, 0.5F);
data.getElder().remove();

View File

@ -35,10 +35,10 @@ import nautilus.game.arcade.kit.perks.data.FireflyData;
public class PerkFlameDash extends Perk
{
private static final int COOLDOWN = 8000;
private static final int TIME = 800;
private static final int DAMAGE_RADIUS = 3;
private static final int KNOCKBACK_MAGNITUDE = 2;
private int _cooldown;
private int _time;
private int _damageRadius;
private int _knockbackMagnitude;
private Set<FireflyData> _data = new HashSet<FireflyData>();
@ -47,6 +47,15 @@ public class PerkFlameDash extends Perk
super("Flame Dash", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Spade to use " + C.cGreen + "Flame Dash" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_time = getPerkInt("Time (ms)");
_damageRadius = getPerkInt("Damage Radius");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
}
@EventHandler
public void Skill(PlayerInteractEvent event)
{
@ -96,14 +105,14 @@ public class PerkFlameDash extends Perk
}
else
{
Recharge.Instance.use(player, GetName(), COOLDOWN, true, true);
Recharge.Instance.use(player, GetName(), _cooldown, true, true);
}
return;
}
Recharge.Instance.recharge(player, GetName());
Recharge.Instance.use(player, GetName(), COOLDOWN, true, true);
Recharge.Instance.use(player, GetName(), _cooldown, true, true);
_data.add(new FireflyData(player));
@ -130,7 +139,7 @@ public class PerkFlameDash extends Perk
FireflyData data = dataIterator.next();
// Move
if (!UtilTime.elapsed(data.Time, TIME))
if (!UtilTime.elapsed(data.Time, _time))
{
Vector vel = data.Location.getDirection();
vel.setY(0);
@ -148,7 +157,7 @@ public class PerkFlameDash extends Perk
// End
else
{
for (Player other : UtilPlayer.getNearby(data.Player.getLocation(), DAMAGE_RADIUS))
for (Player other : UtilPlayer.getNearby(data.Player.getLocation(), _damageRadius))
{
if (other.equals(data.Player))
{
@ -191,6 +200,6 @@ public class PerkFlameDash extends Perk
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
}

View File

@ -43,13 +43,12 @@ import nautilus.game.arcade.kit.Perk;
public class PerkMagmaBlast extends Perk
{
private static final int COOLDOWN = 6000;
private static final float FIREBALL_VELOCITY = 0.2F;
private static final int FIRE_TICKS = 40;
private static final int VELOCITY_RADIUS = 8;
private static final int FIRE_RADIUS = 2;
private static final int DAMAGE = 8;
private int _cooldown;
private float _velocity;
private int _fireTicks;
private int _velocityRadius;
private int _fireRadius;
private int _damage;
private Map<LargeFireball, Location> _proj = new HashMap<>();
@ -58,6 +57,17 @@ public class PerkMagmaBlast extends Perk
super("Magma Blast", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Magma Blast" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_velocity = getPerkFloat("Velocity");
_fireTicks = getPerkInt("Fire Ticks");
_velocityRadius = getPerkInt("Velocity Radius");
_fireRadius = getPerkInt("Fire Radius");
_damage = getPerkInt("Damage");
}
@EventHandler
public void Shoot(PlayerInteractEvent event)
{
@ -88,7 +98,7 @@ public class PerkMagmaBlast extends Perk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -103,7 +113,7 @@ public class PerkMagmaBlast extends Perk
ball.setBounce(false);
ball.teleport(player.getEyeLocation().add(player.getLocation().getDirection().multiply(1)));
Vector dir = player.getLocation().getDirection().multiply(FIREBALL_VELOCITY);
Vector dir = player.getLocation().getDirection().multiply(_velocity);
EntityLargeFireball eFireball = ((CraftLargeFireball) ball).getHandle();
eFireball.dirX = dir.getX();
@ -165,24 +175,29 @@ public class PerkMagmaBlast extends Perk
{
return;
}
proj.remove();
Player shooter = (Player) proj.getShooter();
// Velocity Players
Map<Player, Double> hitMap = UtilPlayer.getInRadius(proj.getLocation(), VELOCITY_RADIUS);
Map<Player, Double> hitMap = UtilPlayer.getInRadius(proj.getLocation(), _velocityRadius);
List<Player> team = TeamSuperSmash.getTeam(Manager, shooter, false);
for (Player cur : hitMap.keySet())
{
if(team.contains(cur))
{
{
continue;
}
continue;
}
double range = hitMap.get(cur);
Manager.GetDamage().NewDamageEvent(cur, shooter, proj, DamageCause.PROJECTILE, range * DAMAGE, false, true, false, shooter.getName(), GetName());
if (range > 0.8)
{
range = 1;
}
Manager.GetDamage().NewDamageEvent(cur, shooter, proj, DamageCause.PROJECTILE, range * _damage, false, true, false, shooter.getName(), GetName());
// Velocity
UtilAction.velocity(cur, UtilAlg.getTrajectory(proj.getLocation().add(0, -0.5, 0), cur.getEyeLocation()), 1 + 2 * range, false, 0, 0.2 + 0.4 * range, 1.2, true);
@ -222,9 +237,9 @@ public class PerkMagmaBlast extends Perk
}
}
if (UtilMath.offset(player, proj) < FIRE_RADIUS)
if (UtilMath.offset(player, proj) < _fireRadius)
{
player.setFireTicks(FIRE_TICKS);
player.setFireTicks(_fireTicks);
}
}
}

View File

@ -1,14 +1,5 @@
package nautilus.game.arcade.game.games.smash.perks.magmacube;
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.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
@ -20,21 +11,42 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
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.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.inventory.ItemStack;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
public class PerkMagmaBoost extends Perk
{
private static final int MAX_STACKS = 3;
private static final ItemStack BOOTS = new ItemStack(Material.IRON_BOOTS);
private static final ItemStack CHESTPLATE = new ItemStack(Material.IRON_CHESTPLATE);
private static final ItemStack HELMET = new ItemStack(Material.IRON_HELMET);
private int _maxStacks;
private Map<UUID, Integer> _kills = new HashMap<>();
public PerkMagmaBoost()
{
super("Fuel the Fire", new String[] { C.cGray + "Kills give +1 Damage, -15% Knockback Taken and +1 Size.", C.cGray + "Kill bonuses can stack " + MAX_STACKS + " times, and reset on death.", });
super("Fuel the Fire", new String[0]);
}
@Override
public void setupValues()
{
_maxStacks = getPerkInt("Max Stacks");
setDesc(C.cGray + "Kills give +1 Damage, -15% Knockback Taken and +1 Size.", C.cGray + "Kill bonuses can stack " + _maxStacks + " times, and reset on death.");
}
@EventHandler
@ -50,7 +62,7 @@ public class PerkMagmaBoost extends Perk
public void kill(CombatDeathEvent event)
{
Player killed = (Player) event.GetEvent().getEntity();
_kills.remove(killed.getUniqueId());
if (event.GetLog().GetKiller() == null)
@ -80,14 +92,28 @@ public class PerkMagmaBoost extends Perk
size += _kills.get(key);
}
size = Math.min(MAX_STACKS, size);
size = Math.min(_maxStacks, size);
// Adjust armour
if (size == 1)
{
killer.getInventory().setBoots(BOOTS);
}
else if (size == 2)
{
killer.getInventory().setChestplate(CHESTPLATE);
}
else if (size == 3)
{
killer.getInventory().setHelmet(HELMET);
}
_kills.put(key, size);
slime.SetSize(size + 1);
Manager.GetDisguise().updateDisguise(slime);
killer.setExp(0.99F * (size / (float) MAX_STACKS));
killer.setExp(0.99F * (size / (float) _maxStacks));
}
@EventHandler(priority = EventPriority.HIGHEST)
@ -104,7 +130,7 @@ public class PerkMagmaBoost extends Perk
}
Player damager = event.GetDamagerPlayer(false);
if (damager == null)
{
return;
@ -116,12 +142,12 @@ public class PerkMagmaBoost extends Perk
}
UUID key = damager.getUniqueId();
if (!_kills.containsKey(key))
{
return;
}
event.AddMod(damager.getName(), GetName(), _kills.get(key), false);
}
@ -132,12 +158,12 @@ public class PerkMagmaBoost extends Perk
{
return;
}
if (event.GetCause() != DamageCause.ENTITY_ATTACK)
{
return;
}
Player damagee = event.GetDamageePlayer();
if (damagee == null)

View File

@ -17,9 +17,7 @@ import nautilus.game.arcade.kit.perks.data.MeteorShowerData;
public class SmashMagmacube extends SmashUltimate
{
private static final int DURATION = 12000;
private List<MeteorShowerData> _meteors = new ArrayList<>();
public SmashMagmacube()
@ -30,7 +28,7 @@ public class SmashMagmacube extends SmashUltimate
@Override
public void activate(Player player)
{
_meteors.add(new MeteorShowerData(player, UtilPlayer.getTarget(player, UtilBlock.blockPassSet, 128).getLocation(), DURATION));
_meteors.add(new MeteorShowerData(player, UtilPlayer.getTarget(player, UtilBlock.blockPassSet, 128).getLocation(), getLength()));
}
@EventHandler
@ -40,17 +38,7 @@ public class SmashMagmacube extends SmashUltimate
{
return;
}
Iterator<MeteorShowerData> meteorIter = _meteors.iterator();
while (meteorIter.hasNext())
{
MeteorShowerData data = meteorIter.next();
if (data.update())
{
meteorIter.remove();
}
}
_meteors.removeIf(MeteorShowerData::update);
}
}

View File

@ -40,14 +40,14 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkPigBaconBomb extends SmashPerk
{
private static final float ENERGY_PER_PIG = 0.35F;
private static final float ENERGY_PER_PIG_DISGUISED_FACTOR = 0.7F;
private static final int COOLDOWN = 100;
private static final int PIG_MAX_TICKS = 80;
private static final float PIG_SPEED = 1.2F;
private static final int PIG_EXPLODE_RADIUS = 2;
private static final int PIG_EXPLODE_DAMAGE = 4;
private static final int PIG_EXPLODE_DAMAGE_RADIUS = 4;
private float _energyPig;
private float _energyPigDisguiseFactor;
private int _cooldown;
private int _maxTicks;
private float _pigSpeed;
private int _explodeRadius;
private int _explodeDamage;
private int _explodeDamageRadius;
private Map<UUID, Set<Pig>> _pigs = new HashMap<UUID, Set<Pig>>();
@ -56,6 +56,19 @@ public class PerkPigBaconBomb extends SmashPerk
super("Baby Bacon Bomb", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Spade to " + C.cGreen + "Baby Bacon Bomb" });
}
@Override
public void setupValues()
{
_energyPig = getPerkFloat("Energy Per Pig");
_energyPigDisguiseFactor = getPerkFloat("Energy Per Pig Disguise Factor");
_cooldown = getPerkInt("Cooldown (ms)");
_maxTicks = getPerkInt("Pig Max Ticks");
_pigSpeed = getPerkFloat("Pig Speed");
_explodeRadius = getPerkInt("Pig Explode Radius");
_explodeDamage = getPerkInt("Pig Explode Damage");
_explodeDamageRadius = getPerkInt("Pig Explode Damage Radius");
}
@EventHandler
public void Skill(PlayerInteractEvent event)
{
@ -86,13 +99,13 @@ public class PerkPigBaconBomb extends SmashPerk
return;
}
float energy = ENERGY_PER_PIG;
float energy = _energyPig;
DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player);
if (disguise != null && disguise instanceof DisguisePigZombie)
{
energy = energy * ENERGY_PER_PIG_DISGUISED_FACTOR;
energy = energy * _energyPigDisguiseFactor;
}
// Energy
@ -103,7 +116,7 @@ public class PerkPigBaconBomb extends SmashPerk
}
// Recharge
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, false, false))
if (!Recharge.Instance.use(player, GetName(), _cooldown, false, false))
{
return;
}
@ -112,7 +125,7 @@ public class PerkPigBaconBomb extends SmashPerk
player.setExp(Math.max(0f, player.getExp() - energy));
// Velocity
UtilAction.velocity(player, player.getLocation().getDirection(), 0.8, true, 0.9, 0, 1, true);
UtilAction.velocity(player, player.getLocation().getDirection(), 0.8, true, 1.2, 0, 1, true);
// Sound
player.getWorld().playSound(player.getLocation(), Sound.PIG_IDLE, 2f, 0.75f);
@ -163,7 +176,7 @@ public class PerkPigBaconBomb extends SmashPerk
{
Pig pig = pigIterator.next();
if (!pig.isValid() || pig.getTicksLived() > PIG_MAX_TICKS)
if (!pig.isValid() || pig.getTicksLived() > _maxTicks)
{
PigExplode(pigIterator, pig, player);
continue;
@ -176,9 +189,9 @@ public class PerkPigBaconBomb extends SmashPerk
continue;
}
UtilEnt.CreatureMoveFast(pig, target.getLocation(), PIG_SPEED);
UtilEnt.CreatureMoveFast(pig, target.getLocation(), _pigSpeed);
if (UtilMath.offset(target, pig) < PIG_EXPLODE_RADIUS)
if (UtilMath.offset(target, pig) < _explodeRadius)
{
PigExplode(pigIterator, pig, player);
}
@ -196,7 +209,7 @@ public class PerkPigBaconBomb extends SmashPerk
pig.getWorld().playSound(pig.getLocation(), Sound.PIG_DEATH, 1f, 2f);
// Damage
Map<LivingEntity, Double> targets = UtilEnt.getInRadius(pig.getLocation(), PIG_EXPLODE_DAMAGE_RADIUS);
Map<LivingEntity, Double> targets = UtilEnt.getInRadius(pig.getLocation(), _explodeDamageRadius);
for (LivingEntity cur : targets.keySet())
{
@ -206,7 +219,7 @@ public class PerkPigBaconBomb extends SmashPerk
}
// Damage Event
Manager.GetDamage().NewDamageEvent(cur, owner, null, DamageCause.CUSTOM, PIG_EXPLODE_DAMAGE, false, true, false, owner.getName(), GetName());
Manager.GetDamage().NewDamageEvent(cur, owner, null, DamageCause.CUSTOM, _explodeDamage, false, true, false, owner.getName(), GetName());
}
// Remove

View File

@ -40,17 +40,29 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkPigBaconBounce extends SmashPerk implements IThrown
{
private static final float ENERGY_PER_BACON = 0.2F;
private static final float ENERGY_PER_BACON_DISGUISED_FACTOR = 0.7F;
private static final int COOLDOWN = 100;
private static final int HEALTH_PER_BACON = 1;
private static final int BACON_DAMAGE = 4;
private float _energyBacon;
private float _energyBaconDisgtuiseFactor;
private float _energyBaconBack;
private int _cooldown;
private int _healthBacon;
private int _damageBacon;
public PerkPigBaconBounce()
{
super("Bouncy Bacon", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Bouncy Bacon", });
}
@Override
public void setupValues()
{
_energyBacon = getPerkFloat("Energy Per Bacon");
_energyBaconDisgtuiseFactor = getPerkFloat("Energy Per Bacon Disguise Factor");
_energyBaconBack = getPerkFloat("Energy Per Bacon Back");
_cooldown = getPerkInt("Cooldown (ms)");
_healthBacon = getPerkInt("Health Per Bacon");
_damageBacon = getPerkInt("Bacon Damage");
}
@EventHandler
public void Skill(PlayerInteractEvent event)
{
@ -81,13 +93,13 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
return;
}
float energy = ENERGY_PER_BACON;
float energy = _energyBacon;
DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player);
if (disguise != null && disguise instanceof DisguisePigZombie)
{
energy = energy * ENERGY_PER_BACON_DISGUISED_FACTOR;
energy = energy * _energyBaconDisgtuiseFactor;
}
// Energy
@ -98,7 +110,7 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
}
// Recharge
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, false, false))
if (!Recharge.Instance.use(player, GetName(), _cooldown, false, false))
{
return;
}
@ -109,7 +121,7 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
// Launch
Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.PORK, (byte) 0, 1, "Bacon" + System.currentTimeMillis()));
UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 0.4f);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, .8F);
ent.setPickupDelay(9999);
// Sound
@ -130,7 +142,7 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
}
// Damage Event
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, BACON_DAMAGE, true, true, false, UtilEnt.getName(data.getThrower()), GetName());
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, _damageBacon, true, true, false, UtilEnt.getName(data.getThrower()), GetName());
Item item = (Item) data.getThrown();
item.setItemStack(new ItemStack(Material.GRILLED_PORK));
@ -181,7 +193,7 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
event.getItem().remove();
// Restore Energy
event.getPlayer().setExp(Math.min(0.999f, event.getPlayer().getExp() + 0.05f));
event.getPlayer().setExp(Math.min(0.999f, event.getPlayer().getExp() + _energyBaconBack));
// Sound
event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.EAT, 2f, 1f);
@ -189,7 +201,7 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
// Heal
if (event.getItem().getItemStack().getType() == Material.GRILLED_PORK)
{
UtilPlayer.health(event.getPlayer(), HEALTH_PER_BACON);
UtilPlayer.health(event.getPlayer(), _healthBacon);
UtilParticle.PlayParticle(ParticleType.HEART, event.getPlayer().getLocation().add(0, 0.5, 0), 0.2f, 0.2f, 0.2f, 0, 4, ViewDist.LONG, UtilServer.getPlayers());
}
}

View File

@ -24,7 +24,7 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkPigZombie extends SmashPerk
{
private static final int MIN_HEALTH = 6;
private int _minHealth;
public Set<UUID> _active = new HashSet<>();
@ -33,6 +33,12 @@ public class PerkPigZombie extends SmashPerk
super("Nether Pig", new String[] { C.cGray + "Become Nether Pig when HP is below 6.", C.cGray + "Return to Pig when HP is 10 or higher." });
}
@Override
public void setupValues()
{
_minHealth = getPerkInt("Min Health");
}
@EventHandler
public void Check(UpdateEvent event)
{
@ -86,7 +92,7 @@ public class PerkPigZombie extends SmashPerk
// Not Active
else
{
if (player.getHealth() <= 0 || (!isSuperActive(player) && player.getHealth() > MIN_HEALTH))
if (player.getHealth() <= 0 || (!isSuperActive(player) && player.getHealth() > _minHealth))
{
continue;
}

View File

@ -8,11 +8,9 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashPig extends SmashUltimate
{
private static final int DURATION = 40000;
public SmashPig()
{
super("Pig Stink", new String[] {}, Sound.PIG_IDLE, DURATION);
super("Pig Stink", new String[] {}, Sound.PIG_IDLE, 0);
}
@Override
@ -24,7 +22,7 @@ public class SmashPig extends SmashUltimate
{
if (!player.equals(other))
{
Manager.GetCondition().Factory().Confuse(GetName() + " " + player.getName(), other, player, DURATION / 1000, 0, false, false, false);
Manager.GetCondition().Factory().Confuse(GetName() + " " + player.getName(), other, player, getLength() / 1000, 0, false, false, false);
}
}
}

View File

@ -26,9 +26,9 @@ import nautilus.game.arcade.kit.perks.data.HomingSheepData;
public class SmashSheep extends SmashUltimate
{
private static final int DAMAGE_RADIUS = 10;
private static final int DAMAGE = 20;
private static final int KNOCKBACK_MAGNITUDE = 3;
private int _damageRadius;
private int _damage;
private int _knockbackMagnitude;
private List<HomingSheepData> _sheep = new ArrayList<>();
@ -37,6 +37,14 @@ public class SmashSheep extends SmashUltimate
super("Homing Sheeples", new String[] {}, Sound.SHEEP_IDLE, 0);
}
@Override
public void setupValues()
{
_damageRadius = getPerkInt("Damage Radius");
_damage = getPerkInt("Damage");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
}
@Override
public void activate(Player player)
{
@ -91,7 +99,7 @@ public class SmashSheep extends SmashUltimate
double scale = 0.4 + 0.6 * Math.min(1, data.Sheep.getTicksLived() / 60d);
// Players
Map<Player, Double> players = UtilPlayer.getInRadius(data.Sheep.getLocation(), DAMAGE_RADIUS);
Map<Player, Double> players = UtilPlayer.getInRadius(data.Sheep.getLocation(), _damageRadius);
for (Player player : players.keySet())
{
@ -101,7 +109,7 @@ public class SmashSheep extends SmashUltimate
}
// Damage Event
Manager.GetDamage().NewDamageEvent(player, data.Shooter, null, DamageCause.CUSTOM, DAMAGE * scale, true, true, false, data.Shooter.getName(), GetName());
Manager.GetDamage().NewDamageEvent(player, data.Shooter, null, DamageCause.CUSTOM, _damage * scale, true, true, false, data.Shooter.getName(), GetName());
}
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, data.Sheep.getLocation(), 0, 0, 0, 0, 1, ViewDist.MAX, UtilServer.getPlayers());
@ -118,6 +126,6 @@ public class SmashSheep extends SmashUltimate
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
}

View File

@ -39,13 +39,13 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkBoneRush extends SmashPerk implements IThrown
{
private static final int COOLDOWN = 10000;
private static final float DAMAGE_NORMAL = 0.7F;
private static final int DAMAGE_SMASH = 3;
private static final int KNOCKBACK_NORMAL = 10;
private static final int KNOCKBACK_SMASH = 6;
private static final int EXPIRE_TIME = 2000;
private static final float Y_LIMIT = 0.25F;
private int _cooldown;
private float _damageNormal;
private int _damageSmash;
private int _knockbackNormal;
private int _knockbackSmash;
private int _expireTime;
private float _yLimit;
private Map<UUID, Long> _active = new HashMap<>();
@ -54,6 +54,18 @@ public class PerkBoneRush extends SmashPerk implements IThrown
super("Bone Rush", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Spade to use " + C.cGreen + "Bone Rush", C.cGray + "Crouch to avoid movement with " + C.cGreen + "Bone Rush" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_damageNormal = getPerkFloat("Damage Normal");
_damageSmash = getPerkInt("Damage Smash");
_knockbackNormal = getPerkInt("Knockback Normal");
_knockbackSmash = getPerkInt("Knockback Smash");
_expireTime = getPerkTime("Expire Time");
_yLimit = getPerkFloat("Y Limit");
}
@EventHandler
public void Skill(PlayerInteractEvent event)
{
@ -89,7 +101,7 @@ public class PerkBoneRush extends SmashPerk implements IThrown
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -141,7 +153,7 @@ public class PerkBoneRush extends SmashPerk implements IThrown
// Velocity
Vector dir = player.getLocation().getDirection();
double limit = isSuperActive(player) ? Y_LIMIT + 0.1 : Y_LIMIT;
double limit = isSuperActive(player) ? _yLimit + 0.1 : _yLimit;
if (dir.getY() > limit)
{
@ -159,7 +171,7 @@ public class PerkBoneRush extends SmashPerk implements IThrown
{
Item bone = player.getWorld().dropItem(player.getLocation().add(Math.random() * 5 - 2.5, Math.random() * 3, Math.random() * 5 - 2.5), new ItemStack(Material.BONE));
UtilAction.velocity(bone, dir, 0.6 + 0.3 * Math.random(), false, 0, 0.1 + Math.random() * 0.05, 0.3, false);
Manager.GetProjectile().AddThrow(bone, player, this, EXPIRE_TIME, true, true, true, true, 0.5f);
Manager.GetProjectile().AddThrow(bone, player, this, _expireTime, true, true, true, true, 0.5f);
}
}
}
@ -174,12 +186,12 @@ public class PerkBoneRush extends SmashPerk implements IThrown
if (event.GetReason().contains(GetName()))
{
event.AddKnockback(GetName(), KNOCKBACK_NORMAL);
event.AddKnockback(GetName(), _knockbackNormal);
}
if (event.GetReason().contains("Bone Storm"))
{
event.AddKnockback(GetName(), KNOCKBACK_SMASH);
event.AddKnockback(GetName(), _knockbackSmash);
}
}
@ -216,7 +228,7 @@ public class PerkBoneRush extends SmashPerk implements IThrown
}
// Damage Event
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, isSuperActive(damager) ? DAMAGE_SMASH : DAMAGE_NORMAL, false, true, false, UtilEnt.getName(data.getThrower()), reason);
Manager.GetDamage().NewDamageEvent(target, data.getThrower(), null, DamageCause.CUSTOM, isSuperActive(damager) ? _damageSmash : _damageNormal, false, true, false, UtilEnt.getName(data.getThrower()), reason);
UtilAction.velocity(target, data.getThrown().getVelocity());
}

View File

@ -1,11 +1,14 @@
package nautilus.game.arcade.game.games.smash.perks.skeletalhorse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import mineplex.core.common.util.*;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
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.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Item;
@ -14,28 +17,16 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
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.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
import java.util.*;
public class PerkDeadlyBones extends SmashPerk
{
private static final int RATE = 400;
private static final int TICKS = 50;
private static final int DAMAGE_RADIUS = 4;
private static final int DAMAGE = 4;
private static final float KNOCKBACK_MAGNITUDE = 2.5F;
private int _rate;
private int _ticks ;
private int _damageRadius;
private int _damage;
private float _knockbackMagnitude;
private Map<Item, UUID> _active = new HashMap<>();
@ -44,6 +35,16 @@ public class PerkDeadlyBones extends SmashPerk
super("Deadly Bones", new String[] { C.cGray + "Drop explosive bones when you take damage." });
}
@Override
public void setupValues()
{
_rate = getPerkInt("Rate (ms)");
_ticks = getPerkInt("Ticks");
_damageRadius = getPerkInt("Damage Radius");
_damage = getPerkInt("Damage");
_knockbackMagnitude = getPerkFloat("Knockback Magnitude");
}
@EventHandler
public void damageActivate(CustomDamageEvent event)
{
@ -64,7 +65,7 @@ public class PerkDeadlyBones extends SmashPerk
return;
}
if (!Recharge.Instance.use(player, GetName(), RATE, false, false))
if (!Recharge.Instance.use(player, GetName(), _rate, false, false))
{
return;
}
@ -91,7 +92,7 @@ public class PerkDeadlyBones extends SmashPerk
for (Item item : itemListCopy)
{
// Not Ready
if (item.isValid() && item.getTicksLived() < TICKS)
if (item.isValid() && item.getTicksLived() < _ticks)
{
continue;
}
@ -109,7 +110,7 @@ public class PerkDeadlyBones extends SmashPerk
}
// Damage
Map<LivingEntity, Double> targets = UtilEnt.getInRadius(item.getLocation(), DAMAGE_RADIUS);
Map<LivingEntity, Double> targets = UtilEnt.getInRadius(item.getLocation(), _damageRadius);
for (LivingEntity cur : targets.keySet())
{
@ -118,7 +119,7 @@ public class PerkDeadlyBones extends SmashPerk
continue;
}
Manager.GetDamage().NewDamageEvent(cur, player, null, DamageCause.CUSTOM, DAMAGE * targets.get(cur) + 1, true, true, false, player.getName(), GetName());
Manager.GetDamage().NewDamageEvent(cur, player, null, DamageCause.CUSTOM, _damage * targets.get(cur) + 1, true, true, false, player.getName(), GetName());
}
// Remove
@ -135,6 +136,6 @@ public class PerkDeadlyBones extends SmashPerk
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
}

View File

@ -37,10 +37,10 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkHorseKick extends SmashPerk
{
private static final int COOLDOWN = 6000;
private static final float DAMAGE = 6.5F;
private static final int KICK_TIME = 1000;
private static final int KNOCKBACK_MAGNITUDE = 4;
private int _cooldown;
private float _damage;
private int _kickTime;
private float _knockbackMagnitude;
private Map<UUID, Long> _active = new HashMap<>();
@ -49,6 +49,15 @@ public class PerkHorseKick extends SmashPerk
super("Bone Kick", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Bone Kick" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_damage = getPerkFloat("Damage");
_kickTime = getPerkInt("Kick Time (ms)");
_knockbackMagnitude = getPerkFloat("Knockback Magnitude");
}
@EventHandler
public void Activate(PlayerInteractEvent event)
{
@ -84,7 +93,7 @@ public class PerkHorseKick extends SmashPerk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -119,7 +128,7 @@ public class PerkHorseKick extends SmashPerk
}
// Damage Event
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, DAMAGE, true, true, false, player.getName(), GetName());
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage, true, true, false, player.getName(), GetName());
// Sound
player.getWorld().playSound(player.getLocation(), Sound.SKELETON_HURT, 4f, 0.6f);
@ -158,7 +167,7 @@ public class PerkHorseKick extends SmashPerk
continue;
}
if (!player.isValid() || player.getHealth() <= 0 || UtilTime.elapsed(_active.get(key), KICK_TIME))
if (!player.isValid() || player.getHealth() <= 0 || UtilTime.elapsed(_active.get(key), _kickTime))
{
playerIterator.remove();
@ -192,6 +201,6 @@ public class PerkHorseKick extends SmashPerk
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
}

View File

@ -10,11 +10,9 @@ import nautilus.game.arcade.kit.Perk;
public class SmashSkeletalHorse extends SmashUltimate
{
private static final int DURATION = 20000;
public SmashSkeletalHorse()
{
super("Bone Storm", new String[] {}, Sound.HORSE_SKELETON_DEATH, DURATION);
super("Bone Storm", new String[] {}, Sound.HORSE_SKELETON_DEATH, 0);
}
@Override

View File

@ -33,6 +33,7 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
import org.jooq.util.derby.sys.Sys;
public class PerkBarrage extends SmashPerk
{
@ -48,6 +49,11 @@ public class PerkBarrage extends SmashPerk
private boolean _noDelay;
private boolean _useExp;
public PerkBarrage()
{
this(0, 0, false, false);
}
public PerkBarrage(int max, int tick, boolean remove, boolean noDelay)
{
this(max, tick, remove, noDelay, false);
@ -63,6 +69,16 @@ public class PerkBarrage extends SmashPerk
_noDelay = noDelay;
}
@Override
public void setupValues()
{
_max = getPerkInt("Max", _max);
_tick = getPerkInt("Tick", _tick);
_remove = getPerkBoolean("Remove", _remove);
_noDelay = getPerkBoolean("No Delay", _noDelay);
_useExp = getPerkBoolean("Exp Bar", _useExp);
}
@EventHandler
public void BarrageDrawBow(PlayerInteractEvent event)
{

View File

@ -23,16 +23,25 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkBoneExplosion extends SmashPerk
{
private static final int COOLDOWN = 10000;
private static final int DAMAGE_RADIUS = 7;
private static final int DAMAGE = 6;
private static final float KNOCKBACK_MAGNITUDE = 2.5F;
private int _cooldown;
private int _damageRadius;
private int _damage;
private float _knockbackMagnitude;
public PerkBoneExplosion()
{
super("Bone Explosion", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Bone Explosion" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_damageRadius = getPerkInt("Damage Radius");
_damage = getPerkInt("Damage");
_knockbackMagnitude = getPerkFloat("Knockback Magnitude");
}
@EventHandler
public void Skill(PlayerInteractEvent event)
{
@ -68,12 +77,12 @@ public class PerkBoneExplosion extends SmashPerk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
Map<Player, Double> nearby = UtilPlayer.getInRadius(player.getLocation(), DAMAGE_RADIUS);
Map<Player, Double> nearby = UtilPlayer.getInRadius(player.getLocation(), _damageRadius);
for (Player other : nearby.keySet())
{
@ -86,7 +95,7 @@ public class PerkBoneExplosion extends SmashPerk
UtilPlayer.message(other, F.main("Game", F.elem(Manager.GetColor(player) + player.getName()) + " used " + F.skill(GetName()) + "."));
// Damage Event
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, DAMAGE * nearby.get(other), true, true, false, player.getName(), GetName());
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage * nearby.get(other), true, true, false, player.getName(), GetName());
}
// Inform
@ -104,6 +113,6 @@ public class PerkBoneExplosion extends SmashPerk
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
}

View File

@ -20,14 +20,12 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashSkeleton extends SmashUltimate
{
private static final int DURATION = 10000;
private Set<Projectile> _arrows = new HashSet<Projectile>();
private Set<Projectile> _arrows = new HashSet<>();
public SmashSkeleton()
{
super("Arrow Storm", new String[] {}, Sound.SKELETON_HURT, DURATION);
super("Arrow Storm", new String[] {}, Sound.SKELETON_HURT, 0);
}
@EventHandler
@ -71,15 +69,7 @@ public class SmashSkeleton extends SmashUltimate
{
return;
}
for (Iterator<Projectile> arrowIterator = _arrows.iterator(); arrowIterator.hasNext();)
{
Projectile arrow = arrowIterator.next();
if (arrow.isDead() || !arrow.isValid())
{
arrowIterator.remove();
}
}
_arrows.removeIf(arrow -> arrow.isDead() || !arrow.isValid());
}
}

View File

@ -43,11 +43,11 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkSlimeRocket extends SmashPerk implements IThrown
{
private static final int COOLDOWN = 6000;
private static final float ENERGY_PER_TICK = 0.004F;
private static final int KNOCKBACK_MAGNITUDE = 3;
private static final int MAX_ENERGY_TIME = 3000;
private static final int MAX_HOLD_TIME = 5000;
private int _cooldown = 6000;
private float _energyTick = 0.004F;
private int _knockbackMagnitude = 3;
private int _maxEnergyTime = 3000;
private int _maxHoldTime = 5000;
private Map<UUID, Long> _charge = new HashMap<>();
private Map<Slime, UUID> _owner = new HashMap<>();
@ -58,6 +58,16 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
super("Slime Rocket", new String[] { C.cYellow + "Hold/Release Block" + C.cGray + " to use " + C.cGreen + "Slime Rocket" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_energyTick = getPerkFloat("Energy Per Tick");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
_maxEnergyTime = getPerkTime("Max Energy Time");
_maxHoldTime = getPerkTime("Max Hold Time");
}
@EventHandler
public void EnergyUpdate(UpdateEvent event)
{
@ -101,7 +111,7 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
continue;
}
player.setExp((float) Math.min(0.999, player.getExp() + ENERGY_PER_TICK));
player.setExp((float) Math.min(0.999, player.getExp() + _energyTick));
}
}
@ -140,7 +150,7 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -187,13 +197,13 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
double elapsed = Math.min(3, (double) (System.currentTimeMillis() - time) / 1000d);
// Use Energy
if (!UtilTime.elapsed(time, MAX_ENERGY_TIME))
if (!UtilTime.elapsed(time, _maxEnergyTime))
{
player.setExp((float) Math.max(0, player.getExp() - 0.01f));
}
// AutoFire
if (UtilTime.elapsed(time, MAX_HOLD_TIME))
if (UtilTime.elapsed(time, _maxHoldTime))
{
FireRocket(player);
chargeIterator.remove();
@ -310,7 +320,7 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
@Override

View File

@ -1,42 +1,32 @@
package nautilus.game.arcade.game.games.smash.perks.slime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import mineplex.core.common.util.*;
import mineplex.core.common.util.UtilEvent.ActionType;
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.game.games.smash.perks.SmashPerk;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
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.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilItem;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
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.game.games.smash.perks.SmashPerk;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
public class PerkSlimeSlam extends SmashPerk
{
private static final int COOLDOWN = 6000;
private static final int HIT_BOX = 2;
private static final int START_TIME = 1000;
private static final int DAMAGE_RATE_LIMIT = 500;
private static final int DAMAGE = 7;
private static final int KNOCKBACK_MAGNITUDE = 2;
private int _cooldown;
private int _hitBox;
private int _startTime;
private int _damageRateLimit;
private int _damage;
private int _knockbackMagnitude;
private Map<UUID, Long> _live = new HashMap<>();
@ -45,6 +35,17 @@ public class PerkSlimeSlam extends SmashPerk
super("Slime Slam", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Slime Slam" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_hitBox = getPerkInt("Hit Box");
_startTime = getPerkTime("Start Time");
_damageRateLimit = getPerkInt("Damage Rate Limit (ms)");
_damage = getPerkInt("Damage");
_knockbackMagnitude = getPerkInt("Knockback Magnitude");
}
@EventHandler
public void Leap(PlayerInteractEvent event)
{
@ -75,7 +76,7 @@ public class PerkSlimeSlam extends SmashPerk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -114,7 +115,7 @@ public class PerkSlimeSlam extends SmashPerk
continue;
}
if (UtilMath.offset(player, other) < HIT_BOX)
if (UtilMath.offset(player, other) < _hitBox)
{
doSlam(player, other);
_live.remove(player.getUniqueId());
@ -138,7 +139,7 @@ public class PerkSlimeSlam extends SmashPerk
continue;
}
if (!UtilTime.elapsed(_live.get(key), START_TIME))
if (!UtilTime.elapsed(_live.get(key), _startTime))
{
continue;
}
@ -151,7 +152,7 @@ public class PerkSlimeSlam extends SmashPerk
{
if (damagee instanceof Player)
{
if (!Recharge.Instance.use((Player) damagee, GetName() + " Hit", DAMAGE_RATE_LIMIT, false, false))
if (!Recharge.Instance.use((Player) damagee, GetName() + " Hit", _damageRateLimit, false, false))
{
return;
}
@ -160,10 +161,10 @@ public class PerkSlimeSlam extends SmashPerk
// Recoil Event
if (!isSuperActive(damager))
{
Manager.GetDamage().NewDamageEvent(damager, damagee, null, DamageCause.CUSTOM, DAMAGE / 4, true, true, false, damager.getName(), GetName() + " Recoil");
Manager.GetDamage().NewDamageEvent(damager, damagee, null, DamageCause.CUSTOM, _damage / 4, true, true, false, damager.getName(), GetName() + " Recoil");
// Damage Event
Manager.GetDamage().NewDamageEvent(damagee, damager, null, DamageCause.CUSTOM, DAMAGE, true, true, false, damager.getName(), GetName());
Manager.GetDamage().NewDamageEvent(damagee, damager, null, DamageCause.CUSTOM, _damage, true, true, false, damager.getName(), GetName());
}
// Inform
@ -179,6 +180,6 @@ public class PerkSlimeSlam extends SmashPerk
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
}

View File

@ -26,13 +26,21 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashSlime extends SmashUltimate
{
private static final int DURATION = 19000;
private static final int HIT_BOX = 5;
private static final int DAMAGE = 8;
private int _hitBox;
private int _damage;
public SmashSlime()
{
super("Giga Slime", new String[] {}, Sound.SLIME_ATTACK, DURATION);
super("Giga Slime", new String[] {}, Sound.SLIME_ATTACK, 0);
}
@Override
public void setupValues()
{
super.setupValues();
_hitBox = getPerkInt("Hit Box");
_damage = getPerkInt("Damage");
}
@Override
@ -53,7 +61,7 @@ public class SmashSlime extends SmashUltimate
player.setExp(0.99f);
Manager.GetCondition().Factory().Speed(GetName(), player, player, DURATION / 1000, 2, false, false, false);
Manager.GetCondition().Factory().Speed(GetName(), player, player, getLength() / 1000, 2, false, false, false);
}
@ -128,9 +136,9 @@ public class SmashSlime extends SmashUltimate
continue;
}
if (UtilMath.offset(player.getLocation().add(0, 3, 0), other.getLocation()) < HIT_BOX)
if (UtilMath.offset(player.getLocation().add(0, 3, 0), other.getLocation()) < _hitBox)
{
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, DAMAGE, true, false, false, player.getName(), GetName());
Manager.GetDamage().NewDamageEvent(other, player, null, DamageCause.CUSTOM, _damage, true, false, false, player.getName(), GetName());
UtilParticle.PlayParticle(ParticleType.SLIME, other.getLocation().add(0, 0.6, 0), 1f, 1f, 1f, 0, 20, ViewDist.LONG, UtilServer.getPlayers());

View File

@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.smash.perks.snowman;
import java.util.Map;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -15,14 +16,21 @@ import nautilus.game.arcade.kit.Perk;
public class PerkArcticAura extends Perk
{
private static final int DURATION = 2000;
private static final int RANGE = 5;
private int _duration;
private int _range;
public PerkArcticAura()
{
super("Arctic Aura", new String[] { "You freeze things around you, slowing enemies." });
}
@Override
public void setupValues()
{
_duration = getPerkTime("Duration");
_range = getPerkInt("Range");
}
@EventHandler
public void SnowAura(UpdateEvent event)
{
@ -43,13 +51,18 @@ public class PerkArcticAura extends Perk
continue;
}
double range = RANGE * player.getExp();
double range = _range * player.getExp();
Map<Block, Double> blocks = UtilBlock.getInRadius(player.getLocation(), range);
for (Block block : blocks.keySet())
{
Manager.GetBlockRestore().snow(block, (byte) 1, (byte) 1, (int) (DURATION * (1 + blocks.get(block))), 250, 0);
if (block.getType() == Material.SNOW_BLOCK)
{
continue;
}
Manager.GetBlockRestore().snow(block, (byte) 1, (byte) 1, (int) (_duration * (1 + blocks.get(block))), 250, 0);
}
}
}

View File

@ -28,8 +28,8 @@ import nautilus.game.arcade.kit.perks.data.IcePathData;
public class PerkIcePath extends Perk
{
private static final int COOLDOWN = 12000;
private static final int MELT_TIME = 6000;
private int _cooldown;
private int _meltTime;
private Set<IcePathData> _data = new HashSet<>();
@ -38,6 +38,13 @@ public class PerkIcePath extends Perk
super("Ice Path", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Ice Path" });
}
@Override
public void setupValues()
{
_cooldown = getPerkTime("Cooldown");
_meltTime = getPerkTime("Melt Time");
}
@EventHandler
public void Skill(PlayerInteractEvent event)
{
@ -68,7 +75,7 @@ public class PerkIcePath extends Perk
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
if (!Recharge.Instance.use(player, GetName(), _cooldown, true, true))
{
return;
}
@ -105,7 +112,7 @@ public class PerkIcePath extends Perk
else
{
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, 79);
Manager.GetBlockRestore().add(block, 79, (byte) 0, MELT_TIME);
Manager.GetBlockRestore().add(block, 79, (byte) 0, _meltTime);
}
}
}

View File

@ -40,19 +40,29 @@ import nautilus.game.arcade.game.games.smash.perks.SmashUltimate;
public class SmashSnowman extends SmashUltimate
{
private static final int DURATION = 20000;
private static final int TURRET_HEALTH = 40;
private static final int RATE = 250;
private static final float KNOCKBACK_MAGNITUDE = 2.5F;
private static final int COOLDOWN = 1000;
private int _duration;
private int _turretHealth;
private int _rate;
private float _knockbackMagnitude;
private Map<Projectile, Player> _snowball = new HashMap<>();
private Map<Snowman, Player> _turret = new HashMap<>();
public SmashSnowman()
{
super("Snow Turret", new String[] {}, Sound.STEP_SNOW, DURATION);
super("Snow Turret", new String[] {}, Sound.STEP_SNOW, 0);
}
@Override
public void setupValues()
{
_duration = getPerkTime("Duration");
_turretHealth = getPerkInt("Turret Health");
_rate = getPerkInt("Rate");
_knockbackMagnitude = getPerkFloat("Knockback Magnitude");
}
@Override
@ -72,8 +82,8 @@ public class SmashSnowman extends SmashUltimate
UtilEnt.vegetate(ent);
UtilEnt.ghost(ent, true, false);
ent.setMaxHealth(TURRET_HEALTH);
ent.setHealth(TURRET_HEALTH);
ent.setMaxHealth(_turretHealth);
ent.setHealth(_turretHealth);
UtilAction.velocity(ent, player.getLocation().getDirection(), 1, false, 0, 0.2, 1, false);
@ -122,7 +132,7 @@ public class SmashSnowman extends SmashUltimate
{
Snowman snowman = turretIter.next();
if(snowman.getTicksLived() >= (DURATION/50.0))
if(snowman.getTicksLived() >= (_duration /50.0))
{
UtilParticle.PlayParticle(ParticleType.SNOWBALL_POOF, snowman.getLocation().add(0, 1, 0), 0.4f, 0.4f, 0.4f, 0, 12, ViewDist.LONG, UtilServer.getPlayers());
snowman.remove();
@ -131,7 +141,7 @@ public class SmashSnowman extends SmashUltimate
}
else
{
double amount = 1 - snowman.getTicksLived() / (DURATION/50.0);
double amount = 1 - snowman.getTicksLived() / (_duration /50.0);
snowman.setCustomName(UtilText.getProgress(C.cGreen, amount, C.cRed, false));
snowman.setCustomNameVisible(true);
}
@ -205,13 +215,7 @@ public class SmashSnowman extends SmashUltimate
UtilAction.velocity(damagee, proj.getVelocity().multiply(0.3).add(new Vector(0, 0.3, 0)));
// Damage Event
if (!(damagee instanceof LivingEntity))
{
return;
}
if (!Recharge.Instance.use((Player) damagee, GetName() + " Hit", RATE, false, false))
if (!Recharge.Instance.use((Player) damagee, GetName() + " Hit", _rate, false, false))
{
return;
}
@ -242,7 +246,7 @@ public class SmashSnowman extends SmashUltimate
return;
}
event.AddKnockback(GetName(), KNOCKBACK_MAGNITUDE);
event.AddKnockback(GetName(), _knockbackMagnitude);
}
@Override

View File

@ -31,10 +31,10 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkNeedler extends SmashPerk
{
private static final int COOLDOWN_NORMAL = 2000;
private static final int COOLDOWN_SMASH = 600;
private static final float DAMAGE = 1.1F;
private static final int MAX_TICKS = 300;
private long _cooldownNormal;
private long _cooldownSmash;
private double _damage;
private int _maxTicks;
private Map<UUID, Integer> _active = new HashMap<>();
private Set<Arrow> _arrows = new HashSet<>();
@ -44,6 +44,15 @@ public class PerkNeedler extends SmashPerk
super("Needler", new String[] { C.cYellow + "Hold Block" + C.cGray + " to use " + C.cGreen + "Needler" });
}
@Override
public void setupValues()
{
_cooldownNormal = getPerkInt("Cooldown Normal (ms)");
_cooldownSmash = getPerkInt("Cooldown Smash (ms)");
_damage = getPerkDouble("Damage");
_maxTicks = getPerkInt("Max Ticks");
}
@EventHandler
public void Activate(PlayerInteractEvent event)
{
@ -74,12 +83,12 @@ public class PerkNeedler extends SmashPerk
return;
}
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? COOLDOWN_SMASH : COOLDOWN_NORMAL, !isSuperActive(player), !isSuperActive(player)))
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? _cooldownSmash : _cooldownNormal, !isSuperActive(player), !isSuperActive(player)))
{
return;
}
_active.put(player.getUniqueId(), 8);
_active.put(player.getUniqueId(), 7);
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
}
@ -156,7 +165,7 @@ public class PerkNeedler extends SmashPerk
event.GetProjectile().remove();
// Damage Event
Manager.GetDamage().NewDamageEvent(event.GetDamageeEntity(), damager, null, DamageCause.THORNS, DAMAGE, true, true, false, damager.getName(), GetName());
Manager.GetDamage().NewDamageEvent(event.GetDamageeEntity(), damager, null, DamageCause.THORNS, _damage, true, true, false, damager.getName(), GetName());
if (!isTeamDamage(damager, event.GetDamageePlayer()))
{
@ -176,7 +185,7 @@ public class PerkNeedler extends SmashPerk
{
Arrow arrow = arrowIterator.next();
if (arrow.isOnGround() || !arrow.isValid() || arrow.getTicksLived() > MAX_TICKS)
if (arrow.isOnGround() || !arrow.isValid() || arrow.getTicksLived() > _maxTicks)
{
arrowIterator.remove();
arrow.remove();

View File

@ -26,8 +26,8 @@ import nautilus.game.arcade.kit.Perk;
public class PerkSpiderLeap extends Perk
{
private static final float ENERGY_PER_TICK = 0.005F;
private static final float ENERGY_PER_LEAP = 0.17F;
private float _energyTick;
private float _energyJump;
private Set<UUID> _secondJump = new HashSet<>();
private Set<UUID> _finalJump = new HashSet<>();
@ -38,6 +38,13 @@ public class PerkSpiderLeap extends Perk
+ "Wall Climb requires Energy (Experience Bar)." });
}
@Override
public void setupValues()
{
_energyTick = getPerkFloat("Energy Per Tick");
_energyJump = getPerkFloat("Energy Per Jump");
}
@EventHandler
public void WallClimb(UpdateEvent event)
{
@ -62,19 +69,19 @@ public class PerkSpiderLeap extends Perk
_secondJump.remove(player.getUniqueId());
}
player.setExp(Math.min(0.999F, player.getExp() + (grounded ? ENERGY_PER_TICK * 2 : ENERGY_PER_TICK)));
player.setExp(Math.min(0.999F, player.getExp() + (grounded ? _energyTick * 2 : _energyTick)));
continue;
}
player.setExp(Math.max(0, player.getExp() - ENERGY_PER_TICK));
player.setExp(Math.max(0, player.getExp() - _energyTick));
if (player.getExp() <= 0)
{
continue;
}
if (player.getExp() >= ENERGY_PER_LEAP)
if (player.getExp() >= _energyJump)
{
_finalJump.remove(player.getUniqueId());
}
@ -116,7 +123,7 @@ public class PerkSpiderLeap extends Perk
// Disable Flight
player.setAllowFlight(false);
if (player.getExp() < ENERGY_PER_LEAP)
if (player.getExp() < _energyJump)
{
if (!_finalJump.contains(player.getUniqueId()))
{
@ -132,7 +139,7 @@ public class PerkSpiderLeap extends Perk
UtilAction.velocity(player, 1.0, 0.2, 1.0, true);
// Energy
player.setExp(Math.max(0, player.getExp() - ENERGY_PER_LEAP));
//player.setExp(Math.max(0, player.getExp() - _energyJump));
// Sound
player.getWorld().playSound(player.getLocation(), Sound.SPIDER_IDLE, 1f, 1.5f);

View File

@ -30,15 +30,23 @@ import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkWebShot extends SmashPerk implements IThrown
{
private static final int COOLDOWN_NORMAL = 10000;
private static final int COOLDOWN_SMASH = 1000;
private static final int WEBS = 20;
private int _cooldownNormal = 10000;
private int _cooldownSmash = 1000;
private int _webs = 20;
public PerkWebShot()
{
super("Spin Web", new String[] { C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Spin Web" });
}
@Override
public void setupValues()
{
_cooldownNormal = getPerkTime("Cooldown Normal");
_cooldownSmash = getPerkTime("Cooldown Smash");
_webs = getPerkInt("Webs");
}
@EventHandler
public void ShootWeb(PlayerInteractEvent event)
{
@ -69,7 +77,7 @@ public class PerkWebShot extends SmashPerk implements IThrown
return;
}
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? COOLDOWN_SMASH : COOLDOWN_NORMAL, !isSuperActive(player), !isSuperActive(player)))
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? _cooldownSmash : _cooldownNormal, !isSuperActive(player), !isSuperActive(player)))
{
return;
}
@ -79,7 +87,7 @@ public class PerkWebShot extends SmashPerk implements IThrown
// Boost
UtilAction.velocity(player, 1.2, 0.2, 1.2, true);
for (int i = 0; i < WEBS; i++)
for (int i = 0; i < _webs; i++)
{
Item ent = player.getWorld().dropItem(player.getLocation().add(0, 0.5, 0), ItemStackFactory.Instance.CreateStack(Material.WEB, (byte) 0, 1, "Web " + player.getName() + " " + i));

Some files were not shown because too many files have changed in this diff Show More