Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex

This commit is contained in:
Jonathan Williams 2014-10-17 02:57:30 -05:00
commit 2bbb29c8bb
5 changed files with 172 additions and 62 deletions

View File

@ -0,0 +1,14 @@
package mineplex.core.pet.types;
import org.bukkit.entity.EntityType;
import mineplex.core.pet.Pet;
public class Pumpkin extends Pet
{
public Pumpkin()
{
super("Pumpling", EntityType.ZOMBIE, -1);
}
}

View File

@ -0,0 +1,21 @@
package mineplex.hub.commands;
import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.hub.HubManager;
public class GadgetToggle extends CommandBase<HubManager>
{
public GadgetToggle(HubManager plugin)
{
super(plugin, Rank.ADMIN, new String[] {"gadget"});
}
@Override
public void Execute(Player caller, String[] args)
{
Plugin.ToggleGadget(caller);
}
}

View File

@ -64,6 +64,24 @@ public class Halloween extends SoloGame
public long damage = 0; public long damage = 0;
public long target = 0; public long target = 0;
public long updateBossA = 0;
public long updateBossB = 0;
public long updateBossC = 0;
public long updateBossD = 0;
public long updateBossE = 0;
public long updateBossF = 0;
public long updateBossG = 0;
public long updateBossH = 0;
public long updateBossI = 0;
public long updateBossJ = 0;
public long updateBossK = 0;
public long updateBossL = 0;
public long updateBossM = 0;
public long updateBossN = 0;
public long updateBossO = 0;
public boolean bossDebug = false;
public Halloween(ArcadeManager manager) public Halloween(ArcadeManager manager)
{ {
super(manager, GameType.Halloween, super(manager, GameType.Halloween,
@ -116,7 +134,7 @@ public class Halloween extends SoloGame
_waves.add(new WaveVictory(this)); _waves.add(new WaveVictory(this));
//Make zombies break doors //Make zombies break doors
WorldData.World.setDifficulty(Difficulty.HARD); WorldData.World.setDifficulty(Difficulty.HARD);
} }
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
@ -171,6 +189,26 @@ public class Halloween extends SoloGame
System.out.println("Update Time: " + UtilTime.convertString(update, 4, TimeUnit.MILLISECONDS)); System.out.println("Update Time: " + UtilTime.convertString(update, 4, TimeUnit.MILLISECONDS));
System.out.println("Damage Time: " + UtilTime.convertString(damage, 4, TimeUnit.MILLISECONDS)); System.out.println("Damage Time: " + UtilTime.convertString(damage, 4, TimeUnit.MILLISECONDS));
System.out.println("Target Time: " + UtilTime.convertString(target, 4, TimeUnit.MILLISECONDS)); System.out.println("Target Time: " + UtilTime.convertString(target, 4, TimeUnit.MILLISECONDS));
if (bossDebug)
{
System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
System.out.println("Update Boss State: " + UtilTime.convertString(updateBossA, 4, TimeUnit.MILLISECONDS));
System.out.println("Update Boss Blocks: " + UtilTime.convertString(updateBossB, 4, TimeUnit.MILLISECONDS));
System.out.println("Update Boss Health: " + UtilTime.convertString(updateBossC, 4, TimeUnit.MILLISECONDS));
System.out.println("Update Boss Minion Orbit: " + UtilTime.convertString(updateBossD, 4, TimeUnit.MILLISECONDS));
System.out.println("Update Boss Minion Move: " + UtilTime.convertString(updateBossE, 4, TimeUnit.MILLISECONDS));
System.out.println("Update Boss Minion Attack: " + UtilTime.convertString(updateBossF, 4, TimeUnit.MILLISECONDS));
System.out.println("Update Boss Minion Arrow: " + UtilTime.convertString(updateBossG, 4, TimeUnit.MILLISECONDS));
System.out.println("Update Boss Minion Spawn: " + UtilTime.convertString(updateBossH, 4, TimeUnit.MILLISECONDS));
System.out.println("Update Boss King Control: " + UtilTime.convertString(updateBossI, 4, TimeUnit.MILLISECONDS));
System.out.println("Update Boss King Leap: " + UtilTime.convertString(updateBossJ, 4, TimeUnit.MILLISECONDS));
System.out.println("Update Boss King Bomb: " + UtilTime.convertString(updateBossK, 4, TimeUnit.MILLISECONDS));
System.out.println("Update Boss King Target: " + UtilTime.convertString(updateBossL, 4, TimeUnit.MILLISECONDS));
System.out.println("Update Boss King Trail: " + UtilTime.convertString(updateBossM, 4, TimeUnit.MILLISECONDS));
System.out.println("Update Boss Shield Orbit: " + UtilTime.convertString(updateBossN, 4, TimeUnit.MILLISECONDS));
System.out.println("Update Boss Shield Spawn: " + UtilTime.convertString(updateBossO, 4, TimeUnit.MILLISECONDS));
}
System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"); System.out.println("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
total = 0; total = 0;
@ -181,6 +219,22 @@ public class Halloween extends SoloGame
update = 0; update = 0;
damage = 0; damage = 0;
target = 0; target = 0;
updateBossA = 0;
updateBossB = 0;
updateBossC = 0;
updateBossD = 0;
updateBossE = 0;
updateBossF = 0;
updateBossG = 0;
updateBossH = 0;
updateBossI = 0;
updateBossJ = 0;
updateBossK = 0;
updateBossL = 0;
updateBossM = 0;
updateBossN = 0;
updateBossO = 0;
} }
@EventHandler @EventHandler
@ -499,7 +553,7 @@ public class Halloween extends SoloGame
{ {
PacketPlayOutNamedSoundEffect packet = new PacketPlayOutNamedSoundEffect(audio.getName(), PacketPlayOutNamedSoundEffect packet = new PacketPlayOutNamedSoundEffect(audio.getName(),
player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ(),
3f, 1F); 20f, 1F);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
} }

View File

@ -72,12 +72,14 @@ public class PumpkinKing extends CreatureBase<Skeleton>
private HashSet<Arrow> _arrows = new HashSet<Arrow>(); private HashSet<Arrow> _arrows = new HashSet<Arrow>();
private boolean _announcedHalfHealth = false; private boolean _announcedHalfHealth = false;
public PumpkinKing(Halloween game, Location loc) public PumpkinKing(Halloween game, Location loc)
{ {
super(game, null, Skeleton.class, loc); super(game, null, Skeleton.class, loc);
_kingLocation = loc; _kingLocation = loc;
game.bossDebug = true;
} }
@Override @Override
@ -168,54 +170,74 @@ public class PumpkinKing extends CreatureBase<Skeleton>
@Override @Override
public void Update(UpdateEvent event) public void Update(UpdateEvent event)
{ {
long start = System.currentTimeMillis();
//Main //Main
if (event.getType() == UpdateType.FASTER) if (event.getType() == UpdateType.FASTER)
StateUpdate(); StateUpdate();
Host.updateBossA += System.currentTimeMillis() - start;
start = System.currentTimeMillis();
if (event.getType() == UpdateType.FAST) if (event.getType() == UpdateType.FAST)
KingDestroyBlocks(); KingDestroyBlocks();
Host.updateBossB += System.currentTimeMillis() - start;
start = System.currentTimeMillis();
if (event.getType() == UpdateType.TICK) if (event.getType() == UpdateType.TICK)
KingUpdateHealth(); KingUpdateHealth();
Host.updateBossC += System.currentTimeMillis() - start;
start = System.currentTimeMillis();
//Minions //Minions
if (event.getType() == UpdateType.TICK) if (event.getType() == UpdateType.TICK)
MinionOrbit(); MinionOrbit();
Host.updateBossD += System.currentTimeMillis() - start;
start = System.currentTimeMillis();
if (event.getType() == UpdateType.FASTER) if (event.getType() == UpdateType.FASTER)
MinionAttack(); MinionMove();
Host.updateBossE += System.currentTimeMillis() - start;
start = System.currentTimeMillis();
if (event.getType() == UpdateType.TICK) if (event.getType() == UpdateType.TICK)
MinionAttackDamage(); MinionAttackDamage();
Host.updateBossF += System.currentTimeMillis() - start;
start = System.currentTimeMillis();
if (event.getType() == UpdateType.FASTEST) if (event.getType() == UpdateType.FASTEST)
MinionArrow(); MinionArrow();
Host.updateBossG += System.currentTimeMillis() - start;
start = System.currentTimeMillis();
if (event.getType() == UpdateType.FAST) if (event.getType() == UpdateType.FAST)
MinionSpawn(); MinionSpawn();
Host.updateBossH += System.currentTimeMillis() - start;
start = System.currentTimeMillis();
//Final //Final
if (event.getType() == UpdateType.FAST) if (event.getType() == UpdateType.FAST)
KingControl(); KingControl();
Host.updateBossI += System.currentTimeMillis() - start;
start = System.currentTimeMillis();
if (event.getType() == UpdateType.SEC) if (event.getType() == UpdateType.SEC)
KingLeap(); KingLeap();
Host.updateBossJ += System.currentTimeMillis() - start;
start = System.currentTimeMillis();
if (event.getType() == UpdateType.SEC) if (event.getType() == UpdateType.SEC)
KingBomb(); KingBomb();
Host.updateBossK += System.currentTimeMillis() - start;
start = System.currentTimeMillis();
if (event.getType() == UpdateType.SEC) if (event.getType() == UpdateType.SEC)
KingTarget(); KingTarget();
Host.updateBossL += System.currentTimeMillis() - start;
start = System.currentTimeMillis();
if (event.getType() == UpdateType.TICK) if (event.getType() == UpdateType.TICK)
KingTrail(); KingTrail();
Host.updateBossM += System.currentTimeMillis() - start;
start = System.currentTimeMillis();
//Shield //Shield
if (event.getType() == UpdateType.TICK) if (event.getType() == UpdateType.TICK)
ShieldOrbit(false); ShieldOrbit(false);
Host.updateBossN += System.currentTimeMillis() - start;
start = System.currentTimeMillis();
if (event.getType() == UpdateType.FAST) if (event.getType() == UpdateType.FAST)
ShieldSpawn(); ShieldSpawn();
Host.updateBossO += System.currentTimeMillis() - start;
start = System.currentTimeMillis();
} }
@ -296,26 +318,31 @@ public class PumpkinKing extends CreatureBase<Skeleton>
private void KingUpdateHealth() private void KingUpdateHealth()
{ {
String text = "";
double percent = 0;
if (_shields.size() > 0)
{
percent = (double)_shields.size() / (double)_shieldsMax;
text = C.cGreen + C.Bold + "Kill the Flame Shield";
}
else
{
if (_minions.size() > 0)
{
percent = (double)_minions.size() / (double)_minionsMax;
text = C.cYellow + C.Bold + "Kill the Pumpkin Soldiers";
}
else
{
percent = GetEntity().getHealth()/GetEntity().getMaxHealth();
text = C.cGold + C.Bold + "Kill the Pumpkin King";
}
}
for (Player player : UtilServer.getPlayers()) for (Player player : UtilServer.getPlayers())
{ {
if (_shields.size() > 0) UtilDisplay.displayTextBar(Host.Manager.GetPlugin(), player, percent, text);
{
double percent = (double)_shields.size() / (double)_shieldsMax;
UtilDisplay.displayTextBar(Host.Manager.GetPlugin(), player, percent, C.cGreen + C.Bold + "Kill the Flame Shield");
}
else
{
if (_minions.size() > 0)
{
double percent = (double)_minions.size() / (double)_minionsMax;
UtilDisplay.displayTextBar(Host.Manager.GetPlugin(), player, percent, C.cYellow + C.Bold + "Kill the Pumpkin Soldiers");
}
else
{
double percent = GetEntity().getHealth()/GetEntity().getMaxHealth();
UtilDisplay.displayTextBar(Host.Manager.GetPlugin(), player, percent, C.cGold + C.Bold + "Kill the Pumpkin King");
}
}
} }
} }
@ -344,7 +371,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
Host.CreatureAllowOverride = true; Host.CreatureAllowOverride = true;
Skeleton skel = GetEntity().getWorld().spawn(GetEntity().getLocation(), Skeleton.class); Skeleton skel = GetEntity().getWorld().spawn(GetEntity().getLocation(), Skeleton.class);
Host.CreatureAllowOverride = false; Host.CreatureAllowOverride = false;
Host.Manager.GetCondition().Factory().Invisible("Cloak", skel, skel, 999999, 0, false, false, false); Host.Manager.GetCondition().Factory().Invisible("Cloak", skel, skel, 999999, 0, false, false, false);
skel.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN)); skel.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN));
@ -357,7 +384,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
UtilEnt.Vegetate(skel); UtilEnt.Vegetate(skel);
} }
_minionSpawn = false; _minionSpawn = false;
} }
@ -371,7 +398,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
Skeleton minion = _minions.get(i); Skeleton minion = _minions.get(i);
UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, minion.getEyeLocation(), 0.1f, 0.1f, 0.1f, 0, 1); UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, minion.getEyeLocation(), 0.1f, 0.1f, 0.1f, 0, 1);
minion.setTarget(null); minion.setTarget(null);
double lead = i * ((2d * Math.PI)/_minions.size()); double lead = i * ((2d * Math.PI)/_minions.size());
@ -395,19 +422,20 @@ public class PumpkinKing extends CreatureBase<Skeleton>
loc.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(GetEntity(), minion))); loc.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(GetEntity(), minion)));
//Move //Move
EntityCreature ec = ((CraftCreature)minion).getHandle(); UtilEnt.CreatureMoveFast(minion, loc, 1.4f);
ec.getControllerMove().a(loc.getX(), loc.getY(), loc.getZ(), 1.4); // EntityCreature ec = ((CraftCreature)minion).getHandle();
// ec.getControllerMove().a(loc.getX(), loc.getY(), loc.getZ(), 1.4);
} }
} }
public void MinionAttack() public void MinionMove()
{ {
if (GetState() != 3) if (GetState() != 3)
return; return;
if (_minions.isEmpty()) if (_minions.isEmpty())
return; return;
Skeleton minion = _minions.remove(0); Skeleton minion = _minions.remove(0);
LivingEntity target = _minionTargets.get(minion); LivingEntity target = _minionTargets.get(minion);
@ -416,14 +444,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
minion.setTarget(target); minion.setTarget(target);
Location loc = target.getLocation().add(UtilAlg.getTrajectory(target, minion).multiply(1)); UtilEnt.CreatureMove(minion, target.getLocation(), 1f);
if (UtilMath.offset(loc, minion.getLocation()) > 12)
loc = minion.getLocation().add(UtilAlg.getTrajectory(minion.getLocation(), loc).multiply(12));
//Move
EntityCreature ec = ((CraftCreature)minion).getHandle();
Navigation nav = ec.getNavigation();
nav.a(loc.getX(), loc.getY(), loc.getZ(), 1f);
_minions.add(minion); _minions.add(minion);
} }
@ -436,7 +457,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
for (int i=0 ; i<_minions.size() ; i++) for (int i=0 ; i<_minions.size() ; i++)
{ {
final Skeleton minion = _minions.get(i); final Skeleton minion = _minions.get(i);
UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, minion.getEyeLocation(), 0.1f, 0.1f, 0.1f, 0, 1); UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, minion.getEyeLocation(), 0.1f, 0.1f, 0.1f, 0, 1);
LivingEntity target = _minionTargets.get(minion); LivingEntity target = _minionTargets.get(minion);
@ -451,13 +472,13 @@ public class PumpkinKing extends CreatureBase<Skeleton>
//Damage Event //Damage Event
Host.Manager.GetDamage().NewDamageEvent(target, minion, null, Host.Manager.GetDamage().NewDamageEvent(target, minion, null,
DamageCause.ENTITY_ATTACK, 3, true, true, false, DamageCause.ENTITY_ATTACK, 4, true, false, false,
UtilEnt.getName(minion), GetName()); UtilEnt.getName(minion), GetName());
//Sound //Sound
minion.getWorld().playSound(minion.getLocation(), Sound.ENDERMAN_SCREAM, 2f, 2f); minion.getWorld().playSound(minion.getLocation(), Sound.ENDERMAN_SCREAM, 2f, 2f);
minion.getWorld().playSound(minion.getLocation(), Sound.ENDERMAN_SCREAM, 2f, 2f); minion.getWorld().playSound(minion.getLocation(), Sound.ENDERMAN_SCREAM, 2f, 2f);
//Visual Start //Visual Start
minion.getEquipment().setHelmet(new ItemStack(Material.JACK_O_LANTERN)); minion.getEquipment().setHelmet(new ItemStack(Material.JACK_O_LANTERN));
@ -571,7 +592,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
{ {
if (GetState() == 3 || GetState() == 4) if (GetState() == 3 || GetState() == 4)
return; return;
Iterator<Entity> shieldIterator = _shields.iterator(); Iterator<Entity> shieldIterator = _shields.iterator();
while (shieldIterator.hasNext()) while (shieldIterator.hasNext())
{ {
@ -667,7 +688,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
_state = state; _state = state;
_stateTime = System.currentTimeMillis(); _stateTime = System.currentTimeMillis();
if (state == 3) if (state == 3)
{ {
//Update Gear //Update Gear
@ -690,11 +711,11 @@ public class PumpkinKing extends CreatureBase<Skeleton>
//Announce //Announce
Host.Announce(C.cAqua + C.Bold + "Kill the Pumpkin Minions!"); Host.Announce(C.cAqua + C.Bold + "Kill the Pumpkin Minions!");
MinionAttack(); MinionMove();
Host.playSound(HalloweenAudio.BOSS_STAGE_MINION_ATTACK); Host.playSound(HalloweenAudio.BOSS_STAGE_MINION_ATTACK);
} }
if (state == 4) if (state == 4)
{ {
Host.playSound(HalloweenAudio.BOSS_STAGE_FINAL); Host.playSound(HalloweenAudio.BOSS_STAGE_FINAL);
@ -748,7 +769,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
} }
ShieldSpawn(); ShieldSpawn();
Host.playSound(HalloweenAudio.BOSS_STAGE_SHIELD_RESTORE); Host.playSound(HalloweenAudio.BOSS_STAGE_SHIELD_RESTORE);
_minionTargets.clear(); _minionTargets.clear();
@ -763,7 +784,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
Host.playSound(HalloweenAudio.BOSS_STAGE_FINAL_HALF_DEAD); Host.playSound(HalloweenAudio.BOSS_STAGE_FINAL_HALF_DEAD);
_announcedHalfHealth = true; _announcedHalfHealth = true;
} }
} }
} }

View File

@ -37,9 +37,9 @@ public class PerkFlameSlam extends Perk
public PerkFlameSlam() public PerkFlameSlam()
{ {
super("Flame Slam", new String[] super("Flame Charge", new String[]
{ {
C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Flame Slam" C.cYellow + "Right-Click" + C.cGray + " with Axe to " + C.cGreen + "Flame Charge"
}); });
} }