Skip to content

Commit

Permalink
Construction recipe for barred window with curtains (#36797)
Browse files Browse the repository at this point in the history
* Construction recipe for barred window with curtains

* lint

* add conditional for tear down

Add conditional handler for tearing down curtains from a barred window

* fix missing declaration

No shortcuts... download a compiler, learn c++, and finish what I started.
Game compiles, load save, no error, tear down curtain and they stayed down

* astyle

learn what astyle is and attempt application. minor fix, remove unneeded "."'s
  • Loading branch information
Kilvoctu authored and I-am-Erk committed Jan 8, 2020
1 parent 44b584e commit 0e87154
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 2 deletions.
11 changes: 11 additions & 0 deletions data/json/construction.json
Original file line number Diff line number Diff line change
Expand Up @@ -1988,6 +1988,17 @@
"pre_terrain": "t_window_alarm",
"post_terrain": "t_window_bars_alarm"
},
{
"type": "construction",
"description": "Install Bars Onto Window",
"category": "CONSTRUCT",
"required_skills": [ [ "fabrication", 2 ] ],
"time": "30 m",
"qualities": [ [ { "id": "SAW_W", "level": 1 } ], [ { "id": "HAMMER", "level": 2 } ] ],
"components": [ [ [ "nail", 4 ] ], [ [ "sheet", 2 ] ], [ [ "stick", 1 ] ], [ [ "string_36", 1 ] ] ],
"pre_terrain": "t_window_bars",
"post_terrain": "t_window_bars_curtains"
},
{
"type": "construction",
"description": "Build Large Metal Support",
Expand Down
59 changes: 59 additions & 0 deletions data/json/furniture_and_terrain/terrain-windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,65 @@
"items": [ { "item": "glass_shard", "count": [ 34, 50 ] } ]
}
},
{
"type": "terrain",
"id": "t_window_bars_curtains",
"name": "window with metal bars and curtains",
"description": "A barred window with fancy curtains that have been drawn shut, blocking sunlight and visibility. The curtains can only be opened on the inside. If you examined the curtains more closely, you could peek through the drapes or tear down everything.",
"symbol": "\"",
"looks_like": "t_curtains",
"color": "light_gray",
"move_cost": 0,
"coverage": 95,
"roof": "t_flat_roof",
"flags": [ "NOITEM", "OPENCLOSE_INSIDE", "BARRICADABLE_WINDOW_CURTAINS", "REDUCE_SCENT", "CONNECT_TO_WALL", "BLOCK_WIND" ],
"examine_action": "curtains",
"open": "t_window_bars_domestic",
"bash": {
"str_min": 3,
"str_max": 6,
"sound": "glass breaking!",
"sound_fail": "whack!",
"sound_vol": 16,
"sound_fail_vol": 10,
"ter_set": "t_window_bars",
"items": [
{ "item": "glass_shard", "count": [ 34, 50 ] },
{ "item": "sheet", "count": 2 },
{ "item": "stick", "count": 1 },
{ "item": "string_36", "count": 1 }
]
}
},
{
"type": "terrain",
"id": "t_window_bars_domestic",
"name": "window with metal bars and curtains",
"description": "A giant sheet of glass inserted into a window with thick security grilles, making it impossible to crawl through. Typically installed for high-value stores, or at least stores in bad neighborhoods. This one has been retrofitted with curtains.",
"symbol": "#",
"looks_like": "t_window_bars",
"color": "light_gray",
"move_cost": 0,
"roof": "t_flat_roof",
"flags": [ "TRANSPARENT", "NOITEM", "OPENCLOSE_INSIDE", "BARRICADABLE_WINDOW_CURTAINS", "REDUCE_SCENT", "CONNECT_TO_WALL" ],
"examine_action": "curtains",
"close": "t_window_bars_curtains",
"bash": {
"str_min": 3,
"str_max": 6,
"sound": "glass breaking!",
"sound_fail": "whack!",
"sound_vol": 16,
"sound_fail_vol": 10,
"ter_set": "t_window_bars",
"items": [
{ "item": "glass_shard", "count": [ 34, 50 ] },
{ "item": "sheet", "count": 2 },
{ "item": "stick", "count": 1 },
{ "item": "string_36", "count": 1 }
]
}
},
{
"type": "terrain",
"id": "t_window_stained_green",
Expand Down
2 changes: 2 additions & 0 deletions src/iexamine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3753,6 +3753,8 @@ void iexamine::curtains( player &p, const tripoint &examp )
g->m.ter_set( examp, t_window_no_curtains_open );
} else if( ter == t_window_domestic_taped ) {
g->m.ter_set( examp, t_window_no_curtains_taped );
} else if( ter == t_window_bars_domestic || ter == t_window_bars_curtains ) {
g->m.ter_set( examp, t_window_bars );
}

g->m.spawn_item( p.pos(), "nail", 1, 4, calendar::turn );
Expand Down
4 changes: 3 additions & 1 deletion src/mapdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ ter_id t_null,
t_door_glass_c, t_door_glass_o, t_door_glass_frosted_c, t_door_glass_frosted_o,
t_portcullis,
t_recycler, t_window, t_window_taped, t_window_domestic, t_window_domestic_taped, t_window_open,
t_curtains,
t_curtains, t_window_bars_curtains, t_window_bars_domestic,
t_window_alarm, t_window_alarm_taped, t_window_empty, t_window_frame, t_window_boarded,
t_window_boarded_noglass, t_window_reinforced, t_window_reinforced_noglass, t_window_enhanced,
t_window_enhanced_noglass, t_window_bars_alarm, t_window_bars,
Expand Down Expand Up @@ -712,8 +712,10 @@ void set_ter_ids()
t_window_taped = ter_id( "t_window_taped" );
t_window_domestic = ter_id( "t_window_domestic" );
t_window_domestic_taped = ter_id( "t_window_domestic_taped" );
t_window_bars_domestic = ter_id( "t_window_bars_domestic" );
t_window_open = ter_id( "t_window_open" );
t_curtains = ter_id( "t_curtains" );
t_window_bars_curtains = ter_id( "t_window_bars_curtains" );
t_window_alarm = ter_id( "t_window_alarm" );
t_window_alarm_taped = ter_id( "t_window_alarm_taped" );
t_window_empty = ter_id( "t_window_empty" );
Expand Down
2 changes: 1 addition & 1 deletion src/mapdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ extern ter_id t_null,
t_door_glass_c, t_door_glass_o, t_door_glass_frosted_c, t_door_glass_frosted_o,
t_portcullis,
t_recycler, t_window, t_window_taped, t_window_domestic, t_window_domestic_taped, t_window_open,
t_curtains,
t_curtains, t_window_bars_curtains, t_window_bars_domestic,
t_window_alarm, t_window_alarm_taped, t_window_empty, t_window_frame, t_window_boarded,
t_window_boarded_noglass, t_window_bars_alarm, t_window_bars,
t_window_stained_green, t_window_stained_red, t_window_stained_blue,
Expand Down

0 comments on commit 0e87154

Please sign in to comment.