Of seeds, ammo, and itypes.h

So I’m looking into overhauling farming, primarily by adjusting the time it takes different crops to grow. I’d like to add a mingrow and maxgrow attribute to seeds that determine what day (adjusted for season length options) will grow.

However, if I’m understanding item types right, I’d need to add a mingrow and maxgrow attribute to it_ammo in itypes.h, and set a default value for the vast majority of ammo that isn’t seeds. This seems clunky and ugly.

There’s also the issue of foods that can be used as seeds, such as potatoes and carrots. Under the current system, they can’t be planted, I believe, even if they have a “SEED” flag.

This leads me to what seems to what seems to be the best option, afaik, a seed itype extending and inheriting from comestible…assuming that’s possible. Would that break save compatibility, to create and change items over to a new type? Is there a smarter way to do this? If not, how would I even go about setting up a sub itype?

…I’m starting to see why this hasn’t been touched I think.

IMO the best way to do it might just be to set up some new optional data fields for comestibles, and convert all seeds over to comestibles. That would allow for any type of food to be able to be used as a seed with the right json data entry. No need for a special item type, there are enough foods that it wouldn’t really be needed IMO and setting up some “default values” is a simple one line stuff in the part of the code that loads stuff from the JSON. Compatibility could probably be maintained with a fair bit of work (though you might end up just needing to have all currently growing crops automatically spawn their fruit instead or something similar).