Beispiel #1
0
 public override float VoluntaryJoinPriorityFor(Pawn p)
 {
     if (!IsInvited(p))
     {
         return(0f);
     }
     if (!PartyUtil.ShouldPawnKeepPartying(p))
     {
         return(0f);
     }
     if (!lord.ownedPawns.Contains(p) && IsPartyAboutToEnd())
     {
         return(0f);
     }
     return(VoluntarilyJoinableLordJobJoinPriorities.PartyGuest);
 }
Beispiel #2
0
        private bool TryStartParty(string reason, bool wholeDay, Pawn starter, List <Pawn> invitedPawns)
        {
            Map currentMap = Find.CurrentMap;

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

            if (starter == null)
            {
                starter = PartyUtil.FindRandomPartyOrganizer(Faction.OfPlayer, currentMap);
                if (starter == null)
                {
                    Messages.Message("DM.Error.NoStarter".Translate(), MessageTypeDefOf.NegativeEvent);
                    return(false);
                }
            }

            IntVec3 intVec;

            if (!PartyUtil.TryFindPartySpot(starter, out intVec))
            {
                Messages.Message("DM.Error.NoSpot".Translate(), MessageTypeDefOf.NegativeEvent);
                return(false);
            }

            List <Pawn> invited = null;

            if (_privateAnniversaries.Value && invitedPawns.Count > 0)
            {
                invited = invitedPawns;
            }
            LordJob partyJob = wholeDay ? new LongJoinableParty(intVec, invited, starter) : new JoinableParty(intVec, invited, starter);

            LordMaker.MakeNewLord(starter.Faction, partyJob, currentMap);

            Find.LetterStack.ReceiveLetter("DM.Letter.PartyTitle".Translate(), "DM.Letter.Party".Translate(reason), LetterDefOf.PositiveEvent, new TargetInfo(intVec, currentMap));
            return(true);
        }