More dom changes
This commit is contained in:
parent
386e2e3067
commit
52ac670f3f
@ -250,4 +250,12 @@ public class ConditionFactory
|
||||
ConditionType.BLINDNESS, mult, (int)(20 * duration), extend,
|
||||
Material.EYE_OF_ENDER, (byte)0, showIndicator, ambient));
|
||||
}
|
||||
|
||||
public Condition NightVision(String reason, LivingEntity ent, LivingEntity source,
|
||||
double duration, int mult, boolean extend, boolean showIndicator, boolean ambient)
|
||||
{
|
||||
return Manager.AddCondition(new Condition(Manager, reason, ent, source,
|
||||
ConditionType.NIGHT_VISION, mult, (int)(20 * duration), extend,
|
||||
Material.EYE_OF_ENDER, (byte)0, showIndicator, ambient));
|
||||
}
|
||||
}
|
||||
|
@ -131,6 +131,7 @@ public abstract class Game implements Listener
|
||||
public boolean DeathOut = true;
|
||||
public boolean DeathDropItems = false;
|
||||
public boolean DeathMessages = true;
|
||||
public double DeathSpectateSecs = 0;
|
||||
|
||||
public boolean QuitOut = true;
|
||||
|
||||
|
@ -20,6 +20,7 @@ import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.TeamGame;
|
||||
import nautilus.game.arcade.game.games.champions.kits.*;
|
||||
import nautilus.game.arcade.game.games.champions.map.*;
|
||||
import nautilus.game.arcade.game.games.smash.kits.*;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
|
||||
public class Champions extends TeamGame
|
||||
@ -45,7 +46,12 @@ public class Champions extends TeamGame
|
||||
|
||||
new Kit[]
|
||||
{
|
||||
new KitKnight(manager)
|
||||
new KitWitherSkeleton(manager),
|
||||
new KitBlaze(manager),
|
||||
new KitGolem(manager),
|
||||
new KitSlime(manager),
|
||||
new KitChicken(manager),
|
||||
new KitSpider(manager),
|
||||
},
|
||||
|
||||
new String[]
|
||||
@ -59,7 +65,9 @@ public class Champions extends TeamGame
|
||||
this.DeathOut = false;
|
||||
this.PrepareFreeze = false;
|
||||
|
||||
_shop = new ClassCombatCustomBuildShop(null, null, manager.GetDonation(), "Class Setup");
|
||||
this.DeathSpectateSecs = 8;
|
||||
|
||||
//_shop = new ClassCombatCustomBuildShop(null, null, manager.GetDonation(), "Class Setup");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,6 +8,7 @@ import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.minecraft.game.classcombat.Class.ClientClass;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
@ -35,16 +36,23 @@ public class KitKnight extends Kit
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ApplyKit(Player player)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
{
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD));
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW));
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.ARROW, 64));
|
||||
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.FENCE, (byte)0, 2, F.item("Castle Barricade")));
|
||||
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||
|
||||
|
||||
player.getInventory().setHelmet(ItemStackFactory.Instance.CreateStack(Material.IRON_HELMET));
|
||||
player.getInventory().setChestplate(ItemStackFactory.Instance.CreateStack(Material.IRON_CHESTPLATE));
|
||||
player.getInventory().setLeggings(ItemStackFactory.Instance.CreateStack(Material.IRON_LEGGINGS));
|
||||
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.IRON_BOOTS));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -14,6 +14,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.FireworkEffect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.FireworkEffect.Type;
|
||||
@ -39,6 +40,8 @@ public class CapturePoint
|
||||
private boolean _captured = false;
|
||||
private ArrayList<Block> _captureFloor = new ArrayList<Block>();
|
||||
private long _decayDelay = 0;
|
||||
|
||||
private int _indicatorTick = 0;
|
||||
|
||||
public CapturePoint(Champions host, String name, Location loc)
|
||||
{
|
||||
@ -102,6 +105,9 @@ public class CapturePoint
|
||||
{
|
||||
for (Player player : team.GetPlayers(true))
|
||||
{
|
||||
if (player.getGameMode() != GameMode.SURVIVAL)
|
||||
continue;
|
||||
|
||||
if (Math.abs(_loc.getX() - player.getLocation().getX()) > 2.5)
|
||||
continue;
|
||||
|
||||
@ -227,7 +233,12 @@ public class CapturePoint
|
||||
//Count Up
|
||||
if (_owner != null && _owner.equals(team))
|
||||
{
|
||||
_captureAmount = Math.min(_captureMax, (_captureAmount + (_captureRate*count)));
|
||||
//Given if the other team hadnt actually captured it fully
|
||||
int bonus = 0;
|
||||
if (_captured)
|
||||
bonus = 1;
|
||||
|
||||
_captureAmount = Math.min(_captureMax, (_captureAmount + ((_captureRate*count)+bonus)));
|
||||
|
||||
//Floor Color
|
||||
while ((double)_captureFloor.size()/((double)_captureFloor.size() + (double)_floor.size()) < _captureAmount/_captureMax)
|
||||
@ -305,8 +316,10 @@ public class CapturePoint
|
||||
|
||||
public void Indicate(Color color)
|
||||
{
|
||||
for (Block block : _indicators)
|
||||
Firework(block.getLocation().add(0.5, 0.5, 0.5), color, false);
|
||||
//for (Block block : _indicators)
|
||||
Firework(_indicators.get(_indicatorTick).getLocation().add(0.5, 0.5, 0.5), color, false);
|
||||
|
||||
_indicatorTick = (_indicatorTick + 1)%_indicators.size();
|
||||
}
|
||||
|
||||
public String GetScoreboardName()
|
||||
|
@ -10,6 +10,7 @@ import nautilus.game.arcade.game.games.champions.Champions;
|
||||
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.FireworkEffect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.FireworkEffect.Type;
|
||||
@ -79,6 +80,9 @@ public class Emerald
|
||||
if (!Host.IsAlive(player))
|
||||
return;
|
||||
|
||||
if (player.getGameMode() != GameMode.SURVIVAL)
|
||||
return;
|
||||
|
||||
GameTeam team = Host.GetTeam(player);
|
||||
if (team == null) return;
|
||||
|
||||
|
@ -10,6 +10,7 @@ import nautilus.game.arcade.game.games.champions.Champions;
|
||||
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.FireworkEffect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.FireworkEffect.Type;
|
||||
@ -79,6 +80,9 @@ public class Resupply
|
||||
if (!Host.IsAlive(player))
|
||||
return;
|
||||
|
||||
if (player.getGameMode() != GameMode.SURVIVAL)
|
||||
return;
|
||||
|
||||
GameTeam team = Host.GetTeam(player);
|
||||
if (team == null) return;
|
||||
|
||||
|
@ -6,6 +6,7 @@ import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
@ -523,7 +524,7 @@ public class GameFlagManager implements Listener
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void PlayerDeath(PlayerDeathEvent event)
|
||||
{
|
||||
Game game = Manager.GetGame();
|
||||
final Game game = Manager.GetGame();
|
||||
if (game == null) return;
|
||||
|
||||
final Player player = event.getEntity();
|
||||
@ -537,7 +538,7 @@ public class GameFlagManager implements Listener
|
||||
player.getWorld().dropItem(player.getLocation(), stack);
|
||||
event.getDrops().clear();
|
||||
|
||||
//Player State
|
||||
//DEATH OUT
|
||||
if (game.GetState() == GameState.Live && game.DeathOut)
|
||||
{
|
||||
//Event
|
||||
@ -550,24 +551,55 @@ public class GameFlagManager implements Listener
|
||||
}
|
||||
}
|
||||
|
||||
//Teleport
|
||||
if (game.IsAlive(player))
|
||||
//RESPAW
|
||||
if (game.DeathSpectateSecs <= 0)
|
||||
{
|
||||
game.RespawnPlayer(player);
|
||||
}
|
||||
//Teleport
|
||||
if (game.IsAlive(player))
|
||||
{
|
||||
game.RespawnPlayer(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
game.SetSpectator(player);
|
||||
}
|
||||
|
||||
Manager.GetPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
player.setFireTicks(0);
|
||||
player.setVelocity(new Vector(0,0,0));
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
game.SetSpectator(player);
|
||||
}
|
||||
|
||||
Manager.GetPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable()
|
||||
{
|
||||
public void run()
|
||||
UtilInv.Clear(player);
|
||||
Manager.GetCondition().Factory().Blind("Ghost", player, player, 1.5, 0, false, false, false);
|
||||
Manager.GetCondition().Factory().Cloak("Ghost", player, player, game.DeathSpectateSecs, false, false);
|
||||
player.setGameMode(GameMode.CREATIVE);
|
||||
player.setFlying(true);
|
||||
|
||||
Manager.GetPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable()
|
||||
{
|
||||
player.setFireTicks(0);
|
||||
player.setVelocity(new Vector(0,0,0));
|
||||
}
|
||||
}, 0);
|
||||
public void run()
|
||||
{
|
||||
//Teleport
|
||||
if (game.IsAlive(player))
|
||||
{
|
||||
game.RespawnPlayer(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
game.SetSpectator(player);
|
||||
}
|
||||
|
||||
player.setFireTicks(0);
|
||||
player.setVelocity(new Vector(0,0,0));
|
||||
}
|
||||
}, (int)(game.DeathSpectateSecs * 20d));
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
Loading…
Reference in New Issue
Block a user