private DialogueNode GenBranch0(long id = 0, long next = 1)
    {
        DialogueBranch output = dialogueContext.CreateDialogueBranch(id, next);

        output
        .AddNode(new DialogueSpeech("(Hit [Left clic] or [Space] to progress...)")
                 .AddEffect()
                 .AddHandler(new DialogueEffectSetAudioClipHandler(0))
                 .AddHandler(new DialogueEffectSetAudioClipSourceHandler(0, "SoftDialogueExample/Audio/Intro"))
                 .AddHandler(new DialogueEffectSetAudioClipHandler(1))
                 .AddHandler(new DialogueEffectSetAudioClipSourceHandler(1, "SoftDialogueExample/Audio/MainTheme"))
                 .AddHandler(new DialogueEffectSetAudioClipHandler(2))
                 .AddHandler(new DialogueEffectSetAudioClipSourceHandler(2, "SoftDialogueExample/Audio/BatHitMiss"))
                 .AddHandler(new DialogueEffectSetSpriteHandler(3))
                 .AddHandler(new DialogueEffectSetSpriteSourceHandler(3, "SoftDialogueExample/Sprites/Doge"))
                 .AddHandler(new DialogueEffectSetSpriteSizeHandler(3, new Vector2(1, 1)))
                 .AddHandler(new DialogueEffectSnapSpriteToPositionHandler(3, new Vector3(0, 0), SpriteSnapPosition.Bottom)))
        .AddNode(new DialogueSpeech("...")
                 .AddEffect()
                 .AddHandler(new DialogueEffectPlayAudioHandler(2))
                 .AddHandler(new DialogueEffectSetSpriteVisibleHandler(3, true)))
        .AddNode(new DialogueSpeech("This is a sample.")
                 .AddEffect()
                 .AddHandler(new DialogueEffectPlayAudioHandler(2))
                 .AddHandler(new DialogueEffectFlipSpriteHandler(3, true, false))
                 .AddHandler(new DialogueEffectWaitHandler(0.1f))
                 .AddHandler(new DialogueEffectPlayAudioHandler(2))
                 .AddHandler(new DialogueEffectFlipSpriteHandler(3, false, false))
                 .AddHandler(new DialogueEffectWaitHandler(0.1f))
                 .AddHandler(new DialogueEffectPlayAudioHandler(2))
                 .AddHandler(new DialogueEffectFlipSpriteHandler(3, true, false))
                 .AddHandler(new DialogueEffectWaitHandler(0.1f))
                 .AddHandler(new DialogueEffectPlayAudioHandler(2))
                 .AddHandler(new DialogueEffectFlipSpriteHandler(3, false, false)))
        .AddNode(new DialogueSpeech("...")
                 .AddEffect()
                 .AddHandler(new DialogueEffectPlayAudioHandler(2))
                 .AddHandler(new DialogueEffectScaleSpriteHandler(3, 0.3f, new Vector2(0.1f, 0.1f)))
                 .AddHandler(new DialogueEffectMoveSpriteHandler(3, 0.3f, new Vector3(10, 0, 0), SpriteSnapPosition.Bottom))
                 .AddHandler(new DialogueEffectWaitHandler(0.4f)))
        .AddNode(new DialogueSpeech("Let's get to it already!!!")
                 .AddEffect()
                 .AddHandler(new DialogueEffectPlayAudioHandler(2))
                 .AddHandler(new DialogueEffectSetSpriteVisibleHandler(3, false)))
        .AddNode(new DialogueSpeech("")
                 .AddEffect()
                 .AddHandler(new DialogueEffectSetConditionHandler("FIRST")));

        return(output);
    }
Exemple #2
0
    private DialogueNode GenerateFugitive(long id)
    {
        DialoguePassiveChoice root = dialogueContext.CreateDialoguePassiveChoice(id);

        root.AddOption(new DialoguePassiveOption(id + 1, new string[] { "!fugitive" }));
        root.AddOption(new DialoguePassiveOption(id + 4, new string[] { "fugitive" }));
        DialogueBranch firstEncounter = dialogueContext.CreateDialogueBranch(id + 1, id + 2);

        firstEncounter.AddEffect().AddHandler(new DialogueEffectSetConditionHandler("fugitive"));
        firstEncounter
        .AddNode(new DialogueSpeech("You... you..."))
        .AddNode(new DialogueSpeech("Oh, I'm so sorry..."))
        .AddNode(new DialogueSpeech("Such a waste..."))
        .AddNode(new DialogueSpeech("I'm not going to make it. Please, I beg you, hear me out."))
        .AddNode(new DialogueSpeech("I have a favour to ask of you."));

        DialogueActiveChoice firstEncounterChoice = dialogueContext.CreateDialogueActiveChoice(id + 2);

        firstEncounterChoice
        .AddOption(new DialogueActiveOption(id + 3, "Accept"))
        .AddOption(new DialogueActiveOption(id + 4, "Decline"));

        DialogueBranch firstEncounterAccept = dialogueContext.CreateDialogueBranch(id + 3, -1);

        firstEncounterAccept
        .AddEffect(new DialogueConditionalEffect()).AddCondition("!fugitiveAccept")
        .AddHandler(new DialogueEffectSetConditionHandler("fugitiveAccept"));
        firstEncounterAccept
        .AddNode(new DialogueSpeech("Oh..."))
        .AddNode(new DialogueSpeech("I thank you, from the bottom of my heart..."))
        .AddNode(new DialogueSpeech("Someone will come to claim me."))
        .AddNode(new DialogueSpeech("They will be here soon..."))
        .AddNode(new DialogueSpeech("Don't trust them."))
        .AddNode(new DialogueSpeech("Whatever they say to you, don't ever trust them."))
        .AddNode(new DialogueSpeech("Oppose them!"))
        .AddNode(new DialogueSpeech("They will trick you in doing... unspeakable things..."))
        .AddNode(new DialogueSpeech("Don't end..."))
        .AddNode(new DialogueSpeech("... like me..."));
        DialogueBranch firstEncounterDecline = dialogueContext.CreateDialogueBranch(id + 4, -1);

        firstEncounterDecline
        .AddEffect(new DialogueConditionalEffect()).AddCondition("!fugitiveDecline")
        .AddHandler(new DialogueEffectSetConditionHandler("fugitiveDecline"));
        firstEncounterDecline
        .AddNode(new DialogueSpeech("Oh, please..."))
        .AddNode(new DialogueSpeech("Don't be tricked..."))
        .AddNode(new DialogueSpeech("Save... yourself..."));
        return(root);
    }