From 76e6b7530fceea17e9e6c5b0c5bcfb58e4fa3987 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 26 Jan 2015 09:09:46 +1300 Subject: [PATCH] Meteors now explode everything on contact. Added spellbook for spectators and pregame. Mana cost now obvious when cooling down. Lowered some random item amounts --- .../game/core/explosion/CustomExplosion.java | 16 +++- .../game/games/wizards/SpellMenuPage.java | 19 +++- .../arcade/game/games/wizards/SpellType.java | 8 ++ .../game/games/wizards/WizardSpellMenu.java | 62 ++++++++++++- .../arcade/game/games/wizards/Wizards.java | 93 +++++++++++-------- 5 files changed, 147 insertions(+), 51 deletions(-) diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java index 6b291cd29..bd2f8a98f 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java @@ -41,6 +41,8 @@ public class CustomExplosion extends Explosion private DamageManager _manager; private String _damageReason; private boolean _dropItems = true; + private boolean _damageBlocksEqually; + private boolean _createFire; public CustomExplosion(DamageManager manager, Location loc, float explosionSize, String deathCause) { @@ -50,12 +52,18 @@ public class CustomExplosion extends Explosion _damageReason = deathCause; } + public CustomExplosion setBlocksDamagedEqually(boolean damageEqually) + { + _damageBlocksEqually = damageEqually; + return this; + } + public CustomExplosion explode() { // Explode the explosion a(); a(true); - + return this; } @@ -116,8 +124,8 @@ public class CustomExplosion extends Explosion if (block.getMaterial() != Material.AIR) { - float f3 = this.source != null ? this.source.a(this, this._world, l, i1, j1, block) : block - .a(this.source); + float f3 = this.source != null ? this.source.a(this, this._world, l, i1, j1, block) + : (_damageBlocksEqually ? Blocks.DIRT : block).a(this.source); f1 -= (f3 + 0.3F) * f2; } @@ -295,7 +303,7 @@ public class CustomExplosion extends Explosion } } - if (this.a) + if (this._createFire) { Iterator iterator = this.blocks.iterator(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellMenuPage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellMenuPage.java index 2fb585829..8a6e58a84 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellMenuPage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellMenuPage.java @@ -57,7 +57,7 @@ public class SpellMenuPage extends ShopPageBase 0) { @@ -65,8 +65,10 @@ public class SpellMenuPage extends ShopPageBase 0) { + usableTime = UtilMath.trim(1, usableTime); + double maxSeconds = Math.max(type.getSpellCooldown(wizard), type.getManaCost(wizard) / (wizard.getManaPerTick() * 20)); - displayProgress(displayCooldown ? C.cRed : C.cBlue, type.getElement().getColor() + type.getSpellName(), - 1f - (usableTime / maxSeconds), - UtilTime.convertString((long) (usableTime * 1000), 1, TimeUnit.FIT), player); + displayProgress(displayCooldown ? C.cRed : C.cDPurple, + type.getElement().getColor() + type.getSpellName(), 1f - (usableTime / maxSeconds), + + (displayCooldown ? + + UtilTime.convertString((long) (usableTime * 1000), 1, TimeUnit.FIT) + + : + + usableTime + (usableTime < 60 ? "s" : "m") + " for mana"), + + player); } else @@ -458,7 +469,7 @@ public class Wizards extends SoloGame { if (!colorChange && (float) i / (float) bars >= amount) { - progressBar +=progressBar;// C.cRed; + progressBar += progressColor;// C.cRed; colorChange = true; } @@ -690,40 +701,40 @@ public class Wizards extends SoloGame { if (Manager.GetClients().Get(event.getPlayer()).GetRank().Has(Rank.DEVELOPER)) { - if (event.getPlayer().getName().equalsIgnoreCase("libraryaddict")) + if (event.getMessage().equalsIgnoreCase("spells")) { - if (event.getMessage().equalsIgnoreCase("spells")) + Wizard wizard = getWizard(event.getPlayer()); + for (SpellType type : SpellType.values()) { - Wizard wizard = getWizard(event.getPlayer()); - for (SpellType type : SpellType.values()) + if (wizard.getSpellLevel(type) < type.getMaxLevel()) { - if (wizard.getSpellLevel(type) < type.getMaxLevel()) - { - wizard.learnSpell(type); - } + wizard.learnSpell(type); } - - event.setCancelled(true); - event.getPlayer().sendMessage("All spells leveled up once"); - } - if (event.getMessage().equalsIgnoreCase("hit me")) - { - summonMeteor(event.getPlayer()); } - if (event.getMessage().startsWith("setyield")) - { - _fireballSize = Float.parseFloat(event.getMessage().split(" ")[1]); - } - - if (event.getMessage().equalsIgnoreCase("end game")) - { - sendMeteors(); - } + event.setCancelled(true); + event.getPlayer().sendMessage("All spells leveled up once"); } - else + + if (event.getMessage().equalsIgnoreCase("overtime")) { - event.getPlayer().sendMessage("Nuh uh"); + setGameLiveTime(System.currentTimeMillis() - (10 * 60 * 1000)); + } + + if (event.getMessage().equalsIgnoreCase("hit me")) + { + summonMeteor(event.getPlayer()); + } + + if (event.getMessage().startsWith("setyield")) + { + _fireballSize = Float.parseFloat(event.getMessage().split(" ")[1]); + } + + if (event.getMessage().equalsIgnoreCase("end game")) + { + sendMeteors(); + event.setCancelled(true); } } } @@ -1336,6 +1347,8 @@ public class Wizards extends SoloGame explosion.setDropItems(false); + explosion.setBlocksDamagedEqually(true); + explosion.explode(); } }