@@ -103,6 +103,7 @@ game::game() :
init_missions (); // Set up mission templates (SEE missiondef.cpp)
init_construction (); // Set up constructables (SEE construction.cpp)
init_traits_mutations ();
init_vehicle_parts (); // Set up vehicle parts (SEE veh_typedef.cpp)
init_vehicles (); // Set up vehicles (SEE veh_typedef.cpp)
init_autosave (); // Set up autosave
init_diseases (); // Set up disease lookup table
@@ -5864,7 +5865,7 @@ void game::open()
int vpart;
vehicle *veh = m.veh_at (openx, openy, vpart);
if (veh && veh->part_flag (vpart, vpf_openable )) {
if (veh && veh->part_flag (vpart, " OPENABLE " )) {
if (veh->parts [vpart].open ) {
add_msg (_ (" That door is already open." ));
u.moves += 100 ;
@@ -5912,7 +5913,7 @@ void game::close()
if (mon_at (closex, closey) != -1 )
add_msg (_ (" There's a %s in the way!" ),
z[mon_at (closex, closey)].name ().c_str ());
else if (veh && veh->part_flag (vpart, vpf_openable ) &&
else if (veh && veh->part_flag (vpart, " OPENABLE " ) &&
veh->parts [vpart].open ) {
veh->parts [vpart].open = 0 ;
veh->insides_dirty = true ;
@@ -6125,7 +6126,7 @@ bool game::vehicle_near ()
bool game::pl_refill_vehicle (vehicle &veh, int part, bool test)
{
if (!veh.part_flag (part, vpf_fuel_tank ))
if (!veh.part_flag (part, " FUEL_TANK " ))
return false ;
item* it = NULL ;
item *p_itm = NULL ;
@@ -6413,7 +6414,7 @@ void game::control_vehicle()
std::string message = veh->use_controls ();
if (!message.empty ())
add_msg (message.c_str ());
} else if (veh && veh->part_with_feature (veh_part, vpf_controls ) >= 0
} else if (veh && veh->part_with_feature (veh_part, " CONTROLS " ) >= 0
&& u.in_vehicle ) {
u.controlling_vehicle = true ;
add_msg (_ (" You take control of the %s." ), veh->name .c_str ());
@@ -6426,7 +6427,7 @@ void game::control_vehicle()
add_msg (_ (" No vehicle there." ));
return ;
}
if (veh->part_with_feature (veh_part, vpf_controls ) < 0 ) {
if (veh->part_with_feature (veh_part, " CONTROLS " ) < 0 ) {
add_msg (_ (" No controls there." ));
return ;
}
@@ -6445,8 +6446,8 @@ void game::examine()
int veh_part = 0 ;
vehicle *veh = m.veh_at (examx, examy, veh_part);
if (veh) {
int vpcargo = veh->part_with_feature (veh_part, vpf_cargo , false );
int vpkitchen = veh->part_with_feature (veh_part, vpf_kitchen , true );
int vpcargo = veh->part_with_feature (veh_part, " CARGO " , false );
int vpkitchen = veh->part_with_feature (veh_part, " KITCHEN " , true );
if ((vpcargo >= 0 && veh->parts [vpcargo].items .size () > 0 ) || vpkitchen >= 0 )
pickup (examx, examy, 0 );
else if (u.in_vehicle )
@@ -6826,7 +6827,7 @@ void advanced_inv_update_area( advanced_inv_area &area, game *g ) {
int vp = 0 ;
area.veh = g->m .veh_at ( u.posx +area.offx ,u.posy +area.offy , vp );
if ( area.veh ) {
area.vstor = area.veh ->part_with_feature (vp, vpf_cargo , false );
area.vstor = area.veh ->part_with_feature (vp, " CARGO " , false );
}
if ( area.vstor >= 0 ) {
area.desc = area.veh ->name ;
@@ -8380,11 +8381,11 @@ void game::pickup(int posx, int posy, int min)
int k_part = 0 ;
vehicle *veh = m.veh_at (posx, posy, veh_part);
if (min != -1 && veh) {
k_part = veh->part_with_feature (veh_part, vpf_kitchen );
veh_part = veh->part_with_feature (veh_part, vpf_cargo , false );
k_part = veh->part_with_feature (veh_part, " KITCHEN " );
veh_part = veh->part_with_feature (veh_part, " CARGO " , false );
from_veh = veh && veh_part >= 0 &&
veh->parts [veh_part].items .size () > 0 &&
query_yn (_ (" Get items from %s?" ), veh->part_info (veh_part).name );
query_yn (_ (" Get items from %s?" ), veh->part_info (veh_part).name . c_str () );
if (!from_veh && k_part >= 0 ) {
if (veh->fuel_left (" water" )) {
@@ -9206,7 +9207,7 @@ void game::drop(char chInput)
bool to_veh = false ;
vehicle *veh = m.veh_at (u.posx , u.posy , veh_part);
if (veh) {
veh_part = veh->part_with_feature (veh_part, vpf_cargo );
veh_part = veh->part_with_feature (veh_part, " CARGO " );
to_veh = veh_part >= 0 ;
}
if (dropped.size () == 1 || same) {
@@ -9216,7 +9217,7 @@ void game::drop(char chInput)
dropped.size ()),
dropped[0 ].tname (this ).c_str (),
veh->name .c_str (),
veh->part_info (veh_part).name );
veh->part_info (veh_part).name . c_str () );
} else {
add_msg (ngettext (" You drop your %s." , " You drop your %ss." ,
dropped.size ()),
@@ -9225,7 +9226,7 @@ void game::drop(char chInput)
} else {
if (to_veh) {
add_msg (_ (" You put several items in the %s's %s." ),
veh->name .c_str (), veh->part_info (veh_part).name );
veh->name .c_str (), veh->part_info (veh_part).name . c_str () );
} else {
add_msg (_ (" You drop several items." ));
}
@@ -9259,7 +9260,7 @@ void game::drop_in_direction()
bool to_veh = false ;
vehicle *veh = m.veh_at (dirx, diry, veh_part);
if (veh) {
veh_part = veh->part_with_feature (veh_part, vpf_cargo );
veh_part = veh->part_with_feature (veh_part, " CARGO " );
to_veh = veh->type != veh_null && veh_part >= 0 ;
}
@@ -9294,7 +9295,7 @@ void game::drop_in_direction()
dropped.size ()),
dropped[0 ].tname (this ).c_str (),
veh->name .c_str (),
veh->part_info (veh_part).name );
veh->part_info (veh_part).name . c_str () );
} else if (can_move_there) {
add_msg (ngettext (" You drop your %s on the %s." ,
" You drop your %ss on the %s." , dropped.size ()),
@@ -9309,7 +9310,7 @@ void game::drop_in_direction()
} else {
if (to_veh) {
add_msg (_ (" You put several items in the %s's %s." ),
veh->name .c_str (), veh->part_info (veh_part).name );
veh->name .c_str (), veh->part_info (veh_part).name . c_str () );
} else if (can_move_there) {
add_msg (_ (" You drop several items on the %s." ),
m.name (dirx, diry).c_str ());
@@ -10207,7 +10208,7 @@ void game::pldrive(int x, int y) {
u.in_vehicle = false ;
return ;
}
int pctr = veh->part_with_feature (part, vpf_controls );
int pctr = veh->part_with_feature (part, " CONTROLS " );
if (pctr < 0 ) {
add_msg (_ (" You can't drive the vehicle from here. You need controls!" ));
return ;
@@ -10365,7 +10366,7 @@ void game::plmove(int dx, int dy)
}
bool veh_closed_door = false ;
if (veh1) {
dpart = veh1->part_with_feature (vpart1, vpf_openable );
dpart = veh1->part_with_feature (vpart1, " OPENABLE " );
veh_closed_door = dpart >= 0 && !veh1->parts [dpart].open ;
}
@@ -10378,7 +10379,7 @@ void game::plmove(int dx, int dy)
} else if (veh1 != veh0) {
add_msg (_ (" There is another vehicle in the way." ));
return ;
} else if (veh1->part_with_feature (vpart1, vpf_boardable ) < 0 ) {
} else if (veh1->part_with_feature (vpart1, " BOARDABLE " ) < 0 ) {
add_msg (_ (" That part of the vehicle is currently unsafe." ));
return ;
}
@@ -10459,7 +10460,7 @@ void game::plmove(int dx, int dy)
int gy = grabbed_vehicle->global_y ();
for ( int ep = 0 ; ep < grabbed_vehicle->external_parts .size (); ep++ ) {
const int p = grabbed_vehicle->external_parts [ ep ];
if ( grabbed_vehicle->part_flag ( p, vpf_wheel ) && one_in (2 ) )
if ( grabbed_vehicle->part_flag ( p, " WHEEL " ) && one_in (2 ) )
grabbed_vehicle->handle_trap ( gx + grabbed_vehicle->parts [p].precalc_dx [0 ] + dx,
gy + grabbed_vehicle->parts [p].precalc_dy [0 ] + dy, p );
}
@@ -10489,7 +10490,7 @@ void game::plmove(int dx, int dy)
( u.has_trait (" PARKOUR" ) && m.move_cost (x, y) > 4 ))
{
if (veh1 && m.move_cost (x,y) != 2 )
add_msg (_ (" Moving past this %s is slow!" ), veh1->part_info (vpart1).name );
add_msg (_ (" Moving past this %s is slow!" ), veh1->part_info (vpart1).name . c_str () );
else
add_msg (_ (" Moving past this %s is slow!" ), m.name (x, y).c_str ());
}
@@ -10562,7 +10563,7 @@ void game::plmove(int dx, int dy)
}
// If the new tile is a boardable part, board it
if (veh1 && veh1->part_with_feature (vpart1, vpf_boardable ) >= 0 )
if (veh1 && veh1->part_with_feature (vpart1, " BOARDABLE " ) >= 0 )
m.board_vehicle (this , u.posx , u.posy , &u);
if (m.tr_at (x, y) != tr_null) { // We stepped on a trap!
@@ -10631,7 +10632,7 @@ void game::plmove(int dx, int dy)
}
}
if (veh1 && veh1->part_with_feature (vpart1, vpf_controls ) >= 0
if (veh1 && veh1->part_with_feature (vpart1, " CONTROLS " ) >= 0
&& u.in_vehicle )
add_msg (_ (" There are vehicle controls here. %s to drive." ),
press_x (ACTION_CONTROL_VEHICLE).c_str () );
@@ -10672,7 +10673,7 @@ void game::plmove(int dx, int dy)
u.posx += (tunneldist + 1 ) * (x - u.posx ); // move us the number of tiles we tunneled in the x direction, plus 1 for the last tile
u.posy += (tunneldist + 1 ) * (y - u.posy ); // ditto for y
add_msg (_ (" You quantum tunnel through the %d-tile wide barrier!" ), tunneldist);
if (m.veh_at (u.posx , u.posy , vpart1) && m.veh_at (u.posx , u.posy , vpart1)->part_with_feature (vpart1, vpf_boardable ) >= 0 )
if (m.veh_at (u.posx , u.posy , vpart1) && m.veh_at (u.posx , u.posy , vpart1)->part_with_feature (vpart1, " BOARDABLE " ) >= 0 )
m.board_vehicle (this , u.posx , u.posy , &u);
}
else // or you couldn't tunnel due to lack of energy
@@ -10685,7 +10686,7 @@ void game::plmove(int dx, int dy)
veh1->insides_dirty = true ;
u.moves -= 100 ;
add_msg (_ (" You open the %s's %s." ), veh1->name .c_str (),
veh1->part_info (dpart).name );
veh1->part_info (dpart).name . c_str () );
} else if (m.has_flag (swimmable, x, y)) { // Dive into water!
// Requires confirmation if we were on dry land previously