Finalise update

This commit is contained in:
Sam 2018-07-31 16:56:44 +01:00 committed by Alexander Meech
parent e4e625dbfc
commit 7591f7da18
2 changed files with 46 additions and 42 deletions

View File

@ -20,6 +20,7 @@ import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.EulerAngle; import org.bukkit.util.EulerAngle;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
@ -45,7 +46,7 @@ public class ItemSortal extends ItemGadget
}; };
private static final double DIST_FACTOR_TICK = 0.5; private static final double DIST_FACTOR_TICK = 0.5;
private static final double DELTA_THETA = Math.PI / 10; private static final double DELTA_THETA = Math.PI / 10;
private static final int EXPLOSION_RADIUS = 8; private static final int EXPLOSION_RADIUS = 7;
private static final int PARTICLE_RATE = 5; private static final int PARTICLE_RATE = 5;
private static final int MAX_SWORD_TICKS = 150; private static final int MAX_SWORD_TICKS = 150;
@ -55,12 +56,14 @@ public class ItemSortal extends ItemGadget
{ {
super(manager, "Gate of Babylon", new String[] super(manager, "Gate of Babylon", new String[]
{ {
C.cGray + "A relic of ancient times,",
}, CostConstants.POWERPLAY_BONUS, Material.BONE, (byte) 0, TimeUnit.SECONDS.toMillis(1), null); C.cGray + "said to contain every weapon that has",
C.cGray + "ever existed."
}, CostConstants.POWERPLAY_BONUS, Material.BONE, (byte) 0, TimeUnit.SECONDS.toMillis(2), null);
_sortals = new HashSet<>(); _sortals = new HashSet<>();
// Free = false; Free = false;
setPPCYearMonth(YearMonth.of(2018, Month.AUGUST)); setPPCYearMonth(YearMonth.of(2018, Month.AUGUST));
} }
@ -70,6 +73,42 @@ public class ItemSortal extends ItemGadget
createAndFire(player, player.getLocation().add(0, 3, 0), 20); createAndFire(player, player.getLocation().add(0, 3, 0), 20);
} }
@EventHandler
public void adminCommand(PlayerCommandPreprocessEvent event)
{
Player player = event.getPlayer();
if (!event.getMessage().equalsIgnoreCase("/gil") || !player.isOp())
{
return;
}
event.setCancelled(true);
Location center = player.getLocation().add(0, 0.5, 0);
Manager.runSyncTimer(new BukkitRunnable()
{
int i = 0;
@Override
public void run()
{
if (i++ >= 25)
{
cancel();
return;
}
Vector direction = UtilAlg.getTrajectory(UtilMath.r(360), -UtilMath.r(60) - 20);
Location location = center.clone().add(direction.multiply(18));
location.setDirection(direction.multiply(-1));
createAndFire(player, location, 80 - (i * 2) + UtilMath.r(25));
}
}, 20, 2);
}
private void createAndFire(Player wielder, Location location, int delay) private void createAndFire(Player wielder, Location location, int delay)
{ {
Sortal sortal = new Sortal(wielder, location); Sortal sortal = new Sortal(wielder, location);
@ -104,42 +143,6 @@ public class ItemSortal extends ItemGadget
}, 0, 1); }, 0, 1);
} }
@EventHandler
public void command(PlayerCommandPreprocessEvent event)
{
Player player = event.getPlayer();
if (!event.getMessage().equalsIgnoreCase("/gil") || !player.isOp())
{
return;
}
event.setCancelled(true);
Location center = player.getLocation().add(0, 0.5, 0);
Manager.runSyncTimer(new BukkitRunnable()
{
int i = 0;
@Override
public void run()
{
if (i++ >= 25)
{
cancel();
return;
}
Vector direction = UtilAlg.getTrajectory(UtilMath.r(360), -UtilMath.r(60) - 20);
Location location = center.clone().add(direction.multiply(18));
location.setDirection(direction.multiply(-1));
createAndFire(player, location, 80 - (i * 2) + UtilMath.r(25));
}
}, 20, 2);
}
private class Sortal private class Sortal
{ {
@ -248,7 +251,7 @@ public class ItemSortal extends ItemGadget
} }
explode(true); explode(true);
sortal.explode(false); sortal.explode(true);
return; return;
} }
@ -263,7 +266,7 @@ public class ItemSortal extends ItemGadget
if (swordCollision) if (swordCollision)
{ {
UtilParticle.PlayParticleToAll(ParticleType.FIREWORKS_SPARK, location.add(0, 1, 0), null, 0.1F, 10, ViewDist.LONG); UtilParticle.PlayParticleToAll(ParticleType.FIREWORKS_SPARK, location.add(0, 1, 0), null, 0.1F, 10, ViewDist.LONG);
Point.getWorld().playSound(Point, Sound.ZOMBIE_REMEDY, 1, 0.5F); Point.getWorld().playSound(Point, Sound.ANVIL_LAND, 1, 0.5F);
} }
else else
{ {

View File

@ -52,6 +52,7 @@ public class PowerPlayClubRewards
.put(YearMonth.of(2018, Month.MAY), new UnknownSalesPackageItem("Windup")) .put(YearMonth.of(2018, Month.MAY), new UnknownSalesPackageItem("Windup"))
.put(YearMonth.of(2018, Month.JUNE), new UnknownSalesPackageItem("Chicken Taunt")) .put(YearMonth.of(2018, Month.JUNE), new UnknownSalesPackageItem("Chicken Taunt"))
.put(YearMonth.of(2018, Month.JULY), new UnknownSalesPackageItem("Clacker Boomerang")) .put(YearMonth.of(2018, Month.JULY), new UnknownSalesPackageItem("Clacker Boomerang"))
.put(YearMonth.of(2018, Month.AUGUST), new UnknownSalesPackageItem("Gate of Babylon"))
.build(); .build();
public interface PowerPlayClubItem public interface PowerPlayClubItem