Skip to content

Commit

Permalink
Merge pull request CleverRaven#25609 from BrianLefler/lab_escape
Browse files Browse the repository at this point in the history
Further improve lab escape start - add a brute who smashed the glass.
  • Loading branch information
Rivet-the-Zombie authored Sep 19, 2018
2 parents e2448cd + e57a1c4 commit c7486da
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 37 deletions.
165 changes: 137 additions & 28 deletions data/json/mapgen/lab/lab_escape.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[
{
"//": "Cross floorplan which fills a quadrant with rocks when a side is empty, and possibly adds vaults.",
"//": "Cells where the player starts during a lab escape.",
"type": "mapgen",
"method": "json",
"om_terrain": [ "lab_escape_cells" ],
"weight": 200,
"weight": 100,
"object": {
"fill_ter": "t_thconc_floor",
"rows": [
Expand All @@ -21,41 +21,44 @@
"########################",
"########################",
"########################",
"########################",
"########################",
"########################",
"#---------------------##",
"#|ST,|ST,|ST,|ST,|ST,|##",
"#|,,,|,,,|,,,|,,,|,,,|##",
"#|,,b|,,b|,,b|,,b|,,b|##",
"#|,,b|,,b|,,b|,,b|,,b|##",
"#|,,,|,,,|,,,|,,,|,,,|##",
"#|,,,|,,,|,,,|,,,|,,,|##",
"--gGg|gGg|gGg|gGg|gGg--|"
"-----------------------|",
"|x.....................|",
"|......................|",
"--Lg--Lg--Lg--Lg--Lg-..|",
"|T..|T..|T..|T..|T..|..|",
"|S..|S..|S..|S..|S..|..|",
"|...|...|...|...|...|..|",
"|..b|h.b|..b|..b|..b|..|",
"|z.b|z.b|..b|..b|..b|..|",
"|h..|h..|h..|h.z|h.z|.x|",
"-ggg|ggg|g!g|ggg|ggg-L-|"
],
"palettes": [ "lab_palette" ],
"terrain": {
"g": "t_wall_glass_h",
"G": "t_door_glass_c"
"monster": {
"z": { "monster": "mon_zombie" }
},
"mapping": {
"b": { "items": [ { "item": "bed", "chance": 66 } ] },
"!": { "item": [ { "item": "glass_shard", "count": [3,6] } ] }
}
}
},
{
"//": "Cross floorplan which fills a quadrant with rocks when a side is empty, and possibly adds vaults.",
"//": "South of cells where the player starts during a lab escape. Should include a monster who can break glass",
"type": "mapgen",
"method": "json",
"om_terrain": [ "lab_escape_entrance" ],
"weight": 200,
"weight": 100,
"object": {
"fill_ter": "t_thconc_floor",
"rows": [
"|......................|",
".......................|",
"hh..|---?---|---?---|..|",
"tt..| | |..|",
"hh..| | |..|",
"x.....................Z|",
"----|-------|-------|++|",
"....| | |..|",
"....? | +..|",
"hh..| | |..|",
"tt..| | |..|",
"hh..? | +..|",
"....| | |..|",
"hh..| | |..|",
"tt..| | |..|",
Expand All @@ -74,18 +77,124 @@
" |..| |",
"-----------MM----------|"
],
"palettes": [ "lab_palette" ],
"palettes": [ "lab_palette", "lab_loot_research" ],
"terrain": {
"?": [ "t_concrete_wall", "t_concrete_wall", "t_door_glass_frosted_c" ],
"g": "t_wall_glass_h"
"?": [ "t_concrete_wall", "t_concrete_wall", "t_door_glass_frosted_c" ]
},
"monster": {
"Z": { "monster": "mon_zombie_brute" }
},
"place_nested": [
{ "chunks": [ "lab_spawn_7x7_crossdoors" ], "x": 5, "y": 3 },
{ "chunks": [ "lab_spawn_7x7_wall_sw" ], "x": 4, "y": 3 },
{ "chunks": [ "lab_spawn_7x7_crossdoors" ], "x": 13, "y": 3 },
{ "chunks": [ "lab_spawn_9x9" ], "x": [ 0, 1 ], "y": 14 },
{ "chunks": [ "lab_spawn_9x9_wall_nw" ], "x": 13, "y": 13 },
{ "chunks": [ "lab_border_walls_sew" ], "x": 0, "y": 0 },
{ "chunks": [ "sub_t_stairs_up" ], "x": 12, "y": 20, "neighbors": { "above": [ "lab_stairs" ] } }
{ "chunks": [ "sub_t_stairs_up" ], "x": [11, 12], "y": [20, 21], "neighbors": { "above": [ "lab_stairs" ] } }
]
}
},
{
"//": "South of cells where the player starts during a lab escape. Should include a monster who can break glass",
"type": "mapgen",
"method": "json",
"om_terrain": [ "lab_escape_entrance" ],
"weight": 100,
"object": {
"fill_ter": "t_thconc_floor",
"rows": [
"|......................|",
"xZ.....................|",
"--+--------------------|",
".......................|",
"hh.....................|",
"tt..-----------------..|",
"hh..| | |..|",
"....| | |..|",
"hh..| | |..|",
"tt..+ | +..|",
"hh..| | |..|",
"....| | |..M",
"....| | |..M",
"--+-------|--|--?----?-|",
" |TS| |",
" |..| |",
" |-W| |",
" |..| |",
" +..+ |",
" |..| |",
" |..| |",
" |..| |",
" |..| |",
"-----------MM----------|"
],
"palettes": [ "lab_palette", "lab_loot_research" ],
"terrain": {
"?": [ "t_concrete_wall", "t_concrete_wall", "t_door_glass_frosted_c" ]
},
"monster": {
"Z": { "monster": "mon_zombie_brute" }
},
"place_nested": [
{ "chunks": [ "lab_spawn_7x7_wall_nw" ], "x": 4, "y": 5 },
{ "chunks": [ "lab_spawn_7x7_crossdoors" ], "x": 13, "y": 6 },
{ "chunks": [ "lab_spawn_9x9" ], "x": [ 0, 1 ], "y": 14 },
{ "chunks": [ "lab_spawn_9x9" ], "x": 14, "y": 14 },
{ "chunks": [ "lab_border_walls_sew" ], "x": 0, "y": 0 },
{ "chunks": [ "sub_t_stairs_up" ], "x": [11, 12], "y": [20, 21], "neighbors": { "above": [ "lab_stairs" ] } }
]
}
},
{
"//": "Cross floorplan which fills a quadrant with rocks when a side is empty, and possibly adds vaults.",
"type": "mapgen",
"method": "json",
"om_terrain": [ "lab_escape_entrance" ],
"weight": 100,
"object": {
"fill_ter": "t_thconc_floor",
"rows": [
".......................|",
".......................|",
".d......-----..........|",
".dh.....ddxdd......|---|",
".d......d.h.d......|c.c|",
"..................l|c.c|",
"....Z.............l|c.c|",
"---+---|---?---|-----+-|",
" | | |",
" | | |",
" | | |",
" ? + M",
" | | M",
" | | |",
" | | |",
"---+---|---+---|---?---|",
" | | |",
" | | |",
" | | |",
" + + |",
" | | |",
" | | |",
" | | |",
"-----------MM----------|"
],
"palettes": [ "lab_palette", "lab_loot_research" ],
"terrain": {
"?": [ "t_concrete_wall", "t_concrete_wall", "t_door_glass_frosted_c" ]
},
"monster": {
"Z": { "monster": "mon_zombie_brute" }
},
"place_nested": [
{ "chunks": [ "lab_spawn_7x7" ], "x": 0, "y": 8 },
{ "chunks": [ "lab_spawn_7x7_crossdoors" ], "x": 0, "y": 16 },
{ "chunks": [ "lab_spawn_7x7_crossdoors" ], "x": 8, "y": 8 },
{ "chunks": [ "lab_spawn_7x7" ], "x": 8, "y": 16 },
{ "chunks": [ "lab_spawn_7x7" ], "x": 16, "y": 8 },
{ "chunks": [ "lab_spawn_7x7_wall_nw" ], "x": 15, "y": 15 },
{ "chunks": [ "lab_border_walls_sew" ], "x": 0, "y": 0 },
{ "chunks": [ "sub_t_stairs_up" ], "x": 21, "y": 4, "neighbors": { "above": [ "lab_stairs" ] } }
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion data/json/professions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@
"type": "profession",
"ident": "mutant_patient",
"name": "Unwilling Mutant",
"description": "During the panic of the Cataclysm, one of the lab technicians (feeling remorse for their part in the experiments forced on you and your genetic makeup) set you free.",
"description": "You were a human guinea pig, used by laboratory technicians to understand the immense power of mutation.",
"points": -1,
"items": { "both": [ "subsuit_xl" ], "male": [ "briefs" ], "female": [ "bra", "panties" ] },
"flags": [ "SCEN_ONLY" ]
Expand Down
2 changes: 1 addition & 1 deletion data/json/scenarios/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"ident": "lab_chal",
"name": "Challenge-Lab",
"points": -8,
"description": "You've been locked in a lab with no (obvious) way out! Find a way to escape or starve to death.",
"description": "You were locked in a lab cell until some kind of monster broke the glass. The lab is in lockdown! Find a way to escape.",
"start_name": "Locked Lab",
"professions": [ "unemployed", "mutant_patient", "mutant_volunteer", "labtech", "broken_cyborg" ],
"allowed_locs": [ "lab_escape_cells" ],
Expand Down
4 changes: 2 additions & 2 deletions src/overmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2805,8 +2805,8 @@ bool overmap::build_lab( int x, int y, int z, int s, std::vector<point> *lab_tra
}
}

// 4+ story labs without train connections are candidates for lab escape spots.
if( prefix.empty() && z == -4 && train_odds == 0 ) {
// 4th story of labs is a candidate for lab escape, as long as there's no train or finale.
if( prefix.empty() && z == -4 && train_odds == 0 && numstairs > 0 ) {
int cellx = 0;
int celly = 0;
int tries = 0;
Expand Down
9 changes: 4 additions & 5 deletions src/start_location.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,9 @@ void start_location::place_player( player &u ) const
// Need the "real" map with it's inside/outside cache and the like.
map &m = g->m;
// Start us off somewhere in the center of the map
u.setx( SEEX * int( MAPSIZE / 2 ) + 5 );
u.sety( SEEY * int( MAPSIZE / 2 ) + 6 );
u.setx( SEEX * int( MAPSIZE / 2 ) );
u.sety( SEEY * int( MAPSIZE / 2 ) );
u.setz( g->get_levz() );

m.build_map_cache( m.get_abs_sub().z );
const bool must_be_inside = flags().count( "ALLOW_OUTSIDE" ) == 0;
///\EFFECT_STR allows player to start behind less-bashable furniture and terrain
Expand Down Expand Up @@ -330,8 +329,8 @@ void start_location::place_player( player &u ) const
};

while( !found_good_spot && tries < 100 ) {
tripoint rand_point( ( SEEX * int( MAPSIZE / 2 ) ) + rng( 0, SEEX * 2 ),
( SEEY * int( MAPSIZE / 2 ) ) + rng( 0, SEEY * 2 ),
tripoint rand_point( ( SEEX * int( MAPSIZE / 2 ) ) + rng( 0, SEEX * 2 - 1 ),
( SEEY * int( MAPSIZE / 2 ) ) + rng( 0, SEEY * 2 - 1 ),
u.posz() );
check_spot( rand_point );
}
Expand Down

0 comments on commit c7486da

Please sign in to comment.