public ManagerJob_Hunting(Manager manager) : base(manager)
        {
            // populate the trigger field, set the root category to meats and allow all but human & insect meat.
            Trigger = new Trigger_Threshold(this);
            Trigger.ThresholdFilter.SetDisallowAll();
            Trigger.ThresholdFilter.SetAllow(Utilities_Hunting.MeatRaw, true);

            // disallow humanlike
            foreach (ThingDef def in HumanLikeMeatDefs)
            {
                Trigger.ThresholdFilter.SetAllow(def, false);
            }

            // disallow insect
            Trigger.ThresholdFilter.SetAllow(Utilities_Hunting.InsectMeat, false);

            // start the history tracker;
            History = new History(new[] { "stock", "corpses", "designated" },
                                  new[] { Color.white, new Color(.7f, .7f, .7f), new Color(.4f, .4f, .4f) });

            // init stuff if we're not loading
            if (Scribe.mode == LoadSaveMode.Inactive)
            {
                RefreshAllowedAnimals();
            }
        }
        public ManagerJob_Foraging()
        {
            // all plants that yield something, and it isn't wood.
            AllowedPlants = Find.Map.Biome.AllWildPlants
                                .Where( plant => plant.plant.harvestYield > 0 &&
                                                 plant.plant.harvestedThingDef != null &&
                                                 plant.plant.harvestTag != "Wood" )
                                .ToDictionary( k => k, v => false );

            // add cave world fauna
            List<ThingDef> caveWorldFauna = DefDatabase<ThingDef>.AllDefsListForReading.Where( def => def.plant?.sowTags.Contains( "Fungiponics" ) ?? false ).ToList();
            foreach ( var fungus in caveWorldFauna )
            {
                AllowedPlants.Add( fungus, false );
            }

            // populate the trigger field, count all harvested thingdefs from the allowed plant list
            Trigger = new Trigger_Threshold( this );
            Trigger.ThresholdFilter.SetDisallowAll();
            foreach ( var plant in AllowedPlants.Keys )
            {
                Trigger.ThresholdFilter.SetAllow( plant.plant.harvestedThingDef, true );
            }

            // create History tracker
            History = new History( new[] { "stock", "designated" }, new[] { Color.white, Color.grey } );
        }
        public ManagerJob_Foraging(Manager manager) : base(manager)
        {
            // all plants that yield something, and it isn't wood.
            AllowedPlants = manager.map.Biome.AllWildPlants
                            .Where(plant => plant.plant.harvestYield > 0 &&
                                   plant.plant.harvestedThingDef != null &&
                                   plant.plant.harvestTag != "Wood")
                            .ToDictionary(k => k, v => false);

            // add cave world fauna
            List <ThingDef> caveWorldFauna =
                DefDatabase <ThingDef> .AllDefsListForReading.Where(
                    def =>
                    def.plant?.sowTags.Contains( "Fungiponics" ) ?? false)
                .ToList();

            foreach (ThingDef fungus in caveWorldFauna)
            {
                AllowedPlants.Add(fungus, false);
            }

            // populate the trigger field, count all harvested thingdefs from the allowed plant list
            Trigger = new Trigger_Threshold(this);
            Trigger.ThresholdFilter.SetDisallowAll();
            foreach (ThingDef plant in AllowedPlants.Keys)
            {
                Trigger.ThresholdFilter.SetAllow(plant.plant.harvestedThingDef, true);
            }

            // create History tracker
            History = new History(new[] { "stock", "designated" }, new[] { Color.white, Color.grey });
        }
        public ManagerJob_Production( RecipeDef recipe )
        {
            Bill = recipe.UsesUnfinishedThing ? new Bill_ProductionWithUft( recipe ) : new Bill_Production( recipe );
            _hasMeaningfulIngredientChoices = Dialog_CreateJobsForIngredients.HasPrerequisiteChoices( recipe );
            MainProduct = new MainProductTracker( Bill.recipe );
            Trigger = new Trigger_Threshold( this );
            BillGivers = new BillGiverTracker( this );

            History = new History( new[] { Trigger.ThresholdFilter.Summary } );
        }
Example #5
0
        public ManagerJob_Production(Manager manager, RecipeDef recipe) : base(manager)
        {
            Bill = recipe.UsesUnfinishedThing ? new Bill_ProductionWithUft(recipe) : new Bill_Production(recipe);
            _hasMeaningfulIngredientChoices = Dialog_CreateJobsForIngredients.HasPrerequisiteChoices(manager, recipe);
            MainProduct = new MainProductTracker(Bill.recipe);
            Trigger     = new Trigger_Threshold(this);
            BillGivers  = new BillGiverTracker(this);

            History = new History(new[] { Trigger.ThresholdFilter.Summary });
        }
Example #6
0
        public ManagerJob_Hunting()
        {
            // populate the trigger field, set the root category to meats and allow all but human meat.
            Trigger = new Trigger_Threshold( this );
            Trigger.ThresholdFilter.SetDisallowAll();
            Trigger.ThresholdFilter.SetAllow( Utilities_Hunting.RawMeat, true );
            Trigger.ThresholdFilter.SetAllow( Utilities_Hunting.HumanMeat, false );

            // populate the list of animals from the animals in the biome - allow all by default.
            AllowedAnimals = Find.Map.Biome.AllWildAnimals.ToDictionary( pk => pk, v => true );

            History = new History( new[] { "stock", "corpses", "designated" },
                                   new Color[] { Color.white, new Color( .7f, .7f, .7f ), new Color( .4f, .4f, .4f ) } );
        }
        public ManagerJob_Hunting(Manager manager) : base(manager)
        {
            // populate the trigger field, set the root category to meats and allow all but human meat.
            Trigger = new Trigger_Threshold(this);
            Trigger.ThresholdFilter.SetDisallowAll();
            Trigger.ThresholdFilter.SetAllow(Utilities_Hunting.RawMeat, true);
            Trigger.ThresholdFilter.SetAllow(Utilities_Hunting.HumanMeat, false);

            // populate the list of animals from the animals in the biome - allow all by default.
            AllowedAnimals = manager.map.Biome.AllWildAnimals.ToDictionary(pk => pk, v => true);

            History = new History(new[] { "stock", "corpses", "designated" },
                                  new[] { Color.white, new Color(.7f, .7f, .7f), new Color(.4f, .4f, .4f) });
        }
        public ManagerJob_Foraging(Manager manager) : base(manager)
        {
            // populate the trigger field, count all harvested thingdefs from the allowed plant list
            Trigger = new Trigger_Threshold(this);

            // create History tracker
            History = new History(new[] { "stock", "designated" }, new[] { Color.white, Color.grey });

            // init stuff if we're not loading
            // todo: please, please refactor this into something less clumsy!
            if (Scribe.mode == LoadSaveMode.Inactive)
            {
                RefreshAllowedPlants();
            }
        }
        public ManagerJob_Forestry()
        {
            // populate the trigger field, set the root category to meats and allow all but human meat.
            Trigger = new Trigger_Threshold( this );
            Trigger.ThresholdFilter.SetDisallowAll();
            Trigger.ThresholdFilter.SetAllow( Utilities_Forestry.Wood, true );

            // populate the list of trees from the plants in the biome - allow all by default.
            // A tree is defined as any plant that yields wood
            AllowedTrees =
                Find.Map.Biome.AllWildPlants.Where( pd => pd.plant.harvestedThingDef == Utilities_Forestry.Wood )
                    .ToDictionary( pk => pk, v => true );

            History = new History( new[] { "stock", "designated" }, new[] { Color.white, Color.grey } );
        }
Example #10
0
        public ManagerJob_Mining(Manager manager) : base(manager)
        {
            // populate the trigger field, set the root category to meats and allow all but human & insect meat.
            Trigger = new Trigger_Threshold(this);

            // start the history tracker;
            History = new History(new[] { "stock", "chunks", "designated" },
                                  new[] { Color.white, new Color(.7f, .7f, .7f), new Color(.4f, .4f, .4f) });

            // init stuff if we're not loading
            if (Scribe.mode == LoadSaveMode.Inactive)
            {
                RefreshAllowedMinerals();
            }
        }
Example #11
0
        public ManagerJob_Forestry(Manager manager) : base(manager)
        {
            // populate the trigger field, set the root category to wood.
            Trigger = new Trigger_Threshold(this);
            Trigger.ThresholdFilter.SetDisallowAll();
            Trigger.ThresholdFilter.SetAllow(ThingDefOf.WoodLog, true);

            // initialize clearAreas list with current areas
            UpdateClearAreas();

            History = new History(new[] { "stock", "designated" }, new[] { Color.white, Color.grey });


            // init stuff if we're not loading
            // todo: please, please refactor this into something less clumsy!
            if (Scribe.mode == LoadSaveMode.Inactive)
            {
                RefreshAllowedTrees();
            }
        }
        public ManagerJob_Forestry(Manager manager) : base(manager)
        {
            // populate the trigger field, set the root category to wood.
            Trigger = new Trigger_Threshold(this);
            Trigger.ThresholdFilter.SetDisallowAll();
            Trigger.ThresholdFilter.SetAllow(Utilities_Forestry.Wood, true);

            // populate the list of trees from the plants in the biome - allow all by default.
            // A tree is defined as any plant that yields wood or has a wood harvesting tag.
            AllowedTrees =
                manager.map.Biome.AllWildPlants.Where(
                    pd =>
                    pd.plant.harvestTag == "Wood" ||
                    pd.plant.harvestedThingDef == Utilities_Forestry.Wood)
                // add harvesttag to allow non-wood yielding woody plants.
                .ToDictionary(pk => pk, v => true);

            // initialize clearAreas list with current areas
            UpdateClearAreas();

            History = new History(new[] { "stock", "designated" }, new[] { Color.white, Color.grey });
        }
        public ManagerJob_Forestry( Manager manager )
            : base(manager)
        {
            // populate the trigger field, set the root category to wood.
            Trigger = new Trigger_Threshold( this );
            Trigger.ThresholdFilter.SetDisallowAll();
            Trigger.ThresholdFilter.SetAllow( Utilities_Forestry.Wood, true );

            // populate the list of trees from the plants in the biome - allow all by default.
            // A tree is defined as any plant that yields wood or has a wood harvesting tag.
            AllowedTrees =
                manager.map.Biome.AllWildPlants.Where(
                                              pd =>
                                              pd.plant.harvestTag == "Wood" ||
                                              pd.plant.harvestedThingDef == Utilities_Forestry.Wood )
                    // add harvesttag to allow non-wood yielding woody plants.
                   .ToDictionary( pk => pk, v => true );

            // initialize clearAreas list with current areas
            UpdateClearAreas();

            History = new History( new[] {"stock", "designated"}, new[] {Color.white, Color.grey} );
        }