feat: friendly wildlife mammals spawn friendly offspring #4287
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Players usually tame wildlife that can be considered 'farm-animals'. It's tedious to require the player to keep taming offspring of the animals they have already tamed in the first place so this change addresses that. Mostly meant as QoL change for farm players.
Purpose of change
This change is meant as a simple QoL improvement, mostly aimed at farm players. It makes is so that wildlife mammals that have been tamed and are friendly to the player produce equally friendly offspring that doesn't need to also be tamed with food as that's tedious.
This change works well alongside generic culling process that already exists for pets: 8c42631
Describe the solution
Fix is really easy for mammals. Just check if parent monster is wildlife creature + friendly to player and then make offspring inherit their attitude towards the player. This fix doesn't currently address creatures reproducing via eggs, e.g. chickens. TODO for tomorrow.
Describe alternatives you've considered
I've considered making one larger change that affects both mammals + wildlife creatures that lay eggs but though I'd test waters first with a smaller change.
Also considered not limiting this to WILDLIFE category for animals but I think it's a good idea to do so as I didn't want to affect behavior of weird inter-dimensional scifi creatures that I'm not that familiar with in the first place. However I'm not opposed to expanding the scope of which creatures are affected, just thought this was a safe start.
Testing
Testing is a bit hard because creatures only spawn based on chance + correct conditions. Need to hack the code a bit to make them spawn more reliably every time the submap is loaded. The following hack works for that: 3236ddb
With that hack in place:
Spawn cow. Tame cow. Go away (like 120 tiles or something) and come back so submap gets reloaded.
Cow will have spawned friendly calf.
Also. Spawn cow. Don't tame cow. Go away and come back.
Cow will have spawned a neutral calf.
The testing patch also provides useful messages when this takes place.
Additional context
Checklist