What exactly are Food Type Flags?

Started by Polqanem, August 11, 2023, 03:43:33 AM

Previous topic - Next topic

Polqanem

Hi everyone,

I'm planning on making a mod for rimworld biotech with a gene that makes someone restricted to eating metals, like steel. I've seemingly been successful in assigning the item steel a nutrition value and a foodtype which I called "Metalfood".

The problem is that I don't know where the foodtype "metalfood" would be assigned. I copied a .cs file called "FoodTypeFlags" from github and put it into a folder called "Source" within my mod folder.

The file is named "FoodTypeFlags.cs" and looks like this:

using System;

namespace RimWorld
{
   [Flags]
   public enum FoodTypeFlags
   {
      None = 0,
      VegetableOrFruit = 1,
      Meat = 2,
      Fluid = 4,
      Corpse = 8,
      Seed = 16,
      AnimalProduct = 32,
      Plant = 64,
      Tree = 128,
      Meal = 256,
      Processed = 512,
      Liquor = 1024,
      Kibble = 2048,
      VegetarianAnimal = 3857,
      VegetarianRoughAnimal = 3921,
      CarnivoreAnimal = 2826,
      CarnivoreAnimalStrict = 10,
      OmnivoreAnimal = 3867,
      OmnivoreRoughAnimal = 3931,
      DendrovoreAnimal = 2705,
      OvivoreAnimal = 2848,
      OmnivoreHuman = 3903,
      Metalfood = 4096
   }
}


I'd love some advice, and please tell me if something like this isn't even possible because I haven't seen it ever done before (at least the way I'm doing it). Thank you in advance.