protected override bool CanFireNowSub(IncidentParms parms)
        {
            GameConditionManager gameConditionManager = parms.target.GameConditionManager;
            bool result;

            if (gameConditionManager == null)
            {
                Log.ErrorOnce(string.Format("Couldn't find condition manager for incident target {0}", parms.target), 70849667, false);
                result = false;
            }
            else if (gameConditionManager.ConditionIsActive(this.def.gameCondition))
            {
                result = false;
            }
            else
            {
                List <GameCondition> activeConditions = gameConditionManager.ActiveConditions;
                for (int i = 0; i < activeConditions.Count; i++)
                {
                    if (!this.def.gameCondition.CanCoexistWith(activeConditions[i].def))
                    {
                        return(false);
                    }
                }
                result = true;
            }
            return(result);
        }
        // Token: 0x06000E1B RID: 3611 RVA: 0x00069AE0 File Offset: 0x00067EE0
        protected override bool CanFireNowSub(IncidentParms parms)
        {
            GameConditionManager gameConditionManager = parms.target.GameConditionManager;

            if (gameConditionManager == null)
            {
                Log.ErrorOnce(string.Format("Couldn't find condition manager for incident target {0}", parms.target), 70849667, false);
                return(false);
            }
            if (gameConditionManager.ConditionIsActive(this.def.gameCondition))
            {
                return(false);
            }
            List <GameCondition> activeConditions = gameConditionManager.ActiveConditions;

            for (int i = 0; i < activeConditions.Count; i++)
            {
                if (!this.def.gameCondition.CanCoexistWith(activeConditions[i].def))
                {
                    return(false);
                }
            }
            Map     map = (Map)parms.target;
            IntVec3 intVec;
            Faction faction = Find.FactionManager.FirstFactionOfDef(XenomorphDefOf.RRY_Xenomorph);

            return(this.TryFindSpawnSpot(map, out intVec) && faction != null);

            return(true);
        }
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            GameConditionManager gameConditionManager = parms.target.GameConditionManager;
            int           duration = Mathf.RoundToInt(def.durationDays.RandomInRange * 60000f);
            GameCondition cond     = GameConditionMaker.MakeCondition(def.gameCondition, duration);

            gameConditionManager.RegisterCondition(cond);
            SendStandardLetter();
            return(true);
        }
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            GameConditionManager gameConditionManager = parms.target.GameConditionManager;
            GameCondition        gameCondition        = GameConditionMaker.MakeCondition(duration: Mathf.RoundToInt(def.durationDays.RandomInRange * 60000f), def: def.gameCondition);

            gameConditionManager.RegisterCondition(gameCondition);
            parms.letterHyperlinkThingDefs = gameCondition.def.letterHyperlinks;
            SendStandardLetter(def.letterLabel, gameCondition.LetterText, def.letterDef, parms, LookTargets.Invalid);
            return(true);
        }
        protected override bool CanFireNowSub(IncidentParms parms)
        {
            GameConditionManager gameConditionManager = parms.target.GameConditionManager;

            if (gameConditionManager == null)
            {
                Log.ErrorOnce($"Couldn't find condition manager for incident target {parms.target}", 70849667);
                return(false);
            }
            if (gameConditionManager.ConditionIsActive(def.gameCondition))
            {
                return(false);
            }
            List <GameCondition> activeConditions = gameConditionManager.ActiveConditions;

            for (int i = 0; i < activeConditions.Count; i++)
            {
                if (!def.gameCondition.CanCoexistWith(activeConditions[i].def))
                {
                    return(false);
                }
            }
            return(true);
        }
        protected override bool CanFireNowSub(IIncidentTarget target)
        {
            GameConditionManager gameConditionManager = target.GameConditionManager;

            if (gameConditionManager == null)
            {
                Log.ErrorOnce(string.Format("Couldn't find condition manager for incident target {0}", target), 70849667);
                return(false);
            }
            if (gameConditionManager.ConditionIsActive(this.def.gameCondition))
            {
                return(false);
            }
            List <GameCondition> activeConditions = gameConditionManager.ActiveConditions;

            for (int i = 0; i < activeConditions.Count; i++)
            {
                if (!this.def.gameCondition.CanCoexistWith(activeConditions[i].def))
                {
                    return(false);
                }
            }
            return(true);
        }
        // Token: 0x06000E1C RID: 3612 RVA: 0x00069B78 File Offset: 0x00067F78
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            GameConditionManager gameConditionManager = parms.target.GameConditionManager;
            int           duration = Mathf.RoundToInt(this.def.durationDays.RandomInRange * 60000f);
            GameCondition cond     = GameConditionMaker.MakeCondition(this.def.gameCondition, duration, 0);

            gameConditionManager.RegisterCondition(cond);
            Map     map = (Map)parms.target;
            IntVec3 spawnSpot;

            if (!this.TryFindSpawnSpot(map, out spawnSpot))
            {
                return(false);
            }
            Faction faction = Find.FactionManager.FirstFactionOfDef(XenomorphDefOf.RRY_Xenomorph);

            if (faction == null)
            {
                return(false);
            }
            int           @int      = Rand.Int;
            IncidentParms raidParms = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.ThreatBig, map);

            raidParms.forced               = true;
            raidParms.faction              = faction;
            raidParms.raidStrategy         = RaidStrategyDefOf.ImmediateAttack;
            raidParms.raidArrivalMode      = PawnsArrivalModeDefOf.EdgeWalkIn;
            raidParms.spawnCenter          = spawnSpot;
            raidParms.generateFightersOnly = true;
            raidParms.points               = Mathf.Max(raidParms.points * IncidentWorker_PowerCut.RaidPointsFactorRange.RandomInRange, faction.def.MinPointsToGeneratePawnGroup(PawnGroupKindDefOf.Combat));
            raidParms.pawnGroupMakerSeed   = new int?(@int);
            PawnGroupMakerParms defaultPawnGroupMakerParms = IncidentParmsUtility.GetDefaultPawnGroupMakerParms(PawnGroupKindDefOf.Combat, raidParms, false);

            defaultPawnGroupMakerParms.points = IncidentWorker_Raid.AdjustedRaidPoints(defaultPawnGroupMakerParms.points, raidParms.raidArrivalMode, raidParms.raidStrategy, defaultPawnGroupMakerParms.faction, PawnGroupKindDefOf.Combat);
            IEnumerable <PawnKindDef> pawnKinds = PawnGroupMakerUtility.GeneratePawnKindsExample(defaultPawnGroupMakerParms);

            base.SendStandardLetter();
            QueuedIncident qi = new QueuedIncident(new FiringIncident(IncidentDefOf.RaidEnemy, null, raidParms), Find.TickManager.TicksGame + IncidentWorker_PowerCut.RaidDelay.RandomInRange, 0);

            Find.Storyteller.incidentQueue.Add(qi);

            /*
             * DiaNode diaNode = new DiaNode(text);
             * DiaOption diaOption = new DiaOption("RefugeeChasedInitial_Accept".Translate());
             * diaOption.action = delegate ()
             * {
             *  QueuedIncident qi = new QueuedIncident(new FiringIncident(IncidentDefOf.RaidEnemy, null, raidParms), Find.TickManager.TicksGame + IncidentWorker_PowerCut.RaidDelay.RandomInRange, 0);
             *  Find.Storyteller.incidentQueue.Add(qi);
             * };
             * diaOption.resolveTree = true;
             * diaNode.options.Add(diaOption);
             * string text2 = "RefugeeChasedRejected".Translate(refugee.LabelShort, refugee);
             * DiaNode diaNode2 = new DiaNode(text2);
             * DiaOption diaOption2 = new DiaOption("OK".Translate());
             * diaOption2.resolveTree = true;
             * diaNode2.options.Add(diaOption2);
             * DiaOption diaOption3 = new DiaOption("RefugeeChasedInitial_Reject".Translate());
             * diaOption3.action = delegate ()
             * {
             *  Find.WorldPawns.PassToWorld(refugee, PawnDiscardDecideMode.Decide);
             * };
             * diaOption3.link = diaNode2;
             * diaNode.options.Add(diaOption3);
             * string title = "RefugeeChasedTitle".Translate(map.Parent.Label);
             * Find.WindowStack.Add(new Dialog_NodeTreeWithFactionInfo(diaNode, faction, true, true, title));
             * Find.Archive.Add(new ArchivedDialog(diaNode.text, title, faction));
             */
            return(true);
        }