Merge pull request #154 from Mineplex-LLC/develop
Merge develop into project cosmetics
This commit is contained in:
commit
77af9fb5c2
@ -1617,35 +1617,4 @@ public class UtilBlock
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static boolean water(Material type)
|
||||
{
|
||||
return type == Material.WATER || type == Material.STATIONARY_WATER;
|
||||
}
|
||||
|
||||
public static boolean lava(Material type)
|
||||
{
|
||||
return type == Material.LAVA || type == Material.STATIONARY_LAVA;
|
||||
}
|
||||
|
||||
public static boolean liquid(Material type)
|
||||
{
|
||||
return water(type) || lava(type);
|
||||
}
|
||||
|
||||
public static boolean water(Block block)
|
||||
{
|
||||
return water(block.getType());
|
||||
}
|
||||
|
||||
public static boolean lava(Block block)
|
||||
{
|
||||
return lava(block.getType());
|
||||
}
|
||||
|
||||
public static boolean liquid(Block block)
|
||||
{
|
||||
return liquid(block.getType());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,59 @@
|
||||
package mineplex.core.common.util;
|
||||
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
|
||||
public class UtilParser
|
||||
{
|
||||
public static String parseDamageCause(EntityDamageEvent.DamageCause cause)
|
||||
{
|
||||
switch (cause)
|
||||
{
|
||||
case CONTACT:
|
||||
return "Cactus";
|
||||
case ENTITY_ATTACK:
|
||||
return "Attack";
|
||||
case PROJECTILE:
|
||||
return "Ranged Weapon";
|
||||
case SUFFOCATION:
|
||||
return "Suffocation";
|
||||
case FALL:
|
||||
return "Fall";
|
||||
case FIRE:
|
||||
return "Fire";
|
||||
case FIRE_TICK:
|
||||
return "Burning";
|
||||
case MELTING:
|
||||
return "Melting";
|
||||
case LAVA:
|
||||
return "Lava";
|
||||
case DROWNING:
|
||||
return "Drowning";
|
||||
case BLOCK_EXPLOSION:
|
||||
return "Explosion";
|
||||
case ENTITY_EXPLOSION:
|
||||
return "Explosion";
|
||||
case VOID:
|
||||
return "Void";
|
||||
case LIGHTNING:
|
||||
return "Lightning";
|
||||
case SUICIDE:
|
||||
return "Suicide";
|
||||
case STARVATION:
|
||||
return "Hunger";
|
||||
case POISON:
|
||||
return "Poison";
|
||||
case MAGIC:
|
||||
return "Thrown Potion";
|
||||
case WITHER:
|
||||
return "Wither Effect";
|
||||
case FALLING_BLOCK:
|
||||
return "Falling Block";
|
||||
case THORNS:
|
||||
return "Thorns Enchantment";
|
||||
case CUSTOM:
|
||||
return "Custom";
|
||||
default:
|
||||
return "The Mighty defek7";
|
||||
}
|
||||
}
|
||||
}
|
@ -769,11 +769,11 @@ public enum Achievement
|
||||
new int[] {3},
|
||||
AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
|
||||
// BAWK_BAWK_BATTLES_BOUNCING_SHADOW("Bouncing Shadow", 500,
|
||||
// new String[]{"Bawk Bawk Battles.BouncingShadow"},
|
||||
// new String[]{C.cGray + "Bouncing Block Challenge", "Win 3 entire rounds", "without stepping on red wool"},
|
||||
// new int[] {3},
|
||||
// AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
BAWK_BAWK_BATTLES_BOUNCING_SHADOW("Bouncing Shadow", 500,
|
||||
new String[]{"Bawk Bawk Battles.BouncingShadow"},
|
||||
new String[]{C.cGray + "Bouncing Block Challenge", "Win 3 entire rounds", "without stepping on red wool"},
|
||||
new int[] {3},
|
||||
AchievementCategory.BAWK_BAWK_BATTLES),
|
||||
|
||||
//Bomb Lobbers
|
||||
BOMB_LOBBERS_WINS("Master Bomber", 1200,
|
||||
|
@ -592,7 +592,7 @@ public class GadgetManager extends MiniPlugin
|
||||
|
||||
if (armor.getSlot() == slot)
|
||||
{
|
||||
armor.removeArmor(player);
|
||||
armor.removeArmor(player, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class BabyCowBalloon extends BalloonGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
_entityStand.remove();
|
||||
_balloonEntity.remove();
|
||||
|
@ -47,9 +47,9 @@ public class ItemBatGun extends ItemGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
super.disableCustom(player);
|
||||
super.disableCustom(player, message);
|
||||
|
||||
Clear(player);
|
||||
}
|
||||
|
@ -42,9 +42,9 @@ public class ItemEtherealPearl extends ItemGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
super.disableCustom(player);
|
||||
super.disableCustom(player, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -89,13 +89,13 @@ public class ItemPaintbrush extends ItemGadget
|
||||
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
_brushColor.remove(player.getName());
|
||||
_brushPrevious.remove(player.getName());
|
||||
_playerLocation.remove(player.getName());
|
||||
|
||||
RemoveItem(player);
|
||||
RemoveItem(player, message);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -65,7 +65,7 @@ public class MorphBat extends MorphGadget implements IThrown
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -48,7 +48,7 @@ public class MorphBlaze extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -54,7 +54,7 @@ public class MorphBlock extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
|
||||
|
@ -79,7 +79,7 @@ public class MorphBunny extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
_jumpCharge.remove(player);
|
||||
this.RemoveArmor(player);
|
||||
|
@ -54,7 +54,7 @@ public class MorphChicken extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -42,7 +42,7 @@ public class MorphCow extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -56,7 +56,7 @@ public class MorphCreeper extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -53,7 +53,7 @@ public class MorphEnderman extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -55,7 +55,7 @@ public class MorphPig extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -1,6 +1,5 @@
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Skeleton.SkeletonType;
|
||||
@ -47,7 +46,7 @@ public class MorphPumpkinKing extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -65,7 +65,7 @@ public class MorphSlime extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -66,7 +66,7 @@ public class MorphSnowman extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -70,7 +70,7 @@ public class MorphTitan extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -46,7 +46,7 @@ public class MorphUncleSam extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
|
||||
|
@ -64,7 +64,7 @@ public class MorphVillager extends MorphGadget implements IThrown
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -73,7 +73,7 @@ public class MorphWither extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
@ -200,7 +200,7 @@ public class MorphWither extends MorphGadget
|
||||
|
||||
if (disguise == null || !(disguise instanceof DisguiseWither))
|
||||
{
|
||||
disableCustom(player);
|
||||
disableCustom(player, true);
|
||||
activeIterator.remove();
|
||||
continue;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ public class OutfitTeam extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeArmor(Player player)
|
||||
public void removeArmor(Player player, boolean message)
|
||||
{
|
||||
if (!_active.remove(player))
|
||||
return;
|
||||
@ -96,9 +96,9 @@ public class OutfitTeam extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
removeArmor(player);
|
||||
removeArmor(player, message);
|
||||
}
|
||||
|
||||
@EventHandler(priority=EventPriority.LOWEST)
|
||||
|
@ -43,9 +43,9 @@ public class OutfitRaveSuit extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
removeArmor(player);
|
||||
removeArmor(player, message);
|
||||
_colorPhase.remove(player.getName());
|
||||
}
|
||||
|
||||
|
@ -32,9 +32,9 @@ public class OutfitSpaceSuit extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
removeArmor(player);
|
||||
removeArmor(player, message);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -41,9 +41,9 @@ public class OutfitWindUpSuit extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
removeArmor(player);
|
||||
removeArmor(player, message);
|
||||
_colorPhase.remove(player);
|
||||
_percentage.remove(player);
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class ParticleFairy extends ParticleGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player)) UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(getName()) + "."));
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class ParticleKronos extends ParticleGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player))
|
||||
UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(getName()) + "."));
|
||||
|
@ -46,7 +46,7 @@ public class ParticleHeart extends ParticleGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player)) UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(getName()) + "."));
|
||||
}
|
||||
|
@ -146,11 +146,6 @@ public abstract class Gadget extends SalesPackageBase implements Listener
|
||||
UtilPlayer.message(player, F.main("Gadget", "You enabled " + F.elem(getName()) + "."));
|
||||
}
|
||||
|
||||
public void disableCustom(Player player)
|
||||
{
|
||||
disableCustom(player, true);
|
||||
}
|
||||
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player) && message)
|
||||
|
@ -59,11 +59,12 @@ public abstract class HatGadget extends OutfitGadget
|
||||
player.getInventory().setHelmet(getHelmetItem());
|
||||
}
|
||||
|
||||
public void removeArmor(Player player)
|
||||
public void removeArmor(Player player, boolean message)
|
||||
{
|
||||
if (!_active.remove(player))
|
||||
return;
|
||||
|
||||
if (message)
|
||||
UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(getName()) + "."));
|
||||
|
||||
player.getInventory().setHelmet(null);
|
||||
@ -96,9 +97,9 @@ public abstract class HatGadget extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
removeArmor(player);
|
||||
removeArmor(player, message);
|
||||
}
|
||||
|
||||
public HatType getHatType()
|
||||
|
@ -56,9 +56,9 @@ public abstract class ItemGadget extends Gadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
RemoveItem(player);
|
||||
RemoveItem(player, message);
|
||||
}
|
||||
|
||||
public HashSet<Player> getActive()
|
||||
@ -113,12 +113,13 @@ public abstract class ItemGadget extends Gadget
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveItem(Player player)
|
||||
public void RemoveItem(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player))
|
||||
{
|
||||
player.getInventory().setItem(Manager.getActiveItemSlot(), null);
|
||||
|
||||
if (message)
|
||||
UtilPlayer.message(player, F.main("Gadget", "You unequipped " + F.elem(getName()) + "."));
|
||||
}
|
||||
}
|
||||
|
@ -68,11 +68,12 @@ public abstract class OutfitGadget extends Gadget
|
||||
ItemStackFactory.Instance.CreateStack(getDisplayMaterial().getId(), getDisplayData(), 1, getName()));
|
||||
}
|
||||
|
||||
public void removeArmor(Player player)
|
||||
public void removeArmor(Player player, boolean message)
|
||||
{
|
||||
if (!_active.remove(player))
|
||||
return;
|
||||
|
||||
if (message)
|
||||
UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(getName()) + "."));
|
||||
|
||||
if (_slot == ArmorSlot.Helmet) player.getInventory().setHelmet(null);
|
||||
|
@ -41,7 +41,7 @@ public abstract class ParticleGadget extends Gadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player))
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ public enum GameDisplay
|
||||
Micro("Micro Battle", Material.LAVA_BUCKET, (byte)0, GameCategory.ARCADE, 24),
|
||||
MilkCow("Milk the Cow", Material.MILK_BUCKET, (byte)0, GameCategory.ARCADE, 27),
|
||||
MineStrike("MineStrike", Material.TNT, (byte)0, GameCategory.CHAMPIONS, 25),// Temp set to CHAMPIONS to fix UI bug
|
||||
BawkBawkBattles("Bawk Bawk Battles", Material.EGG, (byte)0, GameCategory.EXTRA, 26),
|
||||
BawkBawkBattles("Bawk Bawk Battles", Material.EGG, (byte)0, GameCategory.CLASSICS, 26),
|
||||
OldMineWare("Old MineWare", Material.PAPER, (byte)0, GameCategory.EXTRA, 26),
|
||||
Paintball("Super Paintball", Material.ENDER_PEARL, (byte)0, GameCategory.ARCADE, 28),
|
||||
Quiver("One in the Quiver", Material.ARROW, (byte)0, GameCategory.ARCADE, 29),
|
||||
|
@ -227,7 +227,8 @@ public class InventoryManager extends MiniDbClientPlugin<ClientInventory>
|
||||
event.getInventory().setItem(1, new ItemStack(Material.INK_SACK, level, (byte) 4));
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
// fixme broken cast
|
||||
// @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void onBlockBreak(BlockBreakEvent event)
|
||||
{
|
||||
if (event.getBlock().getType() != Material.ENCHANTMENT_TABLE)
|
||||
|
@ -159,7 +159,7 @@ public class PersonalServerManager extends MiniPlugin
|
||||
}
|
||||
}
|
||||
|
||||
final ServerGroup serverGroup = new ServerGroup(serverName, serverName, host.getName(), ram, cpu, 1, 0, UtilMath.random.nextInt(250) + 19999, null, true, "arcade.zip", "Arcade.jar", "plugins/Arcade/", minPlayers, maxPlayers,
|
||||
final ServerGroup serverGroup = new ServerGroup(serverName, serverName, host.getName(), ram, cpu, 1, 0, UtilMath.random.nextInt(250) + 19999, "", true, "arcade.zip", "Arcade.jar", "plugins/Arcade/", minPlayers, maxPlayers,
|
||||
true, false, false, games, "", "", "Player", true, event, false, true, false, true, true, false, false, false, false, true, true, true, false, false, "", _us ? Region.US : Region.EU, "", "", "", "");
|
||||
|
||||
getPlugin().getServer().getScheduler().runTaskAsynchronously(getPlugin(), new Runnable()
|
||||
|
@ -88,15 +88,6 @@ public class ProjectileManager extends MiniPlugin
|
||||
sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult));
|
||||
}
|
||||
|
||||
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
|
||||
long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle,
|
||||
Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, float hitboxMult, double charge)
|
||||
{
|
||||
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
|
||||
expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false,
|
||||
sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult, charge));
|
||||
}
|
||||
|
||||
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
|
||||
long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle,
|
||||
Sound sound, float soundVolume, float soundPitch, ParticleType particle, float pX, float pY, float pZ, float pS, int pC, UpdateType effectRate, float hitboxMult)
|
||||
|
@ -63,8 +63,6 @@ public class ProjectileUser
|
||||
|
||||
private double _hitboxGrow;
|
||||
|
||||
private double _charge;
|
||||
|
||||
private List<Player> _canHit;
|
||||
|
||||
public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback,
|
||||
@ -106,47 +104,6 @@ public class ProjectileUser
|
||||
_canHit = null;
|
||||
}
|
||||
|
||||
public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback,
|
||||
long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, boolean pickup,
|
||||
Sound sound, float soundVolume, float soundPitch,
|
||||
Effect effect, int effectData, UpdateType effectRate,
|
||||
ParticleType particle, float particleX, float particleY,
|
||||
float particleZ, float particleS, int particleC, double hitboxMult, double charge)
|
||||
{
|
||||
Throw = throwInput;
|
||||
|
||||
_thrown = thrown;
|
||||
_thrower = thrower;
|
||||
_callback = callback;
|
||||
|
||||
_expireTime = expireTime;
|
||||
_startTime = System.currentTimeMillis();
|
||||
|
||||
_hitPlayer = hitPlayer;
|
||||
_hitNonPlayerEntity = hitNonPlayerEntity;
|
||||
_hitBlock = hitBlock;
|
||||
_idle = idle;
|
||||
_pickup = pickup;
|
||||
|
||||
_sound = sound;
|
||||
_soundVolume = soundVolume;
|
||||
_soundPitch = soundPitch;
|
||||
_particle = particle;
|
||||
_particleX = particleX;
|
||||
_particleY = particleY;
|
||||
_particleZ = particleZ;
|
||||
_particleS = particleS;
|
||||
_particleC = particleC;
|
||||
_effect = effect;
|
||||
_effectData = effectData;
|
||||
_effectRate = effectRate;
|
||||
|
||||
_hitboxGrow = hitboxMult;
|
||||
_canHit = null;
|
||||
|
||||
_charge = charge;
|
||||
}
|
||||
|
||||
public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback,
|
||||
long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, boolean pickup,
|
||||
Sound sound, float soundVolume, float soundPitch,
|
||||
@ -186,7 +143,6 @@ public class ProjectileUser
|
||||
_canHit = canHit;
|
||||
}
|
||||
|
||||
|
||||
public void effect(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != _effectRate)
|
||||
@ -356,11 +312,6 @@ public class ProjectileUser
|
||||
return false;
|
||||
}
|
||||
|
||||
public double getCharge()
|
||||
{
|
||||
return _charge;
|
||||
}
|
||||
|
||||
public IThrown getIThrown()
|
||||
{
|
||||
return _callback;
|
||||
|
@ -924,6 +924,11 @@ public class ServerManager extends MiniDbClientPlugin<SimpleClanToken> implement
|
||||
return _serverNpcShopMap.get("Weekend Brawl");
|
||||
}
|
||||
|
||||
public ShopBase<ServerManager> getBawkShop()
|
||||
{
|
||||
return _serverNpcShopMap.get("Bawk Bawk Battles");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getQuery(int accountId, String uuid, String name)
|
||||
{
|
||||
|
@ -41,25 +41,32 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
add(2, Material.QUARTZ_BLOCK, C.cYellowB + "Speed Builders " + C.cGray + "Competitive Building", new String[]
|
||||
add(1, Material.EGG, C.cYellowB + "Bawk Bawk Battles " + C.cGray + "Challenges", new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "NEW GAME",
|
||||
C.Reset + "",
|
||||
C.Reset + "Follow Bawk Bawk's instructions",
|
||||
C.Reset + "Complete different tasks",
|
||||
C.Reset + "If you lose, chickens will devour you!"
|
||||
}, "BBB", "Bawk_Bawk_Battles", new SelectBawkButton(this));
|
||||
|
||||
add(3, Material.QUARTZ_BLOCK, C.cYellowB + "Speed Builders " + C.cGray + "Competitive Building", new String[]
|
||||
{
|
||||
C.Reset + "",
|
||||
C.Reset + "Memorize Gwen the Guardian's builds",
|
||||
C.Reset + "Then recreate them in a short amount of time.",
|
||||
C.Reset + "The least correct builder is eliminated.",
|
||||
}, "SB", "Speed_Builders", new SelectSBButton(this));
|
||||
|
||||
add(4, Material.BOOK_AND_QUILL, C.cYellowB + "Draw My Thing " + C.cGray + "Pictionary", new String[]
|
||||
add(5, Material.BOOK_AND_QUILL, C.cYellowB + "Draw My Thing " + C.cGray + "Pictionary", new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "NEW UPDATE",
|
||||
C.Reset + "",
|
||||
C.Reset + "Players take turns at drawing a random",
|
||||
C.Reset + "word. Whoever guesses it within the time",
|
||||
C.Reset + "limit gets some points!",
|
||||
}, "DMT", "Draw_My_Thing", new SelectDMTButton(this));
|
||||
|
||||
add(6, Material.TNT, C.cYellowB + "Dragon Escape " + C.cGray + "Fast Paced Parkour", new String[]
|
||||
add(7, Material.TNT, C.cYellowB + "Dragon Escape " + C.cGray + "Fast Paced Parkour", new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "FEATURED ARCADE GAME",
|
||||
C.Reset + "",
|
||||
@ -192,7 +199,6 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
|
||||
add(41, Material.BREWING_STAND_ITEM, C.cYellowB + "Monster Maze " + C.cGray + "Snow Sprint", new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "BETA GAME",
|
||||
C.Reset + "",
|
||||
C.Reset + "Run along a maze avoiding",
|
||||
C.Reset + "evil monsters. Get to the",
|
||||
@ -571,6 +577,11 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
getPlugin().getValentinesShop().attemptShopOpen(player);
|
||||
}
|
||||
|
||||
public void openBawk(Player player)
|
||||
{
|
||||
getPlugin().getBawkShop().attemptShopOpen(player);
|
||||
}
|
||||
|
||||
/*
|
||||
ADDITIONAL LORES;
|
||||
|
||||
|
@ -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 SelectBawkButton implements IButton
|
||||
{
|
||||
private ServerGameMenu _menu;
|
||||
|
||||
public SelectBawkButton(ServerGameMenu menu)
|
||||
{
|
||||
_menu = menu;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
_menu.openBawk(player);
|
||||
}
|
||||
}
|
@ -206,9 +206,6 @@ public class Blink extends SkillActive
|
||||
done = true;
|
||||
}
|
||||
|
||||
target.setYaw(player.getLocation().getYaw());
|
||||
target.setPitch(player.getLocation().getPitch());
|
||||
|
||||
player.teleport(target);
|
||||
|
||||
player.setFallDistance(0);
|
||||
|
@ -29,7 +29,6 @@ import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
||||
|
||||
@ -214,11 +213,10 @@ public class Evade extends SkillActive
|
||||
{
|
||||
Player player = activeIter.next();
|
||||
|
||||
if (!player.isOnline() || !player.isBlocking() || UtilTime.elapsed(_active.get(player), 1000))
|
||||
if (!player.isOnline() || !player.isBlocking() || UtilTime.elapsed(_active.get(player), 750))
|
||||
{
|
||||
activeIter.remove();
|
||||
UtilPlayer.message(player, F.main(GetClassType().name(), "You failed to " + F.skill(GetName()) + "."));
|
||||
Recharge.Instance.useForce(player, GetName(), 10000l, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
@ -29,6 +28,7 @@ import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
||||
import mineplex.minecraft.game.classcombat.Skill.Skill;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
||||
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
|
||||
import net.minecraft.server.v1_8_R3.Material;
|
||||
|
||||
public class Recall extends Skill
|
||||
{
|
||||
@ -69,12 +69,6 @@ public class Recall extends Skill
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
if (UtilBlock.water(player.getLocation().getBlock()))
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " in water."));
|
||||
return;
|
||||
}
|
||||
|
||||
//Check Allowed
|
||||
SkillTriggerEvent trigger = new SkillTriggerEvent(player, GetName(), GetClassType());
|
||||
Bukkit.getServer().getPluginManager().callEvent(trigger);
|
||||
|
@ -6,14 +6,12 @@ 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.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import mineplex.minecraft.game.classcombat.Skill.Skill;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
|
||||
public class ViperStrikes extends Skill
|
||||
{
|
||||
@ -23,8 +21,8 @@ public class ViperStrikes extends Skill
|
||||
|
||||
SetDesc(new String[]
|
||||
{
|
||||
"Your attacks give",
|
||||
"enemies Poison 1",
|
||||
"Your attacks give enemies",
|
||||
"Shock, Slow 1 and Poison 1",
|
||||
"for #0#1 seconds."
|
||||
});
|
||||
}
|
||||
@ -50,8 +48,9 @@ public class ViperStrikes extends Skill
|
||||
LivingEntity damagee = event.GetDamageeEntity();
|
||||
if (damagee == null) return;
|
||||
|
||||
Factory.Damage().NewDamageEvent(damagee, damager, null, DamageCause.POISON, 0, false, true, true, damager.getName(), GetName());
|
||||
damagee.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 20 * (2 + level), 0));
|
||||
//Confuse
|
||||
Factory.Condition().Factory().PoisonShock(GetName(), damagee, damager, level, false);
|
||||
Factory.Condition().Factory().Slow(GetName(), damagee, damager, level, 0, false, false, true, false);
|
||||
|
||||
//Sound
|
||||
damager.getWorld().playSound(damager.getLocation(), Sound.SPIDER_IDLE, 1f, 2f);
|
||||
|
@ -9,34 +9,32 @@ import org.bukkit.Effect;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.FallingBlock;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
||||
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.UtilGear;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
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.classcombat.Class.IPvpClass.ClassType;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillCharge;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
||||
import mineplex.minecraft.game.classcombat.Skill.event.BlockTossExpireEvent;
|
||||
@ -92,7 +90,7 @@ public class BlockToss extends SkillCharge implements IThrown
|
||||
@Override
|
||||
public String GetRechargeString()
|
||||
{
|
||||
return "Recharge: " + "#5.5#-0.5 Seconds";
|
||||
return "Recharge: " + "#4#-0.5 Seconds";
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -196,21 +194,6 @@ public class BlockToss extends SkillCharge implements IThrown
|
||||
player.getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, block.getMaterial().getId());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Damage(EntityDamageByEntityEvent event)
|
||||
{
|
||||
Entity vehicle = event.getEntity().getVehicle();
|
||||
|
||||
if (_holding.containsKey(vehicle))
|
||||
{
|
||||
Player attacker = (Player) event.getDamager();
|
||||
|
||||
//Forward Damage
|
||||
Factory.Damage().NewDamageEvent((Player) vehicle, attacker, Factory.Damage().GetProjectile(event),
|
||||
event.getCause(), event.getDamage(), true, false, false, null, null, event.isCancelled());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Throw(UpdateEvent event)
|
||||
{
|
||||
@ -241,7 +224,7 @@ public class BlockToss extends SkillCharge implements IThrown
|
||||
}
|
||||
|
||||
//Throw
|
||||
if (!cur.isBlocking() || (_charge.containsKey(cur) && _charge.get(cur) >= 1))
|
||||
if (!cur.isBlocking())
|
||||
throwSet.add(cur);
|
||||
|
||||
//Charged Tick
|
||||
@ -258,7 +241,7 @@ public class BlockToss extends SkillCharge implements IThrown
|
||||
for (Player cur : throwSet)
|
||||
{
|
||||
Recharge.Instance.recharge(cur, GetName());
|
||||
Recharge.Instance.use(cur, GetName(), 5500 - (500 * getLevel(cur)), false, true);
|
||||
Recharge.Instance.use(cur, GetName(), 4000 - (500 * getLevel(cur)), false, true);
|
||||
|
||||
FallingBlock block = _holding.remove(cur);
|
||||
float charge = _charge.remove(cur);
|
||||
|
@ -24,7 +24,7 @@ public class CripplingBlow extends Skill
|
||||
{
|
||||
"Your powerful axe attacks give",
|
||||
"targets Slow 2 for 1.5 second,",
|
||||
"as well as 25% less knockback."
|
||||
"as well as 50% less knockback."
|
||||
});
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ public class CripplingBlow extends Skill
|
||||
|
||||
//Damage
|
||||
event.AddMod(damager.getName(), GetName(), 0, true);
|
||||
event.AddKnockback(GetName(), 0.75);
|
||||
event.AddKnockback(GetName(), 0.5);
|
||||
|
||||
//Event
|
||||
UtilServer.getServer().getPluginManager().callEvent(new SkillEvent(damager, GetName(), ClassType.Brute, damagee));
|
||||
|
@ -97,12 +97,6 @@ public class DwarfToss extends SkillActive
|
||||
int level = getLevel(player);
|
||||
if (level == 0) return false;
|
||||
|
||||
if (player.getLocation().getBlock().getTypeId() == 8 || player.getLocation().getBlock().getTypeId() == 9)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " in water."));
|
||||
return false;
|
||||
}
|
||||
|
||||
//Check Material
|
||||
if (player.getItemInHand() != null)
|
||||
if (!_itemSet.contains(player.getItemInHand().getType()))
|
||||
@ -343,9 +337,6 @@ public class DwarfToss extends SkillActive
|
||||
target.leaveVehicle();
|
||||
final double mult = (1.8) * timeScale;
|
||||
|
||||
//Protection
|
||||
Factory.Condition().Factory().Invulnerable(GetName(), target, target, 1.25, false, false);
|
||||
|
||||
//Delay
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(Factory.getPlugin(), new Runnable()
|
||||
{
|
||||
|
@ -101,7 +101,7 @@ public class FleshHook extends SkillActiveCharge implements IThrown
|
||||
//Release Charge
|
||||
else if (_charge.containsKey(cur))
|
||||
{
|
||||
double charge = _charge.remove(cur);
|
||||
float charge = _charge.remove(cur);
|
||||
|
||||
//Action
|
||||
Item item = cur.getWorld().dropItem(cur.getEyeLocation().add(cur.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(131));
|
||||
@ -109,7 +109,7 @@ public class FleshHook extends SkillActiveCharge implements IThrown
|
||||
1 + charge , false, 0, 0.2, 20, false);
|
||||
|
||||
Factory.Projectile().AddThrow(item, cur, this, -1, true, true, true, true,
|
||||
Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, UpdateType.TICK, 0.6f, charge);
|
||||
Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, UpdateType.TICK, 0.6f);
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(cur, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));
|
||||
@ -148,14 +148,14 @@ public class FleshHook extends SkillActiveCharge implements IThrown
|
||||
//Pull
|
||||
UtilAction.velocity(target,
|
||||
UtilAlg.getTrajectory(target.getLocation(), player.getLocation()),
|
||||
velocity, false, 0, 0.7, 1.2, true);
|
||||
1.2 + (0.3 * level), false, 0, 0.7, 1.2, true);
|
||||
|
||||
//Condition
|
||||
Factory.Condition().Factory().Falling(GetName(), target, player, 10, false, true);
|
||||
|
||||
//Damage Event
|
||||
Factory.Damage().NewDamageEvent(target, player, null,
|
||||
DamageCause.CUSTOM, (5 + level) * data.getCharge(), false, true, false,
|
||||
DamageCause.CUSTOM, 5 + level, false, true, false,
|
||||
player.getName(), GetName());
|
||||
|
||||
|
||||
|
@ -21,7 +21,7 @@ public class Intimidation extends Skill
|
||||
SetDesc(new String[]
|
||||
{
|
||||
"You intimidate nearby enemies;",
|
||||
"Enemies within #4#2 blocks receive Slow 1.",
|
||||
"Enemies within #3#3 blocks receive Slow 1.",
|
||||
});
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ public class Intimidation extends Skill
|
||||
int level = getLevel(cur);
|
||||
if (level == 0) continue;
|
||||
|
||||
HashMap<Player, Double> targets = UtilPlayer.getInRadius(cur.getLocation(), 3 + (level * 2));
|
||||
HashMap<Player, Double> targets = UtilPlayer.getInRadius(cur.getLocation(), 3 + (level * 3));
|
||||
for (Player other : targets.keySet())
|
||||
if (!other.equals(cur))
|
||||
if (Factory.Relation().canHurt(cur, other))
|
||||
|
@ -52,7 +52,7 @@ public class AxeThrow extends SkillActive implements IThrown
|
||||
SetDesc(new String[]
|
||||
{
|
||||
"Throw your axe with #0.7#0.1 velocity, ",
|
||||
"dealing #4.5#0.5 damage.",
|
||||
"dealing #5.5#0.5 damage.",
|
||||
"",
|
||||
"You pull your axe back to you when it",
|
||||
"collides with anything.",
|
||||
@ -107,7 +107,7 @@ public class AxeThrow extends SkillActive implements IThrown
|
||||
if (level <= 0)
|
||||
return;
|
||||
|
||||
double damage = 4.5 + 0.5 * level;
|
||||
double damage = 5.5 + 0.5 * level;
|
||||
|
||||
//Damage Event
|
||||
Factory.Damage().NewDamageEvent(target, data.getThrower(), null,
|
||||
|
@ -46,7 +46,7 @@ public class HiltSmash extends SkillActive
|
||||
SetDesc(new String[]
|
||||
{
|
||||
"Smash the hilt of your sword into",
|
||||
"your opponent, dealing #1#1 damage",
|
||||
"your opponent, dealing #2#1 damage",
|
||||
"and Slow 3 for #0.5#0.5 seconds."
|
||||
});
|
||||
}
|
||||
@ -153,7 +153,7 @@ public class HiltSmash extends SkillActive
|
||||
|
||||
//Damage Event
|
||||
Factory.Damage().NewDamageEvent((LivingEntity)ent, player, null,
|
||||
DamageCause.CUSTOM, 1 + level, false, true, false,
|
||||
DamageCause.CUSTOM, 2 + level, false, true, false,
|
||||
player.getName(), GetName());
|
||||
|
||||
//Sound
|
||||
|
@ -30,7 +30,7 @@ public class Swordsmanship extends Skill
|
||||
{
|
||||
"Prepare a powerful sword attack;",
|
||||
"You gain 1 Charge every #5#-1 seconds.",
|
||||
"You can store a maximum of #1#1 Charges.",
|
||||
"You can store a maximum of #0#1 Charges.",
|
||||
"",
|
||||
"When you next attack, your damage is",
|
||||
"increased by the number of your Charges,",
|
||||
@ -79,7 +79,7 @@ public class Swordsmanship extends Skill
|
||||
if (!Recharge.Instance.use(cur, GetName(), 5000 - (1000 * level), false, false))
|
||||
continue;
|
||||
|
||||
int max = 1 + level;
|
||||
int max = level;
|
||||
|
||||
int charge = 1;
|
||||
if (_charges.containsKey(cur))
|
||||
|
@ -67,7 +67,7 @@ public class Blizzard extends SkillActive
|
||||
@Override
|
||||
public String GetEnergyString()
|
||||
{
|
||||
return "Energy: #42#-2 per Second";
|
||||
return "Energy: #34#-2 per Second";
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -114,7 +114,7 @@ public class Blizzard extends SkillActive
|
||||
}
|
||||
|
||||
//Energy
|
||||
if (!Factory.Energy().Use(cur, GetName(), 2.1 - (0.1 * level), true, true))
|
||||
if (!Factory.Energy().Use(cur, GetName(), 1.7 - (0.1 * level), true, true))
|
||||
{
|
||||
_active.remove(cur);
|
||||
continue;
|
||||
|
@ -48,7 +48,7 @@ public class IcePrison extends SkillActive implements IThrown
|
||||
{
|
||||
"Launch an icy orb. When it collides,",
|
||||
"it creates a hollow sphere of ice",
|
||||
"thats lasts for #3#1 seconds.",
|
||||
"thats lasts for #3#1.5 seconds.",
|
||||
});
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ public class IcePrison extends SkillActive implements IThrown
|
||||
if (!UtilBlock.airFoliage(freeze))
|
||||
return;
|
||||
|
||||
long time = 3500 + (1000 * level);
|
||||
long time = 3500 + (1500 * level);
|
||||
|
||||
int yDiff = freeze.getY() - mid.getY();
|
||||
|
||||
|
@ -153,12 +153,6 @@ public class Immolate extends Skill
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cur.getLocation().getBlock().getType() == Material.WATER || cur.getLocation().getBlock().getType() == Material.STATIONARY_WATER)
|
||||
{
|
||||
Remove(cur);
|
||||
continue;
|
||||
}
|
||||
|
||||
//Energy
|
||||
if (!Factory.Energy().Use(cur, GetName(), 0.65 - (level * 0.05), true, true))
|
||||
{
|
||||
|
@ -53,7 +53,7 @@ public class Inferno extends SkillActive
|
||||
@Override
|
||||
public String GetEnergyString()
|
||||
{
|
||||
return "Energy: #42#-2 per Second";
|
||||
return "Energy: #34#-2 per Second";
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -100,7 +100,7 @@ public class Inferno extends SkillActive
|
||||
}
|
||||
|
||||
//Energy
|
||||
if (!Factory.Energy().Use(cur, GetName(), 2.1 - (0.1 * level), true, false))
|
||||
if (!Factory.Energy().Use(cur, GetName(), 1.7 - (0.1 * level), true, false))
|
||||
{
|
||||
_active.remove(cur);
|
||||
continue;
|
||||
@ -113,7 +113,7 @@ public class Inferno extends SkillActive
|
||||
itemStack.setItemMeta(meta);
|
||||
|
||||
Item fire = cur.getWorld().dropItem(cur.getEyeLocation().add(cur.getLocation().getDirection()), itemStack);
|
||||
Factory.Fire().Add(fire, cur, 0.7, 0, 0.3 + (0.1 * level), .25, GetName(), false);
|
||||
Factory.Fire().Add(fire, cur, 0.7, 0, 0.3 + (0.1 * level), 1, GetName(), false);
|
||||
|
||||
fire.teleport(cur.getEyeLocation());
|
||||
double x = 0.07 - (UtilMath.r(14)/100d);
|
||||
|
@ -42,8 +42,8 @@ public class LifeBonds extends Skill
|
||||
{
|
||||
"Drop Axe/Sword to Toggle.",
|
||||
"",
|
||||
"Transfers life from yourself to",
|
||||
"nearby allies with less health.",
|
||||
"Transfers life from healthy allies",
|
||||
"to nearby allies with less health.",
|
||||
"",
|
||||
"Transfers #0.5#0.5 health every second.",
|
||||
"Maximum range of #3#3 Blocks from user."
|
||||
@ -188,6 +188,9 @@ public class LifeBonds extends Skill
|
||||
int level = getLevel(cur);
|
||||
|
||||
//Bonds
|
||||
Player highest = null;
|
||||
double highestHp = 0;
|
||||
|
||||
Player lowest = null;
|
||||
double lowestHp = 20;
|
||||
|
||||
@ -196,6 +199,12 @@ public class LifeBonds extends Skill
|
||||
if (Factory.Relation().canHurt(cur, other) && !other.equals(cur))
|
||||
continue;
|
||||
|
||||
if (highest == null || other.getHealth() > highestHp)
|
||||
{
|
||||
highest = other;
|
||||
highestHp = other.getHealth();
|
||||
}
|
||||
|
||||
if (lowest == null || other.getHealth() < lowestHp)
|
||||
{
|
||||
lowest = other;
|
||||
@ -204,18 +213,18 @@ public class LifeBonds extends Skill
|
||||
}
|
||||
|
||||
//Nothing to Transfer
|
||||
if (cur.equals(lowest) || cur.getHealth() - lowestHp < 2)
|
||||
if (highest == null || lowest == null || highest.equals(lowest) || highestHp - lowestHp < 2)
|
||||
continue;
|
||||
|
||||
double amount = 0.5 + (0.5 * level);
|
||||
|
||||
amount = Math.min((double)(cur.getHealth() - lowestHp) / 2d, amount);
|
||||
amount = Math.min((double)(highestHp - lowestHp) / 2d, amount);
|
||||
|
||||
//Steal
|
||||
UtilPlayer.health(cur, -amount);
|
||||
UtilPlayer.health(highest, -amount);
|
||||
|
||||
//Hearts
|
||||
_hearts.add(new LifeBondsData(cur.getLocation().add(0, 0.8, 0), lowest, amount));
|
||||
_hearts.add(new LifeBondsData(highest.getLocation().add(0, 0.8, 0), lowest, amount));
|
||||
|
||||
//Effect
|
||||
//highest.getWorld().playEffect(highest.getLocation(), Effect.STEP_SOUND, 18);
|
||||
|
@ -22,7 +22,7 @@ public class MagmaBlade extends Skill
|
||||
SetDesc(new String[]
|
||||
{
|
||||
"Your sword deals an additional,",
|
||||
"#0.25#0.25 damage to burning opponents,",
|
||||
"#0.5#0.5 damage to burning opponents,",
|
||||
"but also extinguishes them.",
|
||||
});
|
||||
}
|
||||
@ -54,7 +54,7 @@ public class MagmaBlade extends Skill
|
||||
if (level == 0) return;
|
||||
|
||||
//Damage
|
||||
event.AddMod(damager.getName(), GetName(), 0.25 + 0.25 * level, true);
|
||||
event.AddMod(damager.getName(), GetName(), 0.5 + 0.5 * level, true);
|
||||
|
||||
//Effect
|
||||
damager.getWorld().playSound(damager.getLocation(), Sound.FIZZ, 0.8f, 0f);
|
||||
|
@ -18,24 +18,18 @@ import mineplex.minecraft.game.classcombat.Skill.Skill;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
||||
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityShootBowEvent;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.util.BlockIterator;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
|
||||
public class Sharpshooter extends Skill
|
||||
{
|
||||
private WeakHashMap<Player, Integer> _missedCount = new WeakHashMap<Player, Integer>();
|
||||
private WeakHashMap<Player, Integer> _hitCount = new WeakHashMap<Player, Integer>();
|
||||
private HashMap<Arrow, Player> _arrows = new HashMap<Arrow, Player>();
|
||||
private HashMap<Entity, Player> _arrows = new HashMap<Entity, Player>();
|
||||
|
||||
public Sharpshooter(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels)
|
||||
{
|
||||
@ -60,14 +54,8 @@ public class Sharpshooter extends Skill
|
||||
int level = getLevel((Player)event.getEntity());
|
||||
if (level == 0) return;
|
||||
|
||||
if (!(event.getProjectile() instanceof Arrow))
|
||||
{
|
||||
System.out.println(GetName() + " : " + event.getEntity().getName() + " shot bow but resulting projectile was now Arrow?!?!?!?");
|
||||
return;
|
||||
}
|
||||
|
||||
//Store
|
||||
_arrows.put((Arrow) event.getProjectile(), (Player)event.getEntity());
|
||||
_arrows.put(event.getProjectile(), (Player)event.getEntity());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
@ -110,46 +98,9 @@ public class Sharpshooter extends Skill
|
||||
|
||||
projectile.remove();
|
||||
|
||||
_missedCount.remove(player);
|
||||
|
||||
Recharge.Instance.useForce(player, GetName() + " Timer", 5000);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void missReset(ProjectileHitEvent event)
|
||||
{
|
||||
final Projectile projectile = event.getEntity();
|
||||
Factory.runSyncLater(() -> {
|
||||
if (!projectile.isDead() && _arrows.containsKey(projectile))
|
||||
{
|
||||
Player shooter = (Player) projectile.getShooter();
|
||||
|
||||
if (!_hitCount.containsKey(shooter))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_missedCount.containsKey(shooter))
|
||||
{
|
||||
_missedCount.put(shooter, Integer.valueOf(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
_missedCount.put(shooter, Integer.valueOf(_missedCount.get(shooter).intValue() + 1));
|
||||
|
||||
// Reset
|
||||
if (_missedCount.get(shooter).intValue() >= 2)
|
||||
{
|
||||
_hitCount.remove(shooter);
|
||||
_missedCount.remove(shooter);
|
||||
UtilPlayer.message(shooter, F.main(GetClassType().name(), GetName() + " : " + F.elem("Damage Bonus Reset")));
|
||||
shooter.playSound(shooter.getLocation(), Sound.NOTE_PLING, 1f, 0.75f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 3l);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void resetViaTime(UpdateEvent event)
|
||||
{
|
||||
@ -197,6 +148,5 @@ public class Sharpshooter extends Skill
|
||||
public void Reset(Player player)
|
||||
{
|
||||
_hitCount.remove(player);
|
||||
_missedCount.remove(player);
|
||||
}
|
||||
}
|
||||
|
@ -1,26 +1,28 @@
|
||||
package mineplex.minecraft.game.classcombat.Skill.Ranger;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.minecraft.game.classcombat.Skill.Skill;
|
||||
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
|
||||
public class VitalitySpores extends Skill
|
||||
{
|
||||
private HashMap<Player, Long> _lastDamage = new HashMap<>();
|
||||
private HashMap<Player, Long> _lastMove = new HashMap<Player, Long>();
|
||||
|
||||
public VitalitySpores(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels)
|
||||
{
|
||||
@ -28,45 +30,40 @@ public class VitalitySpores extends Skill
|
||||
|
||||
SetDesc(new String[]
|
||||
{
|
||||
"After getting hit, if no damage is taken",
|
||||
"for 10 Seconds then you will receive",
|
||||
"Regeneration #2#0 for #5#1 Seconds",
|
||||
"While standing still, forest spores",
|
||||
"heal you for #0#0.5 health per 2 seconds."
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void damage(CustomDamageEvent event)
|
||||
public void playerMove(PlayerMoveEvent event)
|
||||
{
|
||||
if (doesUserHaveSkill(event.GetDamageePlayer()))
|
||||
{
|
||||
if (event.GetDamageePlayer().hasPotionEffect(PotionEffectType.REGENERATION))
|
||||
{
|
||||
event.GetDamageePlayer().removePotionEffect(PotionEffectType.REGENERATION);
|
||||
}
|
||||
else
|
||||
{
|
||||
_lastDamage.put(event.GetDamageePlayer(), Long.valueOf(System.currentTimeMillis()));
|
||||
}
|
||||
}
|
||||
if (doesUserHaveSkill(event.getPlayer()) && UtilMath.offset(event.getFrom(), event.getTo()) > 0)
|
||||
_lastMove.put(event.getPlayer(), System.currentTimeMillis());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void update(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Iterator<Entry<Player, Long>> iterator = _lastDamage.entrySet().iterator();
|
||||
while (iterator.hasNext())
|
||||
for (Player cur : GetUsers())
|
||||
{
|
||||
Entry<Player, Long> entry = iterator.next();
|
||||
int level = getLevel(cur);
|
||||
if (level == 0) continue;
|
||||
|
||||
if (UtilTime.elapsed(entry.getValue().longValue(), 10000))
|
||||
if (!_lastMove.containsKey(cur))
|
||||
continue;
|
||||
|
||||
if (UtilTime.elapsed(_lastMove.get(cur), 2000))
|
||||
{
|
||||
iterator.remove();
|
||||
entry.getKey().addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, (20 * (5 + getLevel(entry.getKey()))), 1));
|
||||
UtilPlayer.health(cur, 0.5 * level);
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.HEART, cur.getEyeLocation().add(UtilAlg.getBehind(cur.getLocation().getDirection().multiply(0.5))), 0, 0.2f, 0, 0, 1,
|
||||
ViewDist.LONG, UtilServer.getPlayers());
|
||||
|
||||
_lastMove.put(cur, System.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -74,6 +71,6 @@ public class VitalitySpores extends Skill
|
||||
@Override
|
||||
public void Reset(Player player)
|
||||
{
|
||||
_lastDamage.remove(player);
|
||||
_lastMove.remove(player);
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class WolfsPounce extends SkillChargeSword
|
||||
"Taking damage cancels charge.",
|
||||
"",
|
||||
"Colliding with another player",
|
||||
"mid-air deals up to #2#1 damage",
|
||||
"mid-air deals up to #4#1 damage",
|
||||
"and Slow 2 for 3 seconds."
|
||||
|
||||
});
|
||||
@ -128,7 +128,7 @@ public class WolfsPounce extends SkillChargeSword
|
||||
if (_chargeStore.containsKey(damager))
|
||||
charge = _chargeStore.remove(damager);
|
||||
|
||||
int damage = (int)((2 + getLevel(damager)) * charge);
|
||||
int damage = (int)((4 + getLevel(damager)) * charge);
|
||||
|
||||
//Damage Event
|
||||
Factory.Damage().NewDamageEvent(damagee, damager, null,
|
||||
|
@ -221,6 +221,10 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
||||
AddSkill(new Fitness(this, "Mana Pool", ClassType.Mage, SkillType.GlobalPassive, 1, 3));
|
||||
AddSkill(new Recharge(this, "Mana Regeneration", ClassType.Mage, SkillType.GlobalPassive, 1, 3));
|
||||
|
||||
AddSkill(new Fitness(this, "Fitness", ClassType.Assassin, SkillType.GlobalPassive, 1, 3));
|
||||
AddSkill(new Recharge(this, "Rest", ClassType.Assassin, SkillType.GlobalPassive, 1, 3));
|
||||
|
||||
|
||||
//AddSkill(new Stamina(this, "Stamina", ClassType.Global, SkillType.GlobalPassive, 1, 1));
|
||||
//AddSkill(new Swim(this, "Swim", ClassType.Global, SkillType.GlobalPassive, 1, 1));
|
||||
}
|
||||
@ -231,9 +235,9 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
||||
|
||||
//Sword
|
||||
AddSkill(new Evade(this, "Evade", ClassType.Assassin, SkillType.Sword,
|
||||
2, 1,
|
||||
1, 4,
|
||||
0, 0,
|
||||
2500, -500, true,
|
||||
6500, -500, true,
|
||||
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
|
||||
@ -333,7 +337,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
||||
AddSkill(new Takedown(this, "Takedown", ClassType.Brute, SkillType.Axe,
|
||||
1, 5,
|
||||
0, 0,
|
||||
17000, -1000, true,
|
||||
21000, -1000, true,
|
||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
|
||||
@ -370,7 +374,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
||||
AddSkill(new Riposte(this, "Riposte", ClassType.Knight, SkillType.Sword,
|
||||
1, 5,
|
||||
0, 0,
|
||||
15000, -1000, false,
|
||||
11000, -1000, false,
|
||||
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
|
||||
@ -407,7 +411,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
||||
AddSkill(new AxeThrow(this, "Roped Axe Throw", ClassType.Knight, SkillType.Axe,
|
||||
1, 5,
|
||||
0, 0,
|
||||
4300, -300, true,
|
||||
3300, -300, true,
|
||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||
|
||||
|
@ -73,8 +73,6 @@ public class Condition
|
||||
protected boolean _add = false;
|
||||
protected boolean _live = false;
|
||||
|
||||
protected boolean _cancelPotion;
|
||||
|
||||
protected boolean _showIndicator = true;
|
||||
|
||||
public Condition(ConditionManager manager, String reason, LivingEntity ent, LivingEntity source,
|
||||
@ -104,35 +102,6 @@ public class Condition
|
||||
_live = !add;
|
||||
}
|
||||
|
||||
public Condition(ConditionManager manager, String reason, LivingEntity ent, LivingEntity source,
|
||||
ConditionType type, int mult, int ticks, boolean add, Material visualType, byte visualData, boolean showIndicator, boolean ambient, boolean cancelPotion)
|
||||
{
|
||||
Manager = manager;
|
||||
_time = System.currentTimeMillis();
|
||||
|
||||
_reason = reason;
|
||||
|
||||
_ent = ent;
|
||||
_source = source;
|
||||
|
||||
_type = type;
|
||||
_mult = mult;
|
||||
_ticks = ticks;
|
||||
_ticksTotal = ticks;
|
||||
_ambient = ambient;
|
||||
|
||||
_indicatorType = visualType;
|
||||
_indicatorData = visualData;
|
||||
_showIndicator = showIndicator;
|
||||
|
||||
_cancelPotion = cancelPotion;
|
||||
|
||||
_add = add;
|
||||
|
||||
//Live if NOT Additive
|
||||
_live = !add;
|
||||
}
|
||||
|
||||
public boolean Tick()
|
||||
{
|
||||
if (_live && _ticks > 0)
|
||||
@ -155,11 +124,6 @@ public class Condition
|
||||
|
||||
public void Add()
|
||||
{
|
||||
if (_cancelPotion)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
PotionEffectType type = PotionEffectType.getByName(_type.toString());
|
||||
|
@ -239,16 +239,10 @@ public class ConditionFactory
|
||||
|
||||
public Condition Poison(String reason, LivingEntity ent, LivingEntity source,
|
||||
double duration, int mult, boolean extend, boolean showIndicator, boolean ambient)
|
||||
{
|
||||
return Poison(reason, ent, source, duration, mult, extend, showIndicator, ambient, false);
|
||||
}
|
||||
|
||||
public Condition Poison(String reason, LivingEntity ent, LivingEntity source,
|
||||
double duration, int mult, boolean extend, boolean showIndicator, boolean ambient, boolean cancelPotion)
|
||||
{
|
||||
return Manager.AddCondition(new Condition(Manager, reason, ent, source,
|
||||
ConditionType.POISON, mult, (int)(20 * duration), extend,
|
||||
Material.SLIME_BALL, (byte)14, showIndicator, ambient, cancelPotion));
|
||||
Material.SLIME_BALL, (byte)14, showIndicator, ambient));
|
||||
}
|
||||
|
||||
public Condition PoisonShock(String reason, LivingEntity ent, LivingEntity source,
|
||||
|
@ -24,7 +24,7 @@ public class ServerGroup
|
||||
private int _requiredTotalServers;
|
||||
private int _requiredJoinableServers;
|
||||
|
||||
private String _uptimes;
|
||||
private String _uptimes = "";
|
||||
|
||||
private boolean _arcadeGroup;
|
||||
private String _worldZip;
|
||||
@ -80,7 +80,7 @@ public class ServerGroup
|
||||
_requiredTotalServers = Integer.valueOf(data.get("totalServers"));
|
||||
_requiredJoinableServers = Integer.valueOf(data.get("joinableServers"));
|
||||
_portSection = Integer.valueOf(data.get("portSection"));
|
||||
_uptimes = data.get("uptimes");
|
||||
_uptimes = data.containsKey("uptimes") ? data.get("uptimes") : "";
|
||||
_arcadeGroup = Boolean.valueOf(data.get("arcadeGroup"));
|
||||
_worldZip = data.get("worldZip");
|
||||
_plugin = data.get("plugin");
|
||||
|
@ -73,7 +73,6 @@ import nautilus.game.arcade.command.GameCommand;
|
||||
import nautilus.game.arcade.command.KitUnlockCommand;
|
||||
import nautilus.game.arcade.command.RequiredRankCommand;
|
||||
import nautilus.game.arcade.command.WriteCommand;
|
||||
import nautilus.game.arcade.command.*;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game;
|
||||
import nautilus.game.arcade.game.Game.GameState;
|
||||
@ -91,7 +90,6 @@ import org.bukkit.*;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.block.Chest;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Entity;
|
||||
@ -147,7 +145,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
|
||||
// Managers
|
||||
private GameCreationManager _gameCreationManager;
|
||||
private GameGemManager _gameGemManager;
|
||||
private GameRewardManager _gameRewardManager;
|
||||
private GameManager _gameManager;
|
||||
private GameLobbyManager _gameLobbyManager;
|
||||
private GamePlayerManager _gamePlayerManager;
|
||||
@ -279,7 +277,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
// Managers
|
||||
_gameChatManager = new GameChatManager(this);
|
||||
_gameCreationManager = new GameCreationManager(this);
|
||||
_gameGemManager = new GameGemManager(this);
|
||||
_gameRewardManager = new GameRewardManager(this);
|
||||
_gameManager = new GameManager(this);
|
||||
_gameLobbyManager = new GameLobbyManager(this, packetHandler);
|
||||
_gameHostManager = new GameHostManager(this);
|
||||
@ -510,9 +508,9 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
return _gameManager;
|
||||
}
|
||||
|
||||
public GameGemManager GetGameGemManager()
|
||||
public GameRewardManager GetGameGemManager()
|
||||
{
|
||||
return _gameGemManager;
|
||||
return _gameRewardManager;
|
||||
}
|
||||
|
||||
public GamePlayerManager GetGamePlayerManager()
|
||||
|
@ -2,12 +2,10 @@ package nautilus.game.arcade.game;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import mineplex.core.common.util.*;
|
||||
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||
import mineplex.core.elo.EloPlayer;
|
||||
import mineplex.core.elo.EloTeam;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.itemstack.ItemBuilder;
|
||||
import mineplex.core.packethandler.IPacketHandler;
|
||||
import mineplex.core.packethandler.PacketInfo;
|
||||
@ -35,7 +33,6 @@ import nautilus.game.arcade.world.WorldData;
|
||||
import net.minecraft.server.v1_8_R3.EntityItem;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
|
||||
import net.minecraft.server.v1_8_R3.WorldServer;
|
||||
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
@ -204,6 +201,7 @@ public abstract class Game implements Listener
|
||||
public boolean WorldLeavesDecay = false;
|
||||
public boolean WorldSoilTrample = false;
|
||||
public boolean WorldBoneMeal = false;
|
||||
public boolean WorldChunkUnload = false;
|
||||
|
||||
public int HungerSet = -1;
|
||||
public int HealthSet = -1;
|
||||
@ -423,13 +421,14 @@ public abstract class Game implements Listener
|
||||
System.out.println("Loading " + GetName() + "...");
|
||||
}
|
||||
|
||||
public void registerModule(Module module)
|
||||
public <T extends Module> T registerModule(T module)
|
||||
{
|
||||
if (!_modules.containsKey(module.getClass()))
|
||||
{
|
||||
module.initialize(this);
|
||||
_modules.put(module.getClass(), module);
|
||||
UtilServer.RegisterEvents(module);
|
||||
module.initialize(this);
|
||||
return module;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -437,6 +436,16 @@ public abstract class Game implements Listener
|
||||
}
|
||||
}
|
||||
|
||||
public void unregisterModule(Module module)
|
||||
{
|
||||
if (_modules.containsKey(module.getClass()) && _modules.get(module.getClass()) == module)
|
||||
{
|
||||
_modules.remove(module.getClass());
|
||||
module.cleanup();
|
||||
HandlerList.unregisterAll(module);
|
||||
}
|
||||
}
|
||||
|
||||
public void setKits(Kit[] kits)
|
||||
{
|
||||
_kits = kits;
|
||||
@ -1641,18 +1650,6 @@ public abstract class Game implements Listener
|
||||
SetState(GameState.End);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void disableParticles(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() == GameState.Prepare && Manager.getCosmeticManager().getGadgetManager().hideParticles())
|
||||
{
|
||||
for (Player player : GetPlayers(false))
|
||||
{
|
||||
getArcadeManager().getCosmeticManager().getGadgetManager().removeGadgetType(player, GadgetType.PARTICLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onGameStart(GameStateChangeEvent event)
|
||||
{
|
||||
|
@ -1,33 +1,38 @@
|
||||
package nautilus.game.arcade.game;
|
||||
|
||||
import mineplex.core.common.util.*;
|
||||
import mineplex.core.common.util.UtilTime.*;
|
||||
import mineplex.core.updater.*;
|
||||
import mineplex.core.updater.event.*;
|
||||
import nautilus.game.arcade.*;
|
||||
import nautilus.game.arcade.events.*;
|
||||
import nautilus.game.arcade.game.GameTeam.*;
|
||||
import nautilus.game.arcade.kit.*;
|
||||
import nautilus.game.arcade.stats.TeamDeathsStatTracker;
|
||||
import nautilus.game.arcade.stats.TeamKillsStatTracker;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilTime.TimeUnit;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.PlayerStateChangeEvent;
|
||||
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerLoginEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.event.*;
|
||||
import org.bukkit.event.player.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class TeamGame extends Game
|
||||
{
|
||||
public long RejoinTime = 120000;
|
||||
|
||||
protected ArrayList<GameTeam> _places = new ArrayList<GameTeam>();
|
||||
|
||||
private NautHashMap<String, Long> _rejoinTime = new NautHashMap<String, Long>();
|
||||
protected NautHashMap<String, GameTeam> RejoinTeam = new NautHashMap<String, GameTeam>();
|
||||
protected NautHashMap<String, Kit> RejoinKit = new NautHashMap<String, Kit>();
|
||||
protected NautHashMap<String, Double> RejoinHealth = new NautHashMap<String, Double>();
|
||||
|
||||
protected long RejoinTime = 120000;
|
||||
public NautHashMap<String, Long> RejoinTimes = new NautHashMap<String, Long>();
|
||||
public NautHashMap<String, GameTeam> RejoinTeam = new NautHashMap<String, GameTeam>();
|
||||
public NautHashMap<String, Kit> RejoinKit = new NautHashMap<String, Kit>();
|
||||
public NautHashMap<String, Double> RejoinHealth = new NautHashMap<String, Double>();
|
||||
|
||||
public TeamGame(ArcadeManager manager, GameType gameType, Kit[] kits, String[] gameDesc)
|
||||
{
|
||||
@ -54,7 +59,7 @@ public abstract class TeamGame extends Game
|
||||
return _places;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void PlayerQuit(PlayerQuitEvent event)
|
||||
{
|
||||
if (!InProgress())
|
||||
@ -79,7 +84,7 @@ public abstract class TeamGame extends Game
|
||||
if (!QuitOut)
|
||||
{
|
||||
//Store
|
||||
_rejoinTime.put(player.getName(), System.currentTimeMillis());
|
||||
RejoinTimes.put(player.getName(), System.currentTimeMillis());
|
||||
RejoinTeam.put(player.getName(), team);
|
||||
|
||||
if (GetKit(player) != null)
|
||||
@ -102,7 +107,7 @@ public abstract class TeamGame extends Game
|
||||
|
||||
//Rejoined
|
||||
GameTeam team = RejoinTeam.remove(event.getPlayer().getName());
|
||||
if (team != null && _rejoinTime.remove(event.getPlayer().getName()) != null)
|
||||
if (team != null && RejoinTimes.remove(event.getPlayer().getName()) != null)
|
||||
{
|
||||
team.AddPlayer(event.getPlayer(), true);
|
||||
Announce(team.GetColor() + C.Bold + event.getPlayer().getName() + " has reconnected!", false);
|
||||
@ -126,8 +131,6 @@ public abstract class TeamGame extends Game
|
||||
// }
|
||||
// }
|
||||
// }, 20);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,7 +146,21 @@ public abstract class TeamGame extends Game
|
||||
if (RejoinHealth.containsKey(player.getName()))
|
||||
{
|
||||
double health = RejoinHealth.remove(player.getName());
|
||||
if (health > 0)
|
||||
{
|
||||
getArcadeManager().runSyncLater(() ->
|
||||
{
|
||||
player.setHealth(health);
|
||||
}, 1L);
|
||||
}
|
||||
}
|
||||
|
||||
if (GetLocationStore().containsKey(player.getName()))
|
||||
{
|
||||
getArcadeManager().runSyncLater(() ->
|
||||
{
|
||||
player.teleport(GetLocationStore().remove(player.getName()));
|
||||
}, 1L);
|
||||
}
|
||||
}
|
||||
|
||||
@ -153,13 +170,13 @@ public abstract class TeamGame extends Game
|
||||
if (event.getType() != UpdateType.SEC || QuitOut)
|
||||
return;
|
||||
|
||||
Iterator<String> rejoinIterator = _rejoinTime.keySet().iterator();
|
||||
Iterator<String> rejoinIterator = RejoinTimes.keySet().iterator();
|
||||
|
||||
while (rejoinIterator.hasNext())
|
||||
{
|
||||
String name = rejoinIterator.next();
|
||||
|
||||
if (!UtilTime.elapsed(_rejoinTime.get(name), RejoinTime))
|
||||
if (!UtilTime.elapsed(RejoinTimes.get(name), RejoinTime))
|
||||
continue;
|
||||
|
||||
rejoinIterator.remove();
|
||||
@ -187,7 +204,7 @@ public abstract class TeamGame extends Game
|
||||
}
|
||||
else
|
||||
{
|
||||
_rejoinTime.put(toks[1], System.currentTimeMillis());
|
||||
RejoinTimes.put(toks[1], System.currentTimeMillis());
|
||||
event.getPlayer().sendMessage("Allowed " + toks[1] + " to rejoin!");
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
package nautilus.game.arcade.game.games.champions;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.inventory.data.Item;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.combat.DeathMessageType;
|
||||
@ -26,6 +28,7 @@ import nautilus.game.arcade.stats.SpecialWinStatTracker;
|
||||
import nautilus.game.arcade.stats.TheLongestShotStatTracker;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
@ -16,6 +16,7 @@ import nautilus.game.arcade.game.games.champions.kits.KitMage;
|
||||
import nautilus.game.arcade.game.games.champions.kits.KitRanger;
|
||||
import nautilus.game.arcade.game.games.common.Domination;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.managers.chat.ChatStatData;
|
||||
import nautilus.game.arcade.stats.ElectrocutionStatTracker;
|
||||
import nautilus.game.arcade.stats.KillReasonStatTracker;
|
||||
import nautilus.game.arcade.stats.SeismicSlamStatTracker;
|
||||
|
@ -16,6 +16,7 @@ import nautilus.game.arcade.game.games.champions.kits.KitMage;
|
||||
import nautilus.game.arcade.game.games.champions.kits.KitRanger;
|
||||
import nautilus.game.arcade.game.games.common.TeamDeathmatch;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.managers.chat.ChatStatData;
|
||||
import nautilus.game.arcade.stats.ElectrocutionStatTracker;
|
||||
import nautilus.game.arcade.stats.KillAllOpposingStatTracker;
|
||||
import nautilus.game.arcade.stats.KillReasonStatTracker;
|
||||
|
@ -4,15 +4,6 @@ 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.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilFirework;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.packethandler.IPacketHandler;
|
||||
import mineplex.core.packethandler.PacketInfo;
|
||||
@ -320,7 +311,6 @@ public class HideSeek extends TeamGame
|
||||
{
|
||||
if (event.GetState() == GameState.Prepare)
|
||||
{
|
||||
System.out.println("prep");
|
||||
this.getArcadeManager().getPacketHandler().addPacketHandler(_blockDisguise, PacketPlayOutSpawnEntityLiving.class, PacketPlayOutEntityDestroy.class);
|
||||
this.getArcadeManager().getPacketHandler().addPacketHandler(_useEntity, true, PacketPlayInUseEntity.class);
|
||||
}
|
||||
|
@ -136,6 +136,8 @@ public class GunModule implements Listener
|
||||
public boolean CustomHitbox = true;
|
||||
public boolean BulletAlternate = false;
|
||||
|
||||
public boolean EnableNormalArmor = false;
|
||||
public boolean BlockRegeneration = true;
|
||||
public boolean EnablePickup = true;
|
||||
public boolean EnableDrop = true;
|
||||
public boolean EnableCleaning = true;
|
||||
@ -1022,6 +1024,29 @@ public class GunModule implements Listener
|
||||
UtilAction.zeroVelocity(event.GetDamageeEntity());
|
||||
}
|
||||
|
||||
if (EnableNormalArmor)
|
||||
{
|
||||
|
||||
double armomrDamage = 0;
|
||||
|
||||
for (ItemStack item : event.GetDamageePlayer().getInventory().getArmorContents())
|
||||
{
|
||||
if (item == null)
|
||||
continue;
|
||||
|
||||
if (item.getType().toString().contains("DIAMOND")) armomrDamage -= 1;
|
||||
if (item.getType().toString().contains("GOLD")) armomrDamage -= 0.5;
|
||||
if (item.getType().toString().contains("IRON")) armomrDamage -= 0.75;
|
||||
if (item.getType().toString().contains("LEATHER")) armomrDamage -= 0.25;
|
||||
if (item.getType().toString().contains("CHAIN")) armomrDamage -= 0.5;
|
||||
}
|
||||
|
||||
if (event.GetDamage() - armomrDamage <= 0)
|
||||
armomrDamage = -(event.GetDamage() - 1);
|
||||
|
||||
event.AddMod(event.GetDamageePlayer().getName(), "Armor", armomrDamage, false);
|
||||
}
|
||||
|
||||
event.SetKnockback(false);
|
||||
event.SetIgnoreRate(true);
|
||||
event.SetIgnoreArmor(true);
|
||||
@ -1293,6 +1318,9 @@ public class GunModule implements Listener
|
||||
@EventHandler
|
||||
public void healthCancel(EntityRegainHealthEvent event)
|
||||
{
|
||||
if (!BlockRegeneration)
|
||||
return;
|
||||
|
||||
if (event.getRegainReason() == RegainReason.SATIATED)
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -1379,12 +1407,19 @@ public class GunModule implements Listener
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
for (Player player : _host.GetPlayers(true))
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
if (_host.IsAlive(player))
|
||||
{
|
||||
if (UtilGear.isMat(player.getItemInHand(), Material.IRON_AXE) || UtilGear.isMat(player.getItemInHand(), Material.IRON_SWORD))
|
||||
Manager.GetCondition().Factory().Speed("Knife", player, player, 1.9, 0, false, false, false);
|
||||
player.setWalkSpeed(0.2F);
|
||||
else
|
||||
Manager.GetCondition().EndCondition(player, ConditionType.SPEED, null);
|
||||
player.setWalkSpeed(0.1F);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setWalkSpeed(0.1F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1661,6 +1696,10 @@ public class GunModule implements Listener
|
||||
@EventHandler
|
||||
public void debug(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
if (!event.getPlayer().isOp())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getMessage().contains("recoil"))
|
||||
{
|
||||
|
@ -78,11 +78,12 @@ import nautilus.game.arcade.game.games.mineware.challenge.ChallengeSettings;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeAnvilDance;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeArrowRampage;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeBlockLobbers;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeBouncingBlock;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeBuildRace;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeChickenShooting;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeColorChange;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeDeadlyTnt;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeDiamondHunt;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeDogsVersusCats;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeEggSmash;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeFallingBlocks;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeFastFood;
|
||||
@ -100,7 +101,6 @@ import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeReverseT
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeRushPush;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeSmashOff;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeTreasureDigger;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeVolleyPig;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeWaterHorror;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.type.ChallengeWaveCrush;
|
||||
import nautilus.game.arcade.game.games.mineware.effect.ChickenAttack;
|
||||
@ -108,6 +108,7 @@ import nautilus.game.arcade.game.games.mineware.effect.DeathEffect;
|
||||
import nautilus.game.arcade.game.games.mineware.effect.DeathEffectData;
|
||||
import nautilus.game.arcade.game.games.mineware.events.ChallengeEndEvent;
|
||||
import nautilus.game.arcade.game.games.mineware.kit.KitBawksFood;
|
||||
import nautilus.game.arcade.game.games.mineware.tracker.BouncingShadowTracker;
|
||||
import nautilus.game.arcade.game.games.mineware.tracker.DragonKingTracker;
|
||||
import nautilus.game.arcade.game.games.mineware.tracker.EliteArcherTracker;
|
||||
import nautilus.game.arcade.game.games.mineware.tracker.MilkManTracker;
|
||||
@ -182,7 +183,6 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
private static final float SPECTATOR_KNOCKBACK_SOUND_VOLUME = 2.0F;
|
||||
private static final float SPECTATOR_KNOCKBACK_SOUND_PITCH = 0.5F;
|
||||
|
||||
private static final int MIN_PLAYERS_BLOCK_ATTEMPT = 1;
|
||||
private static final int GENERIC_SCOREBOARD_PLAYER_COUNT = 15;
|
||||
|
||||
private static final int LOST_ONE_LIFE = MAX_LIVES - 1;
|
||||
@ -254,6 +254,7 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
populateChallenges();
|
||||
|
||||
registerStatTrackers(
|
||||
new BouncingShadowTracker(this),
|
||||
new DragonKingTracker(this),
|
||||
new EliteArcherTracker(this),
|
||||
new MilkManTracker(this),
|
||||
@ -271,11 +272,12 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
new ChallengeAnvilDance(this),
|
||||
new ChallengeArrowRampage(this),
|
||||
new ChallengeBlockLobbers(this),
|
||||
new ChallengeBouncingBlock(this),
|
||||
new ChallengeBuildRace(this),
|
||||
new ChallengeColorChange(this),
|
||||
new ChallengeChickenShooting(this),
|
||||
new ChallengeDeadlyTnt(this),
|
||||
new ChallengeDiamondHunt(this),
|
||||
new ChallengeDogsVersusCats(this),
|
||||
new ChallengeEggSmash(this),
|
||||
new ChallengeFallingBlocks(this),
|
||||
new ChallengeFastFood(this),
|
||||
@ -294,8 +296,18 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
new ChallengeRushPush(this),
|
||||
new ChallengeSmashOff(this),
|
||||
new ChallengeTreasureDigger(this),
|
||||
new ChallengeVolleyPig(this),
|
||||
new ChallengeWaveCrush(this));
|
||||
|
||||
/*
|
||||
* Removed:
|
||||
*
|
||||
* Cloud Fall
|
||||
* Dogs Vs Cats
|
||||
* Fishing Day
|
||||
* Navigation Maze
|
||||
* Volley Pig
|
||||
* Zombie Infection
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -386,7 +398,6 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("Found matching challenge: " + instance.getName());
|
||||
return instance;
|
||||
}
|
||||
|
||||
@ -688,7 +699,7 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
private void showDescriptionText()
|
||||
{
|
||||
List<String> messages = Lists.newArrayList(_challenge.getDescription());
|
||||
messages.add(0, C.cGray + "Bawk Bawk says...");
|
||||
messages.add(0, C.cGray + "Bawk Bawk commands...");
|
||||
|
||||
new BukkitRunnable()
|
||||
{
|
||||
@ -1195,21 +1206,21 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
_winners.remove(player);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void blockStartAttempt(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
// If there is only 1 player and the game starts, do not teleport him to the map.
|
||||
|
||||
if (GetState() == GameState.Recruit && GetCountdown() >= 0 && GetPlayers(false).size() <= MIN_PLAYERS_BLOCK_ATTEMPT)
|
||||
{
|
||||
UtilServer.broadcast(F.main("Game", C.cRed + "This game requires at least 2 players to start."));
|
||||
SetCountdown(-1);
|
||||
Manager.GetLobby().DisplayWaiting();
|
||||
}
|
||||
}
|
||||
// @EventHandler
|
||||
// public void blockStartAttempt(UpdateEvent event)
|
||||
// {
|
||||
// if (event.getType() != UpdateType.TICK)
|
||||
// return;
|
||||
//
|
||||
// // If there is only 1 player and the game starts, do not teleport him to the map.
|
||||
//
|
||||
// if (GetState() == GameState.Recruit && GetCountdown() >= 0 && GetPlayers(false).size() <= MIN_PLAYERS_BLOCK_ATTEMPT)
|
||||
// {
|
||||
// UtilServer.broadcast(F.main("Game", C.cRed + "This game requires at least 2 players to start."));
|
||||
// SetCountdown(-1);
|
||||
// Manager.GetLobby().DisplayWaiting();
|
||||
// }
|
||||
// }
|
||||
|
||||
/*
|
||||
* Miscellaneous
|
||||
@ -1475,6 +1486,74 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
return "";
|
||||
}
|
||||
|
||||
// @EventHandler
|
||||
// public void debugCommands(PlayerCommandPreprocessEvent event)
|
||||
// {
|
||||
// Player player = event.getPlayer();
|
||||
// String message = event.getMessage();
|
||||
//
|
||||
// if (Manager.GetClients().hasRank(player, Rank.SNR_MODERATOR))
|
||||
// {
|
||||
// if (message.startsWith("/restrict"))
|
||||
// {
|
||||
// String[] pieces = message.split(" ");
|
||||
//
|
||||
// if (pieces.length > 1)
|
||||
// {
|
||||
// String challenge = F.combine(pieces, 1, null, false).trim();
|
||||
//
|
||||
// if (_list.restrict(challenge))
|
||||
// {
|
||||
// UtilPlayer.message(player, F.main("Game", "Restricted to " + F.elem(challenge) + " challenge."));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// UtilPlayer.message(player, F.main("Game", "Could not find any challenge by that name."));
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// UtilPlayer.message(player, F.main("Game", "All challenge restrictions were cleared."));
|
||||
// _list.unrestrict();
|
||||
// }
|
||||
//
|
||||
// event.setCancelled(true);
|
||||
// }
|
||||
// else if (message.startsWith("/skip"))
|
||||
// {
|
||||
// if (IsLive())
|
||||
// {
|
||||
// endCurrentChallenge();
|
||||
//
|
||||
// Announce(C.cAqua + C.Bold + player.getName() + " skipped this challenge.");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// UtilPlayer.message(player, F.main("Game", "You cannot skip a challenge if the game is not started."));
|
||||
// }
|
||||
//
|
||||
// event.setCancelled(true);
|
||||
// }
|
||||
// else if (message.startsWith("/lose"))
|
||||
// {
|
||||
// if (IsLive() && _challenge != null && IsAlive(player))
|
||||
// {
|
||||
// setLives(player, 0);
|
||||
// _challenge.getData().addLostPlayer(player);
|
||||
// _deathEffect.playDeath(player, player.getLocation());
|
||||
// GetScoreboard().ResetScore(player.getName());
|
||||
// _chickenAttack.start(player);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// UtilPlayer.message(player, F.main("Game", "You cannot lose at this time."));
|
||||
// }
|
||||
//
|
||||
// event.setCancelled(true);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/*
|
||||
* Helper methods
|
||||
*/
|
||||
|
@ -57,7 +57,6 @@ public class ChallengeList
|
||||
{
|
||||
if (challenge.getName().contains(name))
|
||||
{
|
||||
System.out.println("Restricted: " + challenge.getName());
|
||||
_restricted = challenge;
|
||||
return true;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.Location;
|
||||
public class ChallengeSettings
|
||||
{
|
||||
private Challenge _challenge;
|
||||
private int _minPlayers = 2;
|
||||
private int _minPlayers = 1;
|
||||
private int _maxPlayers = 250;
|
||||
private int _maxCompletedCount;
|
||||
private long _startTime;
|
||||
|
@ -1,158 +0,0 @@
|
||||
package nautilus.game.arcade.game.games.mineware.challenge.other;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.Challenge;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.ChallengeType;
|
||||
|
||||
/**
|
||||
* Not used.
|
||||
* @deprecated
|
||||
*/
|
||||
public abstract class ChallengeSeperateRooms extends Challenge
|
||||
{
|
||||
private HashMap<String, Integer[]> _borders = new HashMap<String, Integer[]>();
|
||||
private HashMap<Location, Entry<Integer[], Location>> _spawns = new HashMap<Location, Entry<Integer[], Location>>();
|
||||
private HashMap<String, Location> _rooms = new HashMap<String, Location>();
|
||||
private double _borderX, _borderZ;
|
||||
|
||||
public ChallengeSeperateRooms(BawkBawkBattles host, ChallengeType challengeType, String challengeName)
|
||||
{
|
||||
super(host, challengeType, challengeName);
|
||||
}
|
||||
|
||||
public Location getRoom(Player player)
|
||||
{
|
||||
System.out.print("2. " + player.getName());
|
||||
return _rooms.get(player.getName()).clone();
|
||||
}
|
||||
|
||||
public void assignRooms()
|
||||
{
|
||||
for (Player player : getPlayersAlive())
|
||||
{
|
||||
for (Entry<Location, Entry<Integer[], Location>> entry : _spawns.entrySet())
|
||||
{
|
||||
if (entry.getKey().distance(player.getLocation()) < 1)
|
||||
{
|
||||
System.out.print("1. " + player.getName());
|
||||
_rooms.put(player.getName(), entry.getValue().getValue());
|
||||
_borders.put(player.getName(), entry.getValue().getKey());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public final void generateRoom()
|
||||
{
|
||||
int size = getPlayersAlive().size();
|
||||
|
||||
int x = 1;
|
||||
int z = 1;
|
||||
|
||||
while (size > x * z)
|
||||
{
|
||||
if (x > z)
|
||||
{
|
||||
z++;
|
||||
}
|
||||
else
|
||||
{
|
||||
x++;
|
||||
}
|
||||
}
|
||||
|
||||
_borderX = (x * getBorderX()) + (x * getDividersX());
|
||||
_borderZ = (z * getBorderZ()) + (z * getDividersZ());
|
||||
_borderX /= 2;
|
||||
_borderZ /= 2;
|
||||
_borderX = Math.ceil(_borderX);
|
||||
_borderZ = Math.ceil(_borderZ);
|
||||
|
||||
int players = 0;
|
||||
|
||||
for (int x1 = 0; x1 < x; x1++)
|
||||
{
|
||||
for (int z1 = 0; z1 < z; z1++)
|
||||
{
|
||||
if (++players > size)
|
||||
continue;
|
||||
|
||||
double lX = (x1 * getBorderX()) + (x1 * getDividersX());
|
||||
double lZ = (z1 * getBorderZ()) + (z1 * getDividersZ());
|
||||
lX -= _borderX;
|
||||
lZ -= _borderZ;
|
||||
|
||||
Location loc = getCenter().clone().add(lX, 0, lZ);
|
||||
|
||||
generateRoom(loc.clone());
|
||||
|
||||
_spawns.put(getSpawn(loc.clone()), new HashMap.SimpleEntry(new Integer[]
|
||||
{
|
||||
loc.getBlockX(), loc.getBlockX() + getBorderX(),
|
||||
|
||||
loc.getBlockY(), loc.getBlockY() + getBorderY(),
|
||||
|
||||
loc.getBlockZ(), loc.getBlockZ() + getBorderZ()
|
||||
}, loc.clone()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start()
|
||||
{
|
||||
super.start();
|
||||
|
||||
setBorder((int) -Math.ceil(_borderX), (int) Math.ceil(_borderX), 0, 256, (int) -Math.ceil(_borderZ),
|
||||
(int) Math.ceil(_borderZ));
|
||||
}
|
||||
|
||||
public abstract void generateRoom(Location loc);
|
||||
|
||||
public abstract int getBorderX();
|
||||
|
||||
public abstract int getBorderY();
|
||||
|
||||
public abstract int getBorderZ();
|
||||
|
||||
public abstract int getDividersX();
|
||||
|
||||
public abstract int getDividersZ();
|
||||
|
||||
public Location getSpawn(Location roomLocation)
|
||||
{
|
||||
return roomLocation.clone().add((getBorderX() + 1) / 2D, 1.1, (getBorderZ() + 1) / 2D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Location> createSpawns()
|
||||
{
|
||||
return new ArrayList<Location>(_spawns.keySet());
|
||||
}
|
||||
|
||||
public boolean isInsideMap(Player player)
|
||||
{
|
||||
Location loc = player.getLocation();
|
||||
|
||||
if (!_borders.containsKey(player.getName()) || UtilPlayer.isSpectator(player))
|
||||
{
|
||||
return super.isInsideMap(player);
|
||||
}
|
||||
|
||||
Integer[] borders = _borders.get(player.getName());
|
||||
|
||||
return !(loc.getX() >= borders[1] + 1 || loc.getX() <= borders[0] || loc.getZ() >= borders[5] + 1
|
||||
|| loc.getZ() <= borders[4] || loc.getY() >= borders[3] + 1 || loc.getY() <= borders[2]);
|
||||
}
|
||||
|
||||
}
|
@ -55,7 +55,7 @@ public class ChallengeBouncingBlock extends Challenge implements LogicTracker
|
||||
private static final float SCORE_SOUND_PITCH = 0.2F;
|
||||
private static final int SCORE_BLOCK_HEIGHT = 6;
|
||||
private static final int SCORE_BLOCK_HEIGHT_ADD = 5;
|
||||
private static final int SCORE_BLOCK_HEIGHT_MAX = SCORE_BLOCK_HEIGHT + SCORE_BLOCK_HEIGHT_ADD;
|
||||
private static final int SCORE_BLOCK_DATA_RANGE = 16;
|
||||
private static final int SCORE_BLOCK_SPAWN_SHIFT = 2;
|
||||
private static final int SCORE_BLOCK_BOUND_MULTIPLY = 2;
|
||||
private static final double SCORE_FIREWORK_LOCATION_ADD = 0.5;
|
||||
@ -177,7 +177,7 @@ public class ChallengeBouncingBlock extends Challenge implements LogicTracker
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
for (Player player : getPlayersIn(true))
|
||||
for (Player player : getPlayersIn(false))
|
||||
{
|
||||
UtilTextBottom.display(C.Bold + "Score: " + C.Reset + C.cYellow + C.Bold + _score.get(player), player);
|
||||
}
|
||||
@ -230,7 +230,7 @@ public class ChallengeBouncingBlock extends Challenge implements LogicTracker
|
||||
increment(player, 1);
|
||||
player.playSound(player.getLocation(), Sound.SUCCESSFUL_HIT, SCORE_SOUND_VOLUME, SCORE_SOUND_PITCH);
|
||||
resetBlock(block);
|
||||
spawnRandomWool();
|
||||
spawnRandomWool(true);
|
||||
}
|
||||
|
||||
private void checkCompleted(Player player)
|
||||
@ -238,7 +238,6 @@ public class ChallengeBouncingBlock extends Challenge implements LogicTracker
|
||||
if (_score.get(player) >= SCORE_GOAL)
|
||||
{
|
||||
setCompleted(player);
|
||||
UtilTextBottom.display(C.cGreen + C.Bold + "Completed!", player);
|
||||
}
|
||||
}
|
||||
|
||||
@ -279,40 +278,15 @@ public class ChallengeBouncingBlock extends Challenge implements LogicTracker
|
||||
}
|
||||
}
|
||||
|
||||
private static final double SCORE_BLOCK_SPAWN_CHANCE = 0.1;
|
||||
private static final int SCORE_BLOCK_DATA_RANGE = 16;
|
||||
|
||||
private void spawnStartingWool()
|
||||
{
|
||||
whileLoop: while (_blocks.size() <= Settings.getMaxCompletedCount() + 1)
|
||||
for (int i = 0; i < Host.getPlayersWithRemainingLives() + 1; i++)
|
||||
{
|
||||
for (int x = -getArenaSize(); x <= getArenaSize(); x++)
|
||||
{
|
||||
for (int z = -getArenaSize(); z <= getArenaSize(); z++)
|
||||
{
|
||||
for (int y = SCORE_BLOCK_HEIGHT; y <= SCORE_BLOCK_HEIGHT_MAX; y++)
|
||||
{
|
||||
Block block = getCenter().getBlock().getRelative(x, y, z);
|
||||
|
||||
if (block.isEmpty() || block.getType() == null)
|
||||
{
|
||||
if (Math.random() < SCORE_BLOCK_SPAWN_CHANCE)
|
||||
{
|
||||
spawnRandomWoolAt(x, y, z);
|
||||
|
||||
if (_blocks.size() >= Settings.getMaxCompletedCount() + 1)
|
||||
{
|
||||
break whileLoop;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
spawnRandomWool(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void spawnRandomWool()
|
||||
private void spawnRandomWool(boolean firework)
|
||||
{
|
||||
int size = getArenaSize(MAP_MIN_SIZE) - SCORE_BLOCK_SPAWN_SHIFT;
|
||||
|
||||
@ -320,11 +294,18 @@ public class ChallengeBouncingBlock extends Challenge implements LogicTracker
|
||||
int y = SCORE_BLOCK_HEIGHT + UtilMath.r(SCORE_BLOCK_HEIGHT_ADD);
|
||||
int z = UtilMath.r(size * SCORE_BLOCK_BOUND_MULTIPLY) - size;
|
||||
|
||||
spawnRandomWoolAt(x, y, z);
|
||||
while (!Host.WorldData.World.getBlockAt(x, y, z).isEmpty())
|
||||
{
|
||||
x = UtilMath.r(size * SCORE_BLOCK_BOUND_MULTIPLY) - size;
|
||||
y = SCORE_BLOCK_HEIGHT + UtilMath.r(SCORE_BLOCK_HEIGHT_ADD);
|
||||
z = UtilMath.r(size * SCORE_BLOCK_BOUND_MULTIPLY) - size;
|
||||
}
|
||||
|
||||
spawnRandomWoolAt(x, y, z, firework);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void spawnRandomWoolAt(int x, int y, int z)
|
||||
private void spawnRandomWoolAt(int x, int y, int z, boolean firework)
|
||||
{
|
||||
Block b = getCenter().getBlock().getRelative(x, y, z);
|
||||
Byte color = (byte) UtilMath.r(SCORE_BLOCK_DATA_RANGE);
|
||||
@ -335,7 +316,11 @@ public class ChallengeBouncingBlock extends Challenge implements LogicTracker
|
||||
}
|
||||
|
||||
setBlock(b, Material.WOOL, color);
|
||||
|
||||
if (firework)
|
||||
{
|
||||
UtilFirework.playFirework(b.getLocation().add(SCORE_FIREWORK_LOCATION_ADD, SCORE_FIREWORK_LOCATION_ADD, SCORE_FIREWORK_LOCATION_ADD), Type.BALL, DyeColor.getByWoolData(b.getData()).getColor(), false, false);
|
||||
}
|
||||
|
||||
_blocks.add(b);
|
||||
}
|
||||
|
@ -144,7 +144,6 @@ public class ChallengeBuildRace extends Challenge implements LogicTracker
|
||||
|
||||
if (!Data.isModifiedBlock(block.getRelative(BlockFace.DOWN)))
|
||||
{
|
||||
System.out.println("Cancel");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
@ -19,6 +19,8 @@ import nautilus.game.arcade.game.games.mineware.challenge.ChallengeType;
|
||||
|
||||
/**
|
||||
* A challenge based on dropping from a platform in the correct block.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public class ChallengeCloudFall extends Challenge
|
||||
{
|
||||
@ -84,7 +86,6 @@ public class ChallengeCloudFall extends Challenge
|
||||
Host.DamageFall = false;
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onCustomDamage(CustomDamageEvent event)
|
||||
{
|
||||
@ -142,7 +143,6 @@ public class ChallengeCloudFall extends Challenge
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private boolean isLandingBlock(Block block)
|
||||
{
|
||||
return block.getType() == LANDING_PLATFORM_BLOCK_TYPE && block.getData() == LANDING_PLATFORM_BLOCK_DATA;
|
||||
|
@ -31,7 +31,7 @@ public class ChallengeColorChange extends Challenge
|
||||
private static final int SPAWN_COORDINATES_MULTIPLE = 2;
|
||||
private static final int MAP_HEIGHT = 1;
|
||||
|
||||
private static final long TIME_DELAY = 3000;
|
||||
private static final long TIME_DELAY = 5000;
|
||||
private static final int TIME_DELAY_DECREMENT_RATE = 100;
|
||||
private static final int RESET_DELAY = 4000;
|
||||
|
||||
@ -104,6 +104,7 @@ public class ChallengeColorChange extends Challenge
|
||||
{
|
||||
_isFalling = false;
|
||||
_lastSound = 0;
|
||||
_lastGeneratedPlatforms.clear();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -34,6 +34,8 @@ import nautilus.game.arcade.game.games.mineware.challenge.TeamChallenge;
|
||||
|
||||
/**
|
||||
* A team based challenge with players disguised as dogs and cats.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public class ChallengeDogsVersusCats extends TeamChallenge
|
||||
{
|
||||
|
@ -0,0 +1,42 @@
|
||||
package nautilus.game.arcade.game.games.mineware.challenge.type;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.Challenge;
|
||||
import nautilus.game.arcade.game.games.mineware.challenge.ChallengeType;
|
||||
|
||||
/**
|
||||
* This challenge is used to prevent the game from crashing if it's forced to start with only one player.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public class ChallengeEmpty extends Challenge
|
||||
{
|
||||
public ChallengeEmpty(BawkBawkBattles host)
|
||||
{
|
||||
super(host, ChallengeType.FirstComplete, "Empty", "Not enough players");
|
||||
|
||||
Settings.setUseMapHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Location> createSpawns()
|
||||
{
|
||||
ArrayList<Location> spawns = new ArrayList<>();
|
||||
spawns.add(getCenter().add(0, 1, 0));
|
||||
return spawns;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMap()
|
||||
{
|
||||
Block center = getCenter().getBlock();
|
||||
center.setType(Material.BARRIER);
|
||||
addBlock(center);
|
||||
}
|
||||
}
|
@ -55,7 +55,7 @@ public class ChallengeFallingBlocks extends Challenge implements NumberTracker
|
||||
|
||||
private static final int PLAYER_CAMP_MAX_HEIGHT = 3;
|
||||
private static final byte ADDITIONAL_BLOCK_DATA = 2;
|
||||
private static final float BLOCK_HITBOX_GROW = 0.7F;
|
||||
private static final float BLOCK_HITBOX_GROW = 0.6F;
|
||||
|
||||
private static final Material[] MATERIALS = {
|
||||
Material.GRASS,
|
||||
@ -234,12 +234,7 @@ public class ChallengeFallingBlocks extends Challenge implements NumberTracker
|
||||
if (!isChallengeValid())
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (_waveTracker.containsKey(player))
|
||||
{
|
||||
_waveTracker.remove(player);
|
||||
}
|
||||
_waveTracker.remove(event.getPlayer());
|
||||
}
|
||||
|
||||
private void initializeWaveTracker()
|
||||
|
@ -43,8 +43,9 @@ import nautilus.game.arcade.game.games.mineware.challenge.ChallengeType;
|
||||
|
||||
/**
|
||||
* A challenge based on fishing.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class ChallengeFishingDay extends Challenge
|
||||
{
|
||||
private int _startingLureLevel = 8;
|
||||
|
@ -149,7 +149,6 @@ public class ChallengeLavaRun extends Challenge
|
||||
_modifiedDelay += _modifiedDelayMin;
|
||||
}
|
||||
|
||||
System.out.println("Delay: " + _modifiedDelay);
|
||||
_disappearingBlocks++;
|
||||
_shouldMoveObsidian = false;
|
||||
}
|
||||
|
@ -20,6 +20,8 @@ import nautilus.game.arcade.game.games.mineware.challenge.NumberTracker;
|
||||
|
||||
/**
|
||||
* A challenge based on mazes.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public class ChallengeNavigationMaze extends Challenge implements NumberTracker
|
||||
{
|
||||
|
@ -199,7 +199,11 @@ public class ChallengeReverseTag extends TeamChallenge implements LogicTracker
|
||||
return;
|
||||
|
||||
Player player = event.getEntity();
|
||||
getFirstTeam().remove(player);
|
||||
|
||||
if (!isPlayerValid(player))
|
||||
return;
|
||||
|
||||
_tagTracker.put(player, false);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -267,14 +271,7 @@ public class ChallengeReverseTag extends TeamChallenge implements LogicTracker
|
||||
|
||||
private void trackTag(Player player)
|
||||
{
|
||||
if (_tagTracker.containsKey(player))
|
||||
{
|
||||
if (_tagTracker.get(player))
|
||||
{
|
||||
_tagTracker.put(player, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!_tagTracker.containsKey(player))
|
||||
{
|
||||
_tagTracker.put(player, true);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class ChallengeRushPush extends TeamChallenge
|
||||
(byte) 11,
|
||||
(byte) 14,
|
||||
"Rush Push",
|
||||
"Attack to the enemy team.",
|
||||
"Attack the enemy team.",
|
||||
"Push them off the platform.");
|
||||
|
||||
Settings.setUseMapHeight();
|
||||
|
@ -34,6 +34,8 @@ import nautilus.game.arcade.game.games.mineware.challenge.TeamChallenge;
|
||||
|
||||
/**
|
||||
* A challenge based on volley.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public class ChallengeVolleyPig extends TeamChallenge
|
||||
{
|
||||
@ -164,7 +166,6 @@ public class ChallengeVolleyPig extends TeamChallenge
|
||||
_redSide = 0;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPlayerMove(PlayerMoveEvent event)
|
||||
{
|
||||
@ -308,7 +309,6 @@ public class ChallengeVolleyPig extends TeamChallenge
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void increaseTeamScore()
|
||||
{
|
||||
if (_pig.isValid())
|
||||
|
@ -62,7 +62,7 @@ public class ChallengeWaveCrush extends Challenge implements NumberTracker
|
||||
ChallengeType.LastStanding,
|
||||
"Wave Crush",
|
||||
"Waves of blocks are coming towards you!",
|
||||
"Avoid getting him by them.");
|
||||
"Avoid getting hit by them.");
|
||||
|
||||
Settings.setUseMapHeight();
|
||||
}
|
||||
@ -119,11 +119,7 @@ public class ChallengeWaveCrush extends Challenge implements NumberTracker
|
||||
{
|
||||
_modifiedNextWaveDelay = NEXT_WAVE_DELAY;
|
||||
|
||||
for (Player player : getPlayersAlive())
|
||||
{
|
||||
_survivedWaves.put(player, 0);
|
||||
}
|
||||
|
||||
initializeWaveTracker();
|
||||
startWavesTask();
|
||||
}
|
||||
|
||||
@ -143,12 +139,7 @@ public class ChallengeWaveCrush extends Challenge implements NumberTracker
|
||||
if (!isChallengeValid())
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (_survivedWaves.containsKey(player))
|
||||
{
|
||||
_survivedWaves.remove(player);
|
||||
}
|
||||
_survivedWaves.remove(event.getPlayer());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -161,6 +152,7 @@ public class ChallengeWaveCrush extends Challenge implements NumberTracker
|
||||
if (isPlayerValid(player))
|
||||
{
|
||||
Host.Manager.GetDamage().NewDamageEvent(target, null, null, DamageCause.PROJECTILE, player.getHealth(), false, false, false, "Falling Block", "Wave Crush");
|
||||
subtractWaveCount(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -179,6 +171,22 @@ public class ChallengeWaveCrush extends Challenge implements NumberTracker
|
||||
return COLORS[_colorIndex];
|
||||
}
|
||||
|
||||
private void initializeWaveTracker()
|
||||
{
|
||||
for (Player player : getPlayersAlive())
|
||||
{
|
||||
_survivedWaves.put(player, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private void subtractWaveCount(Player player)
|
||||
{
|
||||
if (Data.isLost(player) && _survivedWaves.get(player) > 0)
|
||||
{
|
||||
_survivedWaves.put(player, _survivedWaves.get(player) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void startWavesTask()
|
||||
{
|
||||
new BukkitRunnable()
|
||||
|
@ -35,6 +35,8 @@ import nautilus.game.arcade.game.games.mineware.challenge.other.ZombieWrapper;
|
||||
|
||||
/**
|
||||
* A challenge based on zombie survival.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public class ChallengeZombieInfection extends Challenge
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ public class ChickenAttack
|
||||
player.teleport(_center);
|
||||
|
||||
UtilTextMiddle.display(C.cRed + "Chicken Attack!", "You ran out of lives.", INFORM_TITLTE_FADE_IN_TICKS, INFORM_TITLTE_STAY_TICKS, INFORM_TITLTE_FADE_OUT_TICKS, player);
|
||||
UtilPlayer.message(player, F.main("Game", "You failed to follow bawk bawk's instructions and you ran out of lives. His minions are now attacking you."));
|
||||
UtilPlayer.message(player, F.main("Game", "You failed to follow Bawk Bawk's commands. Now his chickens will devour you!"));
|
||||
player.playSound(player.getLocation(), Sound.WITHER_SPAWN, 1.0F, 1.0F);
|
||||
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, Integer.MAX_VALUE, 1));
|
||||
|
@ -30,9 +30,8 @@ public class BouncingShadowTracker extends ChallengeStatTracker
|
||||
|
||||
for (Player player : getGame().GetPlayers(true))
|
||||
{
|
||||
if (bouncingBlock.hasData(player) && bouncingBlock.getData().isDone(player))
|
||||
if (bouncingBlock.hasData(player) && bouncingBlock.getData().isCompleted(player))
|
||||
{
|
||||
System.out.println("Bouncing Shadow: " + player.getName());
|
||||
addStat(player, "BouncingShadow", 1, false, false);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ public class DragonKingTracker extends ChallengeStatTracker
|
||||
|
||||
if (score > 0)
|
||||
{
|
||||
System.out.println("Dragon King: " + player.getName());
|
||||
addStat(player, "DragonKing", score, false, false);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ public class EliteArcherTracker extends ChallengeStatTracker
|
||||
|
||||
if (score > 0)
|
||||
{
|
||||
System.out.println("Elite Archer: " + player.getName());
|
||||
addStat(player, "EliteArcher", score, false, false);
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user