From 224d1bbf63ff99f586c86dc061c49b1ee5145817 Mon Sep 17 00:00:00 2001 From: Chiss Date: Tue, 23 Dec 2014 10:36:48 +1100 Subject: [PATCH] blizzard particle redo hub text --- .../core/gadget/gadgets/ParticleBlizzard.java | 27 ++++++++++++++++--- .../src/mineplex/hub/modules/TextManager.java | 4 +-- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleBlizzard.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleBlizzard.java index 7e4defa60..03f7dceb9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleBlizzard.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleBlizzard.java @@ -3,12 +3,13 @@ package mineplex.core.gadget.gadgets; import java.util.HashSet; import java.util.Iterator; +import org.bukkit.Bukkit; +import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.Sound; import org.bukkit.entity.Arrow; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.entity.ProjectileLaunchEvent; import org.bukkit.event.player.PlayerToggleFlightEvent; @@ -18,6 +19,7 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.gadget.types.ParticleGadget; +import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.gadget.GadgetManager; @@ -49,13 +51,31 @@ public class ParticleBlizzard extends ParticleGadget if (!shouldDisplay(player)) continue; + player.getWorld().playSound(player.getLocation(), Sound.AMBIENCE_RAIN, 0.2f, 0.1f); + if (Manager.isMoving(player)) { UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, player.getLocation().add(0, 1, 0), 0.2f, 0.2f, 0.2f, 0, 4); } else { - UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, player.getLocation().add(0, 5, 0), 1f, 0f, 1f, 0, 30); + double scale = (double)(player.getTicksLived() % 50) / 50d; + + for (int i = 0 ; i < 4 ; i++) + { + double r = (1d-scale) * Math.PI * 2; + + double x = Math.sin(r + (i * (Math.PI/2))) * (r%(Math.PI * 2)) * 0.4; + double z = Math.cos(r + (i * (Math.PI/2))) * (r%(Math.PI * 2)) * 0.4; + + UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, player.getLocation().add(x, scale * 3, z), 0f, 0f, 0f, 0, 1); + + if (scale > 0.95 && Recharge.Instance.use(player, GetName(), 1000, false, false)) + { + UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, player.getLocation().add(0, scale * 3.5, 0), 0f, 0f, 0f, 0.2f, 60); + player.getWorld().playSound(player.getLocation(), Sound.STEP_SNOW, 0.75f, 1.5f); + } + } } } } @@ -83,7 +103,6 @@ public class ParticleBlizzard extends ParticleGadget { if (GetActive().contains(event.getEntity().getShooter())) { - //UtilFirework.launchFirework(player.getEyeLocation(), Type.BALL, color(), true, true, new Vector(r(0.1),r(0.1),r(0.1)), 1); _arrows.add((Arrow)event.getEntity()); } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/TextManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/TextManager.java index 4bb6ec319..2ae729452 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/TextManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/TextManager.java @@ -64,8 +64,8 @@ public class TextManager extends MiniPlugin UtilBlockText.MakeText("TEAM DEATHMATCH", locComp.clone().add(15, 21, 0), faceComp, 159, (byte)1, TextAlign.CENTER); UtilBlockText.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, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); + UtilBlockText.MakeText("CLANS", locComp.clone().add(15, 28, 0), faceComp, 159, (byte)14, TextAlign.CENTER); + UtilBlockText.MakeText("CLANS", locComp.clone().add(16, 28, 0), faceComp, (Manager.Type == HubType.Halloween) ? 89 : 159, (Manager.Type == HubType.Halloween) ? (byte)0 : (byte)15, TextAlign.CENTER); //Arcade UtilBlockText.MakeText("ARCADE", locArcade, faceArcade, 159, (byte)5, TextAlign.CENTER);