Exemple #1
0
 protected GatheringScenario(GatheringScenario scenario)
     : base(scenario)
 {
     mLot    = scenario.Lot;
     mReport = false;
     //mGuests.AddRange(scenario.mGuests);
 }
Exemple #2
0
        protected override GatherResult TargetGather(List <Scenario> list, ref bool random)
        {
            if (Target == null)
            {
                if (Lot == null)
                {
                    if (RandomUtil.RandomChance(ChanceOfHomeLot))
                    {
                        Lot = Sim.LotHome;
                    }

                    if (Lot == null)
                    {
                        Lot = Lots.GetCommunityLot(Sim.CreatedSim, null, false);

                        if (Lot == null)
                        {
                            return(GatherResult.Failure);
                        }
                    }
                }
            }

            GatherResult result = base.TargetGather(list, ref random);

            if (result == GatherResult.Success)
            {
                RandomUtil.RandomizeListOfObjects(list);

                int count = 0;
                foreach (Scenario choice in list)
                {
                    GatheringScenario guest = choice as GatheringScenario;
                    if (guest == null)
                    {
                        continue;
                    }

                    count++;
                    mGuests.Add(guest.Target);

                    if (count >= TargetMaximum)
                    {
                        break;
                    }
                }

                list.Clear();
                return(GatherResult.Update);
            }

            return(result);
        }
            protected override void OnPerform()
            {
                mScenario.IncStat("PopulatePartyTask");

                mParty.mPlaceNpcGuestsFunction = null;
                mParty.SomeGuestsHaveArrived   = true;

                Lot lotHome = mParty.Host.LotHome;

                GatheringScenario.PushBuffetInteractions(mScenario, mParty.Host.SimDescription, lotHome);

                List <Sim> sims = new List <Sim>(HouseholdsEx.AllSims(lotHome.Household));

                SimDescription host = mParty.Host.SimDescription;

                foreach (SimDescription sim in mParty.GuestDescriptions)
                {
                    if (!NpcParty.NpcGuestTest(sim, host))
                    {
                        continue;
                    }

                    if (!mScenario.Situations.Allow(mScenario, sim))
                    {
                        mScenario.IncStat("NpcParty Push User Denied");
                        continue;
                    }

                    Sim createdSim = sim.CreatedSim;
                    if (createdSim == null)
                    {
                        createdSim = Instantiation.PerformOffLot(sim, lotHome, null);
                    }

                    if (createdSim != null)
                    {
                        if (createdSim.LotCurrent != lotHome)
                        {
                            if (!mScenario.Situations.PushVisit(mScenario, sim, lotHome))
                            {
                                mScenario.IncStat("NpcParty Push Fail");
                                continue;
                            }
                        }

                        mParty.Guests.Add(createdSim);
                        createdSim.AssignRole(mParty);

                        VisitSituation.SetVisitToGreeted(createdSim);

                        sims.Add(createdSim);
                    }
                }

                foreach (Sim sim in sims)
                {
                    if (sim.LotCurrent == lotHome)
                    {
                        sim.Motives.SetMax(CommodityKind.Energy);
                        sim.Motives.SetMax(CommodityKind.Hygiene);

                        sim.PushSwitchToOutfitInteraction(Sims3.Gameplay.Actors.Sim.ClothesChangeReason.Force, mParty.ClothingStyle);
                    }
                }

                EventTracker.SendEvent(new PartyEvent(EventTypeId.kPartyBegan, mParty.Host, host, mParty));

                mParty.SetState(new NpcParty.Happening(mParty));
            }
Exemple #4
0
 protected DelayedStoryScenario(DelayedStoryScenario scenario)
     : base(scenario)
 {
     mScenario = scenario.mScenario;
     mDelay    = scenario.mDelay;
 }
Exemple #5
0
 public DelayedStoryScenario(GatheringScenario scenario, int delay)
 {
     mScenario = scenario;
     mDelay    = delay;
 }