From 18c3cfd3c1b12198f56780bc510a8a97cb87523c Mon Sep 17 00:00:00 2001 From: Eric Pierce Date: Sat, 5 Feb 2022 13:20:10 -0700 Subject: [PATCH] Add u_var: activity_level --- doc/NPCs.md | 1 + src/condition.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/doc/NPCs.md b/doc/NPCs.md index 28f7ec8fa1c94..63c8a902b11a7 100644 --- a/doc/NPCs.md +++ b/doc/NPCs.md @@ -957,6 +957,7 @@ Example | Description `"u_val": "pkill"` | Current painkiller level. `"u_val": "rad"` | Current radiation level. `"u_val": "focus"` | Current focus level. +`"u_val": "activity_level"` | Current activity level index, from 0-5 `"u_val": "fatigue"` | Current fatigue level. `"u_val": "stamina"` | Current stamina level. `"u_val": "sleep_deprivation"` | Current sleep deprivation level. diff --git a/src/condition.cpp b/src/condition.cpp index 5dfe0510e885f..2292a9a77cfbd 100644 --- a/src/condition.cpp +++ b/src/condition.cpp @@ -1346,6 +1346,10 @@ std::function conditional_t::get_get_int( const JsonObject return [is_npc]( const T & d ) { return d.actor( is_npc )->focus_cur(); }; + } else if( checked_value == "activity_level" ) { + return [is_npc]( const T & d ) { + return d.actor( is_npc )->get_activity_level(); + }; } else if( checked_value == "fatigue" ) { return [is_npc]( const T & d ) { return d.actor( is_npc )->get_fatigue();