Merge branch 'master' of ssh://184.154.0.242:7999/min/mineplex into feature/report

This commit is contained in:
Keir 2015-11-06 01:34:13 +00:00
commit 0c0b3708c6
106 changed files with 2304 additions and 273 deletions

BIN
Art/Treasure/4Qq2m6x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

BIN
Art/Treasure/canc.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

BIN
Art/Treasure/xxiJkbb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

View File

@ -428,4 +428,15 @@ public class UtilAlg
{ {
return a.getWorld() == b.getWorld() && a.getX() == b.getX() && a.getY() == b.getY() && a.getZ() == b.getZ(); return a.getWorld() == b.getWorld() && a.getX() == b.getX() && a.getY() == b.getY() && a.getZ() == b.getZ();
} }
public static int randomMidpoint(int min, int max)
{
int variance = max - min;
int value = UtilMath.r(variance);
value += min;
return value;
}
} }

View File

@ -435,10 +435,23 @@ public class UtilEnt
LivingEntity ent = (LivingEntity)cur; LivingEntity ent = (LivingEntity)cur;
//Feet
double offset = UtilMath.offset(loc, ent.getLocation()); double offset = UtilMath.offset(loc, ent.getLocation());
if (offset < dR) if (offset < dR)
{
ents.put(ent, 1 - (offset/dR)); ents.put(ent, 1 - (offset/dR));
continue;
}
//Eyes
offset = UtilMath.offset(loc, ent.getEyeLocation());
if (offset < dR)
{
ents.put(ent, 1 - (offset/dR));
continue;
}
} }
return ents; return ents;

View File

@ -12,8 +12,8 @@
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Database"/> <classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Database"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/jooq-3.5.2.jar"/> <classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/jooq-3.5.2.jar"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/craftbukkit.jar"/> <classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/craftbukkit.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Core.Common"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/NoCheatPlus.jar"/> <classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/NoCheatPlus.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.PlayerCache"/> <classpathentry combineaccessrules="false" kind="src" path="/Mineplex.PlayerCache"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Core.Common"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

View File

@ -107,6 +107,11 @@ public abstract class MiniPlugin implements Listener
{ {
_plugin.getServer().getScheduler().runTaskAsynchronously(_plugin, runnable); _plugin.getServer().getScheduler().runTaskAsynchronously(_plugin, runnable);
} }
public void runAsync(Runnable runnable, long time)
{
_plugin.getServer().getScheduler().runTaskLaterAsynchronously(_plugin, runnable, time);
}
public void runSync(Runnable runnable) public void runSync(Runnable runnable)
{ {

View File

@ -755,9 +755,6 @@ public enum Achievement
; ;
private static String[] _colors = { C.cAqua, C.cGreen, C.cDGray, C.cPurple, C.cYellow, C.cGray };
private static int _negativeCount = 0;
private String _name; private String _name;
private String[] _desc; private String[] _desc;
private String[] _stats; private String[] _stats;
@ -823,10 +820,7 @@ public enum Achievement
public static String getExperienceString(int level) public static String getExperienceString(int level)
{ {
if (level < 0) if (level < 0)
{ return C.cPurple + level;
_negativeCount++;
return _colors[_negativeCount % _colors.length] + level;
}
if (level < 20) if (level < 20)
return C.cGray + level; return C.cGray + level;

View File

@ -0,0 +1,16 @@
package mineplex.core.disguise.disguises;
import org.bukkit.entity.*;
public class DisguiseMooshroom extends DisguiseAnimal
{
public DisguiseMooshroom(org.bukkit.entity.Entity entity)
{
super(EntityType.MUSHROOM_COW, entity);
}
public String getHurtSound()
{
return "mob.cow.hurt";
}
}

View File

@ -20,6 +20,7 @@ import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent; import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
public class AddFriendPage implements Listener public class AddFriendPage implements Listener
@ -91,6 +92,15 @@ public class AddFriendPage implements Listener
_currentInventory.clear(); _currentInventory.clear();
HandlerList.unregisterAll(this); HandlerList.unregisterAll(this);
} }
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event)
{
if (event.getPlayer() == _player)
{
unregisterListener();
}
}
@EventHandler @EventHandler
public void onInventoryClick(InventoryClickEvent event) public void onInventoryClick(InventoryClickEvent event)

View File

@ -18,6 +18,7 @@ import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent; import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import net.minecraft.server.v1_7_R4.EntityPlayer; import net.minecraft.server.v1_7_R4.EntityPlayer;
@ -130,7 +131,7 @@ public class FriendsGUI implements Listener
ItemBuilder builder = new ItemBuilder(Material.SKULL_ITEM, 1, (short) (friend.Online ? 3 : 0)); ItemBuilder builder = new ItemBuilder(Material.SKULL_ITEM, 1, (short) (friend.Online ? 3 : 0));
builder.setTitle(C.cWhite + C.Bold + friend.Name); builder.setTitle(C.cWhite + C.Bold + friend.Name);
builder.setPlayerHead(friend.Name); // builder.setPlayerHead(friend.Name);
builder.addLore(C.cGray + C.Bold + "Status: " + (friend.Online ? C.cDGreen + "Online" : C.cRed + "Offline")); builder.addLore(C.cGray + C.Bold + "Status: " + (friend.Online ? C.cDGreen + "Online" : C.cRed + "Offline"));
@ -275,7 +276,7 @@ public class FriendsGUI implements Listener
ItemBuilder builder = new ItemBuilder(Material.SKULL_ITEM, 1, (short) (friend.Online ? 3 : 0)); ItemBuilder builder = new ItemBuilder(Material.SKULL_ITEM, 1, (short) (friend.Online ? 3 : 0));
builder.setTitle(C.cWhite + C.Bold + friend.Name); builder.setTitle(C.cWhite + C.Bold + friend.Name);
builder.setPlayerHead(friend.Name); // builder.setPlayerHead(friend.Name);
builder.addLore(C.cGray + C.Bold + "Status: " + (friend.Online ? C.cDGreen + "Online" : C.cRed + "Offline")); builder.addLore(C.cGray + C.Bold + "Status: " + (friend.Online ? C.cDGreen + "Online" : C.cRed + "Offline"));
@ -573,6 +574,15 @@ public class FriendsGUI implements Listener
} }
} }
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event)
{
if (event.getPlayer() == _player)
{
unregisterListener();
}
}
@EventHandler @EventHandler
public void OnInventoryClose(InventoryCloseEvent event) public void OnInventoryClose(InventoryCloseEvent event)
{ {

View File

@ -45,7 +45,7 @@ public class ItemFleshHook extends ItemGadget implements IThrown
UtilAction.velocity(item, player.getLocation().getDirection(), UtilAction.velocity(item, player.getLocation().getDirection(),
1.6, false, 0, 0.2, 10, false); 1.6, false, 0, 0.2, 10, false);
Manager.getProjectileManager().AddThrow(item, player, this, -1, true, true, true, Manager.getProjectileManager().AddThrow(item, player, this, -1, true, true, true, true,
Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, null, 0, UpdateType.TICK, 0.5f); Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, null, 0, UpdateType.TICK, 0.5f);
//Inform //Inform

View File

@ -57,7 +57,7 @@ public class ItemMelonLauncher extends ItemGadget implements IThrown
UtilAction.velocity(item, player.getLocation().getDirection(), UtilAction.velocity(item, player.getLocation().getDirection(),
1, false, 0, 0.2, 10, false); 1, false, 0, 0.2, 10, false);
Manager.getProjectileManager().AddThrow(item, player, this, -1, true, true, true, Manager.getProjectileManager().AddThrow(item, player, this, -1, true, true, true, true,
null, 1f, 1f, null, null, 0, UpdateType.TICK, 0.5f); null, 1f, 1f, null, null, 0, UpdateType.TICK, 0.5f);
//Inform //Inform

View File

@ -114,7 +114,7 @@ public class MorphBat extends MorphGadget implements IThrown
UtilAction.velocity(item, player.getLocation().getDirection(), UtilAction.velocity(item, player.getLocation().getDirection(),
0.01, true, -0.3, 0, 10, false); 0.01, true, -0.3, 0, 10, false);
Manager.getProjectileManager().AddThrow(item, player, this, -1, true, true, true, Manager.getProjectileManager().AddThrow(item, player, this, -1, true, true, true, true,
null, 1f, 1f, null, null, 0, UpdateType.TICK, 0.5f); null, 1f, 1f, null, null, 0, UpdateType.TICK, 0.5f);
//Inform //Inform

View File

@ -97,7 +97,7 @@ public class MorphVillager extends MorphGadget implements IThrown
UtilAction.velocity(gem, player.getLocation().getDirection(), 1, false, 0, 0.2, 1, false); UtilAction.velocity(gem, player.getLocation().getDirection(), 1, false, 0, 0.2, 1, false);
//Throw //Throw
Manager.getProjectileManager().AddThrow(gem, player, this, -1, true, true, true, Manager.getProjectileManager().AddThrow(gem, player, this, -1, true, true, true, true,
null, 1.4f, 0.8f, null, null, 0, UpdateType.TICK, 0.5f); null, 1.4f, 0.8f, null, null, 0, UpdateType.TICK, 0.5f);
Manager.getDonationManager().RewardGems(null, this.GetName() + " Throw", player.getName(), player.getUniqueId(), -20); Manager.getDonationManager().RewardGems(null, this.GetName() + " Throw", player.getName(), player.getUniqueId(), -20);

View File

@ -31,107 +31,107 @@ public class ProjectileManager extends MiniPlugin
} }
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, float hitboxGrow) long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, float hitboxGrow)
{ {
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, false, expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false,
null, 1f, 1f, null, 0, null, null, 0F, 0F, 0F, 0F, 1, hitboxGrow)); null, 1f, 1f, null, 0, null, null, 0F, 0F, 0F, 0F, 1, hitboxGrow));
} }
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, boolean pickup, float hitboxGrow) long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, boolean pickup, float hitboxGrow)
{ {
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, pickup, expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, pickup,
null, 1f, 1f, null, 0, null, null, 0F, 0F, 0F, 0F, 1, hitboxGrow)); null, 1f, 1f, null, 0, null, null, 0F, 0F, 0F, 0F, 1, hitboxGrow));
} }
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle,
Sound sound, float soundVolume, float soundPitch, Effect effect, int effectData, UpdateType effectRate , float hitboxGrow) Sound sound, float soundVolume, float soundPitch, Effect effect, int effectData, UpdateType effectRate , float hitboxGrow)
{ {
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, false, expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false,
sound, soundVolume, soundPitch, effect, effectData, effectRate, null, 0F, 0F, 0F, 0F, 1, hitboxGrow)); sound, soundVolume, soundPitch, effect, effectData, effectRate, null, 0F, 0F, 0F, 0F, 1, hitboxGrow));
} }
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle,
Sound sound, float soundVolume, float soundPitch, ParticleType particle, Effect effect, int effectData, UpdateType effectRate, float hitboxGrow) Sound sound, float soundVolume, float soundPitch, ParticleType particle, Effect effect, int effectData, UpdateType effectRate, float hitboxGrow)
{ {
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, false, expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false,
sound, soundVolume, soundPitch, effect, effectData, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxGrow)); sound, soundVolume, soundPitch, effect, effectData, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxGrow));
} }
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle,
Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, float hitboxMult) Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, float hitboxMult)
{ {
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, false, expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false,
sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult)); sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult));
} }
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, 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) Sound sound, float soundVolume, float soundPitch, ParticleType particle, float pX, float pY, float pZ, float pS, int pC, UpdateType effectRate, float hitboxMult)
{ {
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, false, expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false,
sound, soundVolume, soundPitch, null, 0, effectRate, particle, pX, pY, pZ, pS, pC, hitboxMult)); sound, soundVolume, soundPitch, null, 0, effectRate, particle, pX, pY, pZ, pS, pC, hitboxMult));
} }
// WITH CAN HIT PLAYERS LIST: // WITH CAN HIT PLAYERS LIST:
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, float hitboxGrow, List<Player> canHit) long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, float hitboxGrow, List<Player> canHit)
{ {
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, false, expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false,
null, 1f, 1f, null, 0, null, null, 0F, 0F, 0F, 0F, 1, hitboxGrow, canHit)); null, 1f, 1f, null, 0, null, null, 0F, 0F, 0F, 0F, 1, hitboxGrow, canHit));
} }
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, boolean pickup, float hitboxGrow, List<Player> canHit) long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, boolean pickup, float hitboxGrow, List<Player> canHit)
{ {
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, pickup, expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, pickup,
null, 1f, 1f, null, 0, null, null, 0F, 0F, 0F, 0F, 1, hitboxGrow, canHit)); null, 1f, 1f, null, 0, null, null, 0F, 0F, 0F, 0F, 1, hitboxGrow, canHit));
} }
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle,
Sound sound, float soundVolume, float soundPitch, Effect effect, int effectData, UpdateType effectRate , float hitboxGrow, List<Player> canHit) Sound sound, float soundVolume, float soundPitch, Effect effect, int effectData, UpdateType effectRate , float hitboxGrow, List<Player> canHit)
{ {
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, false, expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false,
sound, soundVolume, soundPitch, effect, effectData, effectRate, null, 0F, 0F, 0F, 0F, 1, hitboxGrow, canHit)); sound, soundVolume, soundPitch, effect, effectData, effectRate, null, 0F, 0F, 0F, 0F, 1, hitboxGrow, canHit));
} }
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle,
Sound sound, float soundVolume, float soundPitch, ParticleType particle, Effect effect, int effectData, UpdateType effectRate, float hitboxGrow, List<Player> canHit) Sound sound, float soundVolume, float soundPitch, ParticleType particle, Effect effect, int effectData, UpdateType effectRate, float hitboxGrow, List<Player> canHit)
{ {
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, false, expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false,
sound, soundVolume, soundPitch, effect, effectData, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxGrow, canHit)); sound, soundVolume, soundPitch, effect, effectData, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxGrow, canHit));
} }
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle,
Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, float hitboxMult, List<Player> canHit) Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, float hitboxMult, List<Player> canHit)
{ {
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, false, expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false,
sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult, canHit)); sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult, canHit));
} }
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, 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, List<Player> canHit) Sound sound, float soundVolume, float soundPitch, ParticleType particle, float pX, float pY, float pZ, float pS, int pC, UpdateType effectRate, float hitboxMult, List<Player> canHit)
{ {
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitBlock, idle, false, expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false,
sound, soundVolume, soundPitch, null, 0, effectRate, particle, pX, pY, pZ, pS, pC, hitboxMult, canHit)); sound, soundVolume, soundPitch, null, 0, effectRate, particle, pX, pY, pZ, pS, pC, hitboxMult, canHit));
} }

View File

@ -11,6 +11,7 @@ import mineplex.core.common.util.UtilServer;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import net.minecraft.server.v1_7_R4.AxisAlignedBB; import net.minecraft.server.v1_7_R4.AxisAlignedBB;
import net.minecraft.server.v1_7_R4.EntityPlayer;
import net.minecraft.server.v1_7_R4.MathHelper; import net.minecraft.server.v1_7_R4.MathHelper;
import net.minecraft.server.v1_7_R4.MovingObjectPosition; import net.minecraft.server.v1_7_R4.MovingObjectPosition;
import net.minecraft.server.v1_7_R4.Vec3D; import net.minecraft.server.v1_7_R4.Vec3D;
@ -36,7 +37,10 @@ public class ProjectileUser
private IThrown _callback; private IThrown _callback;
private long _expireTime; private long _expireTime;
private long _startTime;
private boolean _hitPlayer = false; private boolean _hitPlayer = false;
private boolean _hitNonPlayerEntity = false;
private boolean _hitBlock = false; private boolean _hitBlock = false;
private boolean _idle = false; private boolean _idle = false;
private boolean _pickup = false; private boolean _pickup = false;
@ -61,7 +65,7 @@ public class ProjectileUser
private List<Player> _canHit; private List<Player> _canHit;
public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback, public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, boolean pickup, long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, boolean pickup,
Sound sound, float soundVolume, float soundPitch, Sound sound, float soundVolume, float soundPitch,
Effect effect, int effectData, UpdateType effectRate, Effect effect, int effectData, UpdateType effectRate,
ParticleType particle, float particleX, float particleY, ParticleType particle, float particleX, float particleY,
@ -74,7 +78,10 @@ public class ProjectileUser
_callback = callback; _callback = callback;
_expireTime = expireTime; _expireTime = expireTime;
_startTime = System.currentTimeMillis();
_hitPlayer = hitPlayer; _hitPlayer = hitPlayer;
_hitNonPlayerEntity = hitNonPlayerEntity;
_hitBlock = hitBlock; _hitBlock = hitBlock;
_idle = idle; _idle = idle;
_pickup = pickup; _pickup = pickup;
@ -97,7 +104,7 @@ public class ProjectileUser
} }
public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback, public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, boolean pickup, long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, boolean pickup,
Sound sound, float soundVolume, float soundPitch, Sound sound, float soundVolume, float soundPitch,
Effect effect, int effectData, UpdateType effectRate, Effect effect, int effectData, UpdateType effectRate,
ParticleType particle, float particleX, float particleY, ParticleType particle, float particleX, float particleY,
@ -110,7 +117,10 @@ public class ProjectileUser
_callback = callback; _callback = callback;
_expireTime = expireTime; _expireTime = expireTime;
_startTime = System.currentTimeMillis();
_hitPlayer = hitPlayer; _hitPlayer = hitPlayer;
_hitNonPlayerEntity = hitNonPlayerEntity;
_hitBlock = hitBlock; _hitBlock = hitBlock;
_idle = idle; _idle = idle;
_pickup = pickup; _pickup = pickup;
@ -151,13 +161,13 @@ public class ProjectileUser
public boolean Collision() public boolean Collision()
{ {
if (_expireTime != -1 && System.currentTimeMillis() > _expireTime) if (_expireTime != -1 && System.currentTimeMillis() > (_startTime + _expireTime))
{ {
_callback.Expire(this); _callback.Expire(this);
return true; return true;
} }
if (_hitPlayer) if (_hitPlayer || _hitNonPlayerEntity)
{ {
double distanceToEntity = 0.0D; double distanceToEntity = 0.0D;
LivingEntity victim = null; LivingEntity victim = null;
@ -181,6 +191,12 @@ public class ProjectileUser
((CraftEntity)_thrown).getHandle().motY, ((CraftEntity)_thrown).getHandle().motY,
((CraftEntity)_thrown).getHandle().motZ).grow(_hitboxGrow, _hitboxGrow, _hitboxGrow))) ((CraftEntity)_thrown).getHandle().motZ).grow(_hitboxGrow, _hitboxGrow, _hitboxGrow)))
{ {
if (!_hitNonPlayerEntity && !(entity instanceof EntityPlayer))
continue;
if (!_hitPlayer && entity instanceof EntityPlayer)
continue;
if (entity instanceof net.minecraft.server.v1_7_R4.Entity) if (entity instanceof net.minecraft.server.v1_7_R4.Entity)
{ {
Entity bukkitEntity = ((net.minecraft.server.v1_7_R4.Entity) entity).getBukkitEntity(); Entity bukkitEntity = ((net.minecraft.server.v1_7_R4.Entity) entity).getBukkitEntity();
@ -264,8 +280,8 @@ public class ProjectileUser
//Idle //Idle
if (_idle) if (_idle)
{ {
if (_thrown.getVelocity().length() < 0.2 && if (_thrown.getVelocity().length() < 0.2 && (_thrown.isOnGround() ||
!UtilBlock.airFoliage(_thrown.getLocation().getBlock().getRelative(BlockFace.DOWN))) !UtilBlock.airFoliage(_thrown.getLocation().getBlock().getRelative(BlockFace.DOWN))))
{ {
_callback.Idle(this); _callback.Idle(this);
return true; return true;

View File

@ -5,10 +5,6 @@ import java.sql.SQLException;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniDbClientPlugin; import mineplex.core.MiniDbClientPlugin;
import mineplex.core.account.CoreClientManager; import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.Callback; import mineplex.core.common.util.Callback;
@ -16,6 +12,10 @@ import mineplex.core.common.util.NautHashMap;
import mineplex.core.task.repository.TaskRepository; import mineplex.core.task.repository.TaskRepository;
import mineplex.playerCache.PlayerCache; import mineplex.playerCache.PlayerCache;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class TaskManager extends MiniDbClientPlugin<TaskClient> public class TaskManager extends MiniDbClientPlugin<TaskClient>
{ {
private static Object _taskLock = new Object(); private static Object _taskLock = new Object();
@ -56,31 +56,32 @@ public class TaskManager extends MiniDbClientPlugin<TaskClient>
{ {
public void run() public void run()
{ {
boolean taskExists = false;
synchronized (_taskLock) synchronized (_taskLock)
{ {
if (!_tasks.containsKey(task)) taskExists = _tasks.containsKey(task);
{
_repository.addTask(task);
System.out.println("TaskManager Adding Task : " + task);
}
} }
updateTasks(); if (!taskExists)
synchronized (_taskLock)
{ {
final boolean success = _repository.addAccountTask(PlayerCache.getInstance().getPlayer(uuid).getAccountId(), _tasks.get(task)); _repository.addTask(task);
System.out.println("TaskManager Adding Task : " + task);
if (callback != null) updateTasks();
}
final boolean success = _repository.addAccountTask(PlayerCache.getInstance().getPlayer(uuid).getAccountId(), getTaskId(task));
if (callback != null)
{
Bukkit.getServer().getScheduler().runTask(getPlugin(), new Runnable()
{ {
Bukkit.getServer().getScheduler().runTask(getPlugin(), new Runnable() public void run()
{ {
public void run() callback.run(success);
{ }
callback.run(success); });
}
});
}
} }
} }
}); });

View File

@ -66,6 +66,7 @@ import mineplex.hub.modules.NewsManager;
import mineplex.hub.modules.ParkourManager; import mineplex.hub.modules.ParkourManager;
import mineplex.hub.modules.SoccerManager; import mineplex.hub.modules.SoccerManager;
import mineplex.hub.modules.TextManager; import mineplex.hub.modules.TextManager;
import mineplex.hub.modules.TrickOrTreatManager;
import mineplex.hub.modules.WorldManager; import mineplex.hub.modules.WorldManager;
import mineplex.hub.profile.gui.GUIProfile; import mineplex.hub.profile.gui.GUIProfile;
import mineplex.hub.tutorial.TutorialManager; import mineplex.hub.tutorial.TutorialManager;
@ -75,6 +76,8 @@ import mineplex.minecraft.game.core.combat.DeathMessageType;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import mineplex.minecraft.game.core.condition.ConditionManager; import mineplex.minecraft.game.core.condition.ConditionManager;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import net.minecraft.server.v1_7_R4.EntityMonster;
import net.minecraft.server.v1_7_R4.EntityPlayer;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -142,6 +145,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
private PacketHandler _packetHandler; private PacketHandler _packetHandler;
private PersonalServerManager _personalServerManager; private PersonalServerManager _personalServerManager;
// private HalloweenSpookinessManager _halloweenManager; // private HalloweenSpookinessManager _halloweenManager;
// private TrickOrTreatManager _trickOrTreatManager;
private Location _spawn; private Location _spawn;
private int _scoreboardTick = 0; private int _scoreboardTick = 0;
@ -197,6 +201,8 @@ public class HubManager extends MiniClientPlugin<HubClient>
new SoccerManager(this, _gadgetManager); new SoccerManager(this, _gadgetManager);
new KothManager(this, _gadgetManager); new KothManager(this, _gadgetManager);
new TrickOrTreatManager(_plugin, this, taskManager, donationManager, clientManager);
_petManager = petManager; _petManager = petManager;
_partyManager = partyManager; _partyManager = partyManager;
@ -969,6 +975,27 @@ public class HubManager extends MiniClientPlugin<HubClient>
} }
} }
@EventHandler
public void clearEntityTargets(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC)
return;
for (Entity entity : Bukkit.getWorlds().get(0).getEntities())
{
if (entity instanceof EntityMonster)
{
EntityMonster entityMonster = (EntityMonster)entity;
if (entityMonster.target != null && entityMonster.target instanceof EntityPlayer)
{
if (((EntityPlayer)entityMonster.target).playerConnection.isDisconnected())
entityMonster.target = null;
}
}
}
}
@EventHandler @EventHandler
public void clearGameMode(PlayerQuitEvent event) public void clearGameMode(PlayerQuitEvent event)
{ {

View File

@ -11,6 +11,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
import mineplex.core.MiniPlugin; import mineplex.core.MiniPlugin;
import mineplex.core.common.Rank;
import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
@ -65,14 +66,17 @@ public class HubVisibilityManager extends MiniPlugin
{ {
boolean hideMe = Manager.GetTutorial().InTutorial(player) || boolean hideMe = Manager.GetTutorial().InTutorial(player) ||
UtilMath.offset2d(player.getLocation(), Manager.GetSpawn()) == 0 || UtilMath.offset2d(player.getLocation(), Manager.GetSpawn()) == 0 ||
Manager.getPreferences().Get(player).Invisibility || Manager.getPreferences().Get(player).Invisibility ||
_hiddenPlayers.contains(player); _hiddenPlayers.contains(player);
for (Player other : UtilServer.getPlayers()) for (Player other : UtilServer.getPlayers())
{ {
if (player.equals(other)) if (player.equals(other))
continue; continue;
if(Manager.GetClients().Get(other).GetRank().has(Rank.MODERATOR))
hideMe = false;
if (hideMe || if (hideMe ||
!Manager.getPreferences().Get(other).ShowPlayers || !Manager.getPreferences().Get(other).ShowPlayers ||
Manager.GetTutorial().InTutorial(other)) Manager.GetTutorial().InTutorial(other))

View File

@ -0,0 +1,193 @@
package mineplex.hub.modules;
import java.util.Calendar;
import java.util.HashSet;
import java.util.Iterator;
import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.C;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.donation.DonationManager;
import mineplex.core.recharge.Recharge;
import mineplex.core.task.TaskManager;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.HubManager;
import mineplex.hub.HubType;
import mineplex.hub.modules.trickortreat.Blindness;
import mineplex.hub.modules.trickortreat.Nausea;
import mineplex.hub.modules.trickortreat.RandomTeleport;
import mineplex.hub.modules.trickortreat.ShockingStrikes;
import mineplex.hub.modules.trickortreat.Trick;
import mineplex.hub.modules.trickortreat.TrickDialogue;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
public class TrickOrTreatManager extends MiniPlugin
{
private HubManager _manager;
private TaskManager _taskManager;
private DonationManager _donationManager;
private CoreClientManager _coreClientManager;
private Calendar _cal = Calendar.getInstance();
private String _identifier = "villager";
private HashSet<String> _interacting = new HashSet<String>();
private HashSet<TrickDialogue> _tricking = new HashSet<TrickDialogue>();
private HashSet<Trick> _tricks = new HashSet<Trick>();
private String[] _nextYear = new String[]
{
"Nosy kids...",
"I'm out of candy!",
"Come back next year.",
"No double dipping!",
"I've seen that costume before...",
"You already have enough candy!",
"Once is enough.",
"Isn't it past your bedtime?",
"I already gave you my candy, what more do you want!",
"You again...",
"I said no more!",
"No taking the whole bowl.",
"I have my eye on you...",
"You know what happens to children who want more candy...",
"This was a great year, wasn't it?",
"Aww, did you come back just to talk to me?",
"*heavy staring*",
"Run along, now!",
"The real horror will be your dentist's face...",
"I've heard good things about the house down the road.",
"I started out with 700 pieces!",
"I might call it a night soon.",
"Meow",
"Sure is a mystical night, isn't it?",
"Do you want to hear my song? I wrote it myself!",
};
public TrickOrTreatManager(JavaPlugin plugin, HubManager manager, TaskManager taskManager, DonationManager donationManager, CoreClientManager coreClientManager)
{
super("Trick or Treat", plugin);
_manager = manager;
_taskManager = taskManager;
_donationManager = donationManager;
_coreClientManager = coreClientManager;
_tricks.add(new Blindness(plugin));
_tricks.add(new Nausea(plugin));
_tricks.add(new RandomTeleport(plugin));
_tricks.add(new ShockingStrikes(plugin));
}
public void trick(Player player, String villager)
{
UtilPlayer.message(player, C.cGoldB + villager + ": " + C.cYellowB + UtilAlg.Random(_tricks).onTrick(player));
}
@EventHandler(priority = EventPriority.LOW)
public void onInteract(final PlayerInteractEntityEvent event)
{
if (_manager.Type != HubType.Halloween)
return;
if (!(event.getRightClicked() instanceof LivingEntity))
return;
LivingEntity en = (LivingEntity) event.getRightClicked();
if (en.getCustomName() == null || !new String(ChatColor.stripColor(en.getCustomName())).toLowerCase().trim().startsWith(_identifier))
return;
System.out.println("Interact with Villager.");
if (_interacting.contains(event.getPlayer().getName()))
return;
System.out.println("Not interacting.");
event.setCancelled(true);
final String villagerName = ChatColor.stripColor(en.getCustomName()).substring(_identifier.length()).trim();
if (!Recharge.Instance.use(event.getPlayer(), "ToT with " + villagerName, 2000, false, false))
return;
System.out.println("Not Recharging.");
_interacting.add(event.getPlayer().getName());
final String task = "ToT " + _cal.get(Calendar.YEAR) + " " + villagerName;
if (_taskManager.hasCompletedTask(event.getPlayer(), task))
{
UtilPlayer.message(event.getPlayer(), C.cGoldB + villagerName + ": " + C.cYellowB + UtilMath.randomElement(_nextYear));
_interacting.remove(event.getPlayer().getName());
System.out.println("Has completed Task.");
return;
}
System.out.println("Hasn't completed Task.");
UtilPlayer.message(event.getPlayer(), C.cDGreenB + "You: " + C.cGreenB + "Trick or Treat!");
event.getPlayer().playSound(event.getPlayer().getLocation(), Sound.NOTE_PIANO, 1F, 1F);
final boolean trick = UtilMath.r(10) > 5;
_tricking.add(new TrickDialogue(this, task, event.getPlayer(), villagerName, trick));
System.out.println("Added ne TrickDialogue.");
}
@EventHandler
public void updateDialogues(UpdateEvent event)
{
if (event.getType() != UpdateType.FASTER)
return;
for (Iterator<TrickDialogue> dialogueIterator = _tricking.iterator(); dialogueIterator.hasNext();)
{
TrickDialogue dialogue = dialogueIterator.next();
if (dialogue.originalUpdateDialogue())
{
_interacting.remove(dialogue.getPlayer().getName());
dialogueIterator.remove();
dialogue.shutdown();
System.out.println("Removed trick dialogue.");
}
}
}
public TaskManager getTaskManager()
{
return _taskManager;
}
public DonationManager getDonationManager()
{
return _donationManager;
}
public CoreClientManager getClientManager()
{
return _coreClientManager;
}
}

View File

@ -0,0 +1,40 @@
package mineplex.hub.modules.trickortreat;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import mineplex.core.common.util.UtilMath;
public class Blindness extends Trick
{
public Blindness(JavaPlugin plugin)
{
super(plugin);
}
@Override
public String onTrick(Player player)
{
System.out.println("Tricking " + player.getName() + " with Blindness");
player.playSound(player.getLocation(), Sound.ENDERMAN_SCREAM, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1.2F, 0F);
for (int i = 0 ; i < UtilMath.r(5) ; i++)
player.playSound(player.getLocation(), i % 2 == 0 ? Sound.GHAST_SCREAM : Sound.GHAST_SCREAM2, 1.5F, 0F);
player.playSound(player.getLocation(), Sound.AMBIENCE_THUNDER, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.ZOMBIE_PIG_ANGRY, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.CREEPER_HISS, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.ZOMBIE_REMEDY, 1.2F, 0F);
player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 400, 0));
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 400, 0));
return "See you around...";
}
}

View File

@ -0,0 +1,51 @@
package mineplex.hub.modules.trickortreat;
import org.bukkit.Bukkit;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityLook;
public class HeadSpasms extends Trick
{
public HeadSpasms(JavaPlugin plugin)
{
super(plugin);
}
@Override
public String onTrick(final Player player)
{
System.out.println("Tricking " + player.getName() + " with HeadSpasms");
for (int i = 0 ; i < UtilMath.r(5) ; i++)
player.playSound(player.getLocation(), i % 2 == 0 ? Sound.GHAST_SCREAM : Sound.GHAST_SCREAM2, 1.5F, 0F);
player.playSound(player.getLocation(), Sound.AMBIENCE_THUNDER, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.ZOMBIE_PIG_ANGRY, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.CREEPER_HISS, 1.2F, 0F);
for (int i = 0 ; i < 5 ; i++)
player.playSound(player.getLocation(), Sound.ENDERMAN_SCREAM, 1.2F, 0F);
for (int i = 0 ; i < 40 ; i++)
{
final int i2 = i;
Bukkit.getScheduler().runTaskLater(Plugin, new Runnable()
{
@Override
public void run()
{
if (player.isOnline())
UtilPlayer.sendPacket(player, new PacketPlayOutEntityLook(player.getEntityId(), (byte) player.getLocation().getYaw(), (byte) ((i2 % 2 == 0 ? 1 : -1) * 80), true));
}
}, i);
}
return "What is wrong with your head, dear?";
}
}

View File

@ -0,0 +1,42 @@
package mineplex.hub.modules.trickortreat;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import mineplex.core.common.util.UtilMath;
public class Nausea extends Trick
{
public Nausea(JavaPlugin plugin)
{
super(plugin);
}
@Override
public String onTrick(Player player)
{
System.out.println("Tricking " + player.getName() + " with Nausea");
player.playSound(player.getLocation(), Sound.ENDERMAN_SCREAM, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1.2F, 0F);
for (int i = 0 ; i < UtilMath.r(5) ; i++)
player.playSound(player.getLocation(), i % 2 == 0 ? Sound.GHAST_SCREAM : Sound.GHAST_SCREAM2, 1.5F, 0F);
player.playSound(player.getLocation(), Sound.AMBIENCE_THUNDER, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.ZOMBIE_PIG_ANGRY, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.CREEPER_HISS, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.GHAST_MOAN, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.ZOMBIE_WOODBREAK, 1.2F, 0F);
player.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 400, 3));
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 400, 9));
return "Did someone eat too much candy?";
}
}

View File

@ -0,0 +1,35 @@
package mineplex.hub.modules.trickortreat;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.common.util.UtilMath;
public class RandomTeleport extends Trick
{
public RandomTeleport(JavaPlugin plugin)
{
super(plugin);
}
@Override
public String onTrick(Player player)
{
System.out.println("Tricking " + player.getName() + " with RandomTeleport");
player.teleport(player.getWorld().getHighestBlockAt(Math.max(UtilMath.r(100), 25), Math.max(UtilMath.r(100), 25)).getLocation().add(0, UtilMath.r(30), 0).clone().add(.5, 1, .5));
for (int i = 0 ; i < UtilMath.r(5) ; i++)
player.playSound(player.getLocation(), i % 2 == 0 ? Sound.GHAST_SCREAM : Sound.GHAST_SCREAM2, 1.5F, 0F);
player.playSound(player.getLocation(), Sound.AMBIENCE_THUNDER, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.ZOMBIE_PIG_ANGRY, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.CREEPER_HISS, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1.2F, 0F);
return "Goodbye...";
}
}

View File

@ -0,0 +1,55 @@
package mineplex.hub.modules.trickortreat;
import org.bukkit.Bukkit;
import org.bukkit.Sound;
import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import net.minecraft.server.v1_7_R4.EntityLightning;
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityStatus;
import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityWeather;
public class ShockingStrikes extends Trick
{
public ShockingStrikes(JavaPlugin plugin)
{
super(plugin);
}
@Override
public String onTrick(final Player player)
{
System.out.println("Tricking " + player.getName() + " with Shocking Strikes");
for (int i = 0 ; i < UtilMath.r(5) ; i++)
player.playSound(player.getLocation(), i % 2 == 0 ? Sound.GHAST_SCREAM : Sound.GHAST_SCREAM2, 1.5F, 0F);
player.playSound(player.getLocation(), Sound.AMBIENCE_THUNDER, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.ZOMBIE_PIG_ANGRY, 1.2F, 0F);
player.playSound(player.getLocation(), Sound.CREEPER_HISS, 1.2F, 0F);
for (int i = 0 ; i < 5 ; i++)
player.playSound(player.getLocation(), Sound.ENDERMAN_SCREAM, 1.2F, 0F);
UtilPlayer.sendPacket(player, new PacketPlayOutSpawnEntityWeather(new EntityLightning(((CraftWorld) player.getWorld()).getHandle(), player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ(), true, false)));
for (int i = 0 ; i < 20 ; i++)
{
Bukkit.getScheduler().runTaskLater(Plugin, new Runnable()
{
@Override
public void run()
{
if (player.isOnline())
UtilPlayer.sendPacket(player, new PacketPlayOutEntityStatus(((CraftPlayer) player).getHandle(), (byte) 2));
}
}, 2 * i);
}
return "I hope you're not too shocked...";
}
}

View File

@ -0,0 +1,21 @@
package mineplex.hub.modules.trickortreat;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public abstract class Trick
{
protected JavaPlugin Plugin;
protected Trick(JavaPlugin plugin)
{
Plugin = plugin;
}
public abstract String onTrick(Player player);
public String getName()
{
return null;
}
}

View File

@ -0,0 +1,196 @@
package mineplex.hub.modules.trickortreat;
import java.util.Random;
import org.bukkit.Instrument;
import org.bukkit.Note;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.Note.Tone;
import mineplex.core.common.util.C;
import mineplex.core.common.util.Callback;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.task.TaskManager;
import mineplex.hub.modules.TrickOrTreatManager;
public class TrickDialogue
{
private TrickOrTreatManager _plugin;
private TaskManager _taskManager;
private String _task;
private Player _player;
private long _time;
private String _villagerName;
private boolean _trick;
private boolean _delayOne;
private boolean _delayTwo;
private boolean _delayThree;
public TrickDialogue(TrickOrTreatManager plugin, String task, Player player, String villagerName, boolean trick)
{
_plugin = plugin;
_taskManager = plugin.getTaskManager();
_task = task;
_player = player;
_villagerName = villagerName;
_time = System.currentTimeMillis();
_trick = trick;
}
public long getTime()
{
return _time;
}
public boolean originalUpdateDialogue()
{
if (!_player.isOnline())
return true;
if (!_delayOne && System.currentTimeMillis() - _time > 250)
{
_delayOne = true;
_player.playNote(_player.getLocation(), Instrument.PIANO, Note.natural(1, Tone.D));
_player.playNote(_player.getLocation(), Instrument.PIANO, Note.natural(1, Tone.A));
_time = System.currentTimeMillis();
}
else if (_delayOne && !_delayTwo && System.currentTimeMillis() - _time > 1000)
{
_delayTwo = true;
if (_trick) //Trick
UtilPlayer.message(_player, C.cGoldB + _villagerName + ": " + C.cYellowB + "I choose... TRICK!");
else
UtilPlayer.message(_player, C.cGoldB + _villagerName + ": " + C.cYellowB + "I choose... TREAT!");
_time = System.currentTimeMillis();
}
else if (_delayTwo && !_delayThree && System.currentTimeMillis() - _time > 750)
{
_delayThree = true;
if (_trick)
{
_plugin.runAsync(new Runnable()
{
public void run()
{
_taskManager.completedTask(null, _player, _task);
_plugin.runSync(new Runnable()
{
@Override
public void run()
{
_plugin.trick(_player, _villagerName);
}
});
}
});
}
else
{
UtilPlayer.message(_player, C.cGoldB + _villagerName + ": " + C.cYellowB + "Have a Happy Halloween!");
_plugin.runAsync(new Runnable()
{
public void run()
{
_taskManager.completedTask(new Callback<Boolean>()
{
@Override
public void run(Boolean data)
{
if (!data)
return;
if (UtilMath.r(10) > 5) //Coins
{
final int amount = Math.max(new Random().nextInt(100) + 100, (int) Math.floor(new Random().nextDouble() * 600));
_plugin.getDonationManager().RewardCoins(new Callback<Boolean>()
{
public void run(final Boolean completed)
{
_plugin.runSync(new Runnable()
{
@Override
public void run()
{
if (completed)
{
UtilPlayer.message(_player, F.main("Treat", "You received " + F.elem(C.cYellow + amount + " Coins") + " from " + F.name(_villagerName) + "."));
//Sound
_player.playSound(_player.getLocation(), Sound.LEVEL_UP, 2f, 1.5f);
}
else
{
UtilPlayer.message(_player, F.main("Treat", "There was an error giving " + F.elem(C.cYellow + amount + " Coins") + " to you. Please visit that villager again.") + ".");
}
}
});
}
}, "Treat " + _villagerName, _player.getName(), _plugin.getClientManager().getAccountId(_player), amount);
}
else //Gems
{
final int amount = Math.max(new Random().nextInt(100) + 100, (int) Math.floor(new Random().nextDouble() * 600));
_plugin.getDonationManager().RewardGems(new Callback<Boolean>()
{
public void run(final Boolean completed)
{
_plugin.runSync(new Runnable()
{
@Override
public void run()
{
if (completed)
{
UtilPlayer.message(_player, F.main("Treat", "You received " + F.elem(C.cGreen + amount + " Gems") + " from " + F.name(_villagerName) + "."));
//Sound
_player.playSound(_player.getLocation(), Sound.LEVEL_UP, 2f, 1.5f);
}
else
{
UtilPlayer.message(_player, F.main("Treat", "There was an error giving " + F.elem(C.cGreen + amount + " Gems") + " to you. Please visit that villager again.") + ".");
}
}
});
}
}, "Treat " + _villagerName, _player.getName(), _player.getUniqueId(), amount);
}
}
}, _player, _task);
}
});
}
_time = System.currentTimeMillis();
}
else if (_delayOne && _delayTwo && _delayThree)
return true;
return false;
}
public Player getPlayer()
{
return _player;
}
public void shutdown()
{
_plugin = null;
_taskManager = null;
_task = null;
_player = null;
_villagerName = null;
}
}

View File

@ -901,34 +901,84 @@ public class MapParser extends JavaPlugin implements Listener
event.getPlayer().setVelocity(vel); event.getPlayer().setVelocity(vel);
} }
@EventHandler @EventHandler(priority = EventPriority.LOWEST)
public void signChangeLog(SignChangeEvent event) public void signChangeLog(SignChangeEvent event)
{ {
if (GetData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer())) if (GetData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer()))
{ {
try ArrayList<String> text = new ArrayList<String>();
{
File file = new File(event.getPlayer().getWorld().getName() + "/" + "sign_log.txt"); text.add("Date: " + UtilTime.now());
text.add("Player: " + event.getPlayer().getName());
text.add("Location: " + UtilWorld.locToStrClean(event.getBlock().getLocation()));
for (int i=0 ; i<event.getLines().length ; i++)
text.add("Line " + i + ": " + event.getLines()[i]);
writeSignLog(text, event.getPlayer().getWorld());
}
}
@EventHandler(priority = EventPriority.LOWEST)
public void signCommand(PlayerCommandPreprocessEvent event)
{
if (event.getMessage().toLowerCase().contains("set"))
{
ArrayList<String> text = new ArrayList<String>();
text.add("Date: " + UtilTime.now());
text.add("Player: " + event.getPlayer().getName());
text.add("Location: " + UtilWorld.locToStrClean(event.getPlayer().getLocation()));
text.add("Message: " + event.getMessage());
writeSignCommandLog(text, event.getPlayer().getWorld());
}
}
public void writeSignCommandLog(ArrayList<String> text, World world)
{
try
{
File file = new File(world.getName() + "/" + "command_sign_log.txt");
if (!file.exists()) if (!file.exists())
file.createNewFile(); file.createNewFile();
FileWriter fw = new FileWriter(file.getAbsoluteFile(), true); FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
BufferedWriter bw = new BufferedWriter(fw); BufferedWriter bw = new BufferedWriter(fw);
bw.write("\n\n"); bw.write("\n\n");
bw.write("\n" + "Date: " + UtilTime.now()); for (String line : text)
bw.write("\n" + "Player: " + event.getPlayer().getName()); bw.write("\n" + line);
bw.write("\n" + "Location: " + UtilWorld.locToStrClean(event.getBlock().getLocation()));
for (int i=0 ; i<event.getLines().length ; i++) bw.close();
bw.write("\n" + "Line " + i + ": " + event.getLines()[i]); }
catch (Exception e)
bw.close(); {
} e.printStackTrace();
catch (Exception e) }
{ }
e.printStackTrace();
} public void writeSignLog(ArrayList<String> text, World world)
{
try
{
File file = new File(world.getName() + "/" + "sign_log.txt");
if (!file.exists())
file.createNewFile();
FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
BufferedWriter bw = new BufferedWriter(fw);
bw.write("\n\n");
for (String line : text)
bw.write("\n" + line);
bw.close();
}
catch (Exception e)
{
e.printStackTrace();
} }
} }
} }

View File

@ -204,7 +204,7 @@ public class BlockToss extends SkillCharge implements IThrown
//Action //Action
UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0, 0, 1, true); UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0, 0, 1, true);
Factory.Projectile().AddThrow(block, cur, this, -1, true, true, true, Factory.Projectile().AddThrow(block, cur, this, -1, true, true, true, true,
null, 0, 0, null, 0, UpdateType.FASTEST, 1.2f); null, 0, 0, null, 0, UpdateType.FASTEST, 1.2f);
//Event //Event

View File

@ -107,7 +107,7 @@ public class FleshHook extends SkillActiveCharge implements IThrown
UtilAction.velocity(item, cur.getLocation().getDirection(), UtilAction.velocity(item, cur.getLocation().getDirection(),
1 + charge , false, 0, 0.2, 20, false); 1 + charge , false, 0, 0.2, 20, false);
Factory.Projectile().AddThrow(item, cur, this, -1, true, true, true, Factory.Projectile().AddThrow(item, cur, this, -1, true, true, true, true,
Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, UpdateType.TICK, 0.6f); Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, UpdateType.TICK, 0.6f);
//Inform //Inform

View File

@ -69,7 +69,7 @@ public class FreezingBlast extends SkillActive implements IThrown
//Action //Action
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(79)); Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(79));
item.setVelocity(player.getLocation().getDirection()); item.setVelocity(player.getLocation().getDirection());
Factory.Projectile().AddThrow(item, player, this, -1, true, true, true, Factory.Projectile().AddThrow(item, player, this, -1, true, true, true, true,
Sound.FIZZ, 0.6f, 1.6f, null, 0, UpdateType.FASTEST, 1f); Sound.FIZZ, 0.6f, 1.6f, null, 0, UpdateType.FASTEST, 1f);
//Inform //Inform

View File

@ -72,7 +72,7 @@ public class GlacialBlade extends SkillActive implements IThrown
//Action //Action
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()).subtract(0, 0.2, 0), ItemStackFactory.Instance.CreateStack(370)); Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()).subtract(0, 0.2, 0), ItemStackFactory.Instance.CreateStack(370));
UtilAction.velocity(item, player.getLocation().getDirection(), 1.6, false, 0, 0.2, 10, false); UtilAction.velocity(item, player.getLocation().getDirection(), 1.6, false, 0, 0.2, 10, false);
Factory.Projectile().AddThrow(item, player, this, -1, true, true, true, Factory.Projectile().AddThrow(item, player, this, -1, true, true, true, true,
null, 0, 0, ParticleType.SNOW_SHOVEL, UpdateType.TICK, 0.3f); null, 0, 0, ParticleType.SNOW_SHOVEL, UpdateType.TICK, 0.3f);
//Effect //Effect

View File

@ -70,7 +70,7 @@ public class IcePrison extends SkillActive implements IThrown
//Action //Action
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(79)); Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(79));
item.setVelocity(player.getLocation().getDirection()); item.setVelocity(player.getLocation().getDirection());
Factory.Projectile().AddThrow(item, player, this, -1, true, true, true, Factory.Projectile().AddThrow(item, player, this, -1, true, true, true, true,
Sound.FIZZ, 0.6f, 1.6f, ParticleType.SNOW_SHOVEL, UpdateType.TICK, 1.5f); Sound.FIZZ, 0.6f, 1.6f, ParticleType.SNOW_SHOVEL, UpdateType.TICK, 1.5f);
//Inform //Inform

View File

@ -101,7 +101,7 @@ public class LightningOrb extends SkillActive implements IThrown
//Action //Action
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(57)); Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(57));
item.setVelocity(player.getLocation().getDirection()); item.setVelocity(player.getLocation().getDirection());
Factory.Projectile().AddThrow(item, player, this, System.currentTimeMillis() + 5000 - (400 * level), true, false, false, Factory.Projectile().AddThrow(item, player, this, System.currentTimeMillis() + 5000 - (400 * level), true, true, false, false,
Sound.FIZZ, 0.6f, 1.6f, ParticleType.FIREWORKS_SPARK, UpdateType.TICK, 0.4f); Sound.FIZZ, 0.6f, 1.6f, ParticleType.FIREWORKS_SPARK, UpdateType.TICK, 0.4f);
//Inform //Inform

View File

@ -36,7 +36,7 @@ public class StaticLazer extends SkillChargeSword
{ {
super(skills, name, classType, skillType, cost, maxLevel, super(skills, name, classType, skillType, cost, maxLevel,
0.012f, 0.004f, 0.012f, 0.004f,
12000, -1000, true, true, 16000, -1000, true, true,
false, true); false, true);
SetDesc(new String[] SetDesc(new String[]
@ -48,24 +48,25 @@ public class StaticLazer extends SkillChargeSword
"Taking damage cancels charge.", "Taking damage cancels charge.",
"", "",
"Deals #6#1 damage and travels up to", "Deals #6#1 damage and travels up to",
"#20#10 blocks.", "#20#10 blocks, but loses 1 damage",
"per 20 blocks travelled.",
}); });
_fireOnFull = false; _fireOnFull = false;
_energyPerCharge = 1.2f; _energyPerCharge = 2.4f;
setAchievementSkill(true); setAchievementSkill(true);
} }
@Override @Override
public String GetRechargeString() public String GetRechargeString()
{ {
return "Recharge: " + "#12#-1 Seconds"; return "Recharge: " + "#16#-1 Seconds";
} }
@Override @Override
public String GetEnergyString() public String GetEnergyString()
{ {
return "Energy: " + "24 per Second"; return "Energy: " + "48 per Second";
} }
@Override @Override
@ -82,7 +83,7 @@ public class StaticLazer extends SkillChargeSword
Location newTarget = player.getEyeLocation().add(player.getLocation().getDirection().multiply(curRange)); Location newTarget = player.getEyeLocation().add(player.getLocation().getDirection().multiply(curRange));
//Hit Player //Hit Player
HashMap<LivingEntity, Double> hits = UtilEnt.getInRadius(newTarget, 2); HashMap<LivingEntity, Double> hits = UtilEnt.getInRadius(newTarget, 1.25);
hits.remove(player); hits.remove(player);
if (!hits.isEmpty()) if (!hits.isEmpty())
break; break;
@ -116,7 +117,7 @@ public class StaticLazer extends SkillChargeSword
//Damage Event //Damage Event
Factory.Damage().NewDamageEvent(other, player, null, Factory.Damage().NewDamageEvent(other, player, null,
DamageCause.CUSTOM, 6 + level * charge, true, true, false, DamageCause.CUSTOM, 2 + ((4 + level) * charge) - (curRange * 0.05), true, true, false,
player.getName(), GetName()); player.getName(), GetName());
} }

View File

@ -7,6 +7,7 @@ import mineplex.core.common.util.C;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile; import org.bukkit.entity.Projectile;
@ -36,6 +37,7 @@ public class CustomDamageEvent extends Event implements Cancellable
private Player _damagerPlayer; private Player _damagerPlayer;
private Projectile _projectile; private Projectile _projectile;
private Location _knockbackOrigin = null; private Location _knockbackOrigin = null;
private Entity _knockbackSource = null;
//Flags //Flags
private boolean _ignoreArmor = false; private boolean _ignoreArmor = false;
@ -46,7 +48,7 @@ public class CustomDamageEvent extends Event implements Cancellable
public CustomDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile projectile, public CustomDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile projectile,
DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor, DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor,
String initialSource, String initialReason, boolean cancelled) String initialSource, String initialReason, boolean cancelled, Entity knockbackSource)
{ {
_eventCause = cause; _eventCause = cause;
@ -64,6 +66,8 @@ public class CustomDamageEvent extends Event implements Cancellable
_knockback = knockback; _knockback = knockback;
_ignoreRate = ignoreRate; _ignoreRate = ignoreRate;
_ignoreArmor = ignoreArmor; _ignoreArmor = ignoreArmor;
_knockbackSource = knockbackSource;
if (initialSource != null && initialReason != null) if (initialSource != null && initialReason != null)
AddMod(initialSource, initialReason, 0, true); AddMod(initialSource, initialReason, 0, true);
@ -266,6 +270,9 @@ public class CustomDamageEvent extends Event implements Cancellable
public Location getKnockbackOrigin() public Location getKnockbackOrigin()
{ {
if (_knockbackSource != null)
return _knockbackSource.getLocation();
return _knockbackOrigin; return _knockbackOrigin;
} }

View File

@ -32,6 +32,7 @@ import org.bukkit.Sound;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Arrow; import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Fish; import org.bukkit.entity.Fish;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -167,17 +168,35 @@ public class DamageManager extends MiniPlugin
{ {
NewDamageEvent(damagee, damager, proj, NewDamageEvent(damagee, damager, proj,
cause, damage, knockback, ignoreRate, ignoreArmor, cause, damage, knockback, ignoreRate, ignoreArmor,
source, reason, false); source, reason, false, null);
} }
public void NewDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile proj,
DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor,
String source, String reason, Entity knockbackSource)
{
NewDamageEvent(damagee, damager, proj,
cause, damage, knockback, ignoreRate, ignoreArmor,
source, reason, false, knockbackSource);
}
public void NewDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile proj, public void NewDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile proj,
DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor, DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor,
String source, String reason, boolean cancelled) String source, String reason, boolean cancelled)
{
NewDamageEvent(damagee, damager, proj,
cause, damage, knockback, ignoreRate, ignoreArmor,
source, reason, cancelled, null);
}
public void NewDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile proj,
DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor,
String source, String reason, boolean cancelled, Entity knockbackSource)
{ {
_plugin.getServer().getPluginManager().callEvent( _plugin.getServer().getPluginManager().callEvent(
new CustomDamageEvent(damagee, damager, proj, cause, damage, new CustomDamageEvent(damagee, damager, proj, cause, damage,
knockback, ignoreRate, ignoreArmor, knockback, ignoreRate, ignoreArmor,
source, reason, cancelled)); source, reason, cancelled, knockbackSource));
} }
@EventHandler(priority = EventPriority.LOW) @EventHandler(priority = EventPriority.LOW)

View File

@ -42,9 +42,9 @@ public class Fire extends MiniPlugin
_damageManager = damageManager; _damageManager = damageManager;
} }
public void Add(Item item, LivingEntity owner, double expireTime, double delayTime, double burnTime, double d, String skillName) public void Add(Item item, LivingEntity owner, double expireTime, double delayTime, double burnTime, double damage, String skillName)
{ {
_fire.put(item, new FireData(owner, expireTime, delayTime, burnTime, d, skillName)); _fire.put(item, new FireData(owner, expireTime, delayTime, burnTime, damage, skillName));
item.setPickupDelay(0); item.setPickupDelay(0);
} }

View File

@ -11,6 +11,6 @@
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/httpclient-4.2.jar"/> <classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/httpclient-4.2.jar"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/commons-codec-1.6.jar"/> <classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/commons-codec-1.6.jar"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/gson-2.2.1.jar"/> <classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/gson-2.2.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.8.0_60"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

View File

@ -79,16 +79,14 @@ public class StaffServer extends JavaPlugin
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("cf1b629c-cc55-4eb4-be9e-3ca86dfc7b9d"), "mannalou")); ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("cf1b629c-cc55-4eb4-be9e-3ca86dfc7b9d"), "mannalou"));
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("04a484d0-93e0-4777-a70c-808046917e3a"), "EvilEsther")); ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("04a484d0-93e0-4777-a70c-808046917e3a"), "EvilEsther"));
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("adaa7613-6683-400f-baf8-7272c04b2cb4"), "Timmy48081_")); ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("adaa7613-6683-400f-baf8-7272c04b2cb4"), "Timmy48081_"));
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("2d5fd31b-0aa5-41db-a62d-a4611a24349a"), "ishh")); ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("57791647-93b1-4980-8835-7fddadd20eb8"), "xTheOnlyOreOx"));
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("efaf9a17-2304-4f42-8433-421523c308dc"), "B2_mp")); ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("efaf9a17-2304-4f42-8433-421523c308dc"), "B2_mp"));
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("492ff708-fe76-4c5a-b9ed-a747b5fa20a0"), "Cherdy8s")); ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("492ff708-fe76-4c5a-b9ed-a747b5fa20a0"), "Cherdy8s"));
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("80f40f29-4d66-4355-a32f-01a65af2a14c"), "rl6"));
((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("cf85f470-5248-4978-8208-435736fa136e"), "RustyRoo")); ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("cf85f470-5248-4978-8208-435736fa136e"), "RustyRoo"));
((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("377bdea3-badc-448d-81c1-65db43b17ea4"), "Strutt20")); ((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("377bdea3-badc-448d-81c1-65db43b17ea4"), "Strutt20"));
((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("efaf9a17-2304-4f42-8433-421523c308dc"), "B2_mp")); ((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("efaf9a17-2304-4f42-8433-421523c308dc"), "B2_mp"));
((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("2d5fd31b-0aa5-41db-a62d-a4611a24349a"), "ishh"));
((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("cf85f470-5248-4978-8208-435736fa136e"), "RustyRoo")); ((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("cf85f470-5248-4978-8208-435736fa136e"), "RustyRoo"));
} }
} }

View File

@ -158,7 +158,7 @@ public class PerkBlockTossEVO extends Perk implements IThrown
//Action //Action
UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0.2, 0, 1, true); UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0.2, 0, 1, true);
Manager.GetProjectile().AddThrow(block, cur, this, -1, true, true, true, Manager.GetProjectile().AddThrow(block, cur, this, -1, true, true, true, true,
null, 0, 0, null, 0, UpdateType.FASTEST, 1f); null, 0, 0, null, 0, UpdateType.FASTEST, 1f);
//Event //Event

View File

@ -82,7 +82,7 @@ public class PerkSulphurBombEVO extends Perk implements IThrown
UtilAction.velocity(ent, player.getLocation().getDirection(), 1, false, 0, 0.2, 10, false); UtilAction.velocity(ent, player.getLocation().getDirection(), 1, false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, true,
null, 1f, 1f, null, 1f, 1f,
Effect.SMOKE, 1, UpdateType.SLOW, Effect.SMOKE, 1, UpdateType.SLOW,
1f); 1f);

View File

@ -229,7 +229,7 @@ public class BombLobbers extends TeamGame implements IThrown
canHit.add(pos); canHit.add(pos);
} }
Manager.GetProjectile().AddThrow(tnt, player, this, -1L, true, false, true, .2F, canHit); Manager.GetProjectile().AddThrow(tnt, player, this, -1L, true, true, false, true, .2F, canHit);
Manager.getPlugin().getServer().getPluginManager().callEvent(new TNTThrowEvent(player, tnt)); Manager.getPlugin().getServer().getPluginManager().callEvent(new TNTThrowEvent(player, tnt));
@ -343,7 +343,7 @@ public class BombLobbers extends TeamGame implements IThrown
newTNT.setVelocity(tnt.getKey().getVelocity()); newTNT.setVelocity(tnt.getKey().getVelocity());
newTNT.setFuseTicks(60); newTNT.setFuseTicks(60);
Manager.GetProjectile().AddThrow(newTNT, thrower, this, -1L, true, false, true, .2F); Manager.GetProjectile().AddThrow(newTNT, thrower, this, -1L, true, true, false, true, .2F);
tnt.getKey().remove(); tnt.getKey().remove();

View File

@ -68,7 +68,7 @@ public class PerkMortar extends Perk
tnt.setFuseTicks(40); tnt.setFuseTicks(40);
UtilAction.velocity(tnt, player.getLocation().getDirection(), 2.0D, false, 0.0D, 0.1D, 10.0D, false); UtilAction.velocity(tnt, player.getLocation().getDirection(), 2.0D, false, 0.0D, 0.1D, 10.0D, false);
Manager.GetProjectile().AddThrow(tnt, player, l, -1L, true, false, false, .2F); Manager.GetProjectile().AddThrow(tnt, player, l, -1L, true, true, false, false, .2F);
player.playSound(player.getLocation(), Sound.CREEPER_HISS, 3.0F, 1.0F); player.playSound(player.getLocation(), Sound.CREEPER_HISS, 3.0F, 1.0F);
@ -107,7 +107,7 @@ public class PerkMortar extends Perk
tnt.setFuseTicks(60); tnt.setFuseTicks(60);
UtilAction.velocity(tnt, event.getTNT().getVelocity().add(new Vector(i / 5, 0, i / 5)).normalize(), 2.0D, false, 0.0D, 0.1D, 10.0D, false); UtilAction.velocity(tnt, event.getTNT().getVelocity().add(new Vector(i / 5, 0, i / 5)).normalize(), 2.0D, false, 0.0D, 0.1D, 10.0D, false);
Manager.GetProjectile().AddThrow(tnt, event.getPlayer(), l, -1L, true, false, false, .2F); Manager.GetProjectile().AddThrow(tnt, event.getPlayer(), l, -1L, true, true, false, false, .2F);
// l.addThrower(event.getPlayer(), tnt); // l.addThrower(event.getPlayer(), tnt);
_scatter.add(tnt); _scatter.add(tnt);

View File

@ -26,6 +26,7 @@ import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.GameTeam.PlayerState; import nautilus.game.arcade.game.GameTeam.PlayerState;
import nautilus.game.arcade.game.games.smash.kits.KitBlaze; import nautilus.game.arcade.game.games.smash.kits.KitBlaze;
import nautilus.game.arcade.game.games.smash.kits.KitChicken; import nautilus.game.arcade.game.games.smash.kits.KitChicken;
import nautilus.game.arcade.game.games.smash.kits.KitCow;
import nautilus.game.arcade.game.games.smash.kits.KitCreeper; import nautilus.game.arcade.game.games.smash.kits.KitCreeper;
import nautilus.game.arcade.game.games.smash.kits.KitEnderman; import nautilus.game.arcade.game.games.smash.kits.KitEnderman;
import nautilus.game.arcade.game.games.smash.kits.KitGolem; import nautilus.game.arcade.game.games.smash.kits.KitGolem;
@ -109,6 +110,7 @@ public abstract class SuperSmash extends Game
new KitWitherSkeleton(manager), new KitWitherSkeleton(manager),
new KitMagmaCube(manager), new KitMagmaCube(manager),
new KitZombie(manager), new KitZombie(manager),
new KitCow(manager),
new KitSheep(manager) new KitSheep(manager)

View File

@ -33,7 +33,7 @@ public class KitChicken extends SmashKit
new Perk[] new Perk[]
{ {
new PerkSmashStats(4, 2.0, 0.1, 1.5), new PerkSmashStats(4, 2.0, 0.15, 2),
new PerkFlap(0.8, 0.8, false), new PerkFlap(0.8, 0.8, false),
new PerkEggGun(), new PerkEggGun(),
new PerkChickenRocket() new PerkChickenRocket()
@ -89,7 +89,7 @@ public class KitChicken extends SmashKit
ChatColor.RESET + "while also gaining permanant flight.", ChatColor.RESET + "while also gaining permanant flight.",
})); }));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.LEATHER_CHESTPLATE)); player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE));
} }
@Override @Override

View File

@ -2,15 +2,24 @@ package nautilus.game.arcade.game.games.smash.kits;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguiseCow; import mineplex.core.disguise.disguises.DisguiseCow;
import mineplex.core.disguise.disguises.DisguiseMooshroom;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.smash.perks.PerkCowAngryHerd;
import nautilus.game.arcade.game.games.smash.perks.PerkCowMilkSpiral;
import nautilus.game.arcade.game.games.smash.perks.PerkCowMooshroomMadness;
import nautilus.game.arcade.game.games.smash.perks.PerkCowStampede;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.SmashKit; import nautilus.game.arcade.kit.SmashKit;
@ -20,7 +29,7 @@ public class KitCow extends SmashKit
{ {
public KitCow(ArcadeManager manager) public KitCow(ArcadeManager manager)
{ {
super(manager, "Mad Cow", KitAvailability.Gem, 5000, super(manager, "Cow", KitAvailability.Gem, 6000,
new String[] new String[]
{ {
@ -28,14 +37,16 @@ public class KitCow extends SmashKit
new Perk[] new Perk[]
{ {
new PerkSmashStats(7, 1.0, 0.25, 8), new PerkSmashStats(6, 0.9, 0.25, 7.5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false), new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkCowStampede(),
new PerkCowAngryHerd(),
new PerkCowMilkSpiral(),
new PerkCowMooshroomMadness(),
}, },
EntityType.COW, EntityType.COW,
new ItemStack(Material.MILK_BUCKET), new ItemStack(Material.MILK_BUCKET),
"", 0, null); "Mooshroom Madness", 0, null);
} }
@Override @Override
@ -44,24 +55,56 @@ public class KitCow extends SmashKit
UtilInv.Clear(player); UtilInv.Clear(player);
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1, player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1,
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Stampede", C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Angry Herd",
new String[] new String[]
{ {
ChatColor.RESET + "", ChatColor.RESET + "Send forth an angry herd of Cows",
ChatColor.RESET + "which deal damage and knockback",
ChatColor.RESET + "to opponents. Can hit multiple times.",
})); }));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SPADE, (byte)0, 1, player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SPADE, (byte)0, 1,
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Body Slam", C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Milk Spiral",
new String[] new String[]
{ {
ChatColor.RESET + "Spray out a spiral of milk, propelling",
ChatColor.RESET + "yourself forwards through it. Deals damage",
ChatColor.RESET + "to opponents it collides with.",
ChatColor.RESET + "", ChatColor.RESET + "",
ChatColor.RESET + "Crouching cancels propulsion.",
})); }));
if (Manager.GetGame().GetState() == GameState.Recruit)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.LEATHER, (byte)0, 1,
C.cYellow + C.Bold + "Passive" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Stampede",
new String[]
{
ChatColor.RESET + "As you sprint, you will slowly",
ChatColor.RESET + "build up Speed Levels. You attacks",
ChatColor.RESET + "will deal extra damage and knockback",
ChatColor.RESET + "while you have Speed.",
}));
}
if (Manager.GetGame().GetState() == GameState.Recruit)
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.NETHER_STAR, (byte)0, 1,
C.cYellow + C.Bold + "Smash Crystal" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Mooshroom Madness",
new String[]
{
ChatColor.RESET + "Transform into a powerful Mooshroom Cow.",
ChatColor.RESET + "This grants you +1 damage on all attacks",
ChatColor.RESET + "and abilities, halves ability cooldowns,",
ChatColor.RESET + "and increases your health to 15 hearts.",
ChatColor.RESET + "",
ChatColor.RESET + "You remain a Mooshroom until you die.",
}));
player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.IRON_HELMET)); player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.IRON_HELMET));
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.IRON_CHESTPLATE)); player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.IRON_CHESTPLATE));
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.IRON_LEGGINGS)); player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.IRON_LEGGINGS));
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BOOTS)); player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.IRON_BOOTS));
} }
@Override @Override

View File

@ -21,6 +21,7 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.smash.perks.PerkEndermanTeleport;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.SmashKit; import nautilus.game.arcade.kit.SmashKit;
@ -50,6 +51,7 @@ public class KitEnderman extends SmashKit
new PerkDoubleJump("Double Jump", 0.9, 0.9, false), new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkBlink("Blink", 16, 6000), new PerkBlink("Blink", 16, 6000),
new PerkBlockToss(), new PerkBlockToss(),
new PerkEndermanTeleport(),
new PerkEndermanDragon() new PerkEndermanDragon()
}, },
EntityType.ENDERMAN, EntityType.ENDERMAN,

View File

@ -30,7 +30,7 @@ public class KitGolem extends SmashKit
new Perk[] new Perk[]
{ {
new PerkSmashStats(7, 1.0, 0.25, 8), new PerkSmashStats(7, 1.0, 0.2, 8),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false), new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkSlow(0), new PerkSlow(0),
new PerkFissure(), new PerkFissure(),

View File

@ -214,13 +214,13 @@ public class KitKnight extends SmashKit
Horse horse = (Horse)damagee.getVehicle(); Horse horse = (Horse)damagee.getVehicle();
//Damage Event //Damage Event
CustomDamageEvent newEvent = new CustomDamageEvent(horse, event.GetDamagerEntity(true), event.GetProjectile(), // CustomDamageEvent newEvent = new CustomDamageEvent(horse, event.GetDamagerEntity(true), event.GetProjectile(),
event.GetCause(), event.GetDamageInitial(), true, false, false, // event.GetCause(), event.GetDamageInitial(), true, false, false,
UtilEnt.getName(event.GetDamagerPlayer(true)), event.GetReason(), false); // UtilEnt.getName(event.GetDamagerPlayer(true)), event.GetReason(), false);
_calledEvents.add(newEvent); // _calledEvents.add(newEvent);
Manager.getPlugin().getServer().getPluginManager().callEvent(newEvent); // Manager.getPlugin().getServer().getPluginManager().callEvent(newEvent);
_calledEvents.remove(newEvent); // _calledEvents.remove(newEvent);
} }
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.LOWEST)
@ -246,13 +246,13 @@ public class KitKnight extends SmashKit
Player player = (Player)horse.getPassenger(); Player player = (Player)horse.getPassenger();
//Damage Event //Damage Event
final CustomDamageEvent newEvent = new CustomDamageEvent(player, event.GetDamagerEntity(true), event.GetProjectile(), // final CustomDamageEvent newEvent = new CustomDamageEvent(player, event.GetDamagerEntity(true), event.GetProjectile(),
event.GetCause(), event.GetDamageInitial(), true, false, false, // event.GetCause(), event.GetDamageInitial(), true, false, false,
UtilEnt.getName(event.GetDamagerPlayer(true)), event.GetReason(), false); // UtilEnt.getName(event.GetDamagerPlayer(true)), event.GetReason(), false);
//
_calledEvents.add(newEvent); // _calledEvents.add(newEvent);
Manager.getPlugin().getServer().getPluginManager().callEvent(newEvent); // Manager.getPlugin().getServer().getPluginManager().callEvent(newEvent);
_calledEvents.remove(newEvent); // _calledEvents.remove(newEvent);
//Add Knockback //Add Knockback
event.AddKnockback("Knockback Multiplier", 1.2); event.AddKnockback("Knockback Multiplier", 1.2);
} }

View File

@ -30,7 +30,7 @@ public class KitMagmaCube extends SmashKit
new Perk[] new Perk[]
{ {
new PerkSmashStats(5, 1.75, 0.4, 5), new PerkSmashStats(5, 1.75, 0.35, 5),
new PerkDoubleJump("Double Jump", 1.2, 1, false), new PerkDoubleJump("Double Jump", 1.2, 1, false),
new PerkMagmaBoost(), new PerkMagmaBoost(),
new PerkMagmaBlast(), new PerkMagmaBlast(),

View File

@ -37,7 +37,7 @@ public class KitPig extends SmashKit
new Perk[] new Perk[]
{ {
new PerkSmashStats(5, 1.7, 0.25, 5), new PerkSmashStats(5, 1.5, 0.25, 5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false), new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkPigBaconBounce(), new PerkPigBaconBounce(),
new PerkPigBaconBomb(), new PerkPigBaconBomb(),

View File

@ -36,7 +36,7 @@ public class KitSkeletalHorse extends SmashKit
new Perk[] new Perk[]
{ {
new PerkSmashStats(6, 1.4, 0.35, 6), new PerkSmashStats(6, 1.4, 0.3, 6),
new PerkDoubleJump("Double Jump", 1, 1, false), new PerkDoubleJump("Double Jump", 1, 1, false),
new PerkHorseKick(), new PerkHorseKick(),
new PerkBoneRush(), new PerkBoneRush(),
@ -45,7 +45,7 @@ public class KitSkeletalHorse extends SmashKit
}, },
EntityType.HORSE, EntityType.HORSE,
new ItemStack(Material.BONE), new ItemStack(Material.BONE),
"Bone Storm", 24000, Sound.HORSE_SKELETON_DEATH); "Bone Storm", 20000, Sound.HORSE_SKELETON_DEATH);
} }
@Override @Override

View File

@ -37,10 +37,10 @@ public class KitSkeleton extends SmashKit
new Perk[] new Perk[]
{ {
new PerkSmashStats(5, 1.25, 0.20, 6), new PerkSmashStats(5, 1.25, 0.15, 6),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false), new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkFletcher(2, 4, false), new PerkFletcher(3, 3, false),
new PerkKnockbackArrow(1.75), new PerkKnockbackArrow(1.5),
new PerkBoneExplosion(), new PerkBoneExplosion(),
new PerkRopedArrow("Roped Arrow", 1, 5000), new PerkRopedArrow("Roped Arrow", 1, 5000),
new PerkBarrage(5, 300, true, false, true), new PerkBarrage(5, 300, true, false, true),

View File

@ -13,6 +13,7 @@ import mineplex.core.disguise.disguises.DisguiseSquid;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.smash.perks.PerkFishFlurry;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.SmashKit; import nautilus.game.arcade.kit.SmashKit;
@ -38,6 +39,7 @@ public class KitSkySquid extends SmashKit
new PerkDoubleJump("Double Jump", 0.9, 0.9, false), new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkSuperSquid(), new PerkSuperSquid(),
new PerkInkBlast(), new PerkInkBlast(),
new PerkFishFlurry(),
new PerkStormSquid() new PerkStormSquid()
}, },
EntityType.SQUID, EntityType.SQUID,
@ -67,6 +69,16 @@ public class KitSkySquid extends SmashKit
ChatColor.RESET + "the sky in the direction you are looking.", ChatColor.RESET + "the sky in the direction you are looking.",
})); }));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SPADE, (byte)0, 1,
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Fish Flurry",
new String[]
{
ChatColor.RESET + "Target a location to create a geyser.",
ChatColor.RESET + "After a few seconds, the geyser will explode",
ChatColor.RESET + "with all sorts of marine life which will",
ChatColor.RESET + "damage nearby opponents.",
}));
if (Manager.GetGame().GetState() == GameState.Recruit) if (Manager.GetGame().GetState() == GameState.Recruit)
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.NETHER_STAR, (byte)0, 1, player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.NETHER_STAR, (byte)0, 1,
C.cYellow + C.Bold + "Smash Crystal" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Storm Squid", C.cYellow + C.Bold + "Smash Crystal" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Storm Squid",

View File

@ -46,7 +46,7 @@ public class KitSlime extends SmashKit
new Perk[] new Perk[]
{ {
new PerkSmashStats(6, 1.75, 0.35, 3), new PerkSmashStats(6, 1.75, 0.5, 3),
new PerkDoubleJump("Double Jump", 1.2, 1, false), new PerkDoubleJump("Double Jump", 1.2, 1, false),
new PerkSlimeSlam(), new PerkSlimeSlam(),
new PerkSlimeRocket(), new PerkSlimeRocket(),
@ -142,7 +142,7 @@ public class KitSlime extends SmashKit
player.setExp(0.99f); player.setExp(0.99f);
Manager.GetCondition().Factory().Speed("Giga Slime", player, player, 20, 1, false, false, false); Manager.GetCondition().Factory().Speed("Giga Slime", player, player, 20, 2, false, false, false);
} }
@Override @Override

View File

@ -92,8 +92,8 @@ public class KitSnowman extends SmashKit
new String[] new String[]
{ {
ChatColor.RESET + "Creates a field of snow around you", ChatColor.RESET + "Creates a field of snow around you",
ChatColor.RESET + "granting 150% damage to opponents", ChatColor.RESET + "granting +1 damage and 60% knockback",
ChatColor.RESET + "who are standing on it.", ChatColor.RESET + "to opponents standing on it.",
ChatColor.RESET + "", ChatColor.RESET + "",
ChatColor.RESET + "Your aura shrinks on low energy.", ChatColor.RESET + "Your aura shrinks on low energy.",
})); }));

View File

@ -34,7 +34,7 @@ public class KitSpider extends SmashKit
new Perk[] new Perk[]
{ {
new PerkSmashStats(7, 1.5, 0.3, 6), new PerkSmashStats(6, 1.5, 0.25, 6),
new PerkSpiderLeap(), new PerkSpiderLeap(),
new PerkNeedler(), new PerkNeedler(),
new PerkWebShot(), new PerkWebShot(),

View File

@ -34,7 +34,7 @@ public class KitWolf extends SmashKit
new Perk[] new Perk[]
{ {
new PerkSmashStats(5, 1.6, 0.3, 4.5), new PerkSmashStats(5, 1.6, 0.25, 4.5),
new PerkDoubleJump("Wolf Jump", 1.0, 1.0, true), new PerkDoubleJump("Wolf Jump", 1.0, 1.0, true),
new PerkWolf(), new PerkWolf(),
}, },

View File

@ -37,7 +37,7 @@ public class KitZombie extends SmashKit
new Perk[] new Perk[]
{ {
new PerkSmashStats(6, 1.25, 0.3, 4.5), new PerkSmashStats(6, 1.25, 0.25, 5),
new PerkDoubleJump("Double Jump", 0.9, 0.9, false), new PerkDoubleJump("Double Jump", 0.9, 0.9, false),
new PerkFletcher(2, 2, false), new PerkFletcher(2, 2, false),
new PerkKnockbackArrow(1.5), new PerkKnockbackArrow(1.5),
@ -66,7 +66,7 @@ public class KitZombie extends SmashKit
})); }));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1,
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Deaths Grasp", C.cYellow + C.Bold + "Left-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Deaths Grasp",
new String[] new String[]
{ {
ChatColor.RESET + "Leap forwards. If you collide with an ", ChatColor.RESET + "Leap forwards. If you collide with an ",
@ -99,6 +99,7 @@ public class KitZombie extends SmashKit
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE)); player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE));
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS)); player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS));
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS));
} }
@Override @Override

View File

@ -0,0 +1,36 @@
package nautilus.game.arcade.game.games.smash.perks;
import org.bukkit.Location;
import org.bukkit.entity.Cow;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class DataCowCharge
{
public long Time;
public Player Player;
public Vector Direction;
public Cow Cow;
public Location LastLoc;
public long LastMoveTime;
public DataCowCharge(Player player, Cow cow)
{
Time = System.currentTimeMillis();
Player = player;
Direction = player.getLocation().getDirection();
Direction.setY(0);
Direction.normalize();
Direction.multiply(0.75);
Direction.setY(-0.2);
Cow = cow;
LastLoc = Cow.getLocation();
LastMoveTime = System.currentTimeMillis();
}
}

View File

@ -0,0 +1,112 @@
package nautilus.game.arcade.game.games.smash.perks;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
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 org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class DataCowMilkSpiral
{
public long Time;
public Player Player;
public Vector Direction;
public boolean SuperActive;
public boolean DisableVelocity = false;
public Location Spiral;
public Location SpiralA = null;
public Location SpiralB = null;
public DataCowMilkSpiral(Player player, boolean superActive)
{
Time = System.currentTimeMillis();
Player = player;
SuperActive = superActive;
Direction = player.getLocation().getDirection();
Spiral = player.getLocation().add(new Vector(0,1,0)).add(player.getLocation().getDirection().multiply(2));
}
public boolean update()
{
//Propel
if (!DisableVelocity && !Player.isSneaking() && !UtilTime.elapsed(Time, SuperActive ? 2400 : 1800))
UtilAction.velocity(Player, Direction.clone().add(new Vector(0, 0.1, 0)).normalize().multiply(0.45));
else
DisableVelocity = true;
//Move Forward
Spiral.add(Direction.clone().multiply(0.7));
//Spiral
for (int i=0 ; i<2 ; i++)
{
double lead = i * ((2d * Math.PI)/2);
//Orbit
double speed = 3d;
double oX = -Math.sin(Player.getTicksLived()/speed + lead) * 1.5;
double oZ = Math.cos(Player.getTicksLived()/speed + lead) * 1.5;
Location newSpiral = Spiral.clone();
newSpiral.add(UtilAlg.getLeft(Direction).multiply(oX));
newSpiral.add(UtilAlg.getUp(Direction).multiply(oZ));
newSpiral.getWorld().playSound(newSpiral, Sound.SPLASH, 0.2f, 0.75f);
if (i == 0)
{
if (SpiralA != null)
{
while (UtilMath.offset(SpiralA, newSpiral) > 0.2)
{
SpiralA.add(UtilAlg.getTrajectory(SpiralA, newSpiral).multiply(0.2));
UtilParticle.PlayParticle(SuperActive ? ParticleType.RED_DUST : ParticleType.FIREWORKS_SPARK, SpiralA, 0, 0, 0, 0, 1, ViewDist.LONG, UtilServer.getPlayers());
}
}
else
{
SpiralA = newSpiral;
}
}
else
{
if (SpiralB != null)
{
while (UtilMath.offset(SpiralB, newSpiral) > 0.1)
{
SpiralB.add(UtilAlg.getTrajectory(SpiralB, newSpiral).multiply(0.1));
UtilParticle.PlayParticle(SuperActive ? ParticleType.RED_DUST : ParticleType.FIREWORKS_SPARK, SpiralB, 0, 0, 0, 0, 1, ViewDist.LONG, UtilServer.getPlayers());
}
}
else
{
SpiralB = newSpiral;
}
}
}
if (UtilBlock.solid(Spiral.getBlock()))
return true;
return (UtilTime.elapsed(Time, 3000));
}
}

View File

@ -0,0 +1,20 @@
package nautilus.game.arcade.game.games.smash.perks;
import java.util.HashSet;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
public class DataSquidGeyser
{
public Player Player;
public HashSet<Block> Blocks;
public long StartTime;
public DataSquidGeyser(Player player, HashSet<Block> blocks)
{
StartTime = System.currentTimeMillis();
Player = player;
Blocks = blocks;
}
}

View File

@ -0,0 +1,213 @@
package nautilus.game.arcade.game.games.smash.perks;
import java.util.ArrayList;
import java.util.Iterator;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Cow;
import org.bukkit.entity.MushroomCow;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
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.core.disguise.disguises.DisguiseBase;
import mineplex.core.disguise.disguises.DisguiseMooshroom;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.SmashPerk;
public class PerkCowAngryHerd extends SmashPerk
{
private ArrayList<DataCowCharge> _active = new ArrayList<DataCowCharge>();
public PerkCowAngryHerd()
{
super("Angry Herd", new String[]
{
C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Angry Herd"
});
}
@EventHandler
public void shoot(PlayerInteractEvent event)
{
if (event.isCancelled())
return;
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
return;
if (UtilBlock.usable(event.getClickedBlock()))
return;
if (event.getPlayer().getItemInHand() == null)
return;
if (!event.getPlayer().getItemInHand().getType().toString().contains("_AXE"))
return;
Player player = event.getPlayer();
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? 6000 : 12000, true, true))
return;
event.setCancelled(true);
for (double i=-2 ; i<3 ; i++)
{
Vector dir = player.getLocation().getDirection();
dir.setY(0);
dir.normalize();
Location loc = player.getLocation();
loc.add(dir);
loc.add(UtilAlg.getLeft(dir).multiply(i*1.5));
Manager.GetGame().CreatureAllowOverride = true;
Cow cow = player.getWorld().spawn(loc, isSuperActive(player) ? MushroomCow.class : Cow.class);
Manager.GetGame().CreatureAllowOverride = false;
_active.add(new DataCowCharge(player, cow));
}
//Sound
player.getWorld().playSound(player.getLocation(), Sound.COW_IDLE, 2f, 0.6f);
//Inform
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
}
@EventHandler
public void update(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
Iterator<DataCowCharge> activeIter = _active.iterator();
while (activeIter.hasNext())
{
DataCowCharge data = activeIter.next();
//Expire
if (UtilTime.elapsed(data.Time, 3000))
{
if (data.Cow.isValid())
{
data.Cow.remove();
UtilParticle.PlayParticle(ParticleType.EXPLODE, data.Cow.getLocation().add(0, 1, 0), 0, 0, 0, 0, 1, ViewDist.NORMAL, UtilServer.getPlayers());
}
activeIter.remove();
continue;
}
//Set Moved
if (UtilMath.offset(data.Cow.getLocation(), data.LastLoc) > 1)
{
data.LastLoc = data.Cow.getLocation();
data.LastMoveTime = System.currentTimeMillis();
}
//Stuck Remove
if (UtilTime.elapsed(data.LastMoveTime, 1000))
{
if (data.Cow.isValid())
{
data.Cow.remove();
UtilParticle.PlayParticle(ParticleType.EXPLODE, data.Cow.getLocation().add(0, 1, 0), 0, 0, 0, 0, 1, ViewDist.NORMAL, UtilServer.getPlayers());
}
activeIter.remove();
continue;
}
//Gravity
if (UtilEnt.isGrounded(data.Cow))
{
data.Direction.setY(-0.1);
}
else
{
data.Direction.setY(Math.max(-1, data.Direction.getY() - 0.03));
}
//Move
if (UtilTime.elapsed(data.LastMoveTime, 350) && UtilEnt.isGrounded(data.Cow))
data.Cow.setVelocity(data.Direction.clone().add(new Vector(0,0.75,0)));
else
data.Cow.setVelocity(data.Direction);
if (Math.random() > 0.99)
data.Cow.getWorld().playSound(data.Cow.getLocation(), Sound.COW_IDLE, 1f, 1f);
if (Math.random() > 0.97)
data.Cow.getWorld().playSound(data.Cow.getLocation(), Sound.COW_WALK, 1f, 1.2f);
//Hit
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (player.equals(data.Player))
continue;
if (UtilMath.offset(player, data.Cow) < 2.2)
{
if (Recharge.Instance.use(player, "Hit by " + data.Player.getName(), 600, false, false))
{
//Damage Event
Manager.GetDamage().NewDamageEvent(player, data.Player, null,
DamageCause.CUSTOM, 5, true, true, false,
UtilEnt.getName(data.Player), GetName(),
data.Cow);
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, data.Cow.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0, 12, ViewDist.LONG, UtilServer.getPlayers());
data.Cow.getWorld().playSound(data.Cow.getLocation(), Sound.ZOMBIE_WOOD, 0.75f, 0.8f);
data.Cow.getWorld().playSound(data.Cow.getLocation(), Sound.COW_HURT, 1.5f, 0.75f);
}
}
}
}
}
@EventHandler
public void Knockback(CustomDamageEvent event)
{
if (event.GetReason() == null || !event.GetReason().contains(GetName()))
return;
event.AddKnockback(GetName(), 1.25);
}
@Override
public boolean isSuperActive(Player player)
{
DisguiseBase disguise = Manager.GetDisguise().getDisguise(player);
return disguise != null && disguise instanceof DisguiseMooshroom;
}
}

View File

@ -0,0 +1,111 @@
package nautilus.game.arcade.game.games.smash.perks;
import java.util.HashMap;
import java.util.Iterator;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilBlock;
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.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.disguise.disguises.DisguiseBase;
import mineplex.core.disguise.disguises.DisguiseMooshroom;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.kit.SmashPerk;
public class PerkCowMilkSpiral extends SmashPerk
{
private HashMap<Player, DataCowMilkSpiral> _active = new HashMap<Player, DataCowMilkSpiral>();
public PerkCowMilkSpiral()
{
super("Milk Spiral", new String[]
{
C.cYellow + "Right Click" + C.cGray + " with Spade to " + C.cGreen + "Milk Spiral",
C.cGray + "Crouch to cancel movement for Milk Spiral"
});
}
@EventHandler
public void activate(PlayerInteractEvent event)
{
if (event.isCancelled())
return;
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
return;
if (UtilBlock.usable(event.getClickedBlock()))
return;
if (!event.getPlayer().getItemInHand().getType().toString().contains("_SPADE"))
return;
Player player = event.getPlayer();
if (!Kit.HasKit(player))
return;
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? 6000 : 12000, true, true))
return;
_active.put(player, new DataCowMilkSpiral(player, isSuperActive(player)));
//Inform
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
}
@EventHandler
public void update(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
Iterator<DataCowMilkSpiral> activeIter = _active.values().iterator();
while (activeIter.hasNext())
{
DataCowMilkSpiral data = activeIter.next();
if (data.update())
activeIter.remove();
for (Player player : Manager.GetGame().GetPlayers(true))
{
if (player.equals(data.Player))
continue;
if (UtilMath.offset(player.getLocation().add(0, 1, 0), data.Spiral) < 2)
{
Manager.GetDamage().NewDamageEvent(player, data.Player, null,
DamageCause.CUSTOM, 6, true, false, false,
player.getName(), GetName());
UtilParticle.PlayParticle(isSuperActive(player) ? ParticleType.RED_DUST : ParticleType.FIREWORKS_SPARK, player.getLocation().add(0, 1, 0), 0.2f, 0.2f, 0.2f, 0.3f, 30, ViewDist.LONG, UtilServer.getPlayers());
player.getWorld().playSound(player.getLocation(), Sound.SPLASH, 0.25f, 2f);
}
}
}
}
@Override
public boolean isSuperActive(Player player)
{
DisguiseBase disguise = Manager.GetDisguise().getDisguise(player);
return disguise != null && disguise instanceof DisguiseMooshroom;
}
}

View File

@ -0,0 +1,77 @@
package nautilus.game.arcade.game.games.smash.perks;
import java.util.HashSet;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.disguise.disguises.DisguiseBase;
import mineplex.core.disguise.disguises.DisguiseMooshroom;
import mineplex.core.recharge.Recharge;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.SmashPerk;
public class PerkCowMooshroomMadness extends SmashPerk
{
private HashSet<String> _cowSuperActive = new HashSet<String>();
public PerkCowMooshroomMadness()
{
super("Mooshroom Madness", new String[]
{
}, false);
}
@Override
public void addSuperCustom(Player player)
{
_cowSuperActive.add(player.getName());
//Disguise
DisguiseMooshroom disguise = new DisguiseMooshroom(player);
if (Manager.GetGame().GetTeam(player) != null)
disguise.setName(Manager.GetGame().GetTeam(player).GetColor() + player.getName());
else
disguise.setName(player.getName());
disguise.setCustomNameVisible(true);
Manager.GetDisguise().disguise(disguise);
//Armor
player.setMaxHealth(30);
player.setHealth(30);
//Sound
player.getWorld().playSound(player.getLocation(), Sound.COW_HURT, 5f, 0.25f);
//Recharges
Recharge.Instance.recharge(player, "Angry Herd");
Recharge.Instance.recharge(player, "Milk Spiral");
}
@EventHandler
public void damageBuff(CustomDamageEvent event)
{
Player player = event.GetDamagerPlayer(true);
if (player == null)
return;
if (_cowSuperActive.contains(player.getName()))
{
event.AddMod(player.getName(), GetName(), 1, false);
}
}
@Override
public boolean isSuperActive(Player player)
{
DisguiseBase disguise = Manager.GetDisguise().getDisguise(player);
return disguise != null && disguise instanceof DisguiseMooshroom;
}
}

View File

@ -0,0 +1,197 @@
package nautilus.game.arcade.game.games.smash.perks;
import java.util.WeakHashMap;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
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.core.disguise.disguises.DisguiseBase;
import mineplex.core.disguise.disguises.DisguiseMooshroom;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.Skill.ISkill.SkillType;
import mineplex.minecraft.game.classcombat.Skill.event.SkillEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.SmashPerk;
import org.bukkit.Sound;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.potion.PotionEffectType;
public class PerkCowStampede extends SmashPerk
{
private WeakHashMap<Player, Long> _sprintTime = new WeakHashMap<Player, Long>();
private WeakHashMap<Player, Integer> _sprintStr = new WeakHashMap<Player, Integer>();
public PerkCowStampede()
{
super("Stampede", new String[]
{
C.cGray + "Build up Speed Levels as you sprint.",
C.cGray + "+1 damage for each Speed Level.",
});
}
@EventHandler
public void update(UpdateEvent event)
{
if (event.getType() != UpdateType.FASTER)
return;
for (Player cur : UtilServer.getPlayers())
{
if (!Kit.HasKit(cur))
continue;
//Active - Check for Disable
if (_sprintTime.containsKey(cur))
{
//Stopped
if (!cur.isSprinting() || cur.getLocation().getBlock().isLiquid())
{
_sprintTime.remove(cur);
_sprintStr.remove(cur);
cur.removePotionEffect(PotionEffectType.SPEED);
continue;
}
long time = _sprintTime.get(cur);
int str = _sprintStr.get(cur);
//Apply Speed
if (str > 0)
Manager.GetCondition().Factory().Speed(GetName(), cur, cur, 1.9, !isSuperActive(cur) ? str-1 : str, false, true, true);
//Upgrade Speed
if (!UtilTime.elapsed(time, 3000))
continue;
_sprintTime.put(cur, System.currentTimeMillis());
if (str < 3)
{
_sprintStr.put(cur, str+1);
//Effect
cur.getWorld().playSound(cur.getLocation(), Sound.COW_HURT, 2f, 0.75f + 0.25f * str);
}
//Event
UtilServer.getServer().getPluginManager().callEvent(new SkillEvent(cur, GetName(), ClassType.Brute));
}
else if (cur.isSprinting() || !cur.getLocation().getBlock().isLiquid())
{
//Start Timer
if (!_sprintTime.containsKey(cur))
{
_sprintTime.put(cur, System.currentTimeMillis());
_sprintStr.put(cur, 0);
}
}
}
}
@EventHandler
public void particle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player ent : _sprintStr.keySet())
{
if (_sprintStr.get(ent) <= 0)
continue;
UtilParticle.PlayParticle(isSuperActive(ent) ? ParticleType.RED_DUST : ParticleType.CRIT, ent.getLocation(),
(float)(Math.random() - 0.5), 0.2f + (float)Math.random(), (float)(Math.random() - 0.5), 0, _sprintStr.get(ent) * 2,
ViewDist.NORMAL, UtilServer.getPlayers());
}
}
@EventHandler(priority = EventPriority.HIGH)
public void damage(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() != DamageCause.ENTITY_ATTACK)
return;
Player damager = event.GetDamagerPlayer(false);
if (damager == null) return;
if (!_sprintStr.containsKey(damager))
return;
if (_sprintStr.get(damager) == 0)
return;
LivingEntity damagee = event.GetDamageeEntity();
if (damagee == null) return;
//Remove
_sprintTime.remove(damager);
int str = _sprintStr.remove(damager);
damager.removePotionEffect(PotionEffectType.SPEED);
//Damage
event.AddMod(damager.getName(), GetName(), str, true);
event.AddKnockback(GetName(), 1 + (0.1 * str));
//Inform
UtilPlayer.message(damagee, F.main("Game", F.name(damager.getName()) + " hit you with " + F.skill(GetName()) + "."));
//Effect
damager.getWorld().playSound(damager.getLocation(), Sound.ZOMBIE_WOOD, 1f, 2f);
damager.getWorld().playSound(damager.getLocation(), Sound.COW_HURT, 2f, 2f);
//Event
UtilServer.getServer().getPluginManager().callEvent(new SkillEvent(damager, GetName(), ClassType.Brute, damagee));
}
@EventHandler(priority = EventPriority.HIGH)
public void damageCancel(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
Player damagee = event.GetDamageePlayer();
if (damagee == null) return;
clean(damagee);
Manager.GetCondition().EndCondition(damagee, null, GetName());
}
@EventHandler
public void quit(PlayerQuitEvent event)
{
clean(event.getPlayer());
}
public void clean(Player player)
{
_sprintTime.remove(player);
_sprintStr.remove(player);
}
@Override
public boolean isSuperActive(Player player)
{
DisguiseBase disguise = Manager.GetDisguise().getDisguise(player);
return disguise != null && disguise instanceof DisguiseMooshroom;
}
}

View File

@ -0,0 +1,118 @@
package nautilus.game.arcade.game.games.smash.perks;
import java.util.HashMap;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerQuitEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.kit.SmashPerk;
public class PerkEndermanTeleport extends SmashPerk
{
private HashMap<Player, Block> _target = new HashMap<Player, Block>();
private HashMap<Player, Float> _charge = new HashMap<Player, Float>();
public PerkEndermanTeleport()
{
super("Teleport", new String[]
{
C.cYellow + "Hold Sneak" + C.cGray + " to " + C.cGreen + "Teleport"
});
}
@EventHandler
public void update(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Player player : UtilServer.getPlayers())
{
if (!Kit.HasKit(player))
continue;
if (!player.isSneaking() || !Recharge.Instance.usable(player, GetName()))
{
_target.remove(player);
_charge.remove(player);
continue;
}
Block block = player.getTargetBlock(null, 200);
if (!_target.containsKey(player) || !_charge.containsKey(player))
{
if (block == null || block.getType() == Material.AIR)
continue;
_target.put(player, block);
_charge.put(player, 0f);
}
//Invalid Block - End
if (block == null || block.getType() == Material.AIR)
{
_target.remove(player);
_charge.remove(player);
}
//Same Block - Increase Charge
else if (block.equals(_target.get(player)))
{
_charge.put(player, _charge.get(player) + 0.015f);
UtilTextMiddle.display(null, UtilTextMiddle.progress(_charge.get(player)), 0, 10, 10, player);
if (_charge.get(player) >= 1f)
{
UtilTextMiddle.display(null, C.cGreen + "Teleported", 0, 10, 10, player);
Recharge.Instance.useForce(player, GetName(), 5000);
while (block.getRelative(BlockFace.UP).getType() != Material.AIR)
{
block = block.getRelative(BlockFace.UP);
}
player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1f, 0.5f);
player.teleport(block.getLocation().add(0.5, 1, 0.5));
player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1f, 0.5f);
UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, player.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0.1f, 100, ViewDist.LONG, UtilServer.getPlayers());
}
else
{
player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1f, 1f + _charge.get(player));
UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, player.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0.05f, 10, ViewDist.LONG, UtilServer.getPlayers());
}
}
//New Block - Reset
else
{
_target.put(player, block);
_charge.put(player, 0f);
}
}
}
@EventHandler
public void clean(PlayerQuitEvent event)
{
_target.remove(event.getPlayer());
_charge.remove(event.getPlayer());
}
}

View File

@ -0,0 +1,206 @@
package nautilus.game.arcade.game.games.smash.perks;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.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.core.itemstack.ItemStackFactory;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.SmashPerk;
public class PerkFishFlurry extends SmashPerk implements IThrown
{
private ArrayList<DataSquidGeyser> _active = new ArrayList<DataSquidGeyser>();
public PerkFishFlurry()
{
super("Fish Flurry", new String[]
{
C.cYellow + "Right-Click" + C.cGray + " with Spade to use " + C.cGreen + "Fish Flurry"
});
}
@EventHandler
public void shoot(PlayerInteractEvent event)
{
if (event.isCancelled())
return;
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
return;
if (UtilBlock.usable(event.getClickedBlock()))
return;
if (event.getPlayer().getItemInHand() == null)
return;
if (!event.getPlayer().getItemInHand().getType().toString().contains("_SPADE"))
return;
Player player = event.getPlayer();
if (isSuperActive(player))
return;
if (!Kit.HasKit(player))
return;
Block block = player.getTargetBlock(null, 64);
if (block == null || block.getType() == Material.AIR)
{
UtilPlayer.message(player, F.main("Game", "You must target a block."));
return;
}
if (!Recharge.Instance.use(player, GetName(), 24000, true, true))
return;
event.setCancelled(true);
HashSet<Block> blocks = new HashSet<Block>();
for (Block cur : UtilBlock.getInRadius(block, 3.5d).keySet())
{
if (UtilBlock.airFoliage(cur))
continue;
if (!UtilBlock.airFoliage(cur.getRelative(BlockFace.UP)))
continue;
blocks.add(cur);
}
_active.add(new DataSquidGeyser(player, blocks));
//Inform
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
}
@EventHandler
public void update(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
Iterator<DataSquidGeyser> activeIter = _active.iterator();
while (activeIter.hasNext())
{
DataSquidGeyser data = activeIter.next();
//particles
for (Block block : data.Blocks)
UtilParticle.PlayParticle(ParticleType.SPLASH, block.getLocation().add(0.5, 1, 0.5), 0.25f, 0, 0.25f, 0, 10, ViewDist.LONG, UtilServer.getPlayers());
//sound
Block block = UtilAlg.Random(data.Blocks);
if (Math.random() > 0.5)
block.getWorld().playSound(block.getLocation(), Math.random() > 0.5 ? Sound.SPLASH : Sound.SPLASH2, 0.5f, 1f);
//Fish
if (!UtilTime.elapsed(data.StartTime, 2000))
{
}
else if (!UtilTime.elapsed(data.StartTime, 6000))
{
for (int i=0 ; i<1 ; i++)
{
Item fish = block.getWorld().dropItem(block.getLocation().add(0.5, 1.5, 0.5),
ItemStackFactory.Instance.CreateStack(Material.RAW_FISH, (byte)UtilMath.r(4), 1, "Fish" + System.currentTimeMillis()));
Vector random = new Vector(
Math.random() - 0.5,
1 + Math.random() * 1,
Math.random() - 0.5);
UtilAction.velocity(fish, random, 0.25 + 0.4 * Math.random(), false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(fish, data.Player, this,
-1, true, false, true, true,
null, 1f, 1f,
null, UpdateType.TICK, 1f);
}
}
else
{
activeIter.remove();
}
}
}
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
if (target != null)
{
//Damage Event
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
DamageCause.PROJECTILE, 3, true, true, false,
UtilEnt.getName(data.GetThrower()), GetName());
UtilParticle.PlayParticle(ParticleType.EXPLODE, target.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0, 12, ViewDist.LONG, UtilServer.getPlayers());
}
data.GetThrown().remove();
}
@Override
public void Idle(ProjectileUser data)
{
data.GetThrown().remove();
}
@Override
public void Expire(ProjectileUser data)
{
data.GetThrown().remove();
}
@EventHandler
public void Knockback(CustomDamageEvent event)
{
if (event.GetReason() == null || !event.GetReason().contains(GetName()))
return;
event.AddKnockback(GetName(), 1.5);
event.setKnockbackOrigin(event.GetDamageeEntity().getLocation().add(Math.random()-0.5, -0.1, Math.random()-0.5));
}
}

View File

@ -153,7 +153,7 @@ public class SnowFight extends TeamGame
{ {
if(IsOnIce(player)) if(IsOnIce(player))
{ {
Bukkit.getPluginManager().callEvent(new CustomDamageEvent(player, null, null, DamageCause.CUSTOM, 2.0D, false, true, true, "Ice", "Ice", false)); Bukkit.getPluginManager().callEvent(new CustomDamageEvent(player, null, null, DamageCause.CUSTOM, 2.0D, false, true, true, "Ice", "Ice", false, null));
} }
} }
@ -510,7 +510,7 @@ public class SnowFight extends TeamGame
if(player instanceof Player) if(player instanceof Player)
{ {
Player damagee = (Player) player; Player damagee = (Player) player;
Bukkit.getPluginManager().callEvent(new CustomDamageEvent(damagee, null, null, DamageCause.CUSTOM, damage, false, true, true, "Ice Meteoroid", "Ice Meteoroid", false)); Bukkit.getPluginManager().callEvent(new CustomDamageEvent(damagee, null, null, DamageCause.CUSTOM, damage, false, true, true, "Ice Meteoroid", "Ice Meteoroid", false, null));
} }
} }

View File

@ -3,6 +3,10 @@ package nautilus.game.arcade.game.games.turfforts;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -16,15 +20,19 @@ import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.Arrow; import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockEvent; import org.bukkit.event.block.BlockEvent;
import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import net.minecraft.server.v1_7_R4.EntityArrow; import net.minecraft.server.v1_7_R4.EntityArrow;
import net.minecraft.server.v1_7_R4.Item; import net.minecraft.server.v1_7_R4.Item;
@ -45,6 +53,8 @@ import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType; import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.PlayerGameRespawnEvent;
import nautilus.game.arcade.events.PlayerKitGiveEvent;
import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.TeamGame; import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.games.turfforts.kits.KitInfiltrator; import nautilus.game.arcade.game.games.turfforts.kits.KitInfiltrator;
@ -103,9 +113,11 @@ public class TurfForts extends TeamGame
private long _fightTime = 90000; private long _fightTime = 90000;
private boolean _fight = false; private boolean _fight = false;
private int _lines = 0; private int _lines = 0;
private HashMap<Player, Long> _enemyTurf = new HashMap<Player, Long>(); private HashMap<Player, Long> _enemyTurf = new HashMap<Player, Long>();
private Set<UUID> playersThatNeedBlocks = new HashSet<UUID>();
public TurfForts(ArcadeManager manager) public TurfForts(ArcadeManager manager)
{ {
super(manager, GameType.TurfWars, super(manager, GameType.TurfWars,
@ -266,7 +278,7 @@ public class TurfForts extends TeamGame
EndCheck(); EndCheck();
} }
} }
@EventHandler @EventHandler
public void BowCancel(EntityShootBowEvent event) public void BowCancel(EntityShootBowEvent event)
{ {
@ -284,7 +296,9 @@ public class TurfForts extends TeamGame
{ {
if (event.isCancelled()) // this statement might save just a small amount of time if (event.isCancelled()) // this statement might save just a small amount of time
return; return;
if (!IsAlive(event.getPlayer())) if (!IsAlive(event.getPlayer()))
{ {
event.setCancelled(true); event.setCancelled(true);
@ -296,6 +310,18 @@ public class TurfForts extends TeamGame
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
Block block = event.getBlock();
GameTeam team = GetTeam(event.getPlayer());
GameTeam otherTeam = GetOtherTeam(team);
if (block.getType().equals(Material.WOOL) && (block.getData() == 14 && team.GetColor() != ChatColor.RED) || (block.getData() == 3 && team.GetColor() != ChatColor.AQUA))
{
UtilPlayer.message(event.getPlayer(), F.main("Game", "You cannot break the " + F.elem(otherTeam.GetColor() + otherTeam.GetName()) + " team's blocks!"));
event.setCancelled(true);
return;
}
} }
@EventHandler(ignoreCancelled = true) @EventHandler(ignoreCancelled = true)
@ -525,13 +551,44 @@ public class TurfForts extends TeamGame
{ {
for (Player player : team.GetPlayers(true)) for (Player player : team.GetPlayers(true))
{ {
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.WOOL, team.GetColorData(), 24)); if (UtilPlayer.isSpectator(player))
{
this.playersThatNeedBlocks.add(player.getUniqueId());
}
else
{
addBlocks(team, player);
}
} }
} }
} }
} }
} }
public void addBlocks(GameTeam team, Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.WOOL, team.GetColorData(), 24));
}
@EventHandler(ignoreCancelled = true)
public void onQuit(PlayerQuitEvent event)
{
this.playersThatNeedBlocks.remove(event.getPlayer().getUniqueId());
}
@EventHandler(ignoreCancelled = true)
public void onSpawn(PlayerKitGiveEvent event)
{
Player player = event.GetPlayer();
if (this.playersThatNeedBlocks.contains(player.getUniqueId()))
{
this.playersThatNeedBlocks.remove(player.getUniqueId());
this.addBlocks(GetTeam(player), player);
}
}
@Override @Override
@EventHandler @EventHandler
public void ScoreboardUpdate(UpdateEvent event) public void ScoreboardUpdate(UpdateEvent event)
@ -707,23 +764,6 @@ public class TurfForts extends TeamGame
} }
*/ */
//Added by TheMineBench.
@EventHandler
public void blockBreak(BlockBreakEvent event) {
Block block = event.getBlock();
GameTeam team = GetTeam(event.getPlayer());
GameTeam otherTeam = GetOtherTeam(team);
if (block.getType().equals(Material.WOOL) && (block.getData() == 14 && team.GetColor() != ChatColor.RED) || (block.getData() == 3 && team.GetColor() != ChatColor.AQUA))
{
UtilPlayer.message(event.getPlayer(), F.main("Game", "You cannot break the " + F.elem(otherTeam.GetColor() + otherTeam.GetName()) + " team's blocks!"));
event.setCancelled(true);
return;
}
}
public GameTeam GetOtherTeam(GameTeam team) { public GameTeam GetOtherTeam(GameTeam team) {
return team.GetColor() == ChatColor.RED ? GetTeam(ChatColor.AQUA) : GetTeam(ChatColor.RED); return team.GetColor() == ChatColor.RED ? GetTeam(ChatColor.AQUA) : GetTeam(ChatColor.RED);

View File

@ -47,17 +47,6 @@ public class PerkArcticAura extends Perk
//Snow //Snow
Manager.GetBlockRestore().Snow(block, (byte)1, (byte)1, (long)(duration * (1 + blocks.get(block))), 250, 0); Manager.GetBlockRestore().Snow(block, (byte)1, (byte)1, (long)(duration * (1 + blocks.get(block))), 250, 0);
} }
for (Player other : Manager.GetGame().GetPlayers(true))
{
if (other.equals(player))
continue;
if (UtilMath.offset(player, other) > range)
continue;
Manager.GetCondition().Factory().Slow("Aura Slow", other, player, 0.9, 0, false, false, false, false);
}
} }
} }
} }

View File

@ -69,7 +69,7 @@ public class PerkBaconBlast extends Perk implements IThrown
UtilAction.velocity(ent, player.getLocation().getDirection(), 1, false, 0, 0.2, 10, false); UtilAction.velocity(ent, player.getLocation().getDirection(), 1, false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, true,
null, 1f, 1f, null, 1f, 1f,
null, 1, UpdateType.SLOW, null, 1, UpdateType.SLOW,
0.5f); 0.5f);

View File

@ -166,7 +166,7 @@ public class PerkBatForm extends SmashPerk
} }
//Move //Move
data.Location.add(data.Direction.clone().multiply(0.75)); data.Location.add(data.Direction.clone().multiply(1));
//Effect //Effect
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, data.Location, 0, 0, 0, 0, 1, UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, data.Location, 0, 0, 0, 0, 1,
@ -186,6 +186,9 @@ public class PerkBatForm extends SmashPerk
HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(data.Location, 10); HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(data.Location, 10);
for (LivingEntity cur : targets.keySet()) for (LivingEntity cur : targets.keySet())
{ {
if (cur.equals(data.Shooter))
continue;
Manager.GetDamage().NewDamageEvent(cur, data.Shooter, null, Manager.GetDamage().NewDamageEvent(cur, data.Shooter, null,
DamageCause.CUSTOM, 12 * targets.get(cur) + 0.5, true, false, false, DamageCause.CUSTOM, 12 * targets.get(cur) + 0.5, true, false, false,
data.Shooter.getName(), GetName()); data.Shooter.getName(), GetName());

View File

@ -3,6 +3,7 @@ package nautilus.game.arcade.kit.perks;
import org.bukkit.Color; import org.bukkit.Color;
import org.bukkit.Effect; import org.bukkit.Effect;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.FireworkEffect.Type; import org.bukkit.FireworkEffect.Type;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
@ -104,7 +105,9 @@ public class PerkBlink extends SmashPerk
//Firework //Firework
UtilFirework.playFirework(player.getEyeLocation(), Type.BALL, Color.BLACK, false, false); UtilFirework.playFirework(player.getEyeLocation(), Type.BALL, Color.BLACK, false, false);
player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1f, 1f);
player.teleport(loc); player.teleport(loc);
player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1f, 1f);
//Firework //Firework
UtilFirework.playFirework(player.getEyeLocation(), Type.BALL, Color.BLACK, false, false); UtilFirework.playFirework(player.getEyeLocation(), Type.BALL, Color.BLACK, false, false);

View File

@ -15,6 +15,7 @@ import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.projectile.IThrown; import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser; import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent;
@ -74,6 +75,9 @@ public class PerkBlockToss extends SmashPerk implements IThrown
if (UtilBlock.usable(grab)) if (UtilBlock.usable(grab))
return; return;
if (!Recharge.Instance.usable(player, GetName()))
return;
if (!UtilBlock.airFoliage(grab.getRelative(BlockFace.UP)) || Manager.GetBlockRestore().Contains(grab.getRelative(BlockFace.UP))) if (!UtilBlock.airFoliage(grab.getRelative(BlockFace.UP)) || Manager.GetBlockRestore().Contains(grab.getRelative(BlockFace.UP)))
{ {
@ -126,6 +130,9 @@ public class PerkBlockToss extends SmashPerk implements IThrown
for (Player cur : throwSet) for (Player cur : throwSet)
{ {
Recharge.Instance.recharge(cur, GetName());
Recharge.Instance.use(cur, GetName(), 2000, false, true);
BlockTossData data = _hold.remove(cur); BlockTossData data = _hold.remove(cur);
FallingBlock block = cur.getWorld().spawnFallingBlock(cur.getEyeLocation().add(cur.getLocation().getDirection()), data.Type, data.Data); FallingBlock block = cur.getWorld().spawnFallingBlock(cur.getEyeLocation().add(cur.getLocation().getDirection()), data.Type, data.Data);
@ -143,7 +150,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown
//Action //Action
UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0.2, 0, 1, true); UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0.2, 0, 1, true);
Manager.GetProjectile().AddThrow(block, cur, this, -1, true, true, true, Manager.GetProjectile().AddThrow(block, cur, this, -1, true, true, true, true,
null, 0, 0, null, 0, UpdateType.FASTEST, 1f); null, 0, 0, null, 0, UpdateType.FASTEST, 1f);
//Event //Event

View File

@ -57,7 +57,7 @@ public class PerkBoneExplosion extends SmashPerk
if (!Recharge.Instance.use(player, GetName(), 10000, true, true)) if (!Recharge.Instance.use(player, GetName(), 10000, true, true))
return; return;
HashMap<Player, Double> nearby = UtilPlayer.getInRadius(player.getLocation(), 10); HashMap<Player, Double> nearby = UtilPlayer.getInRadius(player.getLocation(), 7);
for (Player other : nearby.keySet()) for (Player other : nearby.keySet())
{ {
if (player.equals(other)) if (player.equals(other))

View File

@ -123,7 +123,7 @@ public class PerkBoneRush extends SmashPerk implements IThrown
{ {
Item bone = player.getWorld().dropItem(player.getLocation().add(Math.random()*5 - 2.5, Math.random()*3, Math.random()*5 - 2.5), new ItemStack(Material.BONE)); Item bone = player.getWorld().dropItem(player.getLocation().add(Math.random()*5 - 2.5, Math.random()*3, Math.random()*5 - 2.5), new ItemStack(Material.BONE));
UtilAction.velocity(bone, dir, 0.6 + 0.3 * Math.random(), false, 0, 0.1 + Math.random() * 0.05, 0.3, false); UtilAction.velocity(bone, dir, 0.6 + 0.3 * Math.random(), false, 0, 0.1 + Math.random() * 0.05, 0.3, false);
Manager.GetProjectile().AddThrow(bone, player, this, -1, true, true, true, false, 0.5f); Manager.GetProjectile().AddThrow(bone, player, this, 2000, true, true, true, true, 0.5f);
} }
} }
} }

View File

@ -75,7 +75,7 @@ public class PerkCowBomb extends Perk implements IThrown
UtilAction.velocity(ent, player.getLocation().getDirection(), 1.4, false, 0, 0.3, 10, false); UtilAction.velocity(ent, player.getLocation().getDirection(), 1.4, false, 0, 0.3, 10, false);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, true,
null, 1f, 1f, null, 1f, 1f,
null, 1, UpdateType.SLOW, null, 1, UpdateType.SLOW,
0.5f); 0.5f);

View File

@ -55,6 +55,8 @@ public class PerkCreeperElectricity extends Perk
SetPowered(damagee, true); SetPowered(damagee, true);
Manager.GetCondition().Factory().Speed(GetName(), damagee, damagee, 4, 1, false, false, false);
//Sound //Sound
damagee.getWorld().playSound(damagee.getLocation(), Sound.CREEPER_HISS, 3f, 1.25f); damagee.getWorld().playSound(damagee.getLocation(), Sound.CREEPER_HISS, 3f, 1.25f);
@ -117,8 +119,10 @@ public class PerkCreeperElectricity extends Perk
//Inform //Inform
UtilPlayer.message(damagee, F.main("Skill", "You hit " + F.elem(UtilEnt.getName(event.GetDamagerPlayer(false))) + " with " + F.skill(GetName()) + ".")); UtilPlayer.message(damagee, F.main("Skill", "You hit " + F.elem(UtilEnt.getName(event.GetDamagerPlayer(false))) + " with " + F.skill(GetName()) + "."));
//Lightning //Elec
damagee.getWorld().strikeLightningEffect(damagee.getLocation()); damagee.getWorld().strikeLightningEffect(damagee.getLocation());
Manager.GetCondition().Factory().Shock(GetName(), event.GetDamagerEntity(false), event.GetDamageeEntity(), 1, false, false);
SetPowered(damagee, false); SetPowered(damagee, false);
//Damage Event //Damage Event

View File

@ -76,12 +76,12 @@ public class PerkCreeperSulphurBomb extends SmashPerk implements IThrown
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.COAL, (byte)0)); org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.COAL, (byte)0));
UtilAction.velocity(ent, player.getLocation().getDirection(), 1, false, 0, 0.2, 10, false); UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, true,
null, 1f, 1f, null, 1f, 1f,
null, 1, UpdateType.SLOW, null, 1, UpdateType.SLOW,
0.5f); 0.65f);
//Inform //Inform
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + ".")); UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
@ -130,6 +130,6 @@ public class PerkCreeperSulphurBomb extends SmashPerk implements IThrown
if (event.GetReason() == null || !event.GetReason().contains(GetName())) if (event.GetReason() == null || !event.GetReason().contains(GetName()))
return; return;
event.AddKnockback(GetName(), 1.5); event.AddKnockback(GetName(), 2);
} }
} }

View File

@ -106,6 +106,6 @@ public class PerkDeadlyBones extends SmashPerk
if (event.GetReason() == null || !event.GetReason().contains(GetName())) if (event.GetReason() == null || !event.GetReason().contains(GetName()))
return; return;
event.AddKnockback(GetName(), 3); event.AddKnockback(GetName(), 2.5);
} }
} }

View File

@ -44,7 +44,7 @@ public class PerkDeathsGrasp extends Perk
{ {
super("Deaths Grasp", new String[] super("Deaths Grasp", new String[]
{ {
C.cYellow + "Right-Click" + C.cGray + " with Axe to use " + C.cGreen + "Deaths Grasp", C.cYellow + "Left-Click" + C.cGray + " with Bow to use " + C.cGreen + "Deaths Grasp",
C.cGray + "+100% Arrow Damage to enemies thrown by Deaths Grasp" C.cGray + "+100% Arrow Damage to enemies thrown by Deaths Grasp"
}); });
} }
@ -143,7 +143,7 @@ public class PerkDeathsGrasp extends Perk
DamageCause.CUSTOM, 6, false, true, false, DamageCause.CUSTOM, 6, false, true, false,
damager.getName(), GetName()); damager.getName(), GetName());
UtilAction.velocity(damagee, UtilAlg.getTrajectory(damagee, damager), 1.8, false, 0, 1, 1.8, true); UtilAction.velocity(damagee, UtilAlg.getTrajectory2d(damagee, damager), 1.6, false, 0, 1.2, 1.8, true);
UtilAction.zeroVelocity(damager); UtilAction.zeroVelocity(damager);
@ -156,6 +156,7 @@ public class PerkDeathsGrasp extends Perk
UtilPlayer.message(damagee, F.main("Game", F.name(damager.getName()) + " hit you with " + F.skill(GetName()) + ".")); UtilPlayer.message(damagee, F.main("Game", F.name(damager.getName()) + " hit you with " + F.skill(GetName()) + "."));
Recharge.Instance.recharge(damager, GetName()); Recharge.Instance.recharge(damager, GetName());
Recharge.Instance.use(damager, GetName(), 2000, true, true);
} }
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)

View File

@ -20,6 +20,10 @@ import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
@ -89,7 +93,7 @@ public class PerkFirefly extends SmashPerk
if (event.getType() != UpdateType.TICK) if (event.getType() != UpdateType.TICK)
return; return;
_tick = (_tick + 1)%3; _tick = (_tick + 1)%1000;
Iterator<FireflyData> dataIterator = _data.iterator(); Iterator<FireflyData> dataIterator = _data.iterator();
@ -106,26 +110,35 @@ public class PerkFirefly extends SmashPerk
data.Player.getWorld().playSound(data.Player.getLocation(), Sound.EXPLODE, 0.2f, 0.6f); data.Player.getWorld().playSound(data.Player.getLocation(), Sound.EXPLODE, 0.2f, 0.6f);
data.Location = data.Player.getLocation(); data.Location = data.Player.getLocation();
if (_tick == 0) //Sound and Effect
{ UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, data.Player.getLocation().add(0, 1, 0), 0.6f, 0.6f, 0.6f, 0, 10, ViewDist.LONG, UtilServer.getPlayers());
//Firework
UtilFirework.playFirework(data.Player.getLocation().add(0, 0.6, 0), Type.BURST, Color.ORANGE, false, false);
}
float progress = (float)(System.currentTimeMillis()-data.Time)/1500f;
data.Player.getWorld().playSound(data.Player.getLocation(), Sound.BLAZE_BREATH, 0.5f, 1f + progress);
} }
//Velocity //Velocity
else if (!UtilTime.elapsed(data.Time, 2500) || superActive) else if (!UtilTime.elapsed(data.Time, 2750) || superActive)
{ {
UtilAction.velocity(data.Player, data.Player.getLocation().getDirection().multiply(superActive ? 0.9 : 0.7).add(new Vector(0,0.15,0))); UtilAction.velocity(data.Player, data.Player.getLocation().getDirection().multiply(superActive ? 0.9 : 0.7).add(new Vector(0,0.15,0)));
data.Player.getWorld().playSound(data.Player.getLocation(), Sound.EXPLODE, 0.6f, 1.2f); data.Player.getWorld().playSound(data.Player.getLocation(), Sound.EXPLODE, 0.6f, 1.2f);
if (_tick == 0) //Sound and Effect
if (!isSuperActive(data.Player))
{ {
//Firework UtilParticle.PlayParticle(ParticleType.FLAME, data.Player.getLocation().add(0, 1, 0), 0.6f, 0.6f, 0.6f, 0, 40, ViewDist.LONG, UtilServer.getPlayers());
UtilFirework.playFirework(data.Player.getLocation().add(0, 0.6, 0), isSuperActive(data.Player) ? Type.BALL : Type.BURST, Color.RED, false, superActive);
} data.Player.getWorld().playSound(data.Player.getLocation(), Sound.EXPLODE, 0.5f, 1.25f);
}
for (Player other : UtilPlayer.getNearby(data.Player.getLocation(), isSuperActive(data.Player) ? 6 : 4)) else
{
UtilParticle.PlayParticle(ParticleType.FLAME, data.Player.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0, 60, ViewDist.LONG, UtilServer.getPlayers());
UtilParticle.PlayParticle(ParticleType.LAVA, data.Player.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0, 40, ViewDist.LONG, UtilServer.getPlayers());
data.Player.getWorld().playSound(data.Player.getLocation(), Sound.EXPLODE, 0.75f, 0.75f);
}
for (Player other : UtilPlayer.getNearby(data.Player.getLocation(), isSuperActive(data.Player) ? 7 : 4))
{ {
if (other.equals(data.Player)) if (other.equals(data.Player))
continue; continue;
@ -136,10 +149,9 @@ public class PerkFirefly extends SmashPerk
other.playEffect(EntityEffect.HURT); other.playEffect(EntityEffect.HURT);
if (_tick == 0) if (_tick == 0)
if (!data.Targets.contains(other)) {
if (Recharge.Instance.use(other, GetName() + " hit by " + data.Player.getName(), 2000, false, false))
{ {
data.Targets.add(other);
//Damage Event //Damage Event
Manager.GetDamage().NewDamageEvent(other, data.Player, null, Manager.GetDamage().NewDamageEvent(other, data.Player, null,
DamageCause.CUSTOM, 10, true, true, false, DamageCause.CUSTOM, 10, true, true, false,
@ -147,6 +159,7 @@ public class PerkFirefly extends SmashPerk
UtilPlayer.message(other, F.main("Game", F.elem(Manager.GetColor(data.Player) + data.Player.getName()) + " hit you with " + F.elem(GetName()) + ".")); UtilPlayer.message(other, F.main("Game", F.elem(Manager.GetColor(data.Player) + data.Player.getName()) + " hit you with " + F.elem(GetName()) + "."));
} }
}
} }
} }
else else

View File

@ -93,7 +93,7 @@ public class PerkFlap extends SmashPerk
if (UtilEnt.isGrounded(player) || UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN))) if (UtilEnt.isGrounded(player) || UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN)))
{ {
player.setExp(0.999f); player.setExp(Math.min(0.9999f, player.getExp() + 0.03f));
player.setAllowFlight(true); player.setAllowFlight(true);
} }
else if (Recharge.Instance.usable(player, GetName()) && player.getExp() > 0) else if (Recharge.Instance.usable(player, GetName()) && player.getExp() > 0)

View File

@ -60,8 +60,8 @@ public class PerkIcePath extends Perk
if (!Recharge.Instance.use(player, GetName(), 12000, true, true)) if (!Recharge.Instance.use(player, GetName(), 12000, true, true))
return; return;
UtilAction.zeroVelocity(player); player.teleport(player.getLocation().add(0, 1, 0));
player.teleport(player.getLocation().add(0, 0.75, 0)); UtilAction.velocity(player, new Vector(0,0.5,0));
_data.add(new IcePathData(player)); _data.add(new IcePathData(player));

View File

@ -46,7 +46,8 @@ public class PerkInferno extends SmashPerk
if (!Kit.HasKit(player)) if (!Kit.HasKit(player))
continue; continue;
player.setExp((float) Math.min(0.999, player.getExp()+0.015)); if (!player.isBlocking())
player.setExp((float) Math.min(0.999, player.getExp()+0.025));
} }
} }
@ -105,7 +106,7 @@ public class PerkInferno extends SmashPerk
//Fire //Fire
Item fire = cur.getWorld().dropItem(cur.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.BLAZE_POWDER)); Item fire = cur.getWorld().dropItem(cur.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.BLAZE_POWDER));
Manager.GetFire().Add(fire, cur, 0.7, 0, 0.5, 1, "Inferno"); Manager.GetFire().Add(fire, cur, 0.7, 0, 0.5, 1.25, "Inferno");
fire.teleport(cur.getEyeLocation()); fire.teleport(cur.getEyeLocation());
double x = 0.07 - (UtilMath.r(14)/100d); double x = 0.07 - (UtilMath.r(14)/100d);

View File

@ -18,7 +18,11 @@ import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.projectile.IThrown; import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser; import mineplex.core.projectile.ProjectileUser;
@ -71,9 +75,10 @@ public class PerkInkBlast extends SmashPerk implements IThrown
UtilInv.Update(player); UtilInv.Update(player);
for (int i=0 ; i<7 ; i++) for (int i=0 ; i<8 ; i++)
{ {
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(Material.INK_SACK)); org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()),
ItemStackFactory.Instance.CreateStack(Material.INK_SACK, (byte)0, 1, "Ink" + Math.random()));
Vector random = new Vector(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5); Vector random = new Vector(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5);
random.normalize(); random.normalize();
@ -84,9 +89,9 @@ public class PerkInkBlast extends SmashPerk implements IThrown
UtilAction.velocity(ent, player.getLocation().getDirection().add(random), 1 + 0.4 * Math.random(), false, 0, 0.2, 10, false); UtilAction.velocity(ent, player.getLocation().getDirection().add(random), 1 + 0.4 * Math.random(), false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, true,
null, 1f, 1f, null, 1f, 1f,
Effect.SMOKE, 4, UpdateType.TICK, ParticleType.EXPLODE, UpdateType.TICK,
0.5f); 0.5f);
} }
@ -110,8 +115,8 @@ public class PerkInkBlast extends SmashPerk implements IThrown
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null,
DamageCause.PROJECTILE, 3, true, true, false, DamageCause.PROJECTILE, 3, true, true, false,
UtilEnt.getName(data.GetThrower()), GetName()); UtilEnt.getName(data.GetThrower()), GetName());
Manager.GetCondition().Factory().Blind(GetName(), target, data.GetThrower(), 1.5, 0, false, false, false); UtilParticle.PlayParticle(ParticleType.EXPLODE, target.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0, 12, ViewDist.LONG, UtilServer.getPlayers());
} }
@Override @Override

View File

@ -63,7 +63,7 @@ public class PerkIronHook extends Perk implements IThrown
UtilAction.velocity(item, player.getLocation().getDirection(), UtilAction.velocity(item, player.getLocation().getDirection(),
1.8, false, 0, 0.2, 10, false); 1.8, false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(item, player, this, -1, true, true, true, Manager.GetProjectile().AddThrow(item, player, this, -1, true, true, true, true,
Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, null, 0, UpdateType.TICK, 0.6f); Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, null, 0, UpdateType.TICK, 0.6f);
//Inform //Inform

View File

@ -151,7 +151,7 @@ public class PerkLazer extends Perk
if (other.equals(player)) if (other.equals(player))
continue; continue;
if (UtilMath.offset(newTarget, other.getLocation().add(0, 1, 0)) < 3) if (UtilMath.offset(newTarget, other.getLocation().add(0, 1, 0)) < 2.5)
{ {
hitPlayer = true; hitPlayer = true;
break; break;
@ -189,7 +189,7 @@ public class PerkLazer extends Perk
continue; continue;
//Do from center //Do from center
if (UtilMath.offset(target, other.getLocation().add(0, 1, 0)) < 3.5) if (UtilMath.offset(target, other.getLocation().add(0, 1, 0)) < 3)
{ {
//Damage Event //Damage Event
Manager.GetDamage().NewDamageEvent(other, player, null, Manager.GetDamage().NewDamageEvent(other, player, null,

View File

@ -57,7 +57,7 @@ public class PerkNeedler extends SmashPerk
if (!Kit.HasKit(player)) if (!Kit.HasKit(player))
return; return;
if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? 600 : 1800, !isSuperActive(player), !isSuperActive(player))) if (!Recharge.Instance.use(player, GetName(), isSuperActive(player) ? 600 : 2000, !isSuperActive(player), !isSuperActive(player)))
return; return;
_active.put(player, 8); _active.put(player, 8);

View File

@ -69,7 +69,7 @@ public class PerkPigBaconBomb extends SmashPerk
if (!Kit.HasKit(player)) if (!Kit.HasKit(player))
return; return;
float energy = 0.40f; float energy = 0.30f;
DisguiseBase disguise = Manager.GetDisguise().getDisguise(player); DisguiseBase disguise = Manager.GetDisguise().getDisguise(player);
if (disguise != null && disguise instanceof DisguisePigZombie) if (disguise != null && disguise instanceof DisguisePigZombie)

View File

@ -89,7 +89,7 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown
player.setExp(Math.max(0f, player.getExp() - energy)); player.setExp(Math.max(0f, player.getExp() - energy));
//Launch //Launch
Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.PORK)); Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.PORK, (byte) 0, 1, "Bacon"+System.currentTimeMillis()));
UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false); UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 0.4f); Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 0.4f);
ent.setPickupDelay(9999); ent.setPickupDelay(9999);

View File

@ -78,7 +78,7 @@ public class PerkSeismicSlam extends Perk
if (!Kit.HasKit(player)) if (!Kit.HasKit(player))
return; return;
if (!Recharge.Instance.use(player, GetName(), 6000, true, true)) if (!Recharge.Instance.use(player, GetName(), 7000, true, true))
return; return;
//Action //Action
@ -115,7 +115,7 @@ public class PerkSeismicSlam extends Perk
_live.remove(player); _live.remove(player);
//Action //Action
int damage = 11; int damage = 10;
double range = 8; double range = 8;
HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(player.getLocation(), range); HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(player.getLocation(), range);

View File

@ -195,7 +195,7 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown
UtilAction.velocity(slime, player.getLocation().getDirection(), 1 + charge/2d, false, 0, 0.2, 10, true); UtilAction.velocity(slime, player.getLocation().getDirection(), 1 + charge/2d, false, 0, 0.2, 10, true);
Manager.GetProjectile().AddThrow(slime, player, this, -1, true, true, true, Manager.GetProjectile().AddThrow(slime, player, this, -1, true, true, true, true,
null, 0, 0, null, 0, UpdateType.FASTEST, 1f); null, 0, 0, null, 0, UpdateType.FASTEST, 1f);
} }

View File

@ -93,7 +93,7 @@ public class PerkStormSquid extends SmashPerk
//Damage Event //Damage Event
Manager.GetDamage().NewDamageEvent(cur, player, null, Manager.GetDamage().NewDamageEvent(cur, player, null,
DamageCause.CUSTOM, 20 * targets.get(cur), false, true, false, DamageCause.CUSTOM, 16 * targets.get(cur), false, true, false,
player.getName(), GetName()); player.getName(), GetName());
//Velocity //Velocity

View File

@ -13,9 +13,12 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime; 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.core.recharge.Recharge;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
@ -93,8 +96,8 @@ public class PerkSuperSquid extends SmashPerk
UtilAction.velocity(cur, 0.6, 0.1, 1, true); UtilAction.velocity(cur, 0.6, 0.1, 1, true);
cur.getWorld().playSound(cur.getLocation(), Sound.SPLASH2, 0.2f, 1f); cur.getWorld().playSound(cur.getLocation(), Sound.SPLASH2, 0.5f, 1f);
cur.getWorld().playEffect(cur.getLocation(), Effect.STEP_SOUND, 8); UtilParticle.PlayParticle(ParticleType.SPLASH, cur.getLocation().add(0, 0.5, 0), 0.3f, 0.3f, 0.3f, 0, 60, ViewDist.LONG, UtilServer.getPlayers());
} }
} }

View File

@ -76,7 +76,7 @@ public class PerkWebShot extends SmashPerk implements IThrown
random.multiply(0.2); random.multiply(0.2);
UtilAction.velocity(ent, player.getLocation().getDirection().multiply(-1).add(random), 1 + Math.random() * 0.4, false, 0, 0.2, 10, false); UtilAction.velocity(ent, player.getLocation().getDirection().multiply(-1).add(random), 1 + Math.random() * 0.4, false, 0, 0.2, 10, false);
Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 0.5f); Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, true, 0.5f);
} }
//Inform //Inform

View File

@ -36,7 +36,8 @@ public class PerkWitherImage extends SmashPerk
{ {
super("Wither Image", new String[] super("Wither Image", new String[]
{ {
C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Wither Image" C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Wither Image",
C.cYellow + "Double Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Wither Swap"
}); });
} }
@ -105,7 +106,7 @@ public class PerkWitherImage extends SmashPerk
} }
else else
{ {
if (!Recharge.Instance.use(player, "Wither Swap", 1000, true, false)) if (!Recharge.Instance.use(player, "Wither Swap", 2000, true, false))
return; return;
Skeleton skel = _images.get(player); Skeleton skel = _images.get(player);

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