Esempio n. 1
0
        //public static bool RefugeeChasedPossible()
        //{
        //    var incident = new RimWorld.IncidentWorker_RefugeeChased();
        //    incident.def = IncidentDef.Named("RefugeeChased");
        //    return incident.CanFireNow(new IncidentParms
        //    {
        //        target = Helper.AnyPlayerMap
        //    });
        //}

        //public static void RefugeeChased(string quote)
        //{
        //    var incident = new RimWorld.IncidentWorker_RefugeeChased();
        //    incident.def = IncidentDef.Named("RefugeeChased");
        //    if (quote != null)
        //    {
        //        _state = quote;
        //        Helper.Log("state set to " + _state);
        //    }
        //    incident.TryExecute(new IncidentParms
        //    {
        //        target = Helper.AnyPlayerMap
        //    });
        //}

        public static bool AnimalTamePossible()
        {
            var incident = new RimWorld.IncidentWorker_SelfTame();

            incident.def.tale          = null;
            incident.def.category      = new IncidentCategoryDef();
            incident.def.category.tale = null;
            return(incident.CanFireNow(new IncidentParms
            {
                target = Helper.AnyPlayerMap
            }, true));
        }
Esempio n. 2
0
        public static void AnimalTame(string quote = null)
        {
            var incident = new RimWorld.IncidentWorker_SelfTame();

            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
            });
        }
        public override bool IsPossible()
        {
            worker     = new RimWorld.IncidentWorker_SelfTame();
            worker.def = IncidentDef.Named("SelfTame");

            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);
        }
        public override bool IsPossible()
        {
            worker     = new RimWorld.IncidentWorker_SelfTame();
            worker.def = IncidentDef.Named("SelfTame");

            Map map = Helper.AnyPlayerMap;

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

                bool canFire = worker.CanFireNow(parms);

                Helper.Log("Can fire " + canFire);

                return(canFire);
            }

            return(false);
        }