mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Added a new hook: HOOK_ROLLCHECK
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user