Skip to content

Commit

Permalink
Map extra, Mongroups
Browse files Browse the repository at this point in the history
  • Loading branch information
Venera3 committed Jul 18, 2022
1 parent 38b0f54 commit bd24e54
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 60 deletions.
20 changes: 20 additions & 0 deletions data/json/field_type.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,26 @@
},
"display_field": true
},
{
"id": "fd_web_nostick",
"type": "field_type",
"looks_like": "fd_web",
"intensity_levels": [ { "name": "thin cobwebs", "sym": "}", "color": "white" }, { "name": "thin webs", "transparent": false } ],
"description_affix": "covered_in",
"decrease_intensity_on_contact": true,
"priority": 2,
"phase": "solid",
"display_items": true,
"bash": {
"str_min": 1,
"str_max": 3,
"sound_vol": 2,
"sound_fail_vol": 2,
"sound": "hsh!",
"msg_success": "You brush aside some webs."
},
"display_field": true
},
{
"id": "fd_slime",
"type": "field_type",
Expand Down
53 changes: 52 additions & 1 deletion data/json/mapgen/map_extras/spider.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"nested_mapgen_id": "spider_webs",
"object": { "mapgensize": [ 1, 1 ], "place_fields": [ { "field": "fd_web", "x": 0, "y": 0 } ] }
},
{
"type": "mapgen",
"method": "json",
"nested_mapgen_id": "spider_webs_nostick",
"object": { "mapgensize": [ 1, 1 ], "place_fields": [ { "field": "fd_web_nostick", "repeat": [ 0, 3 ], "x": 0, "y": 0 } ] }
},
{
"type": "mapgen",
"method": "json",
Expand Down Expand Up @@ -38,9 +44,54 @@
],
"terrain": { "X": "t_dirt" },
"furniture": { "X": "f_egg_sackws" },
"monster": { "X": { "monster": "mon_spider_web" } },
"monsters": { "X": { "monster": "GROUP_ZOMBIE_TEST", "chance": 1, "density": 1 } },
"nested": { " ": { "chunks": [ [ "spider_webs", 10 ], [ "null", 1 ] ] } },
"flags": [ "ERASE_ALL_BEFORE_PLACING_TERRAIN" ]
}
},
{
"type": "mapgen",
"method": "json",
"update_mapgen_id": "mx_basement_spider",
"object": {
"rows": [
" ",
" ! ",
" ! ",
" ",
" ! ",
" ",
" ! ",
" ",
" ! ! ",
" ",
" ",
" ! ",
" ",
" ! ",
" ",
" ! ",
" ! ",
" ",
" ",
" ! ",
" ",
" ",
" ! ! ",
" "
],
"set": [ { "point": "bash", "x": [ 3, 20 ], "y": [ 3, 20 ], "repeat": [ 5, 10 ] } ],
"monster": { "!": { "group": "GROUP_SPIDER_BASEMENT", "chance": 50, "pack_size": [ 1, 3 ] } },
"nested": {
" ": {
"chunks": [
[ "spider_webs_nostick", 1 ],
[ "wasp_gibs", 1 ],
[ "damaged_door_nested_no_junk", 3 ],
[ "destroyed_door_nested_no_junk", 3 ]
]
}
}
}
}
]
12 changes: 12 additions & 0 deletions data/json/mapgen/nested/aux_nested.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
]
}
},
{
"type": "mapgen",
"method": "json",
"nested_mapgen_id": "damaged_door_nested_no_junk",
"object": { "mapgensize": [ 1, 1 ], "place_ter_furn_transforms": [ { "transform": "damaged_door", "x": 0, "y": 0 } ] }
},
{
"type": "mapgen",
"method": "json",
Expand All @@ -51,6 +57,12 @@
]
}
},
{
"type": "mapgen",
"method": "json",
"nested_mapgen_id": "destroyed_door_nested_no_junk",
"object": { "mapgensize": [ 1, 1 ], "place_ter_furn_transforms": [ { "transform": "destroyed_door", "x": 0, "y": 0 } ] }
},
{
"type": "mapgen",
"method": "json",
Expand Down
22 changes: 18 additions & 4 deletions data/json/monstergroups/bugs.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,32 @@
"name": "GROUP_SPIDER",
"monsters": [ { "monster": "mon_spider_web_small", "cost_multiplier": 0 } ]
},
{
"type": "monstergroup",
"name": "GROUP_SPIDER_BASEMENT",
"default": "mon_spider_cellar_small",
"//": "`monster` ignores group-level pack size, so numbers are set in mapgen",
"monsters": [
{ "monster": "mon_spider_cellar_small", "weight": 300, "ends": "14 days" },
{ "monster": "mon_spider_cellar_giant", "weight": 220, "starts": "7 days", "ends": "28 days" },
{ "monster": "mon_spider_cellar_mom", "weight": 80, "starts": "7 days" },
{ "monster": "mon_spider_cellar_giant", "weight": 200, "starts": "28 days" },
{ "monster": "mon_spider_cellar_mega", "weight": 100, "cost_multiplier": 0, "starts": "28 days" }
]
},
{
"type": "monstergroup",
"name": "GROUP_SPIDER_CELLAR",
"default": "mon_spider_cellar_giant"
"default": "mon_spider_cellar_giant",
"monsters": [ { "monster": "mon_spider_cellar_giant", "weight": 5 } ]
},
{
"type": "monstergroup",
"name": "GROUP_SPIDER_CELLAR_GIANT",
"monsters": [
{ "monster": "mon_spider_cellar_giant", "cost_multiplier": 0, "weight": 5 },
{ "monster": "mon_spider_cellar_mom", "cost_multiplier": 0, "weight": 2 },
{ "monster": "mon_spider_cellar_mega", "cost_multiplier": 0, "weight": 3 }
{ "monster": "mon_spider_cellar_giant", "weight": 5 },
{ "monster": "mon_spider_cellar_mom", "weight": 2 },
{ "monster": "mon_spider_cellar_mega", "weight": 3 }
]
},
{
Expand Down
37 changes: 25 additions & 12 deletions data/json/monstergroups/misc.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"type": "monstergroup",
"name": "GROUP_SUBWAY",
"//": "Z-2 subways, some lost nether things but otherwise mostly normal mobs",
"default": "mon_spider_cellar_giant",
"default": "mon_spider_jumping_small",
"monsters": [
{ "monster": "mon_slug_small", "weight": 180, "ends": "180 hours" },
{ "monster": "mon_slug_giant", "weight": 180, "starts": "180 hours" },
Expand All @@ -102,15 +102,28 @@
"pack_size": [ 1, 2 ],
"starts": "180 hours"
},
{ "monster": "mon_spider_cellar_small", "weight": 300, "pack_size": [ 1, 3 ], "ends": "180 hours" },
{ "monster": "mon_spider_cellar_giant", "weight": 300, "pack_size": [ 1, 3 ], "starts": "180 hours" },
{ "monster": "mon_mutant_experimental", "weight": 50, "cost_multiplier": 2, "ends": "540 hours" },
{ "monster": "mon_spider_cellar_small", "weight": 300, "pack_size": [ 1, 3 ], "ends": "14 days" },
{ "group": "GROUP_SPIDER_CELLAR", "weight": 300, "pack_size": [ 2, 5 ], "starts": "14 days", "ends": "28 days" },
{
"group": "GROUP_SPIDER_CELLAR_GIANT",
"weight": 300,
"cost_multiplier": 0,
"pack_size": [ 2, 4 ],
"starts": "28 days"
},
{
"monster": "mon_mutant_experimental",
"weight": 50,
"cost_multiplier": 2,
"pack_size": [ 1, 3 ],
"starts": "540 hours"
"ends": "14 days"
},
{
"monster": "mon_mutant_experimental",
"weight": 50,
"cost_multiplier": 2,
"pack_size": [ 2, 5 ],
"starts": "14 days"
},
{ "monster": "mon_sludge_crawler", "weight": 50 },
{ "monster": "mon_unseen_hunter", "weight": 50, "cost_multiplier": 2, "starts": "42 hours" },
Expand Down Expand Up @@ -158,17 +171,17 @@
"//2": "1W 42, 1M 180, 1,5M 270, 2M 360, 3M 540, sum 930",
"monsters": [
{ "monster": "mon_kreck", "weight": 200 },
{ "monster": "mon_unseen_hunter", "weight": 200, "starts": "42 hours", "ends": "15 days" },
{ "monster": "mon_unseen_hunter", "weight": 200, "starts": "6 hours", "ends": "15 days" },
{ "monster": "mon_unseen_hunter", "weight": 200, "pack_size": [ 1, 2 ], "starts": "15 days" },
{ "monster": "mon_mutant_experimental", "weight": 200, "ends": "180 hours" },
{ "monster": "mon_mutant_experimental", "weight": 250, "pack_size": [ 1, 3 ], "ends": "7 days" },
{
"monster": "mon_mutant_experimental",
"weight": 200,
"pack_size": [ 1, 2 ],
"starts": "180 hours",
"ends": "15 days"
"weight": 250,
"pack_size": [ 2, 5 ],
"starts": "7 days",
"ends": "28 days"
},
{ "monster": "mon_mutant_experimental", "weight": 200, "pack_size": [ 2, 5 ], "starts": "15 days" },
{ "monster": "mon_mutant_experimental", "weight": 300, "pack_size": [ 3, 6 ], "starts": "28 days" },
{ "monster": "mon_mi_go", "weight": 100, "pack_size": [ 1, 4 ], "ends": "15 days" },
{ "monster": "mon_mi_go_scout", "weight": 100, "cost_multiplier": 2, "starts": "15 days" },
{
Expand Down
2 changes: 1 addition & 1 deletion data/json/monsters/insect_spider.json
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@
"melee_dice": 2,
"melee_dice_sides": 3,
"melee_damage": [ { "damage_type": "cut", "amount": 4 } ],
"special_attacks": [ [ "SUICIDE", 180 ] , [ "GRAB", 5 ] ],
"special_attacks": [ [ "SUICIDE", 180 ], [ "GRAB", 5 ] ],
"dodge": 7,
"bleed_rate": 0,
"death_function": { "corpse_type": "NO_CORPSE" },
Expand Down
6 changes: 3 additions & 3 deletions data/json/overmap/map_extras.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@
"type": "map_extra",
"name": { "str": "Spider Nest" },
"description": "Spider nest is here.",
"generator": { "generator_method": "map_extra_function", "generator_id": "mx_house_spider" },
"min_max_zlevel": [ -2, 0 ],
"generator": { "generator_method": "update_mapgen", "generator_id": "mx_basement_spider" },
"min_max_zlevel": [ -1, -1 ],
"sym": "S",
"color": "yellow",
"autonote": true
Expand All @@ -203,7 +203,7 @@
"name": { "str": "Wasp Nest" },
"description": "Wasp nest is here.",
"generator": { "generator_method": "map_extra_function", "generator_id": "mx_house_wasp" },
"min_max_zlevel": [ 0, 3 ],
"min_max_zlevel": [ 0, 10 ],
"sym": "W",
"color": "yellow",
"autonote": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
"mapgen_end": [ { "method": "builtin", "name": "subway_end" } ],
"mapgen_tee": [ { "method": "builtin", "name": "subway_tee" } ],
"mapgen_four_way": [ { "method": "builtin", "name": "subway_four_way" } ],
"spawns": { "group": "GROUP_SUBWAY_LAB", "population": [ 1, 4 ], "chance": 25 },
"spawns": { "group": "GROUP_SUBWAY_LAB", "population": [ 1, 3 ], "chance": 50 },
"flags": [ "LINEAR" ]
},
{
Expand Down
2 changes: 1 addition & 1 deletion data/json/regional_map_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@
"extras": {
"mx_bugout": 20,
"mx_house_spider": 40,
"mx_house_wasp": 60,
"mx_house_wasp": 30,
"mx_military": 5,
"mx_science": 12,
"mx_collegekids": 15,
Expand Down
37 changes: 0 additions & 37 deletions src/map_extras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,42 +354,6 @@ static bool mx_house_wasp( map &m, const tripoint &loc )
return true;
}

static bool mx_house_spider( map &m, const tripoint &loc )
{
auto spider_type = mon_spider_widow_giant;
auto egg_type = f_egg_sackbw;
if( one_in( 2 ) ) {
spider_type = mon_spider_cellar_giant;
egg_type = f_egg_sackcs;
}
for( int i = 0; i < SEEX * 2; i++ ) {
for( int j = 0; j < SEEY * 2; j++ ) {
if( m.ter( point( i, j ) ) == t_floor ) {
if( one_in( 15 ) ) {
m.add_spawn( spider_type, rng( 1, 2 ), tripoint( i, j, loc.z ) );
for( int x = i - 1; x <= i + 1; x++ ) {
for( int y = j - 1; y <= j + 1; y++ ) {
if( m.ter( point( x, y ) ) == t_floor ) {
madd_field( &m, point( x, y ), fd_web, rng( 2, 3 ) );
if( one_in( 4 ) ) {
m.furn_set( point( i, j ), egg_type );
m.remove_field( {i, j, m.get_abs_sub().z()}, fd_web );
}
}
}
}
} else if( m.passable( point( i, j ) ) && one_in( 5 ) ) {
madd_field( &m, point( i, j ), fd_web, 1 );
}
}
}
}
m.place_items( Item_spawn_data_rare, 60, point_zero, point( SEEX * 2 - 1, SEEY * 2 - 1 ),
false, calendar::start_of_cataclysm );

return true;
}

static bool mx_helicopter( map &m, const tripoint &abs_sub )
{
point c( rng( 6, SEEX * 2 - 7 ), rng( 6, SEEY * 2 - 7 ) );
Expand Down Expand Up @@ -2752,7 +2716,6 @@ static FunctionMap builtin_functions = {
{ map_extra_mx_supplydrop, mx_supplydrop },
{ map_extra_mx_helicopter, mx_helicopter },
{ map_extra_mx_portal_in, mx_portal_in },
{ map_extra_mx_house_spider, mx_house_spider },
{ map_extra_mx_house_wasp, mx_house_wasp },
{ map_extra_mx_shia, mx_shia },
{ map_extra_mx_jabberwock, mx_jabberwock },
Expand Down

0 comments on commit bd24e54

Please sign in to comment.