コード例 #1
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            if (!Guests.Contains(Sim.Partner))
            {
                Guests.Add(Sim.Partner);
            }

            if (!base.PrivateUpdate(frame))
            {
                return(false);
            }

            foreach (SimDescription guest in Guests)
            {
                if (guest.CreatedSim == null)
                {
                    continue;
                }

                if (guest.Genealogy.Children.Contains(Sim.Genealogy))
                {
                    WeddingCeremony.GiveWeddingBuffs(guest.CreatedSim, Sim.CreatedSim);
                }

                if (guest.Genealogy.Children.Contains(Sim.Partner.Genealogy))
                {
                    WeddingCeremony.GiveWeddingBuffs(guest.CreatedSim, Sim.Partner.CreatedSim);
                }
            }

            return(true);
        }
コード例 #2
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            if (!Guests.Contains(Sim.Partner))
            {
                Guests.Add(Sim.Partner);
            }

            if (!base.PrivateUpdate(frame))
            {
                return(false);
            }

            if (Sim.CreatedSim != null)
            {
                EventTracker.SendEvent(EventTypeId.kThrewBachelorParty, Sim.CreatedSim);
            }

            Sim.SetHadBachelorParty();

            int maximum = GetValue <MaximumGiftOption, int>();

            foreach (SimDescription sim in Guests)
            {
                Add(frame, new ManualCashTransferScenario(Sim, sim, 10, "Engagement", 0, maximum), ScenarioResult.Start);
            }

            return(true);
        }
コード例 #3
0
 public void RefuseInvation(Character character)
 {
     if (Guests.Contains(character))
     {
         SendMembers(new PartyRefuseInvitationNotificationMessage((uint)this.Id, (ulong)character.Id));
         RemoveGuest(character);
     }
 }
コード例 #4
0
 public void RemoveGuest(Character character)
 {
     if (Guests.Contains(character))
     {
         Guests.Remove(character);
         character.GuestedParties.Remove(this);
         VerifiyIntegrity();
     }
 }
コード例 #5
0
 public void AddGuest(Character character)
 {
     if (!Guests.Contains(character) && !Members.Contains(character))
     {
         Guests.Add(character);
         character.GuestedParties.Add(this);
         SendMembers(new PartyNewGuestMessage((uint)this.Id, this.GetPartyGuestInformations(character)));
     }
 }
コード例 #6
0
        private void CheckIfGuestsNeedToGoHome()
        {
            List <Sim> simsToGoHome = new List <Sim>();

            foreach (Sim sim in Guests)
            {
                bool flag = VisitSituation.IsGuestAllowedToStayOver(sim);
                if (sim.MoodManager.IsInStrongNegativeMood || (!flag && (sim.BuffManager.HasElement(BuffNames.Tired) || sim.BuffManager.HasElement(BuffNames.Exhausted))))
                {
                    AddSimToGoHome(sim, simsToGoHome);
                }

                if (sim.SimDescription.ChildOrBelow && (SimClock.Hours24 >= GetParams().HourAtWhichChildrenGoHome))
                {
                    AddSimToGoHome(sim, simsToGoHome);
                    foreach (Genealogy genealogy in sim.Genealogy.Parents)
                    {
                        SimDescription simDescription = genealogy.SimDescription;
                        if (simDescription != null)
                        {
                            Sim createdSim = simDescription.CreatedSim;
                            if ((createdSim != null) && Guests.Contains(createdSim))
                            {
                                AddSimToGoHome(createdSim, simsToGoHome);
                            }
                        }
                    }
                }

                float       delta = sim.MoodManager.MoodValue * GetParams().MoodToTimeMod;
                DateAndTime time;
                if (!flag && mTimeForSimToLeave.TryGetValue(sim.ObjectId, out time))
                {
                    time = SimClock.Add(time, TimeUnit.Minutes, delta);
                    if (time.CompareTo(SimClock.CurrentTime()) < 0x0)
                    {
                        AddSimToGoHome(sim, simsToGoHome);
                    }
                    else
                    {
                        mTimeForSimToLeave[sim.ObjectId] = time;
                    }
                }
            }
            foreach (Sim sim3 in simsToGoHome)
            {
                if (sim3.LotCurrent == Lot)
                {
                    MakeGuestGoHome(sim3);
                }
            }
        }
コード例 #7
0
ファイル: Room.cs プロジェクト: elavanis/Mud
        public IResult CheckEnter(IMobileObject mobileObject)
        {
            INonPlayerCharacter npc = mobileObject as INonPlayerCharacter;

            if (npc != null)
            {
                if (Attributes.Contains(RoomAttribute.Small))
                {
                    if (NonPlayerCharacters.Count != 0)
                    {
                        return(new Result("The room is to small to fit another person in there.", true));
                    }
                }

                if (Attributes.Contains(RoomAttribute.NoNPC))
                {
                    return(new Result("Non player characters can not enter here.", true));
                }
            }

            IPlayerCharacter pc = mobileObject as IPlayerCharacter;

            if (pc != null)
            {
                if (Attributes.Contains(RoomAttribute.Small))
                {
                    if (PlayerCharacters.Count != 0)
                    {
                        return(new Result("The room is to small to fit another person in there.", true));
                    }
                }
            }

            if (Owner != null)
            {
                if (Owner != mobileObject.KeyWords[0] &&
                    !Guests.Contains(mobileObject.KeyWords[0]))
                {
                    return(new Result($"That property belongs to {Owner} and you are not on the guest list.", true));
                }
            }

            return(null);
        }
コード例 #8
0
 public bool isGuest(string playerId)
 {
     return(Guests.Contains(playerId));
 }