Edited description of CheckWeaponAmmoCost and HOOK_AMMOCOST

This commit is contained in:
NovaRain
2021-03-12 09:34:57 +08:00
parent 4d04cae5a6
commit 21ff9238a0
3 changed files with 17 additions and 15 deletions
+10 -7
View File
@@ -327,7 +327,7 @@ Runs when retrieving the damage rating of the player's used weapon. (Which may b
int arg0 - The default min damage
int arg1 - The default max damage
Item arg2 - The weapon used. (0 if unarmed)
Item arg2 - The weapon used (0 if unarmed)
Critter arg3 - The critter doing the attacking
int arg4 - The type of attack
int arg5 - non-zero if this is an attack using a melee weapon
@@ -343,13 +343,16 @@ Runs when calculating ammo cost for a weapon. Doesn't affect damage, only how mu
By default, weapon will shoot when at least 1 round is left, regardless of ammo cost calculations.
To add proper check for ammo before shooting and proper calculation of number of burst rounds (hook type 1 and 2 in arg4), set Misc.CheckWeaponAmmoCost=1 in ddraw.ini
Item arg0 - weapon
int arg1 - Number of bullets in burst (1 for single shots)
int arg2 - Ammo cost calculated by original function (this is basically 2 for Super Cattle Prod and Mega Power Fist)
int arg3 - Type of hook (0 - when subtracting ammo after single shot attack, 1 - when checking for "out of ammo" before attack, 2 - when calculating number of burst rounds, 3 - when subtracting ammo after burst attack)
Item arg0 - The weapon
int arg1 - Number of bullets in burst or 1 for single shots
int arg2 - The amount of ammo that will be consumed, calculated by the original ammo cost function (this is basically 2 for Super Cattle Prod and Mega Power Fist)
int arg3 - Type of hook:
0 - when subtracting ammo after single shot attack
1 - when checking for "out of ammo" before attack
2 - when calculating number of burst rounds
3 - when subtracting ammo after burst attack
int ret0 - new ammo cost value (set to 0 for unlimited ammo)
NOTE: for hook type 2, you should return the new cost value based on the original ammo cost instead of the number of bullets
int ret0 - The new amount of ammo to be consumed, or ammo cost of each round for hook type 2 (set to 0 for unlimited ammo)
-------------------------------------------