This commit is contained in:
William Burns 2015-12-11 01:20:36 +00:00
parent 626a812844
commit dda5ac6728
3 changed files with 6 additions and 220 deletions

View File

@ -128,101 +128,10 @@ public class Gladiators extends SoloGame
{
Manager.getCosmeticManager().getGadgetManager().DisableParticles(); // Particles blocking tutorial...
Location white = WorldData.GetDataLocs("WHITE").get(0);
Location purple = WorldData.GetDataLocs("PURPLE").get(0);
Location orange = UtilAlg.findClosest(purple, WorldData.GetDataLocs("ORANGE"));
Location pink = UtilAlg.findClosest(orange, WorldData.GetDataLocs("PINK"));
ArrayList<Location> spawns = new ArrayList<>(WorldData.GetDataLocs("BROWN"));
Location spawn1 = spawns.get(0);
spawns.remove(spawn1);
Location spawn2 = spawns.get(0);
Location loc = WorldData.GetDataLocs("RED").get(0);
e.getTutorial().getPhase(1).setLocation(white);
e.getTutorial().getPhase(1).setTarget(purple);
CreatureAllowOverride = true;
Zombie zombie = (Zombie) WorldData.World.spawnEntity(spawn1, EntityType.ZOMBIE);
Golem villager = (Golem) WorldData.World.spawnEntity(spawn2, EntityType.IRON_GOLEM);
CreatureAllowOverride = false;
for (LivingEntity ent : Arrays.asList(zombie, villager))
{
GameProfile tiger = new ProfileLoader(UUIDFetcher.getUUIDOf("WilliamTiger").toString(), "WilliamTiger").loadProfile();
GameProfile random = stealGameProfile();
DisguisePlayer player = new DisguisePlayer(ent, (ent.equals(zombie) ? random : tiger));
Manager.GetDisguise().disguise(player);
ent.getEquipment().setHelmet(ArenaType.ORANGE.getLoadout().getHelmet());
ent.getEquipment().setChestplate(ArenaType.ORANGE.getLoadout().getChestplate());
ent.getEquipment().setLeggings(ArenaType.ORANGE.getLoadout().getLeggings());
ent.getEquipment().setBoots(ArenaType.ORANGE.getLoadout().getBoots());
ent.getEquipment().setItemInHand(ArenaType.ORANGE.getLoadout().getSword());
if (ent.equals(villager))
ent.setHealth(100);
//UtilEnt.CreatureMoveFast(zombie, purple, 1);
}
zombie.setTarget(villager);
villager.setTarget(zombie);
((TutorialGladiators) e.getTutorial()).setOrange(orange);
((TutorialGladiators) e.getTutorial()).setPink(pink);
((TutorialGladiators) e.getTutorial()).setZombie(zombie);
((TutorialGladiators) e.getTutorial()).setVillager(villager);
((TutorialGladiators) e.getTutorial()).setPurple(purple);
}
private GameProfile stealGameProfile()
{
List<String> steal = Arrays.asList("Chiss", "Sigils", "Mysticate", "b2_mp", "Bitjump");
String random = steal.get(new Random().nextInt(steal.size()));
return new ProfileLoader(UUIDFetcher.getUUIDOf(random).toString(), random).loadProfile();
}
@EventHandler
public void tutorialUpdate(UpdateEvent e)
{
if (e.getType() != UpdateType.FASTEST)
return;
if (GetState() != GameState.Prepare)
return;
if (GetTeamList().get(0).getTutorial() == null)
return;
TutorialGladiators tutorial = (TutorialGladiators) GetTeamList().get(0).getTutorial();
if (tutorial == null)
{
System.out.println("tutorial object null");
if (GetTeamList().get(0).getTutorial() == null)
System.out.println("tutorial is null");
if (!(GetTeamList().get(0).getTutorial() instanceof TutorialGladiators))
System.out.println("its not a gladiators one");
return;
}
if (tutorial.hasEnded())
return;
if (tutorial.isParticleStage())
{
if (tutorial.getZombie() != null)
tutorial.getZombie().damage(200);
UtilEnt.CreatureMoveFast(tutorial.getVillager(), tutorial.getPink(), 1F);
for (Location loc : UtilShapes.getLinesDistancedPoints(tutorial.getVillager().getLocation(), tutorial.getPink(), 0.2))
{
UtilParticle.PlayParticle(UtilParticle.ParticleType.HAPPY_VILLAGER, loc, 0.03f, 0.03f, 0.03f, 0, 3,
UtilParticle.ViewDist.LONG, UtilServer.getPlayers());
}
}
e.getTutorial().getPhase(1).setLocation(loc.add(0, 50, 0));
e.getTutorial().getPhase(1).setTarget(loc);
}
@Override
@ -773,6 +682,8 @@ public class Gladiators extends SoloGame
}
else if (_roundState.equals(RoundState.STARTING_2))
{
_roundState = RoundState.STARTING_1;
for (Arena a : _gameArenaSet)
{
if (a.getState() != ArenaState.FIGHTING)

View File

@ -22,14 +22,6 @@ public class TutorialGladiators extends GameTutorial
private Gladiators _host;
private Location _pink, _orange, _purple;
private Zombie _zombie;
private Golem _villager;
private boolean _particleStage;
private boolean hasHit1, hasHit2;
public TutorialGladiators(ArcadeManager manager)
{
super(manager, new TutorialPhase[]{
@ -38,116 +30,12 @@ public class TutorialGladiators extends GameTutorial
TeleportOnEnd = false;
hasHit1 = false;
hasHit2 = false;
_particleStage = false;
_host = (Gladiators) manager.GetGame();
}
public Location getPink()
{
return _pink;
}
public void setPink(Location pink)
{
_pink = pink;
}
public Location getOrange()
{
return _orange;
}
public void setOrange(Location orange)
{
_orange = orange;
}
public Zombie getZombie()
{
return _zombie;
}
public void setZombie(Zombie zombie)
{
_zombie = zombie;
}
public Golem getVillager()
{
return _villager;
}
public void setVillager(Golem villager)
{
_villager = villager;
}
public boolean isHasHit1()
{
return hasHit1;
}
public void setHasHit1(boolean hasHit1)
{
this.hasHit1 = hasHit1;
}
public boolean isHasHit2()
{
return hasHit2;
}
public void setHasHit2(boolean hasHit2)
{
this.hasHit2 = hasHit2;
}
public Location getPurple()
{
return _purple;
}
public void setPurple(Location purple)
{
_purple = purple;
}
public boolean isParticleStage()
{
return _particleStage;
}
public void setParticleStage(boolean particleStage)
{
_particleStage = particleStage;
}
@Override
public void onEnd()
{
Gladiators game = (Gladiators) Manager.GetGame();
for (Player p : game.GetPlayers(true))
{
p.teleport(game.GetTeam(p).GetSpawn().clone());
}
if (_zombie != null)
_zombie.remove();
if (_villager != null)
_villager.remove();
Arena gateArena = _host.getArenaByMid(getOrange());
for (Location loc : gateArena.getDoorBlocks())
loc.getBlock().setType(Material.FENCE); // Manual door close.
// Spawns
_host.GetTeamList().get(0).GetSpawns().clear();
for (Arena a : _host.getGameArenaSet())

View File

@ -11,14 +11,10 @@ import nautilus.game.arcade.gametutorial.TutorialText;
public class TutorialPhaseGladiators extends TutorialPhase
{
private static final TutorialText TUT1 = new TutorialText(C.cGreen + "Defeat your opponent!", 20 * 3, 1);
private static final TutorialText TUT2 = new TutorialText("", 20 * 4, 2);
private static final TutorialText TUT3 = new TutorialText(C.cGreen + "To the next arena!", C.cGreen + "Follow the particles", 20 * 3, 3);
public TutorialPhaseGladiators()
{
super(new TutorialText[]{
TUT1, TUT2, TUT3
new TutorialText(C.cGreen + "Defeat your opponent to advance", C.cGreen + "Gladiators!", 20 * 5, 1)
});
}
@ -27,13 +23,4 @@ public class TutorialPhaseGladiators extends TutorialPhase
{
return 1;
}
@Override
public void onMessageDisplay(TutorialText text)
{
if (text.equals(TUT3))
{
((TutorialGladiators)getTutorial()).setParticleStage(true);
}
}
}