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.EntityType;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.EventHandler;
@ -302,11 +303,6 @@ public class Explosion extends MiniPlugin
}
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())
return;
@ -324,10 +320,7 @@ public class Explosion extends MiniPlugin
blocks.put(cur, new AbstractMap.SimpleEntry<Integer, Byte>(cur.getTypeId(), cur.getData()));
if (removeBlock)
{
cur.setType(Material.AIR);
}
cur.setType(Material.AIR);
}
//DELAY

View File

@ -45,10 +45,8 @@ public class CustomExplosion extends Explosion
private boolean _createFire;
private boolean _ignoreRate = true;
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);
@ -56,7 +54,6 @@ public class CustomExplosion extends Explosion
_manager = manager;
_damageReason = deathCause;
_blockExplosionSize = explosionSize;
_explosion = explosion;
}
public CustomExplosion setBlockExplosionSize(float explosionSize)
@ -73,13 +70,6 @@ public class CustomExplosion extends Explosion
return this;
}
public CustomExplosion setFallingBlockExplosion(boolean fallingBlockExplosion)
{
_fallingBlockExplosion = fallingBlockExplosion;
return this;
}
public CustomExplosion setDamageBlocks(boolean damageBlocks)
{
b = damageBlocks;
@ -292,11 +282,6 @@ public class CustomExplosion extends Explosion
return;
}
if (_fallingBlockExplosion)
{
_explosion.BlockExplosion(event.GetBlocks(), new Location(_world.getWorld(), posX, posY, posZ), false, false);
}
Iterator iterator = this.blocks.iterator();
while (iterator.hasNext())

View File

@ -10,39 +10,31 @@ import org.bukkit.event.inventory.ClickType;
public class SpellButton implements IButton
{
private SpellType _spell;
private SpellMenuPage _spellPage;
private SpellType _spell;
private SpellMenuPage _spellPage;
public SpellButton(SpellMenuPage spellPage, SpellType spell)
{
_spell = spell;
_spellPage = spellPage;
}
public SpellButton(SpellMenuPage spellPage, SpellType spell)
{
_spell = spell;
_spellPage = spellPage;
}
@Override
public void onClick(Player player, ClickType clickType)
{
Wizard wizard = _spellPage.getWizards().getWizard(player);
@Override
public void onClick(Player player, ClickType clickType)
{
Wizard wizard = _spellPage.getWizards().getWizard(player);
if (wizard != null)
{
if (clickType.isLeftClick())
{
wizard.setSpell(player.getInventory().getHeldItemSlot(), _spell);
if (wizard != null)
{
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);
}
else
{
_spellPage.getWizards().castSpell(player, wizard, _spell, null);
}
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 10, 1);
_spellPage.getWizards().drawUtilTextBottom(player);
_spellPage.getWizards().changeWandsTitles(player);
player.closeInventory();
}
}
_spellPage.getWizards().drawUtilTextBottom(player);
_spellPage.getWizards().changeWandsTitles(player);
}
}
}

View File

@ -73,14 +73,10 @@ public class SpellMenuPage extends ShopPageBase<WizardSpellMenu, WizardSpellMenu
for (String lore : spell.getDesc())
{
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));
}

View File

@ -3,12 +3,9 @@ package nautilus.game.arcade.game.games.wizards.spells;
import java.util.List;
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.spellinterfaces.SpellClick;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
@ -23,60 +20,49 @@ import org.bukkit.metadata.FixedMetadataValue;
public class SpellLightningStrike extends Spell implements SpellClick
{
@Override
public void castSpell(final Player p)
{
List<Block> list = p.getLastTwoTargetBlocks(UtilBlock.blockAirFoliageSet, 150);
if (list.size() > 1)
{
final Location loc = list.get(0).getLocation().add(0.5, 0, 0.5);
@Override
public void castSpell(Player p)
{
List<Block> list = p.getLastTwoTargetBlocks(UtilBlock.blockAirFoliageSet, 150);
if (list.size() > 1)
{
Location loc = list.get(0).getLocation();
while (UtilBlock.solid(loc.getBlock().getRelative(BlockFace.UP)))
{
loc.add(0, 1, 0);
}
while (UtilBlock.solid(loc.getBlock().getRelative(BlockFace.UP)))
{
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);
LightningStrike lightning = p.getWorld().strikeLightning(loc);
Bukkit.getScheduler().scheduleSyncDelayedTask(Wizards.getArcadeManager().getPlugin(), new Runnable()
{
lightning.setMetadata("Damager", new FixedMetadataValue(Wizards.getArcadeManager().getPlugin(), p));
@Override
public void run()
{
LightningStrike lightning = p.getWorld().strikeLightning(loc);
charge(p);
}
}
lightning.setMetadata("Damager", new FixedMetadataValue(Wizards.getArcadeManager().getPlugin(), p));
}
@EventHandler
public void onEntityDamage(EntityDamageByEntityEvent event)
{
if (event.getDamager() instanceof LightningStrike && event.getEntity() instanceof LivingEntity)
{
LightningStrike lightning = (LightningStrike) event.getDamager();
if (lightning.hasMetadata("Damager"))
{
event.setCancelled(true);
}, 20);
if (!lightning.hasMetadata("IgnoreDamage"))
{
lightning.setMetadata("IgnoreDamage", new FixedMetadataValue(Wizards.getArcadeManager().getPlugin(), null));
charge(p);
}
}
@EventHandler
public void onEntityDamage(EntityDamageByEntityEvent event)
{
if (event.getDamager() instanceof LightningStrike && event.getEntity() instanceof LivingEntity)
{
LightningStrike lightning = (LightningStrike) event.getDamager();
if (lightning.hasMetadata("Damager"))
{
event.setCancelled(true);
if (!lightning.hasMetadata("IgnoreDamage"))
{
lightning.setMetadata("IgnoreDamage", new FixedMetadataValue(Wizards.getArcadeManager().getPlugin(), null));
Wizards.getArcadeManager()
.GetDamage()
.NewDamageEvent((LivingEntity) event.getEntity(),
(Player) lightning.getMetadata("Damager").get(0).value(), null, DamageCause.LIGHTNING,
event.getDamage(), false, true, false, "Lightning Strike", "Lightning Strike");
}
}
}
}
Wizards.getArcadeManager()
.GetDamage()
.NewDamageEvent((LivingEntity) event.getEntity(),
(Player) lightning.getMetadata("Damager").get(0).value(), null, DamageCause.LIGHTNING,
event.getDamage(), false, true, false, "Lightning Strike", "Lightning Strike");
}
}
}
}
}

View File

@ -7,14 +7,14 @@ import org.bukkit.entity.Player;
public class SpellSpeedBoost extends Spell implements SpellClick
{
@Override
public void castSpell(Player p)
{
int ticks = 20 * 20;
int potionLevel = getSpellLevel(p);
@Override
public void castSpell(Player p)
{
int ticks = 30 * getSpellLevel(p) * 20;
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);
charge(p);
}
charge(p);
}
}

View File

@ -43,7 +43,7 @@ public class SpellSummonWolves extends Spell implements SpellClick, SpellClickBl
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;
@ -57,10 +57,11 @@ public class SpellSummonWolves extends Spell implements SpellClick, SpellClickBl
wolf.setBreed(false);
wolf.setCustomName(player.getDisplayName() + "'s Wolf");
wolf.setRemoveWhenFarAway(false);
wolf.setMaxHealth(0.5);
wolf.setHealth(0.5);
wolf.setMaxHealth(2);
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);