I use a CustomInventory item in Aracnocide to give each player class a different weapon based on the class the player chose. There are state jumps if the player has a ceratin item and the such. HOWEVER, my real struggle is: even if full on ammo, the player can pickup those weapons infinitely, thus discarding the pickups.
Here's some example code:
Code: Select all
//==============================================================================
// Light Pistol
//==============================================================================
ACTOR ARWPSPC : CustomInventory replaces Pistol
{
+LOOKALLAROUND
Inventory.Icon "TNT1A0"
Inventory.PickupSound ""
Inventory.PickupMessage "Obtained Weapon [Light Pistol]"
States
{
Spawn:
TNT1 A 1 A_Look
Loop
See:
TNT1 A 0 A_JumpIfInTargetInventory("TrooperDummy",1,"SpawnTrooper")
TNT1 A 0 A_JumpIfInTargetInventory("RangerDummy",1,"SpawnRanger")
TNT1 A 0 A_JumpIfInTargetInventory("ReconDummy",1,"SpawnRecon")
TNT1 A 0 A_JumpIfInTargetInventory("ScientistDummy",1,"SpawnScientist")
Stop
SpawnTrooper:
TNT1 A 0 A_SetScale(0.20)
WACP A -1
Stop
SpawnRanger:
TNT1 A 0 A_SetScale(0.55)
WBCP A -1
Stop
SpawnRecon:
TNT1 A 0 A_SetScale(0.30)
WCCP A -1
Stop
SpawnScientist:
TNT1 A 0 A_SetScale(0.60)
WDCP A -1
Stop
Pickup:
NULL A 0 A_JumpIfInventory("TrooperDummy", 1, "Blake")
NULL A 0 A_JumpIfInventory("RangerDummy", 1, "Derrick")
NULL A 0 A_JumpIfInventory("ReconDummy", 1, "Marion")
NULL A 0 A_JumpIfInventory("ScientistDummy", 1, "Stella")
Blake:
NULL A 0 A_JumpIfInventory("ARTR1AC",1,"CL1PK")
NULL A 0 A_JumpIfInventory("ARTRWPC",1,"CL1PK")
NULL A 0 A_Print("= Beretta 92F =",5)
NULL A 0 A_PlaySound("ARPK/WPN/PK1")
NULL A 0 A_GiveInventory("ARCL1",15)
NULL A 0 A_GiveInventory("ARTRWPC",1)
Stop
Derrick:
NULL A 0 A_JumpIfInventory("ARRG1BC",1,"CL1PK")
NULL A 0 A_JumpIfInventory("ARRGWPC",1,"CL1PK")
NULL A 0 A_Print("= Browning Hi-Power =",5)
NULL A 0 A_PlaySound("ARPK/WPN/PK1")
NULL A 0 A_GiveInventory("ARCL1",15)
NULL A 0 A_GiveInventory("ARRGWPC",1)
Stop
Marion:
NULL A 0 A_JumpIfInventory("ARRC1CC",1,"CL1PK")
NULL A 0 A_JumpIfInventory("ARRCWPC",1,"CL1PK")
NULL A 0 A_Print("= Bottini BF-002 =",5)
NULL A 0 A_PlaySound("ARPK/WPN/PK1")
NULL A 0 A_GiveInventory("ARCL1",15)
NULL A 0 A_GiveInventory("ARRCWPC",1)
Stop
Stella:
NULL A 0 A_JumpIfInventory("ARSCWPC",1,"CL1PK")
NULL A 0 A_Print("= A&E SMART Pistol =",5)
NULL A 0 A_PlaySound("ARPK/WPN/PK1")
NULL A 0 A_GiveInventory("ARCL1",15)
NULL A 0 A_GiveInventory("ARSCWPC",1)
Stop
CL1PK:
NULL A 0 A_Print("= +15 Light Pistol Ammo =",5)
NULL A 0 A_PlaySound("ARPK/CL1/PK1")
NULL A 0 A_GiveInventory("ARCL1",15)
Stop
}
}
Thank you in advance for the attention!