Пример #1
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.ChildOrBelow)
            {
                IncStat("Too Young");
                return(false);
            }
            else if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (sim.LotHome == null)
            {
                IncStat("Homeless");
                return(false);
            }
            else if (!Skills.Allow(this, sim))
            {
                IncStat("Skill Denied");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("Situations Denied");
                return(false);
            }
            else if ((sim.IsEP11Bot) && (!sim.HasTrait(TraitNames.ArtisticAlgorithmsChip)))
            {
                IncStat("Chip Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Пример #2
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.ToddlerOrBelow)
            {
                IncStat("Too Young");
                return(false);
            }
            else if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (Party.IsGuestOrHostAtAParty(sim.CreatedSim))
            {
                IncStat("At Party");
                return(false);
            }

            return(base.Allow(sim));
        }
Пример #3
0
        protected override bool CommonAllow(SimDescription sim)
        {
            if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (sim.LotHome == null)
            {
                IncStat("Homeless");
                return(false);
            }
            else if (!Skills.Allow(this, sim))
            {
                IncStat("Skill Denied");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("Situations Denied");
                return(false);
            }

            return(base.CommonAllow(sim));
        }
Пример #4
0
        protected override bool TargetAllow(SimDescription sim)
        {
            if (Sim.Household == sim.Household)
            {
                IncStat("Same House");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("Situations Denied");
                return(false);
            }

            Relationship relation = ManagerSim.GetRelationship(Sim, sim);

            if (relation == null)
            {
                IncStat("Bad Relation");
                return(false);
            }

            if ((!relation.LTR.HasInteractionBit(LongTermRelationship.InteractionBits.BreakUp)) &&
                (!relation.LTR.HasInteractionBit(LongTermRelationship.InteractionBits.Divorce)))
            {
                IncStat("Not Breakup");
                return(false);
            }

            return(base.TargetAllow(sim));
        }
Пример #5
0
 public void Apply(int rotationChange, int powerChange, MarsLanderEnvironment environment)
 {
     if (Status != LanderStatus.Flying) return;
     if (Situation.Fuel < Situation.Power + powerChange) powerChange = 0;
     if (Situation.Fuel < Situation.Power) powerChange = -1;
     Situation.Power += LimitPower(powerChange);
     Situation.Rotation += LimitRotation(rotationChange);
     Situation.Fuel -= Situation.Power;
     Situation.HorizontalSpeed += Trigonometry.GetHorizontalSpeedFraction(Situation.Rotation, ZeroDegreesDirection.Top) * Situation.Power;
     if (Situation.HorizontalSpeed > MarsLanderRules.MaxHorizontalSpeed)
         Situation.HorizontalSpeed = MarsLanderRules.MaxHorizontalSpeed;
     if (Situation.HorizontalSpeed < MarsLanderRules.MinHorizontalSpeed)
         Situation.HorizontalSpeed = MarsLanderRules.MinHorizontalSpeed;
     Situation.VerticalSpeed += Trigonometry.GetVerticalSpeedFraction(Situation.Rotation, ZeroDegreesDirection.Top) * Situation.Power - MarsLanderRules.Gravity;
     if (Situation.VerticalSpeed > MarsLanderRules.MaxVerticalSpeed)
         Situation.VerticalSpeed = MarsLanderRules.MaxVerticalSpeed;
     if (Situation.VerticalSpeed < MarsLanderRules.MinVerticalSpeed)
         Situation.VerticalSpeed = MarsLanderRules.MinVerticalSpeed;
     Situation.X += Situation.HorizontalSpeed;
     Situation.Y += Situation.VerticalSpeed;
     RoundValues();
     Situations.Add(Situation.Clone());
     Actions.Add($"{rotationChange} {powerChange}");
     SetStatus(environment);
 }
Пример #6
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            Computer computer = ManagerLot.GetUsableComputer(Sim);

            if (computer == null)
            {
                IncStat("No Computer");
                return(false);
            }

            Career occupation = Sim.Occupation as Career;

            if (!occupation.CanWriteReport())
            {
                if (Sim.Occupation is LawEnforcement)
                {
                    LawEnforcement career = Sim.Occupation as LawEnforcement;

                    if (!career.CanInterview())
                    {
                        IncStat("Police Level Fail");
                        return(false);
                    }

                    foreach (SimDescription sim in Sims.Adults)
                    {
                        if (career.HasSimBeenInterviewed(sim))
                        {
                            continue;
                        }

                        career.SimInterviewed(sim);
                        break;
                    }
                }
                else if (Sim.Occupation is Journalism)
                {
                    Journalism career = Sim.Occupation as Journalism;

                    if (!career.CanInterview())
                    {
                        IncStat("Journalism Level Fail");
                        return(false);
                    }

                    foreach (SimDescription sim in Sims.Adults)
                    {
                        if (career.HasSimBeenInterviewed(sim))
                        {
                            continue;
                        }

                        career.SimInterviewed(sim);
                        break;
                    }
                }
            }

            return(Situations.PushInteraction <Computer>(this, Sim, computer, Computer.WriteReport.Singleton));
        }
Пример #7
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.ToddlerOrBelow)
            {
                IncStat("Too Young");
                return(false);
            }
            else if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (!HasSkillMetric(sim.Occupation as Career))
            {
                IncStat("No Metric");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("Push Denied");
                return(false);
            }
            else if (!Skills.Allow(this, sim))
            {
                IncStat("Skills Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Пример #8
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            if (!mForceHome)
            {
                Lot current = Sim.CreatedSim.LotCurrent;

                if ((!current.IsResidentialLot) || (Sim.CreatedSim.IsGreetedOnLot(current)))
                {
                    if (Situations.PushGoHere(this, Sim, GetDestination(current, Sim.CreatedSim.Position)))
                    {
                        Friends.AddAlarm(new HeatingUpScenario(Sim, true));
                        return(true);
                    }
                }
            }

            Situations.PushGoHome(this, Sim);

            if (Situations.PushGoHere(this, Sim, GetDestination(Sim.LotHome, Sim.CreatedSim.Position)))
            {
                return(true);
            }

            return(false);
        }
 public SubjectsContainer(BodyContainer parent, SituationsBiomesSubject situationsSubjects) : base(parent)
 {
     foreach (ObjectPair <ScienceSituation, BiomesSubject> situation in situationsSubjects)
     {
         Situations.Add(new SituationContainer(situation));
     }
 }
Пример #10
0
        protected override bool Allow(SimDescription sim)
        {
            if (Sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else
            {
                InteractionInstance instance = null;

                try
                {
                    instance = CareerPushScenario.GetWorkInteraction(Job);
                }
                catch (Exception e)
                {
                    Common.DebugException(Sim, e);
                }

                if (instance == null)
                {
                    IncStat("No Interaction");
                    return(false);
                }
                else if (Situations.HasInteraction(Sim.CreatedSim, instance.InteractionDefinition, true))
                {
                    IncStat("At Work");
                    return(false);
                }
            }

            return(base.Allow(sim));
        }
Пример #11
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.ToddlerOrBelow)
            {
                IncStat("Too Young");
                return(false);
            }
            else if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (!Skills.Allow(this, sim))
            {
                IncStat("Skill Denied");
                return(false);
            }
            else if (!Sims.AllowInventory(this, sim, Managers.Manager.AllowCheck.None))
            {
                IncStat("Inventory Denied");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("Situations Denied");
                return(false);
            }
            else if ((sim.IsEP11Bot) && (!sim.HasTrait(TraitNames.FisherBotChip)))
            {
                IncStat("Chip Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Пример #12
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (!sim.CreatedSim.IsOutside)
            {
                IncStat("Inside");
                return(false);
            }
            else if (sim.LotHome == null)
            {
                IncStat("Homeless");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("Situation Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Пример #13
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.ChildOrBelow)
            {
                IncStat("Too Young");
                return(false);
            }
            else if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (sim.LotHome == null)
            {
                IncStat("Homeless");
                return(false);
            }
            else if (!Skills.Allow(this, sim))
            {
                IncStat("Skill Denied");
                return(false);
            }
            else if (!Sims.AllowInventory(this, sim, Managers.Manager.AllowCheck.None))
            {
                IncStat("Inventory Denied");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("Situations Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Пример #14
0
        protected override bool Allow(SimDescription sim)
        {
            if (!GetValue <AllowHarvestOption, bool>(sim))
            {
                IncStat("Harvest Denied");
                return(false);
            }
            else if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("Situation Denied");
                return(false);
            }
            else if (!Sims.AllowInventory(this, sim, Managers.Manager.AllowCheck.None))
            {
                IncStat("Inventory Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Пример #15
0
        protected override bool Perform(SkillNames skill)
        {
            foreach (RabbitHole hole in Sims3.Gameplay.Queries.GetObjects <RabbitHole>())
            {
                foreach (InteractionObjectPair pair in hole.Interactions)
                {
                    RabbitHole.AttendClassInRabbitHole.Definition interaction = pair.InteractionDefinition as RabbitHole.AttendClassInRabbitHole.Definition;
                    if (interaction == null)
                    {
                        continue;
                    }

                    if (interaction.Skill != skill)
                    {
                        continue;
                    }

                    if (Situations.PushInteraction(this, Sim, hole, interaction))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Пример #16
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            Firefighter instance = Firefighter.Instance;

            if (instance == null)
            {
                IncStat("No Service");
                return(false);
            }

            List <SimDescription> sims = new List <SimDescription>();

            foreach (SimDescription sim in Sims.All)
            {
                if (SimTypes.IsSelectable(sim))
                {
                    IncStat("Active");
                }
                else if (sim.CreatedSim == null)
                {
                    IncStat("Hibernating");
                }
                else if (sim.LotHome == null)
                {
                    IncStat("Not Resident");
                }
                else if (!(sim.Occupation is ActiveFireFighter))
                {
                    IncStat("Not Firefighter");
                }
                else if (!Situations.Allow(this, sim, Managers.Manager.AllowCheck.None))
                {
                    IncStat("Situation Denied");
                }
                else
                {
                    sims.Add(sim);
                }
            }

            if (sims.Count > 0)
            {
                AddStat("Choices", sims.Count);

                SimDescription choice = RandomUtil.GetRandomObjectFromList(sims);

                if (Situations.GreetSimOnLot(choice, Lot))
                {
                    IncStat("Active Firefighter");

                    new NRaas.StoryProgressionSpace.Situations.FirefighterSituation(Lot, choice.CreatedSim);
                    return(true);
                }
            }

            IncStat("Service Firefighter");

            instance.MakeServiceRequest(Lot, true, ObjectGuid.InvalidObjectGuid);
            return(true);
        }
Пример #17
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            bool pushed = false;

            Gardening gardeningSkill = Sim.SkillManager.GetSkill <Gardening>(SkillNames.Gardening);

            List <HarvestPlant> plants = GatherPlants();

            if ((plants == null) || (plants.Count == 0))
            {
                IncStat("No Plants");
                return(false);
            }

            int index = 0;

            while (index < plants.Count)
            {
                HarvestPlant plant = plants[index];

                if ((plant is Sims3.Gameplay.Objects.Gardening.OmniPlant) || (!Sims3.Gameplay.Objects.Gardening.HarvestPlant.HarvestTest(plant, null)))
                {
                    IncStat("Unharvestable");
                    plants.RemoveAt(index);
                    continue;
                }
                else if (!plant.CanProduceMoreHarvestables())
                {
                    if ((gardeningSkill != null) && (gardeningSkill.SkillLevel <= plant.PlantDef.GetSkillRequirement()))
                    {
                        plant.mLifetimeHarvestablesYielded = 0;

                        IncStat("Replanted");
                    }
                    else
                    {
                        IncStat("Skill Too Low");

                        index++;
                        continue;
                    }
                }

                if (Situations.PushInteraction(this, Sim, plant, HarvestEx.Singleton))
                {
                    plants.RemoveAt(index);

                    pushed = true;
                }
                else
                {
                    IncStat("Failure");
                    break;
                }
            }

            return(pushed);
        }
Пример #18
0
        protected override bool Allow()
        {
            if (Situations.GetValue <Option, int>() <= 0)
            {
                return(false);
            }

            return(base.Allow());
        }
Пример #19
0
        protected override bool Push()
        {
            if (!mPush)
            {
                return(false);
            }

            return(Situations.PushInteraction(this, Sim, Sim.CreatedSim, Sims3.Gameplay.Actors.Sim.GoToLibrary.Singleton as InteractionDefinition));
        }
Пример #20
0
        protected override bool Push()
        {
            if (mNewSim != null)
            {
                Situations.PushGoHome(this, mNewSim);
            }

            return(base.Push());
        }
Пример #21
0
        protected override bool CommonAllow(SimDescription sim)
        {
            if (!Situations.Allow(this, sim))
            {
                IncStat("Situations Denied");
                return(false);
            }

            return(base.CommonAllow(sim));
        }
Пример #22
0
        public string StringfySituations()
        {
            string str = "";

            Situations.ForEach(x => str += $"{(int)x},");

            str = str.Remove(str.Length);

            return(str);
        }
Пример #23
0
        protected bool IsValidLover(IScoringGenerator stats, SimDescription sim, SimDescription potential, bool allowAffair, bool force)
        {
            if (sim == potential)
            {
                //stats.IncStat("Myself");
                return(false);
            }
            else if (!GetValue <AllowRomanceOption, bool>(potential))
            {
                stats.IncStat("User Denied");
                return(false);
            }
            else if ((!allowAffair) && (potential.Partner != null))
            {
                stats.IncStat("Affair Denied");
                return(false);
            }
            else if (sim.Partner == potential)
            {
                stats.IncStat("Partner");
                return(false);
            }
            else if ((!GetValue <AllowOldLoverOption, bool>()) && (WasOldLover(sim, potential)))
            {
                stats.IncStat("Old Lover");
                return(false);
            }
            else if (!Allow(stats, sim, potential))
            {
                //stats.IncStat("Mixed Aged Denied");
                return(false);
            }
            else if (potential.Household == null)
            {
                stats.IncStat("Invalid House");
                return(false);
            }
            else if ((SimTypes.IsSpecial(sim)) && (SimTypes.IsSpecial(potential)))
            {
                stats.IncStat("Both Special");
                return(false);
            }
            else if (Situations.IsBusy(stats, potential, true))
            {
                stats.IncStat("Other Busy");
                return(false);
            }
            else if (IsActiveInvolved(potential))
            {
                stats.IncStat("Other Active Involved");
                return(false);
            }

            return(true);
        }
Пример #24
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            base.PrivateUpdate(frame);

            List <AthleticGameObject> objs = new List <AthleticGameObject>();

            InteractionInstance interaction = Target.CreatedSim.InteractionQueue.GetCurrentInteraction();

            if ((interaction != null) && (interaction.Target is AthleticGameObject))
            {
                IncStat("Trainee Ready");

                objs.Add(interaction.Target as AthleticGameObject);
            }
            else
            {
                foreach (Lot lot in ManagerLot.GetOwnedLots(Sim))
                {
                    objs.AddRange(lot.GetObjects <AthleticGameObject>(TestObject));
                }

                if (objs.Count == 0)
                {
                    foreach (Lot lot in ManagerLot.GetOwnedLots(Target))
                    {
                        objs.AddRange(lot.GetObjects <AthleticGameObject>(TestObject));
                    }
                    if (objs.Count == 0)
                    {
                        foreach (AthleticGameObject obj in Sims3.Gameplay.Queries.GetObjects <AthleticGameObject>())
                        {
                            if (!TestObject(obj))
                            {
                                continue;
                            }

                            if (!obj.LotCurrent.IsCommunityLot)
                            {
                                continue;
                            }

                            objs.Add(obj);
                        }

                        if (objs.Count == 0)
                        {
                            IncStat("No Training Object");
                            return(false);
                        }
                    }
                }
            }

            return(Situations.PushMeetUp(this, Sim, Target, RandomUtil.GetRandomObjectFromList(objs).LotCurrent, FirstAction));
        }
Пример #25
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            base.PrivateUpdate(frame);

            bool success = false;

            while (mCollectables.Count > 0)
            {
                GameObject choice = RandomUtil.GetRandomObjectFromList(mCollectables);
                mCollectables.Remove(choice);

                InteractionDefinition interaction = null;
                if (choice is RockGemMetalBase)
                {
                    interaction = CollectEx.Singleton;

                    IncStat("Collect");
                }
                else if (choice is MinorPet)
                {
                    interaction = CaptureEx.Singleton;

                    IncStat("Capture");
                }
                else if (choice is InsectJig)
                {
                    interaction = CatchInsectEx.Singleton;

                    IncStat("CatchInsect");
                }
                else if ((choice is DigSite) && (Sim.TeenOrAbove))
                {
                    interaction = Excavate.Singleton;

                    IncStat("Excavate");
                }
                else
                {
                    continue;
                }

                if (Situations.PushInteraction(this, Sim, choice, interaction))
                {
                    IncStat("Pushed");
                    success = true;
                }
                else
                {
                    break;
                }
            }

            return(success);
        }
Пример #26
0
 protected override bool Push()
 {
     if (GameUtils.IsInstalled(ProductVersion.EP2))
     {
         if (Situations.PushToObject <ConsignmentRegister>(this, Sim))
         {
             return(true);
         }
     }
     return(base.Push());
 }
Пример #27
0
 protected override bool Push()
 {
     if ((Sim.Occupation != null) && (Sim.Occupation.Boss != null))
     {
         return(Situations.PushMeetUp(this, Sim, Sim.Occupation.Boss, ManagerSituation.MeetUpType.Either, ManagerFriendship.FriendlyFirstAction));
     }
     else
     {
         return(false);
     }
 }
Пример #28
0
        protected override bool Push()
        {
            if (mFail)
            {
                if (AllowGoToJail)
                {
                    Manager.AddAlarm(new GoToJailScenario(Sim, Bail));
                }
            }

            return(Situations.PushVisit(this, Sim, Target.LotHome));
        }
Пример #29
0
            protected override bool PrivateUpdate(ScenarioFrame frame)
            {
                if (Sim.CreatedSim.LotCurrent != Target.CreatedSim.LotCurrent)
                {
                    if (!Situations.PushVisit(this, Target, Sim.CreatedSim.LotCurrent))
                    {
                        return(false);
                    }
                }

                return(base.PrivateUpdate(frame));
            }
Пример #30
0
        protected override bool Push()
        {
            if (Target == null)
            {
                if (!Situations.PushGathering(this, Sim.Partner, Lot))
                {
                    return(false);
                }
            }

            return(base.Push());
        }