From 075bc0af1d3e9b03ce6c6a2f8351d2e33ca1a14c Mon Sep 17 00:00:00 2001 From: Chiss Date: Fri, 17 Oct 2014 21:20:04 +1100 Subject: [PATCH 1/5] Added gem rewards for MS achievements --- .../mineplex/core/achievement/Achievement.java | 16 ++++++++-------- .../src/mineplex/hub/HubManager.java | 1 + .../src/mineplex/mapparser/MapParser.java | 2 ++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java index 19decd705..e7ae07960 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java @@ -516,49 +516,49 @@ public enum Achievement AchievementCategory.MICRO_BATTLE), //MineStrike - MINE_STRIKE_WINS("Striker", 0, + MINE_STRIKE_WINS("Striker", 800, new String[]{"MineStrike.Wins"}, new String[]{"Win 50 games of MineStrike"}, new int[]{50}, AchievementCategory.MINE_STRIKE), - MINE_STRIKE_BOOM_HEADSHOT("BOOM! HEADSHOT!", 0, + MINE_STRIKE_BOOM_HEADSHOT("BOOM! HEADSHOT!", 1000, new String[]{"MineStrike.BoomHeadshot"}, new String[]{"Kill 500 people with headshots"}, new int[]{500}, AchievementCategory.MINE_STRIKE), - MINE_STRIKE_ACE("Ace", 0, + MINE_STRIKE_ACE("Ace", 2000, new String[]{"MineStrike.Ace"}, new String[]{"Get the kill on all enemies in a single round"}, new int[]{1}, AchievementCategory.MINE_STRIKE), - MINE_STRIKE_KABOOM("Kaboom!", 0, + MINE_STRIKE_KABOOM("Kaboom!", 1000, new String[]{"MineStrike.Kaboom"}, new String[]{"Kill two people with a single", "High Explosive Grenade"}, new int[]{1}, AchievementCategory.MINE_STRIKE), - MINE_STRIKE_ASSASSINATION("Assassination", 0, + MINE_STRIKE_ASSASSINATION("Assassination", 800, new String[]{"MineStrike.Assassination"}, new String[]{"Get 20 backstab kills with the knife"}, new int[]{20}, AchievementCategory.MINE_STRIKE), - MINE_STRIKE_CLUTCH_OR_KICK("Clutch or Kick", 0, + MINE_STRIKE_CLUTCH_OR_KICK("Clutch or Kick", 1200, new String[]{"MineStrike.ClutchOrKick"}, new String[]{"Be the last one alive, and kill", "3 or more enemies to achieve victory"}, new int[]{1}, AchievementCategory.MINE_STRIKE), - MINE_STRIKE_KILLING_SPREE("Killing Spree", 0, + MINE_STRIKE_KILLING_SPREE("Killing Spree", 1600, new String[]{"MineStrike.KillingSpree"}, new String[]{"Kill 4 enemies in a row with no more", "than 5 seconds between each kill"}, new int[]{1}, AchievementCategory.MINE_STRIKE), - MINE_STRIKE_BLINDFOLDED("Blindfolded", 0, + MINE_STRIKE_BLINDFOLDED("Blindfolded", 1000, new String[]{"MineStrike.Blindfolded"}, new String[]{"Kill 2 enemies while blinded from", "a single flashbang"}, new int[]{1}, diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index 5b0793915..6b5ae64cd 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -102,6 +102,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent; public class HubManager extends MiniClientPlugin { + // ☃❅ Snowman! public HubType Type = HubType.Halloween; private BlockRestore _blockRestore; diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java index 077d353fd..136ff8b50 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java @@ -18,6 +18,7 @@ import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBurnEvent; import org.bukkit.event.block.BlockFadeEvent; @@ -30,6 +31,7 @@ import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.server.ServerListPingEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; From af0daf4a3d4af4c6fa04183e206608bee4f3c353 Mon Sep 17 00:00:00 2001 From: Chiss Date: Sat, 18 Oct 2014 10:29:00 +1100 Subject: [PATCH 2/5] HH Hunger Update --- .../game/games/halloween/Halloween.java | 86 ++++++++++++++++++- .../games/halloween/creatures/MobGhast.java | 4 +- .../game/arcade/kit/perks/PerkFlameSlam.java | 6 ++ 3 files changed, 93 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java index 5a67a956f..7c7fbfbd8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java @@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.halloween; import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -19,15 +20,18 @@ 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.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.player.PlayerCommandPreprocessEvent; import mineplex.core.common.util.C; +import mineplex.core.common.util.F; 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.UtilTime.TimeUnit; +import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; @@ -53,6 +57,8 @@ public class Halloween extends SoloGame private int _maxMobs = 80; private ArrayList _mobs = new ArrayList(); + private HashMap _damageTime = new HashMap(); + private HashSet _soundOff = new HashSet(); public long total = 0; @@ -110,7 +116,7 @@ public class Halloween extends SoloGame this.PrepareFreeze = false; - this.HungerSet = 20; + //this.HungerSet = 20; this.WorldBoundaryKill = false; } @@ -558,4 +564,82 @@ public class Halloween extends SoloGame ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); } } + + private int hungerTick = 0; + @EventHandler + public void Hunger(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + return; + + if (!IsLive()) + return; + + if (_mobs.size() < 30) + { + for (Player player : GetPlayers(true)) + UtilPlayer.hunger(player, 1); + return; + } + + int rate = 4; + if (_mobs.size() > 60) + rate = 3; + if (_mobs.size() > 70) + rate = 2; + if (_mobs.size() >= 80) + rate = 1; + + hungerTick = (hungerTick + 1)%rate; + + for (Player player : GetPlayers(true)) + { + if (_damageTime.containsKey(player)) + { + if (!UtilTime.elapsed(_damageTime.get(player), 2000)) + continue; + } + + player.setSaturation(3f); + player.setExhaustion(0f); + + if (player.getFoodLevel() <= 2) + { + if (Recharge.Instance.use(player, "Food Message", 4000, false, false)) + UtilPlayer.message(player, F.main("Game", "Attack monsters players to restore hunger!")); + } + + if (hungerTick == 0) + { + if (player.getFoodLevel() > 2) + { + UtilPlayer.hunger(player, -1); + } + } + } + } + + @EventHandler(priority = EventPriority.MONITOR) + public void HungerRestore(CustomDamageEvent event) + { + if (event.IsCancelled()) + return; + + if (event.GetDamagerPlayer(true) == null) + return; + + if (event.GetDamage() <= 1) + return; + + Player damager = event.GetDamagerPlayer(true); + if (damager == null) + return; + + if (!Recharge.Instance.use(damager, "Hunger Restore", 100, false, false)) + return; + + _damageTime.put(damager, System.currentTimeMillis()); + + UtilPlayer.hunger(damager, 4); + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobGhast.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobGhast.java index a2adf2c42..25b74f7fd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobGhast.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/MobGhast.java @@ -21,8 +21,8 @@ public class MobGhast extends CreatureBase @Override public void SpawnCustom(Ghast ent) { - ent.setMaxHealth(80); - ent.setHealth(80); + ent.setMaxHealth(55); + ent.setHealth(55); ent.setCustomName("Ghast"); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameSlam.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameSlam.java index 3d08eff13..e3baf43d6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameSlam.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFlameSlam.java @@ -66,6 +66,12 @@ 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 airborne.")); + return; + } + if (!Recharge.Instance.use(player, GetName(), 8000, true, true)) return; From 651791ad83d046d0b1feea87158a8cb4ad223695 Mon Sep 17 00:00:00 2001 From: Chiss Date: Sat, 18 Oct 2014 10:40:08 +1100 Subject: [PATCH 3/5] HH FOod update --- .../nautilus/game/arcade/game/games/halloween/Halloween.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java index 7c7fbfbd8..2451654e7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/Halloween.java @@ -640,6 +640,9 @@ public class Halloween extends SoloGame _damageTime.put(damager, System.currentTimeMillis()); - UtilPlayer.hunger(damager, 4); + if (event.GetCause() == DamageCause.PROJECTILE) + UtilPlayer.hunger(damager, 6); + else + UtilPlayer.hunger(damager, 4); } } From 02ea14bcd1bea86c4674117f123f828dfe769120 Mon Sep 17 00:00:00 2001 From: Chiss Date: Sat, 18 Oct 2014 10:50:17 +1100 Subject: [PATCH 4/5] Damaging Boss restores all hunger --- .../game/games/halloween/creatures/PumpkinKing.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java index f28f74b62..4b0e37cf2 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java @@ -118,6 +118,9 @@ public class PumpkinKing extends CreatureBase if (event.GetDamagerPlayer(true) == null) event.SetCancelled("Non-Player"); + + if (event.GetDamagerPlayer(true) != null) + event.GetDamagerPlayer(true).setFoodLevel(20); event.SetKnockback(false); } @@ -137,6 +140,11 @@ public class PumpkinKing extends CreatureBase event.SetCancelled("Projectile"); UtilPlayer.message(event.GetDamagerPlayer(true), F.main("Boss", "Projectiles cannot harm " + F.elem("Pumpkin Minions") + "!")); } + else + { + if (event.GetDamagerPlayer(true) != null) + event.GetDamagerPlayer(true).setFoodLevel(20); + } } //Attacked Shield else if (_shields.contains(event.GetDamageeEntity())) @@ -150,6 +158,9 @@ public class PumpkinKing extends CreatureBase if (event.GetDamagerPlayer(true) == null) return; + + if (event.GetDamagerPlayer(true) != null) + event.GetDamagerPlayer(true).setFoodLevel(20); //Effect Host.Manager.GetBlood().Effects(event.GetDamageeEntity().getLocation(), 10, 0.2, null, 0f, 0f, Material.BLAZE_POWDER, (byte)0, 10, false); From 68009d3013a18f3f185728141e67554382661f58 Mon Sep 17 00:00:00 2001 From: Chiss Date: Sat, 18 Oct 2014 13:51:25 +1100 Subject: [PATCH 5/5] A little more time to handle wave 5 --- .../nautilus/game/arcade/game/games/halloween/waves/Wave5.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/Wave5.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/Wave5.java index 6feaad4a5..50a89a6dc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/Wave5.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/waves/Wave5.java @@ -10,7 +10,7 @@ public class Wave5 extends WaveBase { public Wave5(Halloween host) { - super(host, "Double the Giants! Double the fun!", 80000, host.GetSpawnSet(1), HalloweenAudio.WAVE_5); + super(host, "Double the Giants! Double the fun!", 90000, host.GetSpawnSet(1), HalloweenAudio.WAVE_5); } @Override