예제 #1
0
        public static FuneralScenario Create(ManagerSituation manager, SimDescription deadSim)
        {
            SimDescription host = null;

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

            foreach (SimDescription parent in Relationships.GetParents(deadSim))
            {
                hosts.Add(parent);
            }

            foreach (SimDescription child in Relationships.GetChildren(deadSim))
            {
                hosts.Add(child);
            }

            foreach (SimDescription sibling in Relationships.GetSiblings(deadSim))
            {
                hosts.Add(sibling);
            }

            foreach (Relationship relation in Relationship.GetRelationships(deadSim))
            {
                if (relation.LTR.Liking <= 50)
                {
                    continue;
                }

                hosts.Add(relation.GetOtherSimDescription(deadSim));
            }

            foreach (SimDescription sim in hosts)
            {
                if (sim == null)
                {
                    continue;
                }

                if (sim.LotHome == null)
                {
                    continue;
                }

                if (manager.IsBusy(manager, sim, true))
                {
                    continue;
                }

                host = sim;
                break;
            }

            if (host == null)
            {
                return(null);
            }

            return(new FuneralScenario(host, deadSim));
        }
예제 #2
0
            private void TimeToInviteGuests()
            {
                Sim host = Parent.Host;

                foreach (SimDescription description in Parent.GuestDescriptions)
                {
                    if (host != null)
                    {
                        Sim createdSim = description.CreatedSim;
                        if ((createdSim == null) && (!SimTypes.IsDead(description)) && (!SimTypes.IsSelectable(description)))
                        {
                            createdSim = Instantiation.PerformOffLot(description, host.LotHome, null);
                        }

                        if (createdSim != null)
                        {
                            Parent.Guests.Add(createdSim);
                            createdSim.AssignRole(Parent);
                        }
                    }
                }

                ManagerSituation situations = StoryProgression.Main.Situations;

                foreach (Sim sim3 in Parent.Guests)
                {
                    if (!situations.IsBusy(situations, sim3, true))
                    {
                        continue;
                    }

                    if (StoryProgression.Main.Situations.Allow(StoryProgression.Main.Situations, sim3.SimDescription))
                    {
                        sim3.PushSwitchToOutfitInteraction(Sim.ClothesChangeReason.GoingToSituation, Parent.ClothingStyle);
                    }

                    if (sim3.LotCurrent != Parent.Lot)
                    {
                        Parent.PushComeToParty(sim3);
                    }
                    else
                    {
                        Parent.OnRouteToPartySucceeded(sim3, 0f);
                    }
                }

                if (Parent.Lot != Parent.Host.LotCurrent)
                {
                    Parent.PushComeToParty(host);
                }
            }
예제 #3
0
        public static BirthdayScenario Create(ManagerSituation manager, SimDescription birthdaySim)
        {
            SimDescription host = null;

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

            if (!manager.Households.AllowGuardian(birthdaySim))
            {
                foreach (SimDescription parent in Relationships.GetParents(birthdaySim))
                {
                    hosts.Add(parent);
                }
            }
            else
            {
                hosts.Add(birthdaySim);
            }

            foreach (SimDescription sim in hosts)
            {
                if (sim == null)
                {
                    continue;
                }

                if (sim.LotHome == null)
                {
                    continue;
                }

                if (manager.IsBusy(manager, sim, true))
                {
                    continue;
                }

                host = sim;
                break;
            }

            if (host == null)
            {
                return(null);
            }

            return(new BirthdayScenario(host, birthdaySim));
        }