Halloween update

This commit is contained in:
Chiss 2014-10-16 16:27:09 +11:00
parent c30171d24f
commit 5db2c072a0
21 changed files with 238 additions and 82 deletions

View File

@ -150,6 +150,11 @@ public class MapUtil
((CraftWorld) world).getHandle().notify(x, y, z);
}
}
public static void ChunkBlockSet(World world, int x, int y, int z, int id, byte data, boolean notifyPlayers)
{
world.getBlockAt(x, y, z).setTypeIdAndData(id, data, notifyPlayers);
}
private static boolean changeChunkBlock(int x, int y, int z, net.minecraft.server.v1_7_R4.Chunk chunk, Block block,
byte data)

View File

@ -139,21 +139,21 @@ public class UtilText
if (align == TextAlign.CENTER)
for (int i=-64 ; i<=64 ; i++)
{
MapUtil.ChunkBlockChange(world, bX + i * face.getModX(), bY + i * face.getModY(), bZ + i * face.getModZ(), 0, (byte)0, true);
MapUtil.ChunkBlockSet(world, bX + i * face.getModX(), bY + i * face.getModY(), bZ + i * face.getModZ(), 0, (byte)0, true);
}
if (align == TextAlign.LEFT)
for (int i=0 ; i<=128 ; i++)
{
MapUtil.ChunkBlockChange(world, bX + i * face.getModX(), bY + i * face.getModY(), bZ + i * face.getModZ(), 0, (byte)0, true);
MapUtil.ChunkBlockSet(world, bX + i * face.getModX(), bY + i * face.getModY(), bZ + i * face.getModZ(), 0, (byte)0, true);
}
if (align == TextAlign.RIGHT)
for (int i=-128 ; i<=0 ; i++)
{
MapUtil.ChunkBlockChange(world, bX + i * face.getModX(), bY + i * face.getModY(), bZ + i * face.getModZ(), 0, (byte)0, true);
MapUtil.ChunkBlockSet(world, bX + i * face.getModX(), bY + i * face.getModY(), bZ + i * face.getModZ(), 0, (byte)0, true);
}
@ -181,7 +181,7 @@ public class UtilText
if (letter[x][y] == 1)
{
changes.add(world.getBlockAt(bX, bY, bZ));
MapUtil.ChunkBlockChange(world, bX, bY, bZ, id, data, true);
MapUtil.ChunkBlockSet(world, bX, bY, bZ, id, data, true);
}
//Forward

View File

@ -332,7 +332,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
if (_shuttingDown)
{
event.setMotd("Restarting soon");
}
}
}
public boolean BumpDisabled(Entity ent)

View File

@ -6,6 +6,7 @@ import mineplex.core.common.util.UtilText.TextAlign;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.hub.HubManager;
import mineplex.hub.HubType;
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
@ -29,7 +30,7 @@ public class TextManager extends MiniPlugin
int arcadeIndex = 0;
int smashIndex = 0;
public TextManager(HubManager manager)
{
super("Text Creator", manager.GetPlugin());
@ -55,55 +56,55 @@ public class TextManager extends MiniPlugin
{
//Comp
UtilText.MakeText("CHAMPIONS", locComp, faceComp, 159, (byte)5, TextAlign.CENTER);
UtilText.MakeText("CHAMPIONS", locComp.clone().add(1, 0, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("CHAMPIONS", locComp.clone().add(1, 0, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("DOMINATE", locComp.clone().add(15, 14, 0), faceComp, 159, (byte)4, TextAlign.CENTER);
UtilText.MakeText("DOMINATE", locComp.clone().add(16, 14, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("DOMINATE", locComp.clone().add(16, 14, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("TEAM DEATHMATCH", locComp.clone().add(15, 21, 0), faceComp, 159, (byte)1, TextAlign.CENTER);
UtilText.MakeText("TEAM DEATHMATCH", locComp.clone().add(16, 21, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("TEAM DEATHMATCH", locComp.clone().add(16, 21, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
//UtilText.MakeText("CAPTURE THE PIG", locComp.clone().add(15, 28, 0), faceComp, 159, (byte)14, TextAlign.CENTER);
//UtilText.MakeText("CAPTURE THE PIG", locComp.clone().add(16, 28, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
//UtilText.MakeText("CAPTURE THE PIG", locComp.clone().add(16, 28, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
//Arcade
UtilText.MakeText("ARCADE", locArcade, faceArcade, 159, (byte)5, TextAlign.CENTER);
UtilText.MakeText("ARCADE", locArcade.clone().add(0, 0, 1), faceArcade, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("ARCADE", locArcade.clone().add(0, 0, 1), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 15), faceArcade, 159, (byte)4, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 16), faceArcade, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 15), faceArcade, 159, (byte)1, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 16), faceArcade, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 15), faceArcade, 159, (byte)14, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 16), faceArcade, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
//Survival
UtilText.MakeText("SURVIVAL", locSurvival, faceSurvival, 159, (byte)5, TextAlign.CENTER);
UtilText.MakeText("SURVIVAL", locSurvival.clone().add(-1, 0, 0), faceSurvival, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("SURVIVAL", locSurvival.clone().add(-1, 0, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("THE BRIDGES", locSurvival.clone().add(-15, 14, 0), faceSurvival, 159, (byte)4, TextAlign.CENTER);
UtilText.MakeText("THE BRIDGES", locSurvival.clone().add(-16, 14, 0), faceSurvival, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("THE BRIDGES", locSurvival.clone().add(-16, 14, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("SURVIVAL GAMES", locSurvival.clone().add(-15, 21, 0), faceSurvival, 159, (byte)1, TextAlign.CENTER);
UtilText.MakeText("SURVIVAL GAMES", locSurvival.clone().add(-16, 21, 0), faceSurvival, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("SURVIVAL GAMES", locSurvival.clone().add(-16, 21, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("ULTRA HARDCORE", locSurvival.clone().add(-15, 28, 0), faceSurvival, 159, (byte)14, TextAlign.CENTER);
UtilText.MakeText("ULTRA HARDCORE", locSurvival.clone().add(-16, 28, 0), faceSurvival, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("ULTRA HARDCORE", locSurvival.clone().add(-16, 28, 0), faceSurvival, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
//Other
UtilText.MakeText("CLASSICS", locClassics, faceOther, 159, (byte)5, TextAlign.CENTER);
UtilText.MakeText("CLASSICS", locClassics.add(0, 0, -1), faceOther, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("CLASSICS", locClassics.add(0, 0, -1), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -15), faceOther, 159, (byte)4, TextAlign.CENTER);
UtilText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -16), faceOther, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -16), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("MINE STRIKE", locClassics.clone().add(0, 21, -15), faceOther, 159, (byte)1, TextAlign.CENTER);
UtilText.MakeText("MINE STRIKE", locClassics.clone().add(0, 21, -16), faceOther, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("MINE STRIKE", locClassics.clone().add(0, 21, -16), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("BLOCK HUNT", locClassics.clone().add(0, 28, -15), faceOther, 159, (byte)14, TextAlign.CENTER);
UtilText.MakeText("BLOCK HUNT", locClassics.clone().add(0, 28, -16), faceOther, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("BLOCK HUNT", locClassics.clone().add(0, 28, -16), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
}
/*
@ -114,13 +115,13 @@ public class TextManager extends MiniPlugin
return;
UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 15), faceArcade, 159, (byte)4, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 16), faceArcade, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(0), locArcade.clone().add(0, 14, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 15), faceArcade, 159, (byte)1, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 16), faceArcade, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(1), locArcade.clone().add(0, 21, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 15), faceArcade, 159, (byte)14, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 16), faceArcade, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText(GetArcadeText(2), locArcade.clone().add(0, 28, 16), faceArcade, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
arcadeIndex = (arcadeIndex + 3)%arcadeGames.length;
}
@ -148,13 +149,13 @@ public class TextManager extends MiniPlugin
if (smashIndex == 1) color = 0;
//UtilText.MakeText("SUPER SMASH MOBS", locOther, faceOther, 159, color, TextAlign.CENTER);
//UtilText.MakeText("SUPER SMASH MOBS", locOther.clone().add(0, 0, -1), faceOther, 159, (byte)15, TextAlign.CENTER);
//UtilText.MakeText("SUPER SMASH MOBS", locOther.clone().add(0, 0, -1), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -15), faceOther, 159, color, TextAlign.CENTER);
UtilText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -16), faceOther, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("SUPER SMASH MOBS", locClassics.clone().add(0, 14, -16), faceOther, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
UtilText.MakeText("DOMINATE", locComp.clone().add(15, 14, 0), faceComp, 159, color, TextAlign.CENTER);
UtilText.MakeText("DOMINATE", locComp.clone().add(16, 14, 0), faceComp, 159, (byte)15, TextAlign.CENTER);
UtilText.MakeText("DOMINATE", locComp.clone().add(16, 14, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER);
//System.out.println("TextCreator : " + (System.currentTimeMillis() - startTime) + "ms");
}
*/

View File

@ -25,6 +25,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Boat;
@ -278,6 +279,22 @@ public class WorldManager extends MiniPlugin
}
}
@EventHandler
public void SoundUpdate(UpdateEvent event)
{
if (Manager.Type != HubType.Halloween)
return;
if (event.getType() != UpdateType.SLOW)
return;
if (Math.random() > 0.1)
return;
for (Player player : UtilServer.getPlayers())
player.playSound(player.getLocation(), Sound.AMBIENCE_CAVE, 3f, 1f);
}
@EventHandler
public void BlockForm(BlockFormEvent event)
{

View File

@ -1,8 +1,5 @@
package nautilus.game.arcade.game.games.halloween;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@ -14,6 +11,7 @@ import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@ -21,13 +19,14 @@ import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityTargetEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilWorld;
import mineplex.core.common.util.UtilTime.TimeUnit;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
@ -41,6 +40,7 @@ import nautilus.game.arcade.game.games.halloween.creatures.*;
import nautilus.game.arcade.game.games.halloween.kits.*;
import nautilus.game.arcade.game.games.halloween.waves.*;
import nautilus.game.arcade.kit.Kit;
import net.minecraft.server.v1_7_R4.PacketPlayOutNamedSoundEffect;
public class Halloween extends SoloGame
{
@ -53,6 +53,8 @@ public class Halloween extends SoloGame
private int _maxMobs = 80;
private ArrayList<CreatureBase> _mobs = new ArrayList<CreatureBase>();
private HashSet<Player> _soundOff = new HashSet<Player>();
public long total = 0;
public long move = 0;
public int moves = 0;
@ -138,6 +140,15 @@ public class Halloween extends SoloGame
GetTeamList().add(new GameTeam(this, "Pumpkin King", ChatColor.RED, WorldData.GetDataLocs("RED")));
}
@EventHandler(priority = EventPriority.MONITOR)
public void VoiceCommand(GameStateChangeEvent event)
{
if (event.GetState() != GameState.Live)
return;
Announce(C.Bold + "Type " + C.cGreen + C.Bold + "/voice" + C.cWhite + C.Bold + " to disable voice audio.");
}
@EventHandler(priority = EventPriority.MONITOR)
public void TimeReport(UpdateEvent event)
@ -337,6 +348,8 @@ public class Halloween extends SoloGame
else if (GetPlayers(true).size() == 0)
{
playSound(HalloweenAudio.BOSS_WIN);
for (Player player : GetPlayers(false))
{
Manager.GetGame().AddGems(player, 10, "Participation", false);
@ -434,7 +447,7 @@ public class Halloween extends SoloGame
//Rounds
Scoreboard.WriteBlank();
Scoreboard.Write(C.cYellow + "Wave");
Scoreboard.Write(_wave + " of 6");
Scoreboard.Write((_wave+1) + " of 6");
Scoreboard.WriteBlank();
Scoreboard.Write(C.cYellow + "Monsters");
@ -458,4 +471,37 @@ public class Halloween extends SoloGame
Scoreboard.Draw();
}
@EventHandler
public void soundOff(PlayerCommandPreprocessEvent event)
{
if (event.getMessage().equalsIgnoreCase("/voice"))
{
if (_soundOff.remove(event.getPlayer()))
{
UtilPlayer.message(event.getPlayer(), C.Bold + "Voice Audio: " + C.cGreen + "Enabled");
}
else
{
_soundOff.add(event.getPlayer());
UtilPlayer.message(event.getPlayer(), C.Bold + "Voice Audio: " + C.cRed + "Disabled");
}
event.setCancelled(true);
}
}
public void playSound(HalloweenAudio audio)
{
for (Player player : UtilServer.getPlayers())
if (!_soundOff.contains(player))
{
PacketPlayOutNamedSoundEffect packet = new PacketPlayOutNamedSoundEffect(audio.getName(),
player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ(),
3f, 1F);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
}
}
}

View File

@ -0,0 +1,32 @@
package nautilus.game.arcade.game.games.halloween;
public enum HalloweenAudio
{
WAVE_1("halloween.wave1"),
WAVE_2("halloween.wave2"),
WAVE_3("halloween.wave3"),
WAVE_4("halloween.wave4"),
WAVE_5("halloween.wave5"),
WAVE_6("halloween.wave6"),
BOSS_SPAWN("halloween.boss_spawn"),
BOSS_LOSE("halloween.boss_lose"),
BOSS_WIN("halloween.boss_win"),
BOSS_STAGE_MINION_ATTACK("halloween.boss_minion"),
BOSS_STAGE_SHIELD_RESTORE("halloween.boss_shield"),
BOSS_STAGE_FINAL("halloween.boss_final"),
BOSS_STAGE_FINAL_HALF_DEAD("halloween.boss_final_taunt");
private String _name;
HalloweenAudio(String name)
{
_name = name;
}
public String getName()
{
return _name;
}
}

View File

@ -23,6 +23,7 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.halloween.Halloween;
import nautilus.game.arcade.game.games.halloween.HalloweenAudio;
import net.minecraft.server.v1_7_R4.EntityArrow;
import net.minecraft.server.v1_7_R4.EntityCreature;
import net.minecraft.server.v1_7_R4.Navigation;
@ -70,6 +71,8 @@ public class PumpkinKing extends CreatureBase<Skeleton>
private HashSet<Arrow> _arrows = new HashSet<Arrow>();
private boolean _announcedHalfHealth = false;
public PumpkinKing(Halloween game, Location loc)
{
super(game, null, Skeleton.class, loc);
@ -401,10 +404,10 @@ public class PumpkinKing extends CreatureBase<Skeleton>
{
if (GetState() != 3)
return;
if (_minions.isEmpty())
return;
Skeleton minion = _minions.remove(0);
LivingEntity target = _minionTargets.get(minion);
@ -568,7 +571,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
{
if (GetState() == 3 || GetState() == 4)
return;
Iterator<Entity> shieldIterator = _shields.iterator();
while (shieldIterator.hasNext())
{
@ -664,6 +667,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
_state = state;
_stateTime = System.currentTimeMillis();
if (state == 3)
{
//Update Gear
@ -677,7 +681,7 @@ public class PumpkinKing extends CreatureBase<Skeleton>
Host.Manager.GetCondition().Factory().Speed("Minion Speed", minion, minion, 15, 0, false, false, false);
//Sound
GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.WITHER_SPAWN, 10f, 1.5f);
//GetEntity().getWorld().playSound(GetEntity().getLocation(), Sound.WITHER_SPAWN, 1f, 1.5f);
//Target
_minionTargets.put(minion, GetRandomPlayer());
@ -687,6 +691,13 @@ public class PumpkinKing extends CreatureBase<Skeleton>
Host.Announce(C.cAqua + C.Bold + "Kill the Pumpkin Minions!");
MinionAttack();
Host.playSound(HalloweenAudio.BOSS_STAGE_MINION_ATTACK);
}
if (state == 4)
{
Host.playSound(HalloweenAudio.BOSS_STAGE_FINAL);
}
}
@ -737,10 +748,24 @@ public class PumpkinKing extends CreatureBase<Skeleton>
}
ShieldSpawn();
Host.playSound(HalloweenAudio.BOSS_STAGE_SHIELD_RESTORE);
_minionTargets.clear();
}
}
else if (GetState() == 4)
{
if (!_announcedHalfHealth)
{
if (GetEntity().getHealth() < GetEntity().getMaxHealth()/2)
{
Host.playSound(HalloweenAudio.BOSS_STAGE_FINAL_HALF_DEAD);
_announcedHalfHealth = true;
}
}
}
//Skeleton Scatter
if (GetState() != 3 && UtilTime.elapsed(_stateTime, 2000))

View File

@ -36,7 +36,7 @@ public class KitFinn extends SmashKit
new PerkFlameSlam(),
new PerkBlizzardFinn(),
new PerkFletcher(1, 4, true),
new PerkFletcher(2, 2, true),
},
EntityType.ZOMBIE, new ItemStack(Material.GOLD_SWORD));

View File

@ -35,7 +35,7 @@ public class KitThor extends SmashKit
new Perk[]
{
new PerkKnockbackAttack(2),
new PerkFletcher(1, 4, true),
new PerkFletcher(2, 2, true),
new PerkSeismicHammer(),
new PerkHammerThrow(),
},

View File

@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.halloween.waves;
import mineplex.core.common.util.UtilTime;
import nautilus.game.arcade.game.games.halloween.Halloween;
import nautilus.game.arcade.game.games.halloween.HalloweenAudio;
import nautilus.game.arcade.game.games.halloween.creatures.MobSkeletonArcher;
import nautilus.game.arcade.game.games.halloween.creatures.MobSkeletonWarrior;
@ -9,7 +10,7 @@ public class Wave1 extends WaveBase
{
public Wave1(Halloween host)
{
super(host, "Skeletons? Farmers? FARMER SKELETONS!!!", 60000, host.GetSpawnSet(1));
super(host, "Skeletons? Farmers? FARMER SKELETONS!!!", 60000, host.GetSpawnSet(1), HalloweenAudio.WAVE_1);
}
@Override

View File

@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.halloween.waves;
import mineplex.core.common.util.UtilTime;
import nautilus.game.arcade.game.games.halloween.Halloween;
import nautilus.game.arcade.game.games.halloween.HalloweenAudio;
import nautilus.game.arcade.game.games.halloween.creatures.MobCreeper;
import nautilus.game.arcade.game.games.halloween.creatures.MobGiant;
import nautilus.game.arcade.game.games.halloween.creatures.MobZombie;
@ -10,7 +11,7 @@ public class Wave2 extends WaveBase
{
public Wave2(Halloween host)
{
super(host, "A GIANT!? Better kill that guy fast!", 65000, host.GetSpawnSet(0));
super(host, "Giant Zombie is here to smash your brains!", 65000, host.GetSpawnSet(0), HalloweenAudio.WAVE_2);
}
@Override

View File

@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.halloween.waves;
import mineplex.core.common.util.UtilTime;
import nautilus.game.arcade.game.games.halloween.Halloween;
import nautilus.game.arcade.game.games.halloween.HalloweenAudio;
import nautilus.game.arcade.game.games.halloween.creatures.MobSpiderLeaper;
import nautilus.game.arcade.game.games.halloween.creatures.MobSpiderSmasher;
@ -9,7 +10,7 @@ public class Wave3 extends WaveBase
{
public Wave3(Halloween host)
{
super(host, "Spiders Spiders Spiders!", 70000, host.GetSpawnSet(2));
super(host, "Spiders, Spiders and even more Spiders!", 70000, host.GetSpawnSet(2), HalloweenAudio.WAVE_3);
}
@Override

View File

@ -4,6 +4,7 @@ import org.bukkit.Location;
import mineplex.core.common.util.UtilTime;
import nautilus.game.arcade.game.games.halloween.Halloween;
import nautilus.game.arcade.game.games.halloween.HalloweenAudio;
import nautilus.game.arcade.game.games.halloween.creatures.MobGhast;
import nautilus.game.arcade.game.games.halloween.creatures.MobPigZombie;
@ -11,7 +12,7 @@ public class Wave4 extends WaveBase
{
public Wave4(Halloween host)
{
super(host, "Ghasts and friends!", 80000, host.GetSpawnSet(3));
super(host, "Look up! Its the Ghasts and Ghouls!", 80000, host.GetSpawnSet(3), HalloweenAudio.WAVE_4);
}
@Override

View File

@ -3,13 +3,14 @@ package nautilus.game.arcade.game.games.halloween.waves;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilTime;
import nautilus.game.arcade.game.games.halloween.Halloween;
import nautilus.game.arcade.game.games.halloween.HalloweenAudio;
import nautilus.game.arcade.game.games.halloween.creatures.*;
public class Wave5 extends WaveBase
{
public Wave5(Halloween host)
{
super(host, "Double the Giants! Double the fun!", 80000, host.GetSpawnSet(1));
super(host, "Double the Giants! Double the fun!", 80000, host.GetSpawnSet(1), HalloweenAudio.WAVE_5);
}
@Override

View File

@ -11,6 +11,7 @@ import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import nautilus.game.arcade.game.games.halloween.Halloween;
import nautilus.game.arcade.game.games.halloween.HalloweenAudio;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilServer;
@ -23,6 +24,7 @@ public abstract class WaveBase
protected Halloween Host;
protected String _name;
protected HalloweenAudio _audio;
protected long _start;
protected long _duration;
@ -31,11 +33,12 @@ public abstract class WaveBase
protected ArrayList<Location> _spawns;
public WaveBase(Halloween host, String name, long duration, ArrayList<Location> spawns)
public WaveBase(Halloween host, String name, long duration, ArrayList<Location> spawns, HalloweenAudio audio)
{
Host = host;
_name = name;
_audio = audio;
_start = System.currentTimeMillis();
_duration = duration;
@ -69,8 +72,10 @@ public abstract class WaveBase
UtilTitle.display(C.cYellow + "Wave " + wave, _name, 10, 100, 20);
for (Player player : UtilServer.getPlayers())
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 2f, 1f);
if (_audio != null)
{
Host.playSound(_audio);
}
}
//Display
@ -105,9 +110,6 @@ public abstract class WaveBase
for (int z=-1 ; z<=1 ; z++)
Host.Manager.GetBlockRestore().Add(block.getRelative(x, -1, z), 42, (byte)0, _duration);
//Lightning
block.getWorld().strikeLightningEffect(block.getLocation());
//Clear Laser
while (block.getY() < 250)
{

View File

@ -1,6 +1,7 @@
package nautilus.game.arcade.game.games.halloween.waves;
import nautilus.game.arcade.game.games.halloween.Halloween;
import nautilus.game.arcade.game.games.halloween.HalloweenAudio;
import nautilus.game.arcade.game.games.halloween.creatures.MobCreeper;
import nautilus.game.arcade.game.games.halloween.creatures.MobGiant;
import nautilus.game.arcade.game.games.halloween.creatures.MobZombie;
@ -10,22 +11,28 @@ public class WaveBoss extends WaveBase
{
private PumpkinKing _king;
private boolean _canEnd = false;
public WaveBoss(Halloween host)
{
super(host, "The Pumpkin King", 0, host.GetSpawnSet(0));
super(host, "The Pumpkin King", 0, host.GetSpawnSet(0), HalloweenAudio.WAVE_6);
}
@Override
public void Spawn(int tick)
{
if (tick == 0)
if (tick == 100)
{
_king = new PumpkinKing(Host, Host.WorldData.GetDataLocs("BLACK").get(0));
Host.AddCreature(_king);
Host.playSound(HalloweenAudio.BOSS_SPAWN);
_canEnd = true;
}
//Increasing difficulty of mobs
if (Host.GetCreatures().size() < 20 + (tick/200) && !_king.IsFinal())
if (Host.GetCreatures().size() < 20 + (tick/200) && (_king == null || !_king.IsFinal()))
{
if (tick % Math.max(5, 15 - tick/400) == 0)
if (Math.random() > 0.10)
@ -35,7 +42,7 @@ public class WaveBoss extends WaveBase
}
//Giant every 2.5 minutes
if (tick % 3000 == 0 && !_king.IsFinal())
if (tick % 3000 == 0 && (_king == null || !_king.IsFinal()))
{
Host.AddCreature(new MobGiant(Host, GetSpawn()));
}
@ -44,6 +51,12 @@ public class WaveBoss extends WaveBase
@Override
public boolean CanEnd()
{
return _king == null || !_king.GetEntity().isValid();
if (_canEnd && (_king == null || !_king.GetEntity().isValid()))
{
_king.Host.playSound(HalloweenAudio.BOSS_LOSE);
return true;
}
return false;
}
}

View File

@ -13,7 +13,7 @@ public class WaveVictory extends WaveBase
{
public WaveVictory(Halloween host)
{
super(host, "Celebration!", 15000, host.GetSpawnSet(3));
super(host, "Celebration!", 15000, host.GetSpawnSet(3), null);
}
@Override

View File

@ -1389,7 +1389,10 @@ public class UHC extends TeamGame
//Ended
if (GetState() == GameState.End || GetState() == GameState.Dead)
{
return ChatColor.RED + "Finished";
if (_ended)
return ChatColor.RED + "Finished";
else
return ChatColor.YELLOW + "In Progress";
}
//Not Joinable Yet

View File

@ -1,6 +1,7 @@
package nautilus.game.arcade.kit.perks;
import java.util.HashMap;
import java.util.Iterator;
import java.util.WeakHashMap;
import org.bukkit.Sound;
@ -107,6 +108,26 @@ public class PerkBlizzardFinn extends Perk
}
}
@EventHandler
public void RemoveSnowball(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
Iterator<Projectile> projIterator = _snowball.keySet().iterator();
while (projIterator.hasNext())
{
Projectile proj = projIterator.next();
if (proj.getTicksLived() > 20)
{
proj.remove();
projIterator.remove();
}
}
}
@EventHandler(priority = EventPriority.LOW)
public void Snowball(CustomDamageEvent event)
{
@ -130,21 +151,9 @@ public class PerkBlizzardFinn extends Perk
event.SetCancelled("Player Cancel");
return;
}
damagee.setVelocity(proj.getVelocity().multiply(0.15).add(new Vector(0, 0.15, 0)));
event.AddMod(GetName(), GetName(), 0.6, false);
}
@EventHandler
public void SnowballForm(ProjectileHitEvent event)
{
if (!(event.getEntity() instanceof Snowball))
return;
if (_snowball.remove(event.getEntity()) == null)
return;
Manager.GetBlockRestore().Snow(event.getEntity().getLocation().getBlock(), (byte)1, (byte)7, 2000, 250, 0);
}
}

View File

@ -66,16 +66,10 @@ public class PerkFlameSlam extends Perk
if (!Kit.HasKit(player))
return;
if (UtilEnt.isGrounded(player))
{
UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " while grounded."));
return;
}
if (!Recharge.Instance.use(player, GetName(), 8000, true, true))
return;
UtilAction.velocity(player, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 0.4, true);
//UtilAction.velocity(player, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 0.4, true);
//Record
_live.put(player, System.currentTimeMillis());
@ -95,9 +89,13 @@ public class PerkFlameSlam extends Perk
while (liveIterator.hasNext())
{
Player player = liveIterator.next();
Vector vel = player.getLocation().getDirection();
vel.setY(0);
UtilAlg.Normalize(vel);
player.setVelocity(vel.multiply(0.8));
//Particle
UtilParticle.PlayParticle(ParticleType.FLAME, player.getLocation().add(0, 1, 0), 0.1f, 0.1f, 0.1f, 0, 3);
UtilParticle.PlayParticle(ParticleType.FLAME, player.getLocation().add(0, 1, 0), 0.2f, 0.2f, 0.2f, 0, 5);
for (Entity other : player.getWorld().getEntities())
{
@ -107,7 +105,7 @@ public class PerkFlameSlam extends Perk
if (other instanceof Player)
continue;
if (UtilMath.offset(player, other) > 2)
if (UtilMath.offset(player, other) > 1.5)
continue;
DoSlam(player, (LivingEntity)other);
@ -122,14 +120,14 @@ public class PerkFlameSlam extends Perk
if (!_live.containsKey(player))
continue;
if (UtilEnt.isGrounded(player) || UtilTime.elapsed(_live.get(player), 1000))
if (UtilTime.elapsed(_live.get(player), 800))
_live.remove(player);
}
}
public void DoSlam(Player damager, LivingEntity damagee)
{
UtilAction.velocity(damager, UtilAlg.getTrajectory2d(damagee, damager), 1, true, 0.4, 0, 0.4, false);
UtilAction.velocity(damager, UtilAlg.getTrajectory2d(damagee, damager), 1, true, 0.4, 0, 0.4, true);
for (Entity other : damagee.getWorld().getEntities())
{