Ejemplo n.º 1
0
        public override bool GizmoDisabled(out string reason)
        {
            LordJob_Joinable_Speech lordJob_Joinable_Speech = parent.pawn.GetLord()?.LordJob as LordJob_Joinable_Speech;

            if (lordJob_Joinable_Speech != null && lordJob_Joinable_Speech.Organizer == parent.pawn)
            {
                reason = "AbilitySpeechDisabledAlreadyGivingSpeech".Translate();
                return(true);
            }
            if (GatheringsUtility.AnyLordJobPreventsNewGatherings(parent.pawn.Map))
            {
                reason = "AbilitySpeechDisabledAnotherGatheringInProgress".Translate();
                return(true);
            }
            Building_Throne assignedThrone = parent.pawn.ownership.AssignedThrone;

            if (assignedThrone == null)
            {
                reason = "AbilitySpeechDisabledNoThroneAssigned".Translate();
                return(true);
            }
            if (!parent.pawn.CanReserveAndReach(assignedThrone, PathEndMode.InteractionCell, parent.pawn.NormalMaxDanger()))
            {
                reason = "AbilitySpeechDisabledNoThroneIsNotAccessible".Translate();
                return(true);
            }
            if (parent.pawn.royalty.GetUnmetThroneroomRequirements().Any())
            {
                reason = "AbilitySpeechDisabledNoThroneUndignified".Translate();
                return(true);
            }
            reason = null;
            return(false);
        }
Ejemplo n.º 2
0
        public static bool AcceptableGameConditionsToStartCeremony(Map map)
        {
            if (!AcceptableGameConditionsToContinueCeremony(map))
            {
                return(false);
            }
            if (GenLocalDate.HourInteger(map) < 5 || GenLocalDate.HourInteger(map) > 16)
            {
                return(false);
            }
            if (GatheringsUtility.AnyLordJobPreventsNewGatherings(map))
            {
                return(false);
            }
            if (map.dangerWatcher.DangerRating != 0)
            {
                return(false);
            }
            int num = 0;

            foreach (Pawn item in map.mapPawns.FreeColonistsSpawned)
            {
                if (item.Drafted)
                {
                    num++;
                }
            }
            if ((float)num / (float)map.mapPawns.FreeColonistsSpawnedCount >= 0.5f)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 3
0
        public static bool AcceptableGameConditionsToStartCeremony(Map map)
        {
            bool result;

            if (!MarriageCeremonyUtility.AcceptableGameConditionsToContinueCeremony(map))
            {
                result = false;
            }
            else if (GenLocalDate.HourInteger(map) < 5 || GenLocalDate.HourInteger(map) > 16)
            {
                result = false;
            }
            else if (GatheringsUtility.AnyLordJobPreventsNewGatherings(map))
            {
                result = false;
            }
            else if (map.dangerWatcher.DangerRating != StoryDanger.None)
            {
                result = false;
            }
            else
            {
                int num = 0;
                foreach (Pawn pawn in map.mapPawns.FreeColonistsSpawned)
                {
                    if (pawn.Drafted)
                    {
                        num++;
                    }
                }
                result = ((float)num / (float)map.mapPawns.FreeColonistsSpawnedCount < 0.5f);
            }
            return(result);
        }
Ejemplo n.º 4
0
        public static bool AcceptableGameConditionsToStartParty(Map map)
        {
            if (!AcceptableGameConditionsToContinueParty(map))
            {
                return(false);
            }
            if (GenLocalDate.HourInteger(map) < 4 || GenLocalDate.HourInteger(map) > 21)
            {
                return(false);
            }
            if (GatheringsUtility.AnyLordJobPreventsNewGatherings(map))
            {
                return(false);
            }
            if (map.dangerWatcher.DangerRating != 0)
            {
                return(false);
            }
            int freeColonistsSpawnedCount = map.mapPawns.FreeColonistsSpawnedCount;

            if (freeColonistsSpawnedCount < 4)
            {
                return(false);
            }
            int num = 0;

            foreach (Pawn item in map.mapPawns.FreeColonistsSpawned)
            {
                if (item.health.hediffSet.BleedRateTotal > 0f)
                {
                    return(false);
                }
                if (item.Drafted)
                {
                    num++;
                }
            }
            if ((float)num / (float)freeColonistsSpawnedCount >= 0.5f)
            {
                return(false);
            }
            if (!EnoughPotentialGuestsToStartParty(map))
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 5
0
        public static bool AcceptableGameConditionsToStartParty(Map map)
        {
            bool result;

            if (!PartyUtility.AcceptableGameConditionsToContinueParty(map))
            {
                result = false;
            }
            else if (GenLocalDate.HourInteger(map) < 4 || GenLocalDate.HourInteger(map) > 21)
            {
                result = false;
            }
            else if (GatheringsUtility.AnyLordJobPreventsNewGatherings(map))
            {
                result = false;
            }
            else if (map.dangerWatcher.DangerRating != StoryDanger.None)
            {
                result = false;
            }
            else
            {
                int freeColonistsSpawnedCount = map.mapPawns.FreeColonistsSpawnedCount;
                if (freeColonistsSpawnedCount < 4)
                {
                    result = false;
                }
                else
                {
                    int num = 0;
                    foreach (Pawn pawn in map.mapPawns.FreeColonistsSpawned)
                    {
                        if (pawn.health.hediffSet.BleedRateTotal > 0f)
                        {
                            return(false);
                        }
                        if (pawn.Drafted)
                        {
                            num++;
                        }
                    }
                    result = ((float)num / (float)freeColonistsSpawnedCount < 0.5f && PartyUtility.EnoughPotentialGuestsToStartParty(map, null));
                }
            }
            return(result);
        }