|
12 | 12 | #include "units.h"
|
13 | 13 | #include "vpart_position.h"
|
14 | 14 |
|
15 |
| -static const itype_id itype_backpack_giant( "backpack_giant" ); |
16 |
| -static const itype_id itype_rock_volume_test( "rock_volume_test" ); |
17 |
| - |
18 | 15 | static const trait_id trait_HUGE( "HUGE" );
|
19 | 16 | static const trait_id trait_LARGE( "LARGE" );
|
20 | 17 | static const trait_id trait_SMALL( "SMALL" );
|
21 | 18 | static const trait_id trait_SMALL2( "SMALL2" );
|
22 | 19 |
|
23 |
| -static const vproto_id vehicle_prototype_character_volume_test_car( "character_volume_test_car" ); |
24 |
| - |
25 | 20 | static units::volume your_volume_with_trait( trait_id new_trait )
|
26 | 21 | {
|
27 | 22 | clear_avatar();
|
@@ -60,61 +55,3 @@ TEST_CASE( "character_baseline_volumes", "[volume]" )
|
60 | 55 | REQUIRE( your_height_with_trait( trait_HUGE ) == 280 );
|
61 | 56 | CHECK( your_volume_with_trait( trait_HUGE ) == 156228_ml );
|
62 | 57 | }
|
63 |
| - |
64 |
| -TEST_CASE( "character_at_volume_will_be_cramped_in_vehicle", "[volume]" ) |
65 |
| -{ |
66 |
| - clear_avatar(); |
67 |
| - clear_map(); |
68 |
| - map &here = get_map(); |
69 |
| - Character &you = get_player_character(); |
70 |
| - REQUIRE( you.get_mutations().empty() ); |
71 |
| - |
72 |
| - tripoint_bub_ms test_pos {10, 10, 0 }; |
73 |
| - |
74 |
| - |
75 |
| - clear_vehicles(); // extra safety |
76 |
| - here.add_vehicle( vehicle_prototype_character_volume_test_car, test_pos, 0_degrees, 0, 0 ); |
77 |
| - you.setpos( here, test_pos ); |
78 |
| - const optional_vpart_position vp_there = here.veh_at( you.pos_bub( here ) ); |
79 |
| - REQUIRE( vp_there ); |
80 |
| - tripoint_abs_ms dest_loc = you.pos_abs(); |
81 |
| - |
82 |
| - // Empty aisle |
83 |
| - dest_loc = dest_loc + tripoint::north_west; |
84 |
| - CHECK( !you.will_be_cramped_in_vehicle_tile( here, dest_loc ) ); |
85 |
| - dest_loc = you.pos_abs(); //reset |
86 |
| - |
87 |
| - // Aisle with 10L rock, a tight fit but not impossible |
88 |
| - dest_loc = dest_loc + tripoint::north; |
89 |
| - CHECK( you.will_be_cramped_in_vehicle_tile( here, dest_loc ) ); |
90 |
| - dest_loc = you.pos_abs(); //reset |
91 |
| - |
92 |
| - // Empty aisle, but we've put on a backpack and a 10L rock in that backpack |
93 |
| - item backpack( itype_backpack_giant ); |
94 |
| - auto worn_success = you.wear_item( backpack ); |
95 |
| - CHECK( worn_success ); |
96 |
| - you.i_add( item( itype_rock_volume_test ) ); |
97 |
| - CHECK( 75_liter <= you.get_total_volume() ); |
98 |
| - CHECK( you.get_total_volume() <= 100_liter ); |
99 |
| - dest_loc = dest_loc + tripoint::north_west; |
100 |
| - CHECK( you.will_be_cramped_in_vehicle_tile( here, dest_loc ) ); |
101 |
| - dest_loc = you.pos_abs(); //reset |
102 |
| - |
103 |
| - // Try the cramped aisle with a rock again, but now we are tiny, so it is easy. |
104 |
| - CHECK( your_volume_with_trait( trait_SMALL2 ) == 23326_ml ); |
105 |
| - you.setpos( here, test_pos ); // set our position again, clear_avatar() moved us |
106 |
| - dest_loc = dest_loc + tripoint::north; |
107 |
| - CHECK( !you.will_be_cramped_in_vehicle_tile( here, dest_loc ) ); |
108 |
| - dest_loc = you.pos_abs(); //reset |
109 |
| - |
110 |
| - // Same aisle, but now we have HUGE GUTS. We will never fit. |
111 |
| - CHECK( your_volume_with_trait( trait_HUGE ) == 156228_ml ); |
112 |
| - you.setpos( here, test_pos ); // set our position again, clear_avatar() moved us |
113 |
| - dest_loc = dest_loc + tripoint::north; |
114 |
| - CHECK( you.will_be_cramped_in_vehicle_tile( here, dest_loc ) ); |
115 |
| - dest_loc = you.pos_abs(); //reset |
116 |
| - |
117 |
| - // And finally, check that our HUGE body won't fit even into an empty aisle. |
118 |
| - dest_loc = dest_loc + tripoint::north_west; |
119 |
| - CHECK( you.will_be_cramped_in_vehicle_tile( here, dest_loc ) ); |
120 |
| -} |
0 commit comments