Example #1
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);
        }
Example #2
0
        protected override bool Push()
        {
            if (mNewSim != null)
            {
                Situations.PushGoHome(this, mNewSim);
            }

            return(base.Push());
        }
Example #3
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            int baseChance = GetValue <WitnessBaseChanceOption, int>();

            foreach (SimDescription sim in Sims.All)
            {
                bool forceCurfew;
                if (!IsUnderCurfew(this, this, sim, out forceCurfew))
                {
                    if (sim.CreatedSim != null)
                    {
                        sim.CreatedSim.BuffManager.RemoveElement(BuffNames.OutAfterCurfew);
                    }
                    continue;
                }

                if ((sim.CreatedSim != null) && (sim.TeenOrBelow))
                {
                    if (AddScoring("IgnoreCurfew", sim) > 0)
                    {
                        if (!sim.CreatedSim.BuffManager.HasElement(BuffNames.OutAfterCurfew))
                        {
                            sim.CreatedSim.BuffManager.AddElement(BuffNames.OutAfterCurfew, Origin.FromBreakingCurfew);
                            sim.CreatedSim.BuffManager.AddElement(BuffNames.FightThePower, Origin.FromBreakingCurfew);

                            IncStat("Added Buff");
                        }

                        EventTracker.SendEvent(EventTypeId.kTeenBreakingCurfew, sim.CreatedSim);
                    }
                    else
                    {
                        forceCurfew = true;
                    }
                }

                if ((!forceCurfew) && (!IsWitnessed(this, this, sim, baseChance)))
                {
                    IncStat("Not Witnessed");
                    continue;
                }

                if ((!forceCurfew) && (SimTypes.IsSelectable(sim)))
                {
                    Police instance = Police.Instance;
                    if (instance != null)
                    {
                        float chance = sim.HasTrait(TraitNames.Rebellious) ? Police.kChanceOfPoliceSpawnAfterCurfewRebellious : Police.kChanceOfPoliceSpawnAfterCurfew;
                        if (RandomUtil.RandomChance01(chance))
                        {
                            if ((!instance.IsAnySimActiveOnLot(sim.CreatedSim.LotCurrent)) && (!PoliceSituation.IsTeenBeingCaught(sim.CreatedSim)))
                            {
                                IncStat("Curfew Police");

                                instance.MakeServiceRequest(sim.CreatedSim.LotCurrent, true, sim.CreatedSim.ObjectId);
                            }
                        }
                        else
                        {
                            IncStat("Curfew Police Chance Fail");
                        }
                    }
                }
                else
                {
                    Situations.PushGoHome(this, sim);
                }
            }

            return(true);
        }
Example #4
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            if (Guests.Count < TargetMinimum)
            {
                IncStat("Too Few");
                return(false);
            }

            AddStat("Guests", Guests.Count);

            if (Household.ActiveHousehold != null)
            {
                foreach (SimDescription active in HouseholdsEx.Humans(Household.ActiveHousehold))
                {
                    Target = active;
                    if (!TargetAllow(active))
                    {
                        continue;
                    }

                    if (mGuests.Contains(active))
                    {
                        continue;
                    }

                    if (ManagerFriendship.AreFriends(Sim, active))
                    {
                        mGuests.Add(active);
                    }
                }

                Target = null;
            }

            int delay = 3;

            if (Lot == Sim.LotHome)
            {
                Situations.PushGoHome(this, Sim);

                PushBuffetInteractions(this, Sim, Lot);

                DateAndTime startTime = SimClock.CurrentTime();
                startTime.Ticks += SimClock.ConvertToTicks(3f, TimeUnit.Hours);

                /*
                 * if (Lot != Sim.LotHome)
                 * {
                 *  DateAndTime rentTime = startTime;
                 *  rentTime.Ticks -= SimClock.ConvertToTicks(Sims3.Gameplay.Situations.Party.HoursToStartRentBeforePartyStart, TimeUnit.Hours);
                 *  if (rentTime.CompareTo(SimClock.CurrentTime()) < 0)
                 *  {
                 *      rentTime = SimClock.Add(SimClock.CurrentTime(), TimeUnit.Minutes, 2f);
                 *  }
                 *
                 *  if (!RentScheduler.Instance.RentLot(Lot, Sim.CreatedSim, rentTime, Guests))
                 *  {
                 *      IncStat("Couldn't Rent");
                 *      Lot = Sim.LotHome;
                 *  }
                 * }
                 */

                Party party = GetParty(Lot, Sim.CreatedSim, Guests, PartyAttire, startTime);

                EventTracker.SendEvent(new PartyEvent(EventTypeId.kThrewParty, Sim.CreatedSim, Sim, party));

                delay = 3;
            }
            else
            {
                List <Sim> followers = new List <Sim>();

                foreach (SimDescription guest in Guests)
                {
                    if (SimTypes.IsSelectable(guest))
                    {
                        continue;
                    }

                    if (!Sims.Instantiate(guest, Lot, false))
                    {
                        continue;
                    }

                    Sim guestSim = guest.CreatedSim;
                    if (guestSim == null)
                    {
                        continue;
                    }

                    guestSim.PushSwitchToOutfitInteraction(Sims3.Gameplay.Actors.Sim.ClothesChangeReason.GoingToSituation, PartyAttire);

                    followers.Add(guestSim);
                }

                AddStat("Followers", followers.Count);

                if (!Situations.PushMassVisit(this, Sim, followers, Lot))
                {
                    return(false);
                }

                delay = 0;
            }

            if (mReport)
            {
                Manager.AddAlarm(new DelayedStoryScenario(this, delay));
            }

            return(true);
        }
Example #5
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            base.PrivateUpdate(frame);

            ManagedBuyProduct <ComputerLaptop> .Purchase(Sim, 0, this, UnlocalizedName, null, BuildBuyProduct.eBuyCategory.kBuyCategoryElectronics, BuildBuyProduct.eBuySubCategory.kBuySubCategoryComputers);

            List <Computer> computers = new List <Computer>();

            List <Computer> inventory = new List <Computer>();

            foreach (Computer computer in Inventories.InventoryFindAll <Computer>(Sim))
            {
                inventory.Add(computer);

                if (!computer.IsComputerUsable(Sim.CreatedSim, true, false, true))
                {
                    continue;
                }

                computers.Add(computer);
            }

            if (computers.Count == 0)
            {
                Computer broken = null;

                foreach (Lot lot in ManagerLot.GetOwnedLots(Sim))
                {
                    foreach (Computer computer in lot.GetObjects <Computer>())
                    {
                        if (!computer.IsComputerUsable(Sim.CreatedSim, true, false, true))
                        {
                            broken = computer;
                            continue;
                        }

                        computers.Add(computer);
                    }
                }

                if (computers.Count == 0)
                {
                    if (inventory.Count > 0)
                    {
                        foreach (Computer computer in inventory)
                        {
                            Money.Sell(Sim, computer);
                        }

                        IncStat("Sell Broken");
                    }

                    if (broken != null)
                    {
                        IncStat("Push Repair");

                        Add(frame, new ScheduledRepairScenario(Sim, broken), ScenarioResult.Start);
                        return(false);
                    }
                    else
                    {
                        IncStat("No Computer");
                        return(false);
                    }
                }
            }
            else if ((Sim.CreatedSim.LotCurrent == null) || (!Sim.CreatedSim.LotCurrent.CanSimTreatAsHome(Sim.CreatedSim)))
            {
                Situations.PushGoHome(this, Sim);
            }

            if (GetValue <RefineWritingOption, bool>())
            {
                return(Situations.PushInteraction(this, Sim, RandomUtil.GetRandomObjectFromList(computers), Computer.PracticeWriting.Singleton));
            }
            else
            {
                return(Situations.PushInteraction(this, Sim, RandomUtil.GetRandomObjectFromList(computers), NRaas.StoryProgressionSpace.Interactions.WriteNovelEx.Singleton));
            }
        }
Example #6
0
 protected override bool PrivateUpdate(ScenarioFrame frame)
 {
     Situations.PushGoHome(this, Sim);
     return(true);
 }
Example #7
0
 protected override bool Push()
 {
     return(Situations.PushGoHome(this, Sim));
 }