From 5edce1954cc8b226eede75bf16812cfb8f9ef987 Mon Sep 17 00:00:00 2001 From: Efstratios Karatzas Date: Sat, 2 Mar 2024 14:18:00 -0800 Subject: [PATCH] feat: friendly wildlife mammals spawn friendly offspring 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. --- src/monster.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/monster.cpp b/src/monster.cpp index 3575997ad73c..09a9fc1ad60a 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -507,10 +507,14 @@ void monster::try_reproduce() } chance += 2; + + // wildlife creatures that are friendly to the player will spawn friendly offspring + const bool friendly_parent = type->in_category( "WILDLIFE" ) && + attitude_to( get_player_character() ) == Attitude::A_FRIENDLY; if( season_match && female && one_in( chance ) ) { int spawn_cnt = rng( 1, type->baby_count ); if( type->baby_monster ) { - g->m.add_spawn( type->baby_monster, spawn_cnt, pos() ); + g->m.add_spawn( type->baby_monster, spawn_cnt, pos(), friendly_parent ); } else { g->m.add_item_or_charges( pos(), item::spawn( type->baby_egg, *baby_timer, spawn_cnt ), true ); }