From f9e9e6bebfc95734c0cebe1b800164f77cba347a Mon Sep 17 00:00:00 2001 From: Williham Totland Date: Wed, 16 Jan 2013 20:00:47 +0100 Subject: [PATCH 1/5] Vehicle beds. Using a seat, vehicle beds can now be constructed. As comfortable to sleep on as regular vehicle seats, but does not prompt the player to board the vehicle when walked upon. --- player.cpp | 3 ++- veh_type.h | 4 ++++ veh_typedef.cpp | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/player.cpp b/player.cpp index 00bf8df8aa5e1..f271e103afa22 100644 --- a/player.cpp +++ b/player.cpp @@ -4533,7 +4533,8 @@ void player::try_to_sleep(game *g) vehicle *veh = g->m.veh_at (posx, posy, vpart); if (g->m.ter(posx, posy) == t_bed || g->m.ter(posx, posy) == t_makeshift_bed || g->m.tr_at(posx, posy) == tr_cot || g->m.tr_at(posx, posy) == tr_rollmat || - veh && veh->part_with_feature (vpart, vpf_seat) >= 0) + veh && veh->part_with_feature (vpart, vpf_seat) >= 0 || + veh && veh->part_with_feature (vpart, vpf_bed) >= 0) g->add_msg("This is a comfortable place to sleep."); else if (g->m.ter(posx, posy) != t_floor) g->add_msg("It's %shard to get to sleep on this %s.", diff --git a/veh_type.h b/veh_type.h index d7869c88e5976..8ddf35ef27f00 100644 --- a/veh_type.h +++ b/veh_type.h @@ -14,6 +14,7 @@ enum vpart_id // external parts vp_seat, + vp_bed, vp_frame_h, vp_frame_v, vp_frame_c, @@ -97,6 +98,7 @@ enum vpart_flags vpf_roof, // is a roof (cover) vpf_wheel, // this part touches ground (trigger traps) vpf_seat, // is seat + vpf_bed, // is bed (like seat, but can't be boarded) vpf_engine, // is engine vpf_fuel_tank, // is fuel tank vpf_cargo, // is cargo @@ -148,6 +150,8 @@ const vpart_info vpart_list[num_vparts] = 0 }, { "seat", '#', c_red, '*', c_red, 60, 300, 0, 0, itm_seat, 1, mfb(vpf_over) | mfb(vpf_seat) | mfb(vpf_no_reinforce) }, + { "bed", '#', c_magenta, '*', c_magenta, 60, 300, 0, 0, itm_seat, 1, + mfb(vpf_over) | mfb(vpf_bed) | mfb(vpf_no_reinforce) }, { "frame", 'h', c_ltgray, '#', c_ltgray, 100, 400, 0, 0, itm_frame, 1, mfb(vpf_external) | mfb(vpf_mount_point) | mfb (vpf_mount_inner) }, { "frame", 'j', c_ltgray, '#', c_ltgray, 100, 400, 0, 0, itm_frame, 1, diff --git a/veh_typedef.cpp b/veh_typedef.cpp index 1ebf38ac9b4ce..5cd851922246e 100644 --- a/veh_typedef.cpp +++ b/veh_typedef.cpp @@ -247,7 +247,7 @@ void game::init_vehicles() PART (0, 0, vp_cargo_box); PART (0, 0, vp_roof); PART (0, 1, vp_frame_v2); - PART (0, 1, vp_seat); + PART (0, 1, vp_bed); PART (0, 1, vp_roof); PART (0, -1, vp_frame_v2); PART (0, -1, vp_cargo_box); @@ -255,7 +255,7 @@ void game::init_vehicles() PART (0, 2, vp_board_v); PART (0, 2, vp_fuel_tank_gas); PART (0, -2, vp_frame_v2); - PART (0, -2, vp_seat); + PART (0, -2, vp_bed); PART (0, -2, vp_roof); PART (0, -3, vp_board_v); PART (0, -3, vp_fuel_tank_gas); From dda68881ec3d2c4515fb18a737361be85a30098e Mon Sep 17 00:00:00 2001 From: Williham Totland Date: Thu, 17 Jan 2013 18:19:16 +0100 Subject: [PATCH 2/5] Made opaque vehicle doors actually opaque. --- veh_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/veh_type.h b/veh_type.h index 8ddf35ef27f00..4a21eece757c7 100644 --- a/veh_type.h +++ b/veh_type.h @@ -191,7 +191,7 @@ const vpart_info vpart_list[num_vparts] = { "door", '+', c_cyan, '&', c_cyan, 80, 200, 0, 0, itm_frame, 2, mfb(vpf_external) | mfb(vpf_obstacle) | mfb(vpf_openable) }, { "opaque door",'+', c_cyan, '&', c_cyan, 80, 200, 0, 0, itm_frame, 2, - mfb(vpf_external) | mfb(vpf_obstacle) | mfb(vpf_openable) }, + mfb(vpf_external) | mfb(vpf_obstacle) | mfb(vpf_opaque) | mfb(vpf_openable) }, { "windshield", '"', c_ltcyan, '0', c_ltgray, 70, 50, 0, 0, itm_glass_sheet, 1, mfb(vpf_over) | mfb(vpf_obstacle) | mfb(vpf_no_reinforce) }, { "blade", '-', c_white, 'x', c_white, 250, 100, 0, 0, itm_carblade, 2, From 5f515e596f8a11bc9c1563d46f4ac551ecf8d8a4 Mon Sep 17 00:00:00 2001 From: Williham Totland Date: Thu, 17 Jan 2013 20:54:57 +0100 Subject: [PATCH 3/5] Fixed a minor visual glitch with the semi-truck. --- veh_typedef.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/veh_typedef.cpp b/veh_typedef.cpp index 5cd851922246e..59c5197444bb3 100644 --- a/veh_typedef.cpp +++ b/veh_typedef.cpp @@ -273,7 +273,7 @@ void game::init_vehicles() PART (-1, 1, vp_board_h); PART (-1, -1, vp_board_h); PART (-1, -2, vp_board_h); - PART (-1, 2, vp_board_b); + PART (-1, 2, vp_board_n); PART (-1, -3, vp_board_b); PART (2, -1, vp_frame_h); From 0983210445640e8128d9e910689ca476cbae9b70 Mon Sep 17 00:00:00 2001 From: Williham Totland Date: Thu, 17 Jan 2013 20:55:11 +0100 Subject: [PATCH 4/5] Added internal doors for vehicles. Same materials as a standard door, but: Is roofed, cannot be reinforced, weaker, opaque. Mostly exists for the benefit of the sleeper cab in the Semi-truck. --- veh_type.h | 3 +++ veh_typedef.cpp | 2 +- vehicle.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/veh_type.h b/veh_type.h index 4a21eece757c7..299ace8b3785b 100644 --- a/veh_type.h +++ b/veh_type.h @@ -35,6 +35,7 @@ enum vpart_id vp_roof, vp_door, vp_door_o, + vp_door_i, vp_window, vp_blade_h, vp_blade_v, @@ -192,6 +193,8 @@ const vpart_info vpart_list[num_vparts] = mfb(vpf_external) | mfb(vpf_obstacle) | mfb(vpf_openable) }, { "opaque door",'+', c_cyan, '&', c_cyan, 80, 200, 0, 0, itm_frame, 2, mfb(vpf_external) | mfb(vpf_obstacle) | mfb(vpf_opaque) | mfb(vpf_openable) }, + { "internal door", '+', c_cyan, '&', c_cyan, 75, 75, 0, 0, itm_frame, 2, + mfb(vpf_external) | mfb(vpf_obstacle) | mfb(vpf_opaque) | mfb(vpf_openable) | mfb(vpf_roof) | mfb(vpf_no_reinforce) }, { "windshield", '"', c_ltcyan, '0', c_ltgray, 70, 50, 0, 0, itm_glass_sheet, 1, mfb(vpf_over) | mfb(vpf_obstacle) | mfb(vpf_no_reinforce) }, { "blade", '-', c_white, 'x', c_white, 250, 100, 0, 0, itm_carblade, 2, diff --git a/veh_typedef.cpp b/veh_typedef.cpp index 59c5197444bb3..958c689728240 100644 --- a/veh_typedef.cpp +++ b/veh_typedef.cpp @@ -260,7 +260,7 @@ void game::init_vehicles() PART (0, -3, vp_board_v); PART (0, -3, vp_fuel_tank_gas); - PART (1, 0, vp_door_o); + PART (1, 0, vp_door_i); PART (1, -1, vp_board_h); PART (1, 1, vp_board_h); PART (1, -2, vp_board_h); diff --git a/vehicle.cpp b/vehicle.cpp index c65fb4acfa436..e88a3b872955e 100644 --- a/vehicle.cpp +++ b/vehicle.cpp @@ -1575,7 +1575,7 @@ void vehicle::refresh_insides () else if (part_flag(pn, vpf_obstacle)) { // found an obstacle, like board or windshield or door - if (part_flag(pn, vpf_openable) && parts[pn].open) + if (parts[pn].inside || part_flag(pn, vpf_openable) && parts[pn].open) continue; // door and it's open -- can't cover cover = true; break; From 2e4e06bd20cc8667d3a1e8f531094a15c07cdf35 Mon Sep 17 00:00:00 2001 From: Williham Totland Date: Sat, 19 Jan 2013 19:29:44 +0100 Subject: [PATCH 5/5] Removed +x flag on source files. @TheDarklingWolf Take care not to set these, will ya? ;) --- crafting.cpp | 0 crafting.h | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 crafting.cpp mode change 100755 => 100644 crafting.h diff --git a/crafting.cpp b/crafting.cpp old mode 100755 new mode 100644 diff --git a/crafting.h b/crafting.h old mode 100755 new mode 100644