diff --git a/src/character.h b/src/character.h index 065d2d112200b..ede86de70ba36 100644 --- a/src/character.h +++ b/src/character.h @@ -2689,6 +2689,8 @@ class Character : public Creature, public visitable time_duration get_consume_time( const item &it ); int weariness_level() const; + int weary_threshold() const; + int weariness() const; float activity_level() const; float exertion_adjusted_move_multiplier( float level = -1.0f ) const; void try_reduce_weariness( float exertion ); @@ -2754,8 +2756,6 @@ class Character : public Creature, public visitable int healthy_mod = 0; weariness_tracker weary; - int weary_threshold() const; - int weariness() const; // Our bmr at no activity level int base_bmr() const; diff --git a/tests/activity_scheduling_helper.cpp b/tests/activity_scheduling_helper.cpp index b8a1432f2f768..73d4d69a061e2 100644 --- a/tests/activity_scheduling_helper.cpp +++ b/tests/activity_scheduling_helper.cpp @@ -110,7 +110,10 @@ weariness_events do_activity( tasklist tasks ) tasks.advance( task.interval ); // If we're more weary than we were when we started, report it if( new_weariness != weariness_lvl ) { - activity_log.log( weariness_lvl, new_weariness, spent ); + int new_weary = guy.weariness(); + int new_thresh = guy.weary_threshold(); + activity_log.log( weariness_lvl, new_weariness, spent, + new_weary, new_thresh ); weariness_lvl = new_weariness; } } @@ -167,12 +170,15 @@ time_duration tasklist::duration() return ret; } -void weariness_events::log( const int old_level, const int new_level, const time_duration &when ) +void weariness_events::log( const int old_level, const int new_level, const time_duration &when, + const int new_weariness, const int new_threshold ) { weary_transition added; added.from = old_level; added.to = new_level; added.minutes = to_minutes( when ); + added.new_weariness = new_weariness; + added.new_threshold = new_threshold; transitions.insert( transitions.end(), added ); } @@ -196,8 +202,9 @@ std::string weariness_events::summarize() const { std::string buffer; for( const weary_transition &change : transitions ) { - buffer += string_format( "Transition: Weariness from %d to %d at %d minutes\n", change.from, - change.to, change.minutes ); + buffer += string_format( "Transition: Weariness lvl from %d to %d at %d min (W %d Th %d)\n", + change.from, change.to, change.minutes, + change.new_weariness, change.new_threshold ); } return buffer; } diff --git a/tests/activity_scheduling_helper.h b/tests/activity_scheduling_helper.h index 1da15ebd1041a..aebd348ab88d4 100644 --- a/tests/activity_scheduling_helper.h +++ b/tests/activity_scheduling_helper.h @@ -93,12 +93,15 @@ struct weariness_events { int minutes = 0; int from = 0; int to = 0; + int new_weariness = 0; + int new_threshold = 0; }; std::vector transitions; public: - void log( int old_level, int new_level, const time_duration &when ); + void log( int old_level, int new_level, const time_duration &when, + int new_weariness, int new_threshold ); // Return the first time a transition between `from` and `to` occurs, in minutes // if around = 0_seconds or equivalent, otherwise return the time closest to around