mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
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:
@@ -272,6 +272,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_extra_msg_file(name) sfall_func1("add_extra_msg_file", name)
|
||||
#define add_global_timer_event(time, fixedParam) sfall_func2("add_g_timer_event", time, fixedParam)
|
||||
@@ -304,6 +309,10 @@
|
||||
#define get_object_ai_data(obj, aiParam) sfall_func2("get_object_ai_data", obj, aiParam)
|
||||
#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_string_pointer(text) sfall_func1("get_string_pointer", text)
|
||||
#define get_text_width(text) sfall_func1("get_text_width", text)
|
||||
|
||||
@@ -480,8 +480,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
|
||||
@@ -730,6 +730,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 -------
|
||||
------------------------
|
||||
|
||||
Reference in New Issue
Block a user