mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Changed implementation of StartGDialogFix, additionally fixed the game crash if calling start_gdialog function outside of talk_p_proc procedure for talking heads.
Fixed "Heave Ho!" perk increasing strength stat above 10 when determining the max range of thrown weapons. Moved SpecialUnarmedAttacksFix to BugFixes.cpp and simplified the code. Added comments to old ApplyHeaveHoFix in Perks.cpp. Backported some non-hook related script functions from 4.0: item_weight, get/set_outline, get/set_flags, tile_refresh_display, outlined_object, get/set_cursor_mode, display_stats, get/set_map_enter_position, attack_is_aimed.
This commit is contained in:
@@ -10,6 +10,12 @@
|
||||
#define OBJ_TYPE_MISC (5)
|
||||
#define OBJ_TYPE_SPATIAL (6)
|
||||
|
||||
#define WEAPON_TYPE_NONE (0)
|
||||
#define WEAPON_TYPE_UNARMED (1)
|
||||
#define WEAPON_TYPE_MELEE (2)
|
||||
#define WEAPON_TYPE_THROWN (3)
|
||||
#define WEAPON_TYPE_GUNS (4)
|
||||
|
||||
/* Item Common Flags */
|
||||
#define HIDDEN_ITEM 134217728 // 0x08000000 - Hidden Item
|
||||
|
||||
@@ -39,6 +45,32 @@
|
||||
#define ATKMODE_SEC_BURST 112 // 0x00000070
|
||||
#define ATKMODE_SEC_FLAME 128 // 0x00000080
|
||||
|
||||
/* Object flags for get/set_flags */
|
||||
#define FLAG_MOUSE_3D (0x1)
|
||||
#define FLAG_WALKTHRU (0x4)
|
||||
#define FLAG_FLAT (0x8)
|
||||
#define FLAG_NOBLOCK (0x10)
|
||||
#define FLAG_LIGHTING (0x20)
|
||||
#define FLAG_TEMP (0x400)
|
||||
#define FLAG_MULTIHEX (0x800)
|
||||
#define FLAG_NOHIGHLIGHT (0x1000)
|
||||
#define FLAG_USED (0x2000)
|
||||
#define FLAG_TRANSRED (0x4000)
|
||||
#define FLAG_TRANSNONE (0x8000)
|
||||
#define FLAG_TRANSWALL (0x10000)
|
||||
#define FLAG_TRANSGLASS (0x20000)
|
||||
#define FLAG_TRANSSTEAM (0x40000)
|
||||
#define FLAG_TRANSENERGY (0x80000)
|
||||
#define FLAG_LEFT_HAND (0x1000000)
|
||||
#define FLAG_RIGHT_HAND (0x2000000)
|
||||
#define FLAG_WORN (0x4000000)
|
||||
#define FLAG_HIDDENITEM (0x8000000)
|
||||
#define FLAG_WALLTRANSEND (0x10000000)
|
||||
#define FLAG_LIGHTTHRU (0x20000000)
|
||||
#define FLAG_SEEN (0x40000000)
|
||||
#define FLAG_SHOOTTHRU (0x80000000)
|
||||
|
||||
|
||||
/* Critter Flags */
|
||||
#define CFLG_BARTER 2 // 0x00000002 - Barter (can trade with)
|
||||
#define CFLG_NOSTEAL 32 // 0x00000020 - Steal (cannot steal from)
|
||||
|
||||
@@ -158,6 +158,19 @@
|
||||
#define GAME_MSG_PRO_TILE (0x1004)
|
||||
#define GAME_MSG_PRO_MISC (0x1005)
|
||||
|
||||
#define OUTLINE_NONE (0)
|
||||
#define OUTLINE_RED_GLOW (0x01)
|
||||
#define OUTLINE_RED (0x02)
|
||||
#define OUTLINE_GREY (0x04)
|
||||
#define OUTLINE_GREEN_GLOW (0x08)
|
||||
#define OUTLINE_YELLOW (0x10)
|
||||
#define OUTLINE_DARK_YELLOW (0x20)
|
||||
#define OUTLINE_PURPLE (0x40)
|
||||
|
||||
#define CURSOR_MOVEMENT (0)
|
||||
#define CURSOR_COMMAND (1)
|
||||
#define CURSOR_TARGETING (2)
|
||||
|
||||
#define mstr_combat(x) (message_str_game(GAME_MSG_COMBAT, x))
|
||||
#define mstr_ai(x) (message_str_game(GAME_MSG_AI, x))
|
||||
#define mstr_scrname(x) (message_str_game(GAME_MSG_SCRNAME, x))
|
||||
@@ -189,15 +202,28 @@
|
||||
#define party_member_list_all party_member_list(1)
|
||||
|
||||
|
||||
#define create_win(winName, x, y, w, h) sfall_func5("create_win", winName, x, y, w, h)
|
||||
#define create_win_flag(winName, x, y, w, h, flag) sfall_func6("create_win", winName, x, y, w, h, flag)
|
||||
#define critter_inven_obj2(obj, type) sfall_func2("critter_inven_obj2", obj, type)
|
||||
#define exec_map_update_scripts sfall_func0("exec_map_update_scripts")
|
||||
#define floor2(value) sfall_func1("floor2", value)
|
||||
#define get_current_inven_size(obj) sfall_func1("get_current_inven_size", obj)
|
||||
#define intface_hide sfall_func0("intface_hide")
|
||||
#define intface_is_hidden sfall_func0("intface_is_hidden")
|
||||
#define intface_redraw sfall_func0("intface_redraw")
|
||||
#define intface_show sfall_func0("intface_show")
|
||||
#define set_ini_setting(setting, value) sfall_func2("set_ini_setting", setting, value)
|
||||
#define spatial_radius(obj) sfall_func1("spatial_radius", obj)
|
||||
#define attack_is_aimed sfall_func0("attack_is_aimed")
|
||||
#define create_win(winName, x, y, w, h) sfall_func5("create_win", winName, x, y, w, h)
|
||||
#define create_win_flag(winName, x, y, w, h, flag) sfall_func6("create_win", winName, x, y, w, h, flag)
|
||||
#define critter_inven_obj2(obj, type) sfall_func2("critter_inven_obj2", obj, type)
|
||||
#define display_stats sfall_func0("display_stats")
|
||||
#define exec_map_update_scripts sfall_func0("exec_map_update_scripts")
|
||||
#define floor2(value) sfall_func1("floor2", value)
|
||||
#define get_current_inven_size(obj) sfall_func1("get_current_inven_size", obj)
|
||||
#define get_cursor_mode sfall_func0("get_cursor_mode")
|
||||
#define get_flags(obj) sfall_func1("get_flags", obj)
|
||||
#define get_map_enter_position sfall_func0("get_map_enter_position")
|
||||
#define get_outline(obj) sfall_func1("get_outline", obj)
|
||||
#define intface_hide sfall_func0("intface_hide")
|
||||
#define intface_is_hidden sfall_func0("intface_is_hidden")
|
||||
#define intface_redraw sfall_func0("intface_redraw")
|
||||
#define intface_show sfall_func0("intface_show")
|
||||
#define item_weight(obj) sfall_func1("item_weight", obj)
|
||||
#define outlined_object sfall_func0("outlined_object")
|
||||
#define set_cursor_mode(mode) sfall_func1("set_cursor_mode", mode)
|
||||
#define set_flags(obj, flags) sfall_func2("set_flags", obj, flags)
|
||||
#define set_ini_setting(setting, value) sfall_func2("set_ini_setting", setting, value)
|
||||
#define set_map_enter_position(tile, elev, rot) sfall_func3("set_map_enter_position", tile, elev, rot)
|
||||
#define set_outline(obj, color) sfall_func2("set_outline", obj, color)
|
||||
#define spatial_radius(obj) sfall_func1("spatial_radius", obj)
|
||||
#define tile_refresh_display sfall_func0("tile_refresh_display")
|
||||
|
||||
@@ -385,6 +385,54 @@ Some utility/math functions are available:
|
||||
- works just like vanilla floor function, but returns correct integers for negative values
|
||||
- vanilla floor function works exactly the same as ceil for negative values, much like trunc in C/C++
|
||||
|
||||
> int sfall_func1("item_weight", object)
|
||||
- gets the current weight of an object
|
||||
|
||||
> int sfall_func1("get_outline", object)
|
||||
- gets the current outline color for an object
|
||||
|
||||
> void sfall_func2("set_outline", object, int color)
|
||||
- sets the outline color of an object
|
||||
- 0 means or any value above 0x00FFFFFF disables the outline
|
||||
- call "tile_refresh_display" after changing outline of objects to properly redraw the scene
|
||||
|
||||
> int sfall_func1("get_flags", object)
|
||||
- gets the current value of object flags (see define_extra.h for available flags)
|
||||
|
||||
> void sfall_func2("set_flags", object, int flags)
|
||||
- sets the current flags of an object
|
||||
- all flags are rewritten with given integer, so first get current flags with "get_flags" and use bwor/bwand to set/remove specific flag
|
||||
|
||||
> void sfall_func0("tile_refresh_display")
|
||||
- redraws the game scene (tiles, walls, objects, etc.)
|
||||
|
||||
> object sfall_func0("outlined_object")
|
||||
- returns an object that is currently highlighted by hovering the mouse above it
|
||||
|
||||
> int sfall_func0("get_cursor_mode")
|
||||
- returns the current cursor mode (0 - movement cursor, 1 - command cursor, 2 - targeting cursor)
|
||||
- mode 4 to 10 are Skilldex skills (yellow targeting cursor)
|
||||
|
||||
> void sfall_func1("set_cursor_mode", int mode)
|
||||
- sets the current cursor mode
|
||||
|
||||
> void sfall_func0("display_stats")
|
||||
- displays player stats in the inventory screen display window
|
||||
- works only in opened inventory
|
||||
|
||||
> array sfall_func0("get_map_enter_position")
|
||||
- returns an array of the player's position data (index 0 - tile, 1 - elevation, 2 - rotation) when entering the map through exit grids
|
||||
- if entering from the world map, the tile value will be -1
|
||||
- should be called in map_enter_p_proc procedure to get the correct position data
|
||||
|
||||
> void sfall_func3("set_map_enter_position", int tile, int elevation, int rotation)
|
||||
- overrides the player's entry position when entering the map through exit grids
|
||||
- setting the tile to 0 will put the player on the start hex (default tile and elevation) of the map
|
||||
- works only in map_enter_p_proc procedure
|
||||
|
||||
> int sfall_func0("attack_is_aimed")
|
||||
- returns 1 if the aimed attack mode is selected, 0 otherwise
|
||||
|
||||
> int sfall_func1("get_current_inven_size", object)
|
||||
- returns the current inventory size of the container or the critter
|
||||
|
||||
|
||||
Reference in New Issue
Block a user