public void Execute(RoomVO room) { if (!room.Cleared && (room.MoveThroughChance > 0) && !room.HostHere) { AmbitionApp.OpenDialog <RoomVO>(DialogConsts.CHOOSE_ROOM, room); } }
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); } }
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); } }
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; } }
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); } }
public void Execute(int livre) { if (livre <= 0) { AmbitionApp.OpenDialog("OutOfMoneyPopUpModal"); } }
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]); }
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); }
public void Cancel() { #if UNITY_STANDALONE AmbitionApp.OpenDialog(DialogConsts.GAME_MENU); #else #endif }
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]); } } } }
public void Cancel() { #if UNITY_STANDALONE AmbitionApp.OpenDialog(DialogConsts.GAME_MENU); #else AmbitionApp.SendMessage(GameMessages.COMPLETE); #endif }
public void LoadSelected() { if (_selected != null) { AmbitionApp.OpenDialog("restore", OnConfirm, new Dictionary <string, string>() { { "%g", _selected.SaveText.text } }); } }
public void DeleteSelected() { if (_selected != null) { AmbitionApp.OpenDialog("delete_saved", OnDelete, new Dictionary <string, string>() { { "%g", _selected.SaveText.text } }); } }
public void Execute(ErrorEventArgs args) { switch (args.Type) { case ErrorEventArgs.ErrorType.save_file: HandleSaveFileError(args.Data[0]); break; } AmbitionApp.OpenDialog(DialogConsts.ERROR, args); }
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 }); } }
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); } } } }
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); } } }
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); } } }
// 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); } }
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); }
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); } } }
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)); }
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; } } } }
public override void OnEnter() => AmbitionApp.OpenDialog(dialogID);// args[0]);
public void ResetGame() { AmbitionApp.OpenDialog("exit", () => AmbitionApp.SendMessage(GameMessages.EXIT_GAME)); }
//To Do: Add in the fader (Still needs to be made) private void HandleSelect(LocationPin location) { ExplorePin.SetActive(false); AmbitionApp.OpenDialog("PARIS_LOCATION", location); }
public void Execute() { AmbitionApp.OpenDialog(DialogConsts.EXIT_GAME); }
protected void OpenDialog() { AmbitionApp.OpenDialog(DialogID); }
public void OpenDialog(string dialogID) { AmbitionApp.OpenDialog(dialogID); }
//To Do: Add in the fader (Still needs to be made) private void HandleSelect(LocationConfig location) { _selected = location; AmbitionApp.OpenDialog(DialogConsts.PARIS_LOCATION, _selected); }