Skip to content

Commit

Permalink
Tapeable windows, even when it would be redundant to do so
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDarklingWolf committed Feb 25, 2013
1 parent 4ea120c commit 6a33c12
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 16 deletions.
29 changes: 25 additions & 4 deletions construction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,12 @@ void game::init_construction()
COMP(itm_nail, 8, NULL);
COMP(itm_2x4, 10, NULL);
COMP(itm_sheet, 1, NULL);


CONSTRUCT("Tape up window", 0, &construct::able_window,
&construct::done_tape);
STAGE(t_null, 2);
COMP(itm_duct_tape, 50, NULL);

CONSTRUCT("Deconstruct Furniture", 0, &construct::able_deconstruct,
&construct::done_deconstruct);
STAGE(t_null, 20);
Expand Down Expand Up @@ -687,7 +692,7 @@ bool construct::able_empty_window(game *g, point p)

bool construct::able_window_pane(game *g, point p)
{
return (g->m.ter(p.x, p.y) == t_window || g->m.ter(p.x, p.y) == t_window_domestic);
return (g->m.ter(p.x, p.y) == t_window || g->m.ter(p.x, p.y) == t_window_domestic || g->m.ter(p.x, p.y) == t_window_alarm);
}

bool construct::able_broken_window(game *g, point p)
Expand Down Expand Up @@ -794,7 +799,6 @@ void construct::done_tree(game *g, point p)
{
mvprintz(0, 0, c_red, "Press a direction for the tree to fall in:");
int x = 0, y = 0;
do
do
get_direction(g, x, y, input());
while (x == -2 || y == -2);
Expand Down Expand Up @@ -824,7 +828,24 @@ void construct::done_vehicle(game *g, point p)
}
veh->name = name;
veh->install_part (0, 0, vp_frame_v2);
}
}

void construct::done_tape(game *g, point p)
{
g->add_msg("You tape up the %s.", g->m.tername(p.x, p.y).c_str());
switch (g->m.ter(p.x, p.y))
{
case t_window_alarm:
g->m.ter(p.x, p.y) = t_window_alarm_taped;

case t_window_domestic:
g->m.ter(p.x, p.y) = t_window_domestic_taped;

case t_window:
g->m.ter(p.x, p.y) = t_window_taped;
}

}

void construct::done_deconstruct(game *g, point p)
{
Expand Down
3 changes: 2 additions & 1 deletion construction.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ struct construct // Construction functions.
void done_vehicle(game *, point);
void done_tree(game *, point);
void done_log(game *, point);
void done_furniture(game *, point);
void done_furniture(game *, point);
void done_tape(game *, point);
void done_deconstruct(game *, point);

};
7 changes: 5 additions & 2 deletions map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,8 @@ case t_wall_log:
break;

case t_window_domestic:
case t_curtains:
case t_curtains:
case t_window_domestic_taped:
result = rng(0, 6);
if (res) *res = result;
if (str >= result) {
Expand All @@ -1225,7 +1226,9 @@ case t_wall_log:
break;

case t_window:
case t_window_alarm:
case t_window_alarm:
case t_window_alarm_taped:
case t_window_taped:
result = rng(0, 6);
if (res) *res = result;
if (str >= result) {
Expand Down
22 changes: 13 additions & 9 deletions mapdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ t_door_metal_c, t_door_metal_o, t_door_metal_locked,
t_door_glass_c, t_door_glass_o,
t_bulletin,
t_portcullis,
t_recycler, t_window, t_window_domestic, t_window_open, t_curtains,
t_window_alarm, t_window_empty, t_window_frame, t_window_boarded,
t_recycler, t_window, t_window_taped, t_window_domestic, t_window_domestic_taped, t_window_open, t_curtains,
t_window_alarm, t_window_alarm_taped, t_window_empty, t_window_frame, t_window_boarded,
t_rock, t_fault,
t_paper,
// Tree
Expand Down Expand Up @@ -323,19 +323,23 @@ const ter_t terlist[num_terrain_types] = { // MUST match enum ter_id above!
mfb(transparent)},
{"window", '"', c_ltcyan, 0, tr_null,
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(noitem)|
mfb(supports_roof)|mfb(deconstruct)},
mfb(supports_roof)|mfb(deconstruct)}, // Plain Ol' window
{"taped window", '"', c_dkgray, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)}, // Regular window
{"window", '"', c_ltcyan, 0, tr_null,
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(noitem)|
mfb(supports_roof)|mfb(deconstruct)}, //has curtains
{"open window", '\'', c_ltcyan, 4, tr_null,
mfb(transparent)|mfb(flammable)|mfb(noitem)|
mfb(supports_roof)},
mfb(transparent)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)},
{"closed curtains", '"', c_dkgray, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)|
mfb(supports_roof)},
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)},
{"taped window", '"', c_dkgray, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)}, // Curtain window
{"window", '"', c_ltcyan, 0, tr_null, // Actually alarmed
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(alarmed)|mfb(noitem)|
mfb(supports_roof)},
mfb(supports_roof)},
{"taped window", '"', c_dkgray, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)|mfb(alarmed)}, //Alarmed, duh.
{"empty window", '0', c_yellow, 8, tr_null,
mfb(transparent)|mfb(flammable)|mfb(supports_roof)},
{"window frame", '0', c_ltcyan, 8, tr_null,
Expand All @@ -354,7 +358,7 @@ const ter_t terlist[num_terrain_types] = { // MUST match enum ter_id above!
{"young tree", '1', c_green, 4, tr_null,
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)},
{"apple tree", '7', c_ltgreen, 0, tr_null,
mfb(flammable2)|mfb(noitem)|mfb(supports_roof)},
mfb(flammable2)|mfb(noitem)|mfb(supports_roof)},
{"underbrush", '#', c_ltgreen, 6, tr_null,
mfb(transparent)|mfb(bashable)|mfb(diggable)|mfb(container)|
mfb(flammable2)|mfb(thin_obstacle)|mfb(place_item)},
Expand Down

0 comments on commit 6a33c12

Please sign in to comment.