Revert wizard commits

This commit is contained in:
libraryaddict 2015-03-27 22:13:50 +13:00
parent a772d4cbf2
commit b84756ef7a
7 changed files with 76 additions and 123 deletions

View File

@ -25,6 +25,7 @@ import org.bukkit.block.Block;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.FallingBlock; import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed; import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -302,11 +303,6 @@ public class Explosion extends MiniPlugin
} }
public void BlockExplosion(Collection<Block> blockSet, Location mid, boolean onlyAbove) public void BlockExplosion(Collection<Block> blockSet, Location mid, boolean onlyAbove)
{
BlockExplosion(blockSet, mid, onlyAbove, true);
}
public void BlockExplosion(Collection<Block> blockSet, Location mid, boolean onlyAbove, boolean removeBlock)
{ {
if (blockSet.isEmpty()) if (blockSet.isEmpty())
return; return;
@ -324,11 +320,8 @@ public class Explosion extends MiniPlugin
blocks.put(cur, new AbstractMap.SimpleEntry<Integer, Byte>(cur.getTypeId(), cur.getData())); blocks.put(cur, new AbstractMap.SimpleEntry<Integer, Byte>(cur.getTypeId(), cur.getData()));
if (removeBlock)
{
cur.setType(Material.AIR); cur.setType(Material.AIR);
} }
}
//DELAY //DELAY
final Location fLoc = mid; final Location fLoc = mid;

View File

@ -45,10 +45,8 @@ public class CustomExplosion extends Explosion
private boolean _createFire; private boolean _createFire;
private boolean _ignoreRate = true; private boolean _ignoreRate = true;
private float _blockExplosionSize; private float _blockExplosionSize;
private boolean _fallingBlockExplosion;
private mineplex.core.explosion.Explosion _explosion;
public CustomExplosion(DamageManager manager, mineplex.core.explosion.Explosion explosion, Location loc, float explosionSize, String deathCause) public CustomExplosion(DamageManager manager, Location loc, float explosionSize, String deathCause)
{ {
super(((CraftWorld) loc.getWorld()).getHandle(), null, loc.getX(), loc.getY(), loc.getZ(), explosionSize); super(((CraftWorld) loc.getWorld()).getHandle(), null, loc.getX(), loc.getY(), loc.getZ(), explosionSize);
@ -56,7 +54,6 @@ public class CustomExplosion extends Explosion
_manager = manager; _manager = manager;
_damageReason = deathCause; _damageReason = deathCause;
_blockExplosionSize = explosionSize; _blockExplosionSize = explosionSize;
_explosion = explosion;
} }
public CustomExplosion setBlockExplosionSize(float explosionSize) public CustomExplosion setBlockExplosionSize(float explosionSize)
@ -73,13 +70,6 @@ public class CustomExplosion extends Explosion
return this; return this;
} }
public CustomExplosion setFallingBlockExplosion(boolean fallingBlockExplosion)
{
_fallingBlockExplosion = fallingBlockExplosion;
return this;
}
public CustomExplosion setDamageBlocks(boolean damageBlocks) public CustomExplosion setDamageBlocks(boolean damageBlocks)
{ {
b = damageBlocks; b = damageBlocks;
@ -292,11 +282,6 @@ public class CustomExplosion extends Explosion
return; return;
} }
if (_fallingBlockExplosion)
{
_explosion.BlockExplosion(event.GetBlocks(), new Location(_world.getWorld(), posX, posY, posZ), false, false);
}
Iterator iterator = this.blocks.iterator(); Iterator iterator = this.blocks.iterator();
while (iterator.hasNext()) while (iterator.hasNext())

View File

@ -25,23 +25,15 @@ public class SpellButton implements IButton
Wizard wizard = _spellPage.getWizards().getWizard(player); Wizard wizard = _spellPage.getWizards().getWizard(player);
if (wizard != null) if (wizard != null)
{
if (clickType.isLeftClick())
{ {
wizard.setSpell(player.getInventory().getHeldItemSlot(), _spell); wizard.setSpell(player.getInventory().getHeldItemSlot(), _spell);
player.sendMessage(C.cBlue + "Set spell on wand to " + _spell.getElement().getColor() + _spell.getSpellName()); player.sendMessage(C.cBlue + "Set spell on wand to " + _spell.getElement().getColor() + _spell.getSpellName());
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 10, 1); player.playSound(player.getLocation(), Sound.ORB_PICKUP, 10, 1);
}
else
{
_spellPage.getWizards().castSpell(player, wizard, _spell, null);
}
_spellPage.getWizards().drawUtilTextBottom(player); _spellPage.getWizards().drawUtilTextBottom(player);
_spellPage.getWizards().changeWandsTitles(player); _spellPage.getWizards().changeWandsTitles(player);
player.closeInventory();
} }
} }

View File

@ -76,10 +76,6 @@ public class SpellMenuPage extends ShopPageBase<WizardSpellMenu, WizardSpellMenu
builder.addLore(C.cGray + lore, 35); builder.addLore(C.cGray + lore, 35);
} }
builder.addLore("");
builder.addLore(C.cPurple + C.Bold + "LEFT CLICK" + C.cDGreen + " Bind spell");
builder.addLore(C.cGreen + C.Bold + "RIGHT CLICK" + C.cBlue + " Instant Cast");
if (wizard == null) if (wizard == null)
{ {
addItem(i, new ShopItem(builder.build(), spell.name(), spell.name(), 1, true, true)); addItem(i, new ShopItem(builder.build(), spell.name(), spell.name(), 1, true, true));

View File

@ -3,12 +3,9 @@ package nautilus.game.arcade.game.games.wizards.spells;
import java.util.List; import java.util.List;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import nautilus.game.arcade.game.games.wizards.Spell; import nautilus.game.arcade.game.games.wizards.Spell;
import nautilus.game.arcade.game.games.wizards.spellinterfaces.SpellClick; import nautilus.game.arcade.game.games.wizards.spellinterfaces.SpellClick;
import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
@ -24,32 +21,21 @@ public class SpellLightningStrike extends Spell implements SpellClick
{ {
@Override @Override
public void castSpell(final Player p) public void castSpell(Player p)
{ {
List<Block> list = p.getLastTwoTargetBlocks(UtilBlock.blockAirFoliageSet, 150); List<Block> list = p.getLastTwoTargetBlocks(UtilBlock.blockAirFoliageSet, 150);
if (list.size() > 1) if (list.size() > 1)
{ {
final Location loc = list.get(0).getLocation().add(0.5, 0, 0.5); Location loc = list.get(0).getLocation();
while (UtilBlock.solid(loc.getBlock().getRelative(BlockFace.UP))) while (UtilBlock.solid(loc.getBlock().getRelative(BlockFace.UP)))
{ {
loc.add(0, 1, 0); loc.add(0, 1, 0);
} }
UtilParticle.PlayParticle(ParticleType.ANGRY_VILLAGER, loc.clone().add(0, 1.3, 0), 0.5F, 0.3F, 0.5F, 0, 7);
Bukkit.getScheduler().scheduleSyncDelayedTask(Wizards.getArcadeManager().getPlugin(), new Runnable()
{
@Override
public void run()
{
LightningStrike lightning = p.getWorld().strikeLightning(loc); LightningStrike lightning = p.getWorld().strikeLightning(loc);
lightning.setMetadata("Damager", new FixedMetadataValue(Wizards.getArcadeManager().getPlugin(), p)); lightning.setMetadata("Damager", new FixedMetadataValue(Wizards.getArcadeManager().getPlugin(), p));
}
}, 20);
charge(p); charge(p);
} }

View File

@ -10,7 +10,7 @@ public class SpellSpeedBoost extends Spell implements SpellClick
@Override @Override
public void castSpell(Player p) public void castSpell(Player p)
{ {
int ticks = 20 * 20; int ticks = 30 * getSpellLevel(p) * 20;
int potionLevel = getSpellLevel(p); int potionLevel = getSpellLevel(p);
Wizards.getArcadeManager().GetCondition().Factory().Speed("Speed Boost", p, p, ticks, potionLevel, false, false, false); Wizards.getArcadeManager().GetCondition().Factory().Speed("Speed Boost", p, p, ticks, potionLevel, false, false, false);

View File

@ -43,7 +43,7 @@ public class SpellSummonWolves extends Spell implements SpellClick, SpellClickBl
Location loc = block.getLocation().add(0.5, 0, 0.5); Location loc = block.getLocation().add(0.5, 0, 0.5);
for (int i = 0; i < getSpellLevel(player); i++) for (int i = 0; i < 2 + getSpellLevel(player); i++)
{ {
Wizards.CreatureAllowOverride = true; Wizards.CreatureAllowOverride = true;
@ -57,10 +57,11 @@ public class SpellSummonWolves extends Spell implements SpellClick, SpellClickBl
wolf.setBreed(false); wolf.setBreed(false);
wolf.setCustomName(player.getDisplayName() + "'s Wolf"); wolf.setCustomName(player.getDisplayName() + "'s Wolf");
wolf.setRemoveWhenFarAway(false); wolf.setRemoveWhenFarAway(false);
wolf.setMaxHealth(0.5); wolf.setMaxHealth(2);
wolf.setHealth(0.5); wolf.setHealth(2);
// wolf.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 9001, 0));
_summonedWolves.put(wolf, System.currentTimeMillis() + (30L * 1000L)); this._summonedWolves.put(wolf, System.currentTimeMillis() + (30L * 1000L));
} }
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, loc, 0.8F, 0, 0.8F, 0, 4); UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, loc, 0.8F, 0, 0.8F, 0, 4);