spawns after tutorial and Giants facing each other.
This commit is contained in:
parent
b0e16f6612
commit
a3d6af884d
@ -21,12 +21,10 @@ import mineplex.core.common.util.UtilShapes;
|
||||
import mineplex.core.common.util.UtilTextBottom;
|
||||
import mineplex.core.common.util.UtilTextMiddle;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
import mineplex.core.hologram.Hologram;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.visibility.VisibilityManager;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
@ -41,6 +39,7 @@ import nautilus.game.arcade.game.games.typewars.stats.HoarderStatTracker;
|
||||
import nautilus.game.arcade.game.games.typewars.stats.PerfectionistStatTracker;
|
||||
import nautilus.game.arcade.game.games.typewars.stats.WaitForItStatTracker;
|
||||
import nautilus.game.arcade.game.games.typewars.tutorial.TutorialTypeWars;
|
||||
import nautilus.game.arcade.gametutorial.events.GameTutorialEndEvent;
|
||||
import nautilus.game.arcade.gametutorial.events.GameTutorialStartEvent;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.world.WorldData;
|
||||
@ -50,7 +49,6 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Creeper;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Giant;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -72,7 +70,6 @@ public class TypeWars extends TeamGame
|
||||
private ArrayList<Minion> _activeMinions;
|
||||
private ArrayList<Minion> _deadMinions;
|
||||
private ArrayList<Minion> _finishedMinions;
|
||||
private ArrayList<Minion> _attackingMinions;
|
||||
|
||||
private HashMap<Player, Integer> _moneyMap;
|
||||
|
||||
@ -149,7 +146,6 @@ public class TypeWars extends TeamGame
|
||||
_minionsSpawned = new HashMap<>();
|
||||
_giantsAttacked = new HashMap<>();
|
||||
_playerTitles = new HashSet<>();
|
||||
_attackingMinions = new ArrayList<>();
|
||||
|
||||
_animationTicks = 0;
|
||||
_nukeFrame = 0;
|
||||
@ -201,21 +197,15 @@ public class TypeWars extends TeamGame
|
||||
Location red = WorldData.GetDataLocs("PURPLE").get(0);
|
||||
Location blue = WorldData.GetDataLocs("LIME").get(0);
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
red.getWorld().getBlockAt(red).setType(Material.STONE);
|
||||
blue.getWorld().getBlockAt(blue).setType(Material.STONE);
|
||||
|
||||
red.add(0, 1, 0);
|
||||
blue.add(0,1,0);
|
||||
}
|
||||
red.setPitch(UtilAlg.GetPitch(UtilAlg.getTrajectory(red, blue)));
|
||||
red.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(red, blue)));
|
||||
|
||||
blue.setPitch(UtilAlg.GetPitch(UtilAlg.getTrajectory(blue, red)));
|
||||
blue.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(blue, red)));
|
||||
|
||||
red.add(0, 1, 0);
|
||||
blue.add(0, 1, 0);
|
||||
|
||||
red.setYaw(UtilAlg.GetYaw(new Vector(blue.getBlockX() - red.getBlockX(), blue.getBlockY() - red.getBlockY(), blue.getBlockZ() - red.getBlockZ())));
|
||||
blue.setYaw(UtilAlg.GetYaw(new Vector(red.getBlockX() - blue.getBlockX(), red.getBlockY() - blue.getBlockY(), red.getBlockZ() - blue.getBlockZ())));
|
||||
|
||||
int i = 0;
|
||||
for(GameTeam team : GetTeamList())
|
||||
{
|
||||
@ -338,6 +328,28 @@ public class TypeWars extends TeamGame
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void tutorialEnd(GameTutorialEndEvent event)
|
||||
{
|
||||
int i = 0;
|
||||
for(Player player : event.getTutorial().getPlayers().keySet())
|
||||
{
|
||||
Location location = event.getTutorial().getTeam().GetSpawns().get(i);
|
||||
for(GameTeam team : GetTeamList())
|
||||
{
|
||||
if(team != event.getTutorial().getTeam())
|
||||
{
|
||||
location.setPitch(UtilAlg.GetPitch(UtilAlg.getTrajectory(location, _giants.get(team).getLocation())));
|
||||
location.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(location, _giants.get(team).getLocation())));
|
||||
}
|
||||
}
|
||||
player.teleport(location);
|
||||
i++;
|
||||
if(i >= event.getTutorial().getTeam().GetSpawns().size())
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTutorials()
|
||||
{
|
||||
|
@ -21,6 +21,7 @@ public class TutorialTypeWars extends GameTutorial
|
||||
public TutorialTypeWars(ArcadeManager manager)
|
||||
{
|
||||
super(manager, new TutorialPhase[]{new TutorialPhaseTypeWars()});
|
||||
this.TeleportOnEnd = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user