示例#1
0
 public void Execute(RoomVO room)
 {
     if (!room.Cleared && (room.MoveThroughChance > 0) && !room.HostHere)
     {
         AmbitionApp.OpenDialog <RoomVO>(DialogConsts.CHOOSE_ROOM, room);
     }
 }
示例#2
0
 public void PeddleInfluencePopUp() //This has to be handled in a pop-up because the player has to evaluate the odds and confirm their decision
 {
     if (_gossip != null)
     {
         AmbitionApp.OpenDialog("PEDDLE_INFLUENCE", _gossip);
     }
 }
示例#3
0
        public void Save()
        {
            _path = Path.Combine(UnityEngine.Application.persistentDataPath, Filepath.SAVE_FILE);
            List <string[]> saves;

            if (File.Exists(_path))
            {
                string result = File.ReadAllText(_path);
                saves = Newtonsoft.Json.JsonConvert.DeserializeObject <List <string[]> >(result);
                LoadGameButton.interactable = saves.Count > 0;
            }
            else
            {
                saves = new List <string[]>();
            }

            if (AmbitionApp.Game.SaveSlotID >= 0)
            {
                AmbitionApp.OpenDialog(DialogConsts.SAVE_GAME);
            }
            else if (saves.Count < AmbitionApp.Game.MaxSaves)
            {
                AmbitionApp.CloseDialog(DialogConsts.GAME_MENU);
                AmbitionApp.OpenDialog(DialogConsts.SAVE_NEW);
                AmbitionApp.SendMessage(GameMessages.SAVE_GAME);
            }
            else
            {
                AmbitionApp.OpenDialog("game_menu.saves.modal.too_many_saves", null, null);
            }
        }
示例#4
0
        public void Execute(DateTime date)
        {
            CalendarModel calendar = AmbitionApp.GetModel <CalendarModel>();

            if (!calendar.Timeline.ContainsKey(date))
            {
                return;
            }
            List <PartyVO> parties = calendar.Timeline[date].OfType <PartyVO>().ToList();

            switch (parties.Count)
            {
            case 0:
                break;  // Don't do shit.

            case 1:     // Decide whether you're staying or going.
                AmbitionApp.OpenDialog(parties[0].RSVP == RSVP.Accepted
                                           ? DialogConsts.CANCEL
                                           : DialogConsts.RSVP, parties[0]);
                break;

            // You must choose
            // But choose wisely
            // For while the true Party grants eternal life
            // A false one will take it from you
            default:
                AmbitionApp.OpenDialog(DialogConsts.RSVP_CHOICE, parties);
                break;
            }
        }
示例#5
0
 public void SellGossipPopUp() //This has to be handled in a pop-up because the player has to evaluate the odds and confirm their decision
 {
     if (_gossip != null)
     {
         AmbitionApp.OpenDialog("SELL_GOSSIP", _gossip);
     }
 }
示例#6
0
 public void Execute(int livre)
 {
     if (livre <= 0)
     {
         AmbitionApp.OpenDialog("OutOfMoneyPopUpModal");
     }
 }
示例#7
0
        public override void OnEnter()
        {
            List <CalendarEvent> events  = null;
            List <PartyVO>       parties = AmbitionApp.GetModel <PartyModel>().GetNewInvitations(true, false);
            List <RendezVO>      rendezs;

            if (parties.Count == 0)
            {
                CharacterModel model = AmbitionApp.GetModel <CharacterModel>();
                rendezs = model.GetNewEvents(true, false);
                if (rendezs.Count > 0)
                {
                    events = rendezs.ConvertAll(r => (CalendarEvent)r);
                    events.Sort();
                    events = events.FindAll(e => e.Day == events[0].Day);
                }
            }
            else
            {
                parties.Sort();
                events = parties.FindAll(p => p.Day == parties[0].Day).ConvertAll(p => (CalendarEvent)p);
                RendezVO[] occasions = AmbitionApp.Calendar.GetOccasions <RendezVO>(parties[0].Day);
                occasions = Array.FindAll(occasions, r => r.RSVP == RSVP.New);
                events.AddRange(occasions);
            }
            events?.ForEach(e => e.Created = AmbitionApp.Calendar.Day);
            AmbitionApp.OpenDialog(DialogConsts.RSVP, events?.ToArray() ?? new CalendarEvent[0]);
        }
示例#8
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);
        }
示例#9
0
        public void Cancel()
        {
#if UNITY_STANDALONE
            AmbitionApp.OpenDialog(DialogConsts.GAME_MENU);
#else
#endif
        }
示例#10
0
 public void SelectParty(int partyNumber)
 {
     for (int i = _parties.Count - 1; i >= 0; i--)
     {
         if (_parties[i] != null)
         {
             if (i != partyNumber)
             {
                 if (_parties[i].RSVP == RSVP.Accepted)
                 {
                     AmbitionApp.OpenDialog(DialogConsts.RSVP_CHOICE, _parties[i]);
                 }
                 else
                 {
                     _parties[i].RSVP = RSVP.Declined;
                     AmbitionApp.SendMessage(_parties[i]);
                 }
             }
             else
             {
                 AmbitionApp.SendMessage(DialogConsts.RSVP, _parties[i]);
             }
         }
     }
 }
示例#11
0
        public void Cancel()
        {
#if UNITY_STANDALONE
            AmbitionApp.OpenDialog(DialogConsts.GAME_MENU);
#else
            AmbitionApp.SendMessage(GameMessages.COMPLETE);
#endif
        }
示例#12
0
 public void LoadSelected()
 {
     if (_selected != null)
     {
         AmbitionApp.OpenDialog("restore", OnConfirm, new Dictionary <string, string>()
         {
             { "%g", _selected.SaveText.text }
         });
     }
 }
示例#13
0
 public void DeleteSelected()
 {
     if (_selected != null)
     {
         AmbitionApp.OpenDialog("delete_saved", OnDelete, new Dictionary <string, string>()
         {
             { "%g", _selected.SaveText.text }
         });
     }
 }
示例#14
0
 public void Execute(ErrorEventArgs args)
 {
     switch (args.Type)
     {
     case ErrorEventArgs.ErrorType.save_file:
         HandleSaveFileError(args.Data[0]);
         break;
     }
     AmbitionApp.OpenDialog(DialogConsts.ERROR, args);
 }
示例#15
0
        public override void OnEnter()
        {
            CharacterModel  characters = AmbitionApp.GetModel <CharacterModel>();
            List <RendezVO> rendezs    = characters.GetPendingInvitations(true, false);

            if (rendezs.Count > 0)
            {
                RendezVO rendez = rendezs[0];
                AmbitionApp.SendMessage(RendezvousMessages.CREATE_RENDEZVOUS_RESPONSE, rendez);
                AmbitionApp.OpenDialog(DialogConsts.RSVP, new CalendarEvent[] { rendez });
            }
        }
示例#16
0
        public override void OnEnter()
        {
            CalendarModel cal = AmbitionApp.Calendar;

            PartyVO[] parties = cal.GetOccasions <PartyVO>(cal.Day - 1);
            PartyVO   party   = Array.Find(parties, p => p.RSVP == RSVP.New);

            if (party != null)
            {
                CommodityVO penalty = new CommodityVO(CommodityType.Credibility, AmbitionApp.GetModel <PartyModel>().IgnoreInvitationPenalty);
                Dictionary <string, string> subs = new Dictionary <string, string>();
                LocalizationModel           loc  = AmbitionApp.GetModel <LocalizationModel>();
                party.RSVP           = RSVP.Declined;
                subs["$PARTYNAME"]   = loc.GetPartyName(party);
                subs["$CREDIBILITY"] = penalty.Value.ToString();
                AmbitionApp.OpenDialog(DialogConsts.MISSED_RSVP_DIALOG, subs);
                AmbitionApp.SendMessage(penalty);
            }
            else
            {
                RendezVO[] dates = cal.GetOccasions <RendezVO>(cal.Day - 1);
                RendezVO   date  = Array.Find(dates, d => d.RSVP == RSVP.New);
                if (date != null)
                {
                    CharacterModel characters  = AmbitionApp.GetModel <CharacterModel>();
                    CharacterVO    character   = characters.GetCharacter(date.Character);
                    bool           isPenalized = !date.IsCaller;
                    date.RSVP = RSVP.Declined;
                    if (character != null)
                    {
                        character.LiaisonDay = -1;
                    }
                    AmbitionApp.SendMessage(date);
                    if (isPenalized)
                    {
                        int         penalty      = characters.MissedRendezvousPenalty;
                        CommodityVO favorPenalty = new CommodityVO()
                        {
                            Type  = CommodityType.Favor,
                            ID    = date.Character,
                            Value = penalty
                        };
                        AmbitionApp.SendMessage(favorPenalty);
                        Dictionary <string, string> subs = new Dictionary <string, string>();
                        subs["$SHORTNAME"] = AmbitionApp.GetModel <LocalizationModel>().GetShortName(character, date.Character);
                        subs["$FAVOR"]     = penalty.ToString();
                        AmbitionApp.OpenDialog(DialogConsts.MISSED_RENDEZVOUS_DIALOG, subs);
                    }
                }
            }
        }
示例#17
0
        public void CreateCancellationModal()
        {
            List <ICalendarEvent> events;
            CalendarModel         calendar = AmbitionApp.GetModel <CalendarModel>();

            if (calendar.Timeline.TryGetValue(calendar.Today, out events))
            {
                PartyVO party = events.Find(e => e is PartyVO && ((PartyVO)e).RSVP == RSVP.Accepted) as PartyVO;
                if (party != null)
                {
                    AmbitionApp.OpenDialog(DialogConsts.CANCEL, party);
                }
            }
        }
示例#18
0
 public void Execute(PartyVO party)
 {
     if (party != null)
     {
         if (AmbitionApp.Inventory.GetEquippedItem(ItemType.Outfit) != null)
         {
             AmbitionApp.SendMessage(PartyMessages.START_PARTY);
         }
         else
         {
             //You ain't got no clothes to attend the party!
             AmbitionApp.OpenDialog(DialogConsts.NO_OUTFIT);
         }
     }
 }
示例#19
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown("escape"))
     {
         AmbitionApp.OpenDialog("EXIT_GAME");
     }
     if (Input.GetMouseButtonDown(0))
     {
         Cursor.SetCursor(CursorClick, HotSpot, CursorMode);
     }
     if (Input.GetMouseButtonUp(0))
     {
         Cursor.SetCursor(CursorRest, HotSpot, CursorMode);
     }
 }
示例#20
0
        public override void OnEnterState()
        {
            PartyModel model = AmbitionApp.GetModel <PartyModel>();
            PartyVO    party = model.Party;

            // Lose a turn
            model.Turn++;

            //The Player is relocated to the Entrance
            MapModel mmod = AmbitionApp.GetModel <MapModel>();

            mmod.Room = mmod.Map.Entrance;

            AmbitionApp.OpenDialog("DEFEAT");
            AmbitionApp.SendMessage(PartyMessages.FLEE_CONVERSATION);
            AmbitionApp.SendMessage(PartyMessages.SHOW_MAP);
        }
示例#21
0
 public void Execute(PartyVO party)
 {
     AmbitionApp.GetModel <PartyModel>().Party = party;
     if (party != null)
     {
         InventoryModel model = AmbitionApp.GetModel <InventoryModel>();
         if (model.Inventory.Exists(i => i.Type == ItemConsts.OUTFIT))
         {
             AmbitionApp.SendMessage(PartyMessages.START_PARTY);
         }
         else
         {
             //You ain't got no clothes to attend the party!
             AmbitionApp.OpenDialog(DialogConsts.NO_OUTFIT);
         }
     }
 }
示例#22
0
        public override void OnEnterState()
        {
            CalendarModel  calendar = AmbitionApp.GetModel <CalendarModel>();
            DateTime       today    = calendar.Today;
            List <PartyVO> parties  = calendar.GetEvents <PartyVO>(today).Where(p => p.RSVP == RSVP.New).ToList();

            if (Util.RNG.Generate(0, 3) == 0)            // Chance of a random future engagement
            {
                PartyVO party = new PartyVO
                {
                    InvitationDate = today,
                    Date           = today.AddDays(Util.RNG.Generate(1, 8) + Util.RNG.Generate(1, 8)), // +2d8 days
                    RSVP           = RSVP.New
                };
                AmbitionApp.Execute <InitPartyCmd, PartyVO>(party);
                parties.Add(party);
            }
            parties.ForEach(p => AmbitionApp.OpenDialog(RSVPDialog.DIALOG_ID, p));
        }
示例#23
0
        public void Execute(DateTime date)
        {
            CalendarModel calendar = AmbitionApp.GetModel <CalendarModel>();
            PartyModel    model    = AmbitionApp.GetModel <PartyModel>();

            PartyVO[]  parties = calendar.GetOccasions <PartyVO>(date);
            RendezVO[] dates   = calendar.GetOccasions <RendezVO>(date);
            if (parties.Length + dates.Length > 0)
            {
                PartyVO  party  = Array.Find(parties, p => p.IsAttending);
                RendezVO rendez = Array.Find(dates, p => p.IsAttending);
                if (party != null)
                {
                    AmbitionApp.OpenDialog(DialogConsts.RSVP, new CalendarEvent[] { party });
                }
                else if (rendez != null)
                {
                    AmbitionApp.OpenDialog(DialogConsts.RSVP, new CalendarEvent[] { rendez });
                }
                else
                {
                    List <CalendarEvent> events = new List <CalendarEvent>(parties);
                    events.AddRange(dates);
                    AmbitionApp.OpenDialog(DialogConsts.RSVP, events.ToArray());
                }
            }
            else if (date.Subtract(calendar.Today).Days >= 1 && AmbitionApp.Paris.Rendezvous.Count > 0)
            {
                CharacterModel cModel = AmbitionApp.GetModel <CharacterModel>();
                foreach (CharacterVO character in cModel.Characters.Values)
                {
                    if (character.IsDateable && !character.IsRendezvousScheduled)
                    {
                        AmbitionApp.OpenDialog(DialogConsts.CREATE_RENDEZVOUS, date);
                        break;
                    }
                }
            }
        }
示例#24
0
 public override void OnEnter() => AmbitionApp.OpenDialog(dialogID);// args[0]);
示例#25
0
 public void ResetGame()
 {
     AmbitionApp.OpenDialog("exit", () => AmbitionApp.SendMessage(GameMessages.EXIT_GAME));
 }
示例#26
0
 //To Do: Add in the fader (Still needs to be made)
 private void HandleSelect(LocationPin location)
 {
     ExplorePin.SetActive(false);
     AmbitionApp.OpenDialog("PARIS_LOCATION", location);
 }
示例#27
0
 public void Execute()
 {
     AmbitionApp.OpenDialog(DialogConsts.EXIT_GAME);
 }
示例#28
0
 protected void OpenDialog()
 {
     AmbitionApp.OpenDialog(DialogID);
 }
示例#29
0
 public void OpenDialog(string dialogID)
 {
     AmbitionApp.OpenDialog(dialogID);
 }
示例#30
0
 //To Do: Add in the fader (Still needs to be made)
 private void HandleSelect(LocationConfig location)
 {
     _selected = location;
     AmbitionApp.OpenDialog(DialogConsts.PARIS_LOCATION, _selected);
 }