public float GetMotiveFactor(MotiveKey key, bool relative, out bool exactMatch) { float multiple = key.GetMotiveFactor(mMotiveDeltasV2, out exactMatch); if ((relative) && (mRelativeMotives.ContainsKey(key.mKind))) { multiple *= sRelativeFactor; } if (multiple < 0) { multiple = 0; } return(multiple); }
protected override OptionResult Run(GameHitParameters <GameObject> parameters) { if (base.Run(parameters) == OptionResult.Failure) { return(OptionResult.Failure); } if (Age.sCurrent.Count == 0) { SimpleMessageDialog.Show(Name, Common.Localize("CreateNewFactor:NoAge")); return(OptionResult.Failure); } else if (Species.sCurrent.Count == 0) { SimpleMessageDialog.Show(Name, Common.Localize("CreateNewFactor:NoSpecies")); return(OptionResult.Failure); } else if (Occult.sCurrent.Count == 0) { SimpleMessageDialog.Show(Name, Common.Localize("CreateNewFactor:NoOccult")); return(OptionResult.Failure); } else if (Commodity.sCurrent.Count == 0) { SimpleMessageDialog.Show(Name, Common.Localize("CreateNewFactor:NoCommodity")); return(OptionResult.Failure); } foreach (CASAgeGenderFlags species in Species.sCurrent) { foreach (CASAgeGenderFlags age in Age.sCurrent) { foreach (OccultTypes occult in Occult.sCurrent) { foreach (CommodityKind kind in Commodity.sCurrent) { MotiveKey key = new MotiveKey(age | species, occult, kind); Relativity.Settings.SetMotiveFactor(key, Value); } } } } PriorValues.sFactorChanged = true; return(OptionResult.SuccessLevelDown); }
public float GetMotiveDecayFactor(MotiveKey key, out bool exactMatch) { float multiple = key.GetMotiveFactor(mMotiveDecayDeltasV2, out exactMatch); /* * if ((relative) && (mRelativeDecayMotives.ContainsKey(kind))) * { * multiple *= sRelativeFactor; * } */ if (multiple < 0) { multiple = 0; } return(multiple); }
public void EnsureBaseMotives() { foreach (CommodityKind kind in TuningAlterations.sCommodities) { MotiveKey key = new MotiveKey(kind); bool exactMatch; GetMotiveFactor(key, false, out exactMatch); if (!exactMatch) { SetMotiveFactor(key, 1f); } GetMotiveDecayFactor(key, out exactMatch); if (!exactMatch) { SetMotiveDecayFactor(key, 1f); } } }
public void SetMotiveFactor(MotiveKey key, float factor) { key.SetMotiveFactor(mMotiveDeltasV2, factor); }
public float GetMotiveFactor(MotiveKey key, bool relative) { bool exactMatch; return(GetMotiveFactor(key, relative, out exactMatch)); }
public float GetMotiveDecayFactor(MotiveKey key) { bool exactMatch; return(GetMotiveDecayFactor(key, out exactMatch)); }
public MotiveDecayDeltaFactor(MotiveKey key) { mKey = key; }