public void SequenceCompletedCallback(Aisling a, DialogSequence b)
        {
            if (b.HasOptions)
            {
                var subject = a.Quests.Find(i => i.Name == "awakening");

                if (subject != null && subject.Completed)
                {
                    a.Client.SendOptionsDialog(Mundane, "You found it, good. Now go clean up the rats in here. It looks like a rape dungeon in here.",
                                               new OptionsDataItem(0x0010, "How do i attack?")
                                               );
                }
                else
                {
                    a.Client.SendOptionsDialog(Mundane, "Your stuff ain't up my ass mate. try checking the chest over there. if you can wade through the porno mags.");
                    return;
                }

                subject = a.Quests.Find(i => i.Name == "practice makes perfect");

                if (subject != null && subject.Completed)
                {
                    a.Client.SendOptionsDialog(Mundane, string.Format("Thank you {0}, Looks better in here now. So what you want to do here?", a.Username),
                                               new OptionsDataItem(0x0012, "Skip Tutorial (Advanced Users Only)")
                                               );
                }
                else
                {
                    a.Client.SendOptionsDialog(Mundane, "I said go kill these rats, what are you sitting around for?");
                    return;
                }
            }
        }
예제 #2
0
 void Start()
 {
     if (GetComponent <DialogSequence>())
     {
         sequence = GetComponent <DialogSequence>();
     }
 }
예제 #3
0
        void SequenceComplete(Aisling aisling, DialogSequence sequence)
        {
            if (aisling.ReactedWith(Reactor.Name))
            {
                return;
            }

            if (sequence == null)
            {
                aisling.Reactions[Reactor.Name] = DateTime.UtcNow;
                aisling.ReactorActive           = false;
                aisling.ActiveReactor           = null;
                aisling.Client.CloseDialog();

                foreach (var sequences in Reactor.Sequences.Where(i => i.OnSequenceStep != null))
                {
                    sequences.OnSequenceStep.Invoke(aisling, sequences);
                }

                if (Reactor.Quest != null)
                {
                    Reactor.Quest.Rewards(aisling, false);
                }

                if (Reactor.PostScript != null)
                {
                    Reactor.PostScript.OnTriggered(aisling);
                }
            }
        }
예제 #4
0
    public void InitiateDialog(Dialog dialog, DialogSequence sequenceScript)
    {
        isDialogRunning = true;
        EnableUI(true);
        currentDialog  = dialog;
        dialogSequence = sequenceScript;
        UIManager.Instance.DisableUIInteraction(true);
        UIManager.Instance.Blur(true);
        GameManager.Instance.StopPlayerMovement(true);
        GameManager.Instance.PauseUIInputs(true);
        GameManager.Instance.PauseEnemies(true);
        GameManager.Instance.MouseMovementActive = false;

        foreach (string name in dialog.names)
        {
            names.Enqueue(name);
        }

        foreach (string message in dialog.messages)
        {
            messages.Enqueue(message);
        }


        // foreach(Image icon in currentDialog.icons)
        //     icons.Enqueue(icon);

        if (dialog.defaultPortrait)
        {
            defaultImage = dialog.defaultPortrait;
        }
    }
예제 #5
0
        public virtual void AddPursuit(DialogSequence pursuit)
        {
            if (pursuit.Id == null)
            {
                // This is a local sequence, so assign it into the pursuit range and
                // assign an ID
                pursuit.Id = (uint)(Constants.DIALOG_SEQUENCE_SHARED + Pursuits.Count);
                Pursuits.Add(pursuit);
            }
            else
            {
                // This is a shared sequence
                Pursuits.Add(pursuit);
            }

            if (SequenceCatalog.ContainsKey(pursuit.Name))
            {
                Logger.WarnFormat("Pursuit {0} is being overwritten", pursuit.Name);
                SequenceCatalog.Remove(pursuit.Name);
            }

            SequenceCatalog.Add(pursuit.Name, pursuit);

            if (pursuit.Id > Constants.DIALOG_SEQUENCE_SHARED)
            {
                pursuit.AssociateSequence(this);
            }
        }
예제 #6
0
        public void SequenceCompletedCallback(Aisling a, DialogSequence b)
        {
            if (b.HasOptions)
            {
                var subject = a.Quests.Find(i => i.Name == "awakening");

                if (subject != null && subject.Completed)
                {
                    a.Client.SendOptionsDialog(Mundane, "You look all set, Please let me know what you find out what's happening...",
                                               new OptionsDataItem(0x0010, "How do i attack?")
                                               );
                }
                else
                {
                    a.Client.SendOptionsDialog(Mundane, "Don't tell me you forgot where your stuff is? try the chest. You probably locked it up.");
                    return;
                }

                subject = a.Quests.Find(i => i.Name == "practice makes perfect");

                if (subject != null && subject.Completed)
                {
                    a.Client.SendOptionsDialog(Mundane, string.Format("Thank you {0}, I have a secret way out of this tutorial if you desire!", a.Username),
                                               new OptionsDataItem(0x0012, "Skip Tutorial (Advanced Users Only)")
                                               );
                }
                else
                {
                    a.Client.SendOptionsDialog(Mundane, "I said go kill these rats, what are you sitting around for?");
                    return;
                }
            }
        }
예제 #7
0
        /// <summary>
        /// Another convenience function to generate an "end" sequence where the user must hit close (e.g. a dialog end).
        /// This is useful to make a jumpable end to a previous dialog option.
        /// </summary>
        /// <param name="simpleDialog">The text of the simple dialog.</param>
        /// <param name="callback">An optional Lua callback expression that will be attached to the simple dialog.</param>
        /// <param name="name">An optional name to give the dialog sequence.</param>
        /// <returns>The constructed dialog sequence</returns>
        public HybrasylDialogSequence NewEndSequence(string simpleDialog, string callback = "", string name = null)
        {
            DialogSequence sequence;

            if (string.IsNullOrEmpty(simpleDialog))
            {
                GameLog.ScriptingError("NewEndSequence: Dialog text (first argument) cannot be null or empty");
                return(null);
            }

            if (name == null)
            {
                sequence = new DialogSequence(Guid.NewGuid().ToString());
            }
            else
            {
                sequence = new DialogSequence(name);
            }

            var dialog = new SimpleDialog(simpleDialog);

            if (!string.IsNullOrEmpty(callback))
            {
                dialog.CallbackExpression = callback;
            }

            sequence.AddDialog(dialog);
            return(new HybrasylDialogSequence(sequence));
        }
예제 #8
0
파일: Dialogs.cs 프로젝트: Jinori/server
 public AsyncDialogRequest(DialogSequence sequence, VisibleObject invoker, User invokee, bool requireLocal = true)
 {
     _sequence     = sequence;
     Invoker       = invoker;
     Invokee       = invokee;
     _requireLocal = requireLocal;
 }
예제 #9
0
    public static DialogSequence Default()
    {
        DialogSequence dialogSeqeuence = new DialogSequence();

        dialogSeqeuence.SetEventSelector(EventSelector.doNothing);

        return(dialogSeqeuence);
    }
예제 #10
0
    public void AddSequence(string sequenceName, DialogSequence sequence)
    {
        if (sequences.ContainsKey(sequenceName))
        {
            return;
        }

        sequences.Add(sequenceName, sequence);
    }
예제 #11
0
 protected void Awake()
 {
     Animation = new DialogAnimation(this);
     Writing   = new DialogWriting(this, sentenceText, authorText);
     Sequence  = new DialogSequence(this);
     OnShow   += Writing.StartWriting;
     OnShow   += () => CreateButtons(Sequence.GetCurrent());
     Hide();
 }
    private void TutorialDialog(Dialog dialog, bool mode)
    {
        if (!mode)
        {
            return;
        }

        DialogManager.Instance.InitiateDialog(dialog, DialogSequence.Default());
        DialogManager.Instance.UnloadDialog();
    }
예제 #13
0
        /// <summary>
        /// Create a new dialog sequence consisting of a bunch of simple text dialogs.
        /// </summary>
        /// <param name="sequenceName">The name of the constructed sequence.</param>
        /// <param name="textList">A string array of dialog lines that will be used to construct each dialog in the sequence.</param>
        /// <returns>The constructed dialog seqeunce</returns>
        public HybrasylDialogSequence NewSimpleDialogSequence(string sequenceName, params string[] textList)
        {
            var sequence = new DialogSequence(sequenceName);

            foreach (var entry in textList)
            {
                sequence.AddDialog(new SimpleDialog(entry));
            }
            return(new HybrasylDialogSequence(sequence));
        }
예제 #14
0
 /// <summary>
 /// Assoiciate this particular dialog with a sequence.
 /// </summary>
 /// <param name="sequence"></param>
 public void AssociateDialogWithSequence(DialogSequence sequence)
 {
     if (sequence is null)
     {
         GameLog.ScriptingError("AssociateDialogWithSequence: sequence (first argument) cannot be null");
         return;
     }
     Sequence = sequence;
     sequence.AddDialog(Dialog);
 }
예제 #15
0
 public virtual void RegisterDialogSequence(DialogSequence sequence)
 {
     sequence.Id = (uint)(Constants.DIALOG_SEQUENCE_PURSUITS + DialogSequences.Count);
     DialogSequences.Add(sequence);
     if (SequenceCatalog.ContainsKey(sequence.Name))
     {
         Logger.WarnFormat("Dialog sequence {0} is being overwritten", sequence.Name);
         SequenceCatalog.Remove(sequence.Name);
     }
     SequenceCatalog.Add(sequence.Name, sequence);
 }
예제 #16
0
        void ProgressionManager_SetChallengeRoomAsCompleted(On.ProgressionManager.orig_SetChallengeRoomAsCompleted orig, ProgressionManager self, string roomKey)
        {
            //if this is a rando file, go ahead and give the item we expect to get
            if (randoStateManager.IsRandomizedFile)
            {
                LocationRO powerSealLocation = null;
                foreach (LocationRO location in RandomizerConstants.GetAdvancedRandoLocationList())
                {
                    if (location.LocationName.Equals(roomKey))
                    {
                        powerSealLocation = location;
                    }
                }

                if (powerSealLocation == null)
                {
                    throw new RandomizerException($"Challenge room with room key '{roomKey}' was not found in the list of locations. This will need to be corrected for this challenge room to work.");
                }

                RandoItemRO challengeRoomRandoItem = RandomizerStateManager.Instance.CurrentLocationToItemMapping[powerSealLocation];

                Console.WriteLine($"Challenge room '{powerSealLocation.PrettyLocationName}' completed. Providing rando item '{challengeRoomRandoItem}'.");
                //Handle timeshards
                if (EItems.TIME_SHARD.Equals(challengeRoomRandoItem.Item))
                {
                    Manager <InventoryManager> .Instance.CollectTimeShard(1);

                    //Set this item to have been collected in the state manager
                    randoStateManager.GetSeedForFileSlot(randoStateManager.CurrentFileSlot).CollectedItems.Add(challengeRoomRandoItem);
                }
                else
                {
                    //Before adding the item to the inventory, add this item to the override
                    RandomizerStateManager.Instance.AddTempRandoItemOverride(challengeRoomRandoItem.Item);
                    Manager <InventoryManager> .Instance.AddItem(challengeRoomRandoItem.Item, 1);

                    //Now remove the override
                    RandomizerStateManager.Instance.RemoveTempRandoItemOverride(challengeRoomRandoItem.Item);
                }

                //I want to try to have a dialog popup say what the player got.
                DialogSequence challengeSequence = ScriptableObject.CreateInstance <DialogSequence>();
                challengeSequence.dialogID = "RANDO_ITEM";
                challengeSequence.name     = challengeRoomRandoItem.Item.ToString();
                challengeSequence.choices  = new List <DialogSequenceChoice>();
                AwardItemPopupParams challengeAwardItemParams = new AwardItemPopupParams(challengeSequence, true);
                Manager <UIManager> .Instance.ShowView <AwardItemPopup>(EScreenLayers.PROMPT, challengeAwardItemParams, true);
            }


            //For now calling the orig method once we are done so the game still things we are collecting seals. We can change this later.
            orig(self, roomKey);
        }
예제 #17
0
파일: Dialogs.cs 프로젝트: Jinori/server
 /// <summary>
 /// Transition between two dialog sequences. This allows us to start a new sequence from an option or
 /// a response handler, and validate where we've come from.
 /// </summary>
 /// <param name="target">A VisibleObject that is the target of the dialog sequence</param>
 /// <param name="dialogStart">The dialog sequence to which we will transition.</param>
 /// <returns></returns>
 public bool TransitionDialog(VisibleObject target, DialogSequence dialogStart)
 {
     if (!InDialog)
     {
         Log.Error("Transition can only occur from an active dialog");
         return(false);
     }
     Associate            = target;
     PreviousPursuitId    = CurrentPursuitId;
     ActiveDialogSequence = dialogStart;
     ActiveDialog         = dialogStart.Dialogs.First();
     return(true);
 }
        private void QuestCompleted(Aisling aisling, DialogSequence b)
        {
            aisling.Client.SendOptionsDialog(Mundane,
                                             "Ah there we go, splendid! this should be useful to you for a while. Come back again another time, i might be able to make you something even better.");

            var subject = aisling.Quests.Find(i => i.Name == Mundane.Template.QuestKey);

            if (subject != null)
            {
                Actor.Quest.OnCompleted(aisling);
                aisling.DestroyReactor(Actor);
                aisling.Client.CloseDialog();

                subject.Completed = true;
            }
        }
예제 #19
0
 /// <summary>
 /// Start a dialog sequence. The player must not already be in a dialog or in
 /// any other state.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="dialogStart"></param>
 /// <returns></returns>
 public bool StartDialog(VisibleObject target, DialogSequence dialogStart)
 {
     if (dialogStart.Id == null)
     {
         Logger.ErrorFormat("Can't start a dialog with a null dialog ID: {0}", dialogStart.Name);
         return(false);
     }
     if (!InDialog)
     {
         Associate            = target;
         ActiveDialogSequence = dialogStart;
         ActiveDialog         = dialogStart.Dialogs.First();
         return(true);
     }
     return(false);
 }
예제 #20
0
파일: Dialogs.cs 프로젝트: hybrasyl/server
 /// <summary>
 /// Start a dialog sequence. The player must not already be in a dialog or in
 /// any other state.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="dialogStart"></param>
 /// <returns></returns>
 public bool StartDialog(VisibleObject target, DialogSequence dialogStart)
 {
     if (dialogStart.Id == null)
     {
         Log.Error("Can't start a dialog with a null dialog ID: {DialogName}", dialogStart.Name);
         return(false);
     }
     if (!InDialog)
     {
         Associate             = target;
         ActiveDialogSequence  = dialogStart;
         ActiveDialog          = dialogStart.Dialogs.First();
         User.Condition.Flags |= PlayerFlags.InDialog;
         return(true);
     }
     return(false);
 }
예제 #21
0
            void SequenceComplete(Aisling aisling, DialogSequence sequence)
            {
                if (aisling.ActiveSequence != null && !aisling.ActiveSequence.CanMoveNext)
                {
                    return;
                }

                if (aisling.ReactedWith(Reactor.Name))
                {
                    return;
                }

                if (sequence == null)
                {
                    aisling.Reactions[Reactor.Name] = DateTime.UtcNow;
                    aisling.ReactorActive           = false;
                    aisling.ActiveSequence          = null;
                    aisling.ActiveReactor.Completed = true;

                    aisling.Client.CloseDialog();

                    if (Reactor.Quest != null && !Reactor.Quest.Completed)
                    {
                        var aisling_quest = aisling.Quests.Find(i => i.Name == Reactor.Quest.Name);

                        if (aisling_quest == null)
                        {
                            aisling.AcceptQuest(Reactor.Quest);
                            aisling_quest = aisling.Quests.Find(i => i.Name == Reactor.Quest.Name);
                        }

                        if (!aisling_quest.Completed)
                        {
                            aisling_quest.HandleQuest(aisling.Client, null, quest_completed_ok =>
                            {
                                if (quest_completed_ok)
                                {
                                    aisling_quest.Completed = true;
                                    aisling_quest.OnCompleted(aisling, true);
                                }
                            });
                        }
                    }
                }
            }
예제 #22
0
        void SequenceComplete(Aisling aisling, DialogSequence sequence)
        {
            if (sequence == null)
            {
                aisling.Reactions[Reactor.Name] = DateTime.UtcNow;
                aisling.ReactorActive           = false;
                aisling.ActiveReactor           = null;
                aisling.Client.CloseDialog();

                if (Reactor.QuestReward != null)
                {
                    Reactor.QuestReward.Rewards(aisling, false);
                }

                if (Reactor.PostScript != null)
                {
                    Reactor.PostScript.OnTriggered(aisling);
                }
            }
        }
예제 #23
0
        /// <summary>
        /// Create a new dialog sequence consisting of a bunch of simple text dialogs.
        /// </summary>
        /// <param name="sequenceName">The name of the constructed sequence.</param>
        /// <param name="textList">A string array of dialog lines that will be used to construct each dialog in the sequence.</param>
        /// <returns>The constructed dialog seqeunce</returns>
        public HybrasylDialogSequence NewSimpleDialogSequence(string sequenceName, params string[] textList)
        {
            if (string.IsNullOrEmpty(sequenceName))
            {
                GameLog.ScriptingError($"NewSimpleDialogSequence: Sequence name (first argument) was null / empty");
                return(null);
            }

            var sequence = new DialogSequence(sequenceName);

            foreach (var entry in textList)
            {
                if (string.IsNullOrEmpty(entry))
                {
                    GameLog.ScriptingWarning("NewSimpleDialogSequence: encountered empty / null dialog text, ignoring");
                    continue;
                }
                sequence.AddDialog(new SimpleDialog(entry));
            }
            return(new HybrasylDialogSequence(sequence));
        }
예제 #24
0
        public virtual void AddPursuit(DialogSequence pursuit)
        {
            if (pursuit.Id == null)
            {
                // This is a local sequence, so assign it into the pursuit range and
                // assign an ID
                pursuit.Id = (uint)(Constants.DIALOG_SEQUENCE_SHARED + Pursuits.Count());
                Pursuits.Add(pursuit);
            }
            else
            {
                // This is a shared sequence
                Pursuits.Add(pursuit);
            }

            SequenceCatalog.Add(pursuit.Name, pursuit);

            if (pursuit.Id > Constants.DIALOG_SEQUENCE_SHARED)
            {
                pursuit.AssociateSequence(this);
            }
        }
예제 #25
0
        /// <summary>
        /// Another convenience function to generate an "end" sequence where the user must hit close (e.g. a dialog end).
        /// This is useful to make a jumpable end to a previous dialog option.
        /// </summary>
        /// <param name="simpleDialog">The text of the simple dialog.</param>
        /// <param name="callback">An optional Lua callback expression that will be attached to the simple dialog.</param>
        /// <param name="name">An optional name to give the dialog sequence.</param>
        /// <returns>The constructed dialog sequence</returns>
        public HybrasylDialogSequence NewEndSequence(string simpleDialog, string callback = "", string name = null)
        {
            DialogSequence sequence;

            if (name == null)
            {
                sequence = new DialogSequence(Guid.NewGuid().ToString());
            }
            else
            {
                sequence = new DialogSequence(name);
            }

            var dialog = new SimpleDialog(simpleDialog);

            if (!string.IsNullOrEmpty(callback))
            {
                dialog.CallbackExpression = callback;
            }

            sequence.AddDialog(dialog);
            return(new HybrasylDialogSequence(sequence));
        }
예제 #26
0
 public virtual void RegisterDialogSequence(DialogSequence sequence)
 {
     sequence.Id = (uint)(Constants.DIALOG_SEQUENCE_PURSUITS + DialogSequences.Count());
     DialogSequences.Add(sequence);
     SequenceCatalog.Add(sequence.Name, sequence);
 }
예제 #27
0
        public virtual void AddPursuit(DialogSequence pursuit)
        {
            if (pursuit.Id == null)
            {
                // This is a local sequence, so assign it into the pursuit range and
                // assign an ID
                pursuit.Id = (uint)(Constants.DIALOG_SEQUENCE_SHARED + Pursuits.Count());
                Pursuits.Add(pursuit);
            }
            else
            {
                // This is a shared sequence
                Pursuits.Add(pursuit);
            }

            SequenceCatalog.Add(pursuit.Name, pursuit);

            if (pursuit.Id > Constants.DIALOG_SEQUENCE_SHARED)
            {
                pursuit.AssociateSequence(this);
            }
        }
예제 #28
0
 public HybrasylDialogSequence(string sequenceName)
 {
     Sequence = new DialogSequence(sequenceName);
 }
예제 #29
0
 public void AssociateDialogWithSequence(DialogSequence sequence)
 {
     Sequence = sequence;
     sequence.AddDialog(Dialog);
 }
예제 #30
0
 void Start()
 {
     DS = new DialogSequence(new DialogChoice("Czy napewno chcesz wejść do " + name, new Character("Door", false), "Tak", new DoorDialog(sceneID), "Nie", null));
 }
예제 #31
0
파일: World.cs 프로젝트: saroque/server
 internal void RegisterGlobalSequence(DialogSequence sequence)
 {
     sequence.Id = (uint) GlobalSequences.Count();
     GlobalSequences.Add(sequence);
     GlobalSequencesCatalog.Add(sequence.Name, sequence);
 }
예제 #32
0
파일: Dialogs.cs 프로젝트: DomGrieco/server
 /// <summary>
 /// Start a dialog sequence. The player must not already be in a dialog or in
 /// any other state.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="dialogStart"></param>
 /// <returns></returns>
 public bool StartDialog(VisibleObject target, DialogSequence dialogStart)
 {
     if (dialogStart.Id == null)
     {
         Logger.ErrorFormat("Can't start a dialog with a null dialog ID: {0}", dialogStart.Name);
         return false;
     }
     if (!InDialog)
     {
         Associate = target;
         ActiveDialogSequence = dialogStart;
         ActiveDialog = dialogStart.Dialogs.First();
         return true;
     }
     return false;
 }
예제 #33
0
파일: Dialogs.cs 프로젝트: DomGrieco/server
 public void AssociateWithSequence(DialogSequence dialogSequence)
 {
     Sequence = dialogSequence;
 }
예제 #34
0
 public virtual void RegisterDialogSequence(DialogSequence sequence)
 {
     sequence.Id = (uint)(Constants.DIALOG_SEQUENCE_PURSUITS + DialogSequences.Count());
     DialogSequences.Add(sequence);
     SequenceCatalog.Add(sequence.Name, sequence);
 }
예제 #35
0
 public void AssociateWithSequence(DialogSequence dialogSequence)
 {
     Sequence = dialogSequence;
 }
예제 #36
0
 public HybrasylDialogSequence(string sequenceName)
 {
     Sequence = new DialogSequence(sequenceName);
 }
예제 #37
0
 /// <summary>
 /// Assoiciate this particular dialog with a sequence.
 /// </summary>
 /// <param name="sequence"></param>
 public void AssociateDialogWithSequence(DialogSequence sequence)
 {
     Sequence = sequence;
     sequence.AddDialog(Dialog);
 }