Skip to content

Commit

Permalink
Merge pull request #74663 from CleverRaven/breather-fix
Browse files Browse the repository at this point in the history
Make a zombie-flavored breather and cut spawns of them in meat lab
  • Loading branch information
Maleclypse authored Jun 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 5f78795 + 50402c1 commit cc3131f
Showing 5 changed files with 64 additions and 9 deletions.
5 changes: 4 additions & 1 deletion data/json/mapgen_palettes/microlab.json
Original file line number Diff line number Diff line change
@@ -173,7 +173,10 @@
"N": { "item": "fireman_cabinet", "chance": 100 }
},
"monster": {
" ": [ { "monster": "mon_zombie_living_wall", "chance": 3 }, { "monster": "mon_breather_hub", "chance": 1 } ],
" ": [
{ "monster": "mon_zombie_living_wall", "chance": 3 },
{ "group": "GROUP_AMALGAMATION_BREATHER_HUB_SPARSE", "chance": 1 }
],
"c": { "monster": "mon_zombie_living_wall", "chance": 3 },
"@": { "monster": "mon_zombie_living_wall", "chance": 80 }
},
8 changes: 4 additions & 4 deletions data/json/monster_special_attacks/monster_deaths.json
Original file line number Diff line number Diff line change
@@ -658,13 +658,13 @@
"valid_targets": [ "hostile", "ally" ],
"effect": "attack",
"shape": "blast",
"targeted_monster_ids": [ "mon_breather", "mon_breather_hub" ],
"targeted_monster_ids": [ "mon_breather", "mon_breather_hub", "mon_amalgamation_breather", "mon_amalgamation_breather_hub" ],
"damage_type": "pure",
"min_damage": 1000,
"max_damage": 1000,
"min_aoe": 48,
"max_aoe": 48,
"aoe_increment": 48,
"min_aoe": 5,
"max_aoe": 5,
"aoe_increment": 5,
"flags": [ "SILENT", "NO_EXPLOSION_SFX" ]
},
{
5 changes: 5 additions & 0 deletions data/json/monstergroups/zombie_amalgamations.json
Original file line number Diff line number Diff line change
@@ -44,6 +44,11 @@
{ "group": "GROUP_COCOON_MED_1", "weight": 1, "pack_size": [ 3, 3 ], "starts": "28 days" }
]
},
{
"name": "GROUP_AMALGAMATION_BREATHER_HUB_SPARSE",
"type": "monstergroup",
"monsters": [ { "monster": "mon_null", "weight": 9 }, { "monster": "mon_amalgamation_breather_hub" } ]
},
{
"name": "GROUP_AMALGAMATION_SMALL",
"type": "monstergroup",
41 changes: 41 additions & 0 deletions data/json/monsters/zed_amalgamation.json
Original file line number Diff line number Diff line change
@@ -82,6 +82,47 @@
"effect": { "id": "death_blood", "hit_self": true, "min_level": 3 }
}
},
{
"id": "mon_amalgamation_breather",
"type": "MONSTER",
"name": { "str": "breather" },
"description": "This is some sort of unearthly pink flesh sac; moist and ridged with veins, it is otherwise without discernible exterior features. Seemingly immobile and defenseless, it sits in place, swelling and collapsing upon itself as it breathes.",
"default_faction": "zombie",
"bodytype": "blob",
"species": [ "ZOMBIE", "ABERRATION" ],
"volume": "62500 ml",
"weight": "81500 g",
"hp": 100,
"speed": 100,
"symbol": "o",
"color": "pink",
"melee_damage": [ { "damage_type": "cut", "amount": 0 } ],
"melee_training_cap": 2,
"harvest": "exempt",
"special_attacks": [ [ "BREATHE", 8 ] ],
"death_function": { "corpse_type": "NO_CORPSE", "message": "The %s melts away." },
"flags": [ "IMMOBILE", "NOGIB" ]
},
{
"id": "mon_amalgamation_breather_hub",
"type": "MONSTER",
"name": { "str": "breather" },
"description": "A weird mass of immobile, breathing pink goo. The other breathers seem to originate from this one.",
"default_faction": "zombie",
"bodytype": "blob",
"species": [ "ZOMBIE", "ABERRATION" ],
"volume": "62500 ml",
"weight": "81500 g",
"hp": 100,
"speed": 100,
"symbol": "O",
"color": "pink",
"melee_damage": [ { "damage_type": "cut", "amount": 0 } ],
"harvest": "exempt",
"special_attacks": [ [ "BREATHE", 8 ] ],
"death_function": { "effect": { "id": "death_kill_breathers", "hit_self": true }, "corpse_type": "NO_CORPSE" },
"flags": [ "ACIDPROOF", "ACID_BLOOD", "IMMOBILE" ]
},
{
"type": "MONSTER",
"abstract": "mon_amalgamation_abstract_small",
14 changes: 10 additions & 4 deletions src/monattack.cpp
Original file line number Diff line number Diff line change
@@ -192,6 +192,8 @@ static const mtype_id mon_blob( "mon_blob" );
static const mtype_id mon_blob_brain( "mon_blob_brain" );
static const mtype_id mon_blob_large( "mon_blob_large" );
static const mtype_id mon_blob_small( "mon_blob_small" );
static const mtype_id mon_amalgamation_breather( "mon_amalgamation_breather" );
static const mtype_id mon_amalgamation_breather_hub( "mon_amalgamation_breather_hub" );
static const mtype_id mon_breather( "mon_breather" );
static const mtype_id mon_breather_hub( "mon_breather_hub" );
static const mtype_id mon_creeper_hub( "mon_creeper_hub" );
@@ -3977,13 +3979,17 @@ bool mattack::breathe( monster *z )
{
// It takes a while
z->mod_moves( -to_moves<int>( 1_seconds ) );
bool old_breather_type = z->type->id == mon_breather || z->type->id == mon_breather_hub;
mtype_id breather_type = old_breather_type ? mon_breather : mon_amalgamation_breather;
mtype_id hub_type = old_breather_type ? mon_breather_hub : mon_amalgamation_breather_hub;
int spawn_radius = old_breather_type ? 3 : 2;

bool able = z->type->id == mon_breather_hub;
bool able = z->type->id == hub_type;
creature_tracker &creatures = get_creature_tracker();
if( !able ) {
for( const tripoint &dest : get_map().points_in_radius( z->pos(), 3 ) ) {
for( const tripoint &dest : get_map().points_in_radius( z->pos(), spawn_radius ) ) {
monster *const mon = creatures.creature_at<monster>( dest );
if( mon && mon->type->id == mon_breather_hub ) {
if( mon && mon->type->id == hub_type ) {
able = true;
break;
}
@@ -3993,7 +3999,7 @@ bool mattack::breathe( monster *z )
return true;
}

if( monster *const spawned = g->place_critter_around( mon_breather, z->pos(), 1 ) ) {
if( monster *const spawned = g->place_critter_around( breather_type, z->pos(), 1 ) ) {
spawned->reset_special( "BREATHE" );
spawned->make_ally( *z );
}

0 comments on commit cc3131f

Please sign in to comment.