Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breather fix 0.H #74664

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion data/json/mapgen_palettes/microlab.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
},
Expand Down
8 changes: 4 additions & 4 deletions data/json/monster_special_attacks/monster_deaths.json
Original file line number Diff line number Diff line change
Expand Up @@ -572,13 +572,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" ]
},
{
Expand Down
5 changes: 5 additions & 0 deletions data/json/monstergroups/zombie_amalgamations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
41 changes: 41 additions & 0 deletions data/json/monsters/zed_amalgamation.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,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",
Expand Down
14 changes: 10 additions & 4 deletions src/monattack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,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" );
Expand Down Expand Up @@ -4124,13 +4126,17 @@ bool mattack::breathe( monster *z )
{
// It takes a while
z->moves -= 100;
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;
}
Expand All @@ -4140,7 +4146,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 );
}
Expand Down
Loading