Add voices and general improvements
This commit is contained in:
parent
2720e78932
commit
3f5ee494d8
@ -26,6 +26,7 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.event.player.PlayerArmorStandManipulateEvent;
|
||||
|
||||
import mineplex.core.account.permissions.Permission;
|
||||
import mineplex.core.account.permissions.PermissionGroup;
|
||||
@ -36,6 +37,7 @@ import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTextMiddle;
|
||||
import mineplex.core.explosion.ExplosionEvent;
|
||||
import mineplex.core.packethandler.IPacketHandler;
|
||||
import mineplex.core.packethandler.PacketInfo;
|
||||
@ -73,7 +75,6 @@ public class ChristmasCommon extends SoloGame
|
||||
private GameTeam _badGuys;
|
||||
|
||||
private List<Location> _barrier;
|
||||
private long _santaSayTime;
|
||||
|
||||
private Sleigh _sleigh;
|
||||
protected Location _sleighSpawn;
|
||||
@ -207,6 +208,7 @@ public class ChristmasCommon extends SoloGame
|
||||
{
|
||||
UtilServer.Unregister(_currentSection);
|
||||
_currentSection.end();
|
||||
UtilTextMiddle.display("❄" + C.cGreen + " Well Done " + C.cWhite + "❄", "Follow Santa", 0, 80, 10, GetPlayers(true).toArray(new Player[0]));
|
||||
}
|
||||
|
||||
_forceSkip = false;
|
||||
@ -219,7 +221,6 @@ public class ChristmasCommon extends SoloGame
|
||||
|
||||
UtilServer.RegisterEvents(_currentSection);
|
||||
_currentSection.start();
|
||||
onNextSection(_currentSection);
|
||||
|
||||
Location target = _currentSection.getSleighTarget();
|
||||
|
||||
@ -237,11 +238,6 @@ public class ChristmasCommon extends SoloGame
|
||||
}
|
||||
}
|
||||
|
||||
public void onNextSection(Section section)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private Section getNext()
|
||||
{
|
||||
return _sections.isEmpty() ? null : _sections.remove(0);
|
||||
@ -434,6 +430,12 @@ public class ChristmasCommon extends SoloGame
|
||||
event.setDroppedExp(0);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void armourStandManipulate(PlayerArmorStandManipulateEvent event)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void projectileHit(ProjectileHitEvent event)
|
||||
{
|
||||
@ -489,7 +491,7 @@ public class ChristmasCommon extends SoloGame
|
||||
player.sendMessage(getSantaMessage(message));
|
||||
}
|
||||
|
||||
public String getSantaMessage(String message)
|
||||
private String getSantaMessage(String message)
|
||||
{
|
||||
return C.cRedB + "Santa" + C.cWhiteB + ": " + C.cYellow + message;
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import org.bukkit.entity.Chicken;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
@ -149,6 +150,11 @@ public class Sleigh
|
||||
Target = loc;
|
||||
}
|
||||
|
||||
public Location getTarget()
|
||||
{
|
||||
return Target;
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (!_loaded)
|
||||
@ -198,13 +204,26 @@ public class Sleigh
|
||||
|
||||
private void Bump()
|
||||
{
|
||||
double centralYZ = CentralEntity.getLocation().getZ();
|
||||
|
||||
for (Player player : Host.GetPlayers(true))
|
||||
{
|
||||
if (player.getLocation().getZ() < CentralEntity.getLocation().getZ() - 24 && Recharge.Instance.use(player, "Sleigh Bump", 400, false, false))
|
||||
if (!Recharge.Instance.use(player, "Sleigh Bump", 400, false, false))
|
||||
{
|
||||
player.damage(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
double offset = centralYZ - player.getLocation().getZ();
|
||||
|
||||
if (offset > 26)
|
||||
{
|
||||
player.teleport(CentralEntity);
|
||||
}
|
||||
else if (offset > 24)
|
||||
{
|
||||
Host.getArcadeManager().GetDamage().NewDamageEvent(player, null, null, DamageCause.CUSTOM, 1, false, true, true, Host.GetName(), "Too Slow");
|
||||
Host.sendSantaMessage(player, "Careful " + player.getName() + "! Keep up with my Sleigh!", null);
|
||||
UtilAction.velocity(player, UtilAlg.getTrajectory2d(player, CentralEntity), 0.6, true, 0.2, 0, 0, true);
|
||||
UtilAction.velocity(player, UtilAlg.getTrajectory2d(player, CentralEntity), 0.7, true, 0.2, 0, 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,12 +75,23 @@ public class ChristmasNew extends ChristmasCommon
|
||||
|
||||
@EventHandler
|
||||
public void gameStart(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Prepare)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Manager.runSyncLater(() -> sendSantaMessage("Thank you for coming. Someone has stolen all of the Christmas presents. I need your help to get them back.", ChristmasNewAudio.SANTA_INTRO), 40);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void gameLive(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Live)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sendSantaMessage("Testing music", ChristmasNewAudio.TEST);
|
||||
sendSantaMessage("Follow me, let's find out who’s behind this.", ChristmasNewAudio.SANTA_FOLLOW_ME_2);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,30 @@ import mineplex.core.common.util.UtilPlayer.CustomSound;
|
||||
public enum ChristmasNewAudio implements CustomSound
|
||||
{
|
||||
|
||||
TEST("test")
|
||||
PK_LAUGH("pk_hahaha_I_have_been_expecting_you_santa_claus"),
|
||||
PK_IT_WAS_ME("pk_yes_it_was_me_nothing_you_can_do_too_late"),
|
||||
|
||||
SANTA_ALMOST_THERE("santa_almost_there"),
|
||||
SANTA_MINE("santa_another_one_in_mine_watch_out_monsters"),
|
||||
SANTA_CLEAR_PATH("santa_clear_path_through_rocks"),
|
||||
SANTA_FOLLOW_ME("santa_follow_me"),
|
||||
SANTA_FOLLOW_ME_2("santa_follow_me_find_out_who_behind_this"),
|
||||
SANTA_GOOD_JOB("santa_good_job"),
|
||||
SANTA_LONGER("santa_great_job_just_a_little_bit_longer"),
|
||||
SANTA_PUMPKIN_CASTLE("santa_jeepers_creepers_pumpkin_kings_castle"),
|
||||
SANTA_LETS_GO("santa_lets_go"),
|
||||
SANTA_TWO_MORE_PRESENTS("santa_look_two_more_presents"),
|
||||
SANTA_BRIDGE_OFF("santa_oh_no_magical_bridge_turned_off_defend_generators"),
|
||||
SANTA_WITCHES("santa_oh_no_those_witches_look_particularly_nasty"),
|
||||
SANTA_TREES("santa_see_one_in_trees_follow_ornaments"),
|
||||
SANTA_STOLE_PRESENTS("santa_so_it_was_you_who_stole_all_of_the_christmas_presents"),
|
||||
SANTA_INTRO("santa_thanks_for_coming"),
|
||||
SANTA_ICE_MAZE("santa_theres_another_present_hidden_ice_maze"),
|
||||
SANTA_ITS_A_TRAP("santa_watch_out_its_a_trap"),
|
||||
SANTA_PREPARE_FOR_BATTLE("santa_we_will_see_about_that_prepare_for_battle"),
|
||||
SANTA_WELL_DONE("santa_well_done"),
|
||||
SANTA_BRIDGE_ON("santa_you_did_it_magical_bridge_turned_on")
|
||||
|
||||
;
|
||||
|
||||
private final String _audioPath;
|
||||
|
@ -10,12 +10,16 @@ import org.bukkit.FireworkEffect.Type;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import mineplex.core.common.util.UtilFirework;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.lifetimes.SimpleLifetime;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
import nautilus.game.arcade.game.games.christmas.Sleigh;
|
||||
import nautilus.game.arcade.game.games.christmasnew.ChristmasNew;
|
||||
import nautilus.game.arcade.game.games.christmasnew.present.Present;
|
||||
import nautilus.game.arcade.world.WorldData;
|
||||
@ -30,6 +34,7 @@ public abstract class Section extends SimpleLifetime implements Listener, Sectio
|
||||
.withFlicker()
|
||||
.withTrail()
|
||||
.build();
|
||||
private static final int SLEIGH_OFFSET_INFORM_SQUARED = 300;
|
||||
|
||||
protected final ChristmasNew _host;
|
||||
protected final WorldData _worldData;
|
||||
@ -38,6 +43,7 @@ public abstract class Section extends SimpleLifetime implements Listener, Sectio
|
||||
private final List<SectionChallenge> _challenges;
|
||||
|
||||
private int _timeSet;
|
||||
private boolean _informedTarget;
|
||||
|
||||
public Section(ChristmasNew host, Location sleighTarget)
|
||||
{
|
||||
@ -120,6 +126,28 @@ public abstract class Section extends SimpleLifetime implements Listener, Sectio
|
||||
_host.getSleigh().AddPresent(location);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void updateTarget(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SEC || _informedTarget)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Sleigh sleigh = _host.getSleigh();
|
||||
|
||||
if (UtilMath.offsetSquared(sleigh.GetLocation(), sleigh.getTarget()) < SLEIGH_OFFSET_INFORM_SQUARED)
|
||||
{
|
||||
_informedTarget = true;
|
||||
onSantaTarget();
|
||||
}
|
||||
}
|
||||
|
||||
public void onSantaTarget()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void setTimeSet(int timeSet)
|
||||
{
|
||||
_timeSet = timeSet;
|
||||
|
@ -17,6 +17,7 @@ import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
import nautilus.game.arcade.game.games.christmasnew.ChristmasNew;
|
||||
import nautilus.game.arcade.game.games.christmasnew.ChristmasNewAudio;
|
||||
import nautilus.game.arcade.game.games.christmasnew.section.Section;
|
||||
|
||||
public class Section5 extends Section
|
||||
@ -43,7 +44,7 @@ public class Section5 extends Section
|
||||
new SnowmenKong(host, presents[1], this)
|
||||
);
|
||||
|
||||
setTimeSet(12000);
|
||||
setTimeSet(12500);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -102,6 +103,12 @@ public class Section5 extends Section
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSantaTarget()
|
||||
{
|
||||
_host.sendSantaMessage("Look, two more presents.", ChristmasNewAudio.SANTA_TWO_MORE_PRESENTS);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void updateFallingBlocks(UpdateEvent event)
|
||||
{
|
||||
|
@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Snowman;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -13,7 +14,6 @@ import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.common.util.MapUtil;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
@ -32,6 +32,8 @@ class SnowmenKong extends SectionChallenge
|
||||
private static final int SEARCH_DISTANCE_SQUARED = 100;
|
||||
private static final int MIN_TICKS_BEFORE_HIT = 8;
|
||||
private static final Vector HIT_VELOCITY = new Vector(-1.5, 0.7, 0);
|
||||
private static final int MAX_TICKS = 300;
|
||||
private static final int MAX_MOBS = 100;
|
||||
|
||||
private final List<SnowmanWave> _waves;
|
||||
|
||||
@ -51,12 +53,14 @@ class SnowmenKong extends SectionChallenge
|
||||
public void onPresentCollect()
|
||||
{
|
||||
_spawn = false;
|
||||
_entities.forEach(Entity::remove);
|
||||
_entities.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegister()
|
||||
{
|
||||
_spawn = true;
|
||||
_host.getArcadeManager().runSyncLater(() -> _spawn = true, 800);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -95,19 +99,19 @@ class SnowmenKong extends SectionChallenge
|
||||
@EventHandler
|
||||
public void updateWaveSpawn(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SLOW || !_spawn)
|
||||
if (event.getType() != UpdateType.SLOW || !_spawn || _entities.size() > MAX_MOBS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (SnowmanWave wave : _waves)
|
||||
{
|
||||
Player player = UtilPlayer.getClosest(wave.Spawns.get(0), 40);
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// Player player = UtilPlayer.getClosest(wave.Spawns.get(0), 40);
|
||||
//
|
||||
// if (player == null)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
int index = UtilMath.r(wave.Spawns.size() - 1) + 1;
|
||||
boolean upShift = Math.random() > 0.5;
|
||||
@ -126,6 +130,7 @@ class SnowmenKong extends SectionChallenge
|
||||
UtilEnt.vegetate(snowman);
|
||||
UtilEnt.ghost(snowman, true, false);
|
||||
UtilEnt.setFakeHead(snowman, true);
|
||||
UtilEnt.setTickWhenFarAway(snowman, true);
|
||||
|
||||
wave.Entities.add(snowman);
|
||||
}
|
||||
@ -144,13 +149,18 @@ class SnowmenKong extends SectionChallenge
|
||||
{
|
||||
for (Snowman entity : wave.Entities)
|
||||
{
|
||||
if (!entity.isValid() || entity.getTicksLived() < MIN_TICKS_BEFORE_HIT)
|
||||
if (!entity.isValid())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Location target = entity.getLocation().add(0, -1, (wave.PositiveZ ? 2 : -2));
|
||||
UtilEnt.CreatureMove(entity, target, 1.5F);
|
||||
UtilEnt.CreatureMove(entity, target, 1.6F);
|
||||
|
||||
if (entity.getTicksLived() < MIN_TICKS_BEFORE_HIT)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (Player player : UtilEnt.getPlayersInsideEntity(entity))
|
||||
{
|
||||
@ -165,7 +175,7 @@ class SnowmenKong extends SectionChallenge
|
||||
|
||||
Location location = entity.getLocation();
|
||||
|
||||
if (UtilBlock.solid(location.add(location.getDirection()).getBlock()))
|
||||
if (UtilBlock.solid(location.add(location.getDirection()).getBlock()) || entity.getTicksLived() > MAX_TICKS)
|
||||
{
|
||||
entity.remove();
|
||||
}
|
||||
|
@ -9,12 +9,15 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.MapUtil;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.hologram.Hologram;
|
||||
import mineplex.core.itemstack.ItemBuilder;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
@ -25,6 +28,14 @@ import nautilus.game.arcade.game.games.christmasnew.section.SectionChallenge;
|
||||
class SwitchParkour extends SectionChallenge
|
||||
{
|
||||
|
||||
private static final ItemStack STAY_ON_RED = new ItemBuilder(Material.WOOL, (byte) 14)
|
||||
.setTitle(C.cRedB + "STAY ON RED")
|
||||
.build();
|
||||
private static final ItemStack STAY_ON_GREEN = new ItemBuilder(Material.WOOL, (byte) 13)
|
||||
.setTitle(C.cDGreenB + "STAY ON GREEN")
|
||||
.build();
|
||||
private static final int[] STAY_ON_SLOTS = {5, 6, 7};
|
||||
|
||||
private final List<Location> _black;
|
||||
private final List<Location> _white;
|
||||
|
||||
@ -58,6 +69,16 @@ class SwitchParkour extends SectionChallenge
|
||||
public void onPresentCollect()
|
||||
{
|
||||
_enabled = false;
|
||||
|
||||
for (Player player : _host.GetPlayers(true))
|
||||
{
|
||||
Inventory inventory = player.getInventory();
|
||||
|
||||
for (int slot : STAY_ON_SLOTS)
|
||||
{
|
||||
inventory.setItem(slot, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -67,7 +88,7 @@ class SwitchParkour extends SectionChallenge
|
||||
{
|
||||
_checkpointHologram.start();
|
||||
_enabled = true;
|
||||
}, 400);
|
||||
}, 800);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -109,6 +130,16 @@ class SwitchParkour extends SectionChallenge
|
||||
_black.forEach(location -> MapUtil.QuickChangeBlockAt(location, Material.WOOL, (byte) 13));
|
||||
}
|
||||
|
||||
for (Player player : _host.GetPlayers(true))
|
||||
{
|
||||
Inventory inventory = player.getInventory();
|
||||
|
||||
for (int slot : STAY_ON_SLOTS)
|
||||
{
|
||||
inventory.setItem(slot, _blackSolid ? STAY_ON_RED : STAY_ON_GREEN);
|
||||
}
|
||||
}
|
||||
|
||||
_blackSolid = !_blackSolid;
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import org.bukkit.Location;
|
||||
import mineplex.core.lifetimes.Component;
|
||||
|
||||
import nautilus.game.arcade.game.games.christmasnew.ChristmasNew;
|
||||
import nautilus.game.arcade.game.games.christmasnew.ChristmasNewAudio;
|
||||
import nautilus.game.arcade.game.games.christmasnew.section.Section;
|
||||
|
||||
public class Section4 extends Section
|
||||
@ -29,7 +30,7 @@ public class Section4 extends Section
|
||||
@Override
|
||||
public void onUnregister()
|
||||
{
|
||||
|
||||
_host.sendSantaMessage("You did it! My magical bridge has been turned on.", ChristmasNewAudio.SANTA_BRIDGE_ON);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -50,4 +51,10 @@ public class Section4 extends Section
|
||||
|
||||
return super.isComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSantaTarget()
|
||||
{
|
||||
_host.sendSantaMessage("Oh no! My magical bridge has been turned off. Defend the generators while they charge up!", ChristmasNewAudio.SANTA_BRIDGE_OFF);
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.christmasnew.section.one;
|
||||
import org.bukkit.Location;
|
||||
|
||||
import nautilus.game.arcade.game.games.christmasnew.ChristmasNew;
|
||||
import nautilus.game.arcade.game.games.christmasnew.ChristmasNewAudio;
|
||||
import nautilus.game.arcade.game.games.christmasnew.section.Section;
|
||||
import nautilus.game.arcade.game.games.christmasnew.section.SectionChallenge;
|
||||
|
||||
@ -47,6 +48,13 @@ public class Section1 extends Section
|
||||
@Override
|
||||
public void onUnregister()
|
||||
{
|
||||
_host.sendSantaMessage("Follow me.", ChristmasNewAudio.SANTA_FOLLOW_ME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSantaTarget()
|
||||
{
|
||||
_host.sendSantaMessage("Look! I see one up in those trees. Follow the ornaments in the trees to find the present.", ChristmasNewAudio.SANTA_TREES);
|
||||
_host.getArcadeManager().runSyncLater(() -> _host.sendSantaMessage("There’s another one in the mine over there. Watch out for the monsters.", ChristmasNewAudio.SANTA_MINE), 150);
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,12 @@ package nautilus.game.arcade.game.games.christmasnew.section.six;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityEquipment;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Skeleton;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -15,6 +18,8 @@ import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.MapUtil;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
@ -75,11 +80,11 @@ class BossFight extends SectionChallenge
|
||||
@Override
|
||||
public void onUnregister()
|
||||
{
|
||||
_phases.forEach(phase ->
|
||||
if (_currentPhase != null)
|
||||
{
|
||||
phase.deactivate();
|
||||
phase.onUnregister();
|
||||
});
|
||||
_currentPhase.onUnregister();
|
||||
_currentPhase.deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -118,7 +123,7 @@ class BossFight extends SectionChallenge
|
||||
return;
|
||||
}
|
||||
|
||||
if (UtilTime.elapsed(_start, 30000))
|
||||
if (UtilTime.elapsed(_start, 40000))
|
||||
{
|
||||
_host.sendSantaMessage("Starting", null);
|
||||
_host.getSleigh().unloadSleigh();
|
||||
@ -168,6 +173,16 @@ class BossFight extends SectionChallenge
|
||||
|
||||
_boss.getWorld().strikeLightningEffect(_bossSpawn);
|
||||
|
||||
_host.getArcadeManager().runSyncLater(() ->
|
||||
{
|
||||
PacketPlayOutEntityEquipment packet = new PacketPlayOutEntityEquipment(_boss.getEntityId(), 4, CraftItemStack.asNMSCopy(HELMET), true);
|
||||
|
||||
for (Player player : UtilServer.getPlayersCollection())
|
||||
{
|
||||
UtilPlayer.sendPacket(player, packet);
|
||||
}
|
||||
}, 1);
|
||||
|
||||
_host.CreatureAllowOverride = false;
|
||||
}
|
||||
}
|
||||
|
@ -11,12 +11,13 @@ import org.bukkit.scheduler.BukkitRunnable;
|
||||
import mineplex.core.common.util.MapUtil;
|
||||
|
||||
import nautilus.game.arcade.game.games.christmasnew.ChristmasNew;
|
||||
import nautilus.game.arcade.game.games.christmasnew.ChristmasNewAudio;
|
||||
import nautilus.game.arcade.game.games.christmasnew.section.Section;
|
||||
|
||||
public class Section6 extends Section
|
||||
{
|
||||
|
||||
private static final int GATE_OPEN_DELAY = 350;
|
||||
private static final int GATE_OPEN_DELAY = 600;
|
||||
|
||||
private final List<Location> _gate;
|
||||
|
||||
@ -93,4 +94,10 @@ public class Section6 extends Section
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSantaTarget()
|
||||
{
|
||||
_host.sendSantaMessage("Jeepers Creepers! It’s the Pumpkin King’s Castle.", ChristmasNewAudio.SANTA_PUMPKIN_CASTLE);
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class AttackShootArrows extends BossAttack implements IThrown
|
||||
arrow.setCritical(true);
|
||||
arrow.setVelocity(new Vector((Math.random() - 0.5) / 1.5D, (Math.random() / 3) + 1, (Math.random() - 0.5) / 1.5D));
|
||||
|
||||
_phase.getHost().getArcadeManager().GetProjectile().AddThrow(arrow, _boss, this, -1, true, true, false, false, 1);
|
||||
_phase.getHost().getArcadeManager().GetProjectile().AddThrow(arrow, _boss, this, -1, true, true, false, false, 2);
|
||||
}, 1, 1);
|
||||
}
|
||||
|
||||
|
@ -4,9 +4,15 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.TNTPrimed;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
|
||||
import nautilus.game.arcade.game.games.christmasnew.section.six.phase.BossPhase;
|
||||
@ -15,11 +21,15 @@ public class AttackThrowTNT extends BossAttack
|
||||
{
|
||||
|
||||
private static final long DURATION = TimeUnit.SECONDS.toMillis(4);
|
||||
private static final int FUSE_TICKS = 60;
|
||||
private static final int FUSE_TICKS = 50;
|
||||
|
||||
public AttackThrowTNT(BossPhase phase)
|
||||
private final int _max;
|
||||
|
||||
public AttackThrowTNT(BossPhase phase, int max)
|
||||
{
|
||||
super(phase);
|
||||
|
||||
_max = max;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -32,19 +42,28 @@ public class AttackThrowTNT extends BossAttack
|
||||
public void onRegister()
|
||||
{
|
||||
Location location = _boss.getEyeLocation();
|
||||
|
||||
for (int i = 0; i < _max; i++)
|
||||
{
|
||||
TNTPrimed tnt = location.getWorld().spawn(location, TNTPrimed.class);
|
||||
tnt.setFuseTicks(FUSE_TICKS + UtilMath.r(20));
|
||||
|
||||
tnt.setFuseTicks(FUSE_TICKS);
|
||||
|
||||
Vector direction = location.getDirection().multiply(0.3);
|
||||
Vector direction = location.getDirection().multiply(0.3).add(new Vector((Math.random() - 0.5) / 2, Math.random() / 3, (Math.random() - 0.5) / 2));
|
||||
direction.setY(0.8);
|
||||
|
||||
UtilAction.velocity(tnt, direction);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnregister()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void explode(EntityExplodeEvent event)
|
||||
{
|
||||
UtilParticle.PlayParticleToAll(ParticleType.HUGE_EXPLOSION, event.getLocation(), null, 0, 1, ViewDist.LONG);
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class Phase1 extends BossPhase
|
||||
|
||||
addAttacks(
|
||||
new AttackThrowMobs(this, 2, 4),
|
||||
new AttackThrowTNT(this),
|
||||
new AttackThrowTNT(this, 4),
|
||||
new AttackShootArrows(this)
|
||||
);
|
||||
}
|
||||
@ -91,6 +91,12 @@ public class Phase1 extends BossPhase
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnregister()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void updateShield(UpdateEvent event)
|
||||
{
|
||||
|
@ -21,6 +21,7 @@ import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
import nautilus.game.arcade.game.games.christmasnew.ChristmasNew;
|
||||
import nautilus.game.arcade.game.games.christmasnew.ChristmasNewAudio;
|
||||
import nautilus.game.arcade.game.games.christmasnew.section.Section;
|
||||
import nautilus.game.arcade.game.games.christmasnew.section.SectionChallenge;
|
||||
|
||||
@ -124,6 +125,9 @@ class CaveIn extends SectionChallenge
|
||||
{
|
||||
_exploded = true;
|
||||
|
||||
_host.sendSantaMessage("Watch out! It’s a trap!", ChristmasNewAudio.SANTA_ITS_A_TRAP);
|
||||
_host.getArcadeManager().runSyncLater(() -> _host.sendSantaMessage("Clear a path through those rocks.", ChristmasNewAudio.SANTA_CLEAR_PATH), 100);
|
||||
|
||||
_blocksToExplode.forEach(location ->
|
||||
{
|
||||
UtilParticle.PlayParticleToAll(ParticleType.HUGE_EXPLOSION, location, 0, 0, 0, 0.1F, 1, ViewDist.LONG);
|
||||
|
@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.christmasnew.section.three;
|
||||
import org.bukkit.Location;
|
||||
|
||||
import nautilus.game.arcade.game.games.christmasnew.ChristmasNew;
|
||||
import nautilus.game.arcade.game.games.christmasnew.ChristmasNewAudio;
|
||||
import nautilus.game.arcade.game.games.christmasnew.section.Section;
|
||||
|
||||
public class Section3 extends Section
|
||||
@ -30,7 +31,7 @@ public class Section3 extends Section
|
||||
@Override
|
||||
public void onUnregister()
|
||||
{
|
||||
|
||||
_host.sendSantaMessage("Lets go!", ChristmasNewAudio.SANTA_LETS_GO);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.christmasnew.section.two;
|
||||
import org.bukkit.Location;
|
||||
|
||||
import nautilus.game.arcade.game.games.christmasnew.ChristmasNew;
|
||||
import nautilus.game.arcade.game.games.christmasnew.ChristmasNewAudio;
|
||||
import nautilus.game.arcade.game.games.christmasnew.section.Section;
|
||||
|
||||
public class Section2 extends Section
|
||||
@ -29,6 +30,13 @@ public class Section2 extends Section
|
||||
@Override
|
||||
public void onUnregister()
|
||||
{
|
||||
_host.sendSantaMessage("Good job!", ChristmasNewAudio.SANTA_GOOD_JOB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSantaTarget()
|
||||
{
|
||||
_host.sendSantaMessage("Oh no! Those witches looks particularly nasty.", ChristmasNewAudio.SANTA_WITCHES);
|
||||
_host.getArcadeManager().runSyncLater(() -> _host.sendSantaMessage("There’s another present hidden within that ice maze.", ChristmasNewAudio.SANTA_ICE_MAZE), 150);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user