예제 #1
0
        public static bool BlightPossible()
        {
            var incident = new RimWorld.IncidentWorker_CropBlight();

            incident.def               = new IncidentDef();
            incident.def.tale          = null;
            incident.def.category      = new IncidentCategoryDef();
            incident.def.category.tale = null;
            return(incident.CanFireNow(new IncidentParms
            {
                target = Helper.AnyPlayerMap
            }));
        }
        public override bool IsPossible()
        {
            worker     = new RimWorld.IncidentWorker_CropBlight();
            worker.def = IncidentDef.Named("CropBlight");

            Map map = Helper.AnyPlayerMap;

            if (map != null)
            {
                parms = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.Misc, map);

                return(worker.CanFireNow(parms));
            }

            return(false);
        }
예제 #3
0
        public static void Blight(string quote = null)
        {
            var incident = new RimWorld.IncidentWorker_CropBlight();

            incident.def = new IncidentDef();
            if (quote != null)
            {
                _state = quote;
                Helper.Log("state set to " + _state);
            }
            incident.def.tale          = null;
            incident.def.category      = new IncidentCategoryDef();
            incident.def.category.tale = null;
            incident.TryExecute(new IncidentParms
            {
                target = Helper.AnyPlayerMap
            });
        }
예제 #4
0
        public override bool IsPossible()
        {
            worker     = new RimWorld.IncidentWorker_CropBlight();
            worker.def = new IncidentDef();

            parms = new IncidentParms();

            List <Map> allMaps = Current.Game.Maps;

            foreach (Map map in allMaps)
            {
                parms.target = map;
                if (worker.CanFireNow(parms))
                {
                    return(true);
                }
            }
            return(false);
        }