Added "get_stat_max/min" script functions (#307)

Added updating player's stats on the char screen to "display_stats"
script function (#314)
This commit is contained in:
NovaRain
2020-06-29 11:57:36 +08:00
parent 1e6d2229dd
commit de01fdf065
9 changed files with 119 additions and 30 deletions
+9
View File
@@ -244,6 +244,11 @@
use_obj_on_obj(item, dude_obj); \
set_self(0)
// returns the corrected tile distance between two objects to the distance variable (return value >= 9996 is an error when getting the distance)
#define distance_objs(distance, obj1, obj2) distance := tile_distance_objs(obj1, obj2) - 1; \
if (get_flags(obj1) bwand FLAG_MULTIHEX) distance--; \
if (get_flags(obj2) bwand FLAG_MULTIHEX) distance--
// sfall_funcX macros
#define add_global_timer_event(time, fixedParam) sfall_func2("add_g_timer_event", time, fixedParam)
#define add_iface_tag sfall_func0("add_iface_tag")
@@ -269,6 +274,10 @@
#define get_metarule_table sfall_func0("get_metarule_table")
#define get_object_data(obj, offset) sfall_func2("get_object_data", obj, offset)
#define get_outline(obj) sfall_func1("get_outline", obj)
#define get_pc_stat_max(stat) sfall_func1("get_stat_max", stat)
#define get_pc_stat_min(stat) sfall_func1("get_stat_min", stat)
#define get_npc_stat_max(stat) sfall_func2("get_stat_max", stat, 1)
#define get_npc_stat_min(stat) sfall_func2("get_stat_mix", stat, 1)
#define get_sfall_arg_at(argNum) sfall_func1("get_sfall_arg_at", argNum)
#define get_text_width(text) sfall_func1("get_text_width", text)
#define hide_window(winName) sfall_func1("hide_window", winName)
+9 -2
View File
@@ -445,8 +445,8 @@ Some utility/math functions are available:
- sets the current cursor mode
> void sfall_func0("display_stats")
- displays player stats in the inventory screen display window
- works only in opened inventory
- updates player's stats in the inventory display window or on the character screen
- NOTE: works only when the interface window is opened
> int sfall_func1("lock_is_jammed", object)
- returns 1 if the lock (container or scenery) is currently jammed, 0 otherwise
@@ -636,6 +636,13 @@ optional arguments:
- flags: mode flags (see MSGBOX_* constants in define_extra.h). Pass -1 to skip setting the flags (default flags are NORMAL and YESNO)
- color1/2: the color index in Fallout palette. color1 sets the text color for the first line, and color2 for all subsequent lines of text (default color is 145)
> int sfall_func1("get_stat_min", stat)
> int sfall_func1("get_stat_max", stat)
> int sfall_func2("get_stat_min", stat, bool who)
> int sfall_func2("get_stat_max", stat, bool who)
- returns the maximum or minimum set value of the specified stat (see set_stat_max/min functions)
- who: 0 (false) or omitting the argument - returns the value of the player, 1 (true) - returns the value set for other critters
------------------------
------ MORE INFO -------
------------------------