From 5c984569953837060a17e48068b41eed31bab3e3 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 7 Dec 2017 22:41:02 +0000 Subject: [PATCH] Add additional voice lines --- .../game/games/christmas/ChristmasCommon.java | 7 +++--- .../section/five/SwitchParkour.java | 14 +++-------- .../christmasnew/section/six/BossFight.java | 4 +-- .../section/six/phase/Phase1.java | 4 +++ .../section/six/phase/Phase2.java | 25 +++++++++++++++++++ .../christmasnew/section/two/Section2.java | 2 +- 6 files changed, 39 insertions(+), 17 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/ChristmasCommon.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/ChristmasCommon.java index 77e9a32a7..f97740bcf 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/ChristmasCommon.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/ChristmasCommon.java @@ -525,14 +525,13 @@ public class ChristmasCommon extends SoloGame @Override public Location GetSpectatorLocation() { - List alive = GetPlayers(true); - - if (alive.isEmpty()) + if (!IsLive()) { return super.GetSpectatorLocation(); } else { + List alive = GetPlayers(true); List locations = new ArrayList<>(alive.size()); alive.forEach(player -> locations.add(player.getLocation())); return UtilAlg.getAverageLocation(locations); @@ -560,7 +559,7 @@ public class ChristmasCommon extends SoloGame if (victory) { WorldTimeSet = 18000; - sendSantaMessage("Well done everyone! You saved Christmas!", null); + Manager.runSyncLater(() -> sendSantaMessage("You did it! I can’t believe it! You saved Christmas!", null), 80); } SetCustomWinLine(customLine); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/five/SwitchParkour.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/five/SwitchParkour.java index 2c43475b4..f6b26551e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/five/SwitchParkour.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/five/SwitchParkour.java @@ -58,7 +58,7 @@ class SwitchParkour extends SectionChallenge _checkpointTrigger = _worldData.GetCustomLocs(String.valueOf(Material.LAPIS_BLOCK.getId())).get(0).getBlock().getLocation(); _checkpointHologram = new Hologram(host.getArcadeManager().getHologramManager(), _checkpointTrigger.clone().add(0.5, 1, 0.5), C.cGoldB + "Checkpoint") - .setInteraction((player, clickType) -> activateCheckpoint()); + .setInteraction((player, clickType) -> activateCheckpoint(player)); _checkpoint = _worldData.GetCustomLocs(String.valueOf(Material.LAPIS_ORE.getId())); _checkpoint.forEach(location -> MapUtil.QuickChangeBlockAt(location, Material.AIR)); @@ -146,12 +146,6 @@ class SwitchParkour extends SectionChallenge public void checkpointInteract(PlayerInteractEvent event) { Player player = event.getPlayer(); - - if (UtilPlayer.isSpectator(player)) - { - return; - } - Block block = event.getClickedBlock(); if (block == null || block.getType() != Material.LEVER) @@ -159,12 +153,12 @@ class SwitchParkour extends SectionChallenge return; } - activateCheckpoint(); + activateCheckpoint(player); } - private void activateCheckpoint() + private void activateCheckpoint(Player player) { - if (_hasCheckpointed) + if (_hasCheckpointed || UtilPlayer.isSpectator(player)) { return; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/six/BossFight.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/six/BossFight.java index eb93fb32c..2d2b7097f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/six/BossFight.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/six/BossFight.java @@ -155,7 +155,7 @@ class BossFight extends SectionChallenge _innerGate.forEach(location -> MapUtil.QuickChangeBlockAt(location, Material.NETHER_FENCE)); } - else if (!_dialogueC && UtilTime.elapsed(_start, 45000)) + else if (!_dialogueC && UtilTime.elapsed(_start, 44000)) { _dialogueC = true; _host.sendBossMessage("Yes it was me! There is nothing you and your friends can do now, you are too late!", ChristmasNewAudio.PK_IT_WAS_ME); @@ -169,7 +169,7 @@ class BossFight extends SectionChallenge { _dialogueA = true; spawnBoss(); - _host.sendBossMessage("Hahaha! I’ve been expecting you Santa Claus.", ChristmasNewAudio.PK_LAUGH); + _host.sendBossMessage("Hahaha! I’ve been expecting you Santa Claus. You fell right into my trap.", ChristmasNewAudio.PK_LAUGH); } if (Math.random() < 0.15) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/six/phase/Phase1.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/six/phase/Phase1.java index 699278541..caa761b90 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/six/phase/Phase1.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/six/phase/Phase1.java @@ -103,6 +103,9 @@ public class Phase1 extends BossPhase _shield.add(stand); } + + _host.getArcadeManager().runSyncLater(() -> _host.sendSantaMessage("He has a shield that’s protecting him from your attacks. Just try and survive while I think of a way to destroy it.", null), 80); + _host.getArcadeManager().runSyncLater(() -> _host.sendBossMessage("That’s right! I’ve learned about all your tricks that you’ve used before. I won’t be falling for them again!", null), 240); } @Override @@ -206,6 +209,7 @@ public class Phase1 extends BossPhase _host.CreatureAllowOverride = false; _completing = true; _host.sendSantaMessage("GWEN? Is that you?", null); + _host.getArcadeManager().runSyncLater(() -> _host.sendBossMessage("That’s right! I’ve learned about all your tricks that you’ve used before. I won’t be falling for them again!", null), 60); } if (_animation.update()) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/six/phase/Phase2.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/six/phase/Phase2.java index c96fcfd6a..c7f8d20c7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/six/phase/Phase2.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/six/phase/Phase2.java @@ -7,9 +7,14 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.BlockFace; +import org.bukkit.entity.Arrow; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; +import org.bukkit.entity.Projectile; import org.bukkit.event.EventHandler; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.entity.ProjectileHitEvent; +import org.bukkit.projectiles.ProjectileSource; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.util.Vector; @@ -112,6 +117,7 @@ public class Phase2 extends BossPhase onAttack(null); _host.sendBossMessage("Now you've really done it!", null); + _host.getArcadeManager().runSyncLater(() -> _host.sendSantaMessage("Great! He’s now vulnerable to your attacks.", null), 50); Map lastLocation = new HashMap<>(); @@ -178,6 +184,25 @@ public class Phase2 extends BossPhase _section.setObjective("Defeat the Pumpkin King", _boss.getHealth() / _boss.getMaxHealth()); } + @EventHandler + public void projectileHit(ProjectileHitEvent event) + { + Projectile projectile = event.getEntity(); + ProjectileSource source = projectile.getShooter(); + + if (source == null || !(source instanceof Player)) + { + return; + } + + if (projectile instanceof Arrow && UtilMath.offset2dSquared(_boss, projectile) < 4) + { + Player player = (Player) projectile.getShooter(); + + _host.getArcadeManager().GetDamage().NewDamageEvent(_boss, player, projectile, DamageCause.CUSTOM, 4, false, true, true, player.getName(), "Archery"); + } + } + @EventHandler public void bossDamage(CustomDamageEvent event) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/two/Section2.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/two/Section2.java index 2dba987c9..54dbdf688 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/two/Section2.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmasnew/section/two/Section2.java @@ -36,7 +36,7 @@ public class Section2 extends Section @Override public void onSantaTarget() { - _host.sendSantaMessage("Oh no! Those witches looks particularly nasty.", ChristmasNewAudio.SANTA_WITCHES); + _host.sendSantaMessage("Oh no! Those spiders 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); } }