// 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)); }
// Utility function for checking with an operator public static bool Check(RequirementVO req, int query) { var result = _Check(req, query); Debug.LogFormat("Check: commod {0} ID {1} value {2} operator {3} target {4} result {5}", req.Type, req.ID, req.Value, req.Operator, query, result); return(result); }
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)); }
public static bool Check(RequirementVO req) { CharacterModel model = AmbitionApp.GetModel <CharacterModel>(); model.Characters.TryGetValue(req.ID, out CharacterVO character); return(character?.IsDateable ?? false); }
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)); }
public static bool Check(RequirementVO req) { if (!AmbitionApp.Game.Misc.TryGetValue(req.ID, out int value)) { value = 0; } return(RequirementsSvc.Check(req, value)); }
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)); }
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)); }
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)); }
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)); }
public bool Check(RequirementVO req) { #if DEBUG try { return(_handlers[req.Type] (req)); } catch (Exception e) { throw new Exception("Requirement type \"" + req.Type.ToString() + "\" not found", e); } #else return(_handlers.TryGetValue(req.Type, out Func <RequirementVO, bool> handler) && handler(req)); #endif }
public static bool _Check(RequirementVO req, int query) { switch (req.Operator) { case RequirementOperator.Less: return(query < req.Value); case RequirementOperator.LessOrEqual: return(query <= req.Value); case RequirementOperator.Greater: return(query > req.Value); case RequirementOperator.GreaterOrEqual: return(query >= req.Value); } return(query == req.Value); }
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)); }
// If currently on a rendezvous, checks the requirement ID against both the current character and location // If not on a rendezvous, checks whether the requirement ID is either a viable rendezvous destination or a dateable character // A value of 1 or greater verifies a match; // A value of 0 or less verifies that neither match public static bool Check(RequirementVO requirement) { CharacterModel model = AmbitionApp.GetModel <CharacterModel>(); if (AmbitionApp.GetModel <GameModel>().Activity == ActivityType.Rendezvous && model.Rendezvous != null) { return((model.Rendezvous.Character == requirement.ID || model.Rendezvous.Location == requirement.ID) == (requirement.Value > 0)); } if (AmbitionApp.Paris.Completed.Contains(requirement.ID)) { return(false); } if (AmbitionApp.Paris.Rendezvous.Contains(requirement.ID)) { return(true); } if (!model.Characters.TryGetValue(requirement.ID, out CharacterVO character)) { return(false); } return(character?.IsDateable ?? false); }
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)); }
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)); }
public static bool Check(RequirementVO req) => RequirementsSvc.Check(req, AmbitionApp.Gossip.Quests.Count);
public static bool CheckRequirement(RequirementVO req) => App.Service <RequirementsSvc>().Check(req);
public static bool Check(RequirementVO req) { int isComplete = AmbitionApp.Story.IsComplete(req.ID, false) ? 1 : 0; return(RequirementsSvc.Check(req, isComplete)); }
public static bool Check(RequirementVO req) => RequirementsSvc.Check(req, Util.RNG.Generate(100));
// 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)); }
// Returns whether the Mark's room has been cleared public static bool Check(RequirementVO req) { return(true); //Array.Exists(map.Map.Rooms, r => r.HostHere && r.Cleared); }
public static bool Check(RequirementVO req) { int value = AmbitionApp.GetModel <GameModel>().Livre; return(RequirementsSvc.Check(req, value)); }