Added a new hook: HOOK_ROLLCHECK

This commit is contained in:
NovaRain
2021-01-13 23:26:19 +08:00
parent bde6b94855
commit ef0bdf1e3b
7 changed files with 85 additions and 2 deletions
+1
View File
@@ -71,6 +71,7 @@
#define HOOK_ENCOUNTER (43)
#define HOOK_ADJUSTPOISON (44)
#define HOOK_ADJUSTRADS (45)
#define HOOK_ROLLCHECK (46)
//Valid arguments to list_begin
#define LIST_CRITTERS (0)
+23
View File
@@ -718,3 +718,26 @@ 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
-------------------------------------------
HOOK_ROLLCHECK (hs_rollcheck.int)
Runs when a game event performs a random roll to check the chance of success or failure.
int arg0 - event type:
1 - checks the chance of an attack hitting the target
2 - checks the chance of a bullet from a burst hitting the target (for burst attacks)
3 - checks the chance when using skills (not listed below)
4 - check the chance of using Repair skill
5 - check the chance of using Doctor skill
6 - check the chance of using Steal skill for the thief
7 - the second Steal skill chance check for the target to catch the thief, in which the target's failure is the thief's success result
int arg1 - the value of roll result (see ROLL_* constants), which is calculated as:
for ROLL_CRITICAL_SUCCESS: random(1, 100) <= (random_chance / 10) + bonus
for ROLL_CRITICAL_FAILURE: random(1, 100) <= -random_chance / 10
int arg2 - the chance value
int arg3 - the bonus value, used when checking critical success
int arg4 - random chance (calculated as: chance - random(1, 100)), where a negative value is a failure check (ROLL_FAILURE)
int ret0 - overrides the roll result