MERGE PLEASE!

This commit is contained in:
Sam 2016-10-13 16:11:01 +01:00
parent 2b2bb817be
commit a5d52d9e2f
21 changed files with 196 additions and 217 deletions

View File

@ -31,6 +31,8 @@ public class BabyFireworkEffect extends Effect
_multipleColors = true;
_fireworkColor = Color.RED;
}
_colors = new Color[0];
}
public BabyFireworkEffect(Location location, JavaPlugin javaPlugin, Color... colors)

View File

@ -314,6 +314,7 @@ public class TreasureLocation implements Listener
{
Location fromLocation = event.getFrom();
Location toLocation = event.getTo();
if (fromLocation.getWorld().equals(toLocation.getWorld())) return;
Location centerLocation = _currentTreasure.getCenterBlock().getLocation().add(0.5, 1.5, 0.5);
double toDistanceFromCenter = centerLocation.distanceSquared(toLocation);

View File

@ -1,6 +1,7 @@
package mineplex.hub;
import mineplex.core.Managers;
import mineplex.core.MiniClientPlugin;
import mineplex.core.TimingsFix;
import mineplex.core.account.CoreClient;
import mineplex.core.account.CoreClientManager;
import mineplex.core.achievement.AchievementManager;
@ -237,6 +238,7 @@ public class HubManager extends MiniClientPlugin<HubClient> implements IChatMess
// new HolidayGiftManager(plugin, clientManager, donationManager, inventoryManager, taskManager);
require(PlayerDisguiseManager.class);
require(TimingsFix.class);
// NotificationManager notificationManager = new NotificationManager(plugin, clientManager, donationManager);
// new MailManager(_plugin, notificationManager);
new ValentinesGiftManager(plugin, clientManager, _bonusManager.getRewardManager(), inventoryManager, _gadgetManager, statsManager);

View File

@ -95,8 +95,12 @@ public class SoloSuperSmash extends SuperSmash
//Wipe Last
Scoreboard.reset();
if (GetPlayers(true).size() > 14)
boolean minimise = false;
if (GetPlayers(false).size() > 14)
{
minimise = true;
Scoreboard.writeNewLine();
Scoreboard.write(C.cGreenB + "Players Alive");
Scoreboard.write(GetPlayers(true).size() + " ");
@ -109,7 +113,7 @@ public class SoloSuperSmash extends SuperSmash
{
Scoreboard.writeNewLine();
Scoreboard.writeGroup(GetPlayers(false), player ->
Scoreboard.writeGroup(GetPlayers(minimise), player ->
{
int lives = getLives(player);

View File

@ -84,50 +84,33 @@ import nautilus.game.arcade.kit.Perk;
public abstract class SuperSmash extends Game
{
private static final int MAX_LIVES = 4;
private static final int POWERUP_SPAWN_Y_INCREASE = 120;
private static final int MAX_LIVES = 4;
private static final int POWERUP_SPAWN_Y_INCREASE = 120;
private static final int HUNGER_DELAY = 250;
private static final String DATA_POINT_POWERUP = "RED";
private Map<Player, Integer> _lives = new HashMap<>();
private Location _powerupCurrent = null;
private Location _powerupTarget = null;
private EnderCrystal _powerup = null;
private Hologram _powerupHologram = null;
private boolean _powerupHologramColour;
private long _nextPowerup = 0;
private static final Set<Material> REMOVE_ON_ITEM_SPAWN = Sets.newHashSet(Material.CACTUS, Material.BROWN_MUSHROOM, Material.RED_MUSHROOM, Material.YELLOW_FLOWER, Material.RED_ROSE);
public SuperSmash(ArcadeManager manager, GameType type, String[] description)
{
this(manager,
new Kit[] {
new KitSkeleton(manager),
new KitGolem(manager),
new KitSpider(manager),
new KitSlime(manager),
new KitCreeper(manager),
new KitEnderman(manager),
new KitSnowman(manager),
new KitWolf(manager),
new KitBlaze(manager),
new KitWitch(manager),
new KitChicken(manager),
new KitSkeletalHorse(manager),
new KitPig(manager),
new KitSkySquid(manager),
new KitWitherSkeleton(manager),
new KitMagmaCube(manager),
new KitZombie(manager),
new KitCow(manager),
new KitSheep(manager),
new KitGuardian(manager)
new KitSkeleton(manager), new KitGolem(manager), new KitSpider(manager), new KitSlime(manager), new KitCreeper(manager), new KitEnderman(manager), new KitSnowman(manager),
new KitWolf(manager), new KitBlaze(manager), new KitWitch(manager), new KitChicken(manager), new KitSkeletalHorse(manager), new KitPig(manager), new KitSkySquid(manager),
new KitWitherSkeleton(manager), new KitMagmaCube(manager), new KitZombie(manager), new KitCow(manager), new KitSheep(manager), new KitGuardian(manager)
}, type, description);
}
@ -136,12 +119,12 @@ public abstract class SuperSmash extends Game
{
super(manager, type, kits, description);
this.DeathOut = false;
this.CompassEnabled = true;
this.DeathSpectateSecs = 4;
this.WorldWaterDamage = 1000;
this.HideTeamSheep = true;
this.ReplaceTeamsWithKits = true;
DeathOut = false;
CompassEnabled = true;
DeathSpectateSecs = 4;
WorldWaterDamage = 1000;
HideTeamSheep = true;
ReplaceTeamsWithKits = true;
}
@EventHandler(priority = EventPriority.HIGH)
@ -168,18 +151,19 @@ 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);
// 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
public void playerQuit(PlayerQuitEvent event)
{
@ -208,7 +192,7 @@ public abstract class SuperSmash extends Game
if (lives > 0)
{
String livesString = (lives == 1 ? "life" : "lives");
UtilPlayer.message(player, C.cRedB + "You have died!");
UtilPlayer.message(player, C.cRedB + "You have " + lives + " " + livesString + " left!");
player.playSound(player.getLocation(), Sound.NOTE_BASS_GUITAR, 2f, 0.5f);
@ -227,13 +211,13 @@ public abstract class SuperSmash extends Game
return true;
}
String gameOver = "You ran out of lives!";
UtilTextMiddle.display(C.cRedB + "GAME OVER", gameOver, 10, 50, 10, player);
UtilPlayer.message(player, C.cRedB + gameOver);
player.playSound(player.getLocation(), Sound.EXPLODE, 2f, 1f);
return false;
}
@ -263,9 +247,9 @@ public abstract class SuperSmash extends Game
{
continue;
}
UtilInv.remove(player, Material.NETHER_STAR, (byte) 0, 1);
player.setHealth(player.getMaxHealth());
player.playSound(player.getLocation(), ultimate.getSound(), 10, 1);
@ -285,39 +269,40 @@ public abstract class SuperSmash extends Game
{
return;
}
if (!IsLive())
{
return;
}
if (_powerupHologram != null)
{
_powerupHologram.setText((_powerupHologramColour ? C.cGreenB : C.cWhiteB) + "SMASH CRYSTAL");
_powerupHologramColour = !_powerupHologramColour;
}
if (_powerup == null)
{
if (System.currentTimeMillis() < _nextPowerup)
{
return;
}
if (WorldData.GetDataLocs(DATA_POINT_POWERUP).isEmpty())
{
return;
}
if (_powerupTarget == null)
{
BlockRestore blockRestore = Manager.GetBlockRestore();
Location newTarget = UtilAlg.Random(WorldData.GetDataLocs(DATA_POINT_POWERUP));
Block targetBlock = newTarget.getBlock();
// This relies on this method being called 4 times a second (5 ticks, UpdateType.FASTER).
// This relies on this method being called 4 times a second (5
// ticks, UpdateType.FASTER).
long restoreTime = (POWERUP_SPAWN_Y_INCREASE / 4 / 2) * 1000 + 500;
_powerupTarget = newTarget.clone();
_powerupCurrent = newTarget.clone().add(0, POWERUP_SPAWN_Y_INCREASE, 0);
@ -327,20 +312,20 @@ public abstract class SuperSmash extends Game
for (int z = -1; z <= 1; z++)
{
blockRestore.add(targetBlock.getRelative(x, -3, z), Material.IRON_BLOCK.getId(), (byte) 0, restoreTime);
if (x == 0 && z == 0)
{
continue;
}
blockRestore.add(targetBlock.getRelative(x, -1, z), Material.QUARTZ_BLOCK.getId(), (byte) 0, restoreTime);
}
}
blockRestore.add(targetBlock.getRelative(0, -2, 0), Material.BEACON.getId(), (byte) 0, restoreTime);
blockRestore.add(targetBlock.getRelative(0, -1, 0), Material.STAINED_GLASS.getId(), (byte) 5, restoreTime);
}
if (_powerupTarget.getY() < _powerupCurrent.getY())
{
_powerupCurrent.subtract(0, 2, 0);
@ -352,9 +337,9 @@ public abstract class SuperSmash extends Game
_powerup = _powerupTarget.getWorld().spawn(_powerupTarget, EnderCrystal.class);
_powerupHologram = new Hologram(Manager.getHologramManager(), _powerupTarget.add(0, 2, 0), true, "SMASH CRYSTAL").start();
CreatureAllowOverride = false;
UtilFirework.playFirework(_powerupTarget, Type.BURST, Color.YELLOW, false, true);
_powerupTarget = null;
_powerupCurrent = null;
}
@ -368,17 +353,17 @@ public abstract class SuperSmash extends Game
{
return;
}
if (!IsLive())
{
return;
}
if (_powerup == null)
{
return;
}
Player best = null;
double bestDist = 0;
@ -388,14 +373,14 @@ public abstract class SuperSmash extends Game
{
continue;
}
double dist = UtilMath.offset(player, _powerup);
if (dist > 2)
{
continue;
}
if (best == null || dist < bestDist)
{
best = player;
@ -407,15 +392,15 @@ public abstract class SuperSmash extends Game
{
_powerupHologram.stop();
_powerupHologram = null;
_powerup.remove();
_powerup = null;
giveSmashItem(best);
_nextPowerup = getNewSmashTime();
}
}
private void giveSmashItem(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.NETHER_STAR, (byte) 0, 1, C.cYellowB + "Click" + C.cWhiteB + " - " + C.cGreenB + "Smash"));
@ -438,7 +423,7 @@ public abstract class SuperSmash extends Game
{
return;
}
if (event.GetCause() == DamageCause.FALL)
{
event.SetCancelled("No Fall Damage");
@ -452,11 +437,11 @@ public abstract class SuperSmash extends Game
{
return;
}
if (event.GetDamageePlayer() != null)
{
Player player = event.GetDamageePlayer();
event.AddKnockback("Smash Knockback", 1 + 0.1 * (player.getMaxHealth() - player.getHealth()));
}
}
@ -468,11 +453,11 @@ public abstract class SuperSmash extends Game
{
return;
}
if (event.GetCause() == DamageCause.VOID || event.GetCause() == DamageCause.LAVA)
{
LivingEntity entity = event.GetDamageeEntity();
entity.eject();
entity.leaveVehicle();
@ -480,7 +465,7 @@ public abstract class SuperSmash extends Game
{
entity.getWorld().strikeLightningEffect(entity.getLocation());
}
event.AddMod("Smash", "Super Smash Mobs", 5000, false);
}
}
@ -491,7 +476,7 @@ public abstract class SuperSmash extends Game
if (event.getRegainReason() == RegainReason.SATIATED)
{
event.setCancelled(true);
}
}
}
@EventHandler(priority = EventPriority.MONITOR)
@ -533,42 +518,42 @@ public abstract class SuperSmash extends Game
{
return;
}
Player player = event.getPlayer();
ItemStack itemStack = player.getItemInHand();
if (itemStack == null)
{
return;
}
if (itemStack.getItemMeta() == null)
{
return;
}
ItemMeta itemMeta = itemStack.getItemMeta();
if (itemMeta.getDisplayName() == null)
{
return;
}
if (itemMeta.getLore() == null)
{
return;
}
if (GetState() != GameState.Recruit)
{
{
return;
}
for (int i = player.getItemInHand().getItemMeta().getLore().size(); i <= 7; i++)
{
UtilPlayer.message(player, "");
}
UtilPlayer.message(player, ArcadeFormat.Line);
UtilPlayer.message(player, "§aAbility - §f§l" + player.getItemInHand().getItemMeta().getDisplayName());
@ -607,12 +592,12 @@ public abstract class SuperSmash extends Game
{
return;
}
if (!IsLive())
{
return;
}
hungerTick = (hungerTick + 1) % 10;
for (Player player : GetPlayers(true))
@ -641,33 +626,33 @@ public abstract class SuperSmash extends Game
{
return;
}
Player damager = event.GetDamagerPlayer(true);
if (damager == null)
{
return;
}
if (damager.equals(event.GetDamageeEntity()))
{
return;
}
if (!(event.GetDamageeEntity() instanceof Player))
{
return;
}
if (!Recharge.Instance.use(damager, "Hunger Restore", HUNGER_DELAY, false, false))
{
return;
}
int amount = Math.max(1, (int) (event.GetDamage() / 2));
UtilPlayer.hunger(damager, amount);
}
@EventHandler
public void itemSpawn(ItemSpawnEvent event)
{
@ -676,7 +661,7 @@ public abstract class SuperSmash extends Game
event.setCancelled(true);
}
}
public long getNewSmashTime()
{
return (long) (System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(3) + TimeUnit.MINUTES.toMillis(5) * Math.random());
@ -698,12 +683,12 @@ public abstract class SuperSmash extends Game
return C.cGreen;
}
}
public Map<Player, Integer> getLiveMap()
{
return _lives;
}
@EventHandler
public void debugCommands(PlayerCommandPreprocessEvent event)
{
@ -711,62 +696,71 @@ public abstract class SuperSmash extends Game
{
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);
_lives.put(player, MAX_LIVES);
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);
}
}

View File

@ -10,12 +10,11 @@ import org.bukkit.scheduler.BukkitRunnable;
import mineplex.core.common.Pair;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
@ -89,11 +88,11 @@ public class TeamSuperSmash extends SuperSmash
for (GameTeam team : GetTeamList())
{
Scoreboard.writeGroup(team.GetPlayers(true), player ->
Scoreboard.writeGroup(team.GetPlayers(false), player ->
{
int lives = getLives(player);
return Pair.create(team.GetColor() + player.getName(), lives);
return Pair.create(team.GetColor() + (IsAlive(player) ? "" : C.Strike) + player.getName(), lives);
}, true);
}
}
@ -101,6 +100,7 @@ public class TeamSuperSmash extends SuperSmash
Scoreboard.draw();
}
@Override
@EventHandler
public void gameStart(GameStateChangeEvent event)
{
@ -109,6 +109,8 @@ public class TeamSuperSmash extends SuperSmash
return;
}
super.gameStart(event);
new BukkitRunnable()
{
@ -116,12 +118,7 @@ public class TeamSuperSmash extends SuperSmash
public void run()
{
for (Player player : GetPlayers(true))
{
if (UtilPlayer.isSpectator(player))
{
continue;
}
{
GameTeam team = GetTeam(player);
Player bestTeamMember = null;
@ -142,11 +139,11 @@ public class TeamSuperSmash extends SuperSmash
if (bestTeamMember == null)
{
UtilTextMiddle.display(C.cRedB + "No one", "You don\'t have a teamamte :(", 10, 50, 10);
UtilTextMiddle.display(C.cRedB + "No one", "You don\'t have a teammate :(", 10, 50, 10, player);
return;
}
UtilTextMiddle.display(team.GetColor() + bestTeamMember.getName(), "Is your teammate", 10, 50, 10);
UtilTextMiddle.display(team.GetColor() + bestTeamMember.getName(), "Is your teammate", 10, 50, 10, player);
}
}
}.runTaskLater(Manager.getPlugin(), 40);
@ -163,6 +160,11 @@ public class TeamSuperSmash extends SuperSmash
Player damager = event.GetDamagerPlayer(true);
Player damagee = event.GetDamageePlayer();
if (GetTeam(damager) == null || GetTeam(damagee) == null)
{
return;
}
if (GetTeam(damager).equals(GetTeam(damagee)))
{
if (event.GetCause() == DamageCause.FIRE)

View File

@ -105,7 +105,7 @@ public class KitMagmaCube extends SmashKit
}
@EventHandler
public void FireItemResist(UpdateEvent event)
public void fireResistance(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
{
@ -124,8 +124,7 @@ public class KitMagmaCube extends SmashKit
continue;
}
Manager.GetCondition().Factory().FireItemImmunity(GetName(), player, player, 1.9, false);
player.setFireTicks(0);
}
}
}

View File

@ -128,6 +128,6 @@ public class KitSkeleton extends SmashKit
return;
}
event.AddMod("Arrow Nerf", -2);
event.AddMod("Arrow Nerf", -1.5);
}
}

View File

@ -135,6 +135,12 @@ public class PerkFirefly extends SmashPerk
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)
{

View File

@ -44,7 +44,7 @@ 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 = 11;
private static final int DAMAGE = 9;
private static final float KNOCKBACK_MAGNITUDE = 2.5F;
private Map<UUID, BlockTossData> _hold = new HashMap<>();
@ -133,7 +133,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
{
return;
}
Set<Player> throwSet = new HashSet<>();
for (UUID key : _hold.keySet())
@ -165,7 +165,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
for (Player cur : throwSet)
{
UUID key = cur.getUniqueId();
Recharge.Instance.recharge(cur, GetName());
Recharge.Instance.use(cur, GetName(), COOLDOWN, false, true);
@ -181,7 +181,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
// Throw
double mult = Math.min(1.4, 1.4 * ((double) charge / CHARGE_TIME));
// Action
UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0.2, 0, 1, true);
Manager.GetProjectile().AddThrow(block, cur, this, -1, true, true, true, true, null, 0, 0, null, 0, UpdateType.FASTEST, 1f);
@ -241,7 +241,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
{
return;
}
FallingBlock falling = (FallingBlock) event.getEntity();
falling.getWorld().playEffect(event.getBlock().getLocation(), Effect.STEP_SOUND, falling.getBlockId());

View File

@ -1,7 +1,6 @@
package nautilus.game.arcade.game.games.smash.perks.golem;
import java.util.List;
import java.util.Map;
import org.bukkit.Effect;
import org.bukkit.Material;
@ -60,7 +59,7 @@ public class SmashGolem extends SmashUltimate
for (Player other : alivePlayers)
{
if (player.equals(other) || UtilPlayer.isSpectator(player))
if (player.equals(other) || UtilPlayer.isSpectator(other))
{
continue;
}

View File

@ -3,6 +3,8 @@ package nautilus.game.arcade.game.games.smash.perks.guardian;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Player;
import mineplex.core.common.util.UtilEnt;
import nautilus.game.arcade.ArcadeManager;
public class TargetLazerData
@ -35,6 +37,9 @@ public class TargetLazerData
_targetPlaceholder.setBasePlate(false);
_targetPlaceholder.setGravity(false);
_targetPlaceholder.setVisible(false);
UtilEnt.ghost(_targetPlaceholder, true, false);
manager.GetGame().CreatureAllowOverride = false;
}

View File

@ -102,7 +102,8 @@ public class PerkFlameDash extends Perk
return;
}
Recharge.Instance.useForce(player, GetName(), COOLDOWN);
Recharge.Instance.recharge(player, GetName());
Recharge.Instance.use(player, GetName(), COOLDOWN, true, true);
_data.add(new FireflyData(player));

View File

@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@ -39,7 +40,7 @@ public class PerkMagmaBoost extends Perk
{
Player killed = (Player) event.GetEvent().getEntity();
_kills.remove(killed);
_kills.remove(killed.getUniqueId());
if (event.GetLog().GetKiller() == null)
{
@ -74,7 +75,9 @@ public class PerkMagmaBoost extends Perk
slime.SetSize(size + 1);
Manager.GetDisguise().updateDisguise(slime);
Bukkit.broadcastMessage("Exp: " + 0.99f * (size / MAX_STACKS));
killer.setExp(0.99f * (size / MAX_STACKS));
}

View File

@ -131,7 +131,7 @@ public class PerkWoolCloud extends Perk
UtilParticle.PlayParticle(ParticleType.FLAME, player.getLocation(), 0.2f, 0.2f, 0.2f, 0, 4, ViewDist.LONGER, UtilServer.getPlayers());
if (!UtilTime.elapsed(_active.get(player), MIN_VELOCITY_TIME))
if (!UtilTime.elapsed(_active.get(key), MIN_VELOCITY_TIME))
{
continue;
}
@ -153,7 +153,7 @@ public class PerkWoolCloud extends Perk
}
}
if (UtilEnt.isGrounded(player) || UtilTime.elapsed(_active.get(player), MAX_VELOCITY_TIME))
if (UtilEnt.isGrounded(player) || UtilTime.elapsed(_active.get(key), MAX_VELOCITY_TIME))
{
playerIterator.remove();
setWoolColor(player, DyeColor.WHITE);

View File

@ -37,15 +37,18 @@ 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;
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 Map<UUID, Long> _charge = new HashMap<>();
private Map<Slime, UUID> _owner = new HashMap<>();
private Map<Slime, Long> _lastAttack = new HashMap<>();
@ -69,12 +72,12 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
{
continue;
}
if (isSuperActive(player))
{
continue;
}
int size = 1;
if (player.getExp() > 0.8)
{
@ -93,7 +96,7 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
Manager.GetDisguise().updateDisguise(slime);
}
if (player.isBlocking())
if (player.isBlocking() && !Recharge.Instance.usable(player, GetName()))
{
continue;
}
@ -141,7 +144,7 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
{
return;
}
UtilPlayer.message(player, F.main("Skill", "You are charging " + F.skill(GetName()) + "."));
_charge.put(player.getUniqueId(), System.currentTimeMillis());
@ -154,7 +157,7 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
{
return;
}
Iterator<UUID> chargeIterator = _charge.keySet().iterator();
while (chargeIterator.hasNext())
@ -173,7 +176,7 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
// Charge
if (player.isBlocking())
{
// Energy Depleted
// Energy Depleted
if (player.getExp() < 0.1)
{
FireRocket(player);
@ -184,22 +187,23 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
double elapsed = Math.min(3, (double) (System.currentTimeMillis() - time) / 1000d);
// Use Energy
if (!UtilTime.elapsed(time, 3000))
if (!UtilTime.elapsed(time, MAX_ENERGY_TIME))
{
player.setExp((float) Math.max(0, player.getExp() - 0.01f));
}
// AutoFire
if (UtilTime.elapsed(time, 5000))
if (UtilTime.elapsed(time, MAX_HOLD_TIME))
{
FireRocket(player);
chargeIterator.remove();
}
float offset = (float) (elapsed / 6d);
// Effect
player.getWorld().playSound(player.getLocation(), Sound.SLIME_WALK, 0.5f, (float) (0.5 + 1.5 * (elapsed / 3d)));
UtilParticle.PlayParticle(ParticleType.SLIME, player.getLocation().add(0, 1, 0), (float) (elapsed / 6d), (float) (elapsed / 6d), (float) (elapsed / 6d), 0, (int) (elapsed * 5),
ViewDist.LONGER, UtilServer.getPlayers());
UtilParticle.PlayParticle(ParticleType.SLIME, player.getLocation().add(0, 1, 0), offset, offset, offset, 0, (int) (elapsed * 5), ViewDist.LONGER, UtilServer.getPlayers());
}
}
// Release
@ -247,15 +251,15 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
{
return;
}
if (!_owner.containsKey(event.getEntity()))
{
return;
}
if (event.getTarget() instanceof Player)
{
if (isTeamDamage((Player) event.getTarget(), UtilPlayer.searchExact(_owner.get(event.getEntity().getUniqueId()))))
if (isTeamDamage((Player) event.getTarget(), UtilPlayer.searchExact(_owner.get(event.getEntity()))))
{
event.setCancelled(true);
return;
@ -328,7 +332,7 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
{
return;
}
Slime slime = (Slime) event.GetDamagerEntity(false);
// Attack Rate

View File

@ -75,11 +75,6 @@ public class PerkSlimeSlam extends SmashPerk
return;
}
if (isSuperActive(player))
{
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
{
return;
@ -114,12 +109,7 @@ public class PerkSlimeSlam extends SmashPerk
for (Player other : alivePlayers)
{
if (UtilPlayer.isSpectator(other))
{
continue;
}
if (other.equals(player))
if (player.equals(other) || UtilPlayer.isSpectator(other) || isTeamDamage(player, other))
{
continue;
}
@ -171,10 +161,10 @@ public class PerkSlimeSlam extends SmashPerk
if (!isSuperActive(damager))
{
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());
// Damage Event
Manager.GetDamage().NewDamageEvent(damagee, damager, null, DamageCause.CUSTOM, DAMAGE, true, true, false, damager.getName(), GetName());
}
// Inform
UtilPlayer.message(damager, F.main("Game", "You hit " + F.name(UtilEnt.getName(damagee)) + " with " + F.skill(GetName()) + "."));

View File

@ -41,7 +41,6 @@ public class SmashSlime extends SmashUltimate
super.activate(player);
player.getInventory().remove(Material.IRON_SWORD);
player.getInventory().remove(Material.IRON_AXE);
DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player);
if (disguise != null && disguise instanceof DisguiseSlime)

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.bukkit.block.Block;
@ -42,8 +43,7 @@ public class PerkWitchPotion extends SmashPerk implements IThrown
private static final int COOLDOWN = 2000;
private static final int RANGE_NOMRAL = 3;
private static final int RANGE_SMASH = 4;
private static final int DAMAGE_NORMAL = 6;
private static final int DAMAGE_NORMAL = 7;
private static final int KNOCKBACK_MAGNITUDE = 2;
private List<Projectile> _proj = new ArrayList<>();
@ -99,7 +99,7 @@ public class PerkWitchPotion extends SmashPerk implements IThrown
_proj.add(potion);
Manager.GetProjectile().AddThrow(potion, player, this, 10000, true, true, true, false, false, 0.5F);
Manager.GetProjectile().AddThrow(potion, player, this, 10000, true, true, true, false, false, 0);
// Inform
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
@ -143,39 +143,12 @@ public class PerkWitchPotion extends SmashPerk implements IThrown
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
Set<LivingEntity> players = new HashSet<>();
Player thrower = (Player) data.getThrower();
Map<Player, Double> nearby = UtilPlayer.getInRadius(data.getThrown().getLocation(), RANGE_NOMRAL);
LivingEntity entity = data.getThrower();
if (target != null)
for (Player player : nearby.keySet())
{
players.add(target);
}
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (player.equals(data.getThrower()))
{
continue;
}
double d = UtilMath.offset(player.getLocation().add(0, 1, 0), data.getThrown().getLocation());
if (d > (isSuperActive(thrower) ? RANGE_SMASH : RANGE_NOMRAL))
{
continue;
}
players.add(player);
}
int i = 0;
for (LivingEntity entity : players)
{
// Damage Event
Manager.GetDamage().NewDamageEvent(entity, thrower, null, DamageCause.CUSTOM, (i++ == 0 ? DAMAGE_NORMAL + 1 : DAMAGE_NORMAL), true, true, false, thrower.getName(), GetName());
Manager.GetCondition().Factory().Slow(GetName(), entity, null, 3, 1, true, false, false, false);
Manager.GetDamage().NewDamageEvent(player, entity, null, DamageCause.CUSTOM, DAMAGE_NORMAL * nearby.get(player), true, true, false, entity.getName(), GetName());
}
}

View File

@ -357,12 +357,7 @@ public class PerkWolf extends SmashPerk
for (Player other : Manager.GetGame().GetPlayers(true))
{
if (player.equals(other))
{
continue;
}
if (Manager.isSpectator(other))
if (player.equals(other) || UtilPlayer.isSpectator(other) || isTeamDamage(player, other))
{
continue;
}
@ -490,7 +485,7 @@ public class PerkWolf extends SmashPerk
_repeat.get(damager.getUniqueId()).add(System.currentTimeMillis());
// Exp
damager.setExp(Math.min(0.9999f, _repeat.get(damager.getUniqueId()).size() / 9f));
damager.setExp(Math.min(0.999f, _repeat.get(damager.getUniqueId()).size() / 9f));
}
@EventHandler
@ -521,7 +516,7 @@ public class PerkWolf extends SmashPerk
}
// Exp
player.setExp(Math.min(0.9999f, _repeat.get(player).size() / 9f));
player.setExp(Math.min(0.999f, _repeat.get(uuid).size() / 9f));
}
}
}

View File

@ -271,7 +271,7 @@ public class LegacyGameLobbyManager extends LobbyManager
double space = 4;
double offset = (divide - 1) * space / 2d;
for (int i = 0; i < kits.size() - divide; i++)
for (int i = 1; i < kits.size() - divide; i++)
{
Kit kit = kits.get(i + divide);