Exemple #1
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));
        }
Exemple #2
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);
        }
Exemple #3
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));
        }
Exemple #4
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));
        }
        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));
        }
Exemple #6
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));
        }
Exemple #7
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));
        }
Exemple #8
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));
        }
Exemple #9
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));
        }
        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));
        }
        protected override bool CommonAllow(SimDescription sim)
        {
            if (!Situations.Allow(this, sim))
            {
                IncStat("Situations Denied");
                return(false);
            }

            return(base.CommonAllow(sim));
        }
Exemple #12
0
        protected override bool Allow(SimDescription sim)
        {
            if (!Situations.Allow(this, sim))
            {
                IncStat("Scoring Fail");
                return(false);
            }
            else if (mWinner == null)
            {
                IncStat("No Winner");
                return(false);
            }

            return(base.Allow(sim));
        }
Exemple #13
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.ChildOrBelow)
            {
                IncStat("Too Young");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Exemple #14
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("Situations Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Exemple #15
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            SimDescription.DeathType type = SimDescription.DeathType.Starve;
            if (Sim.OccultManager.HasOccultType(OccultTypes.Mummy))
            {
                type = SimDescription.DeathType.MummyCurse;
            }

            if ((Target != null) && (Situations.Allow(this, Target, Managers.Manager.AllowCheck.None)))
            {
                Add(frame, new GoToHospitalScenario(Target, Sim, "InjuredFight", type), ScenarioResult.Start);
            }

            ReduceMotives(Sim);
            ReduceMotives(Target);
            return(true);
        }
Exemple #16
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.ChildOrBelow)
            {
                IncStat("Too Young");
                return(false);
            }
            else if (sim.LotHome == null)
            {
                IncStat("Not Resident");
                return(false);
            }
            else if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (!Skills.Allow(this, sim))
            {
                IncStat("Skills Denied");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("Push Denied");
                return(false);
            }
            else if (sim.CreatedSim.BuffManager == null)
            {
                IncStat("No Manager");
                return(false);
            }
            else if ((sim.CreatedSim.BuffManager.HasElement(BuffNames.Singed)) ||
                     (sim.CreatedSim.BuffManager.HasElement(BuffNames.SingedElectricity)))
            {
                IncStat("Singed");
                return(false);
            }
            else if ((sim.IsEP11Bot) && (!sim.HasTrait(TraitNames.HandiBotChip)))
            {
                IncStat("Chip Denied");
                return(false);
            }

            return(base.Allow(sim));
        }
Exemple #17
0
        protected override bool Push()
        {
            if (Sim.CreatedSim == null)
            {
                return(false);
            }

            if (!Situations.Allow(this, Sim))
            {
                return(false);
            }

            if (Sim.CreatedSim.InteractionQueue != null)
            {
                Sim.CreatedSim.InteractionQueue.CancelAllInteractions();
            }

            PoliceStation target = ManagerSituation.FindRabbitHole(RabbitHoleType.PoliceStation) as PoliceStation;

            if (target == null)
            {
                return(false);
            }

            if (OnPushInteraction == null)
            {
                return(false);
            }

            InteractionDefinition pushInteraction = OnPushInteraction();

            if (pushInteraction == null)
            {
                return(false);
            }

            InteractionInstance entry = pushInteraction.CreateInstance(target, Sim.CreatedSim, new InteractionPriority(InteractionPriorityLevel.High), false, false);

            Sim.CreatedSim.AddExitReason(ExitReason.CanceledByScript);
            Sim.CreatedSim.InteractionQueue.AddNext(entry);

            return(true);
        }
        protected override bool TargetAllow(SimDescription sim)
        {
            if (!Households.AllowGuardian(sim))
            {
                IncStat("Age Denied");
                return(false);
            }
            else if (!Deaths.Allow(this, sim))
            {
                IncStat("Deaths Denied");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("Situations Denied");
                return(false);
            }

            return(base.TargetAllow(sim));
        }
Exemple #19
0
        protected override bool CommonAllow(SimDescription sim)
        {
            if (sim.ToddlerOrBelow)
            {
                IncStat("Too Young");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("User Denied");
                return(false);
            }
            else if (!GetValue <AllowPushPartyOption, bool>(sim))
            {
                IncStat("Party Denied");
                return(false);
            }

            return(base.CommonAllow(sim));
        }
Exemple #20
0
        protected override bool Allow(SimDescription sim)
        {
            if (!Households.AllowGuardian(sim))
            {
                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 (!Situations.Allow(this, sim))
            {
                IncStat("Situations Denied");
                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 (AddScoring("Nectar", sim) < 0)
            {
                IncStat("Score Fail");
                return(false);
            }

            return(base.Allow(sim));
        }
Exemple #21
0
        protected override bool Allow(SimDescription sim)
        {
            if (sim.CreatedSim == null)
            {
                IncStat("Hibernating");
                return(false);
            }
            else if (sim.LotHome == null)
            {
                IncStat("Homeless");
                return(false);
            }
            else if (sim.CreatedSim.LotCurrent == sim.LotHome)
            {
                IncStat("At Home");
                return(false);
            }
            else if (!Situations.Allow(this, sim))
            {
                IncStat("Push Denied");
                return(false);
            }
            else
            {
                foreach (Sim member in HouseholdsEx.AllHumans(sim.Household))
                {
                    if (member.LotCurrent == sim.CreatedSim.LotCurrent)
                    {
                        IncStat("Supervised");
                        return(false);
                    }
                }
            }

            return(base.Allow(sim));
        }