Code: Select all
Actor RandomItem : Ammo 10000
{
Radius 64
Height 64
Inventory.PickupMessage "You got a Random Item!"
Inventory.PickupSound "ITEMBOX1"
Inventory.Amount 1
Inventory.MaxAmount 1
+MOVEWITHSECTOR
States
{
Spawn:
ITEM ABCDEFGHIJKLMNOP 4 Bright
Loop
Pickup:
TNT1 A 0
Stop
}
}
Actor Player : DoomPlayer
{
...
States
{
...
Stay:
...
TNT1 A 0 A_JumpifInventory("RandomItem",1,"GiveItem")
...
GiveItem:
TNT1 A 0 A_JumpifInventory("CheckItem",1,"Stay")
TNT1 A 0 A_GiveInventory("CheckItem",1)
TNT1 A 0 ACS_ExecuteAlways(602,0)
Goto Stay
Code: Select all
#library "HUDICONS"
#include "zcommon.acs"
Script 600 Enter
{
SetFont("ITMEMPTY");
HudMessage(s:"A"; HUDMSG_Plain, PlayerNumber(), 0 , 0.5, 0.1, 0);
}
Script 601 (Void)
{
SetFont("ITMEMPTY");
HudMessage(s:"A"; HUDMSG_Plain, PlayerNumber(), 0 , 0.5, 0.1, 0);
}
Script 602 (void)
{
int Check = Random(1,2);
if(Check == 1){
GiveInventory("GreenSkullAmmo",1);
SetFont("ITMGSKUL");
HudMessage(s:"A"; HUDMSG_Plain, PlayerNumber(), 0 , 0.5, 0.1, 0);
}
if(Check == 2){
GiveInventory("RedSkullAmmo",1);
SetFont("ITMRSKUL");
HudMessage(s:"A"; HUDMSG_Plain, PlayerNumber(), 0 , 0.5, 0.1, 0);
}
}
