Exemplo n.º 1
0
        internal static void Postfix(ref float __result, Map ___map, ThingDef plant)
        {
            if (!plant.HasModExtension <DM_ModExtension>())
            {
                return;
            }
            DM_ModExtension ext = plant.GetModExtension <DM_ModExtension>();

            if (SeasonUtility.GetPreviousSeason(ext.season) == GenLocalDate.Season(___map) && ext.spawnInPreviousSeason)
            {
                __result = (ext.commonality / 2);
                return;
            }
            __result = ext.commonality;
        }
Exemplo n.º 2
0
        internal static void Postfix(IntVec3 c, Map ___map, List <ThingDef> outPlants)
        {
            List <ThingDef> thingDefs = DefDatabase <ThingDef> .AllDefsListForReading;

            foreach (ThingDef thingDef in thingDefs.Where(x => x.HasModExtension <DM_ModExtension>()))
            {
                outPlants.Remove(thingDef);
                DM_ModExtension ext = thingDef.GetModExtension <DM_ModExtension>();
                if (!thingDef.CanEverPlantAt_NewTemp(c, ___map))
                {
                    return;
                }
                if (GenLocalDate.Season(___map) == ext.season || (SeasonUtility.GetPreviousSeason(ext.season) == GenLocalDate.Season(___map) && ext.spawnInPreviousSeason) || (DMSeasonUtility.GetNextSeason(ext.season) == GenLocalDate.Season(___map) && ext.spawnInNextSeason))
                {
                    outPlants.Add(thingDef);
                }
            }
        }