READY 2 GO

This commit is contained in:
Cheese 2015-11-14 12:52:14 +11:00
parent 770e2be44b
commit 259397b6ae
11 changed files with 123 additions and 81 deletions

View File

@ -67,7 +67,7 @@ public enum GameDisplay
Lobbers("Bomb Lobbers", Material.FIREBALL, (byte) 0, GameCategory.ARCADE, 54),
ChampionsCTF("Champions Capture the Flag", "Champions", Material.REDSTONE_BLOCK, (byte)0, GameCategory.CHAMPIONS, 55),
ChampionsCTF("Champions CTF", "Champions", Material.REDSTONE_BLOCK, (byte)0, GameCategory.CHAMPIONS, 55),
Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999);

View File

@ -15,6 +15,7 @@ public enum GameType
CastleSiege("Castle Siege"),
ChampionsTDM("Champions TDM", "Champions"),
ChampionsDominate("Champions Domination", "Champions"),
ChampionsCTF("Champions CTF", "Champions"),
ChampionsMOBA("Champions MOBA", "Champions"),
Christmas("Christmas Chaos"),
DeathTag("Death Tag"),

View File

@ -14,6 +14,7 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
@ -112,7 +113,8 @@ public class BlockToss extends SkillCharge implements IThrown
}
// Ladder and beacon grabs
if (grab.getType() == Material.LADDER || grab.getType() == Material.BEACON || grab.getType() == Material.WEB || grab.getType() == Material.STANDING_BANNER || grab.getType() == Material.WALL_BANNER) {
if (grab.getType() == Material.LADDER || grab.getType() == Material.BEACON || grab.getType() == Material.WEB || grab.getType() == Material.STANDING_BANNER || grab.getType() == Material.WALL_BANNER)
{
UtilPlayer.message(player, F.main(GetName(), "You cannot grab this block."));
return;
}
@ -271,6 +273,19 @@ public class BlockToss extends SkillCharge implements IThrown
}
@EventHandler
public void blockSolidify(EntityChangeBlockEvent event)
{
if (_falling.containsKey(event.getEntity()))
{
event.setCancelled(true);
createBlock((FallingBlock)event.getEntity(), event.getBlock());
_falling.remove(event.getEntity());
}
}
@EventHandler
public void CreateBlock(UpdateEvent event)
{
@ -287,31 +302,27 @@ public class BlockToss extends SkillCharge implements IThrown
continue;
fallIter.remove();
Block block = fall.getLocation().getBlock();
if (block.getType() != fall.getMaterial())
continue;
//No idea why i was doing this
//block.setTypeIdAndData(0, (byte)0, false);
//Added this to fix ^
if (!UtilBlock.airFoliage(block))
continue;
int id = fall.getBlockId();
if (id == 12) id = Material.SANDSTONE.getId();
if (id == 13) id = Material.STONE.getId();
//Block Replace
Factory.BlockRestore().Add(block, fall.getBlockId(), (byte)0, 10000);
//Effect
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getTypeId());
createBlock(fall, fall.getLocation().getBlock());
}
}
public void createBlock(FallingBlock fall, Block block)
{
if (!UtilBlock.airFoliage(block))
return;
int id = fall.getBlockId();
if (id == 12) id = Material.SANDSTONE.getId();
if (id == 13) id = Material.STONE.getId();
//Block Replace
Factory.BlockRestore().Add(block, id, (byte)0, 10000);
//Effect
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getTypeId());
}
@EventHandler
public void ItemSpawn(ItemSpawnEvent event)

View File

@ -18,7 +18,7 @@ public class Colossus extends Skill
SetDesc(new String[]
{
"You are so huge that you take",
"50% less knockback from attacks."
"35% less knockback from attacks."
});
}
@ -36,7 +36,7 @@ public class Colossus extends Skill
//Damage
event.AddMod(damagee.getName(), GetName(), 0, false);
event.AddKnockback(GetName(), 0.5);
event.AddKnockback(GetName(), 0.35);
}
@Override

View File

@ -24,7 +24,7 @@ public class CripplingBlow extends Skill
{
"Your powerful axe attacks give",
"targets Slow 2 for 1.5 second,",
"as well as no knockback."
"as well as 50% less knockback."
});
}
@ -57,7 +57,7 @@ public class CripplingBlow extends Skill
//Damage
event.AddMod(damager.getName(), GetName(), 0, true);
event.SetKnockback(false);
event.AddKnockback(GetName(), 0.5);
//Event
UtilServer.getServer().getPluginManager().callEvent(new SkillEvent(damager, GetName(), ClassType.Brute, damagee));

View File

@ -149,44 +149,60 @@ public class Blizzard extends SkillActive
}
//Target
HashSet<Byte> ignore = new HashSet<Byte>();
ignore.add((byte) 0);
ignore.add((byte) 78);
ignore.add((byte) 80);
// HashSet<Byte> ignore = new HashSet<Byte>();
// ignore.add((byte) 0);
// ignore.add((byte) 78);
// ignore.add((byte) 80);
Block target = cur.getTargetBlock(ignore, 7);
// Block target = cur.getTargetBlock(ignore, 7);
//Snow
if (target == null || target.getType() == Material.AIR || UtilMath.offset(target.getLocation(), cur.getLocation()) > 5)
for (int i=0 ; i<1+level ; i++)
{
Projectile snow = cur.launchProjectile(Snowball.class);
double mult = 0.25 + 0.15 * level;
double x = (0.2 - (UtilMath.r(40)/100d)) * mult;
double y = (UtilMath.r(20)/100d) * mult;
double z = (0.2 - (UtilMath.r(40)/100d)) * mult;
snow.setVelocity(cur.getLocation().getDirection().add(new Vector(x,y,z)).multiply(2));
_snowball.put(snow, cur);
}
if (target == null || target.getType() == Material.AIR)
continue;
if (UtilMath.offset(target.getLocation(), cur.getLocation()) > 7)
continue;
HashMap<Block, Double> blocks = UtilBlock.getInRadius(target.getLocation(), 2d, 1);
for (Block block : blocks.keySet())
//Snowballs
// if (target == null || target.getType() == Material.AIR || UtilMath.offset(target.getLocation(), cur.getLocation()) > 5)
// for (int i=0 ; i<1+level ; i++)
// {
// Projectile snow = cur.launchProjectile(Snowball.class);
//
// double mult = 0.25 + 0.15 * level;
// double x = (0.2 - (UtilMath.r(40)/100d)) * mult;
// double y = (UtilMath.r(20)/100d) * mult;
// double z = (0.2 - (UtilMath.r(40)/100d)) * mult;
//
//
//
// snow.setVelocity(cur.getLocation().getDirection().add(new Vector(x,y,z)).multiply(2));
// _snowball.put(snow, cur);
// }
//
// if (target == null || target.getType() == Material.AIR)
// continue;
//
// if (UtilMath.offset(target.getLocation(), cur.getLocation()) > 7)
// continue;
//
// HashMap<Block, Double> blocks = UtilBlock.getInRadius(target.getLocation(), 2d, 1);
// for (Block block : blocks.keySet())
// {
// Factory.BlockRestore().Snow(block, (byte)(1 + (int)(2*blocks.get(block))), (byte)(7*level), 2500, 250, 3);
// }
//Snowballs
for (int i=0 ; i<1+level ; i++)
{
Factory.BlockRestore().Snow(block, (byte)(1 + (int)(2*blocks.get(block))), (byte)(7*level), 2500, 250, 3);
Projectile snow = cur.launchProjectile(Snowball.class);
double mult = 0.25 + 0.15 * level;
double x = (0.2 - (UtilMath.r(40)/100d)) * mult;
double y = (UtilMath.r(20)/100d) * mult;
double z = (0.2 - (UtilMath.r(40)/100d)) * mult;
snow.setVelocity(cur.getLocation().getDirection().add(new Vector(x,y,z)).multiply(2));
_snowball.put(snow, cur);
}
//Effect
target.getWorld().playEffect(target.getLocation(), Effect.STEP_SOUND, 80);
// target.getWorld().playEffect(target.getLocation(), Effect.STEP_SOUND, 80);
cur.getWorld().playSound(cur.getLocation(), Sound.STEP_SNOW, 0.1f, 0.5f);
}
}
@ -213,17 +229,17 @@ public class Blizzard extends SkillActive
UtilAction.velocity(damagee, proj.getVelocity().multiply(0.1).add(new Vector(0, 0.15, 0)));
}
@EventHandler
public void SnowballForm(ProjectileHitEvent event)
{
if (!(event.getEntity() instanceof Snowball))
return;
if (_snowball.remove(event.getEntity()) == null)
return;
Factory.BlockRestore().Snow(event.getEntity().getLocation().getBlock(), (byte)1, (byte)7, 2000, 250, 0);
}
// @EventHandler
// public void SnowballForm(ProjectileHitEvent event)
// {
// if (!(event.getEntity() instanceof Snowball))
// return;
//
// if (_snowball.remove(event.getEntity()) == null)
// return;
//
// Factory.BlockRestore().Snow(event.getEntity().getLocation().getBlock(), (byte)1, (byte)7, 2000, 250, 0);
// }
@EventHandler
public void clearInvalidSnowballedPlayers(UpdateEvent event)

View File

@ -106,7 +106,7 @@ public class LightningOrb extends SkillActive implements IThrown
//Action
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(57));
item.setVelocity(player.getLocation().getDirection());
Factory.Projectile().AddThrow(item, player, this, System.currentTimeMillis() + 5000 - (400 * level), true, true, false, false,
Factory.Projectile().AddThrow(item, player, this, 5000 - (400 * level), true, true, false, false,
Sound.FIZZ, 0.6f, 1.6f, ParticleType.FIREWORKS_SPARK, UpdateType.TICK, 0.4f);
//Inform

View File

@ -58,7 +58,7 @@ public class HealingShot extends SkillActive
"Prepare a Healing Shot;",
"",
"Your next arrow will give its target",
"Regeneration 3 for #5#1 seconds,",
"Regeneration 3 for #3#1 seconds,",
"and remove all negative effects.",
"",
"Gives Nausea to enemies for #5#1 seconds."
@ -155,7 +155,7 @@ public class HealingShot extends SkillActive
//Regen
if (Factory.Relation().canHurt(damager, damagee))
{
Factory.Condition().Factory().Regen(GetName(), damagee, damager, 5 + level, 2, false, false, false);
Factory.Condition().Factory().Regen(GetName(), damagee, damager, 3 + level, 2, false, false, false);
//Remove Bad
damagee.setFireTicks(0);

View File

@ -160,7 +160,7 @@ public abstract class ItemUsable extends Item implements IThrown
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(GetType()));
UtilAction.velocity(ent, player.getLocation().getDirection(), _throwPower, false, 0, 0.2, 10, false);
Factory.Throw().AddThrow(ent, player, this, expire, _throwPlayer, _throwBlock, _throwIdle, _throwPickup, 0.5f);
Factory.Throw().AddThrow(ent, player, this, expire, _throwPlayer, _throwPlayer, _throwBlock, _throwIdle, _throwPickup, 0.5f);
ThrowCustom(event, ent);
}

View File

@ -111,6 +111,9 @@ public class Fire extends MiniPlugin
if (!_fire.containsKey(fire))
return;
if (_fire.get(fire).GetOwner().equals(player))
return;
event.setCancelled(true);
if (((CraftPlayer)player).getHandle().spectating)

View File

@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.common;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
@ -81,8 +82,8 @@ public class CaptureTheFlag extends TeamGame
//protected String[] _blockedItems = new String[] {"SWORD", "AXE", "BOW"};
private boolean _suddenDeath = false;
private ConcurrentHashMap<Player, List<ItemStack>> _hotbars = new ConcurrentHashMap<Player, List<ItemStack>>();
private ConcurrentHashMap<Player, ItemStack> _helmets = new ConcurrentHashMap<Player, ItemStack>();
private HashMap<Player, List<ItemStack>> _hotbars = new HashMap<Player, List<ItemStack>>();
private HashMap<Player, ItemStack> _helmets = new HashMap<Player, ItemStack>();
private boolean _redFlickerStage = false;
private boolean _blueFlickerStage = false;
@ -190,13 +191,23 @@ public class CaptureTheFlag extends TeamGame
for (Flag flag : _flags)
flag.update();
for (Player player : _hotbars.keySet())
Iterator<Player> hotbarIter = _hotbars.keySet().iterator();
while (hotbarIter.hasNext())
{
Player player = hotbarIter.next();
if (!player.isOnline() || UtilPlayer.isSpectator(player) || !IsAlive(player))
_hotbars.remove(player);
hotbarIter.remove();
}
for (Player player : _helmets.keySet())
Iterator<Player> helmetIter = _helmets.keySet().iterator();
while (helmetIter.hasNext())
{
Player player = helmetIter.next();
if (!player.isOnline() || UtilPlayer.isSpectator(player) || !IsAlive(player))
_helmets.remove(player);
helmetIter.remove();
}
}
else if (event.getType() == UpdateType.TICK)
{