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

Wyrms mine jsonify #51167

Merged
merged 7 commits into from
Aug 30, 2021
12 changes: 12 additions & 0 deletions data/json/furniture_and_terrain/terrain-floors-outdoors.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,5 +388,17 @@
"move_cost": 5,
"flags": [ "TRANSPARENT", "FLAT" ],
"bash": { "sound": "thump", "ter_set": "t_null", "str_min": 50, "str_max": 100, "str_min_supported": 100, "bash_below": true }
},
{
"type": "terrain",
"id": "t_orifice",
"name": "orifice",
"description": "A large round orifice with trails of fresh and dried up strange green liquid with a strong acid odor covering its inner sides.",
"symbol": "O",
"color": "green",
"looks_like": "t_pit",
"move_cost": 0,
"roof": "t_rock_floor",
"flags": [ "NOITEM", "SUPPORTS_ROOF", "WALL" ]
}
]
2 changes: 1 addition & 1 deletion data/json/furniture_and_terrain/terrain-mechanisms.json
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@
"color": "dark_gray",
"move_cost": 0,
"coverage": 50,
"flags": [ "TRANSPARENT", "MOUNTABLE", "PERMEABLE", "MINEABLE" ],
"flags": [ "TRANSPARENT", "MOUNTABLE", "PERMEABLE", "MINEABLE", "SEALED" ],
"examine_action": "pedestal_wyrm",
"bash": {
"str_min": 100,
Expand Down
115 changes: 115 additions & 0 deletions data/json/mapgen/mine/mine_wyrms.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
[
{
"type": "mapgen",
"method": "json",
"om_terrain": [ [ "mine_wyrms_west", "mine_wyrms_central", "mine_wyrms_east" ] ],
"object": {
"fill_ter": "t_rock_floor",
"rows": [
"###@@@ @#####@@@@@@@@@@@################@@@@@@@@@@@##########",
"###@ @@@@@@ @@####@ @######@@@@@@@@@@@ @##########",
"###@ @@@@#####@ @##@@@ @######@ @@@@@ @@@@@@#####",
"#@@@ @#### @##@ @@@@@ @#####@@ @###@ @#####",
"#@ ####@ @@@@@@@###* @###@ @@@###@ @@@@ @@@@@ @#####",
"#@ @@@@#@ @########O*** @##@@ @####* @##@ @#####",
"#@@ **##@ @@@@@##### @@#@ @###O** @##@@@@@@@@@@ @#####",
"##@ **O#@ @@@@#@@ @## @#### @###########@ @#####",
"##@@ *##@@@ @##@ @#O* @###@ @###########@ @@@###",
"###@ @###@@@@@ @@#@ @##** @@##@ @@@@@@@#####@@@ @###",
"###@ @@@###### @#@ @#@@@@ @##@@@@ *@#######@ @###",
"###@@@ @@@@@#O** @#@ @####@ @#####@ *O#######@ @###",
"#####@ @## @#@@ @@####@ @#####@ *@#######@ @###",
"#####@@@@@ @#@ @##@ @#####@ @#####@@@@@@@ @@@#######@ @@@@",
"#########@ @#@@@@ @@#@ @#####@@@ @@@@@#######@ @#########@@@ ",
"##@@@@@@@ @@@####@ @#@ @@@@@###@ @@######@ @###########@ ",
"@@@ @#######@ @#@ @@@##@ @@@@###@ @@@@@@@#####@ &",
"#* @@#####@@@@@#@@ @#@**** @@#@*** @###@ @#####@@@@@ ",
"O* @##@@@@@ @##@ @#@#O#@@ @#@@#O#@ @###@ ##########@ ",
"#* @@#@ @@#@ @######@ @######@ @###@@@ ***O#########@@@@",
"@@ @@@ @@@ @#@ @@@@@@#@ @######@ @#####@@@ ##############",
"#@ @@@#@ @#@ @@@@ @@######@ @@@@@#### @#############",
"#@ @###@ >@#@@@@@@ @#######@ @#############",
"#@@@@@@@@@@###@@@@######@@@@@@@@@@#######@@@@@@@@@@@@@@@@@@#############"
],
"terrain": {
" ": [ [ "t_water_sh_underground", 1 ], [ "t_rock_floor", 10 ] ],
"@": [ [ "t_rock", 4 ], [ "t_rock_floor", 1 ] ],
"#": "t_rock",
">": "t_slope_down",
"&": "t_buffer_stop",
"O": "t_orifice"
},
"items": {
" ": [
{
"item": {
"subtype": "distribution",
"entries": [
{ "item": "coal_lump", "prob": 20, "count": [ 1, 10 ] },
{ "item": "rock", "prob": 40, "count": [ 1, 10 ] },
{ "item": "rock_large", "prob": 10, "count": [ 1, 10 ] },
{ "item": "rock_flaking", "prob": 20, "count": [ 1, 10 ] },
{ "item": "material_shrd_limestone", "prob": 40, "count": [ 1, 10 ] },
{ "item": "material_limestone", "prob": 40, "count": [ 1, 10 ] },
{ "item": "material_niter", "prob": 5, "count": [ 1, 10 ] },
{ "item": "material_sand", "prob": 50, "charges": [ 10, 500 ] },
{ "item": "material_soil", "prob": 50, "charges": [ 10, 500 ] },
{ "item": "chunk_sulfur", "prob": 5, "count": [ 1, 10 ] },
{ "item": "material_rocksalt", "prob": 5, "count": [ 1, 10 ] },
{ "item": "material_rhodonite", "prob": 5, "count": [ 1, 10 ] },
{ "item": "material_zincite", "prob": 5, "count": [ 1, 10 ] }
]
},
"repeat": [ 1, 3 ],
"chance": 1
},
{ "item": "mine_equipment", "chance": 1 }
]
},
"fields": { "*": { "field": "fd_acid", "intensity": 2, "age": 1 } }
}
},
{
"type": "mapgen",
"method": "json",
"om_terrain": "mine_wyrms_finale",
"object": {
"fill_ter": "t_rock_floor",
"rows": [
"########################",
"########################",
"########################",
"########################",
"########################",
"########################",
"########################",
"########################",
"########################",
"###########@@@@@@#O#@@##",
"###########@ ***@##",
"###########@ @##",
"###########@ @##",
"###########@ @##",
"###########@ @##",
"###########@ $ *###",
"###########@ *O##",
"###########@ *###",
"############* @##",
"###########O** @##",
"############ @##",
"###########@ @##",
"###########@ < @##",
"###########@@@@@@@@@@@##"
],
"terrain": {
"@": [ [ "t_rock", 4 ], [ "t_rock_floor", 1 ] ],
"#": "t_rock",
"$": "t_pedestal_wyrm",
"<": "t_slope_up",
"O": "t_orifice"
},
"item": { "$": { "item": "petrified_eye", "chance": 100 } },
"fields": { "*": { "field": "fd_acid", "intensity": 2, "age": 1 } }
}
}
]
5 changes: 5 additions & 0 deletions data/json/monster_factions.json
Original file line number Diff line number Diff line change
Expand Up @@ -493,5 +493,10 @@
"name": "sewer_snake",
"base_faction": "mutant_piscivores",
"neutral": "sewer_snake"
},
{
"type": "MONSTER_FACTION",
"name": "dark_wyrm",
"neutral": "mon_dark_wyrm"
Night-Pryanik marked this conversation as resolved.
Show resolved Hide resolved
}
]
2 changes: 1 addition & 1 deletion data/json/monsters/insect_spider.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "MONSTER",
"name": { "str": "dark wyrm" },
"description": "A huge mutated worm found deep underground. It has a gaping round mouth lined with dagger-like teeth, and its flesh is slick with bubbling blue slime.",
"default_faction": "mutant",
"default_faction": "dark_wyrm",
"bodytype": "snake",
"species": [ "MUTANT" ],
"volume": "92500 ml",
Expand Down
29 changes: 29 additions & 0 deletions data/json/overmap/overmap_special/mine.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,34 @@
"city_sizes": [ 4, -1 ],
"occurrences": [ 0, 2 ],
"flags": [ "WILDERNESS" ]
},
{
"type": "overmap_special",
"id": "Wyrms mine",
"overmaps": [
{ "point": [ 0, 0, 0 ], "overmap": "s_lot_north" },
{ "point": [ 0, 1, 0 ], "overmap": "mine_entrance_north" },
{ "point": [ 1, 1, 0 ], "overmap": "mine_entrance_loading_zone_north" },
{ "point": [ 1, 0, 0 ], "overmap": "road_end_north" },
{ "point": [ 0, 1, 1 ], "overmap": "mine_entrance_roof_north" },
{ "point": [ 1, 1, 1 ], "overmap": "mine_entrance_loading_zone_roof_north" },
{ "point": [ 0, 1, -1 ], "overmap": "mine_shaft_middle_north" },
{ "point": [ 1, 1, -1 ], "overmap": "mine_shaft_middle_east_north" },
{ "point": [ 0, 1, -2 ], "overmap": "mine_shaft_lower_north" },
{ "point": [ 1, 1, -2 ], "overmap": "mine_shaft_lower_east_north" },
{ "point": [ -1, 1, -2 ], "overmap": "mine_wyrms_east_north" },
{ "point": [ -2, 1, -2 ], "overmap": "mine_wyrms_central_north" },
{ "point": [ -3, 1, -2 ], "overmap": "mine_wyrms_west_north" },
{ "point": [ -3, 1, -3 ], "overmap": "mine_wyrms_finale_north" }
],
"connections": [
{ "point": [ 0, -1, 0 ], "terrain": "road", "connection": "local_road", "from": [ 0, 0, 0 ] },
{ "point": [ 1, -1, 0 ], "terrain": "road", "connection": "local_road", "from": [ 1, 0, 0 ] }
],
"locations": [ "wilderness" ],
"city_distance": [ 10, 40 ],
"city_sizes": [ 4, -1 ],
"occurrences": [ 0, 2 ],
"flags": [ "WILDERNESS" ]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,11 @@
"mine_amigara_-1_east",
"mine_amigara_finale_west",
"mine_amigara_finale_central",
"mine_amigara_finale_east"
"mine_amigara_finale_east",
"mine_wyrms_west",
"mine_wyrms_central",
"mine_wyrms_east",
"mine_wyrms_finale"
],
"name": "mine tunnels",
"sym": "O",
Expand Down
52 changes: 33 additions & 19 deletions src/iexamine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1605,24 +1605,35 @@ void iexamine::fault( Character &, const tripoint & )
void iexamine::pedestal_wyrm( Character &you, const tripoint &examp )
{
map &here = get_map();
if( !here.i_at( examp ).empty() ) {
none( you, examp );
return;
}
// Send in a few wyrms to start things off.
get_event_bus().send<event_type::awakes_dark_wyrms>();
int num_wyrms = rng( 1, 4 );
for( int i = 0; i < num_wyrms; i++ ) {
if( monster *const mon = g->place_critter_around( mon_dark_wyrm, you.pos(), 2 ) ) {
here.ter_set( mon->pos(), t_rock_floor );
map_stack items = here.i_at( examp );
if( !items.empty() ) {
if( items.only_item().typeId() == itype_petrified_eye &&
query_yn( _( "Remove the petrified eye from the pedestal?" ) ) ) {
here.i_clear( examp );

item eye( itype_petrified_eye );
you.i_add_or_drop( eye );

// Send in a few wyrms to start things off.
get_event_bus().send<event_type::awakes_dark_wyrms>();
for( const tripoint &p : here.points_on_zlevel() ) {
if( here.ter( p ) == ter_id( "t_orifice" ) ) {
g->place_critter_around( mon_dark_wyrm, p, 1 );
}
}

sounds::sound( examp, 80, sounds::sound_t::combat, _( "an ominous grinding noise…" ), true,
"misc", "stones_grinding" );
add_msg( _( "The pedestal sinks into the ground…" ) );
here.ter_set( examp, t_rock_floor );
get_timed_events().add( timed_event_type::SPAWN_WYRMS,
calendar::turn + rng( 30_seconds, 60_seconds ) );
} else {
none( you, examp );
add_msg( _( "You decided to leave the petrified eye on the pedestal…" ) );
return;
}
}
add_msg( _( "The pedestal sinks into the ground…" ) );
sounds::sound( examp, 80, sounds::sound_t::combat, _( "an ominous grinding noise…" ), true,
"misc", "stones_grinding" );
here.ter_set( examp, t_rock_floor );
get_timed_events().add( timed_event_type::SPAWN_WYRMS,
calendar::turn + rng( 30_seconds, 60_seconds ) );
}

/**
Expand Down Expand Up @@ -1796,7 +1807,8 @@ bool iexamine_helper::drink_nectar( Character &you )
/**
* Spawn an item after harvesting the plant
*/
void iexamine_helper::handle_harvest( Character &you, const std::string &itemid, bool force_drop )
void iexamine_helper::handle_harvest( Character &you, const std::string &itemid,
bool force_drop )
{
item harvest = item( itemid );
if( harvest.has_temperature() ) {
Expand Down Expand Up @@ -2359,7 +2371,8 @@ ret_val<bool> iexamine::can_fertilize( Character &you, const tripoint &tile,
return ret_val<bool>::make_success();
}

void iexamine::fertilize_plant( Character &you, const tripoint &tile, const itype_id &fertilizer )
void iexamine::fertilize_plant( Character &you, const tripoint &tile,
const itype_id &fertilizer )
{
ret_val<bool> can_fert = can_fertilize( you, tile, fertilizer );
if( !can_fert.success() ) {
Expand Down Expand Up @@ -2402,7 +2415,8 @@ void iexamine::fertilize_plant( Character &you, const tripoint &tile, const ityp
planted.front().tname() );
}

itype_id iexamine::choose_fertilizer( Character &you, const std::string &pname, bool ask_player )
itype_id iexamine::choose_fertilizer( Character &you, const std::string &pname,
bool ask_player )
{
std::vector<const item *> f_inv = you.all_items_with_flag( flag_FERTILIZER );
if( f_inv.empty() ) {
Expand Down
78 changes: 11 additions & 67 deletions src/mapgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ static const itype_id itype_jp8( "jp8" );

static const mongroup_id GROUP_BREATHER( "GROUP_BREATHER" );
static const mongroup_id GROUP_BREATHER_HUB( "GROUP_BREATHER_HUB" );
static const mongroup_id GROUP_DARK_WYRM( "GROUP_DARK_WYRM" );
static const mongroup_id GROUP_DOG_THING( "GROUP_DOG_THING" );
static const mongroup_id GROUP_FUNGI_FUNGALOID( "GROUP_FUNGI_FUNGALOID" );
static const mongroup_id GROUP_HAZMATBOT( "GROUP_HAZMATBOT" );
Expand Down Expand Up @@ -5195,7 +5194,7 @@ void map::draw_mine( mapgendata &dat )
}

// Not an entrance; maybe some hazards!
switch( rng( 0, 5 ) ) {
switch( rng( 0, 4 ) ) {
case 0:
break; // Nothing! Lucky!

Expand Down Expand Up @@ -5248,49 +5247,6 @@ void map::draw_mine( mapgendata &dat )
}
break;

case 5: { // Dark worm!
const int num_worms = rng( 1, 5 );
for( int i = 0; i < num_worms; i++ ) {
std::vector<direction> sides;
if( dat.n_fac == 6 ) {
sides.push_back( direction::NORTH );
}
if( dat.e_fac == 6 ) {
sides.push_back( direction::EAST );
}
if( dat.s_fac == 6 ) {
sides.push_back( direction::SOUTH );
}
if( dat.w_fac == 6 ) {
sides.push_back( direction::WEST );
}
if( sides.empty() ) {
place_spawns( GROUP_DARK_WYRM, 1, point( SEEX, SEEY ), point( SEEX, SEEY ), 1, true );
i = num_worms;
} else {
point p;
switch( random_entry( sides ) ) {
case direction::NORTH:
p = point( rng( 1, SEEX * 2 - 2 ), rng( 1, 5 ) );
break;
case direction::EAST:
p = point( SEEX * 2 - rng( 2, 6 ), rng( 1, SEEY * 2 - 2 ) );
break;
case direction::SOUTH:
p = point( rng( 1, SEEX * 2 - 2 ), SEEY * 2 - rng( 2, 6 ) );
break;
case direction::WEST:
p = point( rng( 1, 5 ), rng( 1, SEEY * 2 - 2 ) );
break;
default:
break;
}
ter_set( p, t_rock_floor );
place_spawns( GROUP_DARK_WYRM, 1, p, p, 1, true );
}
}
}
break;
}

if( terrain_type == "mine_down" ) { // Don't forget to build a slope down!
Expand Down Expand Up @@ -5445,29 +5401,17 @@ void map::draw_mine( mapgendata &dat )
square( this, t_rock_floor, point( 0, SEEY ), point( 3, SEEY + 1 ) );
}

// Now, pick and generate a type of finale!
switch( rng( 1, 2 ) ) {
case 1: { // Wyrms
const point p2( rng( SEEX, SEEX + 1 ), rng( SEEY, SEEY + 1 ) );
ter_set( p2, t_pedestal_wyrm );
spawn_item( p2, "petrified_eye" );
}
break; // That's it! game::examine handles the pedestal/wyrm spawns

case 2: { // The Thing dog
const int num_bodies = rng( 4, 8 );
for( int i = 0; i < num_bodies; i++ ) {
point p3( rng( 4, SEEX * 2 - 5 ), rng( 4, SEEX * 2 - 5 ) );
add_item( p3, item::make_corpse() );
place_items( item_group_id( "mine_equipment" ), 60, p3,
p3, false, calendar::start_of_cataclysm );
}
place_spawns( GROUP_DOG_THING, 1, point( SEEX, SEEX ), point( SEEX + 1, SEEX + 1 ), 1, true, true );
spawn_artifact( tripoint( rng( SEEX, SEEX + 1 ), rng( SEEY, SEEY + 1 ), abs_sub.z ),
relic_procgen_id( "netherum_tunnels" ) );
}
break;
// The Thing dog
const int num_bodies = rng( 4, 8 );
for( int i = 0; i < num_bodies; i++ ) {
point p3( rng( 4, SEEX * 2 - 5 ), rng( 4, SEEX * 2 - 5 ) );
add_item( p3, item::make_corpse() );
place_items( item_group_id( "mine_equipment" ), 60, p3,
p3, false, calendar::start_of_cataclysm );
}
place_spawns( GROUP_DOG_THING, 1, point( SEEX, SEEX ), point( SEEX + 1, SEEX + 1 ), 1, true, true );
spawn_artifact( tripoint( rng( SEEX, SEEX + 1 ), rng( SEEY, SEEY + 1 ), abs_sub.z ),
relic_procgen_id( "netherum_tunnels" ) );
}
}

Expand Down
Loading