예제 #1
0
        public async Task ConfigTraining(CommandContext ctx)
        {
            var sadgeEmoji = DiscordEmoji.FromName(ctx.Client, ":Sadge:");
            var usagiEmoji = DiscordEmoji.FromName(ctx.Client, ":usagi:");

            var inputStep = new ConfigStep("Should I notify you when your **training** is done?", null);

            string input = string.Empty;

            inputStep.OnValidResult += (result) => input = result;

            var inputDialogHandler = new DialogueHandler(ctx.Client, ctx.Channel, ctx.User, inputStep);

            bool succeeded = await inputDialogHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }

            if (input.Equals("yes") || input.Equals("y"))
            {
                await UpdateState(ctx, AlertType.Training, true).ConfigureAwait(false);

                await ctx.Channel.SendMessageAsync($"{ctx.Member.Mention}, your **training** alerts are enabled! {usagiEmoji}").ConfigureAwait(false);
            }
            else
            {
                await UpdateState(ctx, AlertType.Training, false).ConfigureAwait(false);

                await ctx.Channel.SendMessageAsync($"{ctx.Member.Mention}, your *training** alerts are disabled! {sadgeEmoji}").ConfigureAwait(false);
            }
        }
예제 #2
0
        public async Task EmojiDialogue(CommandContext ctx)
        {
            await ctx.Message.DeleteAsync().ConfigureAwait(false);

            var yesStep = new TextStep("You chose yes", null);
            var noStep  = new IntStep("You chose no", null);

            var emojiStep = new ReactionStep("Yes Or No?", new Dictionary <DiscordEmoji, ReactionStepData>
            {
                { DiscordEmoji.FromName(ctx.Client, ":thumbsup:"), new ReactionStepData {
                      Content = "Yes", NextStep = yesStep
                  } },
                { DiscordEmoji.FromName(ctx.Client, ":thumbsdown:"), new ReactionStepData {
                      Content = "No", NextStep = noStep
                  } },
            });

            var userChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false);

            var inputDialogueHandler = new DialogueHandler(ctx.Client, userChannel, ctx.User, emojiStep);

            bool succeeded = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }
        }
예제 #3
0
        public async Task dialogue(CommandContext ctx)
        {
            var inputStep = new TextStep("Say yes or no.", null);
            var yesStep   = new TextStep("Noice", null);

            string input = string.Empty;

            inputStep.onValidResult += (result) =>
            {
                input = result;

                if (result == "yes")
                {
                    inputStep.SetNextStep(yesStep);
                }
            };

            var userChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false);

            var inputDialogueHandler = new DialogueHandler(
                ctx.Client,
                userChannel,
                ctx.User,
                inputStep
                );

            bool succeeded = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }

            await ctx.Channel.SendMessageAsync(input).ConfigureAwait(false);
        }
    public int currentPhoto; // which one are we critiquing?

    // Start is called before the first frame update
    void Awake()
    {
        gm = FindObjectOfType <GameManager>();
        dh = FindObjectOfType <DialogueHandler>();

        SetUpDialogue();
    }
    IEnumerator GetPlayer()
    {
        yield return(new WaitForSeconds(.5f));

        playerManager   = GameObject.Find("_Player").GetComponent <PlayerManager>();
        dialogueHandler = GameObject.Find("DialogueHandler").GetComponent <DialogueHandler>();
    }
예제 #6
0
    public void OrbPress()
    {
        if (!orbPressed)
        {
            orbPressed = true;
            player     = GameObject.Find("_Player");
            if (playerManager == null)
            {
                playerManager = player.GetComponent <PlayerManager>();
            }
            dialogueHandler = GameObject.Find("DialogueHandler").GetComponent <DialogueHandler>();
            StartCoroutine(OrbPressDialogue());

            Instantiate(explosiveNPC, new Vector3(npcSpawn.position.x + 25, npcSpawn.position.y - 1.5f, 20), Quaternion.identity);
            Instantiate(explosiveNPC, new Vector3(npcSpawn.position.x - 5, npcSpawn.position.y - 1.5f, 20), Quaternion.identity);
            Instantiate(rangedNPC, new Vector3(npcSpawn.position.x, npcSpawn.position.y - 1.5f, 20), Quaternion.identity);
            Instantiate(basicNPC, new Vector3(npcSpawn.position.x + 30, npcSpawn.position.y, 20), Quaternion.identity);
            Instantiate(basicNPC, new Vector3(npcSpawn.position.x + 10, npcSpawn.position.y, 20), Quaternion.identity);

            Instantiate(drill241NPC, new Vector3(npcSpawn.position.x - 21, npcSpawn.position.y - 1.5f, 20), Quaternion.identity);
            Instantiate(sa241NPC, new Vector3(npcSpawn.position.x - 47, npcSpawn.position.y - 1.5f, 20), Quaternion.identity);
            Instantiate(drill241NPC, new Vector3(npcSpawn.position.x - 26, npcSpawn.position.y - 1.5f, 20), Quaternion.identity);
            Instantiate(sa241NPC, new Vector3(npcSpawn.position.x - 5, npcSpawn.position.y - 1.5f, 20), Quaternion.identity);
            Instantiate(drill241NPC, new Vector3(npcSpawn.position.x + 8, npcSpawn.position.y - 1.5f, 20), Quaternion.identity);
        }

        GameObject[] orbsList = GameObject.FindGameObjectsWithTag("Orb");
        if (orbsList.Length > 0)
        {
            SpriteRenderer spriteRenderer = orbsList[0].GetComponent <SpriteRenderer>();
            spriteRenderer.sortingLayerName = "NPCsBack";
            spriteRenderer.sortingOrder     = -1;
        }
    }
예제 #7
0
        /// <summary>
        /// Primary update method. Runs update method calls when needed.
        /// </summary>
        /// <seealso cref="CurrentGameState"/>
        public static void Update()
        {
            switch (CurrentGameState)
            {
            case GAMESTATE.ACTIVE:
                MenuHandler.CheckKeys();
                foreach (AnimatedSprite sprite in allCharacterSprites)
                {
                    sprite.Update();
                    sprite.Buffs.Update();
                    ObjectMapper.DeleteSpriteObject(sprite);
                    ObjectMapper.AddSpriteObject(sprite);
                }
                foreach (Projectile item in allProjectiles)
                {
                    item.Update();
                }
                foreach (MapInteractable i in selectedMap.InteractableLayer)
                {
                    i.MapAction?.Invoke();
                }
                foreach (TimerHelper t in TimerHelper.Timers)
                {
                    t.Update();
                }
                if (Game.PlayerManager.EquippedWeapon != null)
                {
                    Game.PlayerManager.EquippedWeapon.Sprite.Update();
                }
                if (purgeProjectiles.Count != 0)
                {
                    DeleteProjectiles();
                }
                if (purgeSprites.Count != 0)
                {
                    DeleteSprites();
                }
                PlayerInfoUI.Update();
                break;

            case GAMESTATE.MAINMENU:
                break;

            case GAMESTATE.PAUSED:
                MenuHandler.CheckKeys();
                if (DialogueHandler.ActiveDialogue != null)
                {
                    DialogueHandler.Update();
                }
                else
                {
                    MenuHandler.Update();
                }
                PlayerInfoUI.Update();
                break;

            default:
                throw new NotSupportedException("Game has entered an invalid gamestate: " + CurrentGameState);
            }
        }
예제 #8
0
 //Load all scripts that will be controlled by scene flow controller
 void GetScripts()
 {
     audioCS        = GameObject.FindGameObjectWithTag("AudioController").GetComponent <AudioControlScript>();
     dialogueScript = dialogueUI.GetComponent <DialogueHandler>();
     mapScript      = GameObject.FindGameObjectWithTag("GameController").GetComponent <OverworldMapControl>();
     camScript      = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <MapCameraController>();
 }
예제 #9
0
    public IEnumerator Talk(GameObject dialogueObject, GameObject cup)
    {
        cup.SetActive(false);
        CoffeeWishes.Clear();
        DialogueHandler dialogueHandler = dialogueObject.GetComponent <DialogueHandler>();

        if (stolenDialogueHandler == null)
        {
            stolenDialogueHandler = dialogueHandler;
        }
        if (stolenDialogueObject == null)
        {
            stolenDialogueObject = dialogueObject;
        }
        Speech speech = behaviour.speeches?[nextSpeech ?? UnityEngine.Random.Range(0, behaviour.speeches.Count)];

        if (speech != null)
        {
            foreach (Entry statement in speech.statements)
            {
                if (System.Enum.TryParse(statement.moodChange.ToLower().Trim(), out Pose pose))
                {
                    changePose(pose);
                }
                else if (string.IsNullOrEmpty(statement.moodChange))
                {
                    Debug.Log("Pose defined in XML but not recognized");
                }

                if (statement.choice.Count == 0)
                {
                    yield return(Say(statement.text, dialogueHandler, dialogueObject));
                }
                else
                {
                    string[] answerStrings = new string[4];
                    int?[]   answerValues  = new int?[4];
                    for (int i = 0; i < (statement.choice.Count > 4 ? 4 : statement.choice.Count); i++)
                    {
                        answerStrings[i] = statement.choice[i].value;
                        answerValues[i]  = statement.choice[i].result;
                    }
                    yield return(Say(statement.text, dialogueHandler, dialogueObject));

                    dialogueHandler.SetQuestions(answerStrings, answerValues);
                }
            }
        }
        else
        {
            Debug.Log("Character without speech");
        }

        dialogueObject.SetActive(false);
        CoffeeWishes.Add(new CoffeeWish {
            coffeeType = typeof(BlackCoffee), payment = 4.20f
        });
        cup.SetActive(true);
        yield return(null);
    }
예제 #10
0
    public void Start()
    {
        moveSel = 1;

        po = pokemonObject.GetComponent <PokemonObject>();
        eo = enemyObject.GetComponent <PokemonObject>();
        bh = FindObjectOfType <BattleHandler>();
        dh = FindObjectOfType <DialogueHandler>();

        for (int i = 0; i < moveButtons.Length; i++)
        {
            if (i == 0)
            {
                moveButtons[i].GetComponentInChildren <Text>().text = po.moves[i].moveName;
                moveButtons[i].GetComponent <Image>().sprite        = po.moves[i].type.moveButtonDesel;
            }
            else
            {
                if (po.moves[i] != null)
                {
                    moveButtons[i].GetComponentInChildren <Text>().text = po.moves[i].moveName;
                    moveButtons[i].GetComponent <Image>().sprite        = po.moves[1].type.moveButtonDesel;
                }
                else
                {
                    moveButtons[i].GetComponentInChildren <Text>().text = " ";
                }
            }
        }

        dh.StartDialogue(encounterMessage, true, new string[] { eo.species.pokemonName });
    }
예제 #11
0
        public async Task CreateItem(CommandContext ctx)
        {
            TextStep itemDescriptionStep = new TextStep("Describe the item.", null);
            TextStep itemNameStep        = new TextStep("What will the item be called?", itemDescriptionStep);

            Item item = new Item();

            itemNameStep.OnValidResult        += (result) => item.Name = result;
            itemDescriptionStep.OnValidResult += (result) => item.Description = result;

            DiscordDmChannel userChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false);

            DialogueHandler inputDialogueHandler = new DialogueHandler(ctx.Client, userChannel, ctx.User, itemNameStep);

            bool succeeded = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }

            await _itemService.CreateNewItemAsync(item).ConfigureAwait(false);

            await ctx.Channel.SendMessageAsync($"Item {item.Name} successfully created.").ConfigureAwait(false);
        }
예제 #12
0
        public async Task DialoguePoll(CommandContext ctx, TimeSpan?timespan)
        {
            var pollEmbed = new DiscordEmbedBuilder
            {
                Title = "Create Poll",
                Color = DiscordColor.DarkBlue
            };

            var userChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false);

            var pollMessage = await userChannel.SendMessageAsync(embed : pollEmbed).ConfigureAwait(false);

            var pollStep = new PollStep("Send to me options in poll", null, pollMessage, pollEmbed);

            var inputDialogueHandler = new DialogueHandler(ctx.Client, userChannel, ctx.User, pollStep);

            bool succeded = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeded)
            {
                return;
            }

            var interactivity = ctx.Client.GetInteractivity();
            var emoji         = DiscordEmoji.FromName(ctx.Client, ":1:");

            var channelMessage = await ctx.Channel.SendMessageAsync(embed : pollStep.GetPollMessage()).ConfigureAwait(false);
        }
예제 #13
0
        public async Task EmojiDialogue(CommandContext ctx)
        {
            TextStep yesStep = new TextStep("You chose yes", null);
            TextStep noStep  = new TextStep("You chose no", null);

            ReactionStep emojiStep = new ReactionStep("Yes or No?", new Dictionary <DiscordEmoji, ReactionStepData>
            {
                { DiscordEmoji.FromName(ctx.Client, ":+1:"), new ReactionStepData {
                      Content = "This means yes", NextStep = yesStep
                  } },
                { DiscordEmoji.FromName(ctx.Client, ":-1:"), new ReactionStepData {
                      Content = "This means no", NextStep = noStep
                  } }
            });

            DiscordDmChannel userChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false);

            DialogueHandler inputDialogueHandler = new DialogueHandler(ctx.Client, userChannel, ctx.User, emojiStep);

            bool succeeded = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }
        }
예제 #14
0
        public async Task Dialogue(CommandContext ctx)
        {
            var inputStep = new TextStep("Say: abc", null);
            var funnyStep = new IntStep("Haha, funny", null, 100);

            string input = string.Empty;
            int    value = 0;

            inputStep.OnValidResult += (result) =>
            {
                input = result;
                if (result == "abc")
                {
                    inputStep.SetNextStep(funnyStep);
                }
            };

            funnyStep.OnValidResult += (result) => value = result;

            var userChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false);

            var inputDialogueHandler = new DialogueHandler(ctx.Client, userChannel, ctx.User, inputStep);

            bool succeeded = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }

            await ctx.Channel.SendMessageAsync(input).ConfigureAwait(false);

            await ctx.Channel.SendMessageAsync(value.ToString()).ConfigureAwait(false);
        }
예제 #15
0
        public async Task Dialogue(CommandContext ctx)
        {
            TextStep inputStep = new TextStep("Enter something interesting", null);
            TextStep funnyStep = new TextStep("Haha, funny", null);

            string input = string.Empty;

            inputStep.OnValidResult += (result) =>
            {
                input = result;

                if (result == "something interesting")
                {
                    inputStep.SetNextStep(funnyStep);
                }
            };

            DiscordDmChannel userChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false);

            DialogueHandler inputDialogueHandler = new DialogueHandler(ctx.Client, userChannel, ctx.User, inputStep);

            bool succeeded = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }

            await ctx.Channel.SendMessageAsync(input).ConfigureAwait(false);
        }
예제 #16
0
        public async Task CreateItem(CommandContext ctx)
        {
            var itemDescriptionStep = new TextStep("Enter item description:", null);
            var itemNameStep        = new TextStep("Enter item name:", itemDescriptionStep);

            var item = new Item();

            itemNameStep.OnValidResult        += (result) => item.Name = result;
            itemDescriptionStep.OnValidResult += (result) => item.Description = result;

            var userChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false); //ctx.Channel;

            var inputDialogueHandler = new DialogueHandler(ctx.Client, userChannel, ctx.User, itemNameStep);

            bool succeeded = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }

            await _itemService.CreateNewItemAsync(item);

            await ctx.Channel.SendMessageAsync($"Item {item.Name} successfully created!").ConfigureAwait(false);
        }
예제 #17
0
        public async Task Dialogue(CommandContext ctx)
        {
            var    inputStep = new TextStep("Enter someone you want to calculate compatibility with! No need to use '^comp' again in your next message", null);
            string input     = string.Empty;

            //var funnystep = new TextStep("Haha funny", null);

            inputStep.OnValidResult += (result) =>
            {
                input = result;
                //if(result == "something interesting")
                {
                    //inputStep.SetNextStep(funnystep);
                }
            };

            //var userChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false);
            var  inputDialogueHandler = new DialogueHandler(ctx.Client, ctx.Channel, ctx.User, inputStep);
            bool succeeded            = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }

            var random  = new Random();
            int percent = random.Next(0, 101);
            await ctx.Channel.SendMessageAsync(ctx.Member.Mention + ", your compatibility with " + input + " is " + percent + "%!").ConfigureAwait(false);
        }
예제 #18
0
        public async Task Dialogue(CommandContext ctx)
        {
            var inputStep = new TextStep("Enter something interesting!", null, 10);

            string input = string.Empty;

            inputStep.OnValidResult += (result) => input = result;

            var userChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false);

            var inputDialogueHandler = new DialogueHandler(
                ctx.Client,
                userChannel,
                ctx.User,
                inputStep
                );

            bool succeeded = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }

            await ctx.Channel.SendMessageAsync(input).ConfigureAwait(false);
        }
예제 #19
0
        public async Task CreateItem(CommandContext ctx)
        {
            var itemPriceStep       = new IntStep("How much does the item cost?", null, 1);
            var itemDescriptionStep = new TextStep("What is the item about?", itemPriceStep);
            var itemNameStep        = new TextStep("What will the item be called?", itemDescriptionStep);

            var item = new Item();

            itemNameStep.OnValidResult        += (result) => item.Name = result;
            itemDescriptionStep.OnValidResult += (result) => item.Description = result;
            itemPriceStep.OnValidResult       += (result) => item.Price = result;

            var userChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false);

            var inputDialogueHandler = new DialogueHandler(
                ctx.Client,
                userChannel,
                ctx.User,
                itemNameStep
                );

            bool succeeded = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }

            await _itemService.CreateNewItemAsync(item).ConfigureAwait(false);

            await ctx.Channel.SendMessageAsync($"Item {item.Name} succesfully created!").ConfigureAwait(false);
        }
예제 #20
0
        public async Task ItemInfo(CommandContext ctx)
        {
            var itemNameStep = new TextStep("What item are you looking for?", null);

            string itemName = string.Empty;

            itemNameStep.OnValidResult += (result) => itemName = result;

            var inputDialogueHandler = new DialogueHandler(
                ctx.Client,
                ctx.Channel,
                ctx.User,
                itemNameStep
                );

            bool succeeded = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }

            Item item = await _itemService.GetItemByNameAsync(itemName).ConfigureAwait(false);

            if (item == null)
            {
                await ctx.Channel.SendMessageAsync($"There is no item called {itemName}");

                return;
            }

            await ctx.Channel.SendMessageAsync($"Name: {item.Name}, Description: {item.Description}, Price: {item.Price}");
        }
예제 #21
0
 /// <summary>
 /// Allows the game to run logic such as updating the world,
 /// checking for collisions, gathering input, and playing audio.
 /// </summary>
 /// <param name="gameTime">Provides a snapshot of timing values.</param>
 protected override void Update(GameTime gameTime)
 {
     if (ShouldClose)
     {
         Exit();
     }
     KeyHelper.Update();
     RenderHandler.Update();
     MouseHandler.Update();
     if (KeyHelper.CheckTap(Keys.OemTilde))
     {
         DialogueHandler.Start(TestHelper.GetTestDialogues());
     }
     if (KeyHelper.CheckTap(Keys.D3))
     {
         ((PlayerManager)PlayerCharacter.Manager).Inventory.AddToInventory(new Flight());
     }
     if (KeyHelper.CheckTap(Keys.D2))
     {
         ((PlayerManager)PlayerCharacter.Manager).Inventory.AddToInventory(new RegularHealingPotion());
     }
     if (KeyHelper.CheckTap(Keys.D1))
     {
         ((PlayerManager)PlayerCharacter.Manager).Inventory.AddToInventory(new RegularSpeedPotion());
     }
     if (KeyHelper.CheckHeld(Keys.D0))
     {
         PlayerManager.Health--;
     }
     GameTimeMilliseconds = gameTime.ElapsedGameTime.TotalMilliseconds;
     GameTimeSeconds      = gameTime.ElapsedGameTime.TotalSeconds;
     base.Update(gameTime);
 }
예제 #22
0
        public async Task Dialogue(CommandContext ctx)
        {
            var inputStep = new TextStep("Enter smth interesting", null, 5);
            var funnyStep = new IntStep("MUR MUR MUR", null, maxValue: 100);

            var input = string.Empty;
            var value = 0;

            inputStep.OnValidResult += result =>
            {
                input = result;
                if (result == "SupDvach!")
                {
                    inputStep.SetNextStep(funnyStep);
                }
            };

            funnyStep.OnValidResult += result => value = result;

            var userChannel = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false);

            var inputDialogueHandler = new DialogueHandler(ctx.Client, userChannel, ctx.User, inputStep);
            var succeeded            = await inputDialogueHandler.ProcessDialogue().ConfigureAwait(false);

            if (!succeeded)
            {
                return;
            }
            await ctx.Channel.SendMessageAsync(input).ConfigureAwait(false);

            await ctx.Channel.SendMessageAsync($"{value}").ConfigureAwait(false);
        }
예제 #23
0
    private void IncorrectAccusation(Clue accusation)
    {
        string accusedCharacterName = NPCInteraction.activeCharacter.Name;
        string missingTags          = string.Empty;

        // Check if we have the right tags first.
        string[] requiredAccusationTags = DialogueHandler.GetRequiredAccusationClueTags();

        // Since we only need to accuse one clue and have to have the other unlocked, make sure
        // we passed in one of them and have them unlocked in the Journal.
        if (requiredAccusationTags.Contains(accusation.ClueTag))
        {
            // We passed in a correct clue, now let's make sure we have them unlocked in the journal.
            foreach (string tag in requiredAccusationTags)
            {
                if (!Journal.Instance.HasDiscoveredClue(tag))
                {
                    missingTags += tag + ", ";
                }
            }
        }
        else
        {
            missingTags = "You did not pass in the correct clue.";
        }

        //result += "MISSING TAGS: " + missingTags + "\n";

        //if (DialogueHandler.GetCulpritName() != accusedCharacterName)
        //    result += "You did not accuse the correct character. The culprit was actually " + DialogueHandler.GetCulpritName();

        HandleEndGame(false);
    }
예제 #24
0
    IEnumerator BossDiedDialogue()
    {
        dialogueHandler = GameObject.Find("DialogueHandler").GetComponent <DialogueHandler>();
        dialogueHandler.showDialogue(AvatarShown.PROGAGONIST, "That looks like it could be the intelligence inhibitor key!");
        yield return(new WaitForSeconds(4f));

        dialogueHandler.hideDialogue();
    }
예제 #25
0
 private void Start()
 {
     foregroundTilemap = ObjectReferences.Instance.ForegroundTilemap;
     backgroundTilemap = ObjectReferences.Instance.BackgroundTilemap;
     TurnTextScript    = ObjectReferences.Instance.TurnTextScript;
     DialogueHandler   = ObjectReferences.Instance.DialogueHandlerScript;
     MapDetails.InitialiseTiles(foregroundTilemap);
 }
예제 #26
0
    // Use this for initialization
    void Start()
    {
        charController = GetComponent <CharacterController>();
        cam            = Camera.main.transform;
        anim           = GetComponent <Animator>();

        dialogueHandler = FindObjectOfType <DialogueHandler>();
    }
    // Use this for initialization

    void Awake()
    {
        gameController  = GameObject.Find("IIncubate").GetComponent <GameController>();
        eggParameter    = GameObject.Find("Egg").transform.Find("clean").GetComponent <EggParameter>();
        shaderHandler   = GameObject.Find("Egg").transform.Find("clean").GetComponent <ShaderHandler>();
        dialogueHandler = GameObject.Find("DialogueText").GetComponent <DialogueHandler>();
        hatchlingLight  = transform.Find("Light").GetComponent <Light>();
    }
예제 #28
0
    public DialogueOption(DialogueHandler dialogueHandler, XmlNode node)
    {
        this.dialogueHandler = dialogueHandler;

        displayText          = node.SelectSingleNode("DisplayText").InnerText;
        selectOnEnterPressed = XmlConvert.ToBoolean(node.SelectSingleNode("SelectOnEnterPressed").InnerText);
        nextDialogue         = node.SelectSingleNode("NextDialogue").InnerText;
    }
예제 #29
0
 private void Start()
 {
     questionButtons   = new List <QuestionButton>();
     accusationButtons = new List <QuestionButton>();
     knowledgeButton.onClick.AddListener(() => { QuestionHandler.ProbeClue(new Clue("Knowledge", "Preliminary knowledge the character knows.")); });
     //AddClue("Case", new Clue("Knowledge", ""));
     //questionButtons.Add(new QuestionButton(questionCloseButton, new Clue()));
     print(DialogueHandler.GetCulpritName());
 }
예제 #30
0
 void GetDialogue()
 {
     faceArray = new Sprite[dialogue.Length];
     target    = targetArray[index];
     dialogue  = target.dialogue;
     faceArray = target.faceArray;
     temp      = new string[dialogue.Length];
     faceTemp  = new Sprite[faceArray.Length];
 }
예제 #31
0
    void Start()
    {
        this.paused = false;

        dialogueHandler = new DialogueHandler();

        debrisGenerator = new GameObject("DebrisGenerator");
        debrisGenerator.transform.parent = this.transform;
        debrisGenerator.AddComponent<DebrisGeneratorScript>();

        soundManager = new GameObject("SoundManager"); //Instantiate object that carries and plays all sounds
        soundManager.transform.parent = this.transform;
        soundManager.AddComponent<SoundManager>();

        subtitleHandler = new GameObject("SubtitleHandler");
        subtitleHandler.transform.parent = this.transform;
        subtitleHandler.AddComponent<DialogueHandler>();

        dialogueManager = new GameObject("DialogueManager"); //Instantiate object that shows dialogue on screen
        dialogueManager.transform.parent = this.transform;
        dialogueManager.AddComponent<DialogueManagerScript>();

        postProcessManager = new GameObject("PostProcessManager");
        postProcessManager.transform.parent = this.transform;
        postProcessManager.AddComponent<PostProcessManagerScript>();

        storyConditionManager = new GameObject("StoryConditionManager");
        storyConditionManager.transform.parent = this.transform;
        storyConditionManager.AddComponent<StoryConditionManager>();

        oxygenBars = GameObject.Find("OxygenBars");
        oxygenBars.transform.parent = this.transform;
        oxygenBars.AddComponent<OxygenBarScript>();

        screenFader = new GameObject("ScreenFader");
        screenFader.transform.parent = this.transform;
        screenFader.AddComponent<ScreenFadeScript>();

        endStatistics = GameObject.Find("EndStatistics");
        endStatistics.transform.SetParent(this.transform);
        endStatistics.AddComponent<EndStatisticsScript>();

        initialScene = new GameObject("InitialScene");
        initialScene.transform.parent = this.transform;
        initialScene.AddComponent<InitialScene>();

        objectiveIndicator = new GameObject("ObjectiveIndicator");
        objectiveIndicator.AddComponent<ObjectiveIndicatorScript>();

        character = new GameObject("CustomCharacterController");
        // character.transform.parent = this.transform;
        character.AddComponent<CustomCharacterController>();

        drifter = GameObject.Find("Drifter");
        drifter.transform.parent = this.transform;
        drifter.AddComponent<DrifterScript>();
        drifter.transform.position = Camera.main.transform.position + drifterOffset;

        tree = new StoryTree(this.gameObject);
        tree.growTree();
        curGameStatus = StoryStatus.STATUS_None;

        GameObject.Find("StoryConditionManager").GetComponent<StoryConditionManager>().addCondition(StoryConditionValues.PlayerDead);
        GameObject.Find("StoryConditionManager").GetComponent<StoryConditionManager>().addCondition(StoryConditionValues.DrifterDead);

        dialogueHandler.hideSubtitle();

        Pause();

        //WWW gameAnalytics = this.getAnalytics();
        //WWW updateGameAnalytics = this.updateAnalytics(GAME_ANALYTICS_DID_NOT_SAVE);
    }