Chicken attack bug fixes, death effect improvements.
This commit is contained in:
parent
0530ea28e7
commit
c5a9f0c42c
@ -1 +1 @@
|
||||
[[{"location":"C:\\@Thanos\\Documents\\Minecraft\\Mineplex\\projects\\Mineplex\\Plugins\\Libraries\\craftbukkit.jar","type":"JAR","hints":{}},"ABSENT"],[{"location":"C:\\@Thanos\\Documents\\Minecraft\\Mineplex\\projects\\Mineplex\\Plugins\\Nautilus.Game.Arcade","type":"PROJECT","hints":{"PROJECT_NAME":"Nautilus.Game.Arcade"}},"ABSENT"]]
|
||||
[[{"location":"C:\\@Thanos\\Documents\\Minecraft\\Mineplex\\projects\\Mineplex\\Plugins\\Mineplex.Core","type":"PROJECT","hints":{"PROJECT_NAME":"Mineplex.Core"}},"ABSENT"],[{"location":"C:\\@Thanos\\Documents\\Minecraft\\Mineplex\\projects\\Mineplex\\Plugins\\Nautilus.Game.Arcade","type":"PROJECT","hints":{"PROJECT_NAME":"Nautilus.Game.Arcade"}},"ABSENT"]]
|
@ -110,11 +110,15 @@ import nautilus.game.arcade.kit.Kit;
|
||||
|
||||
public class MineWare extends TeamGame implements IThrown
|
||||
{
|
||||
// Used for testing.
|
||||
private int _livesAmount = 1;
|
||||
|
||||
// All players that will participate on challenges.
|
||||
private GameTeam _playersTeam;
|
||||
private GameTeam _chickenTeam;
|
||||
|
||||
// All players that have lost their lives and are spectating with a baby chicken morph.
|
||||
private GameTeam _chickenTeam;
|
||||
|
||||
private HashMap<Player, Integer> _lives = new HashMap<Player, Integer>();
|
||||
|
||||
public boolean _currentCrumble = false;
|
||||
@ -155,10 +159,12 @@ public class MineWare extends TeamGame implements IThrown
|
||||
InventoryClick = true;
|
||||
DamageSelf = false;
|
||||
DeathOut = false;
|
||||
DeathTeleport = false;
|
||||
AutomaticRespawn = false;
|
||||
DeathMessages = false;
|
||||
GiveClock = false;
|
||||
CreatureAllow = true;
|
||||
TeleportsDisqualify = false;
|
||||
|
||||
Manager.GetCreature().SetDisableCustomDrops(true);
|
||||
|
||||
@ -186,9 +192,9 @@ public class MineWare extends TeamGame implements IThrown
|
||||
}
|
||||
else if (event.GetState() == GameState.Live)
|
||||
{
|
||||
_chickenTeam = new GameTeam(this, "Chickens", ChatColor.WHITE, _playersTeam.GetSpawns());
|
||||
_chickenTeam.SetVisible(false);
|
||||
GetTeamList().add(_chickenTeam);
|
||||
_chickenTeam = new GameTeam(this, "Chickens", ChatColor.GRAY, _playersTeam.GetSpawns());
|
||||
_chickenTeam.SetVisible(false);
|
||||
AddTeam(_chickenTeam);
|
||||
}
|
||||
}
|
||||
|
||||
@ -338,7 +344,7 @@ public class MineWare extends TeamGame implements IThrown
|
||||
Manager.GetLobby().DisplayWaiting();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onBlood(BloodEvent event)
|
||||
{
|
||||
|
@ -17,8 +17,10 @@ import org.bukkit.scheduler.BukkitRunnable;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTextMiddle;
|
||||
import mineplex.core.disguise.disguises.DisguiseChicken;
|
||||
import mineplex.core.visibility.VisibilityManager;
|
||||
import nautilus.game.arcade.game.games.mineware.MineWare;
|
||||
|
||||
public class ChickenAttack
|
||||
@ -62,40 +64,29 @@ public class ChickenAttack
|
||||
private void createTestPlatform()
|
||||
{
|
||||
ArrayList<Block> platform = UtilBlock.getInBoundingBox(_corner1, _corner2, false);
|
||||
|
||||
|
||||
for (Block block : platform)
|
||||
{
|
||||
if (block.getLocation().equals(_center.clone().subtract(0, 1.0, 0)))
|
||||
{
|
||||
block.setType(Material.DIAMOND_BLOCK);
|
||||
}
|
||||
else
|
||||
{
|
||||
block.setType(Material.STONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void start(Player player)
|
||||
{
|
||||
System.out.println("");
|
||||
System.out.println("Team: " + _host.getChickenTeam().GetName());
|
||||
System.out.println("Player: " + player.getName());
|
||||
System.out.println("");
|
||||
_host.getPlayersTeam().RemovePlayer(player);
|
||||
_host.getChickenTeam().AddPlayer(player, true);
|
||||
|
||||
_host.getChickenTeam().AddPlayer(player, false);
|
||||
|
||||
// _host.SetPlayerTeam(player, _host.getChickenTeam(), false);
|
||||
UtilInv.Clear(player);
|
||||
|
||||
player.teleport(_center);
|
||||
player.setGameMode(GameMode.ADVENTURE);
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
|
||||
UtilTextMiddle.display(null, C.cRed + C.Bold + "Chicken Attack!", 5, 40, 5, player);
|
||||
player.playSound(player.getLocation(), Sound.WITHER_SPAWN, 1.0F, 1.0F);
|
||||
|
||||
debugDeathTask(player);
|
||||
System.out.println("3");
|
||||
System.out.println("Chicken attack triggered for " + player.getName() + ".");
|
||||
}
|
||||
|
||||
private void debugDeathTask(Player player)
|
||||
@ -115,15 +106,17 @@ public class ChickenAttack
|
||||
|
||||
private void kill(Player player)
|
||||
{
|
||||
System.out.println("Killed: " + player.getName());
|
||||
|
||||
DisguiseChicken disguise = new DisguiseChicken(player);
|
||||
disguise.setBaby();
|
||||
_host.Manager.GetDisguise().disguise(disguise, player);
|
||||
_host.Manager.GetDisguise().disguise(disguise, UtilServer.getPlayers());
|
||||
|
||||
player.teleport(_host.GetSpectatorLocation());
|
||||
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
|
||||
player.setAllowFlight(true);
|
||||
player.setFlying(true);
|
||||
|
||||
player.playSound(player.getLocation(), Sound.BAT_TAKEOFF, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
private void spawnChickens()
|
||||
@ -146,6 +139,8 @@ public class ChickenAttack
|
||||
private void customizeChicken(Chicken chicken)
|
||||
{
|
||||
_chickens.add(chicken);
|
||||
|
||||
// TODO: Make chickens attack player.
|
||||
}
|
||||
|
||||
public void reset()
|
||||
|
@ -35,10 +35,14 @@ public class DeathEffect
|
||||
private DeathText _deathText = new DeathText();
|
||||
private ArrayList<DeathEffectData> _data = new ArrayList<DeathEffectData>();
|
||||
|
||||
private double _foodDropHeight = 0.5;
|
||||
private double _hologramHeight = 2.2;
|
||||
private double _cloudParticleHeight = 1.7;
|
||||
|
||||
public DeathEffect(MineWare host)
|
||||
{
|
||||
_host = host;
|
||||
_plugin = host.getArcadeManager().getPlugin();
|
||||
_plugin = host.Manager.getPlugin();
|
||||
}
|
||||
|
||||
public void playDeath(Player player, Location death)
|
||||
@ -60,7 +64,7 @@ public class DeathEffect
|
||||
|
||||
private void startFoodSpawnTask(DeathEffectData data)
|
||||
{
|
||||
Location dropsite = data.getLocation().clone().add(0, 0.5, 0);
|
||||
Location dropsite = data.getLocation().clone().add(0, _foodDropHeight, 0);
|
||||
ArrayList<Item> foodItems = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < 15; i++)
|
||||
@ -134,8 +138,11 @@ public class DeathEffect
|
||||
|
||||
private Hologram getRandomHologram(Location loc)
|
||||
{
|
||||
Hologram hologram = new Hologram(_host.getArcadeManager().getHologramManager(), loc.clone().add(0, 2.2, 0),
|
||||
C.cAqua + C.Bold + _deathText.getRandom() + C.Reset);
|
||||
Hologram hologram = new Hologram(
|
||||
_host.getArcadeManager().getHologramManager(),
|
||||
loc.clone().add(0, _hologramHeight, 0),
|
||||
C.cAqua + C.Bold + _deathText.getRandom() + C.Reset
|
||||
);
|
||||
|
||||
return hologram;
|
||||
}
|
||||
@ -186,7 +193,7 @@ public class DeathEffect
|
||||
return;
|
||||
}
|
||||
|
||||
UtilParticle.PlayParticleToAll(ParticleType.CLOUD, data.getLocation().clone().add(0, 1.7, 0), 0.2F,
|
||||
UtilParticle.PlayParticleToAll(ParticleType.CLOUD, data.getLocation().clone().add(0, _cloudParticleHeight, 0), 0.2F,
|
||||
0.2F, 0.2F, 0.0F, 10, ViewDist.NORMAL);
|
||||
|
||||
chickenHead.remove();
|
||||
|
Loading…
Reference in New Issue
Block a user