Skip to content

Commit

Permalink
Adds Never Wander Flag (#60205)
Browse files Browse the repository at this point in the history
* Adds Never Wander Flag

Adds a flag that will prevent monsters from being picked up in wandering hordes explicitly.
Adds the flag to Frog Mother and the collapsed tower monsters that were valid for hordes.

* Remove never wander from frog mother

After discussing with Korg on discord, I’m letting frog mothers still wander. I’ll make a new PR in the morning that adds a new lower level frog zombie and have giant and mutant bullfrogs evolve into it to push frog mother later game.

* Removed jabberwock explicit check

Removed the explicit check for jabberwock as they're not zombies, so they won't be picked up anyways.

went ahead and gave them the flag, however, in case anyone ever reworks hordes.

* clang tidy yelled at me

removed the unused variable for jabberwock
  • Loading branch information
a-chancey authored Aug 30, 2022
1 parent 1da002c commit 3ae3918
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion data/json/monsters/jabberwock.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@
"special_attacks": [ [ "FLESH_GOLEM", 5 ] ],
"harvest": "jabberwock",
"dissect": "dissect_beast_sample_large",
"flags": [ "SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "DESTROYS", "ATTACKMON", "POISON" ]
"flags": [ "SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "DESTROYS", "ATTACKMON", "POISON", "NEVER_WANDER" ]
}
]
4 changes: 2 additions & 2 deletions data/json/monsters/zed_fusion.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
"harvest": "exempt",
"special_attacks": [ { "type": "leap", "cooldown": 5, "max_range": 5, "allow_no_target": true }, [ "scratch", 5 ] ],
"death_function": { "message": "A %s explodes!", "effect": { "id": "death_gas", "hit_self": true }, "corpse_type": "NO_CORPSE" },
"flags": [ "SEES", "HEARS", "SMELLS", "WARM", "POISON", "CLIMBS", "NO_BREATHE", "CLIMBS", "HARDTOSHOOT" ]
"flags": [ "SEES", "HEARS", "SMELLS", "WARM", "POISON", "CLIMBS", "NO_BREATHE", "CLIMBS", "HARDTOSHOOT", "NEVER_WANDER" ]
},
{
"id": "mon_zombie_gasbag_impaler",
Expand Down Expand Up @@ -316,7 +316,7 @@
"vision_day": 1,
"special_attacks": [ { "type": "leap", "cooldown": 5, "max_range": 3, "allow_no_target": true }, [ "scratch", 5 ] ],
"death_function": { "message": "A %s explodes!", "effect": { "id": "death_gas", "hit_self": true }, "corpse_type": "NO_CORPSE" },
"flags": [ "SEES", "HEARS", "GOODHEARING", "WARM", "POISON", "CLIMBS", "NO_BREATHE", "CLIMBS", "HARDTOSHOOT" ]
"flags": [ "SEES", "HEARS", "GOODHEARING", "WARM", "POISON", "CLIMBS", "NO_BREATHE", "CLIMBS", "HARDTOSHOOT", "NEVER_WANDER" ]
},
{
"id": "mon_zombie_hanging_innards",
Expand Down
4 changes: 2 additions & 2 deletions src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3390,8 +3390,8 @@ void monster::set_horde_attraction( monster_horde_attraction mha )
bool monster::will_join_horde( int size )
{
const monster_horde_attraction mha = get_horde_attraction();
if( this->has_flag( MF_IMMOBILE ) ) {
return false; //immobile monsters should never join a horde.
if( this->has_flag( MF_IMMOBILE ) || this->has_flag( MF_NEVER_WANDER ) ) {
return false; //immobile monsters should never join a horde. Same with Never Wander monsters.
}
if( mha == MHA_NEVER ) {
return false;
Expand Down
1 change: 1 addition & 0 deletions src/monstergenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ std::string enum_to_string<m_flag>( m_flag data )
case MF_ALWAYS_VISIBLE: return "ALWAYS_VISIBLE";
case MF_ALWAYS_SEES_YOU: return "ALWAYS_SEES_YOU";
case MF_ALL_SEEING: return "ALL_SEEING";
case MF_NEVER_WANDER: return "NEVER_WANDER";
// *INDENT-ON*
case m_flag::MF_MAX:
break;
Expand Down
1 change: 1 addition & 0 deletions src/mtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ enum m_flag : int {
MF_ALWAYS_VISIBLE, // This monster can always be seen regardless of los or light or anything
MF_ALWAYS_SEES_YOU, // This monster always knows where the avatar is
MF_ALL_SEEING, // This monster can see everything within its vision range regardless of light or obstacles
MF_NEVER_WANDER, // This monster will never join wandering hordes.
MF_MAX // Sets the length of the flags - obviously must be LAST
};

Expand Down
3 changes: 0 additions & 3 deletions src/overmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ static const mongroup_id GROUP_SWAMP( "GROUP_SWAMP" );
static const mongroup_id GROUP_WORM( "GROUP_WORM" );
static const mongroup_id GROUP_ZOMBIE( "GROUP_ZOMBIE" );

static const mtype_id mon_jabberwock( "mon_jabberwock" );

static const oter_str_id oter_central_lab( "central_lab" );
static const oter_str_id oter_central_lab_core( "central_lab_core" );
static const oter_str_id oter_central_lab_train_depot( "central_lab_train_depot" );
Expand Down Expand Up @@ -4033,7 +4031,6 @@ void overmap::move_hordes()
const mtype &type = *this_monster.type;
if(
!type.species.count( species_ZOMBIE ) || // Only add zombies to hordes.
type.id == mon_jabberwock || // Jabberwockies are an exception.
this_monster.get_speed() <= 30 || // So are very slow zombies, like crawling zombies.
!this_monster.will_join_horde( INT_MAX ) || // So are zombies who won't join a horde of any size.
!this_monster.mission_ids.empty() // We mustn't delete monsters that are related to missions.
Expand Down

0 comments on commit 3ae3918

Please sign in to comment.