Exemple #1
0
        private bool CheckIncident()
        {
            IncidentModel model = AmbitionApp.GetModel <IncidentModel>();

            while (model.Incident != null) // Iterates through incidents that meet requirements
            {
                if (AmbitionApp.CheckIncidentEligible(model.Incident))
                {
                    return(true);
                }
                model.NextIncident();
            }
            return(false);
        }
Exemple #2
0
        private void HandleSnapShot(byte[] snapshot)
        {
            LocalizationModel loc      = AmbitionApp.GetModel <LocalizationModel>();
            GameModel         model    = AmbitionApp.GetModel <GameModel>();
            IncidentModel     incident = AmbitionApp.GetModel <IncidentModel>();
            string            path     = Path.Combine(UnityEngine.Application.persistentDataPath, Filepath.SAVE_FILE);
            List <string[]>   saves;
            string            result;
            string            saveID       = loc?.HeaderTitlePhrase;
            string            snapshotPath = DateTime.Now.Ticks.ToString() + ".jpg";

            if (File.Exists(path))
            {
                result = File.ReadAllText(path);
                saves  = JsonConvert.DeserializeObject <List <string[]> >(result);
            }
            else
            {
                saves = new List <string[]>();
            }

            if (!string.IsNullOrEmpty(saveID))
            {
                saveID = AmbitionApp.Localize(saveID);
                saveID = string.IsNullOrEmpty(saveID)
                    ? model.PlayerName + " - " + loc.HeaderTitlePhrase + " - " + DateTime.Now.ToString()
                    : model.PlayerName + " - " + saveID + " - " + DateTime.Now.ToString();
            }
            else
            {
                saveID = model.PlayerName + " - " + DateTime.Now.ToString();
            }

            string[] savedGame = new string[]
            {
                saveID,
                snapshotPath,
                AmbitionApp.GetService <ModelSvc>().Save()
            };
            if (snapshot != null)
            {
                snapshotPath = Path.Combine(UnityEngine.Application.persistentDataPath, snapshotPath);
                System.IO.File.WriteAllBytes(snapshotPath, snapshot);
            }
            model.SaveSlotID = saves.Count;
            saves.Add(savedGame);
            result = JsonConvert.SerializeObject(saves);
            File.WriteAllText(path, result);
        }
Exemple #3
0
        void Start()
        {
            IncidentModel model = AmbitionApp.GetModel <IncidentModel>();

            _incident          = model.Incident;
            _background.sprite = model.RestoreSavedState();
            HandleMoment(model.Moment);

            if (_incident != null)
            {
                int            index       = Array.IndexOf(_incident.Nodes, model.Moment);
                TransitionVO[] transitions = _incident.GetLinks(index);
                HandleTransitions(transitions);
            }
        }
Exemple #4
0
        public LocationVO SaveLocation(LocationConfig config)
        {
            if (config == null)
            {
                return(null);
            }

            List <string> incidents = new List <string>();
            IncidentModel story     = AmbitionApp.Story;
            IncidentVO    incident  = config.IntroIncidentConfig?.GetIncident();

            if (incident != null)
            {
                story.Incidents[incident.ID] = incident;
                story.AddDependency(incident, config.name, IncidentType.Location);
            }

            if (config.StoryIncidentConfigs != null)
            {
                foreach (IncidentConfig iconfig in config.StoryIncidentConfigs)
                {
                    incident = iconfig?.GetIncident();
                    if (incident != null)
                    {
                        incidents.Add(incident.ID);
                        story.Incidents[incident.ID] = incident;
                        story.AddDependency(incident, config.name, IncidentType.Location);
                    }
                }
            }

            return(Locations[config.name] = new LocationVO()
            {
                ID = config.name,
                IntroIncident = config.IntroIncidentConfig?.name,
                StoryIncidents = incidents.ToArray(),
                SceneID = config.SceneID,
                IsOneShot = config.OneShot,
                IsDiscoverable = config.IsDiscoverable,
                IsRendezvous = config.IsRendezvous,
                Requirements = config.Requirements ?? new RequirementVO[0]
            });
        }
Exemple #5
0
 public void Execute(CommodityVO reward)
 {
     if (!string.IsNullOrEmpty(reward.ID))
     {
         IncidentModel story    = AmbitionApp.Story;
         IncidentVO    incident = story.LoadIncident(reward.ID, IncidentType.Reward);
         if (incident != null)
         {
             CalendarModel calendar = AmbitionApp.GetModel <CalendarModel>();
             if (reward.Value >= 0)
             {
                 incident.Date = calendar.Today.AddDays(reward.Value);
             }
             story.Incidents[reward.ID] = incident;
             if (incident.IsScheduled)
             {
                 AmbitionApp.SendMessage(CalendarMessages.SCHEDULE, incident);
             }
         }
     }
 }
Exemple #6
0
        public void Execute(string playerID)
        {
            GameModel game = AmbitionApp.Game;

            if (!game.Initialized)
            {
                AmbitionApp.Execute <InitGameCmd>();
            }
            IncidentModel incidentModel = AmbitionApp.GetModel <IncidentModel>();
            CalendarModel calendar      = AmbitionApp.GetModel <CalendarModel>();

            AmbitionApp.Execute <InitPlayerCmd, string>(playerID);
            List <IncidentVO> incidents = new List <IncidentVO>(incidentModel.Incidents.Values);

            foreach (IncidentVO incident in incidents)
            {
                if (incident.IsScheduled)
                {
                    incidentModel.Schedule(incident, incident.Date);
                }
            }
            IncidentVO incdent = incidentModel.UpdateIncident();

            game.Tutorials = new List <string>()
            {
                TutorialConsts.TUTORIAL_INCIDENT,
                TutorialConsts.TUTORIAL_CREDIBILITY,
                TutorialConsts.TUTORIAL_EXHAUSTION,
                TutorialConsts.TUTORIAL_PERIL,
                TutorialConsts.TUTORIAL_ALLEGIANCE,
                TutorialConsts.TUTORIAL_POWER,
                TutorialConsts.TUTORIAL_LIVRE
            };
            AmbitionApp.UFlow.Register <IncidentTutorialController>(TutorialConsts.TUTORIAL_INCIDENT);
            AmbitionApp.UFlow.Invoke(FlowConsts.GAME_CONTROLLER);
            AmbitionApp.SendMessage(AudioMessages.STOP_MUSIC);
        }
Exemple #7
0
        public void Execute(CalendarModel calendar)
        {
            IncidentModel story    = AmbitionApp.Story;
            IncidentVO    incident = story.Incident;

            if (incident == null && Util.RNG.Generate(100) < AmbitionApp.Game.PoliticalChance)
            {
                string[]          incidentIDs = story.Types[IncidentType.Political];
                List <IncidentVO> incidents   = new List <IncidentVO>();
                foreach (string incidentID in incidentIDs)
                {
                    incident = story.GetIncident(incidentID);
                    if (AmbitionApp.CheckIncidentEligible(incident) && !incident.IsScheduled)
                    {
                        incidents.Add(incident);
                    }
                }
                if (incidents.Count > 0)
                {
                    incident = Util.RNG.TakeRandom(incidents);
                    AmbitionApp.SendMessage(CalendarMessages.SCHEDULE, incident);
                }
            }
        }
Exemple #8
0
        public void Execute(PartyVO party)
        {
            CharacterModel characters = AmbitionApp.GetModel <CharacterModel>();
            GameModel      game       = AmbitionApp.Game;
            CalendarModel  calendar   = AmbitionApp.Calendar;
            IncidentModel  story      = AmbitionApp.Story;
            PartyModel     model      = AmbitionApp.GetModel <PartyModel>();

            if (string.IsNullOrEmpty(party.ID) || !model.LoadParty(party.ID, out party))
            {
                party.ID = null;
                if (party.Faction == FactionType.None)
                {
                    List <FactionType> factions = new List <FactionType>(AmbitionApp.Politics.Factions.Keys);
                    factions.Remove(FactionType.None);
                    party.Faction = RNG.TakeRandom(factions);
                }
            }

            if (string.IsNullOrEmpty(party.Host))
            {
                string               gender = RNG.Generate(2) < 1 ? "male" : "female";
                string[]             host   = new string[3];
                IEnumerable <string> locs   = AmbitionApp.GetPhrases(gender + "_title").Values;
                host[0]    = RNG.TakeRandom(locs);
                locs       = AmbitionApp.GetPhrases(gender + "_name").Values;
                host[1]    = RNG.TakeRandom(locs);
                locs       = AmbitionApp.GetPhrases("last_name").Values;
                host[2]    = RNG.TakeRandom(locs);
                party.Host = string.Join(" ", host);
            }

            if (party.Size == PartySize.None)
            {
                ChapterVO chapter = AmbitionApp.Game.GetChapter();
                int       chance  = RNG.Generate(chapter.TrivialPartyChance + chapter.DecentPartyChance + chapter.GrandPartyChance);
                if (chance < chapter.GrandPartyChance)
                {
                    party.Size = PartySize.Grand;
                }
                else if (chance < chapter.DecentPartyChance + chapter.GrandPartyChance)
                {
                    party.Size = PartySize.Decent;
                }
                else
                {
                    party.Size = PartySize.Trivial;
                }
            }

            if (party.phrases?.Length != 4)
            {
                party.phrases    = new int[4];
                party.phrases[0] = GetRandomPhrase(PartyConstants.PARTY_REASON + party.Faction.ToString().ToLower());
                party.phrases[1] = GetRandomPhrase(PartyConstants.PARTY_FLUFF_INTRO);
                party.phrases[2] = GetRandomPhrase(PartyConstants.PARTY_FLUFF_ADJECTIVE);
                party.phrases[3] = GetRandomPhrase(PartyConstants.PARTY_FLUFF_NOUN);
            }

            switch (party.RSVP)
            {
            case RSVP.Accepted:
            case RSVP.Required:
                AmbitionApp.SendMessage(PartyMessages.ACCEPT_INVITATION, party);
                break;

            case RSVP.Declined:
                AmbitionApp.SendMessage(PartyMessages.DECLINE_INVITATION, party);
                break;

            default:
                if (party.Day >= 0)
                {
                    AmbitionApp.SendMessage(CalendarMessages.SCHEDULE, party);
                }
                break;
            }
        }
Exemple #9
0
        public void Execute(string savedGameData)
        {
            GameModel game = AmbitionApp.Game;

            if (!game.Initialized)
            {
                AmbitionApp.Execute <InitGameCmd>();
            }
            UFlowSvc      uflow      = AmbitionApp.GetService <UFlowSvc>();
            CalendarModel calendar   = AmbitionApp.GetModel <CalendarModel>();
            IncidentModel story      = AmbitionApp.Story;
            ParisModel    paris      = AmbitionApp.Paris;
            PartyModel    partyModel = AmbitionApp.GetModel <PartyModel>();

            AmbitionApp.GetService <ModelSvc>().Restore(savedGameData);
            PlayerConfig config = Resources.Load <PlayerConfig>(Filepath.PLAYERS + game.playerID);

            AmbitionApp.Execute <RestorePlayerCmd, PlayerConfig>(config);
            LocationVO location = paris.GetLocation(paris.Location);

            AmbitionApp.CloseAllDialogs();
            AmbitionApp.SendMessage(AudioMessages.STOP_AMBIENT);
            AmbitionApp.SendMessage(AudioMessages.STOP_MUSIC);

            uflow.Reset();
            story.RestoreIncident();
            foreach (string tutorialID in game.Tutorials)
            {
                AmbitionApp.Execute <TutorialReward, CommodityVO>(new CommodityVO()
                {
                    Type = CommodityType.Tutorial,
                    ID   = tutorialID
                });
            }

            UMachine flow = calendar.Day == 0
                ? uflow.Instantiate(FlowConsts.GAME_CONTROLLER)
                : uflow.Instantiate(FlowConsts.DAY_FLOW_CONTROLLER);
            string sceneID = null;

            switch (game.Activity)
            {
            case ActivityType.Estate:
                if (story.Moment == null)
                {
                    flow = RestoreEstate(flow, out sceneID);
                }
                else
                {
                    flow = Restore(flow, MORNING_INCIDENT);
                }
                break;

            case ActivityType.Party:
                flow = Restore(flow, PARTY_STATE);
                if (story.Moment == null)
                {
                    if (partyModel.TurnsLeft > 0)
                    {
                        Restore(flow, PARTY_MAP);
                        sceneID = SceneConsts.MAP_SCENE;
                    }
                    else
                    {
                        Restore(flow, AFTER_PARTY);
                        sceneID = SceneConsts.AFTER_PARTY_SCENE;
                    }
                }
                else if (partyModel.Turn < 0)
                {
                    flow = Restore(flow, PARTY_INTRO);
                }
                else if (partyModel.TurnsLeft > 0)
                {
                    flow = Restore(flow, PARTY_ROOM);
                }
                else
                {
                    flow = Restore(flow, PARTY_OUTTRO);
                }
                break;

            case ActivityType.Evening:
                flow = Restore(flow, EVENING_STATE);
                break;

            case ActivityType.Paris:
                flow = Restore(flow, PARIS_STATE);
                if (story.Moment != null)
                {
                    flow = Restore(flow, PARIS_INCIDENT);
                }
                else
                {
                    sceneID = location?.SceneID ?? SceneConsts.PARIS_SCENE;
                    Restore(flow, sceneID == SceneConsts.PARIS_SCENE ? PARIS_STATE : PARIS_SCENE);
                }
                break;

            case ActivityType.Rendezvous:
                flow = Restore(flow, RENDEZVOUS_STATE);
                flow = Restore(flow, RENDEZVOUS_INCIDENT);
                break;
            }
            if (story.Moment != null)
            {
                Restore(flow, MOMENT);
                sceneID = SceneConsts.INCIDENT_SCENE;
            }
            if (!string.IsNullOrEmpty(sceneID))
            {
                AmbitionApp.SendMessage(GameMessages.LOAD_SCENE, sceneID);
            }
            uflow.Execute();
            AmbitionApp.SendMessage(GameMessages.GAME_LOADED);
        }
Exemple #10
0
        public override void OnEnter()
        {
            PartyModel model = AmbitionApp.GetModel <PartyModel>();

            IncidentVO[]  incidents = new IncidentVO[model.NumRooms];
            IncidentModel story     = AmbitionApp.Story;

            if (model.Incidents != null)
            {
                incidents = new IncidentVO[model.NumRooms];
                for (int i = model.NumRooms - 1; i >= 0; --i)
                {
                    incidents[i] = story.GetIncident(model.Incidents[i]);
                }
            }
            else
            {
                HashSet <string> characters = new HashSet <string>();
                if (model.RequiredIncident != null)
                {
                    int index = RNG.Generate(model.NumRooms);
                    incidents[index] = story.GetIncident(model.RequiredIncident);
                }
                else
                {
                    List <IncidentVO> result = new List <IncidentVO>();
                    IncidentVO        incident;
                    if (model.Party.SupplementalIncidents != null)
                    {
                        string[] shuffle = RNG.Shuffle(model.Party.SupplementalIncidents);
                        foreach (string incidentID in shuffle)
                        {
                            incident = story.GetIncident(incidentID);
                            if (result.Count < model.NumRooms)
                            {
                                if (FindCharacters(incident, characters))
                                {
                                    result.Add(incident);
                                }
                            }
                        }
                    }

                    if (result.Count < model.NumRooms)
                    {
                        incidents = story.GetIncidents(IncidentType.Party);
                        incidents = RNG.Shuffle(incidents);
                        foreach (IncidentVO rand in incidents)
                        {
                            if (AmbitionApp.CheckIncidentEligible(rand) &&
                                (rand.Factions?.Length == 0 || Array.IndexOf(rand.Factions, model.Party.Faction) >= 0) &&
                                FindCharacters(rand, characters))
                            {
                                result.Add(rand);
                            }
                            if (result.Count >= model.NumRooms)
                            {
                                break;
                            }
                        }
                    }
                    while (result.Count < model.NumRooms)
                    {
                        result.Add(null);
                    }
                    incidents = RNG.Shuffle(result);
                }
                model.Incidents = new string[model.NumRooms];
                for (int i = model.NumRooms - 1; i >= 0; --i)
                {
                    model.Incidents[i] = incidents[i]?.ID;
                }
            }

            AmbitionApp.SendMessage(PartyMessages.SELECT_INCIDENTS, incidents);
            string title = AmbitionApp.Localize(PartyConstants.PARTY_NAME + model.Party.ID);

            if (string.IsNullOrEmpty(title))
            {
                title = PartyConstants.PARTY_REASON + model.Party.Faction.ToString().ToLower() + "." + model.Party.phrases[0];
            }
            AmbitionApp.SendMessage(GameMessages.SHOW_HEADER, title);
        }
Exemple #11
0
        public bool LoadParty(string partyID, out PartyVO party)
        {
            PartyConfig config = Resources.Load <PartyConfig>(Filepath.PARTIES + partyID);

            if (config == null)
            {
                party = null;
                Resources.UnloadUnusedAssets();
                return(false);
            }

            IncidentModel story     = AmbitionApp.Story;
            List <string> incidents = new List <string>();
            IncidentVO    incident  = config.IntroIncident?.GetIncident();
            PartyModel    model     = AmbitionApp.GetModel <PartyModel>();

            party               = new PartyVO(config.name);
            party.Size          = config.Size == PartySize.None ? PartySize.Trivial : config.Size;
            party.IntroIncident = incident?.ID;
            story.AddDependency(incident, config.name, IncidentType.Party);

            incident           = config.ExitIncident?.GetIncident();
            party.ExitIncident = incident?.ID;
            story.AddDependency(incident, config.name, IncidentType.Party);

            if (config.RequiredIncidents != null)
            {
                string[] names    = Enum.GetNames(typeof(PartySize));
                int      index    = Array.IndexOf(names, party.Size.ToString());
                int      numTurns = index < model.NumTurnsByPartySize.Length
                    ? model.NumTurnsByPartySize[index]
                    : model.NumTurnsByPartySize[model.NumTurnsByPartySize.Length - 1];
                if (config.RequiredIncidents.Length > numTurns)
                {
                    numTurns = config.RequiredIncidents.Length;
                    for (int i = model.NumTurnsByPartySize.Length - 1; i > 0; --i)
                    {
                        if (numTurns >= model.NumTurnsByPartySize[i] && i < names.Length)
                        {
                            party.Size = (PartySize)i;
                            break;
                        }
                    }
                }
                foreach (IncidentConfig iconfig in config.RequiredIncidents)
                {
                    incident = iconfig?.GetIncident();
                    incidents.Add(incident?.ID);
                    story.AddDependency(incident, config.name, IncidentType.Party);
                }
            }
            party.RequiredIncidents = incidents.ToArray();

            if (config.SupplementalIncidents != null)
            {
                incidents.Clear();
                foreach (IncidentConfig iconfig in config.SupplementalIncidents)
                {
                    incident = iconfig?.GetIncident();
                    if (incident != null)
                    {
                        incidents.Add(incident?.ID);
                        story.AddDependency(incident, config.name, IncidentType.Party);
                    }
                }
            }
            party.SupplementalIncidents = incidents.ToArray();

            if (config.Date > 0)
            {
                party.Day = new DateTime(config.Date).Subtract(AmbitionApp.Calendar.StartDate).Days;
            }
            party.Faction = config.Faction == FactionType.None ? party.Faction : config.Faction;
            party.RSVP    = config.RSVP == RSVP.Required || party.RSVP == RSVP.Required
                ? RSVP.Required
                : party.RSVP == RSVP.New
                ? config.RSVP
                : config.RSVP == RSVP.New
                ? party.RSVP
                : config.RSVP;
            if (!string.IsNullOrWhiteSpace(config.Host))
            {
                party.Host = config.Host;
            }

            party.Requirements = config.Requirements;
            party.Map          = config.Map?.name;
            config             = null;
            Resources.UnloadUnusedAssets();
            return(true);
        }
Exemple #12
0
        public void Execute()
        {
            Util.RNG.Randomize();
            // Model, Message, Command, and Loc services registered in StartupInitBehavior
            App.Register <UFlow.UFlowSvc>();
            App.Register <FactorySvc>();
            App.Register <RewardFactorySvc>();
            App.Register <RequirementsSvc>();
            App.Register <ModelSvc>();

            CalendarModel calendar = AmbitionApp.RegisterModel <CalendarModel>();

            AmbitionApp.RegisterModel <LocalizationModel>();
            AmbitionApp.RegisterModel <ParisModel>();
            AmbitionApp.RegisterModel <GossipModel>();
            IncidentModel incidents = AmbitionApp.RegisterModel <IncidentModel>();

#if DEBUG
            AmbitionApp.RegisterModel <ConsoleModel>();
#endif

            // MENU
            AmbitionApp.RegisterCommand <AutosaveCmd>(GameMessages.AUTOSAVE);
            AmbitionApp.RegisterCommand <SaveGameCmd>(GameMessages.SAVE_GAME);
            AmbitionApp.RegisterCommand <ResetGameCmd>(GameMessages.EXIT_GAME);

            AmbitionApp.RegisterCommand <SchedulePartyCmd, PartyVO>(CalendarMessages.SCHEDULE);
            AmbitionApp.RegisterCommand <ScheduleIncidentCmd, IncidentVO>(CalendarMessages.SCHEDULE);
            AmbitionApp.RegisterCommand <ScheduleRendezvousCmd, RendezVO>(CalendarMessages.SCHEDULE);
            AmbitionApp.RegisterCommand <TransitionInputCmd, TransitionVO>(IncidentMessages.TRANSITION);
            AmbitionApp.RegisterCommand <SellItemCmd, ItemVO>(InventoryMessages.SELL_ITEM);
            AmbitionApp.RegisterCommand <SellGossipCmd, GossipVO>(InventoryMessages.SELL_GOSSIP);
            AmbitionApp.RegisterCommand <PeddleInfluenceCmd, GossipVO>(InventoryMessages.PEDDLE_INFLUENCE);
            AmbitionApp.RegisterCommand <BuyItemCmd, ItemVO>(InventoryMessages.BUY_ITEM);
            AmbitionApp.RegisterCommand <DeleteItemCmd, ItemVO>(InventoryMessages.DELETE_ITEM);
            AmbitionApp.RegisterCommand <InitPartyCmd, PartyVO>(PartyMessages.INITIALIZE_PARTY);

            AmbitionApp.RegisterCommand <GrantRewardCmd, CommodityVO>();
            AmbitionApp.RegisterCommand <GrantRewardsCmd, CommodityVO[]>();
            AmbitionApp.RegisterCommand <CheckMilitaryReputationCmd, FactionVO>();
            AmbitionApp.RegisterCommand <IntroServantCmd, string>(ServantMessages.INTRODUCE_SERVANT);
            AmbitionApp.RegisterCommand <HireServantCmd, string>(ServantMessages.HIRE_SERVANT);
            AmbitionApp.RegisterCommand <FireServantCmd, string>(ServantMessages.FIRE_SERVANT);
            AmbitionApp.RegisterCommand <FireServantTypeCmd, ServantType>(ServantMessages.FIRE_SERVANT);
            AmbitionApp.RegisterCommand <SelectDateCmd, DateTime>(CalendarMessages.SELECT_DATE);
            AmbitionApp.RegisterCommand <UpdateGossipModelCmd, CalendarModel>(CalendarMessages.UPDATE_CALENDAR);
            AmbitionApp.RegisterCommand <GenerateInvitationsCmd, CalendarModel>(CalendarMessages.UPDATE_CALENDAR);
            AmbitionApp.RegisterCommand <GenerateRendezvousCmd, CalendarModel>(CalendarMessages.UPDATE_CALENDAR);
            AmbitionApp.RegisterCommand <PoliticalIncidentCmd, CalendarModel>(CalendarMessages.UPDATE_CALENDAR);
            AmbitionApp.RegisterCommand <UpdateStandingsCmd>(FactionMessages.UPDATE_STANDINGS);
            AmbitionApp.RegisterCommand <EquipItemCmd, ItemVO>(InventoryMessages.EQUIP);
            AmbitionApp.RegisterCommand <UnequipItemCmd, ItemVO>(InventoryMessages.UNEQUIP);
            AmbitionApp.RegisterCommand <UnequipItemSlotCmd, ItemType>(InventoryMessages.UNEQUIP);
            AmbitionApp.RegisterCommand <GoToPartyCmd, PartyVO>(PartyMessages.GO_TO_PARTY);
            AmbitionApp.RegisterCommand <CreateGossipCmd, GossipVO>(InventoryMessages.CREATE_GOSSIP);
            AmbitionApp.RegisterCommand <CompleteQuestCmd, QuestVO>(QuestMessages.COMPLETE_QUEST);
            AmbitionApp.RegisterCommand <FailQuestCmd, QuestVO>(QuestMessages.QUEST_FAILED);
            AmbitionApp.RegisterCommand <FailLastQuestCmd>(QuestMessages.QUEST_FAILED);
            AmbitionApp.RegisterCommand <UpdateMerchantCmd>(InventoryMessages.UPDATE_MERCHANT);
            AmbitionApp.RegisterCommand <StartTutorialCmd, string>(TutorialMessages.START_TUTORIAL);
            AmbitionApp.RegisterCommand <EndTutorialCmd, string>(TutorialMessages.END_TUTORIAL);

            // Party
            AmbitionApp.RegisterCommand <RoomChoiceCmd, RoomVO>();
            AmbitionApp.RegisterCommand <ShowRoomCmd, string>(PartyMessages.SHOW_ROOM);

            AmbitionApp.RegisterCommand <IncreaseExhaustionCmd>(GameMessages.ADD_EXHAUSTION);
            AmbitionApp.RegisterCommand <ApplyExhaustionPenaltyCmd>(GameMessages.EXHAUSTION_EFFECT);
            AmbitionApp.RegisterCommand <ApplyOutfitEffectCmd>(GameMessages.OUTFIT_EFFECT);
            AmbitionApp.RegisterCommand <RestAtHomeCmd>(ParisMessages.REST);
            AmbitionApp.RegisterCommand <CheckPerilCmd, int>(GameConsts.PERIL);

            AmbitionApp.RegisterCommand <AcceptInvitationCmd, PartyVO>(PartyMessages.ACCEPT_INVITATION);
            AmbitionApp.RegisterCommand <DeclineInvitationCmd, PartyVO>(PartyMessages.DECLINE_INVITATION);

            AmbitionApp.RegisterCommand <AcceptRendezvousCmd, RendezVO>(PartyMessages.ACCEPT_INVITATION);
            AmbitionApp.RegisterCommand <DeclineRendezvousCmd, RendezVO>(PartyMessages.DECLINE_INVITATION);

            // Paris
            AmbitionApp.RegisterCommand <SelectDailiesCmd, string[]>(ParisMessages.SELECT_DAILIES);
            AmbitionApp.RegisterCommand <ChooseRendezvousCmd, string>(ParisMessages.CHOOSE_LOCATION);
            AmbitionApp.RegisterCommand <ChooseLocationCmd, string>(ParisMessages.CHOOSE_LOCATION);
            AmbitionApp.RegisterCommand <CalculateRendezvousResponseCmd, RendezVO>(RendezvousMessages.CREATE_RENDEZVOUS_RESPONSE);

            // REWARDS
            AmbitionApp.RegisterReward <LivreReward>(CommodityType.Livre);
            AmbitionApp.RegisterReward <GossipReward>(CommodityType.Gossip);
            AmbitionApp.RegisterReward <ItemReward>(CommodityType.Item);
            AmbitionApp.RegisterReward <ServantReward>(CommodityType.Servant);
            AmbitionApp.RegisterReward <MessageReward>(CommodityType.Message);
            AmbitionApp.RegisterReward <IncidentReward>(CommodityType.Incident);
            AmbitionApp.RegisterReward <LocationReward>(CommodityType.Location);
            AmbitionApp.RegisterReward <PartyReward>(CommodityType.Party);
            AmbitionApp.RegisterReward <CredReward>(CommodityType.Credibility);
            AmbitionApp.RegisterReward <PerilReward>(CommodityType.Peril);
            AmbitionApp.RegisterReward <FavorReward>(CommodityType.Favor);
            AmbitionApp.RegisterReward <FactionAllegianceReward>(CommodityType.Allegiance);
            AmbitionApp.RegisterReward <FactionPowerReward>(CommodityType.Power);
            AmbitionApp.RegisterReward <LiaisonReward>(CommodityType.Liaison);
            AmbitionApp.RegisterReward <MiscReward>(CommodityType.Misc);
            AmbitionApp.RegisterReward <TutorialReward>(CommodityType.Tutorial);
            AmbitionApp.RegisterReward <CharacterReward>(CommodityType.Character);
            AmbitionApp.RegisterReward <RendezvousOutfitReward>(CommodityType.RendezvousOutfit);
            AmbitionApp.RegisterReward <QuestReward>(CommodityType.Quest);
            AmbitionApp.RegisterReward <ExhaustionReward>(CommodityType.Exhaustion);
            AmbitionApp.RegisterReward <DateReward>(CommodityType.Date);

            // REQUIREMENTS
            AmbitionApp.RegisterRequirement(CommodityType.Chance, ChanceReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Random, ChanceReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Livre, LivreReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Credibility, CredReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Peril, PerilReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Date, DateReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Item, ItemReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Location, LocationReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Servant, ServantReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Favor, FavorReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Allegiance, FactionAllegianceReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Power, FactionPowerReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Exhaustion, ExhaustionReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Quest, ActiveQuestReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Incident, IncidentReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.OutfitReaction, OutfitReactionReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Liaison, LiaisonReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Misc, MiscReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Rendezvous, RendezvousReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.RendezvousFavor, RendezvousFavorReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.RendezvousOutfit, RendezvousOutfitReq.Check);
            AmbitionApp.RegisterRequirement(CommodityType.Character, CharacterReq.Check);

            AmbitionApp.UFlow.Register <GameFlow>(FlowConsts.GAME_CONTROLLER);
            AmbitionApp.UFlow.Register <PartyFlow>(FlowConsts.PARTY_CONTROLLER);
            AmbitionApp.UFlow.Register <EstateFlow>(FlowConsts.ESTATE_CONTROLLER);
            AmbitionApp.UFlow.Register <IncidentFlow>(FlowConsts.INCIDENT_CONTROLLER);
            AmbitionApp.UFlow.Register <ParisFlow>(FlowConsts.PARIS_CONTROLLER);
            AmbitionApp.UFlow.Register <DayFlow>(FlowConsts.DAY_FLOW_CONTROLLER);
            AmbitionApp.UFlow.Register <RendezvousFlow>(FlowConsts.RENDEZVOUS_CONTROLLER);

            //AmbitionApp.GetService<AssetBundleSvc>().Load(AssetBundleIDs.ON_LOAD, HandleLoaded);
            AmbitionApp.Game.Initialized = true;
        }