Exemple #1
0
        static async Task <string> TryEnter(Player player, string areaName, ISocketMessageChannel chan)
        {
            switch (areaName)
            {
            case "Floor":
            {
                if (player.IsEncounter(Encounter.Names.Floor))
                {
                    await EnterFLoor(player, chan);

                    return(null);
                }
                return("There are currently no accessible new floors.");
            }

            case "Dungeon":
            {
                if (player.IsEncounter(Encounter.Names.Dungeon))
                {
                    await EnterDungeon(player, chan);

                    return(null);
                }
                return("There are no dungeons currently available");
            }

            default:
            {
                Junction j = player.Area.junctions.Find(Junction.FindName(areaName));
                if (j != null)
                {
                    if (player.Area.arena != null)
                    {
                        await player.Area.arena.EndChallenge(player.Encounter, player.Area, player.areaPath.floor);
                    }

                    await EnterJunction(player, j, chan);

                    if (player.Area.AreaId == "Neitsillia\\Casdam Ilse\\Central Casdam\\Serene Cliffside\\Ruined Shrine" &&
                        player.quests.Find(q => q.Equals(0, 2, 2) || q.Equals(0, 2, 3) || q.Equals(0, 2, 4)) != null &&
                        (player.Party == null || player.Party.MemberCount == 1))
                    {
                        player.Quest_Trigger(Quest.QuestTrigger.QuestLine, "Whispers Of The Wind III");
                        player.NewEncounter(new Encounter(Encounter.Names.Puzzle, player,
                                                          $"Disk;2;Untamed Specter"));
                        await player.NewUI(await chan.SendMessageAsync(embed: player.Encounter.GetEmbed().Build()), MsgType.Puzzle);
                    }

                    return(null);
                }
                return("Area is non existent or inaccessible.");
            }
            }
        }
        public void TestJunction()
        {
            Junction junction       = new Junction();
            Input    JunctionInput  = (Input)junction.FindName("Input");
            Output   JunctionOutput = (Output)junction.FindName("Output");

            Output testOutput = new Output();

            testOutput.State = false;

            JunctionInput.LinkInputs(testOutput);
            JunctionInput._state_StateChange();

            Assert.IsTrue(JunctionOutput.State == false);

            testOutput.State = true;
            JunctionInput._state_StateChange();

            Assert.IsTrue(JunctionOutput.State == true);
        }