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; _multipleColors = true;
_fireworkColor = Color.RED; _fireworkColor = Color.RED;
} }
_colors = new Color[0];
} }
public BabyFireworkEffect(Location location, JavaPlugin javaPlugin, Color... colors) public BabyFireworkEffect(Location location, JavaPlugin javaPlugin, Color... colors)

View File

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

View File

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

View File

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

View File

@ -108,26 +108,9 @@ public abstract class SuperSmash extends Game
new Kit[] { new Kit[] {
new KitSkeleton(manager), new KitSkeleton(manager), new KitGolem(manager), new KitSpider(manager), new KitSlime(manager), new KitCreeper(manager), new KitEnderman(manager), new KitSnowman(manager),
new KitGolem(manager), new KitWolf(manager), new KitBlaze(manager), new KitWitch(manager), new KitChicken(manager), new KitSkeletalHorse(manager), new KitPig(manager), new KitSkySquid(manager),
new KitSpider(manager), new KitWitherSkeleton(manager), new KitMagmaCube(manager), new KitZombie(manager), new KitCow(manager), new KitSheep(manager), new KitGuardian(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); }, type, description);
} }
@ -136,12 +119,12 @@ public abstract class SuperSmash extends Game
{ {
super(manager, type, kits, description); super(manager, type, kits, description);
this.DeathOut = false; DeathOut = false;
this.CompassEnabled = true; CompassEnabled = true;
this.DeathSpectateSecs = 4; DeathSpectateSecs = 4;
this.WorldWaterDamage = 1000; WorldWaterDamage = 1000;
this.HideTeamSheep = true; HideTeamSheep = true;
this.ReplaceTeamsWithKits = true; ReplaceTeamsWithKits = true;
} }
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
@ -170,7 +153,8 @@ public abstract class SuperSmash extends Game
// I think this causes players to sometimes be invisible // I think this causes players to sometimes be invisible
// DisguiseManager disguiseManager = Manager.GetDisguise(); // DisguiseManager disguiseManager = Manager.GetDisguise();
// DisguiseBase disguise = disguiseManager.getActiveDisguise(event.getEntity()); // DisguiseBase disguise =
// disguiseManager.getActiveDisguise(event.getEntity());
// //
// if (disguise == null) // if (disguise == null)
// { // {
@ -315,7 +299,8 @@ public abstract class SuperSmash extends Game
Location newTarget = UtilAlg.Random(WorldData.GetDataLocs(DATA_POINT_POWERUP)); Location newTarget = UtilAlg.Random(WorldData.GetDataLocs(DATA_POINT_POWERUP));
Block targetBlock = newTarget.getBlock(); 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; long restoreTime = (POWERUP_SPAWN_Y_INCREASE / 4 / 2) * 1000 + 500;
_powerupTarget = newTarget.clone(); _powerupTarget = newTarget.clone();
@ -758,15 +743,24 @@ public abstract class SuperSmash extends Game
if (kit.equalsIgnoreCase(kits.GetName())) if (kit.equalsIgnoreCase(kits.GetName()))
{ {
SetKit(player, kits, true); SetKit(player, kits, true);
return;
} }
} }
player.sendMessage(F.main("Kit", "Sorry that is not a kit!"));
} }
else if (message.startsWith("/lives")) else if (message.startsWith("/lives"))
{ {
event.setCancelled(true); event.setCancelled(true);
_lives.put(player, MAX_LIVES);
Announce(C.cWhiteB + player.getName() + C.cAquaB + " reset their 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.Pair;
import mineplex.core.common.util.C; 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.common.util.UtilTextMiddle;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType; import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.events.GameStateChangeEvent;
@ -89,11 +88,11 @@ public class TeamSuperSmash extends SuperSmash
for (GameTeam team : GetTeamList()) for (GameTeam team : GetTeamList())
{ {
Scoreboard.writeGroup(team.GetPlayers(true), player -> Scoreboard.writeGroup(team.GetPlayers(false), player ->
{ {
int lives = getLives(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); }, true);
} }
} }
@ -101,6 +100,7 @@ public class TeamSuperSmash extends SuperSmash
Scoreboard.draw(); Scoreboard.draw();
} }
@Override
@EventHandler @EventHandler
public void gameStart(GameStateChangeEvent event) public void gameStart(GameStateChangeEvent event)
{ {
@ -109,6 +109,8 @@ public class TeamSuperSmash extends SuperSmash
return; return;
} }
super.gameStart(event);
new BukkitRunnable() new BukkitRunnable()
{ {
@ -117,11 +119,6 @@ public class TeamSuperSmash extends SuperSmash
{ {
for (Player player : GetPlayers(true)) for (Player player : GetPlayers(true))
{ {
if (UtilPlayer.isSpectator(player))
{
continue;
}
GameTeam team = GetTeam(player); GameTeam team = GetTeam(player);
Player bestTeamMember = null; Player bestTeamMember = null;
@ -142,11 +139,11 @@ public class TeamSuperSmash extends SuperSmash
if (bestTeamMember == null) 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; 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); }.runTaskLater(Manager.getPlugin(), 40);
@ -163,6 +160,11 @@ public class TeamSuperSmash extends SuperSmash
Player damager = event.GetDamagerPlayer(true); Player damager = event.GetDamagerPlayer(true);
Player damagee = event.GetDamageePlayer(); Player damagee = event.GetDamageePlayer();
if (GetTeam(damager) == null || GetTeam(damagee) == null)
{
return;
}
if (GetTeam(damager).equals(GetTeam(damagee))) if (GetTeam(damager).equals(GetTeam(damagee)))
{ {
if (event.GetCause() == DamageCause.FIRE) if (event.GetCause() == DamageCause.FIRE)

View File

@ -105,7 +105,7 @@ public class KitMagmaCube extends SmashKit
} }
@EventHandler @EventHandler
public void FireItemResist(UpdateEvent event) public void fireResistance(UpdateEvent event)
{ {
if (event.getType() != UpdateType.FAST) if (event.getType() != UpdateType.FAST)
{ {
@ -124,8 +124,7 @@ public class KitMagmaCube extends SmashKit
continue; 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; 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); boolean superActive = isSuperActive(data.Player);
String skillName = superActive ? "Phoenix" : GetName(); String skillName = superActive ? "Phoenix" : GetName();
if (UtilPlayer.isSpectator(player))
{
dataIterator.remove();
continue;
}
// Warmup // Warmup
if (!UtilTime.elapsed(data.Time, WARMUP_TIME) && !superActive) 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 COOLDOWN = 2000;
private static final int CHARGE_TIME = 1200; 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 static final float KNOCKBACK_MAGNITUDE = 2.5F;
private Map<UUID, BlockTossData> _hold = new HashMap<>(); private Map<UUID, BlockTossData> _hold = new HashMap<>();

View File

@ -1,7 +1,6 @@
package nautilus.game.arcade.game.games.smash.perks.golem; package nautilus.game.arcade.game.games.smash.perks.golem;
import java.util.List; import java.util.List;
import java.util.Map;
import org.bukkit.Effect; import org.bukkit.Effect;
import org.bukkit.Material; import org.bukkit.Material;
@ -60,7 +59,7 @@ public class SmashGolem extends SmashUltimate
for (Player other : alivePlayers) for (Player other : alivePlayers)
{ {
if (player.equals(other) || UtilPlayer.isSpectator(player)) if (player.equals(other) || UtilPlayer.isSpectator(other))
{ {
continue; 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.ArmorStand;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import mineplex.core.common.util.UtilEnt;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
public class TargetLazerData public class TargetLazerData
@ -35,6 +37,9 @@ public class TargetLazerData
_targetPlaceholder.setBasePlate(false); _targetPlaceholder.setBasePlate(false);
_targetPlaceholder.setGravity(false); _targetPlaceholder.setGravity(false);
_targetPlaceholder.setVisible(false); _targetPlaceholder.setVisible(false);
UtilEnt.ghost(_targetPlaceholder, true, false);
manager.GetGame().CreatureAllowOverride = false; manager.GetGame().CreatureAllowOverride = false;
} }

View File

@ -102,7 +102,8 @@ public class PerkFlameDash extends Perk
return; 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)); _data.add(new FireflyData(player));

View File

@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
@ -39,7 +40,7 @@ public class PerkMagmaBoost extends Perk
{ {
Player killed = (Player) event.GetEvent().getEntity(); Player killed = (Player) event.GetEvent().getEntity();
_kills.remove(killed); _kills.remove(killed.getUniqueId());
if (event.GetLog().GetKiller() == null) if (event.GetLog().GetKiller() == null)
{ {
@ -75,6 +76,8 @@ public class PerkMagmaBoost extends Perk
slime.SetSize(size + 1); slime.SetSize(size + 1);
Manager.GetDisguise().updateDisguise(slime); Manager.GetDisguise().updateDisguise(slime);
Bukkit.broadcastMessage("Exp: " + 0.99f * (size / MAX_STACKS));
killer.setExp(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()); 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; 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(); playerIterator.remove();
setWoolColor(player, DyeColor.WHITE); setWoolColor(player, DyeColor.WHITE);

View File

@ -37,6 +37,7 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.smash.perks.SmashPerk; import nautilus.game.arcade.game.games.smash.perks.SmashPerk;
public class PerkSlimeRocket extends SmashPerk implements IThrown public class PerkSlimeRocket extends SmashPerk implements IThrown
@ -45,6 +46,8 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
private static final int COOLDOWN = 6000; private static final int COOLDOWN = 6000;
private static final float ENERGY_PER_TICK = 0.004F; private static final float ENERGY_PER_TICK = 0.004F;
private static final int KNOCKBACK_MAGNITUDE = 3; 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<UUID, Long> _charge = new HashMap<>();
private Map<Slime, UUID> _owner = new HashMap<>(); private Map<Slime, UUID> _owner = new HashMap<>();
@ -93,7 +96,7 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
Manager.GetDisguise().updateDisguise(slime); Manager.GetDisguise().updateDisguise(slime);
} }
if (player.isBlocking()) if (player.isBlocking() && !Recharge.Instance.usable(player, GetName()))
{ {
continue; continue;
} }
@ -184,22 +187,23 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
double elapsed = Math.min(3, (double) (System.currentTimeMillis() - time) / 1000d); double elapsed = Math.min(3, (double) (System.currentTimeMillis() - time) / 1000d);
// Use Energy // Use Energy
if (!UtilTime.elapsed(time, 3000)) if (!UtilTime.elapsed(time, MAX_ENERGY_TIME))
{ {
player.setExp((float) Math.max(0, player.getExp() - 0.01f)); player.setExp((float) Math.max(0, player.getExp() - 0.01f));
} }
// AutoFire // AutoFire
if (UtilTime.elapsed(time, 5000)) if (UtilTime.elapsed(time, MAX_HOLD_TIME))
{ {
FireRocket(player); FireRocket(player);
chargeIterator.remove(); chargeIterator.remove();
} }
float offset = (float) (elapsed / 6d);
// Effect // Effect
player.getWorld().playSound(player.getLocation(), Sound.SLIME_WALK, 0.5f, (float) (0.5 + 1.5 * (elapsed / 3d))); 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), UtilParticle.PlayParticle(ParticleType.SLIME, player.getLocation().add(0, 1, 0), offset, offset, offset, 0, (int) (elapsed * 5), ViewDist.LONGER, UtilServer.getPlayers());
ViewDist.LONGER, UtilServer.getPlayers());
} }
} }
// Release // Release
@ -255,7 +259,7 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
if (event.getTarget() instanceof Player) 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); event.setCancelled(true);
return; return;

View File

@ -75,11 +75,6 @@ public class PerkSlimeSlam extends SmashPerk
return; return;
} }
if (isSuperActive(player))
{
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true)) if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
{ {
return; return;
@ -114,12 +109,7 @@ public class PerkSlimeSlam extends SmashPerk
for (Player other : alivePlayers) for (Player other : alivePlayers)
{ {
if (UtilPlayer.isSpectator(other)) if (player.equals(other) || UtilPlayer.isSpectator(other) || isTeamDamage(player, other))
{
continue;
}
if (other.equals(player))
{ {
continue; continue;
} }
@ -171,10 +161,10 @@ public class PerkSlimeSlam extends SmashPerk
if (!isSuperActive(damager)) 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 // 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 // Inform
UtilPlayer.message(damager, F.main("Game", "You hit " + F.name(UtilEnt.getName(damagee)) + " with " + F.skill(GetName()) + ".")); 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); super.activate(player);
player.getInventory().remove(Material.IRON_SWORD); player.getInventory().remove(Material.IRON_SWORD);
player.getInventory().remove(Material.IRON_AXE);
DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player); DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player);
if (disguise != null && disguise instanceof DisguiseSlime) if (disguise != null && disguise instanceof DisguiseSlime)

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
import org.bukkit.block.Block; 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 COOLDOWN = 2000;
private static final int RANGE_NOMRAL = 3; private static final int RANGE_NOMRAL = 3;
private static final int RANGE_SMASH = 4; private static final int DAMAGE_NORMAL = 7;
private static final int DAMAGE_NORMAL = 6;
private static final int KNOCKBACK_MAGNITUDE = 2; private static final int KNOCKBACK_MAGNITUDE = 2;
private List<Projectile> _proj = new ArrayList<>(); private List<Projectile> _proj = new ArrayList<>();
@ -99,7 +99,7 @@ public class PerkWitchPotion extends SmashPerk implements IThrown
_proj.add(potion); _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 // Inform
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + ".")); UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
@ -143,39 +143,12 @@ public class PerkWitchPotion extends SmashPerk implements IThrown
@Override @Override
public void Collide(LivingEntity target, Block block, ProjectileUser data) public void Collide(LivingEntity target, Block block, ProjectileUser data)
{ {
Set<LivingEntity> players = new HashSet<>(); Map<Player, Double> nearby = UtilPlayer.getInRadius(data.getThrown().getLocation(), RANGE_NOMRAL);
Player thrower = (Player) data.getThrower(); LivingEntity entity = data.getThrower();
if (target != null) for (Player player : nearby.keySet())
{ {
players.add(target); Manager.GetDamage().NewDamageEvent(player, entity, null, DamageCause.CUSTOM, DAMAGE_NORMAL * nearby.get(player), true, true, false, entity.getName(), GetName());
}
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);
} }
} }

View File

@ -357,12 +357,7 @@ public class PerkWolf extends SmashPerk
for (Player other : Manager.GetGame().GetPlayers(true)) for (Player other : Manager.GetGame().GetPlayers(true))
{ {
if (player.equals(other)) if (player.equals(other) || UtilPlayer.isSpectator(other) || isTeamDamage(player, other))
{
continue;
}
if (Manager.isSpectator(other))
{ {
continue; continue;
} }
@ -490,7 +485,7 @@ public class PerkWolf extends SmashPerk
_repeat.get(damager.getUniqueId()).add(System.currentTimeMillis()); _repeat.get(damager.getUniqueId()).add(System.currentTimeMillis());
// Exp // 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 @EventHandler
@ -521,7 +516,7 @@ public class PerkWolf extends SmashPerk
} }
// Exp // 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 space = 4;
double offset = (divide - 1) * space / 2d; 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); Kit kit = kits.get(i + divide);