Skip to content
Permalink
Browse files

Merge pull request #19426 from mugling/eng5

Split engine load in to electrical and propulsion
  • Loading branch information...
Coolthulhu committed Dec 3, 2016
2 parents 4bb6f74 + 1eac4d5 commit 014111e6a3a6286061bd97301982d68a4757423b
@@ -179,6 +179,7 @@
"weight" : 80,
"ammo_type" : "plutonium",
"count" : 5,
"energy": 200,
"effects" : ["COOKOFF", "NEVER_MISFIRES"]
},
{
@@ -911,7 +911,7 @@
"damage_modifier": 10,
"folded_volume": 1,
"breaks_into": [ { "item": "glowiegrow" } ],
"flags": [ "REACTOR", "TOOL_NONE", "FOLDABLE", "ATOMIC_LIGHT" ]
"flags": [ "TOOL_NONE", "FOLDABLE", "ATOMIC_LIGHT" ]
},
{
"id": "gray_amalgam",
@@ -999,8 +999,7 @@
{ "item": "scrap", "count": [ 4, 12 ] },
{ "item": "steel_chunk", "count": [ 2, 5 ] },
{ "item": "plastic_chunk", "count": [ 2, 8 ] }
],
"flags": [ "REACTOR" ]
]
},
{
"id": "vgen2",
@@ -689,7 +689,7 @@ void player::process_bionic( int b )
continue;
}

wants_power_amt = veh->discharge_battery( wants_power_amt );
wants_power_amt = veh->discharge( wants_power_amt );
if( wants_power_amt == 0 ) {
charge_power( 1 );
break;
@@ -1524,7 +1524,6 @@ bool game::do_turn()

const bool in_bubble_z = m.has_zlevels() || sm_loc.z == get_levz();
for( auto &veh : sm->vehicles ) {
veh->power_parts();
veh->idle( in_bubble_z && m.inbounds(in_reality.x, in_reality.y) );
}
}
@@ -4681,7 +4681,7 @@ static void process_vehicle_items( vehicle *cur_veh, int part )
}
if( n.ammo_capacity() > n.ammo_remaining() ) {
constexpr int per_charge = 10;
const int missing = cur_veh->discharge_battery( per_charge, false );
const int missing = cur_veh->discharge( per_charge, false );
if( missing < per_charge &&
( missing == 0 || x_in_y( per_charge - missing, per_charge ) ) ) {
n.ammo_set( "battery", n.ammo_remaining() + 1 );
@@ -155,7 +155,7 @@ interact_results interact_with_vehicle( vehicle *veh, const tripoint &pos,
if( veh->fuel_left( "battery" ) < pseudo.ammo_required() ) {
return false;
}
auto qty = pseudo.ammo_capacity() - veh->discharge_battery( pseudo.ammo_capacity() );
auto qty = pseudo.ammo_capacity() - veh->discharge( pseudo.ammo_capacity() );
pseudo.ammo_set( "battery", qty );
g->u.invoke_item( &pseudo );
veh->charge_battery( pseudo.ammo_remaining() );
@@ -224,7 +224,7 @@ interact_results interact_with_vehicle( vehicle *veh, const tripoint &pos,
add_msg( m_good, _( "You purify the contents of the %1$s's %2$s" ),
veh->name.c_str(), tank.name().c_str() );

veh->discharge_battery( tank.ammo_remaining() * cost );
veh->discharge( tank.ammo_remaining() * cost );
tank.ammo_set( "water_clean", tank.ammo_remaining() );
}
}
@@ -224,7 +224,7 @@ turret_data::status turret_data::query() const
}

auto ups = part->base.get_gun_ups_drain() * part->base.gun_current_mode().qty;
if( ups > veh->fuel_left( fuel_type_battery ) ) {
if( ups > veh->fuel_left( fuel_type_battery, true, true ) ) {
return status::no_power;
}

@@ -452,12 +452,19 @@ void vpart_info::check()
if( !item::type_is_defined( part.item ) ) {
debugmsg( "vehicle part %s uses undefined item %s", part.id.c_str(), part.item.c_str() );
}
if( part.has_flag( "TURRET" ) && !item::find_type( part.item )->gun ) {

const itype *base = item::find_type( part.item );

if( part.has_flag( "TURRET" ) && !base->gun ) {
debugmsg( "vehicle part %s has the TURRET flag, but is not made from a gun item", part.id.c_str() );
}
if( part.has_flag( "ENGINE" ) && !item::find_type( part.item )->engine ) {
if( part.has_flag( "ENGINE" ) && !base->engine ) {
debugmsg( "vehicle part %s has the ENGINE flag but base item is not an engine", part.id.c_str() );
}
if( part.has_flag( "REACTOR" ) && !( base->tool && base->tool->ammo_id != NULL_ID ) ) {
debugmsg( "vehicle part %s has the REACTOR flag but base item is not tool with ammo", part.id.c_str() );
}

for( auto &q : part.qualities ) {
if( !q.first.is_valid() ) {
debugmsg( "vehicle part %s has undefined tool quality %s", part.id.c_str(), q.first.c_str() );

0 comments on commit 014111e

Please sign in to comment.
You can’t perform that action at this time.