Added a new hook: HOOK_ADJUSTRADS

Fixed a crash bug in ScriptExtender.cpp from commit c736e39.
Some adjustments to the hook injection mechanism.
This commit is contained in:
NovaRain
2021-01-13 11:11:32 +08:00
parent 4535ec9e20
commit bde6b94855
10 changed files with 125 additions and 75 deletions
+4 -1
View File
@@ -806,7 +806,10 @@
#define bit_32 (0x80000000)
#define bit_ALL (0xFFFFFFFF)
#define ROLL_CRITICAL_FAILURE 0
#define ROLL_FAILURE 1
#define ROLL_SUCCESS 2
#define ROLL_CRITICAL_SUCCESS 3
//Misc commands
#define obj_get_rot(obj) (has_trait(TRAIT_OBJECT, obj, OBJECT_CUR_ROT))
+1
View File
@@ -70,6 +70,7 @@
#define HOOK_TARGETOBJECT (42)
#define HOOK_ENCOUNTER (43)
#define HOOK_ADJUSTPOISON (44)
#define HOOK_ADJUSTRADS (45)
//Valid arguments to list_begin
#define LIST_CRITTERS (0)
+11
View File
@@ -707,3 +707,14 @@ int arg2 - the damage value at the time of applying the poison effect
int ret0 - the new amount of poison being added/removed
int ret1 - the new damage value, only negative values are allowed (will only be valid at the time of taking damage from the poison)
-------------------------------------------
HOOK_ADJUSTRADS (hs_adjustrads.int)
Runs when a critter's radiation level is changed.
Critter arg0 - the critter (usually dude_obj)
int arg1 - the amount of radiation being added/removed
int ret0 - the new amount of radiation being added/removed