Esempio n. 1
0
        ////

        private bool CanBeginCutscene(
            bool isAutoplay,
            CutsceneID cutsceneId,
            Player playsFor,
            out Cutscene cutscene,
            out string result)
        {
            if (this.GetCurrentCutscene_Player(playsFor) != null)
            {
                cutscene = null;
                result   = "Player " + playsFor.name + " (" + playsFor.whoAmI + ") is already playing " + cutsceneId;
                return(false);
            }

            cutscene = cutsceneId.Create(playsFor);

            if (isAutoplay && !cutscene.CanAutoplay)
            {
                result = "Cutscene " + cutsceneId + " does not support autoplay.";
                return(false);
            }
            if (!cutscene.CanReplayPerWorld && this.HasCutscenePlayed_World(cutsceneId))
            {
                cutscene = null;
                result   = "World has already played " + playsFor.name + " (" + playsFor.whoAmI + ")'s cutscene " + cutsceneId;
                return(false);
            }
            if (!cutscene.CanReplayPerPlayer && this.HasCutscenePlayed_Player(cutsceneId, playsFor))
            {
                cutscene = null;
                result   = "Player has already played " + playsFor.name + " (" + playsFor.whoAmI + ")'s cutscene " + cutsceneId;
                return(false);
            }

            return(cutscene.CanBegin(out result));
        }