Skip to content

Commit

Permalink
edited in error
Browse files Browse the repository at this point in the history
  • Loading branch information
David Brown committed Sep 5, 2019
1 parent f6815e6 commit b0db1e7
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include "dependency_tree.h"
#include "editmap.h"
#include "enums.h"
#include "timed_event.h"
#include "faction.h"
#include "filesystem.h"
#include "game_constants.h"
Expand Down Expand Up @@ -103,11 +104,9 @@
#include "sdltiles.h"
#include "sounds.h"
#include "start_location.h"
#include "stats_tracker.h"
#include "string_formatter.h"
#include "string_input_popup.h"
#include "submap.h"
#include "timed_event.h"
#include "translations.h"
#include "trap.h"
#include "uistate.h"
Expand Down Expand Up @@ -280,7 +279,6 @@ game::game() :
{
player_was_sleeping = false;
reset_light_level();
events().subscribe( &*stats_tracker_ptr );
events().subscribe( &*kill_tracker_ptr );
events().subscribe( &*memorial_logger_ptr );
world_generator = std::make_unique<worldfactory>();
Expand Down Expand Up @@ -664,7 +662,6 @@ void game::setup()

SCT.vSCT.clear(); //Delete pending messages

stats().clear();
// reset kill counts
kill_tracker_ptr->clear();
// reset follower list
Expand Down Expand Up @@ -2787,7 +2784,7 @@ void game::reset_npc_dispositions()
npc_to_add->op_of_u.trust = 0;
npc_to_add->op_of_u.value = 0;
npc_to_add->op_of_u.owed = 0;
npc_to_add->set_fac( faction_id( "no_faction" ) );
npc_to_add->set_fac( faction_id( "wasteland_scavengers" ) );
npc_to_add->add_new_mission( mission::reserve_random( ORIGIN_ANY_NPC,
npc_to_add->global_omt_location(),
npc_to_add->getID() ) );
Expand Down Expand Up @@ -2859,11 +2856,6 @@ event_bus &game::events()
return *event_bus_ptr;
}

stats_tracker &game::stats()
{
return *stats_tracker_ptr;
}

memorial_logger &game::memorial()
{
return *memorial_logger_ptr;
Expand Down Expand Up @@ -3371,6 +3363,7 @@ void game::refresh_all()
for( int z = minz; z <= maxz; z++ ) {
m.reset_vehicle_cache( z );
}

draw();
catacurses::refresh();
}
Expand Down Expand Up @@ -9077,12 +9070,8 @@ bool game::walk_move( const tripoint &dest_loc )
add_msg( m_good, _( "You are hiding in the %s." ), m.name( dest_loc ) );
}

if( dest_loc != u.pos() ) {
mtype_id mount_type;
if( u.is_mounted() ) {
mount_type = u.mounted_creature->type->id;
}
g->events().send<event_type::avatar_moves>( mount_type );
if( dest_loc != u.pos() && !u.is_mounted() ) {
u.lifetime_stats.squares_walked++;
}

tripoint oldpos = u.pos();
Expand Down Expand Up @@ -9733,7 +9722,7 @@ void game::on_move_effects()
// TODO: Move this to a character method
if( !u.is_mounted() ) {
const item muscle( "muscle" );
if( one_in( 8 ) ) {// active power gen
if( u.lifetime_stats.squares_walked % 8 == 0 ) {
if( u.has_active_bionic( bionic_id( "bio_torsionratchet" ) ) ) {
u.charge_power( 1 );
}
Expand All @@ -9743,12 +9732,12 @@ void game::on_move_effects()
}
}
}
if( one_in( 160 ) ) {// passive power gen
if( u.lifetime_stats.squares_walked % 160 == 0 ) {
if( u.has_bionic( bionic_id( "bio_torsionratchet" ) ) ) {
u.charge_power( 1 );
}
for( const bionic_id &bid : u.get_bionic_fueled_with( muscle ) ) {
if( u.has_bionic( bid ) ) {
if( u.has_active_bionic( bid ) ) {
u.charge_power( muscle.fuel_energy() * bid->fuel_efficiency );
}
}
Expand Down

0 comments on commit b0db1e7

Please sign in to comment.