Gravity update
This commit is contained in:
parent
74474c6227
commit
f36d7774cc
@ -5,6 +5,7 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.FireworkEffect;
|
||||
import org.bukkit.Location;
|
||||
@ -41,6 +42,7 @@ 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.UtilTextMiddle;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
@ -95,7 +97,7 @@ public class Gravity extends SoloGame
|
||||
|
||||
_help = new String[]
|
||||
{
|
||||
"Push DROP to launch yourself off platforms.",
|
||||
"Drop Item to launch yourself off platforms.",
|
||||
"You automatically grab onto nearby platforms.",
|
||||
"Hold Block to use your Jetpack",
|
||||
"Your Experience Bar is your Jetpack Fuel",
|
||||
@ -137,10 +139,20 @@ public class Gravity extends SoloGame
|
||||
@EventHandler
|
||||
public void AnnounceBoost(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Live)
|
||||
return;
|
||||
if (event.GetState() == GameState.Prepare)
|
||||
{
|
||||
UtilTextMiddle.display(null, C.cGreen + "Drop Weapon" + C.cWhite + " to boost off Platforms", 0, 120, 0);
|
||||
|
||||
Bukkit.getScheduler().runTaskLater(Manager.getPlugin(), new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
UtilTextMiddle.display(null, C.cGreen + "Hold Block" + C.cWhite + " to use Jetpack", 0, 80, 5);
|
||||
}
|
||||
}, 120);
|
||||
}
|
||||
|
||||
Announce(C.Bold + C.cPurple + "Press " + C.Bold + C.cWhite + "DROP WEAPON" + C.Bold + C.cPurple + " to boost yourself off platforms!");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -161,8 +173,7 @@ public class Gravity extends SoloGame
|
||||
|
||||
if (!isInsideMap(o.Base.getLocation()))
|
||||
{
|
||||
o.Base.remove();
|
||||
oIter.remove();
|
||||
o.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@ -698,7 +709,8 @@ public class Gravity extends SoloGame
|
||||
{
|
||||
if (UtilMath.offset(player.getLocation(), _powerup) < 3)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Game", "You collected " + F.skill("Jetpack Fuel") + "!"));
|
||||
UtilTextMiddle.display(null, "Collected Jetpack Fuel", 0, 80, 5, player);
|
||||
|
||||
player.setExp(Math.min(0.9999f, player.getExp() + 0.25f));
|
||||
|
||||
player.getWorld().playSound(player.getLocation(), Sound.DRINK, 1f, 0.5f);
|
||||
|
@ -90,8 +90,8 @@ public abstract class GravityObject
|
||||
{
|
||||
if (this instanceof GravityPlayer)
|
||||
{
|
||||
Base.getWorld().playEffect(Ent.getLocation().subtract(0, 0.5, 0), Effect.FIREWORKS_SPARK, 0, 100);
|
||||
//UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, Ent.getLocation().subtract(0, 0.5, 0), 0, 0, 0, 0, 1);
|
||||
UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, Ent.getLocation().subtract(0, 0.5, 0), 0, 0, 0, 0, 1,
|
||||
ViewDist.MAX, UtilServer.getPlayers());
|
||||
}
|
||||
else if (this instanceof GravityBomb)
|
||||
{
|
||||
@ -221,4 +221,12 @@ public abstract class GravityObject
|
||||
Bat.setSitting(!moving);
|
||||
//Host.Manager.GetDisguise().updateDisguise(Bat);
|
||||
}
|
||||
|
||||
public void remove()
|
||||
{
|
||||
if (Base.getPassenger() != null)
|
||||
Base.getPassenger().remove();
|
||||
|
||||
Base.remove();
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ public class GravityDebris extends GravityObject
|
||||
super(host, ent, mass, 2, vel);
|
||||
|
||||
CollideDelay = System.currentTimeMillis() + 500;
|
||||
SetMovingBat(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.gravity.objects;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
@ -10,6 +11,7 @@ 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.UtilTextMiddle;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import nautilus.game.arcade.game.games.gravity.Gravity;
|
||||
@ -140,7 +142,10 @@ public class GravityPlayer extends GravityObject
|
||||
if (player.getExp() <= 0)
|
||||
{
|
||||
if (Recharge.Instance.use(player, "Fuel", 1000, false, false))
|
||||
UtilPlayer.message(Ent, F.main("Skill", "You have no more " + F.skill("Jetpack Fuel") + "."));
|
||||
{
|
||||
UtilTextMiddle.display(C.cRed + "Jetpack Empty", "Collect Fuel at Gold Blocks with Fireworks", 0, 80, 5, (Player)Ent);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -171,7 +176,8 @@ public class GravityPlayer extends GravityObject
|
||||
//Restore
|
||||
if (near)
|
||||
{
|
||||
UtilPlayer.message(Ent, F.main("Game", "Restoring Oxygen..."));
|
||||
UtilTextMiddle.display(null, "Refilling Oxygen...", 0, 60, 5, (Player)Ent);
|
||||
|
||||
Ent.getWorld().playSound(Ent.getLocation(), Sound.CAT_HISS, 0.2f, 0.5f);
|
||||
|
||||
Base.setHealth(Math.min(60, Base.getHealth() + 10));
|
||||
@ -189,8 +195,7 @@ public class GravityPlayer extends GravityObject
|
||||
DamageCause.CUSTOM, 2, false, true, false,
|
||||
"Oxygen Depleted", "Oxygen Depleted");
|
||||
|
||||
UtilPlayer.message(Ent, F.main("Game", "You are suffocating!"));
|
||||
UtilPlayer.message(Ent, F.main("Game", "Get more Oxygen from the Emerald Blocks!"));
|
||||
UtilTextMiddle.display(C.cRed + "Suffocating", "Refill Oxygen at Emerald Blocks", 0, 60, 5, (Player)Ent);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user