Halloween event changes final

This commit is contained in:
Chiss 2013-10-27 05:32:21 +11:00
parent 95449fec26
commit c9a295d56e
11 changed files with 52 additions and 30 deletions

View File

@ -207,21 +207,27 @@ public class Halloween extends SoloGame
if (_wave >= _waves.size()) if (_wave >= _waves.size())
{ {
for (Player player : GetPlayers(false)) for (Player player : GetPlayers(false))
{
Manager.GetDonation().PurchaseUnknownSalesPackage(null, player.getName(), "Pumpkin Kings Head", 0, true);
Manager.GetGame().AddGems(player, 30, "Killing the Pumpkin King", false); Manager.GetGame().AddGems(player, 30, "Killing the Pumpkin King", false);
Manager.GetGame().AddGems(player, 10, "Participation", false);
}
SetState(GameState.End); SetState(GameState.End);
SetCustomWinLine("You defeated the Pumpkin King!!!"); SetCustomWinLine("You earned Pumpkin Kings Head!");
AnnounceEnd(this.GetTeamList().get(0)); AnnounceEnd(this.GetTeamList().get(0));
return;
} }
if (GetPlayers(true).size() == 0) else if (GetPlayers(true).size() == 0)
{ {
for (Player player : GetPlayers(false))
{
Manager.GetGame().AddGems(player, 10, "Participation", false);
}
SetState(GameState.End); SetState(GameState.End);
SetCustomWinLine("The Pumpkin King is victorious again!"); SetCustomWinLine("You lost...");
AnnounceEnd(this.GetTeamList().get(1)); AnnounceEnd(this.GetTeamList().get(1));
return;
} }
} }
@ -270,7 +276,7 @@ public class Halloween extends SoloGame
if (player == null) return; if (player == null) return;
for (int i=0 ; i<event.GetDamage() ; i++) for (int i=0 ; i<event.GetDamage() ; i++)
Manager.GetGame().AddGems(player, 0.01, "Damage", true); Manager.GetGame().AddGems(player, 0.02, "Damage", true);
} }
public int GetMaxMobs() public int GetMaxMobs()
@ -282,6 +288,7 @@ public class Halloween extends SoloGame
private int _helpIndex = 0; private int _helpIndex = 0;
private String[] _help = new String[] private String[] _help = new String[]
{ {
C.cGreen + "Giants one hit kill you! Stay away!!!",
C.cAqua + "Work together with your team mates.", C.cAqua + "Work together with your team mates.",
C.cGreen + "Each kit gives a buff to nearby allies.", C.cGreen + "Each kit gives a buff to nearby allies.",
C.cAqua + "Kill monsters to keep their numbers down.", C.cAqua + "Kill monsters to keep their numbers down.",

View File

@ -29,8 +29,8 @@ public class MobGiant extends CreatureBase<Giant>
{ {
_tpLoc = ent.getLocation(); _tpLoc = ent.getLocation();
ent.setMaxHealth(400); ent.setMaxHealth(600);
ent.setHealth(400); ent.setHealth(600);
ent.setCustomName("Giant"); ent.setCustomName("Giant");
} }
@ -88,7 +88,7 @@ public class MobGiant extends CreatureBase<Giant>
_tpLoc.setPitch(UtilAlg.GetPitch(dir)); _tpLoc.setPitch(UtilAlg.GetPitch(dir));
_tpLoc.setYaw(UtilAlg.GetYaw(dir)); _tpLoc.setYaw(UtilAlg.GetYaw(dir));
double speed = Math.min(0.30, 0.10 + (GetEntity().getTicksLived() / 12000d)); double speed = Math.min(0.35, 0.1 + (GetEntity().getTicksLived() / 8000d));
_tpLoc.add(dir.multiply(speed)); _tpLoc.add(dir.multiply(speed));

View File

@ -81,7 +81,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
ent.setSkeletonType(SkeletonType.WITHER); ent.setSkeletonType(SkeletonType.WITHER);
ent.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN)); ent.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN));
ent.setMaxHealth(200); ent.setMaxHealth(500);
ent.setHealth(ent.getMaxHealth()); ent.setHealth(ent.getMaxHealth());
ent.getWorld().strikeLightningEffect(ent.getLocation()); ent.getWorld().strikeLightningEffect(ent.getLocation());
@ -195,6 +195,9 @@ public class PumpkinKing extends CreatureBase<Skeleton>
if (event.getType() == UpdateType.SLOW) if (event.getType() == UpdateType.SLOW)
KingTarget(); KingTarget();
if (event.getType() == UpdateType.TICK)
KingTrail();
//Shield //Shield
if (event.getType() == UpdateType.TICK) if (event.getType() == UpdateType.TICK)
@ -204,6 +207,15 @@ public class PumpkinKing extends CreatureBase<Skeleton>
ShieldSpawn(); ShieldSpawn();
} }
private void KingTrail()
{
if (GetState() >= 4)
{
//Particles
UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, GetEntity().getLocation().add(0, 1.5, 0), 0.2f, 0.4f, 0.2f, 0, 1);
}
}
private void KingTarget() private void KingTarget()
{ {
if (Math.random() > 0.25) if (Math.random() > 0.25)
@ -520,7 +532,6 @@ public class PumpkinKing extends CreatureBase<Skeleton>
GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.WITHER_HURT, 1f, 2f); GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.WITHER_HURT, 1f, 2f);
} }
for (int i=0 ; i<toSpawn ; i++) for (int i=0 ; i<toSpawn ; i++)
{ {
//Spawn //Spawn
@ -599,10 +610,10 @@ public class PumpkinKing extends CreatureBase<Skeleton>
//Target //Target
_minionTargets.put(minion, GetRandomPlayer()); _minionTargets.put(minion, GetRandomPlayer());
//Announce
Host.Announce(C.cAqua + C.Bold + "Kill the Pumpkin Minions!");
} }
//Announce
Host.Announce(C.cAqua + C.Bold + "Kill the Pumpkin Minions!");
} }
} }

View File

@ -15,7 +15,7 @@ public class Wave1 extends WaveBase
@Override @Override
public void Spawn(int tick) public void Spawn(int tick)
{ {
if (UtilTime.elapsed(_start, 15000)) if (UtilTime.elapsed(_start, 30000))
return; return;
if (Host.GetCreatures().size() > Host.GetMaxMobs()) if (Host.GetCreatures().size() > Host.GetMaxMobs())

View File

@ -16,7 +16,7 @@ public class Wave2 extends WaveBase
@Override @Override
public void Spawn(int tick) public void Spawn(int tick)
{ {
if (UtilTime.elapsed(_start, 15000)) if (UtilTime.elapsed(_start, 30000))
return; return;
if (tick == 0) if (tick == 0)

View File

@ -18,10 +18,10 @@ public class Wave3 extends WaveBase
if (Host.GetCreatures().size() > Host.GetMaxMobs()) if (Host.GetCreatures().size() > Host.GetMaxMobs())
return; return;
if (tick > 200 && tick % 10 == 0 && !UtilTime.elapsed(_start, 25000)) if (tick > 200 && tick % 10 == 0 && !UtilTime.elapsed(_start, 35000))
Host.AddCreature(new MobSpiderWebber(Host, GetSpawn())); Host.AddCreature(new MobSpiderWebber(Host, GetSpawn()));
if (tick % 10 == 0 && !UtilTime.elapsed(_start, 15000)) if (tick % 8 == 0 && !UtilTime.elapsed(_start, 25000))
Host.AddCreature(new MobSpiderLeaper(Host, GetSpawn())); Host.AddCreature(new MobSpiderLeaper(Host, GetSpawn()));
} }
} }

View File

@ -17,10 +17,10 @@ public class Wave4 extends WaveBase
@Override @Override
public void Spawn(int tick) public void Spawn(int tick)
{ {
if (UtilTime.elapsed(_start, 25000)) if (UtilTime.elapsed(_start, 30000))
return; return;
if (tick > 0 && tick % 100 == 0) if (tick > 0 && tick % 70 == 0)
{ {
Location loc = GetSpawn(); Location loc = GetSpawn();
loc.setY(30 + 20 * Math.random()); loc.setY(30 + 20 * Math.random());
@ -32,7 +32,7 @@ public class Wave4 extends WaveBase
if (Host.GetCreatures().size() > Host.GetMaxMobs()) if (Host.GetCreatures().size() > Host.GetMaxMobs())
return; return;
if (tick % 20 == 0) if (tick % 10 == 0)
Host.AddCreature(new MobPigZombie(Host, GetSpawn())); Host.AddCreature(new MobPigZombie(Host, GetSpawn()));
} }
} }

View File

@ -15,7 +15,7 @@ public class Wave5 extends WaveBase
@Override @Override
public void Spawn(int tick) public void Spawn(int tick)
{ {
if (UtilTime.elapsed(_start, 20000)) if (UtilTime.elapsed(_start, 30000))
return; return;
if (tick == 0) if (tick == 0)

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -63,6 +64,9 @@ public abstract class WaveBase
{ {
System.out.println("Wave " + wave + " has started."); System.out.println("Wave " + wave + " has started.");
Host.Announce(C.cRed + C.Bold + "Wave " + wave + ": " + C.cYellow + _name); Host.Announce(C.cRed + C.Bold + "Wave " + wave + ": " + C.cYellow + _name);
for (Player player : UtilServer.getPlayers())
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 2f, 1f);
} }
//Display //Display

View File

@ -25,17 +25,17 @@ public class WaveBoss extends WaveBase
} }
//Increasing difficulty of mobs //Increasing difficulty of mobs
if (Host.GetCreatures().size() < 20 + (tick/300) && !_king.IsFinal()) if (Host.GetCreatures().size() < 40 + (tick/200) && !_king.IsFinal())
{ {
if (tick % Math.max(5, 20 - tick/600) == 0) if (tick % Math.max(5, 15 - tick/400) == 0)
if (Math.random() > 0.10) if (Math.random() > 0.10)
Host.AddCreature(new MobZombie(Host, Host.GetRandomSpawn())); Host.AddCreature(new MobZombie(Host, Host.GetRandomSpawn()));
else else
Host.AddCreature(new MobCreeper(Host, Host.GetRandomSpawn())); Host.AddCreature(new MobCreeper(Host, Host.GetRandomSpawn()));
} }
//Giant every 2 minutes //Giant every 1.5 minutes
if (tick % 2400 == 0 && !_king.IsFinal()) if (tick % 1800 == 0 && !_king.IsFinal())
{ {
Host.AddCreature(new MobGiant(Host, GetSpawn())); Host.AddCreature(new MobGiant(Host, GetSpawn()));
} }

View File

@ -60,8 +60,8 @@ public class PerkSeismicHammer extends Perk
return; return;
//Action //Action
int damage = 10; int damage = 8;
double range = 10; double range = 8;
HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(player.getLocation(), range); HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(player.getLocation(), range);
for (LivingEntity cur : targets.keySet()) for (LivingEntity cur : targets.keySet())