Final HH Update

This commit is contained in:
Chiss 2014-10-17 12:12:22 +11:00
parent 5db2c072a0
commit 727e137cc4
3 changed files with 137 additions and 62 deletions

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,
@ -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

@ -78,6 +78,8 @@ public class PumpkinKing extends CreatureBase<Skeleton>
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,27 +318,32 @@ public class PumpkinKing extends CreatureBase<Skeleton>
private void KingUpdateHealth() private void KingUpdateHealth()
{ {
for (Player player : UtilServer.getPlayers()) String text = "";
double percent = 0;
if (_shields.size() > 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)
{ {
double percent = (double)_shields.size() / (double)_shieldsMax; percent = (double)_minions.size() / (double)_minionsMax;
UtilDisplay.displayTextBar(Host.Manager.GetPlugin(), player, percent, C.cGreen + C.Bold + "Kill the Flame Shield"); text = C.cYellow + C.Bold + "Kill the Pumpkin Soldiers";
} }
else else
{ {
if (_minions.size() > 0) percent = GetEntity().getHealth()/GetEntity().getMaxHealth();
{ text = C.cGold + C.Bold + "Kill the Pumpkin King";
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");
}
} }
} }
for (Player player : UtilServer.getPlayers())
{
UtilDisplay.displayTextBar(Host.Manager.GetPlugin(), player, percent, text);
}
} }
private void KingDestroyBlocks() private void KingDestroyBlocks()
@ -395,12 +422,13 @@ 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;
@ -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);
} }
@ -451,7 +472,7 @@ 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
@ -690,7 +711,7 @@ 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);
} }

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"
}); });
} }