A_ConsumeAmmo
From DoomWiki.org
A_ConsumeAmmo(amount) is a function that is part of the MBF21 specification. It is a generic weapon function that subtracts ammo from the currently selected ammo pool. It has one parameter, using the value in the "Args1" field as its argument to determine the amount of ammo that is to be removed. If the value is set to zero, the function will subtract the amount of ammo defined in the "ammopershot" field in the weapon's definition instead. Note that this function will not reduce the ammo pool to below zero; if the value of the argument passed to the function is negative, the specified amount will be added to the ammo pool rather than subtracted.
Example[edit]
The following is an example of how to set the A_ConsumeAmmo
code pointer in a DeHackEd file using BEX syntax:
Frame 1234 Args1 = 1234 [CODEPTR] FRAME 1234 = ConsumeAmmo
Or using DECOHack syntax:
state 1234 { TNT1 A 0 A_ConsumeAmmo(1234) goto 1235 }
External links[edit]
- A_ConsumeAmmo in the DSDA-Doom source code, hosted on GitHub.
- MBF21 specification, hosted on GitHub.