diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/GameTutorial.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/GameTutorial.java index fd28fe9de..5a0207e30 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/GameTutorial.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/GameTutorial.java @@ -54,7 +54,7 @@ public abstract class GameTutorial for(TutorialPhase phase : _phases) phase.setTutorial(this); - Manager.GetGame().PrepareTime = 60000; + //Manager.GetGame().PrepareTime = 60000; Manager.GetChat().Silence(60000, false); _started = System.currentTimeMillis(); Manager.getPluginManager().callEvent(new GameTutorialStartEvent(this)); @@ -213,6 +213,11 @@ public abstract class GameTutorial return _tick; } + public TutorialPhase[] getPhases() + { + return _phases; + } + public long getTutorialStart() { return _started; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java index 9c60cc850..a4fac6a32 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java @@ -36,6 +36,8 @@ import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.games.uhc.UHC; import nautilus.game.arcade.gametutorial.GameTutorial; +import nautilus.game.arcade.gametutorial.TutorialPhase; +import nautilus.game.arcade.gametutorial.TutorialText; import org.bukkit.ChatColor; import org.bukkit.Color; @@ -147,14 +149,25 @@ public class GameManager implements Listener if(player.getWorld() == Manager.GetLobby().GetSpawn().getWorld()) return true; } + long prepTime = 0; for(GameTeam team : game.GetTeamList()) { + long timeUsage = 0; if(team.getTutorial() != null) { if(!team.getTutorial().hasStarted()) { team.getTutorial().setTeam(team); team.getTutorial().start(); + timeUsage = team.getTutorial().StartAfterTutorial; + timeUsage = timeUsage + (team.getTutorial().TimeBetweenPhase * team.getTutorial().getPhases().length); + for(TutorialPhase phase : team.getTutorial().getPhases()) + { + for(TutorialText text : phase.getText()) + { + timeUsage = timeUsage + (text.getStayTime() * 50); + } + } } if(!team.getTutorial().hasEnded()) { @@ -168,7 +181,12 @@ public class GameManager implements Listener finished = true; } } + if(prepTime <= timeUsage) + prepTime = timeUsage; } + if(prepTime > 0) + Manager.GetGame().PrepareTime = prepTime; + if(!finished) return true; }