Using D3athStalker's DoomIncarnate as a base:
Code: Select all
HandgunPickup : CustomInventory
{
...
States
{
Spawn:
HGNP A 1
Loop
Pickup:
TNT1 A 0 A_GiveInventory("Handgun", 1)
TNT1 A 0 A_GiveInventory("Handguncounter", 1)
TNT1 A 0 A_CheckFlag("TOSSED","HalfTheAmmo)
TNT1 A 0 A_GiveInventory("9mmBullets", 20)
Stop
HalfTheAmmo:
TNT1 A 0 A_GiveInventory("9mmBullets",10)
The way it is now, the console prints an error message upon pickup, because it checks the player for the flag, instead of the weapon or monster. I tried all AAPTR pointers, but had no luck. Can A_CheckFlag ("TOSSED") be used in any state other than the Spawn state in the first place? I also tried using A_JumpIf (Tossed == 1), which of course also didn't work. I searched the Wiki high and low but couldn't find anything of use, so I don't know if JumpIf can actually be used with flags. The documentation was a bit sparse so to say. Or do two different Handgun actors need to be defined, each with a different Weapon.AmmoGive property?
I wonder if there is any "best" or "official" way to handle such a case. I'm all out of ideas and would appreciate any help in leading me in the right direction :)
Thx in advance.