Beispiel #1
0
        public override void OnEnterState()
        {
            CalendarModel calendar = AmbitionApp.GetModel <CalendarModel>();

            if (calendar.Today >= calendar.NextStyleSwitchDay)
            {
                InventoryModel inventory = AmbitionApp.GetModel <InventoryModel>();
                string         nextStyle = inventory.NextStyle;

                if (nextStyle == null)
                {
                    nextStyle = inventory.Styles[Util.RNG.Generate(1, inventory.Styles.Length)];
                    if (nextStyle == inventory.CurrentStyle)
                    {
                        nextStyle = inventory.Styles[0];
                    }
                }

                Dictionary <string, string> subs = new Dictionary <string, string>()
                {
                    { "$OLDSTYLE", inventory.CurrentStyle },
                    { "$NEWSTYLE", nextStyle }
                };
                AmbitionApp.OpenMessageDialog("style_change_dialog", subs);

                //Actually switching styles
                inventory.CurrentStyle = nextStyle;
                nextStyle                   = inventory.Styles[Util.RNG.Generate(1, inventory.Styles.Length)];
                inventory.NextStyle         = (nextStyle == inventory.NextStyle ? inventory.Styles[0] : nextStyle);
                calendar.NextStyleSwitchDay = calendar.Today.AddDays(Util.RNG.Generate(6, 9));
            }
        }
Beispiel #2
0
        public void Execute(RoomVO room)
        {
            PartyModel        party = AmbitionApp.GetModel <PartyModel>();
            ConversationModel model = AmbitionApp.GetModel <ConversationModel>();

            RemarkVO[] hand = model.Remarks;
            string     interest;
            int        numGuests = model.Guests.Length;
            int        i;

            for (i = hand.Length - 1; i >= party.AmbushHandSize - 1; i--)
            {
                hand[i] = new RemarkVO();
            }
            while (hand[i] == null)
            {
                interest = Util.RNG.TakeRandom(party.Interests);
                hand[i]  = new RemarkVO(Util.RNG.Generate(1, 3), interest);
                i--;
            }

            model.Remarks = hand;

            AmbitionApp.OpenDialog <RoomVO>(DialogConsts.ROOM, room);
            Dictionary <string, string> subs = new Dictionary <string, string>()
            {
                { "$ROOMNAME", room.Name }
            };

            AmbitionApp.OpenMessageDialog("ambush_dialog", subs);
        }
Beispiel #3
0
        public void Execute(DateTime day)
        {
            if (day.Day % 7 == 0)
            {
                InventoryModel inventory = AmbitionApp.GetModel <InventoryModel>();
                GameModel      game      = AmbitionApp.GetModel <GameModel>();
                List <ItemVO>  servants  = inventory.Inventory.FindAll(i => i.Type == ItemConsts.SERVANT && i.Equipped);
                float          cost      = 0;

                foreach (ItemVO item in servants)
                {
                    cost += item.Price;
                }

                if (cost > 0)
                {
                    game.Livre -= (int)cost;
                    Dictionary <string, string> substitutions = new Dictionary <string, string>()
                    {
                        { "$NUMSERVANTS", servants.Count.ToString() },
                        { "$TOTALWAGES", cost.ToString() },
                        { "$LIVRE", game.Livre.ToString() }
                    };
                    AmbitionApp.OpenMessageDialog(DialogConsts.PAY_DAY_DIALOG, substitutions);
                }
            }
        }
Beispiel #4
0
 public void Execute(PartyVO party)
 {
     if (AmbitionApp.GetModel <GameModel>().Level > 8)
     {
         InventoryModel inventory = AmbitionApp.GetModel <InventoryModel>();
         ItemVO         item;
         if (inventory.Equipped.TryGetValue(ItemConsts.OUTFIT, out item) && item != null)
         {
             string style = (item as OutfitVO).Style;
             if (inventory.Equipped.TryGetValue(ItemConsts.ACCESSORY, out item) &&
                 item != null && (string)item.State[ItemConsts.STYLE] == style)
             {
                 if (Util.RNG.Generate(0, 4) == 0)
                 {
                     //Send Out a Relevant Pop-Up
                     Dictionary <string, string> substitutions = new Dictionary <string, string>()
                     {
                         { "$OLDSTYLE", inventory.CurrentStyle },
                         { "$NEWSTYLE", style }
                     };
                     AmbitionApp.OpenMessageDialog("set_trend_dialog", substitutions);
                 }
             }
         }
     }
 }
Beispiel #5
0
        public void Execute(RoomVO room)
        {
            // If Current Room is null, you're probably jumping into the foyer.
            MapModel   model      = AmbitionApp.GetModel <MapModel>();
            PartyModel partyModel = AmbitionApp.GetModel <PartyModel>();

            if (model.Room != null && !model.Room.Cleared)
            {
                int            chance    = model.Room.MoveThroughChance;
                InventoryModel inventory = AmbitionApp.GetModel <InventoryModel>();
                ItemVO         accessory;
                // TODO: Implement Item states
                if (inventory.Equipped.TryGetValue("accessory", out accessory) &&
                    accessory.Name == "Cane")
                {
                    chance = ((chance < 90) ? (chance + 10) : 100);
                }
                //TODO: MoveThrough vs Ambush
                //					if (rnd.Next(100) < chance)
            }

            if (!room.Visited)
            {
                AmbitionApp.SendMessage(room.Actions);
                room.Visited = true;
            }

            model.Room = room;

            foreach (RoomVO rm in model.Map.Rooms)
            {
                if (!rm.Revealed && rm.IsAdjacentTo(room))
                {
                    rm.Revealed = true;
                    AmbitionApp.SendMessage(rm);
                }
            }

            // Fill yer glass
            if (Array.IndexOf(room.Features, PartyConstants.PUNCHBOWL) >= 0)
            {
                AmbitionApp.SendMessage(PartyMessages.REFILL_DRINK);
            }

            // At a certain reputation level, the player's glass may be filled without a punchbowl
            else if (!room.Cleared &&
                     partyModel.Drink < partyModel.MaxDrinkAmount &&
                     AmbitionApp.GetModel <FactionModel>()[partyModel.Party.Faction].Level >= 5 &&
                     Util.RNG.Generate(0, 4) == 0)
            {
                partyModel.Drink = partyModel.MaxDrinkAmount;
                Dictionary <string, string> subs = new Dictionary <string, string>()
                {
                    { "$HOSTNAME", partyModel.Party.Host }
                };
                AmbitionApp.OpenMessageDialog("refill_wine_dialog", subs);
            }
        }
Beispiel #6
0
        public void Execute(RoomVO room)
        {
            PartyModel   model = AmbitionApp.GetModel <PartyModel>();
            FactionModel fmod  = AmbitionApp.GetModel <FactionModel>();

            if (fmod[model.Party.Faction].Level >= 2)
            {
                AmbitionApp.SendMessage(PartyMessages.REFILL_DRINK);

                Dictionary <string, string> substitutions = new Dictionary <string, string>()
                {
                    { "$HOSTNAME", model.Party.Host }
                };
                AmbitionApp.OpenMessageDialog(DialogConsts.REPUTATION_WINE_DIALOG, substitutions);
            }
        }
        override public void OnEnterState()
        {
            CalendarModel calendar = AmbitionApp.GetModel <CalendarModel>();

            if (!calendar.Timeline.ContainsKey(calendar.Yesterday))
            {
                return;
            }
            PartyVO[] parties = calendar.Timeline[calendar.Yesterday].OfType <PartyVO>().Where(p => p.RSVP == RSVP.New).ToArray();
            AmbitionApp.GetModel <GameModel>().Reputation -= 40 * parties.Length;
            foreach (PartyVO party in parties)
            {
                Dictionary <string, string> subs = new Dictionary <string, string>()
                {
                    { "$PARTYNAME", party.Name }
                };
                AmbitionApp.OpenMessageDialog(DialogConsts.MISSED_RSVP_DIALOG, subs);
            }
        }
 public override void OnEnterState() => AmbitionApp.OpenMessageDialog(_phrase);
 public void JournalSelected()
 {
     //This tab isn't ready yet, and going there causes issues and looks ugly
     //SetTab(JournalTab);
     AmbitionApp.OpenMessageDialog("feature_incomplete_dialog");
 }