Added an additional '"Can't Use" flag to misc flags in item objects

* it makes the weapon object unusable in combat.

Updated gl_npcarmor script.
Edits to header files and hookscripts.md.
This commit is contained in:
NovaRain
2021-09-03 21:30:12 +08:00
parent edc2755ef6
commit 806cc765bb
9 changed files with 189 additions and 94 deletions
+14 -12
View File
@@ -87,7 +87,7 @@ The defines to use for the hookID are in **sfall.h**.
#### `HOOK_TOHIT (hs_tohit.int)`
Runs when Fallout is calculating the chances of an attack striking a target.
Runs when Fallout is calculating the chances of an attack striking a target.<br>
Runs after the hit chance is fully calculated normally, including applying the 95% cap.
```
@@ -125,8 +125,8 @@ Critter ret2 - Override the target of the attack
#### `HOOK_CALCAPCOST (hs_calcapcost.int)`
Runs whenever Fallout is calculating the AP cost of using the weapon (or unarmed attack). Doesn't run for using other item types or moving.
Note that the first time a game is loaded, this script doesn't run before the initial interface is drawn, so if the script effects the AP cost of whatever is in the player's hands at the time the wrong AP cost will be shown. It will be fixed the next time the interface is redrawn.
Runs whenever Fallout is calculating the AP cost of using the weapon (or unarmed attack). Doesn't run for using other item types or moving.<br>
Note that the first time a game is loaded, this script doesn't run before the initial interface is drawn, so if the script effects the AP cost of whatever is in the player's hands at the time the wrong AP cost will be shown. It will be fixed the next time the interface is redrawn.<br>
You can get the weapon object by checking item slot based on attack type (`ATKTYPE_LWEP1`, `ATKTYPE_LWEP2`, etc) and then calling `critter_inven_obj`.
```
@@ -144,6 +144,7 @@ int ret0 - The new AP cost
#### `HOOK_DEATHANIM1 (hs_deathanim1.int)`
Runs before Fallout tries to calculate the death animation. Lets you switch out which weapon Fallout sees.
Does not run for critters in the knockdown/out state.
```
@@ -160,8 +161,9 @@ int ret0 - The pid of an object to override the attacking weapon with
#### `HOOK_DEATHANIM2 (hs_deathanim2.int)`
Runs after Fallout has calculated the death animation. Lets you set your own custom frame id, so more powerful than `HOOK_DEATHANIM1`, but performs no validation.
Runs after Fallout has calculated the death animation. Lets you set your own custom frame id, so more powerful than `HOOK_DEATHANIM1`, but performs no validation.<br>
When using `critter_dmg` function, this script will also run. In that case weapon pid will be -1 and attacker will point to an object with `obj_art_fid == 0x20001F5`.
Does not run for critters in the knockdown/out state.
```
@@ -220,7 +222,7 @@ Critter arg0 - The critter that just died
#### `HOOK_FINDTARGET (hs_findtarget.int)`
Runs when the AI is trying to pick a target in combat. Fallout first chooses a list of 4 likely suspects, then normally sorts them in order of weakness/distance/etc depending on the AI caps of the attacker.
Runs when the AI is trying to pick a target in combat. Fallout first chooses a list of 4 likely suspects, then normally sorts them in order of weakness/distance/etc depending on the AI caps of the attacker.<br>
This hook replaces that sorting function, allowing you to sort the targets in some arbitrary way.
The return values can include critters that weren't in the list of possible targets, but the additional targets may still be discarded later on in the combat turn if they are out of the attackers perception or the chance of a successful hit is too low. The list of possible targets often includes duplicated entries, but this is fixed in sfall 4.2.3/3.8.23.
@@ -340,10 +342,10 @@ int ret0 - the new AP cost
-------------------------------------------
#### DEPRECATED HOOKS:
* `HOOK_HEXMOVEBLOCKING (hs_hexmoveblocking.int)`
* `HOOK_HEXAIBLOCKING (hs_hexaiblocking.int)`
* `HOOK_HEXSHOOTBLOCKING (hs_hexshootblocking.int)`
* `HOOK_HEXSIGHTBLOCKING (hs_hexsightblocking.int)`
##### `HOOK_HEXMOVEBLOCKING (hs_hexmoveblocking.int)`
##### `HOOK_HEXAIBLOCKING (hs_hexaiblocking.int)`
##### `HOOK_HEXSHOOTBLOCKING (hs_hexshootblocking.int)`
##### `HOOK_HEXSIGHTBLOCKING (hs_hexsightblocking.int)`
Run when checking to see if a hex blocks movement or shooting. (or ai-ing, presumably...)
@@ -501,7 +503,7 @@ int ret0 - overrides the returned result of the function:
#### `HOOK_INVENTORYMOVE (hs_inventorymove.int)`
Runs before moving items between inventory slots in dude interface. You can override the action.
Runs before moving items between inventory slots in dude interface. You can override the action.<br>
What you can NOT do with this hook:
- force moving items to inappropriate slots (like gun in armor slot)
@@ -531,7 +533,7 @@ int ret0 - Override setting (-1 - use engine handler, any other value - prev
#### `HOOK_INVENWIELD (hs_invenwield.int)`
Runs before causing a critter or the player to wield/unwield an armor or a weapon (except when using the inventory by PC).
Runs before causing a critter or the player to wield/unwield an armor or a weapon (except when using the inventory by PC).<br>
An example usage would be to change critter art depending on armor being used or to dynamically customize weapon animations.
__NOTE:__ When replacing a previously wielded armor or weapon, the unwielding hook will not be executed.
@@ -551,7 +553,7 @@ int ret0 - overrides hard-coded handler (-1 - use engine handler, any other
#### `HOOK_ADJUSTFID (hs_adjustfid.int)`
Runs after calculating character figure FID on the inventory screen, whenever the game decides that character appearance might change.
Runs after calculating character figure FID on the inventory screen, whenever the game decides that character appearance might change.<br>
Also happens on other screens, like barter.
__NOTE:__ FID has following format: `0x0ABBCDDD`, where: `A` - object type, `BB` - animation code (always 0 in this case), `C` - weapon code, `DDD` - FRM index in LST file.