Ejemplo n.º 1
0
        public override void OnDelayedWorldLoadFinished()
        {
            Overwatch.Log("FixLushEpidemic");

            if (GameUtils.IsInstalled(ProductVersion.EP9) && !GameUtils.IsUniversityWorld())
            {
                MotiveTuning mTuning = null;
                foreach (MotiveTuning tuning in MotiveTuning.GetAllTunings(CommodityKind.Juiced))
                {
                    MotiveSatisfactionCurve autoSatisfyCurve = new MotiveSatisfactionCurve
                    {
                        Loops = true
                    };
                    Curve curve = autoSatisfyCurve;
                    curve.Add(new Vector2(0f, -49f));
                    Curve motiveDecayCurve = autoSatisfyCurve.GetMotiveDecayCurve();
                    tuning.mMotiveDecayCurve = motiveDecayCurve;
                    tuning.mAutoSatisfyCurve = autoSatisfyCurve;
                    mTuning = tuning;
                }

                if (mTuning != null)
                {
                    foreach (Sim sim in LotManager.Actors)
                    {
                        if (sim == null || sim.Autonomy == null)
                        {
                            continue;
                        }

                        if (sim.Autonomy.Motives.HasMotive(CommodityKind.Juiced))
                        {
                            sim.mMotiveTuning[(int)CommodityKind.Juiced] = mTuning;
                            sim.Autonomy.Motives.RemoveMotive(CommodityKind.Juiced);
                            sim.Autonomy.Motives.CreateMotive(CommodityKind.Juiced);
                        }
                    }
                }

                Overwatch.Log("Banished autosatisfy of Juiced motive");
            }
        }
Ejemplo n.º 2
0
        public override void OnDelayedWorldLoadFinished()
        {
            Overwatch.Log("FixLushEpidemic");

            if (GameUtils.IsInstalled(ProductVersion.EP9) && !GameUtils.IsUniversityWorld())
            {
                MotiveTuning mTuning = null;
                foreach (MotiveTuning tuning in MotiveTuning.GetAllTunings(CommodityKind.Juiced))
                {
                    MotiveSatisfactionCurve autoSatisfyCurve = new MotiveSatisfactionCurve
                    {
                        Loops = true
                    };
                    Curve curve = autoSatisfyCurve;
                    curve.Add(new Vector2(0f, -49f));
                    Curve motiveDecayCurve = autoSatisfyCurve.GetMotiveDecayCurve();
                    tuning.mMotiveDecayCurve = motiveDecayCurve;
                    tuning.mAutoSatisfyCurve = autoSatisfyCurve;
                    mTuning = tuning;
                }

                if (mTuning != null)
                {
                    foreach (Sim sim in LotManager.Actors)
                    {
                        if (sim == null || sim.Autonomy == null) continue;

                        if (sim.Autonomy.Motives.HasMotive(CommodityKind.Juiced))
                        {
                            sim.mMotiveTuning[(int)CommodityKind.Juiced] = mTuning;
                            sim.Autonomy.Motives.RemoveMotive(CommodityKind.Juiced);
                            sim.Autonomy.Motives.CreateMotive(CommodityKind.Juiced);
                        }
                    }
                }

                Overwatch.Log("Banished autosatisfy of Juiced motive");
            }
        }