Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
                }
            }
        }
Example #5
0
 public void SetMotiveFactor(MotiveKey key, float factor)
 {
     key.SetMotiveFactor(mMotiveDeltasV2, factor);
 }
Example #6
0
        public float GetMotiveFactor(MotiveKey key, bool relative)
        {
            bool exactMatch;

            return(GetMotiveFactor(key, relative, out exactMatch));
        }
Example #7
0
        public float GetMotiveDecayFactor(MotiveKey key)
        {
            bool exactMatch;

            return(GetMotiveDecayFactor(key, out exactMatch));
        }
Example #8
0
 public MotiveDecayDeltaFactor(MotiveKey key)
 {
     mKey = key;
 }