예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Shop"/> class.
 /// </summary>
 /// <param name="previous">The previous.</param>
 /// <param name="name">The name.</param>
 /// <param name="flags">The flags.</param>
 /// <param name="party">The party.</param>
 /// <param name="sellPriceMultiplier">The sell price modifier.</param>
 /// <param name="buyPriceMultiplier">The buy price modifier.</param>
 /// <param name="shopkeeper">The shopkeeper.</param>
 public Shop(Page previous, string name, Flags flags, Party party, float sellPriceMultiplier, float buyPriceMultiplier, Character shopkeeper) : base(new Page(name))
 {
     this.previous            = previous;
     this.flags               = flags;
     this.party               = party;
     this.sellPriceMultiplier = sellPriceMultiplier;
     this.buyPriceMultiplier  = buyPriceMultiplier;
     this.shopkeeper          = shopkeeper;
     this.talks               = new List <Talk>();
     this.buys = new List <Buy>();
     Root.AddCharacters(Side.LEFT, party.Collection);
     Root.AddCharacters(Side.RIGHT, shopkeeper);
     SetupMenus();
 }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorldPages"/> class.
        /// </summary>
        /// <param name="previous">The previous.</param>
        /// <param name="flags">The flags.</param>
        /// <param name="party">The party.</param>
        public WorldPages(Page previous, Flags flags, Party party) : base(new Page("Areas"))
        {
            Root.Body = "Which area would you like to go to?";

            IList <IButtonable> buttons = new List <IButtonable>();

            buttons.Add(PageUtil.GenerateBack(previous));

            Root.AddCharacters(Side.LEFT, party.Collection);

            foreach (AreaType type in AreaList.ALL_AREAS.Keys)
            {
                if (flags.IsAreaUnlocked(type) && flags.CurrentArea != type)
                {
                    buttons.Add(GetAreaChangeProcess(type, flags, party, previous));
                }
            }

            Root.Actions = buttons;
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PageGroup" /> class.
        /// </summary>
        /// <param name="party">The party to enter the dungeon.</param>
        /// <param name="defeat">The page to go to if the party is defeated.</param>
        /// <param name="previous">The previous page, used to back out of the dungeon.</param>
        /// <param name="destination">The destination, where finishing the dungeon will lead to.</param>
        /// <param name="name">The name of the dungeon.</param>
        /// <param name="description">The description of the dungeon.</param>
        /// <param name="encounterGenerator">The encounter generator, used to generate dungeon encounters.</param>
        /// <param name="onClear">The on clear.</param>
        public Dungeon(
            IEnumerable <Character> party,
            Page defeat,
            Page previous,
            Page destination,
            string name,
            string description,
            Func <Encounter[]> encounterGenerator,
            Action onClear) : base(new Page(name))
        {
            Root.Body = description;
            this.encounterGenerator = encounterGenerator;
            this.onClear            = onClear;
            Root.AddCharacters(Side.LEFT, party);

            Root.Actions = new IButtonable[] {
                PageUtil.GenerateBack(previous),
                GetDungeonEnterProcess(party, defeat, destination, onClear)
            };
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StagePages"/> class.
        /// </summary>
        /// <param name="previous">The previous page to back to.</param>
        /// <param name="party">The current party.</param>
        /// <param name="flags">The game's flags.</param>
        public StagePages(Page previous, Party party, Flags flags) : base(new Page("Quest"))
        {
            var buttons = new List <IButtonable>();

            this.party    = party;
            this.flags    = flags;
            this.previous = previous;

            Root.Icon = Util.GetSprite("dungeon-gate");
            Root.AddCharacters(Side.LEFT, party);
            Root.Condition = PageUtil.GetVisitProcessCondition(flags, party);

            buttons.Add(PageUtil.GenerateBack(previous));

            Area currentArea = GetCurrentArea(flags.CurrentArea);

            for (int i = 0; i < currentArea.Stages.Count; i++)
            {
                if (IsStagePlayable(i, currentArea))
                {
                    buttons.Add(GetPageEntryProcess(i, currentArea));
                }
                else
                {
                    buttons.Add(new Process("<color=grey>???</color>", "Complete the previous stage to unlock."));
                }
            }

            Get(ROOT_INDEX).Actions = buttons;
            Get(ROOT_INDEX).OnEnter = () => {
                Get(ROOT_INDEX)
                .AddText(
                    "Select a stage."
                    );
            };
        }