Beispiel #1
0
        // ID is the query month and Value is the Query date
        public static bool Check(RequirementVO req)
        {
            int year  = 0;
            int month = FindMonth(req.ID);
            int day   = req.Value % 100;

            if (month == 0)
            {
                month = (int)(req.Value * .01);
                year  = (int)(month * .01);
                month = month % 100;
            }
            if (month == 0)
            {
                return(false);
            }
            if (year == 0)
            {
                year = 1789;
            }
            DateTime      date        = new DateTime(year, month, day);
            RequirementVO requirement = new RequirementVO()
            {
                Value    = date.Subtract(AmbitionApp.Calendar.StartDate).Days,
                Operator = req.Operator
            };

            return(RequirementsSvc.Check(requirement, AmbitionApp.Calendar.Day));
        }
Beispiel #2
0
        public static bool Check(RequirementVO req)
        {
            CharacterVO character = AmbitionApp.GetModel <CharacterModel>().GetCharacter(req.ID);
            int         check     = (character?.Acquainted ?? false) ? 1 : 0;

            return(RequirementsSvc.Check(req, check));
        }
Beispiel #3
0
 public static bool Check(RequirementVO req)
 {
     if (!AmbitionApp.Game.Misc.TryGetValue(req.ID, out int value))
     {
         value = 0;
     }
     return(RequirementsSvc.Check(req, value));
 }
Beispiel #4
0
        public static bool Check(RequirementVO req)
        {
            CharacterModel characters = AmbitionApp.GetModel <CharacterModel>();
            int            favor      = characters.Characters.TryGetValue(req.ID, out CharacterVO character)
                ? character.Favor : 0;

            return(RequirementsSvc.Check(req, favor));
        }
Beispiel #5
0
        public static bool Check(RequirementVO req)
        {
            int value = AmbitionApp.GetModel <GameModel>().Credibility;
            int roll  = Util.RNG.Generate(100);

            return((roll >= 95) ? true
                : (roll < 5) ? false
                : RequirementsSvc.Check(req, roll + value));
        }
Beispiel #6
0
        public static bool Check(RequirementVO req)
        {
            int val = !string.IsNullOrEmpty(req.ID) &&
                      SteamAPI.IsSteamRunning() &&
                      Steamworks.SteamUserStats.GetAchievement(req.ID, out bool done) &&
                      done
                ? 1
                : 0;

            return(RequirementsSvc.Check(req, val));
        }
Beispiel #7
0
        public static bool Check(RequirementVO req)
        {
            RendezVO rendez = AmbitionApp.GetEvent() as RendezVO;

            if (rendez == null)
            {
                return(false);
            }

            CharacterModel model     = AmbitionApp.GetModel <CharacterModel>();
            CharacterVO    character = model.GetCharacter(rendez.Character);

            return(RequirementsSvc.Check(req, character?.Favor ?? 0));
        }
Beispiel #8
0
        public static bool Check(RequirementVO req)
        {
            RendezVO rendez = AmbitionApp.GetEvent() as RendezVO;

            if (rendez == null)
            {
                return(false);
            }

            CharacterModel model = AmbitionApp.GetModel <CharacterModel>();
            int            score = model.GetOutfitFavor(rendez.Character, AmbitionApp.Inventory.GetEquippedItem(ItemType.Outfit) as OutfitVO);

            return(RequirementsSvc.Check(req, score));
        }
Beispiel #9
0
        public static bool Check(RequirementVO req)
        {
            //Debug.LogFormat("FactionAllegianceReq check");
            FactionModel factions   = AmbitionApp.GetModel <FactionModel>();
            int          allegiance = 0;

            if (Enum.TryParse(req.ID, ignoreCase: true, out FactionType factionID))
            {
                allegiance = factions.Factions.TryGetValue(factionID, out FactionVO faction)
                    ? faction.Allegiance : 0;

                //Debug.LogFormat("Faction {0} allegiance is {1}, checking {2} {3}",req.ID, allegiance, req.Operator, req.Value);
            }
            else
            {
                Debug.LogErrorFormat("Bad faction ID {0} in FactionAllegianceReq", req.ID);
            }

            return(RequirementsSvc.Check(req, allegiance));
        }
Beispiel #10
0
        public static bool Check(RequirementVO req)
        {
            FactionModel model = AmbitionApp.GetModel <FactionModel>();

            char[]           sep      = new char[] { ',', ' ' };
            string[]         tokens   = req.ID.Split(sep);
            List <FactionVO> factions = new List <FactionVO>();
            FactionType      faction;

            foreach (string token in tokens)
            {
                if (Enum.TryParse(token, true, out faction))
                {
                    factions.Add(model.Factions[faction]);
                }
            }
            if (factions.Count > 1)
            {
                req.Value = factions[1].Power;
            }
            return(RequirementsSvc.Check(req, factions[0].Power));
        }
Beispiel #11
0
        public static bool Check(RequirementVO req)
        {
            var party = AmbitionApp.GetModel <PartyModel>().Party;

            // outfit reaction credibility shift
            ItemVO        outfit = AmbitionApp.Inventory.GetEquippedItem(ItemType.Outfit);
            CalendarEvent e      = AmbitionApp.GetEvent();
            FactionType   faction;

            if (e is PartyVO)
            {
                faction = ((PartyVO)e).Faction;
            }
            else
            {
                CharacterVO character = AmbitionApp.GetModel <CharacterModel>().GetCharacter(((RendezVO)e).Character);
                faction = character?.Faction ?? FactionType.Military;
            }
            int value = AmbitionApp.Inventory.GetFactionBonus(outfit, faction);

            return(RequirementsSvc.Check(req, value));
        }
Beispiel #12
0
        public static bool Check(RequirementVO req)
        {
            int isComplete = AmbitionApp.Story.IsComplete(req.ID, false) ? 1 : 0;

            return(RequirementsSvc.Check(req, isComplete));
        }
Beispiel #13
0
 // Checks the Paris model for known locations or currently available explorable locations
 public static bool Check(RequirementVO req)
 {
     return(RequirementsSvc.Check(req, AmbitionApp.Game.Exhaustion));
 }
Beispiel #14
0
 public static bool Check(RequirementVO req) => RequirementsSvc.Check(req, Util.RNG.Generate(100));
Beispiel #15
0
        public static bool Check(RequirementVO req)
        {
            int value = AmbitionApp.GetModel <GameModel>().Livre;

            return(RequirementsSvc.Check(req, value));
        }
Beispiel #16
0
 public static bool Check(RequirementVO req) => RequirementsSvc.Check(req, AmbitionApp.Gossip.Quests.Count);