//***********************
//*START OF PICKUP ITEMS*
//***********************

eventloadactor DONUTS state setpickupflags enda
useractor notenemy DONUTS WEAK 

  setvar ACTORSHEIGHT 23 setvar ACTORSWIDTH 49
  state checkitemflags
  state checkitemflags2 // Checks Item Multiplications for Display Icon
  ifvare SKILLSET? 0
  {
   sizeat 40 40
   setvar SKILLSET? 1
  }

  ifvare mainmenu 0 state fallflags
  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
	ifpdistl RETRIEVEDISTANCE
      {
	 ifcount 6
       {
        ifvarvarl CURRENTHITPOINTS MAXHITPOINTS // If Player's Health Var is less than the Maximum Var
        {
	   ifcanseetarget
	   {
          state checkexplodeflag
          state medikitplayer
          ifvare oldskoolmode 0 qsprintf 152 265 TEMPHEALTH
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvarvar fta fta_normal setvar ftq 152
           ifvare CHARACTERSELECTED? 1 sound DUKE_TAKEPILLS
           sound DUKE_GET
          }
	    state activationflag killit
	   }
        }
       }
      }
     }
    }
   }
  }
  state breakobject
enda

eventloadactor DONUTS2 state setpickupflags enda
useractor notenemy DONUTS2 WEAK 

  setvar ACTORSHEIGHT 15 setvar ACTORSWIDTH 28
  state checkitemflags
  state checkitemflags2 // Checks Item Multiplications for Display Icon
  ifvare SKILLSET? 0
  {
   sizeat 40 40
   setvar SKILLSET? 1
  }
  ifvare mainmenu 0 state fallflags
  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
	ifpdistl RETRIEVEDISTANCE
      {
	 ifcount 6
       {
        ifvarvarl CURRENTHITPOINTS MAXHITPOINTS // If Player's Health Var is less than the Maximum Var
        {
	   ifcanseetarget
	   {
          state checkexplodeflag
          state medikitplayer
          ifvare oldskoolmode 0 qsprintf 153 266 TEMPHEALTH
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvarvar fta fta_normal setvar ftq 153
           ifvare CHARACTERSELECTED? 1 sound DUKE_TAKEPILLS
           sound DUKE_GET
          }
	    state activationflag killit
	   }
        }
       }
      }
     }
    }
   }
  }
  state breakobject
enda

action STEROIDSNORMAL 5370 // 5425 - 55 = 5370
action VITAMINX 5369 // 5424 - 55 = 5369

eventloadactor STEROIDS state setpickupflags action VITAMINX enda
actor STEROIDS

 setvar ACTORSHEIGHT 33 setvar ACTORSWIDTH 21
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarg ITEMDROPPEDTIME 0
 {
  ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
 }
 else
 {
  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifmove RESPAWN_ACTOR_FLAG state respawnit
   else
   {
    ifvare mainmenu 0
    {
     ifp pshrunk nullop
     else
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcount 6
       {
        ifpdistl RETRIEVEDISTANCE
        { 
         ifcanseetarget
         {
          // Steroids can only be grabbed and used by Characters [no vehicle checks needed]

          setvar TEMPVAR STEROID_AMOUNT
          state assesspickuprequirements
          ifvarvarl STEROIDSTIME TEMPVAR
          {
           state checkexplodeflag
  
           setvar ACTORPICKUPAMOUNT STEROID_AMOUNT
           state checkpickupamountflags
           setvarvar STEROIDSTIME ACTORPICKUPAMOUNT
           setplayer[THISACTOR].steroids_amount 400
  
           ifvarand ACTORFLAGS 2 nullop
           else
           {
            ifvare oldskoolmode 0 redefinequote 37 ^20VITAMIN X
            else redefinequote 37 ^20STEROIDS
            setvarvar fta fta_normal setvar ftq 37
           }
           ifspawnedby STEROIDS state getcode else state quikget
          }
          else
          {
           ifvarn oldskoolmode 1
           {
            state checkexplodeflag
            setvarvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags
            addvarvar VITAMINXS ACTORPICKUPAMOUNT
            ifvarand ACTORFLAGS 2 nullop
            else
            {
             ifvare ACTORPICKUPAMOUNT 1
             {
              redefinequote 836 ^14 STORED A BOTTLE OF VITAMIN X INTO INVENTORY!
             }
             else
             {
              redefinequote 836 ^14 STORED %ld BOTTLES OF VITAMIN X INTO INVENTORY!
              qsprintf 836 836 ACTORPICKUPAMOUNT
             }
             setvarvar fta fta_normal setvar ftq 836
            }
            globalsound FOUND_INVENTORY
            ifspawnedby STEROIDS state getcode else state quikget
           }
          }

         }
        }
       }
      }
     }
    }
   }
  }
 }
 ifvare oldskoolmode 0 action VITAMINX else action STEROIDSNORMAL
enda

state pickupcharacter_boots
          state checkexplodeflag

          addvarvar BOOTSTIME POWERUPBENEFIT

          setvar TEMPVAR BOOT_AMOUNT
          state assesspickuprequirements

          ifvarvarg BOOTSTIME TEMPVAR setvarvar BOOTSTIME TEMPVAR
          setplayer[THISACTOR].boot_amount BOOTSTIME
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvarvar fta fta_normal setvar ftq 6
          }
	    ifspawnedby BOOTS state getcode else state quikget
ends

state pickupvehicle_boots
          state checkexplodeflag

          addvarvar TEMPVAR5 POWERUPBENEFIT

          setvar TEMPVAR BOOT_AMOUNT
          state assesspickuprequirements
          ifvarvarg TEMPVAR5 TEMPVAR setvarvar TEMPVAR5 TEMPVAR
          setactorvar[tempvehicleid].ENEMYBOOTSAMOUNT TEMPVAR5
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           redefinequote 836 ^15GRABBED PROTECTIVE BOOTS FOR YOUR VEHICLE!
           setvarvar fta fta_normal setvar ftq 836
          }
	    ifspawnedby BOOTS state getcode else state quikget
ends

state pickupinventory_boots
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags
           addvarvar BOOTPAIRS ACTORPICKUPAMOUNT
           ifvarand ACTORFLAGS 2 nullop
           else
           {
            ifvare ACTORPICKUPAMOUNT 1
            {
             redefinequote 836 ^14 STORED A PAIR OF PROTECTIVE BOOTS INTO INVENTORY!
            }
            else
            {
             redefinequote 836 ^14 STORED %ld PAIRS OF PROTECTIVE BOOTS INTO INVENTORY!
             qsprintf 836 836 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           globalsound FOUND_INVENTORY
 	    ifspawnedby BOOTS state getcode else state quikget
          }
ends

eventloadactor BOOTS state setpickupflags enda
actor BOOTS

 setvar ACTORSHEIGHT 22 setvar ACTORSWIDTH 30
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare FLAGSSET? 0
 {
  ifvarl POWERUPBENEFIT 1 setvar POWERUPBENEFIT BOOT_AMOUNT
  setvarvar ACTORPICKUPAMOUNT POWERUPBENEFIT
  state checkpickupamountflags
  setvarvar POWERUPBENEFIT ACTORPICKUPAMOUNT
  setvar FLAGSSET? 1
 }
 state enemyfloorhurt // Boots will lose power in damage sectors
 ifvarl POWERUPBENEFIT 0
 {
  debris SCRAP1 1
  debris SCRAP2 1
  debris SCRAP3 1
  killit
 }

 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcount 6 
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcanseetarget
        {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          setvar TEMPVAR BOOT_AMOUNT
          state assesspickuprequirements
          ifvarvarl BOOTSTIME TEMPVAR state pickupcharacter_boots else state pickupinventory_boots
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           setvar TEMPVAR BOOT_AMOUNT
           state assesspickuprequirements
           ifvarvarl BOOTSTIME TEMPVAR state pickupcharacter_boots else state pickupinventory_boots
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           setvar TEMPVAR BOOT_AMOUNT
           state assesspickuprequirements
           getactorvar[tempvehicleid].ENEMYBOOTSAMOUNT TEMPVAR5
           ifvarvarl TEMPVAR5 TEMPVAR state pickupvehicle_boots else state pickupinventory_boots
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           setvar TEMPVAR BOOT_AMOUNT
           state assesspickuprequirements
           ifvarvarl BOOTSTIME TEMPVAR
           {
            state pickupcharacter_boots
           }
           else
           {
            setvar TEMPVAR BOOT_AMOUNT
            state assesspickuprequirements
            getactorvar[tempvehicleid].ENEMYBOOTSAMOUNT TEMPVAR5
            ifvarvarl TEMPVAR5 TEMPVAR state pickupvehicle_boots else state pickupinventory_boots
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Vehicle]
          {
           setvar TEMPVAR BOOT_AMOUNT
           state assesspickuprequirements
           getactorvar[tempvehicleid].ENEMYBOOTSAMOUNT TEMPVAR5
           ifvarvarl TEMPVAR5 TEMPVAR
           {
            state pickupvehicle_boots
           }
           else
           {
            setvar TEMPVAR BOOT_AMOUNT
            state assesspickuprequirements
            ifvarvarl BOOTSTIME TEMPVAR state pickupcharacter_boots else state pickupinventory_boots
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
    getactorvar[ITEMSEEK].ENEMYBOOTSAMOUNT ITEMSEEKB
    getactorvar[ITEMSEEK].ENEMYHP ENEMYSHEALTH
    ifvarg ENEMYSHEALTH 0 // -1
    {
     setvar TEMPVAR BOOT_AMOUNT
     state assesspickuprequirements
     ifvarvarl ITEMSEEKB TEMPVAR
     {
      state checkexplodeflag

      setvarvar ACTORPICKUPAMOUNT POWERUPBENEFIT
      state checkpickupamountflags
      setvarvar POWERUPBENEFIT ACTORPICKUPAMOUNT
      addvarvar ITEMSEEKC POWERUPBENEFIT

      setvar TEMPVAR BOOT_AMOUNT
      state assesspickuprequirements

      ifvarvarg ITEMSEEKC TEMPVAR setvarvar ITEMSEEKC TEMPVAR
      setactorvar[ITEMSEEK].ENEMYBOOTSAMOUNT ITEMSEEKC
      state resetitemtarget
      state getitemseekerspecies
      ifvarand ACTORFLAGS 4 nullop
      else
      {
       globalsound DUKE_GET
       ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT PROTECTIVE BOOTS!
       ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT PROTECTIVE BOOTS!             
      }
      state enemygrabitemflash
     }
    }
   }
  }

}
enda

eventloadactor HEATSENSOR state setpickupflags enda
actor HEATSENSOR

ifvare FLAGSSET? 0
{
 ifvare PUBLICBETA? 1
 {
  ifrnd 128
  {
   ifvare AMI? 1
   {
    ifvare HAVEMERCURYCOMPUTER? 0
    {
     ifrnd 32 
     { 
      getactorvar[THISACTOR].ACTORFLAGS TEMP2
      espawn MERCURYCOMPUTER
      setactorvar[RETURN].ACTORFLAGS TEMP2
      killit
     }
     else { setvar FLAGSSET? 1 }
    }
    else
    {
     setvar FLAGSSET? 1
    }
   }
   else
   {
    setvar FLAGSSET? 1
   }
  }
  else
  {
   ifvare LISA? 1
   {
    ifvare HAVEHACKERVISION? 0
    {
     setvar CHARACTERARRAY 8
     getactorvar[CHARACTERARRAY].CHARACTERGOGGLESTIME TEMPVAR
     ifvarg TEMPVAR 1
     {
      ifrnd 32 
      {
       getactorvar[THISACTOR].ACTORFLAGS TEMP2
       espawn HACKERVISION
       setactorvar[RETURN].ACTORFLAGS TEMP2
       killit
      }
      else { setvar FLAGSSET? 1 }
     }
     else
     {
      setvar FLAGSSET? 1
     }
    }
    else
    {
     setvar FLAGSSET? 1
    }
   }
   else
   {
    setvar FLAGSSET? 1
   }
  }
 }
 else
 {
  setvar FLAGSSET? 1
 }
}

 setvar ACTORSHEIGHT 18 setvar ACTORSWIDTH 33
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags

ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
  ifp pshrunk nullop
  else
  {
   ifvare mainmenu 0
   {
    ifvarg CURRENTHITPOINTS 0 // ifp palive
    {
     ifcount 6
     {
      ifpdistl RETRIEVEDISTANCE
      {
       ifvare CHARACTERSELECTED? 8
       {
        ifvare HAVEHACKERVISION? 0
        {
         ifcanseetarget
         {
          setvar TEMPVAR HEAT_AMOUNT
          state assesspickuprequirements
          ifvarvarl NIGHTVISIONTIME TEMPVAR state grabheatsensoritem else state grabheatsensorinventory
         }
        }
        else
        {
         ifcanseetarget state grabheatsensorinventory
        }
       }
       else
       ifvare CHARACTERSELECTED? 4
       {
        state grabheatsensorinventory
       }
       else
       {
        ifcanseetarget
        {
         setvar TEMPVAR HEAT_AMOUNT
         state assesspickuprequirements
         ifvarvarl NIGHTVISIONTIME TEMPVAR state grabheatsensoritem else state grabheatsensorinventory
        }
       }
      }
     }
    }
   }
  }
 }
 
}
enda

// SHIELD = 54

state pickupcharacter_shield
          state checkexplodeflag
	    ifvare ARMORISUSED? 1
	    {
           ifrnd 64 setvar RECEIVEDARMOR 875
           else ifrnd 85 setvar RECEIVEDARMOR 750
           else ifrnd 128 setvar RECEIVEDARMOR 500
           else setvar RECEIVEDARMOR 250
           setvarvar ACTORPICKUPAMOUNT RECEIVEDARMOR
           state checkpickupamountflags
           setvarvar RECEIVEDARMOR ACTORPICKUPAMOUNT

           mulvarvar RECEIVEDARMOR MAXARMORPOINTS
           divvar RECEIVEDARMOR 1000
           addvarvar CURRENTARMORPOINTS RECEIVEDARMOR
           ifvarvarg CURRENTARMORPOINTS MAXARMORPOINTS setvarvar CURRENTARMORPOINTS MAXARMORPOINTS

           ifrnd 128 ifvarl ARMORPERCENT 333 setvar ARMORPERCENT 333
           else ifvarl ARMORPERCENT 667 setvar ARMORPERCENT 667
           setvarvar ACTORPICKUPAMOUNT ARMORPERCENT
           state checkpickupamountflags
           setvarvar ARMORPERCENT ACTORPICKUPAMOUNT
           ifvarg ARMORPERCENT 999 setvar ARMORPERCENT 1000

           ifvarand ACTORFLAGS 2 nullop
           else
           {
            setvarvar fta fta_normal setvar ftq 104
            globalsound KICK_HIT
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            palfrom 24 0 32
            setvar PLAYERAPDAMAGED? -1          
           }
           killit
	    }
	    else
	    {
	     ifrnd 64 ifvarl ARMORPERCENT 333 setvar ARMORPERCENT 333
	     else ifrnd 85 ifvarl ARMORPERCENT 500 setvar ARMORPERCENT 500
	     else ifrnd 128 ifvarl ARMORPERCENT 750 setvar ARMORPERCENT 750
	     else ifvarl ARMORPERCENT 900 setvar ARMORPERCENT 900
           setvarvar ACTORPICKUPAMOUNT ARMORPERCENT
           state checkpickupamountflags
           setvarvar ARMORPERCENT ACTORPICKUPAMOUNT
           ifvarg ARMORPERCENT 999 setvar ARMORPERCENT 1000

           setvarvar RECEIVEDARMOR MAXARMORPOINTS
           setvarvar CURRENTARMORPOINTS RECEIVEDARMOR
           ifvarand ACTORFLAGS 2 nullop
           else
           {
            setvarvar fta fta_normal setvar ftq 38
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            setvar PLAYERAPDAMAGED? -1
           }
	    }
	    ifspawnedby SHIELD
	      state getcode
	    else
	      state quikget
ends

state pickupvehicle_shield
          getactorvar[tempvehicleid].ENEMYARMORPERCENT TEMPVAR3
          state checkexplodeflag
	    ifvare ARMORISUSED? 1
	    {
           ifrnd 64 setvar RECEIVEDARMOR 875
           else ifrnd 85 setvar RECEIVEDARMOR 750
           else ifrnd 128 setvar RECEIVEDARMOR 500
           else setvar RECEIVEDARMOR 250
           setvarvar ACTORPICKUPAMOUNT RECEIVEDARMOR
           state checkpickupamountflags
           setvarvar RECEIVEDARMOR ACTORPICKUPAMOUNT

           mulvarvar RECEIVEDARMOR TEMPVAR5
           divvar RECEIVEDARMOR 1000
           addvarvar CURRENTARMORPOINTS RECEIVEDARMOR
           ifvarvarg TEMPVAR4 TEMPVAR5 setvarvar TEMPVAR4 TEMPVAR5
           setactorvar[tempvehicleid].ENEMYAP TEMPVAR4
           setactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5

           ifrnd 128 ifvarl TEMPVAR3 333 setvar TEMPVAR3 333
           else ifvarl TEMPVAR3 667 setvar TEMPVAR3 667
           setvarvar ACTORPICKUPAMOUNT TEMPVAR3
           state checkpickupamountflags
           setvarvar TEMPVAR3 ACTORPICKUPAMOUNT
           ifvarg TEMPVAR3 999 setvar TEMPVAR3 1000
           setactorvar[tempvehicleid].ENEMYARMORPERCENT TEMPVAR3

           ifvarand ACTORFLAGS 2 nullop
           else
           {
            redefinequote 836 ^15GRABBED A USED SUIT OF BODY ARMOR FOR YOUR VEHICLE!
            setvarvar fta fta_normal setvar ftq 836
            sound KICK_HIT
            globalsound USE_ARMORITEM3
            palfrom 24 0 32
            setvar VEHICLEAPDAMAGED? -1
           }
           killit
	    }
	    else
	    {
	     ifrnd 64 ifvarl TEMPVAR3 333 setvar TEMPVAR3 333
	     else ifrnd 85 ifvarl TEMPVAR3 500 setvar TEMPVAR3 500
	     else ifrnd 128 ifvarl TEMPVAR3 750 setvar TEMPVAR3 750
	     else ifvarl TEMPVAR3 900 setvar TEMPVAR3 900
           setvarvar ACTORPICKUPAMOUNT TEMPVAR3
           state checkpickupamountflags
           setvarvar TEMPVAR3 ACTORPICKUPAMOUNT
           ifvarg TEMPVAR3 999 setvar TEMPVAR3 1000
           setactorvar[tempvehicleid].ENEMYARMORPERCENT TEMPVAR3

           setvarvar RECEIVEDARMOR TEMPVAR5
           setvarvar TEMPVAR4 RECEIVEDARMOR
           setactorvar[tempvehicleid].ENEMYAP TEMPVAR4
           setactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5

           ifvarand ACTORFLAGS 2 nullop
           else
           {
            globalsound USE_ARMORITEM3
            redefinequote 836 ^15GRABBED A SUIT OF BODY ARMOR FOR YOUR VEHICLE!
            setvarvar fta fta_normal setvar ftq 836
            setvar VEHICLEAPDAMAGED? -1
           }
	    }
	    ifspawnedby SHIELD
	      state getcode
	    else
	      state quikget
ends

state pickupinventory_shield
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags
           ifvare ARMORISUSED? 1 addvarvar USEDBODYARMORS ACTORPICKUPAMOUNT else addvarvar BODYARMORS ACTORPICKUPAMOUNT
           ifvarand ACTORFLAGS 2 nullop
           else
           {
            ifvare ACTORPICKUPAMOUNT 1
            {
             ifvare ARMORISUSED? 1 redefinequote 836 ^14 STORED A SUIT OF USED BODY ARMOR INTO INVENTORY!
             else redefinequote 836 ^14 STORED A SUIT OF BODY ARMOR INTO INVENTORY!
            }
            else
            {
             ifvare ARMORISUSED? 1 redefinequote 836 ^14 STORED %ld SUITS OF USED BODY ARMOR INTO INVENTORY!
             else redefinequote 836 ^14 STORED %ld SUITS OF BODY ARMOR INTO INVENTORY!
             qsprintf 836 836 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           globalsound FOUND_INVENTORY
           ifspawnedby SHIELD
 	      state getcode
           else 
            state quikget
          }
ends

action SHIELD-MALE 5330 // 5384 - 54 = 5330
action SHIELD-FEMALE 5329 // 5383 - 54 = 5329
action SHIELD-ESSENCE 5327 // 5381 - 54 = 5327
action SHIELD-CYBANIS 5328 // 5382 - 54 = 5328 
action SHIELD-MALE_USED 5479 // 5533 - 54 = 5479
action SHIELD-FEMALE_USED 5478 // 5532 - 54 = 5478
action SHIELD-ESSENCE_USED 5476 // 5530 - 54 = 5476
action SHIELD-CYBANIS_USED 5477 // 5531 - 54 = 5477 

eventloadactor SHIELD state setpickupflags enda
actor SHIELD
  
  ifspritepal 24 
  {
   getactorvar[THISACTOR].ACTORFLAGS TEMP2
   espawn SUPERSHIELD
   setactorvar[RETURN].ACTORFLAGS TEMP2
   killit 
  }

 ifaction SHIELD-MALE { setvar ACTORSHEIGHT 26 setvar ACTORSWIDTH 27 }
 ifaction SHIELD-MALE_USED { setvar ACTORSHEIGHT 26 setvar ACTORSWIDTH 27 }
 ifaction SHIELD-FEMALE { setvar ACTORSHEIGHT 22 setvar ACTORSWIDTH 22 }
 ifaction SHIELD-FEMALE_USED { setvar ACTORSHEIGHT 22 setvar ACTORSWIDTH 22 }
 ifaction SHIELD-ESSENCE { setvar ACTORSHEIGHT 45 setvar ACTORSWIDTH 56 }
 ifaction SHIELD-ESSENCE_USED { setvar ACTORSHEIGHT 45 setvar ACTORSWIDTH 56 }
 ifaction SHIELD-CYBANIS { setvar ACTORSHEIGHT 50 setvar ACTORSWIDTH 58 }
 ifaction SHIELD-CYBANIS_USED { setvar ACTORSHEIGHT 50 setvar ACTORSWIDTH 58 }
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcount 6
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcanseetarget
        {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTS state pickupcharacter_shield else state pickupinventory_shield
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTS state pickupcharacter_shield else state pickupinventory_shield
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
           ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_shield else state pickupinventory_shield
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTS // If Armor is less than max, grab and immediately wear
           {
            state pickupcharacter_shield
           }
           else
           {
            getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
            ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_shield else state pickupinventory_shield
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Vehicle]
          {
           getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
           ifvarvarl TEMPVAR4 TEMPVAR5 // If Armor is less than max, grab and immediately wear
           {
            state pickupvehicle_shield
           }
           else // If Armor is more than max, try to grab and store
           {
            ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTS state pickupcharacter_shield else state pickupinventory_shield
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
    state checkenemypickuphealth
    getactorvar[ITEMSEEK].ENEMYAP ITEMENEMYCURRENTAP
    getactorvar[ITEMSEEK].ENEMYMAXAP ITEMENEMYMAXAP

    ifvarg ITEMSEEKB 0 ifvarvarl ITEMENEMYCURRENTAP ITEMENEMYMAXAP
    {
     state checkexplodeflag
     setvarvar ITEMSEEKC ITEMENEMYMAXAP
     ifspawnedby PIGCOP
     {
      state monstershielddrop2
     }
     else
     ifspawnedby LIZMAN
     {
      state monstershielddrop2
     }
     else
     {
      ifrnd 64 ifvarl CURRENTENEMYARMORPERCENT 333 setvar CURRENTENEMYARMORPERCENT 333
      else ifrnd 85 ifvarl CURRENTENEMYARMORPERCENT 500 setvar CURRENTENEMYARMORPERCENT 500
      else ifrnd 128 ifvarl CURRENTENEMYARMORPERCENT 750 setvar CURRENTENEMYARMORPERCENT 750
      else ifvarl CURRENTENEMYARMORPERCENT 900 setvar CURRENTENEMYARMORPERCENT 900
      setvarvar ACTORPICKUPAMOUNT CURRENTENEMYARMORPERCENT
      state checkpickupamountflags
      setvarvar CURRENTENEMYARMORPERCENT ACTORPICKUPAMOUNT
      ifvarg CURRENTENEMYARMORPERCENT 999 setvar CURRENTENEMYARMORPERCENT 1000
      setactorvar[ITEMSEEK].ENEMYARMORPERCENT CURRENTENEMYARMORPERCENT
      state getitemseekerspecies
      ifvarand ACTORFLAGS 4 nullop
      else
      {
       ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT ARMOR!
       ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT ARMOR!
       globalsound DUKE_GET
       ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
       setactorvar[ITEMSEEK].ENEMYAPDAMAGED? -1
      }
     }
     addvarvar ITEMENEMYCURRENTAP ITEMSEEKC
     ifvarvarg ITEMSEEKC ITEMENEMYMAXAP setvarvar ITEMSEEKC ITEMENEMYMAXAP
     setactorvar[ITEMSEEK].ENEMYAP ITEMSEEKC
     state resetitemtarget
     state enemygrabitemflash
    }
   }
  }

}

 ifvare ARMORISUSED? 1
 {
  // Change Sprite based on the character in use
  ifvare ARMORAPPEARANCE? 0 action SHIELD-MALE_USED
  ifvare ARMORAPPEARANCE? 1 action SHIELD-FEMALE_USED
  ifvare ARMORAPPEARANCE? 2 action SHIELD-ESSENCE_USED
  ifvare ARMORAPPEARANCE? 3 action SHIELD-CYBANIS_USED
 }
 else
 {
  // Change Sprite based on the character in use
  ifvare ARMORAPPEARANCE? 0 action SHIELD-MALE
  ifvare ARMORAPPEARANCE? 1 action SHIELD-FEMALE
  ifvare ARMORAPPEARANCE? 2 action SHIELD-ESSENCE
  ifvare ARMORAPPEARANCE? 3 action SHIELD-CYBANIS
 }

enda

state pickupcharacter_airtank
          state checkexplodeflag
          addvarvar SCUBATIME POWERUPBENEFIT

          setvar TEMPVAR SCUBA_AMOUNT
          state assesspickuprequirements
          ifvarvarg SCUBATIME TEMPVAR setvarvar SCUBATIME TEMPVAR

          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvarvar fta fta_normal setvar ftq 39
          }
          ifspawnedby AIRTANK
           state getcode
          else
           state quikget
ends

state pickupvehicle_airtank
          state checkexplodeflag
          addvarvar TEMPVAR4 POWERUPBENEFIT

          setvar TEMPVAR SCUBA_AMOUNT
          state assesspickuprequirements
          ifvarvarg TEMPVAR4 TEMPVAR setvarvar TEMPVAR4 TEMPVAR

          setactorvar[tempvehicleid].ENEMYAIRTANKAMOUNT TEMPVAR4
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           redefinequote 836 ^15GRABBED A SUIT OF SCUBA GEAR FOR YOUR VEHICLE!
           setvarvar fta fta_normal setvar ftq 836
          }
          ifspawnedby AIRTANK
           state getcode
          else
           state quikget
ends

state pickupinventory_airtank
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags
           addvarvar SCUBATANKS ACTORPICKUPAMOUNT
           ifvarand ACTORFLAGS 2 nullop
           else
           {
            ifvare ACTORPICKUPAMOUNT 1
            {
             redefinequote 836 ^14 STORED A SUIT OF SCUBA GEAR INTO INVENTORY!
            }
            else
            {
             redefinequote 836 ^14 STORED %ld SUITS OF SCUBA GEAR INTO INVENTORY!
             qsprintf 836 836 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           globalsound FOUND_INVENTORY
           ifspawnedby AIRTANK
            state getcode
           else
 	      state quikget
          }
ends

eventloadactor AIRTANK state setpickupflags enda
actor AIRTANK

 ifvare FLAGSSET? 0
 {
  ifvarl POWERUPBENEFIT 1 setvar POWERUPBENEFIT SCUBA_AMOUNT
  setvarvar ACTORPICKUPAMOUNT POWERUPBENEFIT
  state checkpickupamountflags
  setvarvar POWERUPBENEFIT ACTORPICKUPAMOUNT
  setvar FLAGSSET? 1
 }

 setvar ACTORSHEIGHT 49 setvar ACTORSWIDTH 46
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags

ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcount 6
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcanseetarget
        {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          setvar TEMPVAR SCUBA_AMOUNT
          state assesspickuprequirements
          ifvarvarl SCUBATIME TEMPVAR state pickupcharacter_airtank else state pickupinventory_airtank
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           setvar TEMPVAR SCUBA_AMOUNT
           state assesspickuprequirements
           ifvarvarl SCUBATIME TEMPVAR state pickupcharacter_airtank else state pickupinventory_airtank
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           setvar TEMPVAR SCUBA_AMOUNT
           state assesspickuprequirements
           getactorvar[tempvehicleid].ENEMYAIRTANKAMOUNT TEMPVAR5
           ifvarvarl TEMPVAR5 TEMPVAR state pickupvehicle_airtank else state pickupinventory_airtank
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           setvar TEMPVAR SCUBA_AMOUNT
           state assesspickuprequirements
           ifvarvarl SCUBATIME TEMPVAR
           {
            state pickupcharacter_airtank
           }
           else
           {
            setvar TEMPVAR SCUBA_AMOUNT
            state assesspickuprequirements
            getactorvar[tempvehicleid].ENEMYAIRTANKAMOUNT TEMPVAR5
            ifvarvarl TEMPVAR5 TEMPVAR state pickupvehicle_airtank else state pickupinventory_airtank
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Vehicle]
          {
           setvar TEMPVAR SCUBA_AMOUNT
           state assesspickuprequirements
           getactorvar[tempvehicleid].ENEMYAIRTANKAMOUNT TEMPVAR5
           ifvarvarl TEMPVAR5 TEMPVAR
           {
            state pickupvehicle_airtank
           }
           else
           {
            setvar TEMPVAR SCUBA_AMOUNT
            state assesspickuprequirements
            ifvarvarl SCUBATIME TEMPVAR state pickupcharacter_airtank else state pickupinventory_airtank
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
    getactorvar[ITEMSEEK].ENEMYAIRTANKAMOUNT ITEMSEEKB
    getactorvar[ITEMSEEK].ENEMYHP ENEMYSHEALTH
    ifvarg ENEMYSHEALTH 0 // -1
    {
     setvar TEMPVAR SCUBA_AMOUNT
     state assesspickuprequirements
     ifvarvarl ITEMSEEKB TEMPVAR
     {
      state checkexplodeflag
      addvarvar ITEMSEEKC POWERUPBENEFIT

      setvar TEMPVAR SCUBA_AMOUNT
      state assesspickuprequirements
      ifvarvarg ITEMSEEKC TEMPVAR setvarvar ITEMSEEKC TEMPVAR

      setactorvar[ITEMSEEK].ENEMYAIRTANKAMOUNT ITEMSEEKC
      state resetitemtarget
      state getitemseekerspecies
      ifvarand ACTORFLAGS 4 nullop
      else
      {
       ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT SCUBA GEAR!
       ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT SCUBA GEAR!
       globalsound DUKE_GET
      }
      state enemygrabitemflash
     }
    }
   }
  }

}
enda

action HOLODUKE_FRAMES 0 4 1 1 8
eventloadactor HOLODUKE state setpickupflags enda
actor HOLODUKE 0 HOLODUKE_FRAMES

 ifvare FLAGSSET? 0
 {
  ifvare PUBLICBETA? 1
  {
   ifvare LISA? 1
   {
    ifvare HAVEENERGYSHIELD? 0
    {
     ifrnd 4
     {
      getactorvar[THISACTOR].ACTORFLAGS TEMP2
      espawn ENERGYSHELL
      setactorvar[RETURN].ACTORFLAGS TEMP2
      killit
     }
     else { setvar FLAGSSET? 1 }
    }
    else
    {
     ifrnd 32 { spawn ENERGYSHELL killit }
     else { setvar FLAGSSET? 1 }
    }
   }
   else
   {
    setvar FLAGSSET? 1
   }
  }
  else
  {
   setvar FLAGSSET? 1
  }
 }

 setvar ACTORSHEIGHT 60 setvar ACTORSWIDTH 41
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcount 6
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcanseetarget
        {
         setvar TEMPVAR HOLODUKE_AMOUNT
         state assesspickuprequirements
         ifvarvarl HOLOFORMTIME TEMPVAR
         {
          state checkexplodeflag

          setvarvar ACTORPICKUPAMOUNT HOLODUKE_AMOUNT
          state checkpickupamountflags
          setvarvar HOLOFORMTIME ACTORPICKUPAMOUNT

          setvar TEMPVAR HOLODUKE_AMOUNT
          state assesspickuprequirements
          ifvarvarg HOLOFORMTIME TEMPVAR setvarvar HOLOFORMTIME TEMPVAR

          setplayer[THISACTOR].holoduke_amount HOLOFORMTIME
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvarvar fta fta_normal setvar ftq 51
          }
          ifspawnedby HOLODUKE
            state getcode
          else
            state quikget
         }
         else
         {
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags
           addvarvar HOLOFORMS ACTORPICKUPAMOUNT
           ifvarand ACTORFLAGS 2 nullop
           else
           {
            ifvare ACTORPICKUPAMOUNT 1
            {
             redefinequote 836 ^14 STORED A HOLOFORM INTO INVENTORY!
            }
            else
            {
             redefinequote 836 ^14 STORED %ld HOLOFORMS INTO INVENTORY!
             qsprintf 836 836 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           globalsound FOUND_INVENTORY
           ifspawnedby HOLODUKE
            state getcode
           else
 	      state quikget
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }

}
enda

eventloadactor JETPACK state setpickupflags enda
actor JETPACK

 setvar ACTORSHEIGHT 28 setvar ACTORSWIDTH 30
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare FLAGSSET? 0
 {
  ifvarl POWERUPBENEFIT 1 setvar POWERUPBENEFIT JETPACK_AMOUNT
  setvarvar ACTORPICKUPAMOUNT POWERUPBENEFIT
  state checkpickupamountflags
  setvarvar POWERUPBENEFIT ACTORPICKUPAMOUNT
  setvar FLAGSSET? 1
 }

 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifpdistl RETRIEVEDISTANCE
      {
       ifcount 6
       {
        ifcanseetarget
        {
         setvar TEMPVAR JETPACK_AMOUNT
         state assesspickuprequirements
         ifvarg TEMPVAR 32767 setvar TEMPVAR 32767
         ifvarvarl JETPACKTIME TEMPVAR
	   {
          state checkexplodeflag

          setvarvar ACTORPICKUPAMOUNT JETPACK_AMOUNT
          state checkpickupamountflags
          setvarvar JETPACKTIME ACTORPICKUPAMOUNT

          setvar TEMPVAR JETPACK_AMOUNT
          state assesspickuprequirements
          ifvarg TEMPVAR 32767 setvar TEMPVAR 32767
          ifvarvarg JETPACKTIME TEMPVAR setvarvar JETPACKTIME TEMPVAR

          setplayer[THISACTOR].jetpack_amount JETPACKTIME
  	    ifvarand ACTORFLAGS 2 nullop
          else
          {
 	     setvarvar fta fta_normal setvar ftq 41
          }
	    ifspawnedby JETPACK
	      state getcode
	    else
	      state quikget
	   }
         else
         {
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags
           addvarvar JETPACKS ACTORPICKUPAMOUNT
           ifvarand ACTORFLAGS 2 nullop
           else
           {
            ifvare ACTORPICKUPAMOUNT 1
            {
             redefinequote 836 ^14 STORED A JETPACK INTO INVENTORY!
            }
            else
            {
             redefinequote 836 ^14 STORED %ld JETPACKS INTO INVENTORY!
             qsprintf 836 836 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           globalsound FOUND_INVENTORY
           ifspawnedby JETPACK
            state getcode
           else
            state quikget
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }

// Allows Monsters to Pick Up This Item [LIZTROOP only for now]
  state itemseekingliztroop
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
    getactorvar[ITEMSEEK].ENEMYJETPACKAMOUNT ITEMSEEKB
    getactorvar[ITEMSEEK].ENEMYHP ENEMYSHEALTH
    ifvarg ENEMYSHEALTH 0 // -1
    {
     setvar TEMPVAR JETPACK_AMOUNT
     state assesspickuprequirements
     ifvarg TEMPVAR 32767 setvar TEMPVAR 32767
     ifvarvarl ITEMSEEKB TEMPVAR
     {
      state checkexplodeflag
      addvarvar ITEMSEEKC POWERUPBENEFIT

      setvar TEMPVAR JETPACK_AMOUNT
      state assesspickuprequirements
      ifvarg TEMPVAR 32767 setvar TEMPVAR 32767
      ifvarvarg ITEMSEEKC TEMPVAR setvarvar ITEMSEEKC TEMPVAR

      setactorvar[ITEMSEEK].ENEMYJETPACKAMOUNT ITEMSEEKC
      state resetitemtarget
      state getitemseekerspecies
      ifvarand ACTORFLAGS 4 nullop
      else
      {
       ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT A JETPACK!
       ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT A JETPACK!
       globalsound DUKE_GET
      }
      state enemygrabitemflash
     }
    }
   }
  }

}
enda

eventloadactor ACCESSCARD
{
 state setpickupflags
 espawn ACCESSCARD2
 getactor[THISACTOR].pal TEMP
 setactor[RETURN].pal TEMP
 getactor[THISACTOR].xvel TEMP
 setactor[RETURN].xvel TEMP
 getactorvar[THISACTOR].lotagsav TEMP
 setactorvar[RETURN].lotagsav TEMP
 getactor[THISACTOR].cstat TEMP
 ifvarand TEMP 1024 nullop else addvar TEMP 1024
 setactor[RETURN].cstat TEMP
 getactorvar[THISACTOR].ACTORFLAGS TEMP2
 setactorvar[RETURN].ACTORFLAGS TEMP2
 killit
}
enda 

actor ACCESSCARD
 espawn ACCESSCARD2
 getactor[THISACTOR].pal TEMP
 setactor[RETURN].pal TEMP
 getactor[THISACTOR].xvel TEMP
 setactor[RETURN].xvel TEMP
 getactorvar[THISACTOR].lotagsav TEMP
 setactorvar[RETURN].lotagsav TEMP
 getactor[THISACTOR].cstat TEMP
 ifvarand TEMP 1024 nullop else addvar TEMP 1024
 setactor[RETURN].cstat TEMP
 getactorvar[THISACTOR].ACTORFLAGS TEMP
 setactorvar[RETURN].ACTORFLAGS TEMP
 killit
enda

eventloadactor AMMO state setpickupflags enda
actor AMMO

 state ammochange
 setvar ACTORSHEIGHT 54 setvar ACTORSWIDTH 30
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
          {
           getplayer[THISACTOR].ammo_amount 1 TEMPVAR
           ifvarvarl TEMPVAR MAXPISTOL
           {
            ifcanseetarget
	      {
             state checkexplodeflag

             getplayer[THISACTOR].ammo_amount 1 TEMPVAR
             setvarvar ACTORPICKUPAMOUNT PISTOLAMMOAMOUNT
             state checkpickupamountflags
             addvarvar TEMPVAR ACTORPICKUPAMOUNT
             ifvarvarg TEMPVAR MAXPISTOL setvarvar TEMPVAR MAXPISTOL
             setplayer[THISACTOR].ammo_amount 1 TEMPVAR

  	       ifvarand ACTORFLAGS 2 nullop
             else
             {
	        setvarvar fta fta_normal setvar ftq 65
             }
      		ifspawnedby AMMO
	        state getcode
	       else
	        state quikget
	      }
           }
          }
   }
 }
enda

eventloadactor FREEZEAMMO state setpickupflags enda
actor FREEZEAMMO

 state ammochange
 setvar ACTORSHEIGHT 21 setvar ACTORSWIDTH 34
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
          {
           getplayer[THISACTOR].ammo_amount 9 TEMPVAR
           ifvarvarl TEMPVAR MAXFREEZER
           {
            ifcanseetarget
	      {
             state checkexplodeflag

             getplayer[THISACTOR].ammo_amount 9 TEMPVAR
             setvarvar ACTORPICKUPAMOUNT FREEZEAMMOAMOUNT
             state checkpickupamountflags
             addvarvar TEMPVAR ACTORPICKUPAMOUNT
             ifvarvarg TEMPVAR MAXFREEZER setvarvar TEMPVAR MAXFREEZER
             setplayer[THISACTOR].ammo_amount 9 TEMPVAR

  	       ifvarand ACTORFLAGS 2 nullop
             else
             {
	        setvarvar fta fta_normal setvar ftq 66
             }
	       ifspawnedby FREEZEAMMO
	         state getcode
	       else
	         state quikget
	      }
           }
          }
   }
 }
enda

eventloadactor SHOTGUNAMMO state setpickupflags enda
actor SHOTGUNAMMO

 state ammochange
 setvar ACTORSHEIGHT 30 setvar ACTORSWIDTH 45
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
          {
           getplayer[THISACTOR].ammo_amount 2 TEMPVAR
           ifvarvarl TEMPVAR MAXSHOTGUN
           {
            ifcanseetarget
	      {
             state checkexplodeflag
             getplayer[THISACTOR].ammo_amount 2 TEMPVAR              
	       ifspawnedby PIGCOP
	       {
	        ifrnd 64 setvarvar ACTORPICKUPAMOUNT 20
	        else ifrnd 85 setvarvar ACTORPICKUPAMOUNT 15
	        else ifrnd 128 setvarvar ACTORPICKUPAMOUNT 10
	        else setvarvar ACTORPICKUPAMOUNT 5
	       }
	       else
	       {
              setvarvar ACTORPICKUPAMOUNT SHOTGUNAMMOAMOUNT
	       }
             state checkpickupamountflags
             addvarvar TEMPVAR ACTORPICKUPAMOUNT
             ifvarvarg TEMPVAR MAXSHOTGUN setvarvar TEMPVAR MAXSHOTGUN
             setplayer[THISACTOR].ammo_amount 2 TEMPVAR
  	       ifvarand ACTORFLAGS 2 nullop
             else
             {
 	        setvarvar fta fta_normal setvar ftq 69
             }
	       ifspawnedby SHOTGUNAMMO
	        state getcode
	       else
	        state quikget
	      }
           }
          }
   }
 }
enda

eventloadactor AMMOLOTS state setpickupflags enda
actor AMMOLOTS

 setvar ACTORSHEIGHT 20 setvar ACTORSWIDTH 36
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
          {
           getplayer[THISACTOR].ammo_amount 1 TEMPVAR
           ifvarvarl TEMPVAR MAXPISTOL
           {
            ifcanseetarget
	      {
             state checkexplodeflag

	       addweapon PISTOL_WEAPON 0
             getplayer[THISACTOR].ammo_amount 1 TEMPVAR
             setvarvar ACTORPICKUPAMOUNT 48
             state checkpickupamountflags
             addvarvar TEMPVAR ACTORPICKUPAMOUNT
             ifvarvarg TEMPVAR MAXPISTOL setvarvar TEMPVAR MAXPISTOL
             setplayer[THISACTOR].ammo_amount 1 TEMPVAR

  	       ifvarand ACTORFLAGS 2 nullop
             else
             {
	        setvarvar fta fta_normal setvar ftq 65
             }
	       ifspawnedby AMMOLOTS
	         state getcode
	       else
	         state quikget
	      }
           }
          }
   }
 }
enda

eventloadactor CRYSTALAMMO state setpickupflags enda
actor CRYSTALAMMO

 state ammochange
 setvar ACTORSHEIGHT 15 setvar ACTORSWIDTH 40
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
          {
           getplayer[THISACTOR].ammo_amount 6 TEMPVAR
           ifvarvarl TEMPVAR MAXSHRINKER
           {
            ifcanseetarget
     	      {
             state checkexplodeflag

             getplayer[THISACTOR].ammo_amount 6 TEMPVAR
             setvarvar ACTORPICKUPAMOUNT CRYSTALAMMOAMOUNT
             state checkpickupamountflags
             addvarvar TEMPVAR ACTORPICKUPAMOUNT
             ifvarvarg TEMPVAR MAXSHRINKER setvarvar TEMPVAR MAXSHRINKER
             setplayer[THISACTOR].ammo_amount 6 TEMPVAR
  	       ifvarand ACTORFLAGS 2 nullop
             else
             {
        	 setvarvar fta fta_normal setvar ftq 78
             }
        	ifspawnedby CRYSTALAMMO
        	 state getcode
       	else
      	         state quikget
     	      }
           }
          }
   }
 }
enda

eventloadactor GROWAMMO state setpickupflags enda
actor GROWAMMO

 state ammochange
 setvar ACTORSHEIGHT 32 setvar ACTORSWIDTH 32
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
          {
           getplayer[THISACTOR].ammo_amount 11 TEMPVAR
           ifvarvarl TEMPVAR MAXEXPANDER
           {
            ifcanseetarget
	      {
             state checkexplodeflag

             getplayer[THISACTOR].ammo_amount 11 TEMPVAR
             setvarvar ACTORPICKUPAMOUNT GROWCRYSTALAMMOAMOUNT
             state checkpickupamountflags
             addvarvar TEMPVAR ACTORPICKUPAMOUNT
             ifvarvarg TEMPVAR MAXEXPANDER setvarvar TEMPVAR MAXEXPANDER
             setplayer[THISACTOR].ammo_amount 11 TEMPVAR

  	       ifvarand ACTORFLAGS 2 nullop
             else
             {
     	     	 setvarvar fta fta_normal setvar ftq 123
             }
     	     	ifspawnedby GROWAMMO
           	 state getcode
          	else
          	 state quikget
	      }
           }
          }
   }
 }
enda

eventloadactor BATTERYAMMO state setpickupflags enda
actor BATTERYAMMO

 state ammochange
 setvar ACTORSHEIGHT 36 setvar ACTORSWIDTH 57
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
          {
           getplayer[THISACTOR].ammo_amount 3 TEMPVAR
           ifvarvarl TEMPVAR MAXCHAINGUN
           {
            ifcanseetarget
	      {
             state checkexplodeflag

             getplayer[THISACTOR].ammo_amount 3 TEMPVAR
             setvarvar ACTORPICKUPAMOUNT CHAINGUNAMMOAMOUNT
             state checkpickupamountflags
             addvarvar TEMPVAR ACTORPICKUPAMOUNT
             ifvarvarg TEMPVAR MAXCHAINGUN setvarvar TEMPVAR MAXCHAINGUN
             setplayer[THISACTOR].ammo_amount 3 TEMPVAR

  	       ifvarand ACTORFLAGS 2 nullop
             else
             {
	        setvarvar fta fta_normal setvar ftq 63
             }
	       ifspawnedby BATTERYAMMO
	         state getcode
	       else
	         state quikget
	      }
           }
          }
   }
 }
enda

eventloadactor DEVISTATORAMMO state setpickupflags enda
actor DEVISTATORAMMO

 state ammochange
 setvar ACTORSHEIGHT 23 setvar ACTORSWIDTH 45
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
          {
           getplayer[THISACTOR].ammo_amount 7 TEMPVAR
           ifvarvarl TEMPVAR MAXCHAINGUN
           {
            ifcanseetarget
	      {
             state checkexplodeflag

             getplayer[THISACTOR].ammo_amount 7 TEMPVAR
             setvarvar ACTORPICKUPAMOUNT DEVISTATORAMMOAMOUNT
             state checkpickupamountflags
             addvarvar TEMPVAR ACTORPICKUPAMOUNT
             ifvarvarg TEMPVAR MAXDEVASTATOR setvarvar TEMPVAR MAXDEVASTATOR
             setplayer[THISACTOR].ammo_amount 7 TEMPVAR

  	       ifvarand ACTORFLAGS 2 nullop
             else
             {
	        setvarvar fta fta_normal setvar ftq 14
             }
	       ifspawnedby DEVISTATORAMMO
	         state getcode
	       else
	         state quikget
	      }
           }
          }
   }
 }
enda

eventloadactor RPGAMMO state setpickupflags enda
actor RPGAMMO

 state ammochange
 setvar ACTORSHEIGHT 42 setvar ACTORSWIDTH 83
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
     ifvarg CURRENTHITPOINTS 0 // ifp palive
      ifcount 6
        ifpdistl RETRIEVEDISTANCE
        {
         getplayer[THISACTOR].ammo_amount 4 TEMPVAR
         ifvarvarl TEMPVAR MAXRPG
         {
          ifcanseetarget
	    {
           state checkexplodeflag

           getplayer[THISACTOR].ammo_amount 4 TEMPVAR
           setvarvar ACTORPICKUPAMOUNT RPGAMMOBOX
           state checkpickupamountflags
           addvarvar TEMPVAR ACTORPICKUPAMOUNT
           ifvarvarg TEMPVAR MAXRPG setvarvar TEMPVAR MAXRPG
           setplayer[THISACTOR].ammo_amount 4 TEMPVAR

  	     ifvarand ACTORFLAGS 2 nullop
           else
           {
	      setvarvar fta fta_normal setvar ftq 64
           }
	     ifspawnedby RPGAMMO
	       state getcode
	     else
	       state quikget
	    }
         }
        }
   }
 }
enda

eventloadactor HBOMBAMMO state setpickupflags enda
actor HBOMBAMMO

 state ammochange
 setvar ACTORSHEIGHT 34 setvar ACTORSWIDTH 68
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
          {
           getplayer[THISACTOR].ammo_amount 5 TEMPVAR
           ifvarvarl TEMPVAR MAXPIPEBOMB
           {
            ifcanseetarget
	      {
             state checkexplodeflag

             getplayer[THISACTOR].ammo_amount 5 TEMPVAR
             setvarvar ACTORPICKUPAMOUNT HANDBOMBBOX
             state checkpickupamountflags
             addvarvar TEMPVAR ACTORPICKUPAMOUNT
             ifvarvarg TEMPVAR MAXPIPEBOMB setvarvar TEMPVAR MAXPIPEBOMB
             setplayer[THISACTOR].ammo_amount 5 TEMPVAR

  	       ifvarand ACTORFLAGS 2 nullop
             else
             {
	        setvarvar fta fta_normal setvar ftq 55
             }	
	       ifspawnedby HBOMBAMMO
	         state getweaponcode
	       else
	         state quikweaponget
	      }
           }
          }
   }
 }
enda

state weapontotank
 ifvare oldskoolmode 0
 {
  ifrnd 2
  {
   espawn EMPTYTANK
   ifrnd 85 setactor[RETURN].pal 19
   else ifrnd 128 setactor[RETURN].pal 17
   else setactor[RETURN].pal 0
  }
 }
ends

eventloadactor RPGSPRITE
 state setpickupflags
 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
enda
actor RPGSPRITE

 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
 state checkitemflags
 setvar ACTORSHEIGHT 24 setvar ACTORSWIDTH 77
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
         ifpdistl RETRIEVEDISTANCE
         {
          addweapon RPG_WEAPON 0
          getplayer[THISACTOR].ammo_amount 4 TEMPVAR
          ifvarvarl TEMPVAR MAXRPG
          {
           ifcanseetarget
	     {
            state checkexplodeflag
	
            getplayer[THISACTOR].ammo_amount 4 TEMPVAR
            setvarvar ACTORPICKUPAMOUNT RPGAMMOBOX
            state checkpickupamountflags
            addvarvar TEMPVAR ACTORPICKUPAMOUNT
            ifvarvarg TEMPVAR MAXRPG setvarvar TEMPVAR MAXRPG
            setplayer[THISACTOR].ammo_amount 4 TEMPVAR
	     }
          }
  	    ifvarand ACTORFLAGS 2 nullop else { setvarvar fta fta_normal setvar ftq 56 }
	    ifspawnedby RPGSPRITE state getweaponcode else state quikweaponget
         }
   }
 }
enda

eventloadactor SHOTGUNSPRITE
 state setpickupflags
 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
enda
actor SHOTGUNSPRITE

 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
 setvar ACTORSHEIGHT 25 setvar ACTORSWIDTH 88
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
         ifpdistl RETRIEVEDISTANCE
         {
          addweapon SHOTGUN_WEAPON 0
          getplayer[THISACTOR].ammo_amount 2 TEMPVAR
          ifvarvarl TEMPVAR MAXSHOTGUN
          {
           ifcanseetarget
	     {
            state checkexplodeflag
            getplayer[THISACTOR].ammo_amount 2 TEMPVAR
            ifspawnedby PIGCOP
            {
        	ifrnd 64 setvar ACTORPICKUPAMOUNT 4
        	else ifrnd 64 setvar ACTORPICKUPAMOUNT 3
        	else ifrnd 64 setvar ACTORPICKUPAMOUNT 2
        	else setvar ACTORPICKUPAMOUNT 1
            }
            else
            {
             setvarvar ACTORPICKUPAMOUNT SHOTGUNAMMOAMOUNT
            }
            state checkpickupamountflags
            addvarvar TEMPVAR ACTORPICKUPAMOUNT
            ifvarvarg TEMPVAR MAXSHOTGUN setvarvar TEMPVAR MAXSHOTGUN
            setplayer[THISACTOR].ammo_amount 2 TEMPVAR
      	     }
          }
   	    ifvarand ACTORFLAGS 2 nullop else { setvarvar fta fta_normal setvar ftq 57 }
          ifspawnedby SHOTGUNSPRITE state getweaponcode else state quikweaponget
         }
   }
 }
enda

eventloadactor FIRSTGUNSPRITE
 state setpickupflags
 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
enda
actor FIRSTGUNSPRITE

 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
 setvar ACTORSHEIGHT 20 setvar ACTORSWIDTH 36
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
         ifpdistl RETRIEVEDISTANCE
         {
          addweapon PISTOL_WEAPON 0
          getplayer[THISACTOR].ammo_amount 1 TEMPVAR
          ifvarvarl TEMPVAR MAXPISTOL
          {
           ifcanseetarget
	     {
            state checkexplodeflag

	      addweapon PISTOL_WEAPON 0
            getplayer[THISACTOR].ammo_amount 1 TEMPVAR
            setvarvar ACTORPICKUPAMOUNT 48
            state checkpickupamountflags
            addvarvar TEMPVAR ACTORPICKUPAMOUNT
            ifvarvarg TEMPVAR MAXPISTOL setvarvar TEMPVAR MAXPISTOL
            setplayer[THISACTOR].ammo_amount 1 TEMPVAR
	     }
          }
	    state getweaponcode
         }
   }
 }
enda

eventloadactor TRIPBOMBSPRITE
 state setpickupflags
 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
enda
actor TRIPBOMBSPRITE

 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
 state checkitemflags
 setvar ACTORSHEIGHT 12 setvar ACTORSWIDTH 35
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
          {
           addweapon TRIPBOMB_WEAPON 0
           getplayer[THISACTOR].ammo_amount 8 TEMPVAR
           ifvarvarl TEMPVAR MAXTRIPBOMB
           {
            ifcanseetarget
 	      {
             state checkexplodeflag
	
             getplayer[THISACTOR].ammo_amount 8 TEMPVAR
             setvarvar ACTORPICKUPAMOUNT 1
             state checkpickupamountflags
             addvarvar TEMPVAR ACTORPICKUPAMOUNT
             ifvarvarg TEMPVAR MAXTRIPBOMB setvarvar TEMPVAR MAXTRIPBOMB
             setplayer[THISACTOR].ammo_amount 8 TEMPVAR

	      }
           }
   	     ifvarand ACTORFLAGS 2 nullop else { setvarvar fta fta_normal setvar ftq 58 }
	     ifspawnedby TRIPBOMBSPRITE state getweaponcode else state quikweaponget
          }
   }
 }
enda

eventloadactor CHAINGUNSPRITE
 state setpickupflags
 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
enda
actor CHAINGUNSPRITE

 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
 setvar ACTORSHEIGHT 24 setvar ACTORSWIDTH 88
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
          {
	     addweapon CHAINGUN_WEAPON 0
           getplayer[THISACTOR].ammo_amount 3 TEMPVAR
           ifvarvarl TEMPVAR MAXCHAINGUN
           {
            ifcanseetarget
 	      {
             state checkexplodeflag
	
             getplayer[THISACTOR].ammo_amount 3 TEMPVAR
             setvarvar ACTORPICKUPAMOUNT 50
             state checkpickupamountflags
             addvarvar TEMPVAR ACTORPICKUPAMOUNT
             ifvarvarg TEMPVAR MAXCHAINGUN setvarvar TEMPVAR MAXCHAINGUN
             setplayer[THISACTOR].ammo_amount 3 TEMPVAR

	      }
           }
   	     ifvarand ACTORFLAGS 2 nullop else { setvarvar fta fta_normal setvar ftq 54 }
	     ifspawnedby CHAINGUNSPRITE state getweaponcode else state quikweaponget
          }
   }
 }
enda

eventloadactor SHRINKERSPRITE
 state setpickupflags
 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
enda
actor SHRINKERSPRITE

 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
 setvar ACTORSHEIGHT 30 setvar ACTORSWIDTH 99
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
         ifpdistl RETRIEVEDISTANCE
         {
          addweapon SHRINKER_WEAPON 0
          getplayer[THISACTOR].ammo_amount 6 TEMPVAR
          ifvarvarl TEMPVAR MAXSHRINKER
          {
           ifcanseetarget
	     {
            state checkexplodeflag

            getplayer[THISACTOR].ammo_amount 6 TEMPVAR
            setvarvar ACTORPICKUPAMOUNT 10
            state checkpickupamountflags
            addvarvar TEMPVAR ACTORPICKUPAMOUNT
            ifvarvarg TEMPVAR MAXSHRINKER setvarvar TEMPVAR MAXSHRINKER
            setplayer[THISACTOR].ammo_amount 6 TEMPVAR

	     }
          }
   	    ifvarand ACTORFLAGS 2 nullop else { setvarvar fta fta_normal setvar ftq 60 }
	    ifspawnedby SHRINKERSPRITE state getweaponcode else state quikweaponget
         }
   }
 }
enda

eventloadactor FREEZESPRITE
 state setpickupflags
 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
enda
actor FREEZESPRITE

 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
 setvar ACTORSHEIGHT 27 setvar ACTORSWIDTH 71
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
         ifpdistl RETRIEVEDISTANCE
         {
          addweapon FREEZE_WEAPON 0
          getplayer[THISACTOR].ammo_amount 9 TEMPVAR
          ifvarvarl TEMPVAR MAXFREEZER
          {
           ifcanseetarget
	     {
            state checkexplodeflag

            getplayer[THISACTOR].ammo_amount 9 TEMPVAR
            setvarvar ACTORPICKUPAMOUNT FREEZEAMMOAMOUNT
            state checkpickupamountflags
            addvarvar TEMPVAR ACTORPICKUPAMOUNT
            ifvarvarg TEMPVAR MAXFREEZER setvarvar TEMPVAR MAXFREEZER
            setplayer[THISACTOR].ammo_amount 9 TEMPVAR

	     }
          }
   	    ifvarand ACTORFLAGS 2 nullop else { setvarvar fta fta_normal setvar ftq 59 }
	    ifspawnedby FREEZESPRITE state getweaponcode else state quikweaponget
         }
   }
 }
enda

eventloadactor DEVISTATORSPRITE
 state setpickupflags
 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
enda
actor DEVISTATORSPRITE

 ifvare FLAGSSET? 0 { state weapontotank setvar FLAGSSET? 1 }
 setvar ACTORSHEIGHT 25 setvar ACTORSWIDTH 79
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifcount 6
         ifpdistl RETRIEVEDISTANCE
         {
          addweapon DEVISTATOR_WEAPON 0
          getplayer[THISACTOR].ammo_amount 7 TEMPVAR
          ifvarvarl TEMPVAR MAXDEVASTATOR
          {
           ifcanseetarget
	     {
            state checkexplodeflag

            getplayer[THISACTOR].ammo_amount 7 TEMPVAR
            setvarvar ACTORPICKUPAMOUNT DEVISTATORAMMOAMOUNT
            state checkpickupamountflags
            addvarvar TEMPVAR ACTORPICKUPAMOUNT
            ifvarvarg TEMPVAR MAXDEVASTATOR setvarvar TEMPVAR MAXDEVASTATOR
            setplayer[THISACTOR].ammo_amount 7 TEMPVAR

	     }
          }
   	    ifvarand ACTORFLAGS 2 nullop else { setvarvar fta fta_normal setvar ftq 87 }
	    ifspawnedby DEVISTATORSPRITE state getweaponcode else state quikweaponget
         }
   }
 }
enda

//****************
//*Health Pickups*
//****************

state pickupcharacter_cola
          state checkexplodeflag
          state medikitplayer
          ifvare oldskoolmode 0 qsprintf 61 252 TEMPHEALTH
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvarvar fta fta_normal setvar ftq 61
          }
      	    ifspawnedby COLA
	     state getcode
          else
           state quikget
ends

state pickupvehicle_cola
          state checkexplodeflag
          state medikitvehicle
          ifvare oldskoolmode 0 qsprintf 61 252 TEMPHEALTH
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           redefinequote 836 ^15GRABBED A SMALL MEDIKIT FOR YOUR VEHICLE!
           setvarvar fta fta_normal setvar ftq 836
          }
      	    ifspawnedby COLA
	     state getcode
          else
           state quikget
ends

state pickupinventory_cola
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags
           addvarvar SMALLMEDIKITS ACTORPICKUPAMOUNT
           ifvarand ACTORFLAGS 2 nullop
           else
           {
            ifvare ACTORPICKUPAMOUNT 1
            {
             redefinequote 836 ^14 STORED A SMALL MEDIKIT INTO INVENTORY!
            }
            else
            {
             redefinequote 836 ^14 STORED %ld SMALL MEDIKITS INTO INVENTORY!
             qsprintf 836 836 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           globalsound FOUND_INVENTORY
           ifspawnedby COLA
 	      state getcode
           else
            state quikget
          }
ends

eventloadactor COLA state setpickupflags enda
actor COLA

 state checkrandomhealitem
 setvar ACTORSHEIGHT 16 setvar ACTORSWIDTH 23
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifpdistl RETRIEVEDISTANCE
      {
       ifcount 6
       {
        ifcanseetarget
        {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_cola else state pickupinventory_cola
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_cola else state pickupinventory_cola
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_cola else state pickupinventory_cola
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           ifvarvarl CURRENTHITPOINTS MAXHITPOINTS
           {
            state pickupcharacter_cola
           }
           else
           {
            getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_cola else state pickupinventory_cola
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           ifvarvarl TEMPVAR4 TEMPVAR5
           {
            state pickupvehicle_cola
           }
           else
           {
            ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_cola else state pickupinventory_cola
           }
          }
         }
        }
       }
      }
     }
    }
   }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1 state medikitmonster
  }

}
enda

state pickupcharacter_sixpak
          state checkexplodeflag
          state medikitplayer
          ifvare oldskoolmode 0 qsprintf 62 255 TEMPHEALTH
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvarvar fta fta_normal setvar ftq 62
          }
          ifspawnedby SIXPAK
           state getcode
          else
           state quikget
ends

state pickupvehicle_sixpak
          state checkexplodeflag
          state medikitvehicle
          ifvare oldskoolmode 0 qsprintf 62 255 TEMPHEALTH
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           redefinequote 836 ^15GRABBED A LARGE MEDIKIT FOR YOUR VEHICLE!
           setvarvar fta fta_normal setvar ftq 836
          }
          ifspawnedby SIXPAK
           state getcode
          else
           state quikget
ends

state pickupinventory_sixpak
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags
           addvarvar LARGEMEDIKITS ACTORPICKUPAMOUNT
           ifvarand ACTORFLAGS 2 nullop
           else
           {
            ifvare ACTORPICKUPAMOUNT 1
            {
             redefinequote 836 ^14 STORED A LARGE MEDIKIT INTO INVENTORY!
            }
            else
            {
             redefinequote 836 ^14 STORED %ld LARGE MEDIKITS INTO INVENTORY!
             qsprintf 836 836 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           globalsound FOUND_INVENTORY
      	     ifspawnedby SIXPAK
	      state getcode
           else
            state quikget
          }
ends

eventloadactor SIXPAK state setpickupflags enda
actor SIXPAK

 state checkrandomhealitem
 setvar ACTORSHEIGHT 27 setvar ACTORSWIDTH 17
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifpdistl RETRIEVEDISTANCE
      {
       ifcount 6
       {
        ifcanseetarget
        {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_sixpak else state pickupinventory_sixpak
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_sixpak else state pickupinventory_sixpak
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_sixpak else state pickupinventory_sixpak
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           ifvarvarl CURRENTHITPOINTS MAXHITPOINTS
           {
            state pickupcharacter_sixpak
           }
           else
           {
            getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_sixpak else state pickupinventory_sixpak
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           ifvarvarl TEMPVAR4 TEMPVAR5
           {
            state pickupvehicle_sixpak
           }
           else
           {
            ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_sixpak else state pickupinventory_sixpak
           }
          }
         }
        }
       }
      }
     }
    }
   }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1 state medikitmonster
  }
}
enda

state atomnormal
              setvarvar TEMPHEALTH MAXHITPOINTS	 // Set TEMPHEALTH to Maximum Atom Var
              setvar ACTORPICKUPAMOUNT 50
              state checkpickupamountflags
              mulvarvar TEMPHEALTH ACTORPICKUPAMOUNT
              divvar TEMPHEALTH 100					// Divides by 2 to get 50% of Maximum Var
              addvarvar CURRENTHITPOINTS TEMPHEALTH      		// Adds the actual heal value to the current player health
              ifvarvarg CURRENTHITPOINTS STATLIMITATOMIC setvarvar CURRENTHITPOINTS STATLIMITATOMIC // Prevents the player from going too far over their health value
              ifvarvarg CURRENTHITPOINTS MAXHITPOINTSATOMIC setvarvar CURRENTHITPOINTS MAXHITPOINTSATOMIC 
              ifvare oldskoolmode 0 qsprintf 19 260 TEMPHEALTH
              ifvarand ACTORFLAGS 2 nullop
              else
              {
  	         setvarvar fta fta_normal setvar ftq 19
               setvar PLAYERHPDAMAGED? -1
              }
ends

state pickupcharacter_atom
            state checkexplodeflag
            state gotmedsyoureallyneeded
            ifvare CHARACTERSELECTED? 1 // If Duke grabs the Atomic Health
            {
             ifvare oldskoolmode 0 // If in old-skool mode, Duke doesn't get the extra bonus health
             {
              ifvarvarg MAXHITPOINTSATOMIC STATLIMITATOMIC setvarvar MAXHITPOINTSATOMIC STATLIMITATOMIC
              setvarvar CURRENTHITPOINTS MAXHITPOINTSATOMIC
   	        ifvarand ACTORFLAGS 2 nullop
              else
              {
               redefinequote 335 ^20ATOMIC HEALTH: HP BECOMES 200%!
               setvarvar fta fta_normal setvar ftq 335
               setvar PLAYERHPDAMAGED? -1
              }
             }
             else state atomnormal
            }
            else state atomnormal

            ifspawnedby ATOMICHEALTH state getcode else state quikget
ends

state pickupvehicle_atom
            state checkexplodeflag
            state gotmedsyoureallyneeded

            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR3
            setvarvar TEMPHEALTH TEMPVAR3
            setvar ACTORPICKUPAMOUNT 50
            state checkpickupamountflags
            mulvarvar TEMPHEALTH ACTORPICKUPAMOUNT
            divvar TEMPHEALTH 100					// Divides by 2 to get 50% of Maximum Var
            addvarvar TEMPVAR4 TEMPHEALTH      			// Adds the actual heal value to the current player health
            ifvarvarg TEMPVAR4 STATLIMITATOMIC setvarvar TEMPVAR4 STATLIMITATOMIC 	// Prevents the player from going too far over their health value
            ifvarvarg TEMPVAR4 TEMPVAR5 setvarvar TEMPVAR4 TEMPVAR5
            setactorvar[tempvehicleid].ENEMYHP TEMPVAR4
            ifvare oldskoolmode 0 qsprintf 19 260 TEMPHEALTH
            ifvarand ACTORFLAGS 2 nullop
            else
            {
             redefinequote 836 ^15COLLECTED AN ATOMIC HEALTH FOR YOUR VEHICLE!
             setvarvar fta fta_normal setvar ftq 836
             setvar VEHICLEHPDAMAGED? -1
            }

            ifspawnedby ATOMICHEALTH
             state getcode
            else
             state quikget
ends

state pickupinventory_atom
           ifvarn oldskoolmode 1
           {
            state checkexplodeflag
            setvarvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags
            addvarvar ATOMICHEALTHS ACTORPICKUPAMOUNT
            ifvarand ACTORFLAGS 2 nullop
            else
            {
             ifvare ACTORPICKUPAMOUNT 1
             {
              redefinequote 836 ^14 STORED AN ATOMIC HEALTH INTO INVENTORY!
             }
             else
             {
              redefinequote 836 ^14 STORED %ld  ATOMIC HEALTHS INTO INVENTORY!
              qsprintf 836 836 ACTORPICKUPAMOUNT
             }
             setvarvar fta fta_normal setvar ftq 836
            }
            globalsound FOUND_INVENTORY
      	      ifspawnedby ATOMICHEALTH
	       state getcode
            else
             state quikget
           }
ends

eventloadactor ATOMICHEALTH state setpickupflags enda
actor ATOMICHEALTH

  ifvare FLAGSSET? 0
  {
   ifvare PUBLICBETA? 1
   {
    ifvare oldskoolmode 0
    {
     ifrnd 128 
     {
      getactorvar[THISACTOR].ACTORFLAGS TEMP2
      espawn FORTUNECOOKIE
      setactorvar[RETURN].ACTORFLAGS TEMP2
      killit 
     }
     else
     ifrnd 8 
     {
      getactorvar[THISACTOR].ACTORFLAGS TEMP2
      espawn SUPERATOM
      setactorvar[RETURN].ACTORFLAGS TEMP2
      killit 
     }
     else
     ifrnd 2
     {
      getactorvar[THISACTOR].ACTORFLAGS TEMP2
      espawn SUPERATOM
      setactorvar[RETURN].ACTORFLAGS TEMP2
      setactor[RETURN].pal 12
      setactorvar[RETURN].ACTORFLAGS TEMP2
      killit
     }
     else
     ifrnd 1
     {
      getactorvar[THISACTOR].ACTORFLAGS TEMP2
      espawn CONTINUEITEM
      setactorvar[RETURN].ACTORFLAGS TEMP2
      killit 
     }
     else { setvar FLAGSSET? 1 }
    }
   }
   else
   {
    setvar FLAGSSET? 1
   }
  }

  ifspritepal 16 // An AtomicHealth with a spritepal of 16 will automatically turn into a SuperAtom.
  {
   getactorvar[THISACTOR].ACTORFLAGS TEMP2
   espawn SUPERATOM
   setactorvar[RETURN].ACTORFLAGS TEMP2
   killit 
  }
  ifspritepal 12 // An AtomicHealth with a spritepal of 16 will automatically turn into a SuperAtom.
  {
   getactorvar[THISACTOR].ACTORFLAGS TEMP2
   espawn SUPERATOM
     setactorvar[RETURN].ACTORFLAGS TEMP2
   setactor[RETURN].pal 12
   setactorvar[RETURN].FLAGSSET? 1
   killit
  }
 setvar ACTORSHEIGHT 25 setvar ACTORSWIDTH 29
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifpdistl RETRIEVEDISTANCE
      {
       ifcount 6
       {
        ifcanseetarget
        {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC state pickupcharacter_atom else state pickupinventory_atom
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC state pickupcharacter_atom else state pickupinventory_atom
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           mulvar TEMPVAR5 2
           ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_atom else state pickupinventory_atom
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC
           {
            state pickupcharacter_atom
           }
           else
           {
            getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            mulvar TEMPVAR5 2
            ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_atom else state pickupinventory_atom
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           mulvar TEMPVAR5 2
           ifvarvarl TEMPVAR4 TEMPVAR5
           {
            state pickupvehicle_atom
           }
           else
           {
            ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC state pickupcharacter_atom else state pickupinventory_atom
           }
          }
         }
        }
       }
      }
     }
    }
   }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
	   {
          state checkenemypickuphealth
          getactorvar[ITEMSEEK].ENEMYMAXHP ITEMENEMYMAXHP
          setvarvar ITEMENEMYMAXHPATOMIC ITEMENEMYMAXHP
          mulvar ITEMENEMYMAXHPATOMIC 2
          ifvarvarg ITEMENEMYMAXHPATOMIC STATLIMITATOMIC setvarvar ITEMENEMYMAXHPATOMIC STATLIMITATOMIC
          ifvarg ITEMSEEKB 0
           ifvarvarl ITEMSEEKB ITEMENEMYMAXHPATOMIC
          {
           state checkexplodeflag
           setvarvar ITEMSEEKC ITEMENEMYMAXHP
           setvar ACTORPICKUPAMOUNT 50
           state checkpickupamountflags
 	     mulvarvar ITEMSEEKC ACTORPICKUPAMOUNT
           divvar ITEMSEEKC 100
           addvarvar ITEMSEEKB ITEMSEEKC
           ifvarvarg ITEMSEEKB ITEMENEMYMAXHPATOMIC setvarvar ITEMSEEKB ITEMENEMYMAXHPATOMIC
           setactorvar[ITEMSEEK].ENEMYHP ITEMSEEKB
           state resetitemtarget
           state getitemseekerspecies
           ifvarand ACTORFLAGS 4 nullop
           else
           {
            ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT AN ATOMIC HEALTH!
            ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT AN ATOMIC HEALTH!
            globalsound GETATOMICHEALTH
            setactorvar[ITEMSEEK].ENEMYHPDAMAGED? -1
           }
           state enemygrabitemflash
          }
	   }
  }

}
enda

state pickupinventory_firstaid
              ifvarn oldskoolmode 1
              {
               state checkexplodeflag
               setvarvar ACTORPICKUPAMOUNT 1
               state checkpickupamountflags
               addvarvar PORTABLEMEDIKITS ACTORPICKUPAMOUNT
               ifvarand ACTORFLAGS 2 nullop
               else
               {
                ifvare ACTORPICKUPAMOUNT 1
                {
                 redefinequote 836 ^14 STORED A PORTABLE MEDIKIT INTO INVENTORY!
                }
                else
                {
                 redefinequote 836 ^14 STORED %ld PORTABLE MEDIKITS INTO INVENTORY!
                 qsprintf 836 836 ACTORPICKUPAMOUNT
                }
                setvarvar fta fta_normal setvar ftq 836
               }
               globalsound FOUND_INVENTORY
               ifspawnedby FIRSTAID
                state getcode
               else
                state quikget
              }
ends

eventloadactor FIRSTAID state setpickupflags enda
actor FIRSTAID

 ifvare FLAGSSET? 0
 {
  ifvare PUBLICBETA? 1
  {
   ifvare oldskoolmode 0
   {
    ifvarg PARTYSIZE 1
    {
     ifrnd 64 
     {
      getactorvar[THISACTOR].ACTORFLAGS TEMP2
      espawn RESURRECTIONCHALICE
      setactorvar[RETURN].ACTORFLAGS TEMP2
      killit
     }
     else { setvar FLAGSSET? 1 }
    }
    else
    {
     setvar FLAGSSET? 1
    }
   }
   else
   {
    setvar FLAGSSET? 1
   }
  }
  else
  {
   setvar FLAGSSET? 1
  }
 }

 setvar ACTORSHEIGHT 40 setvar ACTORSWIDTH 54
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarg ITEMDROPPEDTIME 0
 {
  ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
 }
 else
 {
  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifmove RESPAWN_ACTOR_FLAG state respawnit
   else
   {
    ifvare mainmenu 0
    {
     ifp pshrunk nullop
     else
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          ifcanseetarget
          {
           ifvare CHARACTERSELECTED? 13
           {
            setvarvar TEMPVAR MAXHITPOINTS
  	      mulvar TEMPVAR 3
            divvar TEMPVAR 2
            ifvarvarl FIRSTAIDCURRENT TEMPVAR
	      {
             state checkexplodeflag
             setvarvar TEMPVAR MAXHITPOINTS
             mulvar TEMPVAR 3
             divvar TEMPVAR 2 
             setvarvar FIRSTAIDCURRENT TEMPVAR
   	       ifvarand ACTORFLAGS 2 nullop
             else
             {
              setvarvar fta fta_normal setvar ftq 3
              setvar DISPLAYFAFLASHTIMER -28
             }	
             ifspawnedby FIRSTAID
              state getcode
             else
              state quikget
            }
            else
            {
             state pickupinventory_firstaid
            }
           }
           else
           {
            ifvarvarl FIRSTAIDCURRENT MAXHITPOINTS
            {
             state checkexplodeflag
	       setvarvar FIRSTAIDCURRENT MAXHITPOINTS
   	       ifvarand ACTORFLAGS 2 nullop
             else
             {
	        setvarvar fta fta_normal setvar ftq 3
              setvar DISPLAYFAFLASHTIMER -28
             }	
	       ifspawnedby FIRSTAID
	        state getcode
	       else
	        state quikget
	      }
            else
            {
             state pickupinventory_firstaid
            }
           }
          }
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           ifcanseetarget
           {
            ifvare CHARACTERSELECTED? 13
            {
             setvarvar TEMPVAR MAXHITPOINTS
   	       mulvar TEMPVAR 3
             divvar TEMPVAR 2
             ifvarvarl FIRSTAIDCURRENT TEMPVAR
	       {
              state checkexplodeflag
              setvarvar TEMPVAR MAXHITPOINTS
              mulvar TEMPVAR 3
              divvar TEMPVAR 2 
              setvarvar FIRSTAIDCURRENT TEMPVAR
   	        ifvarand ACTORFLAGS 2 nullop
              else
              {
               setvarvar fta fta_normal setvar ftq 3
               setvar DISPLAYFAFLASHTIMER -28
              }	
              ifspawnedby FIRSTAID
               state getcode
              else
               state quikget
             }
             else
             {
              state pickupinventory_firstaid
             }
            }
            else
            {
             ifvarvarl FIRSTAIDCURRENT MAXHITPOINTS
             {
              state checkexplodeflag
	        setvarvar FIRSTAIDCURRENT MAXHITPOINTS
   	        ifvarand ACTORFLAGS 2 nullop
              else
              {
	         setvarvar fta fta_normal setvar ftq 3
               setvar DISPLAYFAFLASHTIMER -28
              }
	        ifspawnedby FIRSTAID
	         state getcode
	      	 else
	      	  state quikget
	       }
             else
             {
              state pickupinventory_firstaid
             }
            }
           }
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           ifcanseetarget
           {
            getactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            ifvarvarl TEMPVAR4 TEMPVAR5
            {
             state checkexplodeflag
             setvarvar TEMPVAR4 TEMPVAR5
             setactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
             setactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
   	       ifvarand ACTORFLAGS 2 nullop
             else
             {
              redefinequote 836 ^15PICKED UP A PORTABLE MEDIKIT FOR YOUR VEHICLE!
 	        setvarvar fta fta_normal setvar ftq 836
              setactorvar[PLAYERID].VDISPLAYFAFLASHTIMER -28
             }
	       ifspawnedby FIRSTAID
	        state getcode
	     	else
	     	 state quikget
            }
            else
            {
             state pickupinventory_firstaid
            }
           }
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           ifcanseetarget
           {
            ifvare CHARACTERSELECTED? 13
            {
             setvarvar TEMPVAR MAXHITPOINTS
   	       mulvar TEMPVAR 3
             divvar TEMPVAR 2
             ifvarvarl FIRSTAIDCURRENT TEMPVAR
	       {
              state checkexplodeflag
              setvarvar TEMPVAR MAXHITPOINTS
              mulvar TEMPVAR 3
              divvar TEMPVAR 2 
              setvarvar FIRSTAIDCURRENT TEMPVAR
   	        ifvarand ACTORFLAGS 2 nullop
              else
              {
               setvarvar fta fta_normal setvar ftq 3
               setvar DISPLAYFAFLASHTIMER -28
              }	
              ifspawnedby FIRSTAID
               state getcode
              else
               state quikget
             }
             else
             {
              getactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
              getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
              ifvarvarl TEMPVAR4 TEMPVAR5
              {
               state checkexplodeflag
               setvarvar TEMPVAR4 TEMPVAR5
               setactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
               setactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
    	         ifvarand ACTORFLAGS 2 nullop
               else
               {
                redefinequote 836 ^15PICKED UP A PORTABLE MEDIKIT FOR YOUR VEHICLE!
 	          setvarvar fta fta_normal setvar ftq 836
                setactorvar[PLAYERID].VDISPLAYFAFLASHTIMER -28
               }	
	         ifspawnedby FIRSTAID
	          state getcode
	     	  else
	     	   state quikget
              }
              else
              {
               state pickupinventory_firstaid
              }
             }
            }
            else
            {
             ifvarvarl FIRSTAIDCURRENT MAXHITPOINTS
             {
              state checkexplodeflag
	        setvarvar FIRSTAIDCURRENT MAXHITPOINTS
   	        ifvarand ACTORFLAGS 2 nullop
              else
              {
	         setvarvar fta fta_normal setvar ftq 3
               setvar DISPLAYFAFLASHTIMER -28
              }
	        ifspawnedby FIRSTAID
	         state getcode
	      	 else
	      	  state quikget
	       }
             else
             {
              getactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
              getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
              ifvarvarl TEMPVAR4 TEMPVAR5
              {
               state checkexplodeflag
               setvarvar TEMPVAR4 TEMPVAR5
               setactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
               setactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
    	         ifvarand ACTORFLAGS 2 nullop
               else
               {
                redefinequote 836 ^15PICKED UP A PORTABLE MEDIKIT FOR YOUR VEHICLE!
 	          setvarvar fta fta_normal setvar ftq 836
                setactorvar[PLAYERID].VDISPLAYFAFLASHTIMER -28
               }	
	         ifspawnedby FIRSTAID
	          state getcode
	     	  else
	     	   state quikget
              }
              else
              {
               state pickupinventory_firstaid
              }
             }
            }
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           ifcanseetarget
           {
            getactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            ifvarvarl TEMPVAR4 TEMPVAR5
            {
             state checkexplodeflag
             setvarvar TEMPVAR4 TEMPVAR5
             setactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
             setactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
   	       ifvarand ACTORFLAGS 2 nullop
             else
             {
              redefinequote 836 ^15PICKED UP A PORTABLE MEDIKIT FOR YOUR VEHICLE!
 	        setvarvar fta fta_normal setvar ftq 836
              setactorvar[PLAYERID].VDISPLAYFAFLASHTIMER -28
             }	
	       ifspawnedby FIRSTAID
	        state getcode
	     	else
	     	 state quikget
            }
            else
            {
             ifvare CHARACTERSELECTED? 13
             {
              setvarvar TEMPVAR MAXHITPOINTS
  	        mulvar TEMPVAR 3
              divvar TEMPVAR 2

              ifvarvarl FIRSTAIDCURRENT TEMPVAR
  	        {
               state checkexplodeflag
               setvarvar TEMPVAR MAXHITPOINTS
               mulvar TEMPVAR 3
               divvar TEMPVAR 2 
               setvarvar FIRSTAIDCURRENT TEMPVAR
   	         ifvarand ACTORFLAGS 2 nullop
               else
               {
                setvarvar fta fta_normal setvar ftq 3
                setvar DISPLAYFAFLASHTIMER -28
               }	
               ifspawnedby FIRSTAID
                state getcode
               else
                state quikget
              }
              else
              {
               state pickupinventory_firstaid
              }
             }
             else
             {
              ifvarvarl FIRSTAIDCURRENT MAXHITPOINTS
              {
               state checkexplodeflag
	         setvarvar FIRSTAIDCURRENT MAXHITPOINTS
   	         ifvarand ACTORFLAGS 2 nullop
               else
               {
	          setvarvar fta fta_normal setvar ftq 3
                setvar DISPLAYFAFLASHTIMER -28
               }
	         ifspawnedby FIRSTAID
	          state getcode
  	      	  else
  	          state quikget
	        }
              else
              {
               state pickupinventory_firstaid
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
 }
// Allows Monsters to Pick Up This Item   
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
	   {
          state checkenemypickuphealth
          getactorvar[ITEMSEEK].ENEMYMAXHP ENEMYFIRSTAIDMAX
          getactorvar[ITEMSEEK].ENEMYFIRSTAID ENEMYCURRENTFIRSTAID          

           ifvarg ITEMSEEKB 0
            ifvarvarl ENEMYCURRENTFIRSTAID ENEMYFIRSTAIDMAX
           {
            state checkexplodeflag
            setactorvar[ITEMSEEK].ENEMYFIRSTAID ENEMYFIRSTAIDMAX
            state resetitemtarget
            state getitemseekerspecies
            ifvarand ACTORFLAGS 2 nullop
            else
            {
             globalsound DUKE_GET
             ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT A PORTABLE MEDIKIT!
             ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT A PORTABLE MEDIKIT!
             setactorvar[ITEMSEEK].EDISPLAYFAFLASHTIMER -28
            }
            state enemygrabitemflash
           }
         }
  }
 }
enda

//***************
//*Money Pickups*
//***************

eventloadactor PENNY state setpickupflags enda
useractor notenemy PENNY

 setvar ACTORSHEIGHT 64 setvar ACTORSWIDTH 64
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifpdistl MONEYRETRIEVEDISTANCE
      {
       ifcount 6
       {
        ifcanseetarget
        {
         ifvarvarl DOLLARS MAXDOLLARS // 999999999
         {
          state moneyfs
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           redefinequote 125 ^13FOUND A PENNY!
           setvarvar fta fta_normal setvar ftq 125
          }
          state moneydisplaycheck 
  
          setvarvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags state checkmoneybadge
          addvarvar CENTS ACTORPICKUPAMOUNT
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           addvarvar DISPLAYCENTS ACTORPICKUPAMOUNT
           setvar MONEYGAIN 1 
           state displaymoney
          }
          ifspawnedby PENNY
            state getcode
          else
            state quikget
         }
        }
       }
      }
     }
    }
   }
 }
enda

eventloadactor NICKEL state setpickupflags enda
useractor notenemy NICKEL

 setvar ACTORSHEIGHT 64 setvar ACTORSWIDTH 64
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 1
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON3
        } 
 	  redefinequote 125 ^13FOUND A NICKEL!
        setvarvar fta fta_normal setvar ftq 125
        state moneydisplaycheck
       }
       setvarvar ACTORPICKUPAMOUNT 5
       state checkpickupamountflags state checkmoneybadge
       addvarvar CENTS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYCENTS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby NICKEL
         state getcode
       else
         state quikget
      }
    }
   }
 }
enda

eventloadactor DIME state setpickupflags enda
useractor notenemy DIME

 setvar ACTORSHEIGHT 64 setvar ACTORSWIDTH 64
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 2
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON3
        }
	  redefinequote 125 ^13FOUND A DIME!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 10
       state checkpickupamountflags state checkmoneybadge
       addvarvar CENTS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYCENTS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby DIME
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor QUARTER state setpickupflags enda
useractor notenemy QUARTER

 setvar ACTORSHEIGHT 64 setvar ACTORSWIDTH 64
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 3
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON3
        }
	  redefinequote 125 ^13FOUND A QUARTER!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 25
       state checkpickupamountflags state checkmoneybadge
       addvarvar CENTS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYCENTS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby QUARTER
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor HALFDOLLAR state setpickupflags enda
useractor notenemy HALFDOLLAR

 setvar ACTORSHEIGHT 64 setvar ACTORSWIDTH 64
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 4
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON3
        }
	  redefinequote 125 ^13FOUND A HALF-DOLLAR!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 50
       state checkpickupamountflags state checkmoneybadge
       addvarvar CENTS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYCENTS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby HALFDOLLAR
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor SACDOLLAR state setpickupflags enda
useractor notenemy SACDOLLAR

 setvar ACTORSHEIGHT 64 setvar ACTORSWIDTH 64
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 6
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON1
        }
	  redefinequote 125 ^13FOUND A SACAGAWEA DOLLAR!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 1
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby SACDOLLAR
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor ONEDOLLAR state setpickupflags enda
useractor notenemy ONEDOLLAR

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 6
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON1
        }
	  redefinequote 125 ^13FOUND A $1 BILL!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 1
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby ONEDOLLAR
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor TWODOLLARS state setpickupflags enda
useractor notenemy TWODOLLARS

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 12 
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON1
        }
	  redefinequote 125 ^13FOUND A $2 BILL!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 2
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby TWODOLLARS
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor TWODOLLARBUNDLE state setpickupflags enda
useractor notenemy TWODOLLARBUNDLE

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 12 
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON1
        }
	  redefinequote 125 ^13FOUND A PAIR OF $ONES!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 2
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby TWODOLLARBUNDLE
         state getcode
       else
         state quikget
      }
   }
 }
enda


eventloadactor FIVEDOLLARS state setpickupflags enda
useractor notenemy FIVEDOLLARS
  
 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 24
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON1
        }
	  redefinequote 125 ^13FOUND A $5 BILL!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 5
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby FIVEDOLLARS
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor FIVEDOLLARBUNDLE state setpickupflags enda
useractor notenemy FIVEDOLLARBUNDLE

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 24
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON1
        }
	  redefinequote 125 ^13FOUND FIVE ONE$ BILLS!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 5
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby FIVEDOLLARBUNDLE
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor NINEDOLLARBUNDLE state setpickupflags enda
useractor notenemy NINEDOLLARBUNDLE

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 28
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON1
        }
	  redefinequote 125 ^13FOUND NINE ONE$ BILLS!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 9
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby NINEDOLLARBUNDLE
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor TENDOLLARS state setpickupflags enda
useractor notenemy TENDOLLARS

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 32 
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON1
        }
	  redefinequote 125 ^13FOUND A $10 BILL!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 10
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby TENDOLLARS
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor TENDOLLARBUNDLE state setpickupflags enda
useractor notenemy TENDOLLARBUNDLE

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 32 
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON1
        }
	  redefinequote 125 ^13FOUND TEN ONE$ BILLS!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 10
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby TENDOLLARBUNDLE
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor TWENTYDOLLARS state setpickupflags enda
useractor notenemy TWENTYDOLLARS

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 48
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON1
        }
	  redefinequote 125 ^13FOUND A $20 BILL!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 20
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby TWENTYDOLLARS
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor FIFTYDOLLARS state setpickupflags enda
useractor notenemy FIFTYDOLLARS

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 64
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON1
        }
	  redefinequote 125 ^13FOUND A $50 BILL!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 50
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby FIFTYDOLLARS
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor EIGHTYDOLLARBUNDLE state setpickupflags enda
useractor notenemy EIGHTYDOLLARBUNDLE

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 80
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON1
        }
	  redefinequote 125 ^13FOUND FOUR TWENTY$ BILLS!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 80
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby EIGHTYDOLLARBUNDLE
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor ONEHUNDREDDOLLARS state setpickupflags enda
useractor notenemy ONEHUNDREDDOLLARS

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 96
        {
         ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON1
        }
	  redefinequote 125 ^13FOUND A $100 BILL!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 100
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby ONEHUNDREDDOLLARS
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor FIVEHUNDREDDOLLARS state setpickupflags enda
useractor notenemy FIVEHUNDREDDOLLARS

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 64
        {
         ifvare CHARACTERSELECTED? 1 globalsound JIBBED_ACTOR2
        }
	  redefinequote 125 ^13FOUND A $500 BILL!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 500
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby FIVEHUNDREDDOLLARS
         state getcode
       else
         state quikget
      }
   }
 }
enda


eventloadactor ONETHOUSANDDOLLARS state setpickupflags enda
useractor notenemy ONETHOUSANDDOLLARS

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 96
        {
         ifvare CHARACTERSELECTED? 1 globalsound JIBBED_ACTOR2
        }
	  redefinequote 125 ^13FOUND A $1000 BILL!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 1000
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby ONETHOUSANDDOLLARS
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor FIVETHOUSANDDOLLARS state setpickupflags enda
useractor notenemy FIVETHOUSANDDOLLARS

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 128
        {
         ifvare CHARACTERSELECTED? 1 globalsound JIBBED_ACTOR2
        }
	  redefinequote 125 ^13FOUND A $5000 BILL!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 5000
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby FIVETHOUSANDDOLLARS
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor TENTHOUSANDDOLLARS state setpickupflags enda
useractor notenemy TENTHOUSANDDOLLARS

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 160
        {
         ifvare CHARACTERSELECTED? 1 globalsound JIBBED_ACTOR2
        }
	  redefinequote 125 ^13FOUND A $10000 BILL!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 10000
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby TENTHOUSANDDOLLARS
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor ONEHUNDREDTHOUSANDDOLLARS state setpickupflags enda
useractor notenemy ONEHUNDREDTHOUSANDDOLLARS

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 128
        {
         ifvare CHARACTERSELECTED? 1 globalsound JIBBED_ACTOR4
        }
	  redefinequote 125 ^13FOUND A $100000 BILL!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 100000
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby ONEHUNDREDTHOUSANDDOLLARS
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor ONEMILLIONDOLLARS state setpickupflags enda
useractor notenemy ONEMILLIONDOLLARS

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 192
        {
         ifvare CHARACTERSELECTED? 1 globalsound JIBBED_ACTOR4
        }
	  redefinequote 125 ^13FOUND A MILLION$ BILL!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       setvarvar ACTORPICKUPAMOUNT 1000000
       state checkpickupamountflags state checkmoneybadge
       addvarvar DOLLARS ACTORPICKUPAMOUNT
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby ONEMILLIONDOLLARS
         state getcode
       else
         state quikget
      }
   }
 }
enda

eventloadactor ONEBILLIONDOLLARS state setpickupflags enda
useractor notenemy ONEBILLIONDOLLARS

 setvar ACTORSHEIGHT 256 setvar ACTORSWIDTH 256
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 state setmoneyflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
        ifpdistl MONEYRETRIEVEDISTANCE
            ifcount 6
             ifcanseetarget
	        ifvarvarl DOLLARS MAXDOLLARS // 999999999
      {
       state moneyfs
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        ifrnd 224
        {
         ifvare CHARACTERSELECTED? 1 globalsound JIBBED_ACTOR4
        }
	  redefinequote 125 ^13FOUND A BILLION$ BILL!
        setvarvar fta fta_normal setvar ftq 125
       }
       state moneydisplaycheck
       addvar DOLLARS 1000000000
       ifvarand ACTORFLAGS 2 nullop
       else
       {
        addvar DISPLAYDOLLARS 1000000000
        setvar MONEYGAIN 1 
        state displaymoney
       }
       ifspawnedby ONEBILLIONDOLLARS
         state getcode
       else
         state quikget
      }
   }
 }
enda

//************************
//*Start of Medikit Items*
//************************

state pickupcharacter_swmedikit
          state checkexplodeflag
          state medikitplayer
          qsprintf 145 253 TEMPHEALTH 
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvarvar fta fta_normal setvar ftq 145
          }
          ifspawnedby SWMEDIKIT
           state getcode
          else
           state quikget
ends

state pickupvehicle_swmedikit
          state checkexplodeflag
          state medikitvehicle
          qsprintf 145 253 TEMPHEALTH 
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           redefinequote 836 ^15GRABBED A MEDIUM MEDIKIT FOR YOUR VEHICLE!
           setvarvar fta fta_normal setvar ftq 836
          }
          ifspawnedby SWMEDIKIT
           state getcode
          else
           state quikget
ends

state pickupinventory_swmedikit
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags
           addvarvar SWMEDIKITS ACTORPICKUPAMOUNT
           ifvarand ACTORFLAGS 2 nullop
           else
           {
            ifvare ACTORPICKUPAMOUNT 1
            {
             redefinequote 836 ^14 STORED A MEDIUM MEDIKIT INTO INVENTORY!
            }
            else
            {
             redefinequote 836 ^14 STORED %ld MEDIUM MEDIKITS INTO INVENTORY!
             qsprintf 836 836 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           globalsound FOUND_INVENTORY
      	     ifspawnedby SWMEDIKIT
	      state getcode
           else
            state quikget
          }
ends

eventloadactor SWMEDIKIT state setpickupflags enda
useractor notenemy SWMEDIKIT 0 

 state checkrandomhealitem
 sizeat 32 32 // 32 32 seems to be the correct size for a custom item relative to other items
 setvar ACTORSHEIGHT 18 setvar ACTORSWIDTH 23
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifpdistl RETRIEVEDISTANCE
      {
       ifcount 6
       {
        ifcanseetarget
     	  {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_swmedikit else state pickupinventory_swmedikit
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_swmedikit else state pickupinventory_swmedikit
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_swmedikit else state pickupinventory_swmedikit
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_swmedikit
           else
           {
            getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_swmedikit else state pickupinventory_swmedikit
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_swmedikit
           else
           {
            ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_swmedikit else state pickupinventory_swmedikit
           }
          }
         }
        }
       }
      }
     }
    }
   }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1 state medikitmonster
  }
}
enda

state pickupcharacter_swbigmedikit
          state checkexplodeflag
          state medikitplayer
          qsprintf 147 256 TEMPHEALTH 
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvarvar fta fta_normal setvar ftq 147
          }
          ifspawnedby SWBIGMEDIKIT
           state getcode
          else
           state quikget
ends

state pickupvehicle_swbigmedikit
          state checkexplodeflag
          state medikitvehicle
          qsprintf 147 256 TEMPHEALTH 
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           redefinequote 836 ^15GRABBED AN EXTRA-LARGE MEDIKIT FOR YOUR VEHICLE!
           setvarvar fta fta_normal setvar ftq 836
          }
          ifspawnedby SWBIGMEDIKIT
           state getcode
          else
           state quikget
ends

state pickupinventory_swbigmedikit
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags
           addvarvar SWBIGMEDIKITS ACTORPICKUPAMOUNT
           ifvarand ACTORFLAGS 2 nullop
           else
           {
            ifvare ACTORPICKUPAMOUNT 1
            {
             redefinequote 836 ^14 STORED AN EXTRA-LARGE MEDIKIT INTO INVENTORY!
            }
            else
            {
             redefinequote 836 ^14 STORED %ld EXTRA-LARGE MEDIKITS INTO INVENTORY!
             qsprintf 836 836 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           globalsound FOUND_INVENTORY
           ifspawnedby SWBIGMEDIKIT 
	      state getcode
           else
            state quikget
          }
ends

eventloadactor SWBIGMEDIKIT state setpickupflags enda
useractor notenemy SWBIGMEDIKIT 0 

 state checkrandomhealitem
 sizeat 32 32 // 32 32 seems to be the correct size for a custom item relative to other items
 setvar ACTORSHEIGHT 24 setvar ACTORSWIDTH 32
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifpdistl RETRIEVEDISTANCE
      {
       ifcount 6
       {
        ifcanseetarget
      	  {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_swbigmedikit else state pickupinventory_swbigmedikit
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_swbigmedikit else state pickupinventory_swbigmedikit
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_swbigmedikit else state pickupinventory_swbigmedikit
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_swbigmedikit
           else
           {
            getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_swbigmedikit else state pickupinventory_swbigmedikit
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_swbigmedikit
           else
           {
            ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_swbigmedikit else state pickupinventory_swbigmedikit
           }
          }
         }
        }
       }
      }
     }
    }
   }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1 state medikitmonster
  }

}
enda

state pickupcharacter_medpack
             state checkexplodeflag
 	 	state medikitplayer
	  	qsprintf 158 258 TEMPHEALTH 
             ifvarand ACTORFLAGS 2 nullop
             else
             {
	  	 setvarvar fta fta_normal setvar ftq 158
             }
             ifspawnedby MEDPACK
              state getcode
             else
              state quikget
ends

state pickupvehicle_medpack
             state checkexplodeflag
 	 	state medikitvehicle
	  	qsprintf 158 258 TEMPHEALTH 
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              redefinequote 836 ^15GRABBED A MED PACK FOR YOUR VEHICLE!
	  	 setvarvar fta fta_normal setvar ftq 836
             }
             ifspawnedby MEDPACK
              state getcode
             else
              state quikget
ends

state pickupinventory_medpack
            ifvarn oldskoolmode 1
            {
             state checkexplodeflag
             setvarvar ACTORPICKUPAMOUNT 1
             state checkpickupamountflags
             addvarvar MEDPACKS ACTORPICKUPAMOUNT
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              ifvare ACTORPICKUPAMOUNT 1
              {
               redefinequote 836 ^14 STORED A MED PACK INTO INVENTORY!
              }
              else
              {
               redefinequote 836 ^14 STORED %ld MED PACKS INTO INVENTORY!
               qsprintf 836 836 ACTORPICKUPAMOUNT
              }
              setvarvar fta fta_normal setvar ftq 836
             }
             globalsound FOUND_INVENTORY
             ifspawnedby MEDPACK
	        state getcode
             else
              state quikget
            }
ends

eventloadactor MEDPACK state setpickupflags enda
useractor notenemy MEDPACK 0 

 state checkrandomhealitem
 sizeat 40 40 // 32 32 seems to be the correct size for a custom item relative to other items
 setvar ACTORSHEIGHT 24 setvar ACTORSWIDTH 20
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarg ITEMDROPPEDTIME 0
 {
  ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
 }
 else
 {
  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifmove RESPAWN_ACTOR_FLAG state respawnit
   else
   {
    ifvare mainmenu 0
    {
     ifp pshrunk nullop
     else
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {

         ifcanseetarget
         {
          getactorvar[PLAYERID].VEHICLEID tempvehicleid
          ifvare tempvehicleid -1
          {
           ifvare CHARACTERSELECTED? 13
           {
            setvarvar TEMP MAXHITPOINTS
            mulvarvar TEMP 9
            divvarvar TEMP 8
            ifvarvarl CURRENTHITPOINTS TEMP state pickupcharacter_medpack else state pickupinventory_medpack
           }
           else
           {
            ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_medpack else state pickupinventory_medpack
           }
          }
          else
          {
           ifvare vehiclepickuptoggle 0 // Character Only
           {
            ifvare CHARACTERSELECTED? 13
            {
             setvarvar TEMP MAXHITPOINTS
             mulvarvar TEMP 9
             divvarvar TEMP 8
             ifvarvarl CURRENTHITPOINTS TEMP state pickupcharacter_medpack else state pickupinventory_medpack
            }
            else
            {
             ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_medpack else state pickupinventory_medpack
            }
           }
           ifvare vehiclepickuptoggle 1 // Vehicle Only
           {
            getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_medpack else state pickupinventory_medpack
           }
           ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
           {
            ifvare CHARACTERSELECTED? 13
            {
             setvarvar TEMP MAXHITPOINTS
             mulvarvar TEMP 9
             divvarvar TEMP 8
             ifvarvarl CURRENTHITPOINTS TEMP state pickupcharacter_medpack
             else
             {
              getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
              getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
              ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_medpack else state pickupinventory_medpack
             }
            }
            else
            {
             ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_medpack
             else
             {
              getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
              getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
              ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_medpack else state pickupinventory_medpack
             }
            }
           }
           ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
           {
            getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_medpack
            else
            {
             ifvare CHARACTERSELECTED? 13
             {
              setvarvar TEMP MAXHITPOINTS
              mulvarvar TEMP 9
              divvarvar TEMP 8
              ifvarvarl CURRENTHITPOINTS TEMP state pickupcharacter_medpack else state pickupinventory_medpack
             }
             else
             {
              ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_medpack else state pickupinventory_medpack
             }
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }

// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1 state medikitmonster
  }

 }
enda

state pickupcharacter_surgerykit
             state checkexplodeflag
	  	state medikitplayer
	  	qsprintf 159 259 TEMPHEALTH 
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              setvarvar fta fta_normal setvar ftq 159
             }
	  	ifspawnedby SURGERYKIT
	  	 state getcode
	  	else
	    	 state quikget
ends

state pickupvehicle_surgerykit
             state checkexplodeflag
	  	state medikitvehicle
	  	qsprintf 159 259 TEMPHEALTH 
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              redefinequote 836 ^15GRABBED A SURGERY KIT FOR YOUR VEHICLE!
              setvarvar fta fta_normal setvar ftq 836
             }
	  	ifspawnedby SURGERYKIT
	  	 state getcode
	  	else
	    	 state quikget
ends

state pickupinventory_surgerykit
            ifvarn oldskoolmode 1
            {
             state checkexplodeflag
             setvarvar ACTORPICKUPAMOUNT 1
             state checkpickupamountflags
             addvarvar SURGERYKITS ACTORPICKUPAMOUNT
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              ifvare ACTORPICKUPAMOUNT 1
              {
               redefinequote 836 ^14 STORED A SURGERY KIT INTO INVENTORY!
              }
              else
              {
               redefinequote 836 ^14 STORED %ld SURGERY KITS INTO INVENTORY!
               qsprintf 836 836 ACTORPICKUPAMOUNT
              }
              setvarvar fta fta_normal setvar ftq 836
             }
             globalsound FOUND_INVENTORY
      	       ifspawnedby SURGERYKIT
	        state getcode
             else
              state quikget
            }
ends

eventloadactor SURGERYKIT state setpickupflags enda
useractor notenemy SURGERYKIT 0 

 state checkrandomhealitem
 sizeat 40 40 // 32 32 seems to be the correct size for a custom item relative to other items
 setvar ACTORSHEIGHT 24 setvar ACTORSWIDTH 32
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarg ITEMDROPPEDTIME 0
 {
  ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
 }
 else
 {
  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifmove RESPAWN_ACTOR_FLAG state respawnit 
   else
   {
    ifvare mainmenu 0
    {
     ifp pshrunk nullop
     else
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         ifcanseetarget
         {
          getactorvar[PLAYERID].VEHICLEID tempvehicleid
          ifvare tempvehicleid -1
          {
           ifvare CHARACTERSELECTED? 13
           { 
            setvarvar TEMP MAXHITPOINTS
            mulvarvar TEMP 3
            divvarvar TEMP 2
            ifvarvarl CURRENTHITPOINTS TEMP state pickupcharacter_surgerykit else state pickupinventory_surgerykit
           }
           else
           {
            ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_surgerykit else state pickupinventory_surgerykit
           }
          }
          else
          {
           ifvare vehiclepickuptoggle 0 // Character Only
           {
            ifvare CHARACTERSELECTED? 13
            { 
             setvarvar TEMP MAXHITPOINTS
             mulvarvar TEMP 3
             divvarvar TEMP 2
             ifvarvarl CURRENTHITPOINTS TEMP state pickupcharacter_surgerykit else state pickupinventory_surgerykit
            }
            else
            {
             ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_surgerykit else state pickupinventory_surgerykit
            }
           }
           ifvare vehiclepickuptoggle 1 // Vehicle Only
           {
            getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_surgerykit else state pickupinventory_surgerykit
           }
           ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
           {
            ifvare CHARACTERSELECTED? 13
            { 
             setvarvar TEMP MAXHITPOINTS
             mulvarvar TEMP 3
             divvarvar TEMP 2
             ifvarvarl CURRENTHITPOINTS TEMP
             {
              state pickupcharacter_surgerykit
             }
             else
             {
              getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
              getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
              ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_surgerykit else state pickupinventory_surgerykit
             }
            }
            else
            {
             ifvarvarl CURRENTHITPOINTS MAXHITPOINTS
             {
              state pickupcharacter_surgerykit
             }
             else
             {
              getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
              getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
              ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_surgerykit else state pickupinventory_surgerykit
             }
            }
           }
           ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
           {
            getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            ifvarvarl TEMPVAR4 TEMPVAR5
            {
             state pickupvehicle_surgerykit
            }
            else
            {
             ifvare CHARACTERSELECTED? 13
             { 
              setvarvar TEMP MAXHITPOINTS
              mulvarvar TEMP 3
              divvarvar TEMP 2
              ifvarvarl CURRENTHITPOINTS TEMP state pickupcharacter_surgerykit else state pickupinventory_surgerykit
             }
             else
             {
              ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pickupcharacter_surgerykit else state pickupinventory_surgerykit
             }
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }

// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1 state medikitmonster
  }

 }
enda

//************************
//*Start of "Bonus" Items*
//************************

state pickupcharacter_maxhpup
          state checkexplodeflag
          state calcmaxhpbonus
	    qsprintf 160 261 TEMPHITPOINTS 
          ifvarand ACTORFLAGS 2 nullop
          else
          {
	     setvarvar fta fta_normal setvar ftq 160
          }
          ifspawnedby MAXHPUP
           state getcode
	    else
           state quikget
ends

state pickupvehicle_maxhpup
          state checkexplodeflag
          state calcmaxhpbonus_vehicle
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           redefinequote 836 ^15YOUR VEHICLE GRABBED A MAXIMUM HP BONUS! (^21+%ld^15)
           qsprintf 836 836 TEMPHITPOINTS 
	     setvarvar fta fta_normal setvar ftq 836
          }
          ifspawnedby MAXHPUP
           state getcode
	    else
           state quikget
ends

eventloadactor MAXHPUP state setpickupflags enda
useractor notenemy MAXHPUP 0 

 ifvare FLAGSSET? 0
 {
  ifspritepal 9 { sizeat 144 144 setactorvar[THISACTOR].ACTORNATURALPAL 9 }
  else ifspritepal 3 { sizeat 96 96 setactorvar[THISACTOR].ACTORNATURALPAL 3 }
  else { sizeat 48 48 setactorvar[THISACTOR].ACTORNATURALPAL 0 }
  setvar FLAGSSET? 1
 }
 state itemfullbright
 setvar ACTORSHEIGHT 21 setvar ACTORSWIDTH 25
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvare mainmenu 0 state fallflags

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit 
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          ifvarvarl CURRENTHITPOINTS STATLIMITATOMIC state pickupcharacter_maxhpup
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           ifvarvarl CURRENTHITPOINTS STATLIMITATOMIC state pickupcharacter_maxhpup
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           ifvarvarl TEMPVAR4 STATLIMITATOMIC state pickupvehicle_maxhpup
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           ifvarvarl CURRENTHITPOINTS STATLIMITATOMIC state pickupcharacter_maxhpup
           else
           {
            getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            ifvarvarl TEMPVAR4 STATLIMITATOMIC state pickupvehicle_maxhpup
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           ifvarvarl TEMPVAR4 STATLIMITATOMIC state pickupvehicle_maxhpup
           else
           {
            ifvarvarl CURRENTHITPOINTS STATLIMITATOMIC state pickupcharacter_maxhpup
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
    state checkenemypickuphealth
    getactorvar[ITEMSEEK].ENEMYHP ITEMSEEKB
    getactorvar[ITEMSEEK].ENEMYMAXHP temp

    ifvarg ITEMSEEKB 0 ifvarvarl ITEMSEEKB STATLIMITATOMIC
    {
     state checkexplodeflag
     state bonusitemvarience
     addvarvar ITEMSEEKB ITEMSEEKC
     ifvarvarg ITEMSEEKB STATLIMITATOMIC setvarvar ITEMSEEKB STATLIMITATOMIC
     setactorvar[ITEMSEEK].ENEMYHP ITEMSEEKB
     ifvarvarg temp STATLIMIT setvarvar temp STATLIMIT
     setactorvar[ITEMSEEK].ENEMYMAXHP temp
     state resetitemtarget
     state bonusgrabactor
     state getitemseekerspecies
     ifvarand ACTORFLAGS 4 nullop
     else
     {
      ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT A MAX HP BONUS! :(
      ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT A MAX HP BONUS! :O
     }
     state enemygrabitemflash
     setvar WORLDTILESHUFFLES 0
     state getworldtile
    }
   }
  }
enda

state pickupcharacter_maxapup
          state checkexplodeflag
          state calcmaxapbonus
      	    qsprintf 161 262 TEMPARMORPOINTS 
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvarvar fta fta_normal setvar ftq 161
          }
          ifspawnedby MAXAPUP
           state getcode
          else
           state quikget
ends

state pickupvehicle_maxapup
          state checkexplodeflag
          state calcmaxapbonus_vehicle
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           redefinequote 836 ^15YOUR VEHICLE GRABBED A MAXIMUM AP BONUS! (^17+%ld^15)
           qsprintf 836 836 TEMPARMORPOINTS 
	     setvarvar fta fta_normal setvar ftq 836
          }
          ifspawnedby MAXAPUP
           state getcode
          else
           state quikget
ends

eventloadactor MAXAPUP state setpickupflags enda
useractor notenemy MAXAPUP 0 

 ifvare FLAGSSET? 0
 {
  ifspritepal 9 { sizeat 144 144 setactorvar[THISACTOR].ACTORNATURALPAL 9 }
  else ifspritepal 3 { sizeat 96 96 setactorvar[THISACTOR].ACTORNATURALPAL 3 }
  else { sizeat 48 48 setactorvar[THISACTOR].ACTORNATURALPAL 0 }
  setvar FLAGSSET? 1
 }
 state itemfullbright
 setvar ACTORSHEIGHT 21 setvar ACTORSWIDTH 25
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit 
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          ifvarvarl CURRENTARMORPOINTS STATLIMITATOMIC state pickupcharacter_maxapup
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           ifvarvarl CURRENTARMORPOINTS STATLIMITATOMIC state pickupcharacter_maxapup
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
           ifvarvarl TEMPVAR4 STATLIMITATOMIC state pickupvehicle_maxapup
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           ifvarvarl CURRENTARMORPOINTS STATLIMITATOMIC state pickupcharacter_maxapup
           else
           {
            getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
            ifvarvarl TEMPVAR4 STATLIMITATOMIC state pickupvehicle_maxapup
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
           ifvarvarl TEMPVAR4 STATLIMITATOMIC state pickupvehicle_maxapup
           else
           {
            ifvarvarl CURRENTARMORPOINTS STATLIMITATOMIC state pickupcharacter_maxapup
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
    state checkenemypickuphealth
    getactorvar[ITEMSEEK].ENEMYAP TEMPVAR3
    getactorvar[ITEMSEEK].ENEMYMAXAP temp

    ifvarg ITEMSEEKB 0 ifvarvarl TEMPVAR3 STATLIMITATOMIC
    {
     state checkexplodeflag
     state bonusitemvarience
     addvarvar TEMPVAR3 ITEMSEEKC
     ifvarvarg ITEMSEEKB STATLIMITATOMIC setvarvar ITEMSEEKB STATLIMITATOMIC
     setactorvar[ITEMSEEK].ENEMYAP TEMPVAR3
     ifvarvarg temp STATLIMIT setvarvar temp STATLIMIT
     setactorvar[ITEMSEEK].ENEMYMAXAP temp

     state resetitemtarget
     state bonusgrabactor
     state getitemseekerspecies
     ifvarand ACTORFLAGS 4 nullop
     else
     {
      ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT A MAX AP BONUS! :(
      ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT A MAX AP BONUS! :O
     }
     state enemygrabitemflash
     setvar WORLDTILESHUFFLES 0
     state getworldtile
    }
   }
  }
enda

eventloadactor MAXHPAPUP state setpickupflags enda
useractor notenemy MAXHPAPUP 0 

 ifvare FLAGSSET? 0
 {
  ifspritepal 9 { sizeat 144 144 setactorvar[THISACTOR].ACTORNATURALPAL 9 }
  else ifspritepal 3 { sizeat 96 96 setactorvar[THISACTOR].ACTORNATURALPAL 3 }
  else { sizeat 48 48 setactorvar[THISACTOR].ACTORNATURALPAL 0 }
  setvar FLAGSSET? 1
 }
 state itemfullbright
 setvar ACTORSHEIGHT 21 setvar ACTORSWIDTH 25
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit 
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifpdistl RETRIEVEDISTANCE
      {
       ifcount 6
       {
        ifcanseetarget
	  {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          setvarvar TEMPVAR STATLIMITATOMIC
          subvar TEMPVAR 1
 	    ifvarvarg CURRENTHITPOINTS TEMPVAR
 	    {
           setvarvar TEMPVAR STATLIMITATOMIC
           subvar TEMPVAR 1
           ifvarvarg CURRENTARMORPOINTS TEMPVAR nullop
           else
           {
            state checkexplodeflag
            state maxhpapbonusgive
	      ifspawnedby MAXHPAPUP
	       state getcode
	      else
	       state quikget
           }
          }
          else
          {
           state checkexplodeflag
           state maxhpapbonusgive
           ifspawnedby MAXHPAPUP
            state getcode
           else
            state quikget
          }
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           setvarvar TEMPVAR STATLIMITATOMIC
           subvar TEMPVAR 1
 	     ifvarvarg CURRENTHITPOINTS TEMPVAR
 	     {
            setvarvar TEMPVAR STATLIMITATOMIC
            subvar TEMPVAR 1
            ifvarvarg CURRENTARMORPOINTS TEMPVAR nullop
            else
            {
             state checkexplodeflag
             state maxhpapbonusgive
	       ifspawnedby MAXHPAPUP
	        state getcode
	       else
	        state quikget
            }
           }
           else
           {
            state checkexplodeflag
            state maxhpapbonusgive
            ifspawnedby MAXHPAPUP
             state getcode
            else
             state quikget
           }
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           setvarvar TEMPVAR STATLIMITATOMIC
           subvar TEMPVAR 1
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           ifvarvarg TEMPVAR4 TEMPVAR5
 	     {
            setvarvar TEMPVAR STATLIMITATOMIC
            subvar TEMPVAR 1
            getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
            ifvarvarg TEMPVAR4 TEMPVAR5 nullop
            else
            {
             state checkexplodeflag
             state maxhpapbonusgive_vehicle
	       ifspawnedby MAXHPAPUP
	        state getcode
	       else
	        state quikget
            }
           }
           else
           {
            state checkexplodeflag
            state maxhpapbonusgive_vehicle
            ifspawnedby MAXHPAPUP
             state getcode
            else
             state quikget
           }
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           setvarvar TEMPVAR STATLIMITATOMIC
           subvar TEMPVAR 1
 	     ifvarvarg CURRENTHITPOINTS TEMPVAR
 	     {
            setvarvar TEMPVAR STATLIMITATOMIC
            subvar TEMPVAR 1
            ifvarvarg CURRENTARMORPOINTS TEMPVAR
            {
             setvarvar TEMPVAR STATLIMITATOMIC
             subvar TEMPVAR 1
             getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
             getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
             ifvarvarg TEMPVAR4 TEMPVAR5
             {
              setvarvar TEMPVAR STATLIMITATOMIC
              subvar TEMPVAR 1
              getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
              getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
              ifvarvarg TEMPVAR4 TEMPVAR5 nullop
              else
              {
               state checkexplodeflag
               state maxhpapbonusgive_vehicle
	         ifspawnedby MAXHPAPUP
	          state getcode
	         else
	          state quikget
              }
             }
             else
             {
              state checkexplodeflag
              state maxhpapbonusgive_vehicle
              ifspawnedby MAXHPAPUP
               state getcode
              else
               state quikget
             }
            }
            else
            {
             state checkexplodeflag
             state maxhpapbonusgive
	       ifspawnedby MAXHPAPUP
	        state getcode
	       else
	        state quikget
            }
           }
           else
           {
            state checkexplodeflag
            state maxhpapbonusgive
            ifspawnedby MAXHPAPUP
             state getcode
            else
             state quikget
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           setvarvar TEMPVAR STATLIMITATOMIC
           subvar TEMPVAR 1
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           ifvarvarg TEMPVAR4 TEMPVAR5
 	     {
            setvarvar TEMPVAR STATLIMITATOMIC
            subvar TEMPVAR 1
            getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
            ifvarvarg TEMPVAR4 TEMPVAR5
            {
             setvarvar TEMPVAR STATLIMITATOMIC
             subvar TEMPVAR 1
 	       ifvarvarg CURRENTHITPOINTS TEMPVAR
 	       {
              setvarvar TEMPVAR STATLIMITATOMIC
              subvar TEMPVAR 1
              ifvarvarg CURRENTARMORPOINTS TEMPVAR nullop
              else
              {
               state checkexplodeflag
               state maxhpapbonusgive
	         ifspawnedby MAXHPAPUP
	          state getcode
	         else
	          state quikget
              }
             }
             else
             {
              state checkexplodeflag
              state maxhpapbonusgive
              ifspawnedby MAXHPAPUP
               state getcode
              else
               state quikget
             }
            }
            else
            {
             state checkexplodeflag
             state maxhpapbonusgive_vehicle
	       ifspawnedby MAXHPAPUP
	        state getcode
	       else
	        state quikget
            }
           }
           else
           {
            state checkexplodeflag
            state maxhpapbonusgive_vehicle
            ifspawnedby MAXHPAPUP
             state getcode
            else
             state quikget
           }
          }
         }

	  }
       }
      }
     }
    }
   }
  }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
    state checkenemypickuphealth
    getactorvar[ITEMSEEK].ENEMYHP tempb
    getactorvar[ITEMSEEK].ENEMYAP tempc

    setvarvar TEMPVAR STATLIMITATOMIC
    subvar TEMPVAR 1
    ifvarvarg tempb TEMPVAR
    {
     setvarvar TEMPVAR STATLIMITATOMIC
     subvar TEMPVAR 1
     ifvarvarg tempc TEMPVAR nullop
     else
     {
      state checkexplodeflag
      state maxhpapbonusgive2
     }
    }
    else
    {
     state checkexplodeflag
     state maxhpapbonusgive2
    }
   }
  }
enda

state pickupcharacter_atkup
          state checkexplodeflag
          state calcatkbonus
          qsprintf 326 329 ATKINCREASED
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvarvar fta fta_normal setvar ftq 326
          }
          ifspawnedby ATKUP
           state getcode
          else
           state quikget
ends

state pickupvehicle_atkup
          state checkexplodeflag
          state calcatkbonus_vehicle
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           redefinequote 836 ^15YOUR VEHICLE GRABBED AN ATTACK BONUS! (^10+%ld^15)
           qsprintf 836 836 ATKINCREASED
           setvarvar fta fta_normal setvar ftq 836
          }
          ifspawnedby ATKUP
           state getcode
          else
           state quikget
ends

eventloadactor ATKUP state setpickupflags enda
useractor notenemy ATKUP 0 

 ifvare FLAGSSET? 0
 {
  ifspritepal 9 { sizeat 144 144 setactorvar[THISACTOR].ACTORNATURALPAL 9 }
  else ifspritepal 3 { sizeat 96 96 setactorvar[THISACTOR].ACTORNATURALPAL 3 }
  else { sizeat 48 48 setactorvar[THISACTOR].ACTORNATURALPAL 0 }
  setvar FLAGSSET? 1
 }
 state itemfullbright
 setvar ACTORSHEIGHT 21 setvar ACTORSWIDTH 24
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit 
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          ifvarvarl PLAYERATTACK STATLIMIT state pickupcharacter_atkup
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           ifvarvarl PLAYERATTACK STATLIMIT state pickupcharacter_atkup
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           getactorvar[tempvehicleid].ACTORATTACK TEMPVAR5
           ifvarvarl TEMPVAR5 STATLIMIT state pickupvehicle_atkup
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           ifvarvarl PLAYERATTACK STATLIMIT state pickupcharacter_atkup
           else
           {
            getactorvar[tempvehicleid].ACTORATTACK TEMPVAR5
            ifvarvarl TEMPVAR5 STATLIMIT state pickupvehicle_atkup
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           getactorvar[tempvehicleid].ACTORATTACK TEMPVAR5
           ifvarvarl TEMPVAR5 STATLIMIT state pickupvehicle_atkup
           else
           {
            ifvarvarl PLAYERATTACK STATLIMIT state pickupcharacter_atkup
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
    state checkenemypickuphealth
    getactorvar[ITEMSEEK].ACTORATTACK temp

    ifvarg ITEMSEEKB 0 ifvarvarl temp STATLIMIT
    {
     state checkexplodeflag
     state bonusitemvarience
     setactorvar[ITEMSEEK].ACTORATTACK temp
     state resetitemtarget
     state bonusgrabactor
     state getitemseekerspecies
     ifvarand ACTORFLAGS 4 nullop
     else
     {
      ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT AN ATTACK BONUS! :(
      ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT AN ATTACK BONUS! :O
     }
     state enemygrabitemflash
     setvar WORLDTILESHUFFLES 0
     state getworldtile
    }
   }
  }
enda

state pickupcharacter_defup
          state checkexplodeflag
          state calcdefbonus
     	    qsprintf 327 330 DEFINCREASED 
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvarvar fta fta_normal setvar ftq 327
          }
          ifspawnedby DEFUP
           state getcode
          else
           state quikget
ends

state pickupvehicle_defup
          state checkexplodeflag
          state calcdefbonus_vehicle
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           redefinequote 836 ^15YOUR VEHICLE GRABBED A DEFENSE BONUS! (^14+%ld^15)
      	     qsprintf 836 836 DEFINCREASED 
           setvarvar fta fta_normal setvar ftq 836
          }
          ifspawnedby DEFUP
           state getcode
          else
           state quikget
ends

eventloadactor DEFUP state setpickupflags enda
useractor notenemy DEFUP 0 

 ifvare FLAGSSET? 0
 {
  ifspritepal 9 { sizeat 144 144 setactorvar[THISACTOR].ACTORNATURALPAL 9 }
  else ifspritepal 3 { sizeat 96 96 setactorvar[THISACTOR].ACTORNATURALPAL 3 }
  else { sizeat 48 48 setactorvar[THISACTOR].ACTORNATURALPAL 0 }
  setvar FLAGSSET? 1
 }
 state itemfullbright
 setvar ACTORSHEIGHT 21 setvar ACTORSWIDTH 24
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit 
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          ifvarvarl PLAYERDEFENSE STATLIMIT state pickupcharacter_defup
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           ifvarvarl PLAYERDEFENSE STATLIMIT state pickupcharacter_defup
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           getactorvar[tempvehicleid].ACTORDEFENSE TEMPVAR5
           ifvarvarl TEMPVAR5 STATLIMIT state pickupvehicle_defup
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           ifvarvarl PLAYERDEFENSE STATLIMIT state pickupcharacter_defup
           else
           {
            getactorvar[tempvehicleid].ACTORDEFENSE TEMPVAR5
            ifvarvarl TEMPVAR5 STATLIMIT state pickupvehicle_defup
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           getactorvar[tempvehicleid].ACTORDEFENSE TEMPVAR5
           ifvarvarl TEMPVAR5 STATLIMIT state pickupvehicle_defup
           else
           {
            ifvarvarl PLAYERDEFENSE STATLIMIT state pickupcharacter_defup
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
    state checkenemypickuphealth
    getactorvar[ITEMSEEK].ACTORDEFENSE temp

    ifvarg ITEMSEEKB 0 ifvarvarl temp STATLIMIT
    {
     state checkexplodeflag
     state bonusitemvarience
     setactorvar[ITEMSEEK].ACTORDEFENSE temp
     state resetitemtarget
     state bonusgrabactor
     state getitemseekerspecies
     ifvarand ACTORFLAGS 4 nullop
     else
     {
      ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT A DEFENSE BONUS! :(
      ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT A DEFENSE BONUS! :O
     }
     state enemygrabitemflash
     setvar WORLDTILESHUFFLES 0
     state getworldtile
    }
   }
  }
enda

eventloadactor ATKDEFUP state setpickupflags enda
useractor notenemy ATKDEFUP 0 

 ifvare FLAGSSET? 0
 {
  ifspritepal 9 { sizeat 144 144 setactorvar[THISACTOR].ACTORNATURALPAL 9 }
  else ifspritepal 3 { sizeat 96 96 setactorvar[THISACTOR].ACTORNATURALPAL 3 }
  else { sizeat 48 48 setactorvar[THISACTOR].ACTORNATURALPAL 0 }
  setvar FLAGSSET? 1
 }
 state itemfullbright
 setvar ACTORSHEIGHT 21 setvar ACTORSWIDTH 24
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit 
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          ifvarvare PLAYERATTACK STATLIMIT
          {
           ifvarvare PLAYERDEFENSE STATLIMIT nullop
           else
           {
            state checkexplodeflag
            state atkdefbonusgive
            ifspawnedby ATKDEFUP
             state getcode
            else
             state quikget
           }
          }
          else
          {
           state checkexplodeflag
           state atkdefbonusgive
           ifspawnedby ATKDEFUP
            state getcode
           else
            state quikget
          }
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           ifvarvare PLAYERATTACK STATLIMIT
           {
            ifvarvare PLAYERDEFENSE STATLIMIT nullop
            else
            {
             state checkexplodeflag
             state atkdefbonusgive
             ifspawnedby ATKDEFUP
              state getcode
             else
              state quikget
            }
           }
           else
           {
            state checkexplodeflag
            state atkdefbonusgive
            ifspawnedby ATKDEFUP
             state getcode
            else
             state quikget
           }
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           getactorvar[tempvehicleid].ACTORATTACK TEMPVAR5
           ifvarvare TEMPVAR5 STATLIMIT
           {
            getactorvar[tempvehicleid].ACTORDEFENSE TEMPVAR5
            ifvarvare TEMPVAR5 STATLIMIT nullop
            else
            {
             state checkexplodeflag
             state atkdefbonusgive_vehicle
             ifspawnedby ATKDEFUP
              state getcode
             else
              state quikget
            }
           }
           else
           {
            state checkexplodeflag
            state atkdefbonusgive_vehicle
            ifspawnedby ATKDEFUP
             state getcode
            else
             state quikget
           }
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           ifvarvare PLAYERATTACK STATLIMIT
           {
            ifvarvare PLAYERDEFENSE STATLIMIT
            {
             getactorvar[tempvehicleid].ACTORATTACK TEMPVAR5
             ifvarvare TEMPVAR5 STATLIMIT
             {
              getactorvar[tempvehicleid].ACTORDEFENSE TEMPVAR5
              ifvarvare TEMPVAR5 STATLIMIT nullop
              else
              {
               state checkexplodeflag
               state atkdefbonusgive_vehicle
               ifspawnedby ATKDEFUP
                state getcode
               else
                state quikget
              }
             }
             else
             {
              state checkexplodeflag
              state atkdefbonusgive_vehicle
              ifspawnedby ATKDEFUP
               state getcode
              else
               state quikget
             }
            }
            else
            {
             state checkexplodeflag
             state atkdefbonusgive
             ifspawnedby ATKDEFUP
              state getcode
             else
              state quikget
            }
           }
           else
           {
            state checkexplodeflag
            state atkdefbonusgive
            ifspawnedby ATKDEFUP
             state getcode
            else
             state quikget
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           getactorvar[tempvehicleid].ACTORATTACK TEMPVAR5
           ifvarvare TEMPVAR5 STATLIMIT
           {
            getactorvar[tempvehicleid].ACTORDEFENSE TEMPVAR5
            ifvarvare TEMPVAR5 STATLIMIT
            {
             ifvarvare PLAYERATTACK STATLIMIT
             {
              ifvarvare PLAYERDEFENSE STATLIMIT nullop
              else
              {
               state checkexplodeflag
               state atkdefbonusgive
               ifspawnedby ATKDEFUP
                state getcode
               else
                state quikget
              }
             }
             else
             {
              state checkexplodeflag
              state atkdefbonusgive
              ifspawnedby ATKDEFUP
               state getcode
              else
               state quikget
             }
            }
            else
            {
             state checkexplodeflag
             state atkdefbonusgive_vehicle
             ifspawnedby ATKDEFUP
              state getcode
             else
              state quikget
            }
           }
           else
           {
            state checkexplodeflag
            state atkdefbonusgive_vehicle
            ifspawnedby ATKDEFUP
             state getcode
            else
             state quikget
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
    state checkenemypickuphealth

    getactorvar[ITEMSEEK].ACTORATTACK tempb // tempatk
    getactorvar[ITEMSEEK].ACTORDEFENSE tempc // tempdef

    setvarvar TEMPVAR STATLIMIT
    subvar TEMPVAR 1
    ifvarvarg tempb TEMPVAR
    {
     setvarvar TEMPVAR STATLIMIT
     subvar TEMPVAR 1
     ifvarvarg tempc TEMPVAR nullop
     else
     {
      state checkexplodeflag
      state atkdefbonusgive2
     }
    }
    else
    {
     state checkexplodeflag
     state atkdefbonusgive2
    }
   }
  }
enda

eventloadactor SPDUP state setpickupflags enda
useractor notenemy SPDUP 0 

 ifvare FLAGSSET? 0
 {
  ifspritepal 9 { sizeat 96 96 setactorvar[THISACTOR].ACTORNATURALPAL 9 }
  else ifspritepal 3 { sizeat 64 64 setactorvar[THISACTOR].ACTORNATURALPAL 3 }
  else { sizeat 32 32 setactorvar[THISACTOR].ACTORNATURALPAL 0 }
  setvar FLAGSSET? 1
 }
 state itemfullbright
 setvar ACTORSHEIGHT 28 setvar ACTORSWIDTH 17
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit 
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         ifvarl CHARACTERSPEEDTRUE 61000 	// If Player's Speed is less than 100 [61000 Raw Units]
	   {
          state checkexplodeflag
          state calcspdbonus
          ifspawnedby SPDUP
           state getcode
          else
           state quikget
         }
        }
       }
      }
     }
    }
   }
  }
 }
enda

eventloadactor AIRTIMEBONUS state setpickupflags enda
useractor notenemy AIRTIMEBONUS 0

 ifvare FLAGSSET? 0
 {
  ifspritepal 9 { sizeat 162 162 setactorvar[THISACTOR].ACTORNATURALPAL 9 }
  else ifspritepal 3 { sizeat 108 108 setactorvar[THISACTOR].ACTORNATURALPAL 3 }
  else { sizeat 54 54 setactorvar[THISACTOR].ACTORNATURALPAL 0 }
  setvar FLAGSSET? 1
 }
 state itemfullbright
 setvar ACTORSHEIGHT 11 setvar ACTORSWIDTH 15
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit 
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         state checkexplodeflag
         state airtimebonus
         ifvarand ACTORFLAGS 2 nullop
         else
         {
	    redefinequote 335 ^16LUNG-TIME BONUS!
	    setvarvar fta fta_normal setvar ftq 335
         }
         ifspawnedby AIRTIMEBONUS
          state getcode
	   else
	    state quikget
        }
       }
      }
     }
    }
   }
  }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
    state checkenemypickuphealth
    getactorvar[ITEMSEEK].ENEMYHP ITEMSEEKB

    ifvarg ITEMSEEKB 0
    {
     state checkexplodeflag
     getactorvar[ITEMSEEK].ENEMYMAXAIRTIME tempd
     getactorvar[ITEMSEEK].ENEMYAIRTIME tempc
     randvar temp 1
     ifspritepal 3 mulvar temp 4
     ifspritepal 9 mulvar temp 9
     setvar tempb 2
     ifspritepal 3 mulvar tempb 4
     ifspritepal 9 mulvar tempb 9
     ifrnd 128 subvarvar tempb temp else addvarvar tempb temp
     ifrnd 64 addvar tempe 1
     ifrnd 16 addvar tempe 1
     ifrnd 4 addvar tempe 1
     ifrnd 1 addvar tempe 1
     ifspritepal 3 mulvar tempe 4
     ifspritepal 9 mulvar tempe 9
     addvarvar tempb tempe
     getactorvar[ITEMSEEK].ENEMYLEVEL TEMP
     ifvarg TEMP 25 ifvarl TEMP 51 { mulvar tempb 3 divvar tempb 2 } 
     ifvarg TEMP 50 ifvarl TEMP 76 { mulvar tempb 4 divvar tempb 2 } 
     ifvarg TEMP 75 ifvarl TEMP 101 { mulvar tempb 5 divvar tempb 2 } 
     ifvarand ACTORFLAGS 128 mulvar tempb 2
     ifvarand ACTORFLAGS 256 mulvar tempb 4

     addvarvar tempd tempb
     addvarvar tempc tempb
     setactorvar[ITEMSEEK].ENEMYMAXAIRTIME tempd
     setactorvar[ITEMSEEK].ENEMYAIRTIME tempc

     state resetitemtarget
     state bonusgrabactor
     state getitemseekerspecies
     ifvarand ACTORFLAGS 4 nullop
     else
     {
      ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT A LUNG_TIME BONUS! :(
      ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT A LUNG_TIME BONUS! :O
     }
     state enemygrabitemflash
     setvar WORLDTILESHUFFLES 0
     state getworldtile
    }
   }
  }
enda

eventloadactor MANTLEBONUS state setpickupflags enda
useractor notenemy MANTLEBONUS 0

 ifvare FLAGSSET? 0
 {
  ifspritepal 9 { sizeat 48 48 setactorvar[THISACTOR].ACTORNATURALPAL 9 }
  else ifspritepal 3 { sizeat 32 32 setactorvar[THISACTOR].ACTORNATURALPAL 3 }
  else { sizeat 16 16 setactorvar[THISACTOR].ACTORNATURALPAL 0 }
  setvar FLAGSSET? 1
 }
 state itemfullbright
 setvar ACTORSHEIGHT 56 setvar ACTORSWIDTH 68
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit 
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         ifvare CHARACTERSELECTED? 9
         {
 	    redefinequote 335 ^17CYBANIS DOES NOT NEED THIS ITEM!
	    setvar fta 6 setvar ftq 335
         }
         else
         {
          state checkexplodeflag
          state mantlebonus
          ifvarand ACTORFLAGS 2 nullop
          else
          {
 	     redefinequote 335 ^14MANTLE-STRENGTH BONUS!
           setvarvar fta fta_normal setvar ftq 335
          }
          ifspawnedby MANTLEBONUS
           state getcode
          else
           state quikget
         }
        }
       }
      }
     }
    }
   }
  }
 }
enda

eventloadactor AIRJUMPBONUS state setpickupflags enda
useractor notenemy AIRJUMPBONUS 0

 ifvare FLAGSSET? 0
 {
  ifspritepal 9 { sizeat 60 60 setactorvar[THISACTOR].ACTORNATURALPAL 9 }
  else ifspritepal 3 { sizeat 40 40 setactorvar[THISACTOR].ACTORNATURALPAL 3 }
  else { sizeat 20 20 setactorvar[THISACTOR].ACTORNATURALPAL 0 }
  setvar FLAGSSET? 1
 }
 state shadepulse2
 setactor[THISACTOR].shade shade
 setactor[THISACTOR].cstat 2
 state itemdroptimer
 ifvare mainmenu 0 { state fallflags2 }
 setvar ACTORSHEIGHT 85 setvar ACTORSWIDTH 71
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit 
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
 	  {
         state checkexplodeflag
         state airjumpbonus
         ifvarand ACTORFLAGS 2 nullop
         else
         {
          ifspritepal 9 
          {
           redefinequote 335 ^22AIR JUMPS INCREASED BY 9!
           redefinequote 336 ^22AIR JUMPS INCREASED BY %ld!
          }
          else
          ifspritepal 3
          {
           redefinequote 335 ^22AIR JUMPS INCREASED BY 4!
           redefinequote 336 ^22AIR JUMPS INCREASED BY %ld!
          }
          else
          {
           redefinequote 335 ^22AIR JUMPS INCREASED BY 1!
           redefinequote 336 ^22AIR JUMPS INCREASED BY %ld!
          }
          qsprintf 335 336 JUMINCREASED
	    setvarvar fta fta_normal setvar ftq 335
         }
         ifspawnedby AIRJUMPBONUS
          state getcode
         else
          state quikget
	  }
	 }
      }
     }
    }
   }
  }
 }
enda

eventloadactor SATCHEL_SMALL state setpickupflags enda
useractor notenemy SATCHEL_SMALL 0 

 ifvare FLAGSSET? 0
 {
  ifspritepal 9 { sizeat 120 120 setactorvar[THISACTOR].ACTORNATURALPAL 9 }
  else ifspritepal 3 { sizeat 80 80 setactorvar[THISACTOR].ACTORNATURALPAL 3 }
  else { sizeat 40 40 setactorvar[THISACTOR].ACTORNATURALPAL 0 }
  setvar FLAGSSET? 1
 }
 state itemfullbright
 setvar ACTORSHEIGHT 19 setvar ACTORSWIDTH 21
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvare mainmenu 0 state fallflags
 ifmove RESPAWN_ACTOR_FLAG state respawnit 
 else
 {
  ifvare mainmenu 0
  {
   ifp pshrunk nullop
   else
   {
    ifvarg CURRENTHITPOINTS 0 // ifp palive
    {
     ifcanseetarget
     {
      ifpdistl RETRIEVEDISTANCE
      {
       ifcount 6
       {
        state checkexplodeflag
        state randomammoincrease
        ifvarand ACTORFLAGS 2 nullop
        else
        {
         redefinequote 334 ^23GOT A SMALL SATCHEL!
         setvarvar fta fta_normal setvar ftq 334
        }
        ifspawnedby SATCHEL_SMALL
         state getcode
        else
         state quikget
       }
      }
     }
    }
   }
  }
 }
enda

eventloadactor SATCHEL_LARGE state setpickupflags enda
useractor notenemy SATCHEL_LARGE 0 

 ifvare FLAGSSET? 0
 {
  ifspritepal 9 { sizeat 204 204 setactorvar[THISACTOR].ACTORNATURALPAL 9 }
  else ifspritepal 3 { sizeat 136 136 setactorvar[THISACTOR].ACTORNATURALPAL 3 }
  else { sizeat 68 68 setactorvar[THISACTOR].ACTORNATURALPAL 0 }
  setvar FLAGSSET? 1
 }
 state itemfullbright
 setvar ACTORSHEIGHT 24 setvar ACTORSWIDTH 24
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit 
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         state checkexplodeflag
         state randomammoincrease
         state randomammoincrease
         state randomammoincrease
         state randomammoincrease
         ifvarand ACTORFLAGS 2 nullop
         else
         {
          redefinequote 334 ^23GOT A LARGE SATCHEL!
          setvarvar fta fta_normal setvar ftq 334
         }
         ifspawnedby SATCHEL_LARGE
          state getcode
         else
          state quikget
        }
       }
      }
     }
    }
   }
  }
 }
enda

// Super Atom! Gives 200% Health/Armor/Portable Medikit all in one!

state pickupcharacter_superatom
            state checkexplodeflag
            state gotmedsyoureallyneeded

            ifrnd 64 { ifvarl ARMORPERCENT 925 setvar ARMORPERCENT 925 }
            else ifrnd 85 { ifvarl ARMORPERCENT 950 setvar ARMORPERCENT 950 }
            else ifrnd 128 { ifvarl ARMORPERCENT 975 setvar ARMORPERCENT 975 }
            else { ifvarl ARMORPERCENT 1000 setvar ARMORPERCENT 1000 }
	
            ifvarand ACTORFLAGS 2 nullop
            else
            {
             ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC setvar PLAYERHPDAMAGED? -1
             ifvarvarl FIRSTAIDCURRENT MAXHITPOINTSATOMIC setvar DISPLAYFAFLASHTIMER -28
             ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTSATOMIC setvar PLAYERAPDAMAGED? -1
            }
            setvarvar CURRENTHITPOINTS MAXHITPOINTSATOMIC
            ifvarvarg CURRENTHITPOINTS STATLIMITATOMIC setvarvar CURRENTHITPOINTS STATLIMITATOMIC
            setvarvar FIRSTAIDCURRENT MAXHITPOINTSATOMIC
            ifvarvarg FIRSTAIDCURRENT STATLIMITATOMIC setvarvar FIRSTAIDCURRENT STATLIMITATOMIC
            setvarvar CURRENTARMORPOINTS MAXARMORPOINTSATOMIC
            ifvarvarg CURRENTARMORPOINTS STATLIMITATOMIC setvarvar CURRENTARMORPOINTS STATLIMITATOMIC

            ifvarand ACTORFLAGS 2 nullop
            else
            {
             setvarvar fta fta_normal setvar ftq 151
            }
	      ifspawnedby SUPERATOM
	        state getcode
            else
	        state quikget
ends

state pickupvehicle_superatom
            state checkexplodeflag

            getactorvar[tempvehicleid].ENEMYARMORPERCENT TEMPVAR3
            ifrnd 64 { ifvarl TEMPVAR3 925 setvar TEMPVAR3 925 }
            else ifrnd 85 { ifvarl TEMPVAR3 950 setvar TEMPVAR3 950 }
            else ifrnd 128 { ifvarl TEMPVAR3 975 setvar TEMPVAR3 975 }
            else { ifvarl TEMPVAR3 1000 setvar TEMPVAR3 1000 }
            setactorvar[tempvehicleid].ENEMYARMORPERCENT TEMPVAR3
	
            ifvarand ACTORFLAGS 2 nullop
            else
            {
             getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
             getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
             mulvar TEMPVAR5 2
             ifvarvarl TEMPVAR4 TEMPVAR5 setvar VEHICLEHPDAMAGED? -1
             getactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
             getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
             mulvar TEMPVAR5 2
             ifvarvarl TEMPVAR4 TEMPVAR5 setactorvar[PLAYERID].VDISPLAYFAFLASHTIMER -28
             getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
             getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
             mulvar TEMPVAR5 2
             ifvarvarl TEMPVAR4 TEMPVAR5 setvar VEHICLEAPDAMAGED? -1
            }
            getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            mulvar TEMPVAR5 2
            ifvarvarl TEMPVAR4 TEMPVAR5 setvarvar TEMPVAR4 TEMPVAR5
            ifvarvarg TEMPVAR4 STATLIMITATOMIC setvarvar TEMPVAR4 STATLIMITATOMIC
            setactorvar[tempvehicleid].ENEMYHP TEMPVAR4

            getactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            mulvar TEMPVAR5 2
            ifvarvarl TEMPVAR4 TEMPVAR5 setvarvar TEMPVAR4 TEMPVAR5
            ifvarvarg TEMPVAR4 STATLIMITATOMIC setvarvar TEMPVAR4 STATLIMITATOMIC
            setactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4

            getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
            mulvar TEMPVAR5 2
            ifvarvarl TEMPVAR4 TEMPVAR5 setvarvar TEMPVAR4 TEMPVAR5
            ifvarvarg TEMPVAR4 STATLIMITATOMIC setvarvar TEMPVAR4 STATLIMITATOMIC
            setactorvar[tempvehicleid].ENEMYAP TEMPVAR4

            ifvarand ACTORFLAGS 2 nullop
            else
            {
             redefinequote 836 ^15GRABBED A SUPER ATOM FOR YOUR VEHICLE!
             setvarvar fta fta_normal setvar ftq 836
            }
	      ifspawnedby SUPERATOM
	        state getcode
            else
	        state quikget
ends

state pickupinventory_superatom
            state checkexplodeflag
            setvarvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags
            addvarvar SUPERATOMS ACTORPICKUPAMOUNT
            ifvarand ACTORFLAGS 2 nullop
            else
            {
             ifvare ACTORPICKUPAMOUNT 1
             {
              redefinequote 836 ^14 STORED A SUPER ATOM INTO INVENTORY!
             }
             else
             {
              redefinequote 836 ^14 STORED %ld SUPER ATOMS INTO INVENTORY!
              qsprintf 836 836 ACTORPICKUPAMOUNT
             }
             setvarvar fta fta_normal setvar ftq 836
            }
            globalsound FOUND_INVENTORY
      	      ifspawnedby SUPERATOM
             state getcode
            else
             state quikget
ends

eventloadactor SUPERATOM state setpickupflags enda
useractor notenemy SUPERATOM 0

 ifvare FLAGSSET? 0
 {
  ifspritepal 12
  {
   ifrnd 2
   {
    getactorvar[THISACTOR].ACTORFLAGS TEMP2
    espawn CONTINUEITEM
    setactorvar[RETURN].ACTORFLAGS TEMP2
    killit
   }
   else
   {
    spritepal 12 sizeat 96 96
    setactorvar[THISACTOR].ACTORNATURALPAL 12
    setvar FLAGSSET? 1 
   }
  }
  else
  {
   ifrnd 8 
   {
    spritepal 12 sizeat 96 96
    setactorvar[THISACTOR].ACTORNATURALPAL 12
    setvar FLAGSSET? 1
   }
   else 
   ifrnd 2
   {
    getactorvar[THISACTOR].ACTORFLAGS TEMP2
    espawn CONTINUEITEM
    setactorvar[RETURN].ACTORFLAGS TEMP2
    killit
   }
   else 
   {
    spritepal 16 sizeat 48 48
    setactorvar[THISACTOR].ACTORNATURALPAL 16
    setvar FLAGSSET? 1 
   }
  }
 }

 state itemfullbright
 state calcplayermaxhealthatomic
 state calcplayermaxarmoratomic
 setvar ACTORSHEIGHT 25 setvar ACTORSWIDTH 29
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit 
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifspritepal 12 // If it is a Hyper Atom
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          setvar TEMP3 0
          state superatom_maincheck
          ifvarg TEMP3 0
          {
           state checkexplodeflag
           state gotmedsyoureallyneeded

           ifvarand ACTORFLAGS 2 nullop
           else
           {
            ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC setvar PLAYERHPDAMAGED? -1
            ifvarvarl FIRSTAIDCURRENT MAXHITPOINTSATOMIC setvar DISPLAYFAFLASHTIMER -28
            ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTSATOMIC setvar PLAYERAPDAMAGED? -1
           }

           setvar ARMORPERCENT 1000
           setvarvar CURRENTHITPOINTS MAXHITPOINTSATOMIC
           ifvarvarg CURRENTHITPOINTS STATLIMITATOMIC setvarvar CURRENTHITPOINTS STATLIMITATOMIC
           setvarvar FIRSTAIDCURRENT MAXHITPOINTSATOMIC
           ifvarvarg FIRSTAIDCURRENT STATLIMITATOMIC setvarvar FIRSTAIDCURRENT STATLIMITATOMIC
           setvarvar CURRENTARMORPOINTS MAXARMORPOINTSATOMIC
           ifvarvarg CURRENTARMORPOINTS STATLIMITATOMIC setvarvar CURRENTARMORPOINTS STATLIMITATOMIC

           ifvare DUKE? 1 
           {
            ifvarn CHARACTERSELECTED? 1 
            { 
             setvar CHARACTERARRAY 1
             state hyperatomsetcharacter
            } 
           }
           ifvare JACK? 1 
           {
            ifvarn CHARACTERSELECTED? 2
            { 
             setvar CHARACTERARRAY 2
             state hyperatomsetcharacter
            } 
           }
           ifvare BUBSY? 1 
           {
            ifvarn CHARACTERSELECTED? 3
            { 
             setvar CHARACTERARRAY 3
             state hyperatomsetcharacter
            } 
           }
           ifvare AMI? 1 
           {
            ifvarn CHARACTERSELECTED? 4
            { 
             setvar CHARACTERARRAY 4
             state hyperatomsetcharacter
            } 
           }
           ifvare LOWANG? 1 
           {
            ifvarn CHARACTERSELECTED? 5
            { 
             setvar CHARACTERARRAY 5
             state hyperatomsetcharacter
            } 
           }
           ifvare ESSENCE? 1 
           {
            ifvarn CHARACTERSELECTED? 6
            { 
             setvar CHARACTERARRAY 6
             state hyperatomsetcharacter
            } 
           }
           ifvare TED? 1 
           {
            ifvarn CHARACTERSELECTED? 7
            { 
             setvar CHARACTERARRAY 7
             state hyperatomsetcharacter
            } 
           }
           ifvare LISA? 1 
           {
            ifvarn CHARACTERSELECTED? 8
            { 
             setvar CHARACTERARRAY 8
             state hyperatomsetcharacter
            } 
           }
           ifvare CYBANIS? 1 
           {
            ifvarn CHARACTERSELECTED? 9
            { 
             setvar CHARACTERARRAY 9
             state hyperatomsetcharacter
            } 
           }
           ifvare NETHRA? 1 
           {
            ifvarn CHARACTERSELECTED? 10
            { 
             setvar CHARACTERARRAY 10
             state hyperatomsetcharacter
            } 
           }
           ifvare PAULA? 1 
           {
            ifvarn CHARACTERSELECTED? 11
            { 
             setvar CHARACTERARRAY 11
             state hyperatomsetcharacter
            } 
           }
           ifvare LORI? 1 
           {
            ifvarn CHARACTERSELECTED? 12
            { 
             setvar CHARACTERARRAY 12
             state hyperatomsetcharacter
            } 
           }
           ifvare MINAKO? 1 
           {
            ifvarn CHARACTERSELECTED? 13
            { 
             setvar CHARACTERARRAY 13
             state hyperatomsetcharacter
            } 
           }
           ifvare MYSTERY1? 1 
           {
            ifvarn CHARACTERSELECTED? 14
            { 
             setvar CHARACTERARRAY 14
             state hyperatomsetcharacter
            } 
           }
           ifvare MAKEN? 1 
           {
            ifvarn CHARACTERSELECTED? 15
            { 
             setvar CHARACTERARRAY 15
             state hyperatomsetcharacter
            } 
           }
           getactorvar[PLAYERID].VEHICLEID tempvehicleid
           ifvarn tempvehicleid -1
           {
	      getactorvar[tempvehicleid].ENEMYHP temp
            ifvarg temp 0
            {
             setactorvar[tempvehicleid].ENEMYARMORPERCENT 1000
             getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR
             mulvar TEMPVAR 2
             ifvarvarg TEMPVAR STATLIMITATOMIC setvarvar TEMPVAR STATLIMITATOMIC
             setactorvar[tempvehicleid].ENEMYHP TEMPVAR
             getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR
             mulvar TEMPVAR 2
             ifvarvarg TEMPVAR STATLIMITATOMIC setvarvar TEMPVAR STATLIMITATOMIC
             setactorvar[tempvehicleid].ENEMYAP TEMPVAR
             mulvar TEMPVAR 2
             ifvarvarg TEMPVAR STATLIMITATOMIC setvarvar TEMPVAR STATLIMITATOMIC
             setactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR
            }
           }
           ifvarand ACTORFLAGS 2 nullop
           else
           {
            redefinequote 432 ^12FOUND A HYPER-ATOM! 200% HP/AP/FA TO ALL!! :D
 	      setvarvar fta fta_normal setvar ftq 432
           }
           ifspawnedby SUPERATOM
            state getcode
           else
            state quikget
          }
         }
        }
       }
      }
     }
     else // Else if it is a Super Atom
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          getactorvar[PLAYERID].VEHICLEID tempvehicleid
          ifvare tempvehicleid -1
          {
           setvar TEMP3 0
           state superatom_checkstatsplayer
           ifvarg TEMP3 0 state pickupcharacter_superatom else state pickupinventory_superatom
          }
          else
          {
           ifvare vehiclepickuptoggle 0 // Character Only
           {
            setvar TEMP3 0
            state superatom_checkstatsplayer
            ifvarg TEMP3 0 state pickupcharacter_superatom else state pickupinventory_superatom
           }
           ifvare vehiclepickuptoggle 1 // Vehicle Only
           {
            setvar TEMP3 0
            state superatom_checkstatsvehicle
            ifvarg TEMP3 0 state pickupvehicle_superatom else state pickupinventory_superatom
           }
           ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
           {
            setvar TEMP3 0
            state superatom_checkstatsplayer
            ifvarg TEMP3 0 state pickupcharacter_superatom 
            else
            {
             setvar TEMP3 0
             state superatom_checkstatsvehicle
             ifvarg TEMP3 0 state pickupvehicle_superatom else state pickupinventory_superatom
            }
           }
           ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
           {
            setvar TEMP3 0
            state superatom_checkstatsvehicle
            ifvarg TEMP3 0 state pickupvehicle_superatom
            else
            {
             setvar TEMP3 0
             state superatom_checkstatsplayer
             ifvarg TEMP3 0 state pickupcharacter_superatom else state pickupinventory_superatom
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
          state checkenemypickuphealth
          getactorvar[ITEMSEEK].ENEMYMAXHP ITEMENEMYMAXHP
          getactorvar[ITEMSEEK].ENEMYMAXAP ITEMENEMYMAXAP
          getactorvar[ITEMSEEK].ENEMYMAXHP ENEMYFIRSTAIDMAX
          getactorvar[ITEMSEEK].ENEMYFIRSTAID ENEMYCURRENTFIRSTAID          

          ifspritepal 12
          {
           setvar TEMP5 1
          }
          else
          {
           setvar TEMP5 0
           getactorvar[ITEMSEEK].ENEMYHP TEMP3
           getactorvar[ITEMSEEK].ENEMYMAXHP TEMP4
           mulvar TEMP4 2
           ifvarvarl TEMP3 TEMP4 addvar TEMP5 1

           getactorvar[ITEMSEEK].ENEMYAP TEMP3
           getactorvar[ITEMSEEK].ENEMYMAXAP TEMP4
           mulvar TEMP4 2
           ifvarvarl TEMP3 TEMP4 addvar TEMP5 1

           getactorvar[ITEMSEEK].ENEMYFIRSTAID TEMP3
           getactorvar[ITEMSEEK].ENEMYMAXHP TEMP4
           mulvar TEMP4 2
           ifvarvarl TEMP3 TEMP4 addvar TEMP5 1
          }

          ifvarg TEMP5 0
          {
           ifvarg ITEMSEEKB 0
           {
            state checkexplodeflag

            setvarvar ITEMENEMYMAXHPATOMIC ITEMENEMYMAXHP
            mulvar ITEMENEMYMAXHPATOMIC 2
            getactorvar[ITEMSEEK].ENEMYHP TEMP3
            ifvarvarl TEMP3 ITEMENEMYMAXHPATOMIC { ifvarand ACTORFLAGS 4 nullop else setactorvar[ITEMSEEK].ENEMYHPDAMAGED? -1 }
            ifvarvarg ITEMENEMYMAXHPATOMIC STATLIMITATOMIC setvarvar ITEMENEMYMAXHPATOMIC STATLIMITATOMIC
            setvarvar ITEMENEMYMAXAPATOMIC ITEMENEMYMAXAP
            mulvar ITEMENEMYMAXAPATOMIC 2
            getactorvar[ITEMSEEK].ENEMYAP TEMP3
            ifvarvarl TEMP3 ITEMENEMYMAXAPATOMIC { ifvarand ACTORFLAGS 4 nullop else setactorvar[ITEMSEEK].ENEMYAPDAMAGED? -1 }
            ifvarvarg ITEMENEMYMAXAPATOMIC STATLIMITATOMIC setvarvar ITEMENEMYMAXAPATOMIC STATLIMITATOMIC
            setvarvar ENEMYFIRSTAIDMAXATOMIC ENEMYFIRSTAIDMAX
            mulvar ENEMYFIRSTAIDMAXATOMIC 2
            getactorvar[ITEMSEEK].ENEMYFIRSTAID TEMP3
            ifvarvarl TEMP3 ENEMYFIRSTAIDMAXATOMIC { ifvarand ACTORFLAGS 4 nullop else setactorvar[ITEMSEEK].EDISPLAYFAFLASHTIMER -28 }
            ifvarvarg ENEMYFIRSTAIDMAXATOMIC STATLIMITATOMIC setvarvar ENEMYFIRSTAIDMAXATOMIC STATLIMITATOMIC 

            ifspritepal 12
            {
             setvar CURRENTENEMYARMORPERCENT 1000
            }
            else
            {
             ifrnd 64 { ifvarl CURRENTENEMYARMORPERCENT 925 setvar CURRENTENEMYARMORPERCENT 925 }
             else ifrnd 85 { ifvarl CURRENTENEMYARMORPERCENT 950 setvar CURRENTENEMYARMORPERCENT 950 }
             else ifrnd 128 { ifvarl CURRENTENEMYARMORPERCENT 975 setvar CURRENTENEMYARMORPERCENT 975 }
             else { ifvarl CURRENTENEMYARMORPERCENT 1000 setvar CURRENTENEMYARMORPERCENT 1000 }
            }
 
            setactorvar[ITEMSEEK].ENEMYHP ITEMENEMYMAXHPATOMIC
            setactorvar[ITEMSEEK].ENEMYAP ITEMENEMYMAXAPATOMIC
            setactorvar[ITEMSEEK].ENEMYFIRSTAID ITEMENEMYMAXHPATOMIC
            setactorvar[ITEMSEEK].ENEMYCURRENTFIRSTAID ENEMYFIRSTAID
            setactorvar[ITEMSEEK].ENEMYARMORPERCENT CURRENTENEMYARMORPERCENT
            state resetitemtarget
            setvar WORLDTILESHUFFLES 0
            state getworldtile
            state getitemseekerspecies
            ifvarand ACTORFLAGS 4 nullop
            else
            {
             globalsound GETATOMICHEALTH
             ifspritepal 12
             {
              ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT A HYPER-ATOM! ;_;
              ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT A HYPER-ATOM! >_>
             }
             else
             {
              ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT A SUPER ATOM! ;_;
              ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT A SUPER ATOM! >_>
             }
            }
            state enemygrabitemflash
           }
	    }
   }
  }

}
enda

state pickupcharacter_colorshield
          state checkexplodeflag
          ifspritepal 14 // Green-Class Armor
          {
           setvar TEMPVAR 333
           state assesspickuprequirements
           ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
           ifvarvarl ARMORPERCENT TEMPVAR setvarvar ARMORPERCENT TEMPVAR

           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2a
	      redefinequote 167 ^20GOT USED GREEN-CLASS ARMOR!
           }
           else
           {
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2
	      redefinequote 167 ^20GOT GREEN-CLASS ARMOR!
           }
	    }
          else
          ifspritepal 16 // Blue-Class Armor
          {
           setvar TEMPVAR 500
           state assesspickuprequirements
           ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
           ifvarvarl ARMORPERCENT TEMPVAR setvarvar ARMORPERCENT TEMPVAR

           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2a
            redefinequote 167 ^20GOT USED BLUE-CLASS ARMOR!
           }
           else
           {
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2
            redefinequote 167 ^20GOT BLUE-CLASS ARMOR!
           }
          }
          else
          ifspritepal 23 // Yellow-Class Armor
          {
           setvar TEMPVAR 750
           state assesspickuprequirements
           ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
           ifvarvarl ARMORPERCENT TEMPVAR setvarvar ARMORPERCENT TEMPVAR

           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2a
            redefinequote 167 ^20GOT USED YELLOW-CLASS ARMOR!
           }
           else
           {
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2
            redefinequote 167 ^20GOT YELLOW-CLASS ARMOR!
           }
          }
          else
          ifspritepal 10 // Red-Class Armor
          {
           setvar TEMPVAR 900
           state assesspickuprequirements
           ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
           ifvarvarl ARMORPERCENT TEMPVAR setvarvar ARMORPERCENT TEMPVAR

           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2a
            redefinequote 167 ^20GOT USED RED-CLASS ARMOR!
           }
           else
           {
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2
            redefinequote 167 ^20GOT RED-CLASS ARMOR!
           }
          }
          else
          ifspritepal 13 // Grey Class Armor
          {
           randvar TEMPVAR 99
           addvar TEMPVAR 900
           state assesspickuprequirements
           ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
           ifvarvarl ARMORPERCENT TEMPVAR setvarvar ARMORPERCENT TEMPVAR

           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2a
            redefinequote 167 ^20GOT USED GREY-CLASS ARMOR!
           }
           else
           {
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2
            redefinequote 167 ^20GOT GREY-CLASS ARMOR!
           }
          }
          else
          ifspritepal 20 // White-Class Armor
          {
           ifvarl ARMORPERCENT 1000 setvar ARMORPERCENT 1000
           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2a
      	      redefinequote 167 ^20GOT USED WHITE-CLASS ARMOR!
           }
           else
           {
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2
      	      redefinequote 167 ^20GOT WHITE-CLASS ARMOR!
           }
          }
          else
          {
           randvar TEMPVAR 1000
           state assesspickuprequirements
           ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
           ifvarvarl ARMORPERCENT TEMPVAR setvarvar ARMORPERCENT TEMPVAR

           randvar ARMORPERCENT 1000
           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2a
            redefinequote 167 ^20GOT USED RANDOM-CLASS ARMOR!
           }
           else
           {
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2
            redefinequote 167 ^20GOT RANDOM-CLASS ARMOR!
           }
          }
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvar PLAYERAPDAMAGED? -1
           setvarvar fta fta_normal setvar ftq 167
          }
          ifspawnedby COLORSHIELD
           state getcode
          else
           state quikget
ends

state pickupvehicle_colorshield
          state checkexplodeflag
//
          getactorvar[tempvehicleid].ENEMYARMORPERCENT TEMPVAR3
          ifspritepal 14 // Green-Class Armor
          {
           setvar TEMPVAR 333
           state assesspickuprequirements
           ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
           ifvarvarl TEMPVAR3 TEMPVAR setvarvar TEMPVAR3 TEMPVAR

           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            globalsound USE_ARMORITEM3
            state givearmor2a_vehicle
	      redefinequote 167 ^15GOT USED GREEN-CLASS ARMOR FOR YOUR VEHICLE!
           }
           else
           {
            globalsound USE_ARMORITEM3
            state givearmor2_vehicle
	      redefinequote 167 ^15GOT GREEN-CLASS ARMOR FOR YOUR VEHICLE!
           }
	    }
          else
          ifspritepal 16 // Blue-Class Armor
          {
           setvar TEMPVAR 500
           state assesspickuprequirements
           ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
           ifvarvarl TEMPVAR3 TEMPVAR setvarvar TEMPVAR3 TEMPVAR

           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            globalsound USE_ARMORITEM3
            state givearmor2a_vehicle
            redefinequote 167 ^15GOT USED BLUE-CLASS ARMOR FOR YOUR VEHICLE!
           }
           else
           {
            globalsound USE_ARMORITEM3
            state givearmor2_vehicle
            redefinequote 167 ^15GOT BLUE-CLASS ARMOR FOR YOUR VEHICLE!
           }
          }
          else
          ifspritepal 23 // Yellow-Class Armor
          {
           setvar TEMPVAR 750
           state assesspickuprequirements
           ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
           ifvarvarl TEMPVAR3 TEMPVAR setvarvar TEMPVAR3 TEMPVAR

           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            globalsound USE_ARMORITEM3
            state givearmor2a_vehicle
            redefinequote 167 ^15GOT USED YELLOW-CLASS ARMOR FOR YOUR VEHICLE!
           }
           else
           {
            globalsound USE_ARMORITEM3
            state givearmor2_vehicle
            redefinequote 167 ^15GOT YELLOW-CLASS ARMOR FOR YOUR VEHICLE!
           }
          }
          else
          ifspritepal 10 // Red-Class Armor
          {
           setvar TEMPVAR 900
           state assesspickuprequirements
           ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
           ifvarvarl TEMPVAR3 TEMPVAR setvarvar TEMPVAR3 TEMPVAR

           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            globalsound USE_ARMORITEM3
            state givearmor2a_vehicle
            redefinequote 167 ^15GOT USED RED-CLASS ARMOR FOR YOUR VEHICLE!
           }
           else
           {
            globalsound USE_ARMORITEM3
            state givearmor2_vehicle
            redefinequote 167 ^15GOT RED-CLASS ARMOR FOR YOUR VEHICLE!
           }
          }
          else
          ifspritepal 13 // Grey Class Armor
          {
           randvar TEMPVAR 99
           addvar TEMPVAR 900
           state assesspickuprequirements
           ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
           ifvarvarl TEMPVAR3 TEMPVAR setvarvar TEMPVAR3 TEMPVAR

           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            globalsound USE_ARMORITEM3
            state givearmor2a_vehicle
            redefinequote 167 ^15GOT USED GREY-CLASS ARMOR FOR YOUR VEHICLE!
           }
           else
           {
            globalsound USE_ARMORITEM3
            state givearmor2_vehicle
            redefinequote 167 ^15GOT GREY-CLASS ARMOR FOR YOUR VEHICLE!
           }
          }
          else
          ifspritepal 20 // White-Class Armor
          {
           ifvarl TEMPVAR3 1000 setvar TEMPVAR3 1000
           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            globalsound USE_ARMORITEM3
            state givearmor2a_vehicle
      	      redefinequote 167 ^15GOT USED WHITE-CLASS ARMOR FOR YOUR VEHICLE!
           }
           else
           {
            globalsound USE_ARMORITEM3
            state givearmor2_vehicle
      	      redefinequote 167 ^15GOT WHITE-CLASS ARMOR FOR YOUR VEHICLE!
           }
          }
          else
          {
           randvar TEMPVAR 1000
           state assesspickuprequirements
           ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
           ifvarvarl TEMPVAR3 TEMPVAR setvarvar TEMPVAR3 TEMPVAR

           randvar TEMPVAR3 1000
           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            globalsound USE_ARMORITEM3
            state givearmor2a_vehicle
            redefinequote 167 ^15GOT USED RANDOM-CLASS ARMOR FOR YOUR VEHICLE!
           }
           else
           {
            globalsound USE_ARMORITEM3
            state givearmor2_vehicle
            redefinequote 167 ^15GOT RANDOM-CLASS ARMOR FOR YOUR VEHICLE!
           }
          }
          setactorvar[tempvehicleid].ENEMYARMORPERCENT TEMPVAR3
//
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvar VEHICLEAPDAMAGED? -1
           setvarvar fta fta_normal setvar ftq 167
          }
          ifspawnedby COLORSHIELD
           state getcode
          else
           state quikget
ends

state pickupinventory_colorshield
          state checkexplodeflag
          setvarvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags
          ifvare ARMORISUSED? 1
          {
           ifspritepal 14 addvarvar USEDGREENARMORS ACTORPICKUPAMOUNT
           else ifspritepal 16 addvarvar USEDBLUEARMORS ACTORPICKUPAMOUNT
           else ifspritepal 23 addvarvar USEDYELLOWARMORS ACTORPICKUPAMOUNT
           else ifspritepal 10 addvarvar USEDREDARMORS ACTORPICKUPAMOUNT
           else ifspritepal 13 addvarvar USEDGREYARMORS ACTORPICKUPAMOUNT
           else ifspritepal 20 addvarvar USEDWHITEARMORS ACTORPICKUPAMOUNT
           else addvarvar USEDRANDOMARMORS ACTORPICKUPAMOUNT
          }
          else
          {
           ifspritepal 14 addvarvar GREENARMORS ACTORPICKUPAMOUNT
           else ifspritepal 16 addvarvar BLUEARMORS ACTORPICKUPAMOUNT
           else ifspritepal 23 addvarvar YELLOWARMORS ACTORPICKUPAMOUNT
           else ifspritepal 10 addvarvar REDARMORS ACTORPICKUPAMOUNT
           else ifspritepal 13 addvarvar GREYARMORS ACTORPICKUPAMOUNT
           else ifspritepal 20 addvarvar WHITEARMORS ACTORPICKUPAMOUNT
           else addvarvar RANDOMARMORS ACTORPICKUPAMOUNT
          }
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvare ACTORPICKUPAMOUNT 1
           {
            ifvare ARMORISUSED? 1
            {
             ifspritepal 14 redefinequote 836 ^14 STORED A SUIT OF USED GREEN-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 16 redefinequote 836 ^14 STORED A SUIT OF USED BLUE-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 23 redefinequote 836 ^14 STORED A SUIT OF USED YELLOW-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 10 redefinequote 836 ^14 STORED A SUIT OF USED RED-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 13 redefinequote 836 ^14 STORED A SUIT OF USED GREY-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 20 redefinequote 836 ^14 STORED A SUIT OF USED WHITE-CLASS ARMOR INTO INVENTORY!
             else redefinequote 836 ^14 STORED A SUIT OF USED RANDOM-CLASS ARMOR INTO INVENTORY!
            }
            else
            {
             ifspritepal 14 redefinequote 836 ^14 STORED A SUIT OF GREEN-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 16 redefinequote 836 ^14 STORED A SUIT OF BLUE-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 23 redefinequote 836 ^14 STORED A SUIT OF YELLOW-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 10 redefinequote 836 ^14 STORED A SUIT OF RED-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 13 redefinequote 836 ^14 STORED A SUIT OF GREY-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 20 redefinequote 836 ^14 STORED A SUIT OF WHITE-CLASS ARMOR INTO INVENTORY!
             else redefinequote 836 ^14 STORED A SUIT OF RANDOM-CLASS ARMOR INTO INVENTORY!
            }
           }
           else
           {
            ifvare ARMORISUSED? 1
            {
             ifspritepal 14 redefinequote 836 ^14 STORED %ld SUITS OF USED GREEN-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 16 redefinequote 836 ^14 STORED %ld SUITS OF USED BLUE-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 23 redefinequote 836 ^14 STORED %ld SUITS OF USED YELLOW-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 10 redefinequote 836 ^14 STORED %ld SUITS OF USED RED-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 13 redefinequote 836 ^14 STORED %ld SUITS OF USED GREY-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 20 redefinequote 836 ^14 STORED %ld SUITS OF USED WHITE-CLASS ARMOR INTO INVENTORY!
             else redefinequote 836 ^14 STORED %ld SUITS OF USED RANDOM-CLASS ARMOR INTO INVENTORY!
            }
            else
            {
             ifspritepal 14 redefinequote 836 ^14 STORED %ld SUITS OF GREEN-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 16 redefinequote 836 ^14 STORED %ld SUITS OF BLUE-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 23 redefinequote 836 ^14 STORED %ld SUITS OF YELLOW-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 10 redefinequote 836 ^14 STORED %ld SUITS OF RED-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 13 redefinequote 836 ^14 STORED %ld SUITS OF GREY-CLASS ARMOR INTO INVENTORY!
             else ifspritepal 20 redefinequote 836 ^14 STORED %ld SUITS OF WHITE-CLASS ARMOR INTO INVENTORY!
             else redefinequote 836 ^14 STORED %ld SUITS OF RANDOM-CLASS ARMOR INTO INVENTORY!
            }
            qsprintf 836 836 ACTORPICKUPAMOUNT
           }
           setvarvar fta fta_normal setvar ftq 836
          }
          globalsound FOUND_INVENTORY
          ifspawnedby COLORSHIELD
           state getcode
          else
           state quikget
ends

// COLORSHIELD = 67

action COLORSHIELD-MALE 5347 // 5414 - 67 = 5347
action COLORSHIELD-FEMALE 5349 // 5416 - 67 = 5349
action COLORSHIELD-ESSENCE 5348 // 5415 - 67 = 5348
action COLORSHIELD-CYBANIS 5354 // 5421 - 67 = 5354 
action COLORSHIELD-MALE_USED 5462 // 5529 - 67 = 5462
action COLORSHIELD-FEMALE_USED 5461 // 5528 - 67 = 5461
action COLORSHIELD-ESSENCE_USED 5459 // 5526 - 67 = 5459
action COLORSHIELD-CYBANIS_USED 5460 // 5527 - 67 = 5460 

eventloadactor COLORSHIELD state setpickupflags enda
useractor notenemy COLORSHIELD 0

 sizeat 32 32
 getactor[THISACTOR].cstat temp
 ifvarand temp 1
 {
  subvar temp 1
  setactor[THISACTOR].cstat temp
 }
  
 ifaction COLORSHIELD-MALE { setvar ACTORSHEIGHT 26 setvar ACTORSWIDTH 27 }
 ifaction COLORSHIELD-MALE_USED { setvar ACTORSHEIGHT 26 setvar ACTORSWIDTH 27 }
 ifaction COLORSHIELD-FEMALE { setvar ACTORSHEIGHT 22 setvar ACTORSWIDTH 22 }
 ifaction COLORSHIELD-FEMALE_USED { setvar ACTORSHEIGHT 22 setvar ACTORSWIDTH 22 }
 ifaction COLORSHIELD-ESSENCE { setvar ACTORSHEIGHT 45 setvar ACTORSWIDTH 56 }
 ifaction COLORSHIELD-ESSENCE_USED { setvar ACTORSHEIGHT 45 setvar ACTORSWIDTH 56 }
 ifaction COLORSHIELD-CYBANIS { setvar ACTORSHEIGHT 50 setvar ACTORSWIDTH 58 }
 ifaction COLORSHIELD-CYBANIS_USED { setvar ACTORSHEIGHT 50 setvar ACTORSWIDTH 58 }
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare FLAGSSET? 0
 {
  ifspritepal 10 setactorvar[THISACTOR].ACTORNATURALPAL 10
  else ifspritepal 13 setactorvar[THISACTOR].ACTORNATURALPAL 13
  else ifspritepal 14 setactorvar[THISACTOR].ACTORNATURALPAL 14
  else ifspritepal 16 setactorvar[THISACTOR].ACTORNATURALPAL 16
  else ifspritepal 20 setactorvar[THISACTOR].ACTORNATURALPAL 20
  else ifspritepal 23 setactorvar[THISACTOR].ACTORNATURALPAL 23
  else setactorvar[THISACTOR].ACTORNATURALPAL 15
  setvar FLAGSSET? 1 
 }
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit 
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifcount 6
       {
        ifpdistl RETRIEVEDISTANCE
        {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTS state pickupcharacter_colorshield else state pickupinventory_colorshield
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTS state pickupcharacter_colorshield else state pickupinventory_colorshield
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
           ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_colorshield else state pickupinventory_colorshield
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTS state pickupcharacter_colorshield
           else
           {
            getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
            ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_colorshield else state pickupinventory_colorshield
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
           ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_colorshield
           else
           {
            ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTS state pickupcharacter_colorshield else state pickupinventory_colorshield
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
	   {
          state checkenemypickuphealth
          getactorvar[ITEMSEEK].ENEMYAP ITEMENEMYCURRENTAP
          getactorvar[ITEMSEEK].ENEMYMAXAP ITEMENEMYMAXAP

          ifvarg ITEMSEEKB 0
          ifvarvarl ITEMENEMYCURRENTAP ITEMENEMYMAXAP
          {
           state checkexplodeflag
           setvarvar ITEMSEEKC ITEMENEMYMAXAP
           {
            ifvare ARMORISUSED? 1
            {
             ifrnd 64 mulvar ITEMSEEKC 875
             else ifrnd 85 mulvar ITEMSEEKC 750
             else ifrnd 128 mulvar ITEMSEEKC 500
             else mulvar ITEMSEEKC 250
            }
            else
            {
             mulvar ITEMSEEKC 1000
            }
            divvar ITEMSEEKC 1000
            {
             getactorvar[ITEMSEEK].ENEMYARMORPERCENT CURRENTENEMYARMORPERCENT
             ifspritepal 14
             { 
              setvarvar TEMPVAR 333
              state assesspickuprequirements
              ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
	        ifvarvarl CURRENTENEMYARMORPERCENT TEMPVAR setvarvar CURRENTENEMYARMORPERCENT TEMPVAR
              state getitemseekerspecies
              ifvare ARMORISUSED? 1
              { 
               ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT USED GREEN-CLASS ARMOR!
               ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT USED GREEN-CLASS ARMOR!
              }
              else
              { 
               ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT GREEN-CLASS ARMOR!
               ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT GREEN-CLASS ARMOR!
              }
             }
             else
             ifspritepal 16
             { 
              setvarvar TEMPVAR 500
              state assesspickuprequirements
              ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
	        ifvarvarl CURRENTENEMYARMORPERCENT TEMPVAR setvarvar CURRENTENEMYARMORPERCENT TEMPVAR
              state getitemseekerspecies
              ifvare ARMORISUSED? 1
              { 
               ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT USED BLUE-CLASS ARMOR!
               ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT USED BLUE-CLASS ARMOR!
              }
              else
              { 
               ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT BLUE-CLASS ARMOR!
               ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT BLUE-CLASS ARMOR!
              }
             }
             else
             ifspritepal 23
             { 
              setvarvar TEMPVAR 750
              state assesspickuprequirements
              ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
	        ifvarvarl CURRENTENEMYARMORPERCENT TEMPVAR setvarvar CURRENTENEMYARMORPERCENT TEMPVAR
              state getitemseekerspecies
              ifvare ARMORISUSED? 1
              { 
               ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT USED YELLOW-CLASS ARMOR!
               ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT USED YELLOW-CLASS ARMOR!
              }
              else
              { 
               ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT YELLOW-CLASS ARMOR!
               ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT YELLOW-CLASS ARMOR!
              }
             }
             else
             ifspritepal 10
             { 
              setvarvar TEMPVAR 900
              state assesspickuprequirements
              ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
	        ifvarvarl CURRENTENEMYARMORPERCENT TEMPVAR setvarvar CURRENTENEMYARMORPERCENT TEMPVAR
              state getitemseekerspecies
              ifvare ARMORISUSED? 1
              { 
               ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT USED RED-CLASS ARMOR!
               ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT USED RED-CLASS ARMOR!
              }
              else
              { 
               ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT RED-CLASS ARMOR!
               ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT RED-CLASS ARMOR!
              }
             }
             else
             ifspritepal 13
             { 
              randvarvar TEMPVAR 99
              addvarvar TEMPVAR 900
              state assesspickuprequirements
              ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
	        ifvarvarl CURRENTENEMYARMORPERCENT TEMPVAR setvarvar CURRENTENEMYARMORPERCENT TEMPVAR
              state getitemseekerspecies
              ifvare ARMORISUSED? 1
              { 
               ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT USED GREY-CLASS ARMOR!
               ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT USED GREY-CLASS ARMOR!
              }
              else
              { 
               ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT GREY-CLASS ARMOR!
               ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT GREY-CLASS ARMOR!
              }
             }
             else
             ifspritepal 20
             { 
              ifvarl CURRENTENEMYARMORPERCENT 1000 setvar CURRENTENEMYARMORPERCENT 1000
              state getitemseekerspecies
              ifvare ARMORISUSED? 1
              { 
               ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT USED WHITE-CLASS ARMOR!
               ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT USED WHITE-CLASS ARMOR!
              }
              else
              { 
               ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT WHITE-CLASS ARMOR!
               ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT WHITE-CLASS ARMOR!
              }
             }
             else
             {  
              randvarvar TEMPVAR 1000
              state assesspickuprequirements
              ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
	        ifvarvarl CURRENTENEMYARMORPERCENT TEMPVAR setvarvar CURRENTENEMYARMORPERCENT TEMPVAR
              state getitemseekerspecies
              ifvare ARMORISUSED? 1
              { 
               ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT USED RANDOM-CLASS ARMOR!
               ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT USED RANDOM-CLASS ARMOR!
              }
              else
              { 
               ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT RANDOM-CLASS ARMOR!
               ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT RANDOM-CLASS ARMOR!
              }
             }
             setactorvar[ITEMSEEK].ENEMYARMORPERCENT CURRENTENEMYARMORPERCENT
            }
            setvar WORLDTILESHUFFLES 0
            state getworldtile
            ifvarand ACTORFLAGS 4 nullop
            else
            {
             setactorvar[ITEMSEEK].ENEMYAPDAMAGED? -1
             ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
             ifvare ARMORISUSED? 1 globalsound KICK_HIT else globalsound DUKE_GET
            }
           }
           addvarvar ITEMENEMYCURRENTAP ITEMSEEKC
           ifvarvarg ITEMENEMYCURRENTAP ITEMENEMYMAXAP setvarvar ITEMENEMYCURRENTAP ITEMENEMYMAXAP 
           setactorvar[ITEMSEEK].ENEMYAP ITEMENEMYCURRENTAP
           state resetitemtarget
           state enemygrabitemflash
          }
	   }
  }

}

 ifvare ARMORISUSED? 1
 {
  // Change Sprite based on the character in use
  ifvare ARMORAPPEARANCE? 0 action COLORSHIELD-MALE_USED
  ifvare ARMORAPPEARANCE? 1 action COLORSHIELD-FEMALE_USED
  ifvare ARMORAPPEARANCE? 2 action COLORSHIELD-ESSENCE_USED
  ifvare ARMORAPPEARANCE? 3 action COLORSHIELD-CYBANIS_USED
 }
 else
 {
  // Change Sprite based on the character in use
  ifvare ARMORAPPEARANCE? 0 action COLORSHIELD-MALE
  ifvare ARMORAPPEARANCE? 1 action COLORSHIELD-FEMALE
  ifvare ARMORAPPEARANCE? 2 action COLORSHIELD-ESSENCE
  ifvare ARMORAPPEARANCE? 3 action COLORSHIELD-CYBANIS
 }

enda

state pickupcharacter_supershield
           state checkexplodeflag
	     ifvare ARMORISUSED? 1
	     {
            setvarvar RECEIVEDARMOR MAXARMORPOINTSATOMIC
            ifrnd 64 mulvar RECEIVEDARMOR 1750 
            else ifrnd 85 mulvar RECEIVEDARMOR 1500
            else ifrnd 128 mulvar RECEIVEDARMOR 1000
            else mulvar RECEIVEDARMOR 500
            divvar RECEIVEDARMOR 1000

            addvarvar CURRENTARMORPOINTS RECEIVEDARMOR
            ifvarvarg CURRENTARMORPOINTS MAXARMORPOINTSATOMIC setvarvar CURRENTARMORPOINTS MAXARMORPOINTSATOMIC

            ifrnd 64 ifvarl ARMORPERCENT 333 setvar ARMORPERCENT 333
            else ifrnd 85 ifvarl ARMORPERCENT 500 setvar ARMORPERCENT 500
            else ifrnd 128 ifvarl ARMORPERCENT 750 setvar ARMORPERCENT 750
            else ifvarl ARMORPERCENT 900 setvar ARMORPERCENT 900

            ifvarand ACTORFLAGS 2 nullop
            else
            {
             globalsound KICK_HIT
             ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
             setvar PLAYERAPDAMAGED? -1
             setvarvar fta fta_normal setvar ftq 149
             palfrom 24 0 32
            }
            killit
	     }
	     else
	     {
	      ifrnd 64 ifvarl ARMORPERCENT 333 setvar ARMORPERCENT 333
	      else ifrnd 85 ifvarl ARMORPERCENT 500 setvar ARMORPERCENT 500
	      else ifrnd 128 ifvarl ARMORPERCENT 750 setvar ARMORPERCENT 750
	      else ifvarl ARMORPERCENT 900 setvar ARMORPERCENT 900
            setvarvar ACTORPICKUPAMOUNT ARMORPERCENT
            state checkpickupamountflags
            setvarvar ARMORPERCENT ACTORPICKUPAMOUNT
            ifvarg ARMORPERCENT 999 setvar ARMORPERCENT 1000

	      setvarvar RECEIVEDARMOR MAXARMORPOINTSATOMIC
	      setvarvar CURRENTARMORPOINTS RECEIVEDARMOR

            ifvarand ACTORFLAGS 2 nullop
            else
            {
             ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
             setvar PLAYERAPDAMAGED? -1
 	       setvarvar fta fta_normal setvar ftq 148
            }
	      ifspawnedby SUPERSHIELD
	       state getcode
 	      else
 	       state quikget
	     }
ends

state pickupvehicle_supershield
           state checkexplodeflag
	     ifvare ARMORISUSED? 1
	     {
            setvarvar RECEIVEDARMOR TEMPVAR5
            ifrnd 64 mulvar RECEIVEDARMOR 1750 
            else ifrnd 85 mulvar RECEIVEDARMOR 1500
            else ifrnd 128 mulvar RECEIVEDARMOR 1000
            else mulvar RECEIVEDARMOR 500
            divvar RECEIVEDARMOR 1000

            addvarvar TEMPVAR4 RECEIVEDARMOR
            ifvarvarg TEMPVAR4 TEMPVAR5 setvarvar TEMPVAR4 TEMPVAR5
            setactorvar[tempvehicleid].ENEMYAP TEMPVAR4

            getactorvar[tempvehicleid].ENEMYARMORPERCENT TEMPVAR3
            ifrnd 64 ifvarl TEMPVAR3 333 setvar TEMPVAR3 333
            else ifrnd 85 ifvarl TEMPVAR3 500 setvar TEMPVAR3 500
            else ifrnd 128 ifvarl TEMPVAR3 750 setvar TEMPVAR3 750
            else ifvarl TEMPVAR3 900 setvar TEMPVAR3 900
            setactorvar[tempvehicleid].ENEMYARMORPERCENT TEMPVAR3

            ifvarand ACTORFLAGS 2 nullop
            else
            {
             setvar VEHICLEAPDAMAGED? -1
             globalsound KICK_HIT
             globalsound USE_ARMORITEM3
             redefinequote 836 ^15GRABBED A SUIT OF USED SUPER ARMOR FOR YOUR VEHICLE!
 	       setvarvar fta fta_normal setvar ftq 836
             palfrom 24 0 32
            }
            killit
	     }
	     else
	     {
            getactorvar[tempvehicleid].ENEMYARMORPERCENT TEMPVAR3
	      ifrnd 64 ifvarl TEMPVAR3 333 setvar TEMPVAR3 333
	      else ifrnd 85 ifvarl TEMPVAR3 500 setvar TEMPVAR3 500
	      else ifrnd 128 ifvarl TEMPVAR3 750 setvar TEMPVAR3 750
	      else ifvarl TEMPVAR3 900 setvar TEMPVAR3 900
            setvarvar ACTORPICKUPAMOUNT TEMPVAR3
            state checkpickupamountflags
            setvarvar TEMPVAR3 ACTORPICKUPAMOUNT
            ifvarg TEMPVAR3 999 setvar TEMPVAR3 1000
            setactorvar[tempvehicleid].ENEMYARMORPERCENT TEMPVAR3

	      setvarvar RECEIVEDARMOR TEMPVAR5
	      setvarvar TEMPVAR4 RECEIVEDARMOR
            setactorvar[tempvehicleid].ENEMYAP TEMPVAR4

            ifvarand ACTORFLAGS 2 nullop
            else
            {
             globalsound USE_ARMORITEM3
             setvar VEHICLEAPDAMAGED? -1
             redefinequote 836 ^15GRABBED A SUIT OF SUPER ARMOR FOR YOUR VEHICLE!
 	       setvarvar fta fta_normal setvar ftq 836
            }
	      ifspawnedby SUPERSHIELD
	       state getcode
	      else
 	       state quikget
	     }
//
ends

state pickupinventory_supershield
          state checkexplodeflag
	    ifvare ARMORISUSED? 1
          {
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags
           addvarvar USEDSUPERARMORS ACTORPICKUPAMOUNT
           ifvarand ACTORFLAGS 2 nullop
           else
           {
            ifvare ACTORPICKUPAMOUNT 1
            {
             redefinequote 836 ^14 STORED A SUIT OF USED SUPER ARMOR INTO INVENTORY!
            }
            else
            {
             redefinequote 836 ^14 STORED %ld SUITS OF USED SUPER ARMOR INTO INVENTORY!
             qsprintf 836 836 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           globalsound FOUND_INVENTORY
           ifspawnedby SUPERSHIELD
	      state getcode
           else
	      state quikget
          }
          else
	    {
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags
           addvarvar SUPERARMORS ACTORPICKUPAMOUNT
           ifvarand ACTORFLAGS 2 nullop
           else
           {
            ifvare ACTORPICKUPAMOUNT 1
            {
             redefinequote 836 ^14 STORED A SUIT OF SUPER ARMOR INTO INVENTORY!
            }
            else
            {
             redefinequote 836 ^14 STORED %ld SUITS OF SUPER ARMOR INTO INVENTORY!
             qsprintf 836 836 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           globalsound FOUND_INVENTORY
           ifspawnedby SUPERSHIELD
	      state getcode
           else
	      state quikget
	    }
ends

// SUPERSHIELD = 66

action SUPERSHIELD-MALE 5318 // 5384 - 66 = 5318
action SUPERSHIELD-FEMALE 5317 // 5383 - 66 = 5317
action SUPERSHIELD-ESSENCE 5315 // 5381 - 66 = 5315
action SUPERSHIELD-CYBANIS 5316 // 5382 - 66 = 5316 
action SUPERSHIELD-MALE_USED 5467 // 5533 - 66 = 5467
action SUPERSHIELD-FEMALE_USED 5466 // 5532 - 54 = 5466
action SUPERSHIELD-ESSENCE_USED 5464 // 5530 - 54 = 5464
action SUPERSHIELD-CYBANIS_USED 5465 // 5531 - 54 = 5465 

eventloadactor SUPERSHIELD state setpickupflags enda
useractor notenemy SUPERSHIELD 0

 state calcplayermaxarmoratomic  
 ifvare FLAGSSET? 0
 {
  spritepal 24 sizeat 48 48
  setactorvar[THISACTOR].ACTORNATURALPAL 24
  setvar FLAGSSET? 1 
 }

 ifaction SUPERSHIELD-MALE { setvar ACTORSHEIGHT 26 setvar ACTORSWIDTH 27 }
 ifaction SUPERSHIELD-MALE_USED { setvar ACTORSHEIGHT 26 setvar ACTORSWIDTH 27 }
 ifaction SUPERSHIELD-FEMALE { setvar ACTORSHEIGHT 22 setvar ACTORSWIDTH 22 }
 ifaction SUPERSHIELD-FEMALE_USED { setvar ACTORSHEIGHT 22 setvar ACTORSWIDTH 22 }
 ifaction SUPERSHIELD-ESSENCE { setvar ACTORSHEIGHT 45 setvar ACTORSWIDTH 56 }
 ifaction SUPERSHIELD-ESSENCE_USED { setvar ACTORSHEIGHT 45 setvar ACTORSWIDTH 56 }
 ifaction SUPERSHIELD-CYBANIS { setvar ACTORSHEIGHT 50 setvar ACTORSWIDTH 58 }
 ifaction SUPERSHIELD-CYBANIS_USED { setvar ACTORSHEIGHT 50 setvar ACTORSWIDTH 58 }
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifcount 6
       {
        ifpdistl RETRIEVEDISTANCE
        {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTSATOMIC state pickupcharacter_supershield else state pickupinventory_supershield
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTSATOMIC state pickupcharacter_supershield else state pickupinventory_supershield
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
           mulvar TEMPVAR5 2
           ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_supershield else state pickupinventory_supershield
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTSATOMIC
           {
            state pickupcharacter_supershield
           }
           else
           {
            getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
            mulvar TEMPVAR5 2
            ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_supershield else state pickupinventory_supershield
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
           mulvar TEMPVAR5 2
           ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_supershield
           else
           {
            ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTSATOMIC state pickupcharacter_supershield else state pickupinventory_supershield
           }
          }
         }
        }
       }
      }
     }
    }
   }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
    state checkenemypickuphealth
    getactorvar[ITEMSEEK].ENEMYAP ITEMENEMYCURRENTAP
    getactorvar[ITEMSEEK].ENEMYMAXAP ITEMENEMYMAXAP
    setvarvar ITEMENEMYMAXAPATOMIC ITEMENEMYMAXAP
    mulvar ITEMENEMYMAXAPATOMIC 2

    ifvarg ITEMSEEKB 0
    {
     ifvarvarl ITEMENEMYCURRENTAP ITEMENEMYMAXAPATOMIC
     {
            state checkexplodeflag
            setvarvar ITEMSEEKC ITEMENEMYMAXAPATOMIC
            ifvare ARMORISUSED? 1
            {
             state monstersupershielddrop2
            }
            else
            {
             mulvar ITEMSEEKC 2000
             divvar ITEMSEEKC 1000

	       ifrnd 64 ifvarl TEMPVAR 333 setvar TEMPVAR 333
	       else ifrnd 85 ifvarl TEMPVAR 500 setvar TEMPVAR 500
	       else ifrnd 128 ifvarl TEMPVAR 750 setvar TEMPVAR 750
 	       else ifvarl TEMPVAR 900 setvar TEMPVAR 900
             state assesspickuprequirements
             ifvarg TEMPVAR 1000 setvar TEMPVAR 1000
	       ifvarvarl CURRENTENEMYARMORPERCENT TEMPVAR setvarvar CURRENTENEMYARMORPERCENT TEMPVAR

             setactorvar[ITEMSEEK].ENEMYARMORPERCENT CURRENTENEMYARMORPERCENT
             setvar WORLDTILESHUFFLES 0
             state getworldtile
             state getitemseekerspecies
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              setactorvar[ITEMSEEK].ENEMYAPDAMAGED? -1
              globalsound DUKE_GET
              ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
              ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT SUPER ARMOR!
              ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT SUPER ARMOR!
             }
            }
            addvarvar ITEMENEMYCURRENTAP ITEMSEEKC
            ifvarvarg ITEMENEMYCURRENTAP ITEMENEMYMAXAPATOMIC setvarvar ITEMENEMYCURRENTAP ITEMENEMYMAXAPATOMIC
            setactorvar[ITEMSEEK].ENEMYAP ITEMENEMYCURRENTAP
            state resetitemtarget
            state enemygrabitemflash
     }
    }
   }
  }

}

 ifvare ARMORISUSED? 1
 {
  // Change Sprite based on the character in use
  ifvare ARMORAPPEARANCE? 0 action SUPERSHIELD-MALE_USED
  ifvare ARMORAPPEARANCE? 1 action SUPERSHIELD-FEMALE_USED
  ifvare ARMORAPPEARANCE? 2 action SUPERSHIELD-ESSENCE_USED
  ifvare ARMORAPPEARANCE? 3 action SUPERSHIELD-CYBANIS_USED
 }
 else
 {
  // Change Sprite based on the character in use
  ifvare ARMORAPPEARANCE? 0 action SUPERSHIELD-MALE
  ifvare ARMORAPPEARANCE? 1 action SUPERSHIELD-FEMALE
  ifvare ARMORAPPEARANCE? 2 action SUPERSHIELD-ESSENCE
  ifvare ARMORAPPEARANCE? 3 action SUPERSHIELD-CYBANIS
 }

enda

//*******************
//*POWERUP ARTIFACTS*
//*******************

state pickupcharacter_invuln
             state checkexplodeflag
   	 	addvarvar INVULNTIME POWERUPBENEFIT
             ifvarand ACTORFLAGS 2 nullop
             else
             {
   		 setvarvar fta fta_normal setvar ftq 156
              ifvarg INVULNTIME 104 stopsound INVULNITEM2
   		 sound INVULNITEM1
   		 sound DUKE_GET
   		 state artipickupsounds
              ifvare CHARACTERSELECTED? 2 globalsound JACK_GRABINVULN
              else ifvare CHARACTERSELECTED? 3 globalsound BUBSY_GRABINVULN
              else ifvare CHARACTERSELECTED? 6 globalsound ESSENCE_GRABINVULN
              else ifvare CHARACTERSELECTED? 8 globalsound LISA_GRABINVULN
              else ifvare CHARACTERSELECTED? 9 globalsound CYBANIS_GRABINVULN
              else ifvare CHARACTERSELECTED? 13 globalsound MINAKO_GRABINVULN
              else ifvare CHARACTERSELECTED? 15 globalsound MAKEN_GRABINVULN
             }
             setvar WORLDTILESHUFFLES 0
             state getworldtile
      		state activationflag killit
ends

state pickupvehicle_invuln
             state checkexplodeflag
             getactorvar[tempvehicleid].ENEMYINVULNTIME TEMPVAR5
   	 	addvarvar TEMPVAR5 POWERUPBENEFIT
             setactorvar[tempvehicleid].ENEMYINVULNTIME TEMPVAR5
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              redefinequote 836 ^15YOUR VEHICLE ACCQUIRED AN ICON OF THE DEFENDER! >:D
   		 setvarvar fta fta_normal setvar ftq 836
              ifvarg TEMPVAR5 104 stopsound INVULNITEM2
   		 sound INVULNITEM1
   		 sound DUKE_GET
   		 state artipickupsounds
             }
             setvar WORLDTILESHUFFLES 0
             state getworldtile
      		state activationflag killit
ends

action DEFENDERSPIN 347 //  5502 - 5155 = 347

// Invulnerability Item Pickup
eventloadactor ICONOFTHEDEFENDER state setpickupflags enda
useractor notenemy ICONOFTHEDEFENDER 0

 getactor[THISACTOR].mdflags TEMP
 orvar TEMP 16
 setactor[THISACTOR].mdflags TEMP 

 state itemfullbright
 state checkartifacttimes
 sizeat 48 48
 setvar ACTORSHEIGHT 29 setvar ACTORSWIDTH 22
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          ifcanseetarget
	    {
           getactorvar[PLAYERID].VEHICLEID tempvehicleid
           ifvare tempvehicleid -1 state pickupcharacter_invuln
           else
           {
            ifvare vehiclepickuptoggle 0 state pickupcharacter_invuln // Character Only
            ifvare vehiclepickuptoggle 1 state pickupvehicle_invuln // Vehicle Only
            ifvare vehiclepickuptoggle 2 state pickupcharacter_invuln // Character & Vehicle [Character before Vehicle]
            ifvare vehiclepickuptoggle 3 state pickupvehicle_invuln // Vehicle & Character [Vehicle before Character]
           }
	    }
         }
        }
       }
      }
    }
   }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
	   {
          state checkenemypickuphealth
          getactorvar[ITEMSEEK].ENEMYINVULNTIME ITEMSEEKC

          ifvarg ITEMSEEKB 0
          {
           state checkexplodeflag
           addvarvar ITEMSEEKC POWERUPBENEFIT
           setactorvar[ITEMSEEK].ENEMYINVULNTIME ITEMSEEKC
           state resetitemtarget
           setvar WORLDTILESHUFFLES 0
           state getworldtile
           state getitemseekerspecies
           ifvarand ACTORFLAGS 4 nullop
           else
           {
            ifvarg ENEMYINVULNTIME 104 stopsound INVULNITEM2
            sound INVULNITEM1
            globalsound DUKE_GET
            ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT AN INVULN ITEM! O_O
            ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT AN INVULN ITEM! <_<
           }
           state enemygrabitemflash
          }
	   }
   }
  action DEFENDERSPIN
enda

state pickupcharacter_quad
             state checkexplodeflag
	       addvarvar QUADTIME POWERUPBENEFIT
             ifvarand ACTORFLAGS 2 nullop
             else
             {
 	        setvarvar fta fta_normal setvar ftq 164
              ifvarg QUADTIME 104 stopsound QUADDAMAGE2
	        sound QUADDAMAGE1
	        sound DUKE_GET
   	        state artipickupsounds
              ifvare CHARACTERSELECTED? 2 globalsound JACK_GRABQUAD
              else ifvare CHARACTERSELECTED? 3 globalsound BUBSY_GRABQUAD
              else ifvare CHARACTERSELECTED? 6 globalsound ESSENCE_GRABQUAD
              else ifvare CHARACTERSELECTED? 8 globalsound LISA_GRABQUAD
              else ifvare CHARACTERSELECTED? 9 globalsound CYBANIS_GRABQUAD
              else ifvare CHARACTERSELECTED? 13 globalsound MINAKO_GRABQUAD
              else ifvare CHARACTERSELECTED? 15 globalsound MAKEN_GRABQUAD
             }
             setvar WORLDTILESHUFFLES 0
             state getworldtile
	       state activationflag killit
ends

state pickupvehicle_quad
             state checkexplodeflag
             getactorvar[tempvehicleid].ENEMYQUADTIME TEMPVAR5
   	 	addvarvar TEMPVAR5 POWERUPBENEFIT
             setactorvar[tempvehicleid].ENEMYQUADTIME TEMPVAR5
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              redefinequote 836 ^15YOUR VEHICLE ACCQUIRED A QUAD DAMAGE! >:D
   		 setvarvar fta fta_normal setvar ftq 836
              ifvarg TEMPVAR5 104 stopsound QUADDAMAGE2
   		 sound QUADDAMAGE1
   		 sound DUKE_GET
   		 state artipickupsounds
             }
             setvar WORLDTILESHUFFLES 0
             state getworldtile
      		state activationflag killit
ends

action QUADSPIN 5458 // 5494 - 36 = 5458

eventloadactor QUADDAMAGE state setpickupflags enda
useractor notenemy QUADDAMAGE 0

 getactor[THISACTOR].mdflags TEMP
 orvar TEMP 16
 setactor[THISACTOR].mdflags TEMP 

 state itemfullbright
 state checkartifacttimes
 sizeat 22 22
 ifvare mainmenu 0 state fallflags
 setvar ACTORSHEIGHT 69 setvar ACTORSWIDTH 54
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          ifcanseetarget
	    {
           getactorvar[PLAYERID].VEHICLEID tempvehicleid
           ifvare tempvehicleid -1 state pickupcharacter_quad
           else
           {
            ifvare vehiclepickuptoggle 0 state pickupcharacter_quad // Character Only
            ifvare vehiclepickuptoggle 1 state pickupvehicle_quad // Vehicle Only
            ifvare vehiclepickuptoggle 2 state pickupcharacter_quad // Character & Vehicle [Character before Vehicle]
            ifvare vehiclepickuptoggle 3 state pickupvehicle_quad // Vehicle & Character [Vehicle before Character]
           }
	    }
         }
        } 
       }
      }
    }
   }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
	   {
          state checkenemypickuphealth
          getactorvar[ITEMSEEK].ENEMYQUADTIME ITEMSEEKC

          ifvarg ITEMSEEKB 0
          {
           state checkexplodeflag
           addvarvar ITEMSEEKC POWERUPBENEFIT
           setactorvar[ITEMSEEK].ENEMYQUADTIME ITEMSEEKC
           state resetitemtarget
           setvar WORLDTILESHUFFLES 0
           state getworldtile
           state getitemseekerspecies
           ifvarand ACTORFLAGS 4 nullop
           else
           {
            ifvarg ENEMYQUADTIME 104 stopsound QUADDAMAGE2
            sound QUADDAMAGE1
            globalsound DUKE_GET
            ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT A QUAD DAMAGE! D:
            ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT A QUAD DAMAGE! :|
           }
           state enemygrabitemflash
          }
	   }
  }
  action QUADSPIN
enda

state pickupcharacter_regen
             state checkexplodeflag
             state gotmedsyoureallyneeded
	       addvarvar REGENTIME POWERUPBENEFIT
             ifvarand ACTORFLAGS 2 nullop
             else
             {
	        setvarvar fta fta_normal setvar ftq 229
	        sound REGEN_GRAB
	        sound DUKE_GET
  		 state artipickupsounds
              ifvare CHARACTERSELECTED? 2 globalsound JACK_GRABREGEN
              else ifvare CHARACTERSELECTED? 3 globalsound BUBSY_GRABREGEN
              else ifvare CHARACTERSELECTED? 6 globalsound ESSENCE_GRABREGEN
              else ifvare CHARACTERSELECTED? 8 globalsound LISA_GRABREGEN
              else ifvare CHARACTERSELECTED? 9 globalsound CYBANIS_GRABREGEN
              else ifvare CHARACTERSELECTED? 13 globalsound MINAKO_GRABREGEN
              else ifvare CHARACTERSELECTED? 15 globalsound MAKEN_GRABREGEN
             }
	     	setvar PLAYERREGENCOUNTER 25
             setvar WORLDTILESHUFFLES 0
             state getworldtile
 	       state activationflag killit
ends

state pickupvehicle_regen
             state checkexplodeflag
             getactorvar[tempvehicleid].ENEMYREGENTIME TEMPVAR5
   	 	addvarvar TEMPVAR5 POWERUPBENEFIT
             setactorvar[tempvehicleid].ENEMYREGENTIME TEMPVAR5
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              redefinequote 836 ^15YOUR VEHICLE ACCQUIRED A REGENERATION ANKH! >:D
   		 setvarvar fta fta_normal setvar ftq 836
	        sound REGEN_GRAB
	        sound DUKE_GET
  		 state artipickupsounds
             }
	     	setactorvar[tempvehicleid].ENEMYREGENCOUNTER 25
             setvar WORLDTILESHUFFLES 0
             state getworldtile
 	       state activationflag killit
ends

eventloadactor REGENITEM state setpickupflags enda
useractor notenemy REGENITEM 0

 state itemfullbright
 state checkartifacttimes
 sizeat 12 12
 setvar ACTORSHEIGHT 120 setvar ACTORSWIDTH 120
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          ifcanseetarget
	    {
           getactorvar[PLAYERID].VEHICLEID tempvehicleid
           ifvare tempvehicleid -1 state pickupcharacter_regen
           else
           {
            ifvare vehiclepickuptoggle 0 state pickupcharacter_regen // Character Only
            ifvare vehiclepickuptoggle 1 state pickupvehicle_regen // Vehicle Only
            ifvare vehiclepickuptoggle 2 state pickupcharacter_regen // Character & Vehicle [Character before Vehicle]
            ifvare vehiclepickuptoggle 3 state pickupvehicle_regen // Vehicle & Character [Vehicle before Character]
           }
	    }
         }
        }
       }
      }
    }
   }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
	   {
          state checkenemypickuphealth
          getactorvar[ITEMSEEK].ENEMYREGENTIME ITEMSEEKC

          ifvarg ITEMSEEKB 0
          {
           state checkexplodeflag
           addvarvar ITEMSEEKC POWERUPBENEFIT
           setactorvar[ITEMSEEK].ENEMYREGENTIME ITEMSEEKC
           state resetitemtarget
           setvar ENEMYREGENCOUNTER 25
           state getitemseekerspecies
           setvar WORLDTILESHUFFLES 0
           state getworldtile
           ifvarand ACTORFLAGS 4 nullop
           else
           {
            globalsound REGEN_GRAB
            globalsound DUKE_GET
            ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT A REGENERATION ANKH! :(
            ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT A REGENERATION ANKH! :O
           }
           state enemygrabitemflash
          }
	   }
  }
enda

state pickupcharacter_apregen
             state checkexplodeflag
	       addvarvar APREGENTIME POWERUPBENEFIT
             ifvarand ACTORFLAGS 2 nullop
             else
             {
	        setvarvar fta fta_normal setvar ftq 233
	        sound REGEN_GRABAP
	        sound DUKE_GET
   		 state artipickupsounds
              ifvare CHARACTERSELECTED? 2 globalsound JACK_GRABAPREGEN
              else ifvare CHARACTERSELECTED? 3 globalsound BUBSY_GRABAPREGEN
              else ifvare CHARACTERSELECTED? 6 globalsound ESSENCE_GRABAPREGEN
              else ifvare CHARACTERSELECTED? 8 globalsound LISA_GRABAPREGEN
              else ifvare CHARACTERSELECTED? 9 globalsound CYBANIS_GRABAPREGEN
              else ifvare CHARACTERSELECTED? 13 globalsound MINAKO_GRABAPREGEN
              else ifvare CHARACTERSELECTED? 15 globalsound MAKEN_GRABAPREGEN
             }
	       setvar PLAYERAPREGENCOUNTER 25
             setvar WORLDTILESHUFFLES 0
             state getworldtile
	       state activationflag killit
ends

state pickupvehicle_apregen
             state checkexplodeflag
             getactorvar[tempvehicleid].ENEMYAPREGENTIME TEMPVAR5
   	 	addvarvar TEMPVAR5 POWERUPBENEFIT
             setactorvar[tempvehicleid].ENEMYAPREGENTIME TEMPVAR5
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              redefinequote 836 ^15YOUR VEHICLE ACCQUIRED A SHIELD EMBLEM! >:D
   		 setvarvar fta fta_normal setvar ftq 836
	        sound REGEN_GRABAP
	        sound DUKE_GET
  		 state artipickupsounds
             }
	     	setactorvar[tempvehicleid].ENEMYAPREGENCOUNTER 25
             setvar WORLDTILESHUFFLES 0
             state getworldtile
 	       state activationflag killit
ends

action SPINNINGSHIELD -414 // 5900 - 5486 = -414

eventloadactor APREGENITEM state setpickupflags enda
useractor notenemy APREGENITEM 0

 getactor[THISACTOR].mdflags TEMP
 orvar TEMP 16
 setactor[THISACTOR].mdflags TEMP 

 state itemfullbright
 state checkartifacttimes
 sizeat 38 38
 setvar ACTORSHEIGHT 28 setvar ACTORSWIDTH 24
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          ifcanseetarget
	    {
           getactorvar[PLAYERID].VEHICLEID tempvehicleid
           ifvare tempvehicleid -1 state pickupcharacter_apregen
           else
           {
            ifvare vehiclepickuptoggle 0 state pickupcharacter_apregen // Character Only
            ifvare vehiclepickuptoggle 1 state pickupvehicle_apregen // Vehicle Only
            ifvare vehiclepickuptoggle 2 state pickupcharacter_apregen // Character & Vehicle [Character before Vehicle]
            ifvare vehiclepickuptoggle 3 state pickupvehicle_apregen // Vehicle & Character [Vehicle before Character]
           }
	    }
         }
        }
       }
      }
    }
   }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
	   {
          state checkenemypickuphealth
          getactorvar[ITEMSEEK].ENEMYAPREGENTIME ITEMSEEKC

          ifvarg ITEMSEEKB 0
          {
           state checkexplodeflag
           addvarvar ITEMSEEKC POWERUPBENEFIT
           setactorvar[ITEMSEEK].ENEMYAPREGENTIME ITEMSEEKC
           state resetitemtarget
           setvar WORLDTILESHUFFLES 0
           state getworldtile
           setvar ENEMYAPREGENCOUNTER 25
           state getitemseekerspecies
           ifvarand ACTORFLAGS 4 nullop
           else
           {
            globalsound REGEN_GRABAP
            globalsound DUKE_GET
            ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT A SHIELD EMBLEM! :(
            ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT A SHIELD EMBLEM! :O
           }
            state enemygrabitemflash
          }
	   }
  }
  action SPINNINGSHIELD
enda

state pickupcharacter_vampire
             state checkexplodeflag
	       addvarvar VAMPIRETIME POWERUPBENEFIT
             ifvarand ACTORFLAGS 2 nullop
             else
             {
	        setvarvar fta fta_normal setvar ftq 235
	        sound GRAB_VAMPIREITEM
	        sound DUKE_GET
   		 state artipickupsounds
              ifvare CHARACTERSELECTED? 2 globalsound JACK_GRABVAMPIRE
              else ifvare CHARACTERSELECTED? 3 globalsound BUBSY_GRABVAMPIRE
              else ifvare CHARACTERSELECTED? 6 globalsound ESSENCE_GRABVAMPIRE
              else ifvare CHARACTERSELECTED? 8 globalsound LISA_GRABVAMPIRE
              else ifvare CHARACTERSELECTED? 9 globalsound CYBANIS_GRABVAMPIRE
              else ifvare CHARACTERSELECTED? 13 globalsound MINAKO_GRABVAMPIRE
              else ifvare CHARACTERSELECTED? 15 globalsound MAKEN_GRABVAMPIRE
             }
             setvar WORLDTILESHUFFLES 0
             state getworldtile
	       state activationflag killit
ends

state pickupvehicle_vampire
             state checkexplodeflag
             getactorvar[tempvehicleid].ENEMYVAMPIRETIME TEMPVAR5
   	 	addvarvar TEMPVAR5 POWERUPBENEFIT
             setactorvar[tempvehicleid].ENEMYVAMPIRETIME TEMPVAR5
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              redefinequote 836 ^15YOUR VEHICLE ACCQUIRED A VAMPIRE MASK! >:D
   		 setvarvar fta fta_normal setvar ftq 836
	        sound GRAB_VAMPIREITEM
	        sound DUKE_GET
  		 state artipickupsounds
             }
             setvar WORLDTILESHUFFLES 0
             state getworldtile
 	       state activationflag killit
ends

// Vampire/Drain Artifact
eventloadactor VAMPIREITEM state setpickupflags enda
useractor notenemy VAMPIREITEM 0

 state itemfullbright
 state checkartifacttimes
 sizeat 40 40
 setvar ACTORSHEIGHT 37 setvar ACTORSWIDTH 25
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          ifcanseetarget
	    {
           getactorvar[PLAYERID].VEHICLEID tempvehicleid
           ifvare tempvehicleid -1 state pickupcharacter_vampire
           else
           {
            ifvare vehiclepickuptoggle 0 state pickupcharacter_vampire // Character Only
            ifvare vehiclepickuptoggle 1 state pickupvehicle_vampire // Vehicle Only
            ifvare vehiclepickuptoggle 2 state pickupcharacter_vampire // Character & Vehicle [Character before Vehicle]
            ifvare vehiclepickuptoggle 3 state pickupvehicle_vampire // Vehicle & Character [Vehicle before Character]
           }
	    }
         }
        }
       }
      }
    }
   }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
	   {
          state checkenemypickuphealth
          getactorvar[ITEMSEEK].ENEMYVAMPIRETIME ITEMSEEKC

          ifvarg ITEMSEEKB 0
          {
           state checkexplodeflag
           addvarvar ITEMSEEKC POWERUPBENEFIT
           setactorvar[ITEMSEEK].ENEMYVAMPIRETIME ITEMSEEKC
           state resetitemtarget
           setvar WORLDTILESHUFFLES 0
           state getworldtile
           state getitemseekerspecies
           ifvarand ACTORFLAGS 4 nullop
           else
           {
            globalsound GRAB_VAMPIREITEM
            globalsound DUKE_GET
            ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT A VAMPIRE MASK! D:
            ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT A VAMPIRE MASK! :P
           }
            state enemygrabitemflash
          }
	   }
  }
enda

// OTHER

eventloadactor COILS state setpickupflags enda
useractor notenemy COILS 0

 state itemfullbright
 sizeat 40 40
 setvar ACTORSHEIGHT 10 setvar ACTORSWIDTH 24
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
             ifvarl TELEPORTERCOILS 2400
 	       {
              setvarvar ACTORPICKUPAMOUNT 20
              state checkpickupamountflags
              addvarvar TELEPORTERCOILS ACTORPICKUPAMOUNT
        	 ifvarg TELEPORTERCOILS 2400 setvar TELEPORTERCOILS 2400
       	 redefinequote 335 ^20GOT 20 TELEPORTER COILS! 
       	 redefinequote 336 ^20GOT %ld TELEPORTER COILS! 
              qsprintf 335 336 ACTORPICKUPAMOUNT
              ifvarand ACTORFLAGS 2 nullop
              else
              {
         	  palfrom 16 0 32
         	  globalsound DUKE_GET
          	  setvarvar fta fta_normal setvar ftq 335
              }
              setvar WORLDTILESHUFFLES 0
              state getworldtile
        	 state activationflag killit
      		}
       }
   }
 }

}
enda

state fortunecookie_fortunedisplays
	        // Defines the various quotes for a fortune cookie
	        setvar FORTUNECOOKIETIMER 78 // displays fortune for 3 seconds
	        randvar FORTUNECOOKIEQUOTE 66 // Determines how many of the fortunes on the list below are used
	        {
	         ifvare FORTUNECOOKIEQUOTE 0 redefinequote 272 FORTUNE SAY: ALL YOUR BASE ARE BELONG TO US!
	         else ifvare FORTUNECOOKIEQUOTE 1 redefinequote 272 FORTUNE SAY: IT'S OVER NINE THOUSAAAND!!!
	         else ifvare FORTUNECOOKIEQUOTE 2 redefinequote 272 FORTUNE SAY: HIT THE BOSSES' WEAKPOINT FOR MASSIVE DAMAGE!
	         else 
               ifvare FORTUNECOOKIEQUOTE 3
               {
                ifvare CHARACTERSELECTED? 4 redefinequote 272 FORTUNE SAY: PROTIP: AMI TAKES WAY LESS DAMAGE FROM ICE!
                else ifvare CHARACTERSELECTED? 10 redefinequote 272 FORTUNE SAY: PROTIP: NETHRA ABSORBS ICE-DAMAGE IN HER HUMAN FORM!
                else redefinequote 272 FORTUNE SAY: PROTIP: ICE IS COLD!
               }
	         else 
               ifvare FORTUNECOOKIEQUOTE 4 
               {
                ifvare CHARACTERSELECTED? 7 redefinequote 272 FORTUNE SAY: PROTIP: TED TAKES LESS DAMAGE FROM EXPLOSIVES!
                ifvare CHARACTERSELECTED? 13 redefinequote 272 FORTUNE SAY: PROTIP: MAKEN TAKES WAY LESS DAMAGE FROM EXPLOSIVES AND FIRE!
                else redefinequote 272 FORTUNE SAY: PROTIP: FIRE IS HOT!
               }
	         else ifvare FORTUNECOOKIEQUOTE 5 redefinequote 272 FORTUNE SAY: LOOKIN' AT ME, LOOKIN' AT YOU, LOOKIN' AT ME.
	         else
	         ifvare FORTUNECOOKIEQUOTE 6
	         {
	          ifvare GENDER? 0 redefinequote 272 FORTUNE SAY: YOU NEVER GOING TO SCORE.
	          ifvare GENDER? 1 redefinequote 272 FORTUNE SAY: LOVE WILL COME TO YOU EASY.
	         }
	         else
	         ifvare FORTUNECOOKIEQUOTE 7
	         {
                ifvare CHARACTERSELECTED? 1 redefinequote 272 FORTUNE SAY: TRY TO GET ALONG BETTER. BE A NICE MAN.
                ifvare CHARACTERSELECTED? 2 redefinequote 272 FORTUNE SAY: TRY TO GET ALONG BETTER. BE A NICE BOY.
                ifvare CHARACTERSELECTED? 3 redefinequote 272 FORTUNE SAY: TRY TO GET ALONG BETTER. BE A NICE BOBCAT.
                ifvare CHARACTERSELECTED? 4 redefinequote 272 FORTUNE SAY: TRY TO GET ALONG BETTER. BE A NICE GIRL.
                ifvare CHARACTERSELECTED? 5 redefinequote 272 FORTUNE SAY: TRY TO GET ALONG BETTER. BE A NICE MAN.
                ifvare CHARACTERSELECTED? 6 redefinequote 272 FORTUNE SAY: TRY TO GET ALONG BETTER. BE A NICE ALIEN.
                ifvare CHARACTERSELECTED? 7 redefinequote 272 FORTUNE SAY: TRY TO GET ALONG BETTER. BE A NICE BOY.
                ifvare CHARACTERSELECTED? 8 redefinequote 272 FORTUNE SAY: TRY TO GET ALONG BETTER. BE A NICE GIRL.
                ifvare CHARACTERSELECTED? 9 redefinequote 272 FORTUNE SAY: TRY TO GET ALONG BETTER. BE A NICE ALIEN.
                ifvare CHARACTERSELECTED? 10
                {
                 ifvare NETHRAFORM? 0 redefinequote 272 FORTUNE SAY: TRY TO GET ALONG BETTER. BE A NICE ALIEN.
                 else ifvarg NETHRAFORM? 0 redefinequote 272 FORTUNE SAY: TRY TO GET ALONG BETTER. BE A NICE GIRL.
                }
                ifvarg CHARACTERSELECTED? 10 ifvarl CHARACTERSELECTED? 13 redefinequote 272 FORTUNE SAY: TRY TO GET ALONG BETTER. BE A NICE GIRL.
                ifvare CHARACTERSELECTED? 14 redefinequote 272 FORTUNE SAY: TRY TO GET ALONG BETTER. BE A NICE QUEEN.
                ifvare CHARACTERSELECTED? 15 redefinequote 272 FORTUNE SAY: TRY TO GET ALONG BETTER. BE A NICE GIRL.
	         }
	         else
	         ifvare FORTUNECOOKIEQUOTE 8
	         {
	          ifvare GENDER? 0 redefinequote 272 FORTUNE SAY: YOUR CHI ATTRACTS MANY CHICKS.
	          ifvare GENDER? 1 redefinequote 272 FORTUNE SAY: YOUR CHI ATTRACTS MANY DUDES.
	         }
	         else ifvare FORTUNECOOKIEQUOTE 9 redefinequote 272 FORTUNE SAY: MAN WHO STAND ON TOILET, HIGH ON POT.
	         else ifvare FORTUNECOOKIEQUOTE 10 redefinequote 272 FORTUNE SAY: BASEBALL WRONG, MAN WITH 4 BALLS CANNOT WALK.
	         else ifvare FORTUNECOOKIEQUOTE 11 redefinequote 272 FORTUNE SAY: WE COULD PUT SPACE BEHIND IT!
	         else ifvare FORTUNECOOKIEQUOTE 12 redefinequote 272 FORTUNE SAY: SORRY, YOU NO WIN THIS TIME, TRY AGAIN.
	         else ifvare FORTUNECOOKIEQUOTE 13 redefinequote 272 FORTUNE SAY: THERE IS MUCH DEATH IN FUTURE.
	         else
	         ifvare FORTUNECOOKIEQUOTE 14
	         {
                ifvare CHARACTERSELECTED? 1 redefinequote 272 FORTUNE SAY: NO MAN IS ISLAND, EXCEPT DUKE NUKEM.
                ifvare CHARACTERSELECTED? 2 redefinequote 272 FORTUNE SAY: NO MAN IS ISLAND, EXCEPT JACK WALKER.
                ifvare CHARACTERSELECTED? 3 redefinequote 272 FORTUNE SAY: NO MAN IS ISLAND, EXCEPT BUBSY BOBCAT.
                ifvare CHARACTERSELECTED? 4 redefinequote 272 FORTUNE SAY: NO WOMAN IS ISLAND, EXCEPT AMI MIZUNO.
                ifvare CHARACTERSELECTED? 5 redefinequote 272 FORTUNE SAY: NO MAN IS ISLAND, EXCEPT LO WANG.
                ifvare CHARACTERSELECTED? 6 redefinequote 272 FORTUNE SAY: NO MAN IS ISLAND, EXCEPT ESSENCE MARGALAN.
                ifvare CHARACTERSELECTED? 7 redefinequote 272 FORTUNE SAY: NO MAN IS ISLAND, EXCEPT TED MALDORAS.
                ifvare CHARACTERSELECTED? 8 redefinequote 272 FORTUNE SAY: NO WOMAN IS ISLAND, EXCEPT LISA BATES.
                ifvare CHARACTERSELECTED? 9  redefinequote 272 FORTUNE SAY: NO MAN IS ISLAND, EXCEPT CYBANIS MORGANDOS.
                ifvare CHARACTERSELECTED? 10
                {
                 ifvare NETHRAFORM? 0 redefinequote 272 FORTUNE SAY: NO WOMAN IS ISLAND, EXCEPT NETHRA MARABOSHI.
                 ifvare NETHRAFORM? 1 redefinequote 272 FORTUNE SAY: NO WOMAN IS ISLAND, EXCEPT CHRISTINA MITCHELL.
                }
                ifvare CHARACTERSELECTED? 11 redefinequote 272 FORTUNE SAY: NO WOMAN IS ISLAND, EXCEPT PAULA POLESTAR.
                ifvare CHARACTERSELECTED? 12 redefinequote 272 FORTUNE SAY: NO WOMAN IS ISLAND, EXCEPT LORI STEPHENS.
                ifvare CHARACTERSELECTED? 13 redefinequote 272 FORTUNE SAY: NO WOMAN IS ISLAND, EXCEPT MINAKO AINO.
                ifvare CHARACTERSELECTED? 14
                {
                 ifvare debugtoggle 0
                 {
                  ifvare PUBLICBETA? 1
                  {
                   redefinequote 272 FORTUNE SAY: NO WOMAN IS ISLAND, EXCEPT ??????? ?????????.
                  }
                  else
                  {
                   redefinequote 272 FORTUNE SAY: NO WOMAN IS ISLAND, EXCEPT NAFERIA MABOROSHI.
                  }
                 }
                 else
                 {
                  ifvare PUBLICBETA? 1
                  {
                   redefinequote 272 FORTUNE SAY: NO WOMAN IS ISLAND, EXCEPT HINOTORI GENKAI.
                  }
                  else
                  {
                   redefinequote 272 FORTUNE SAY: NO WOMAN IS ISLAND, EXCEPT NAFERIA MABOROSHI.
                  }
                 }
                }
                ifvare CHARACTERSELECTED? 15 redefinequote 272 FORTUNE SAY: NO WOMAN IS ISLAND, EXCEPT MAKEN SHINKARA.
	         }
	         else ifvare FORTUNECOOKIEQUOTE 15 redefinequote 272 FORTUNE SAY: MAN TRAPPED IN PANTRY, HAS ASS IN JAM.
	         else ifvare FORTUNECOOKIEQUOTE 16 redefinequote 272 FORTUNE SAY: 1997 3DREALMS FORTUNE COOKIE COMPANY.
	         else
	         ifvare FORTUNECOOKIEQUOTE 17
	         {
                ifvare CHARACTERSELECTED? 1 redefinequote 272 FORTUNE SAY: TAKE PISS, HAVE BAD KARMA.
                else ifvare CHARACTERSELECTED? 2 redefinequote 272 FORTUNE SAY: THE ONE YOU ADMIRE WILL NEED YOUR HELP.
                else ifvare CHARACTERSELECTED? 3 redefinequote 272 FORTUNE SAY: NARCISSISM NOT ALWAYS NEGATIVE THING.
                else ifvare CHARACTERSELECTED? 4 redefinequote 272 FORTUNE SAY: SOON YOU LEARN BIG SECRET ABOUT YOURSELF.
                else ifvare CHARACTERSELECTED? 5 redefinequote 272 FORTUNE SAY: YOU SHOULD NOT SCRATCH YOURSELF THERE.
                else ifvare CHARACTERSELECTED? 6 redefinequote 272 FORTUNE SAY: THE ONE YOU CARE ABOUT STILL ALIVE.
                else ifvare CHARACTERSELECTED? 7 redefinequote 272 FORTUNE SAY: MAKE OWN PATH, DO NOT FOLLOW OTHERS.
                else ifvare CHARACTERSELECTED? 8 redefinequote 272 FORTUNE SAY: YOU PLAY HUGE ROLE IN FUTURE.
                else ifvare CHARACTERSELECTED? 9 redefinequote 272 FORTUNE SAY: YOU WILL BE HARBRINGER OF A NEW ERA.
                else ifvare CHARACTERSELECTED? 10 redefinequote 272 FORTUNE SAY: DON'T HIDE YOUR TRUE FEELINGS.
                else ifvare CHARACTERSELECTED? 11 redefinequote 272 FORTUNE SAY: EVIL FEARS TRUE HOPE.
                else ifvare CHARACTERSELECTED? 12 redefinequote 272 FORTUNE SAY: DON'T TAKE EVERY TRAGEDY TO HEART.
                else ifvare CHARACTERSELECTED? 13 redefinequote 272 FORTUNE SAY: DON'T LET YOUR FRIENDS WORRY ABOUT YOU.
                else ifvare CHARACTERSELECTED? 14 redefinequote 272 FORTUNE SAY: THE PAST WILL RETURN WITH VIOLENT SHOVE.
                else ifvare CHARACTERSELECTED? 15 redefinequote 272 FORTUNE SAY: DESTINY ALWAYS RUN COURSE.
                else redefinequote 272 FORTUNE SAY: CONSPIRACY RULES YOUR FUTURE.
	         }
	         else ifvare FORTUNECOOKIEQUOTE 18 redefinequote 272 FORTUNE SAY: DON'T YOU KNOW YOU THE SCUM OF SOCIETY!?
	         else ifvare FORTUNECOOKIEQUOTE 19 redefinequote 272 FORTUNE SAY: YOU SHOULD KILL ALL BUSINESS ASSOCIATES.
	         else ifvare FORTUNECOOKIEQUOTE 20 redefinequote 272 FORTUNE SAY: 26-31-43-82-16-29
	         else ifvare FORTUNECOOKIEQUOTE 21 redefinequote 272 FORTUNE SAY: YOU MUST FIND THE COMPUTER ROOM!
	         else ifvare FORTUNECOOKIEQUOTE 22 redefinequote 272 FORTUNE SAY: SPOILER: YOU DIE!
	         else ifvare FORTUNECOOKIEQUOTE 23 redefinequote 272 FORTUNE SAY: WHA-CHOW! IT'S LIKE A KICK IN THE NUTS!
	         else
	         ifvare FORTUNECOOKIEQUOTE 24
	         {
                ifvare CHARACTERSELECTED? 3 redefinequote 272 FORTUNE SAY: PROTIP: BUBSY'S DURABILITY IS WEAKER WHEN IN OR UNDER THE WATER!
                else ifvare CHARACTERSELECTED? 4 redefinequote 272 FORTUNE SAY: PROTIP: AMI IS MORE POWERFUL WHEN IN OR UNDER THE WATER!
                else redefinequote 272 FORTUNE SAY: PROTIP: WATER IS WET!
	         }
	         else ifvare FORTUNECOOKIEQUOTE 25 redefinequote 272 FORTUNE SAY: DO A BARREL ROLL!
	         else ifvare FORTUNECOOKIEQUOTE 26 redefinequote 272 FORTUNE SAY: ALL LIFE BEGINS WITH NU, AND ENDS WITH NU.
	         else ifvare FORTUNECOOKIEQUOTE 27 redefinequote 272 FORTUNE SAY: WE LOOOOVEE THE MOOOON!!
	         else
	         ifvare FORTUNECOOKIEQUOTE 28
	         {
                ifvare GENDER? 0 redefinequote 272 FORTUNE SAY: CHEER UP EMO DUDE.
                ifvare GENDER? 1 redefinequote 272 FORTUNE SAY: CHEER UP EMO CHICK.
	         }
	         else ifvare FORTUNECOOKIEQUOTE 29 redefinequote 272 FORTUNE SAY: REVENGE ALWAYS COMES FULL CIRCLE.
	         else 
               ifvare FORTUNECOOKIEQUOTE 30
               {
                redefinequote 272 FORTUNE SAY: THERE IS MORE TO YOUR DESTINY THAN YOU THINK...
               }
	         else ifvare FORTUNECOOKIEQUOTE 31 redefinequote 272 FORTUNE SAY: LET'S GET DANGEROUS!
	         else ifvare FORTUNECOOKIEQUOTE 32 redefinequote 272 FORTUNE SAY: TODAY IS A VERY DANGEROUS DAY.
	         else ifvare FORTUNECOOKIEQUOTE 33 redefinequote 272 FORTUNE SAY: THERE'S A BOMB IN THE LASAGNA!
	         else ifvare FORTUNECOOKIEQUOTE 34 redefinequote 272 FORTUNE SAY: YOU PLAY WITH FIRE, YOU GET BURNED!
	         else ifvare FORTUNECOOKIEQUOTE 35 redefinequote 272 FORTUNE SAY: THE WIND OF DEATH BEINGS TO HOWL INTENSELY...
	         else ifvare FORTUNECOOKIEQUOTE 36 redefinequote 272 FORTUNE SAY: 8-16-23-42-4-15
	         else ifvare FORTUNECOOKIEQUOTE 37 redefinequote 272 FORTUNE SAY: THIS GAME STINKS!
	         else ifvare FORTUNECOOKIEQUOTE 38 redefinequote 272 FORTUNE SAY: A CHEESE PIZZA AND A LARGE DRINK IS $10.77
	         else 
               ifvare FORTUNECOOKIEQUOTE 39
               {
                ifvare CHARACTERSELECTED? 10 redefinequote 272 FORTUNE SAY: PROTIP: NETHRA ABSORBS ELECTRIC-DAMAGE IN HER ALIEN FORM!
                else redefinequote 272 FORTUNE SAY: PROTIP: ELECTRIC IS SHOCKING!
               }
	         else ifvare FORTUNECOOKIEQUOTE 40 redefinequote 272 FORTUNE SAY: MAN WHO FART IN CHURCH SIT IN OWN PEW.
	         else ifvare FORTUNECOOKIEQUOTE 41 redefinequote 272 FORTUNE SAY: MAN WHO BUY DROWNED CAT PAY FOR WET PUSSY.
	         else
	         ifvare FORTUNECOOKIEQUOTE 42
	         {
                ifvare GENDER? 0 redefinequote 272 FORTUNE SAY: DON'T YOU WANNA BE "THE GUY"?!
                ifvare GENDER? 1 redefinequote 272 FORTUNE SAY: DON'T YOU WANNA BE "THE BABE"?!
	         }
	         else ifvare FORTUNECOOKIEQUOTE 43 redefinequote 272 FORTUNE SAY: GIANT CHERRIES BAD FOR YOU.
	         else ifvare FORTUNECOOKIEQUOTE 44 redefinequote 272 FORTUNE SAY: IF YOU CAN'T SLAM WITH BEST, THEN JAM WITH REST!
	         else ifvare FORTUNECOOKIEQUOTE 45 redefinequote 272 FORTUNE SAY: A MOOSE ONCE BIT SISTER.
	         else
	         ifvare FORTUNECOOKIEQUOTE 46
	         {
                ifvare CHARACTERSELECTED? 1 redefinequote 272 FORTUNE SAY: FIGHT, DUKE NUKEM, FOR EVERLASTING PEACE!
                ifvare CHARACTERSELECTED? 2 redefinequote 272 FORTUNE SAY: FIGHT, JACK WALKER, FOR EVERLASTING PEACE!
                ifvare CHARACTERSELECTED? 3 redefinequote 272 FORTUNE SAY: FIGHT, BUBSY BOBCAT, FOR EVERLASTING PEACE!
                ifvare CHARACTERSELECTED? 4 redefinequote 272 FORTUNE SAY: FIGHT, AMI MIZUNO, FOR EVERLASTING PEACE!
                ifvare CHARACTERSELECTED? 5 redefinequote 272 FORTUNE SAY: FIGHT, LO WANG, FOR EVERLASTING PEACE!
                ifvare CHARACTERSELECTED? 6 redefinequote 272 FORTUNE SAY: FIGHT, ESSENCE MARGALAN, FOR EVERLASTING PEACE!
                ifvare CHARACTERSELECTED? 7 redefinequote 272 FORTUNE SAY: FIGHT, TED MALDORAS, FOR EVERLASTING PEACE!
                ifvare CHARACTERSELECTED? 8 redefinequote 272 FORTUNE SAY: FIGHT, LISA BATES, FOR EVERLASTING PEACE!
                ifvare CHARACTERSELECTED? 9 redefinequote 272 FORTUNE SAY: FIGHT, CYBANIS MORGANDOS, FOR EVERLASTING PEACE!
                ifvare CHARACTERSELECTED? 10
                {
                 ifvare NETHRAFORM? 0 redefinequote 272 FORTUNE SAY: FIGHT, NETHRA MABOROSHI, FOR EVERLASTING PEACE!
                 ifvare NETHRAFORM? 1 redefinequote 272 FORTUNE SAY: FIGHT, CHRSTINA MITCHELL, FOR EVERLASTING PEACE!
                }
                ifvare CHARACTERSELECTED? 11 redefinequote 272 FORTUNE SAY: FIGHT, PAULA POLESTAR, FOR EVERLASTING PEACE!
                ifvare CHARACTERSELECTED? 12 redefinequote 272 FORTUNE SAY: FIGHT, LORI STEPHENS, FOR EVERLASTING PEACE!
                ifvare CHARACTERSELECTED? 13 redefinequote 272 FORTUNE SAY: FIGHT, MINAKO AINO, FOR EVERLASTING PEACE!
                ifvare CHARACTERSELECTED? 14
                {
                 ifvare debugtoggle 0
                 {
                  ifvare PUBLICBETA? 1
                  {
                   redefinequote 272 FORTUNE SAY: FIGHT, ??????? ?????????, FOR EVERLASTING PEACE!
                  }
                  else
                  {
                   redefinequote 272 FORTUNE SAY: FIGHT, NAFERIA MABOROSHI, FOR EVERLASTING PEACE!
                  }
                 }
                 else
                 {
                  ifvare PUBLICBETA? 1
                  {
                   redefinequote 272 FORTUNE SAY: FIGHT, HINOTORI GENKAI, FOR EVERLASTING PEACE!
                  }
                  else
                  {
                   redefinequote 272 FORTUNE SAY: FIGHT, NAFERIA MABOROSHI, FOR EVERLASTING PEACE!
                  }
                 }
                }
                ifvare CHARACTERSELECTED? 15 redefinequote 272 FORTUNE SAY: FIGHT, MAKEN SHINKARA, FOR EVERLASTING PEACE!
	         }
	         else ifvare FORTUNECOOKIEQUOTE 47 redefinequote 272 FORTUNE SAY: IT'S A TRAP!!
	         else ifvare FORTUNECOOKIEQUOTE 48 redefinequote 272 FORTUNE SAY: IT'S TIME TO K-K-KILL!!!
	         else ifvare FORTUNECOOKIEQUOTE 49 redefinequote 272 FORTUNE SAY: WANNA GO DO SOMETHING STUPID?
	         else ifvare FORTUNECOOKIEQUOTE 50 redefinequote 272 FORTUNE SAY: I CAN HAS CHEEZBURGER?!
	         else ifvare FORTUNECOOKIEQUOTE 51 redefinequote 272 FORTUNE SAY: LVL 30 WIZRDCAT CASTS SUM SPELLZ!!
	         else ifvare FORTUNECOOKIEQUOTE 52 redefinequote 272 FORTUNE SAY: IM N UR COOKI, TELLIN U UR FUTURE!
	         else ifvare FORTUNECOOKIEQUOTE 53 redefinequote 272 FORTUNE SAY: DO NOT PUT TOO MUCH FAITH IN YOUR 'SUPERIORS'...
	         else ifvare FORTUNECOOKIEQUOTE 54 redefinequote 272 FORTUNE SAY: DAMN YOU DOG!!! YOU RUINED MY ANGLE!!!
	         else ifvare FORTUNECOOKIEQUOTE 55 redefinequote 272 FORTUNE SAY: I HAS A HOTDOG?
	         else ifvare FORTUNECOOKIEQUOTE 56 redefinequote 272 FORTUNE SAY: BEWARE THE BAD WOLF...
	         else ifvare FORTUNECOOKIEQUOTE 57 redefinequote 272 FORTUNE SAY: WHAT IS A MAN?! A MISERABLE PILE OF SECRETS?!
	         else ifvare FORTUNECOOKIEQUOTE 58 redefinequote 272 FORTUNE SAY: TURN LEFT!
	         else ifvare FORTUNECOOKIEQUOTE 59 redefinequote 272 FORTUNE SAY: YOU ARE NOT ALONE...
	         else ifvare FORTUNECOOKIEQUOTE 60 redefinequote 272 FORTUNE SAY: THE CAKE IS NOT A LIE...
	         else ifvare FORTUNECOOKIEQUOTE 61 redefinequote 272 FORTUNE SAY: FAIL AT LIFE YOU WILL, NYA!
	         else ifvare FORTUNECOOKIEQUOTE 62 redefinequote 272 FORTUNE SAY: SMOOOOOOOOOORG!!!!
	         else ifvare FORTUNECOOKIEQUOTE 63
               {
                ifvare CHARACTERSELECTED? 1 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE DUKE, RIGHT? WHAT A GREAT NAME!
                ifvare CHARACTERSELECTED? 2 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE JACK, RIGHT? WHAT A GREAT NAME!
                ifvare CHARACTERSELECTED? 3 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE BUBSY, RIGHT? WHAT A GREAT NAME!
                ifvare CHARACTERSELECTED? 4 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE AMI, RIGHT? WHAT A GREAT NAME!
                ifvare CHARACTERSELECTED? 5 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE HIGA, RIGHT? WHAT A GREAT NAME!
                ifvare CHARACTERSELECTED? 6 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE ESSENCE, RIGHT? WHAT A GREAT NAME!
                ifvare CHARACTERSELECTED? 7 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE TED, RIGHT? WHAT A GREAT NAME!
                ifvare CHARACTERSELECTED? 8 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE LISA, RIGHT? WHAT A GREAT NAME!
                ifvare CHARACTERSELECTED? 9 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE CYBANIS, RIGHT? WHAT A GREAT NAME!
                ifvare CHARACTERSELECTED? 10
                {
                 ifvare NETHRAFORM? 0 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE NETHRA, RIGHT? WHAT A GREAT NAME!
                 ifvare NETHRAFORM? 1 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE CHRISTINA, RIGHT? WHAT A GREAT NAME!
                }
                ifvare CHARACTERSELECTED? 11 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE PAULA, RIGHT? WHAT A GREAT NAME!
                ifvare CHARACTERSELECTED? 12 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE LORI, RIGHT? WHAT A GREAT NAME!
                ifvare CHARACTERSELECTED? 13 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE MINAKO, RIGHT? WHAT A GREAT NAME!
                ifvare CHARACTERSELECTED? 14
                {
                 ifvare debugtoggle 0
                 {
                  ifvare PUBLICBETA? 1 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE ???????, RIGHT? WHAT A GREAT NAME!
                  else redefinequote 272 FORTUNE SAY: YEAH, YOU'RE NAFERIA, RIGHT? WHAT A GREAT NAME!
                 }
                 else
                 {
                  ifvare PUBLICBETA? 1 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE HINOTORI, RIGHT? WHAT A GREAT NAME!
                  else redefinequote 272 FORTUNE SAY: YEAH, YOU'RE NAFERIA, RIGHT? WHAT A GREAT NAME!
                 }
                }
                ifvare CHARACTERSELECTED? 15 redefinequote 272 FORTUNE SAY: YEAH, YOU'RE MAKEN, RIGHT? WHAT A GREAT NAME!
               }
	         else ifvare FORTUNECOOKIEQUOTE 64 redefinequote 272 FORTUNE SAY: GUESS WHO IT IS?! GHOST NAPPA!!!
	         else ifvare FORTUNECOOKIEQUOTE 65 redefinequote 272 FORTUNE SAY: WHO YOU GONNA CALL?! GHOST BUSTERS!!!
	         else ifvare FORTUNECOOKIEQUOTE 66 redefinequote 272 FORTUNE SAY: DID I JUST GET SHOT?!
	        }
ends

state pickupcharacter_fortune
             state checkexplodeflag
             state gotmedsyoureallyneeded
             ifvare CHARACTERSELECTED? 5 // If Lo Wang Grabs the Fortune Cookie
             {
              ifvarvarg MAXHITPOINTSATOMIC STATLIMITATOMIC setvarvar MAXHITPOINTSATOMIC STATLIMITATOMIC
              setvarvar CURRENTHITPOINTS MAXHITPOINTSATOMIC
              ifvarand ACTORFLAGS 2 nullop
              else
              {
               redefinequote 335 ^20FORTUNE COOKIE: HP BECOMES 200%!
               setvarvar fta fta_normal setvar ftq 335
              }
             }
             else // Anyone else Grabs the Fortune Cookie
             {
		 setvarvar tempb MAXHITPOINTSATOMIC
		 setvarvar TEMPHEALTH MAXHITPOINTS
              setvar ACTORPICKUPAMOUNT 50
              state checkpickupamountflags
 	        mulvarvar TEMPHEALTH ACTORPICKUPAMOUNT
	        divvar TEMPHEALTH 100
	        addvarvar CURRENTHITPOINTS TEMPHEALTH      // Adds the actual heal value to the current player health
	        ifvarvarg CURRENTHITPOINTS STATLIMITATOMIC setvarvar CURRENTHITPOINTS STATLIMITATOMIC // Prevents the player from going too far over their health value
	        ifvarvarg CURRENTHITPOINTS MAXHITPOINTSATOMIC setvarvar CURRENTHITPOINTS MAXHITPOINTSATOMIC
	        qsprintf 273 274 TEMPHEALTH 
              ifvarand ACTORFLAGS 2 nullop
              else
              {
 	         setvarvar fta fta_normal setvar ftq 273
              }
             }
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              setvar PLAYERHPDAMAGED? -1
              state fortunecookie_fortunedisplays
             }
	       ifspawnedby FORTUNECOOKIE
	         state getcode
	       else
	         state quikget
ends

state pickupvehicle_fortune
             state checkexplodeflag
	       setvarvar tempb TEMPVAR5

             getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR3
             setvarvar TEMPHEALTH TEMPVAR3
             setvar ACTORPICKUPAMOUNT 50
             state checkpickupamountflags
 	       mulvarvar TEMPHEALTH ACTORPICKUPAMOUNT
	       divvar TEMPHEALTH 100
	       addvarvar TEMPVAR4 TEMPHEALTH      // Adds the actual heal value to the current player health
	       ifvarvarg TEMPVAR4 STATLIMITATOMIC setvarvar TEMPVAR4 STATLIMITATOMIC // Prevents the player from going too far over their health value
	       ifvarvarg TEMPVAR4 TEMPVAR5 setvarvar TEMPVAR4 TEMPVAR5
             setactorvar[tempvehicleid].ENEMYHP TEMPVAR4
	       qsprintf 273 274 TEMPHEALTH 
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              redefinequote 836 ^15YOUR VEHICLE GRABBED A FORTUNE COOKIE!
 	        setvarvar fta fta_normal setvar ftq 836
             }
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              setvar VEHICLEHPDAMAGED? -1
              state fortunecookie_fortunedisplays
             }
	       ifspawnedby FORTUNECOOKIE
	         state getcode
	       else
	         state quikget
ends

eventloadactor FORTUNECOOKIE state setpickupflags enda
useractor notenemy FORTUNECOOKIE 0

 ifvare FLAGSSET? 0
 {
  ifrnd 1 { spawn CONTINUEITEM killit }
  else { setvar FLAGSSET? 1 }
 }
 state itemfullbright
 sizeat 24 24
 setvar ACTORSHEIGHT 22 setvar ACTORSWIDTH 34
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifpdistl RETRIEVEDISTANCE
      {
       ifcount 6
       {
        ifcanseetarget
        {
         getactorvar[PLAYERID].VEHICLEID tempvehicleid
         ifvare tempvehicleid -1
         {
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC state pickupcharacter_fortune
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC state pickupcharacter_fortune
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           mulvar TEMPVAR5 2
           ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_fortune
          }
          ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
          {
           ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC state pickupcharacter_fortune
           else
           {
            getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            mulvar TEMPVAR5 2
            ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_fortune
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
           mulvar TEMPVAR5 2
           ifvarvarl TEMPVAR4 TEMPVAR5 state pickupvehicle_fortune
           else
           {
            ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC state pickupcharacter_fortune
           }
          }
         }
	  }
       }
      }
     }
    }
   }
 }
// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
	   {
          state checkenemypickuphealth
          getactorvar[ITEMSEEK].ENEMYMAXHP ITEMENEMYMAXHP
          setvarvar ITEMENEMYMAXHPATOMIC ITEMENEMYMAXHP
          mulvar ITEMENEMYMAXHPATOMIC 2

          ifvarg ITEMSEEKB 0
           ifvarvarl ITEMSEEKB ITEMENEMYMAXHPATOMIC
           {
            state checkexplodeflag
            setvarvar ITEMSEEKC ITEMENEMYMAXHP
            setvar ACTORPICKUPAMOUNT 50
            state checkpickupamountflags
 	      mulvarvar ITEMSEEKC ACTORPICKUPAMOUNT
            mulvar ITEMSEEKC 50
            divvar ITEMSEEKC 100
            addvarvar ITEMSEEKB ITEMSEEKC
            ifvarvarg ITEMSEEKB ITEMENEMYMAXHPATOMIC setvarvar ITEMSEEKB ITEMENEMYMAXHPATOMIC
            setactorvar[ITEMSEEK].ENEMYHP ITEMSEEKB
            state resetitemtarget
            state getitemseekerspecies
            ifvarand ACTORFLAGS 4 nullop
            else
            {
             setactorvar[ITEMSEEK].ENEMYHPDAMAGED? -1
             globalsound FORTUNECOOKIE1
             ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT A FORTUNE COOKIE!
             ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT A FORTUNE COOKIE!
            }
            state enemygrabitemflash
           }
	   }
  }
enda

eventloadactor ONELIFETSHIRT state setpickupflags enda
useractor notenemy ONELIFETSHIRT 0

 ifvare BUBSY? 1
 {
  cstat 0
  setvar ACTORSHEIGHT 32 setvar ACTORSWIDTH 32
  state checkitemflags
  state checkitemflags2 // Checks Item Multiplications for Display Icon
 }
 else
 {
  cstat 32768
 }
 sizeat 60 60
 ifvare mainmenu 0 state fallflags2
 state itemfullbright
 state itemdroptimer
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
     else
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
       ifcanseetarget
       {
        ifcount 6
         ifpdistl RETRIEVEDISTANCE
          {
             ifvare BUBSY? 1 // Bubsy must be in your group in order to grab this item
 	       {
	         ifvarl BUBSYLIVES 8
 	         {
                state checkexplodeflag
                setvar ACTORPICKUPAMOUNT 1
                state checkpickupamountflags
                addvarvar BUBSYLIVES ACTORPICKUPAMOUNT

                ifvarn CHARACTERSELECTED? 3
                {
                 setvar CHARACTERARRAY 3
                 getactorvar[CHARACTERARRAY].CHARACTERHP temp
                 getactorvar[CHARACTERARRAY].CHARACTERMAXHP tempb
                 ifvare temp 0
                 {
                  setactorvar[CHARACTERARRAY].CHARACTERHP tempb
                  subvar BUBSYLIVES 1
                 }
                }
                // If Bubsy is dead upon picking up a T-Shirt, revive him to full health, but remove the newly grabbed life
                ifvarg ACTORPICKUPAMOUNT 1
                {
                 redefinequote 335 ^20GOT 1 EXTRA LIVES FOR BUBSY!
                 redefinequote 336 ^20GOT %ld EXTRA LIVES FOR BUBSY!
                 qsprintf 335 336 ACTORPICKUPAMOUNT
                }
                else
                {
                 redefinequote 335 ^20GOT 1 EXTRA LIFE FOR BUBSY!
                }
                ifvarand ACTORFLAGS 2 nullop
                else
                {
         	    palfrom 16 0 32
        	    setvarvar fta fta_normal setvar ftq 335
        	    globalsound FOUND_BIGITEM
                }
                setvar WORLDTILESHUFFLES 0
                state getworldtile
	          state activationflag killit
	         }
               else
 	         {
                ifvarand ACTORFLAGS 2 nullop
                else
                {
         	    redefinequote 130 ^17BUBSY HAS ENOUGH EXTRA LIVES NOW!
        	    setvar fta 6 setvar ftq 130               
                }
               }
              }
          }
       }
     }
   }
 }

}
enda

eventloadactor TWOLIFETSHIRT state setpickupflags enda
useractor notenemy TWOLIFETSHIRT 0

 ifvare BUBSY? 1
 {
  cstat 0
  setvar ACTORSHEIGHT 32 setvar ACTORSWIDTH 32
  state checkitemflags
  state checkitemflags2 // Checks Item Multiplications for Display Icon
 }
 else
 {
  cstat 32768
 }
 sizeat 60 60
 ifvare mainmenu 0 state fallflags2
 state itemfullbright
 state itemdroptimer
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
     else
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
       ifcanseetarget
       {
        ifcount 6
         ifpdistl RETRIEVEDISTANCE
          {
            ifvare BUBSY? 1 // Bubsy must be in your group in order to grab this item
 	      {
 	       ifvarand ACTORFLAGS 384
             {
	        ifvarl BUBSYLIVES 16
 	        {
               state checkexplodeflag
               setvar ACTORPICKUPAMOUNT 2
               state checkpickupamountflags
               addvarvar BUBSYLIVES ACTORPICKUPAMOUNT

               ifvarn CHARACTERSELECTED? 3
               {
                setvar CHARACTERARRAY 3
                getactorvar[CHARACTERARRAY].CHARACTERHP temp
                getactorvar[CHARACTERARRAY].CHARACTERMAXHP tempb
                ifvare temp 0
                {
                 setactorvar[CHARACTERARRAY].CHARACTERHP tempb
                 subvar BUBSYLIVES 1
                }
               }
               redefinequote 335 ^20GOT 2 EXTRA LIVES FOR BUBSY!
               redefinequote 336 ^20GOT %ld EXTRA LIVES FOR BUBSY!
               qsprintf 335 336 ACTORPICKUPAMOUNT
               ifvarand ACTORFLAGS 2 nullop
               else
               {
          	   palfrom 16 0 32
        	   globalsound FOUND_BIGITEM
        	   setvarvar fta fta_normal setvar ftq 335               
               }
               ifvarg BUBSYLIVES 16 setvar BUBSYLIVES 16
               setvar WORLDTILESHUFFLES 0
               state getworldtile
	         state activationflag killit
	        }
              else
 	        {
               ifvarand ACTORFLAGS 2 nullop
               else
               {
          	   redefinequote 130 ^17BUBSY HAS ENOUGH EXTRA LIVES NOW!
        	   setvar fta 6 setvar ftq 130               
               }
              }
             }
             else
             {
	        ifvarl BUBSYLIVES 8
 	        {
               state checkexplodeflag
               setvar ACTORPICKUPAMOUNT 2
               state checkpickupamountflags
               addvarvar BUBSYLIVES ACTORPICKUPAMOUNT

               ifvarn CHARACTERSELECTED? 3
               {
                setvar CHARACTERARRAY 3
                getactorvar[CHARACTERARRAY].CHARACTERHP temp
                getactorvar[CHARACTERARRAY].CHARACTERMAXHP tempb
                ifvare temp 0
                {
                 setactorvar[CHARACTERARRAY].CHARACTERHP tempb
                 subvar BUBSYLIVES 1
                }
               }
               ifvarand ACTORFLAGS 2 nullop
               else
               {
                redefinequote 335 ^20GOT 2 EXTRA LIVES FOR BUBSY!
                redefinequote 336 ^20GOT %ld EXTRA LIVES FOR BUBSY!
                qsprintf 335 336 ACTORPICKUPAMOUNT
          	   palfrom 16 0 32
        	   globalsound FOUND_BIGITEM
        	   setvarvar fta fta_normal setvar ftq 335               
               }
               ifvarg BUBSYLIVES 8 setvar BUBSYLIVES 8
               setvar WORLDTILESHUFFLES 0
               state getworldtile
	         state activationflag killit
	        }
              else
 	        {
               ifvarand ACTORFLAGS 2 nullop
               else
               {
          	   redefinequote 130 ^17BUBSY HAS ENOUGH EXTRA LIVES NOW!
        	   setvar fta 6 setvar ftq 130               
               }
              }
             }
            }
          }
       }
     }
   }
 }

}
enda

eventloadactor CONTINUEITEM state setpickupflags enda
useractor notenemy CONTINUEITEM 0

 sizeat 60 60
 state itemfullbright
 ifvare mainmenu 0 state fallflags2
 setvar ACTORSHEIGHT 29 setvar ACTORSWIDTH 28
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 state itemdroptimer
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
       ifcanseetarget
       {
        ifcount 6
          ifpdistl RETRIEVEDISTANCE
          {
	     ifvarand ACTORFLAGS 256
           {
	      ifvarl CONTINUES? 8
 	      {
             state checkexplodeflag
             setvar ACTORPICKUPAMOUNT 1
             state checkpickupamountflags
             addvarvar CONTINUES? ACTORPICKUPAMOUNT
             ifvarg ACTORPICKUPAMOUNT 1
             {
          	 ifvare GENDER? 0 redefinequote 335 ^20FOUND 1 CONTINUES! LUCKY BASTARD...
        	 ifvare GENDER? 1 redefinequote 335 ^20FOUND 1 CONTINUES! LUCKY BITCH...
          	 ifvare GENDER? 0 redefinequote 336 ^20FOUND %ld CONTINUES! LUCKY BASTARD...
        	 ifvare GENDER? 1 redefinequote 336 ^20FOUND %ld CONTINUES! LUCKY BITCH...
              qsprintf 335 336 ACTORPICKUPAMOUNT
             }
             else
             {
           	 ifvare GENDER? 0 redefinequote 335 ^20FOUND A CONTINUE! LUCKY BASTARD...
          	 ifvare GENDER? 1 redefinequote 335 ^20FOUND A CONTINUE! LUCKY BITCH...
             }
             ifvarand ACTORFLAGS 2 nullop
             else
             {
        	 setvarvar fta fta_normal setvar ftq 335
         	 palfrom 16 0 32
              globalsound DUKE_GET
        	 globalsound FORTUNECOOKIE1
        	 globalsound FOUND_BIGITEM
             }
             ifvarg CONTINUES? 8 setvar CONTINUES? 8
             setvar WORLDTILESHUFFLES 0
             state getworldtile
	       state activationflag killit
	      }
            else
 	      {
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              redefinequote 335 ^17YOU ALREADY HAVE 1 CONTINUES!
              redefinequote 336 ^17YOU ALREADY HAVE %ld CONTINUES!
              qsprintf 335 336 CONTINUES?
        	 setvarvar fta fta_normal setvar ftq 335
             }
            }
           }
           else
           {
	      ifvarl CONTINUES? 5
 	      {
             state checkexplodeflag
             setvar ACTORPICKUPAMOUNT 1
             state checkpickupamountflags
             addvarvar CONTINUES? ACTORPICKUPAMOUNT
             ifvarg ACTORPICKUPAMOUNT 1
             {
          	 ifvare GENDER? 0 redefinequote 335 ^20FOUND 1 CONTINUES! LUCKY BASTARD...
        	 ifvare GENDER? 1 redefinequote 335 ^20FOUND 1 CONTINUES! LUCKY BITCH...
          	 ifvare GENDER? 0 redefinequote 336 ^20FOUND %ld CONTINUES! LUCKY BASTARD...
        	 ifvare GENDER? 1 redefinequote 336 ^20FOUND %ld CONTINUES! LUCKY BITCH...
              qsprintf 335 336 ACTORPICKUPAMOUNT
             }
             else
             {
           	 ifvare GENDER? 0 redefinequote 335 ^20FOUND A CONTINUE! LUCKY BASTARD...
          	 ifvare GENDER? 1 redefinequote 335 ^20FOUND A CONTINUE! LUCKY BITCH...
             }
             ifvarand ACTORFLAGS 2 nullop
             else
             {
        	 setvarvar fta fta_normal setvar ftq 335
         	 palfrom 16 0 32
              globalsound DUKE_GET
        	 globalsound FORTUNECOOKIE1
        	 globalsound FOUND_BIGITEM
             }
             ifvarg CONTINUES? 5 setvar CONTINUES? 5
             setvar WORLDTILESHUFFLES 0
             state getworldtile
	       state activationflag killit
	      }
            else
 	      {
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              redefinequote 335 ^17YOU ALREADY HAVE 1 CONTINUES!
              redefinequote 336 ^17YOU ALREADY HAVE %ld CONTINUES!
              qsprintf 335 336 CONTINUES?
        	 setvar fta 6 setvar ftq 335
             }
            }
           }
          }
       }
    }
   }
  }

}
enda

eventloadactor RESURRECTIONCHALICE state setpickupflags enda
useractor notenemy RESURRECTIONCHALICE 0 

 sizeat 64 64 // 32 32 seems to be the correct size for a custom item relative to other items
 state itemfullbright
 setvar ACTORSHEIGHT 30 setvar ACTORSWIDTH 24
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags

 ifvarg ITEMDROPPEDTIME 0
 {
  ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
 }
 else
 {
  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifmove RESPAWN_ACTOR_FLAG state respawnit 
   else
   {
    ifvare mainmenu 0
    {
     ifp pshrunk nullop
     else
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          state checkexplodeflag
          setvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags
          addvarvar RESURRECTIONCHALICES ACTORPICKUPAMOUNT
          ifvarg ACTORPICKUPAMOUNT 1
          {
           redefinequote 335 ^6GOT 1 RESURRECTION CHALICES!! ROCK ON! :D
           redefinequote 336 ^6GOT %ld RESURRECTION CHALICES!! ROCK ON! :D
           qsprintf 335 336 ACTORPICKUPAMOUNT
          }
          else
          {
           redefinequote 335 ^6GOT A RESURRECTION CHALICE!! ROCK ON! :D
          }
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvarvar fta fta_normal setvar ftq 335
           globalsound FOUND_BIGITEM
           palfrom 32 0 32
          }
          setvar WORLDTILESHUFFLES 0
          state getworldtile
          state activationflag killit
         }
        }
       }
      }
     }
    }
   }
  }
 }
enda

eventloadactor EYEDROP state setpickupflags enda
useractor notenemy EYEDROP 0 

 sizeat 24 24 // 32 32 seems to be the correct size for a custom item relative to other items
 state itemfullbright
 setvar ACTORSHEIGHT 37 setvar ACTORSWIDTH 37
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags

 ifvarg ITEMDROPPEDTIME 0
 {
  ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
 }
 else
 {
  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifmove RESPAWN_ACTOR_FLAG state respawnit 
   else
   {
    ifvare mainmenu 0
    {
     ifp pshrunk nullop
     else
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          state checkexplodeflag
          setvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags
          addvarvar EYEDROPS ACTORPICKUPAMOUNT
          ifvarg ACTORPICKUPAMOUNT 1
          {
           redefinequote 335 ^14FOUND 1 EYEDROPS!
           redefinequote 336 ^14FOUND %ld EYEDROPS!
           qsprintf 335 336 ACTORPICKUPAMOUNT
          }
          else
          {
           redefinequote 335 ^14FOUND AN EYEDROP!
          }
          state grabinventory
         }
        }
       }
      }
     }
    }
   }
  }
 }
enda

eventloadactor ANTIDOTE state setpickupflags enda
useractor notenemy ANTIDOTE 0 

 sizeat 24 24 // 32 32 seems to be the correct size for a custom item relative to other items
 state itemfullbright
 setvar ACTORSHEIGHT 32 setvar ACTORSWIDTH 22
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags

 ifvarg ITEMDROPPEDTIME 0
 {
  ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
 }
 else
 {
  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifmove RESPAWN_ACTOR_FLAG state respawnit 
   else
   {
    ifvare mainmenu 0
    {
     ifp pshrunk nullop
     else
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          state checkexplodeflag 
  
          setvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags
          addvarvar ANTIDOTES ACTORPICKUPAMOUNT
          ifvarg ACTORPICKUPAMOUNT 1
          {
           redefinequote 335 ^14FOUND 1 ANTIDOTES!
           redefinequote 336 ^14FOUND %ld ANTIDOTES!
           qsprintf 335 336 ACTORPICKUPAMOUNT
          }
          else
          {
           redefinequote 335 ^14FOUND AN ANTIDOTE!
          }
  
          state grabinventory
         }
        }
       }
      }
     }
    }
   }
  }
 }
enda

eventloadactor FOGHORN state setpickupflags enda
useractor notenemy FOGHORN 0 

 sizeat 16 16 // 32 32 seems to be the correct size for a custom item relative to other items
 state itemfullbright
 setvar ACTORSHEIGHT 58 setvar ACTORSWIDTH 61
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags

 ifvarg ITEMDROPPEDTIME 0
 {
  ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
 }
 else
 {
  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifmove RESPAWN_ACTOR_FLAG state respawnit 
   else
   {
    ifvare mainmenu 0
    {
     ifp pshrunk nullop
     else
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          state checkexplodeflag
          setvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags
          addvarvar FOGHORNS ACTORPICKUPAMOUNT
          ifvarg ACTORPICKUPAMOUNT 1
          {
           redefinequote 335 ^14FOUND 1 FOGHORNS!
           redefinequote 336 ^14FOUND %ld FOGHORNS!
           qsprintf 335 336 ACTORPICKUPAMOUNT
          }
          else
          {
           redefinequote 335 ^14FOUND A FOGHORN!
          }
          state grabinventory
         }
        }
       }
      }
     }
    }
   }
  }
 }
enda

state getshieldcolors
 setvarvar TEMPVAR5 CURRENTBIOSHIELDPOWER
 ifvare CHARACTERSELECTED? 8 divvarvar TEMPVAR5 MAXHITPOINTS
 else
 {
  setvar CHARACTERARRAY 8
  getactorvar[CHARACTERARRAY].CHARACTERMAXHP TEMPVAR4
  divvarvar TEMPVAR5 TEMPVAR4
 }
 ifvarl TEMPVAR5 16 setactor[THISACTOR].pal 0
 else ifvarg TEMPVAR5 15 ifvarl TEMPVAR5 64 setactor[THISACTOR].pal 17
 else ifvarg TEMPVAR5 63 ifvarl TEMPVAR5 256 setactor[THISACTOR].pal 23
 else ifvarg TEMPVAR5 255 ifvarl TEMPVAR5 1024 setactor[THISACTOR].pal 21
 else ifvarg TEMPVAR5 1023 setactor[THISACTOR].pal 20
ends

eventloadactor ENERGYSHELL state setpickupflags enda
useractor notenemy ENERGYSHELL 0

 ifvare LISA? 1
 {
  cstat 0
  setvar ACTORSHEIGHT 115 setvar ACTORSWIDTH 111
  state checkitemflags
  state checkitemflags2 // Checks Item Multiplications for Display Icon
 }
 else
 {
  cstat 32768
 }

 state getshieldcolors
 sizeat 8 8 // 32 32 seems to be the correct size for a custom item relative to other items
 state itemfullbright
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
          {
           ifvare LISA? 1 // Lisa must be in your group in order to grab this item
           {
            state checkexplodeflag
            ifvare HAVEENERGYSHIELD? 0
            { 
             setvar HAVEENERGYSHIELD? 1
             redefinequote 335 ^14FOUND BIO-CELL ENERGY SHIELD FOR LISA!
            }
            ifvare CHARACTERSELECTED? 8 { ifvarn HAVEENERGYSHIELD? 0 globalsound LISA_GRABSHIELD }
            setvar ACTORPICKUPAMOUNT 16
            state checkpickupamountflags
            addvarvar ESHIELDDMGFACTOR ACTORPICKUPAMOUNT
            ifvarn CURRENTCELLS 0 setvarvar DAMAGEINCELL ESHIELDDMGFACTOR
            ifvarvare CURRENTCELLS MAXCELLS setvarvar DAMAGEINCELL ESHIELDDMGFACTOR         

            ifvarn HAVEENERGYSHIELD? 0 redefinequote 335 ^14BIO-CELL ENERGY SHIELD UPGRADED!
            ifvarand ACTORFLAGS 2 nullop
            else
            {
             setvarvar fta fta_normal setvar ftq 335
             globalsound YEAH
             globalsound YEAH
             palfrom 32 0 32
            }
            setvar WORLDTILESHUFFLES 0
            state getworldtile
            state activationflag killit
           }
          }
       }
   }
 }
enda

state checkcellpickups
            setvarvar tempe ACTORPICKUPAMOUNT
            divvar tempe 5

            setvar TEMP3 0
            setvar TEMP4 0
            setvar tempc 0
            setvar tempd 0
            whilevarvarn tempd tempe
            {
             ifvarvarl CURRENTCELLS MAXCELLS
             {
              addvar CURRENTCELLS 5
              addvar tempc 5
              ifvarvarg CURRENTCELLS MAXCELLS { setvarvar CURRENTCELLS MAXCELLS setvarvar DAMAGEINCELL ESHIELDDMGFACTOR }
             }
             else addvar TEMP4 1

             addvar tempd 1
            }

            setvarvar TEMP3 TEMP4
            whilevarn TEMP3 0
            {
             ifvarg TEMP3 15
             {
              espawn ENERGYCELL_LARGE state scatterdrops
              subvar TEMP3 16
             }
             else
             ifvarg TEMP3 5 ifvarl TEMP3 16
             {
              espawn ENERGYCELL_MEDIUM state scatterdrops
              subvar TEMP3 6
             }
             else
             ifvarl TEMP3 6
             {
              espawn ENERGYCELL_SMALL state scatterdrops
              subvar TEMP3 1
             }
             ifvarl TEMP3 0 setvar TEMP3 0
            }
ends

eventloadactor ENERGYCELL_SMALL state setpickupflags enda
useractor notenemy ENERGYCELL_SMALL 0 

 ifvare LISA? 1
 {
  cstat 0
  setvar ACTORSHEIGHT 198 setvar ACTORSWIDTH 104
  state checkitemflags
  state checkitemflags2 // Checks Item Multiplications for Display Icon
 }
 else cstat 32768

 sizeat 4 4
 state itemfullbright
 ifvare mainmenu 0 state fallflags

 ifvarg ITEMDROPPEDTIME 0
 {
  ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
 }
 else
 {
  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifmove RESPAWN_ACTOR_FLAG state respawnit
   else
   {
    ifvare mainmenu 0
    {
     ifp pshrunk nullop
     else
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          ifvarvarl CURRENTCELLS MAXCELLS
          {
           ifvare LISA? 1 // Lisa must be in your group in order to grab this item
   	     {
            state checkexplodeflag
            setvar ACTORPICKUPAMOUNT 5
            state checkpickupamountflags

            state checkcellpickups

//            addvarvar CURRENTCELLS ACTORPICKUPAMOUNT
//            ifvarvarg CURRENTCELLS MAXCELLS { setvarvar CURRENTCELLS MAXCELLS setvarvar DAMAGEINCELL ESHIELDDMGFACTOR }
            redefinequote 335 ^22FOUND 5 ENERGY CELLS!
            redefinequote 336 ^22FOUND %ld ENERGY CELLS!
            qsprintf 335 336 tempc
            ifrnd 16 { ifvare CHARACTERSELECTED? 8 globalsound LISA_GRABCELLS }
            state grabinventory
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
enda

eventloadactor ENERGYCELL_MEDIUM state setpickupflags enda
useractor notenemy ENERGYCELL_MEDIUM 0 

 ifvare LISA? 1
 {
  cstat 0
  setvar ACTORSHEIGHT 261 setvar ACTORSWIDTH 220
  state checkitemflags
  state checkitemflags2 // Checks Item Multiplications for Display Icon
 }
 else cstat 32768

 sizeat 4 4
 state itemfullbright
 ifvare mainmenu 0 state fallflags

 ifvarg ITEMDROPPEDTIME 0
 {
  ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
 }
 else
 {
  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifmove RESPAWN_ACTOR_FLAG state respawnit
   else
   {
    ifvare mainmenu 0
    {
     ifp pshrunk nullop
     else
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          ifvarvarl CURRENTCELLS MAXCELLS
          {
           ifvare LISA? 1 // Lisa must be in your group in order to grab this item
  	     {
            state checkexplodeflag
            setvar ACTORPICKUPAMOUNT 30
            state checkpickupamountflags

            state checkcellpickups


//            addvarvar CURRENTCELLS ACTORPICKUPAMOUNT
//            ifvarvarg CURRENTCELLS MAXCELLS { setvarvar CURRENTCELLS MAXCELLS setvarvar DAMAGEINCELL ESHIELDDMGFACTOR }
            redefinequote 335 ^22FOUND 30 ENERGY CELLS!
            redefinequote 336 ^22FOUND %ld ENERGY CELLS!
            qsprintf 335 336 tempc
            ifrnd 48 { ifvare CHARACTERSELECTED? 8 globalsound LISA_GRABCELLS }
            state grabinventory
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
enda

eventloadactor ENERGYCELL_LARGE state setpickupflags enda
useractor notenemy ENERGYCELL_LARGE 0 

 ifvare LISA? 1
 {
  cstat 0
  setvar ACTORSHEIGHT 291 setvar ACTORSWIDTH 435
  state checkitemflags
  state checkitemflags2 // Checks Item Multiplications for Display Icon
 }
 else cstat 32768

 sizeat 4 4
 state itemfullbright
 ifvare mainmenu 0 state fallflags
 ifvarg ITEMDROPPEDTIME 0
 {
  ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
 }
 else
 {
  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifmove RESPAWN_ACTOR_FLAG state respawnit
   else
   {
    ifvare mainmenu 0
    {
     ifp pshrunk nullop
     else
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          ifvarvarl CURRENTCELLS MAXCELLS
          {
           ifvare LISA? 1 // Lisa must be in your group in order to grab this item
   	     {
            state checkexplodeflag
            setvar ACTORPICKUPAMOUNT 80
            state checkpickupamountflags

            state checkcellpickups

//            addvarvar CURRENTCELLS ACTORPICKUPAMOUNT
//            ifvarvarg CURRENTCELLS MAXCELLS { setvarvar CURRENTCELLS MAXCELLS setvarvar DAMAGEINCELL ESHIELDDMGFACTOR }
            redefinequote 335 ^22FOUND 80 ENERGY CELLS!
            redefinequote 336 ^22FOUND %ld ENERGY CELLS!
            qsprintf 335 336 tempc
            ifrnd 80 { ifvare CHARACTERSELECTED? 8 globalsound LISA_GRABCELLS }
            state grabinventory
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
enda

eventloadactor MERCURYCOMPUTER state setpickupflags enda
useractor notenemy MERCURYCOMPUTER 0 

 ifvare AMI? 1
 {
  cstat 0
  setvar ACTORSHEIGHT 25 setvar ACTORSWIDTH 39
  state checkitemflags
  state checkitemflags2 // Checks Item Multiplications for Display Icon
 }
 else
 {
  cstat 32768
 }
 ifvare HAVEMERCURYCOMPUTER? 1 killit
 sizeat 44 44 // sizeat 64 64
 state itemfullbright
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
           ifvare AMI? 1
            ifvarn HAVEMERCURYCOMPUTER? 1
            {
             state checkexplodeflag
             setvar HAVEMERCURYCOMPUTER? 1
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              globalsound YEAH
              globalsound YEAH
              globalsound YEAH
              redefinequote 334 ^23YOU FOUND THE MERCURY SUPERCOMPUTER!!
              setvarvar fta fta_normal setvar ftq 334
              palfrom 32 0 32
             }
             setvar WORLDTILESHUFFLES 0
             state getworldtile
             state activationflag killit
            }
       }
   }
 }
enda

eventloadactor HACKERVISION state setpickupflags enda
useractor notenemy HACKERVISION 0 

 ifvare LISA? 1
 {
  cstat 0
  setvar ACTORSHEIGHT 20 setvar ACTORSWIDTH 14
  state checkitemflags
  state checkitemflags2 // Checks Item Multiplications for Display Icon
 }
 else
 {
  cstat 32768
 }
 ifvare HAVEHACKERVISION? 1 killit
 sizeat 64 64
 state itemfullbright
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
           ifvare LISA? 1
           {
            ifvarn HAVEHACKERVISION? 1
            {
             state checkexplodeflag
             setvar CHARACTERARRAY 8
             getactorvar[CHARACTERARRAY].CHARACTERGOGGLESTIME TEMPVAR
             ifvarg TEMPVAR 0
             {
              setvar HAVEHACKERVISION? 1
              ifvarand ACTORFLAGS 2 nullop
              else
              {
               redefinequote 334 ^23YOU FOUND THE HACKER-VISION NODE!!
               setvarvar fta fta_normal setvar ftq 334
               palfrom 32 0 32
               globalsound YEAH
               globalsound YEAH
               globalsound YEAH
              }
              setvar WORLDTILESHUFFLES 0
              state getworldtile
              state activationflag killit
             }
             else
             {
              ifvarand ACTORFLAGS 2 nullop
              else
              {
               redefinequote 334 ^10LISA NEEDS GOGGLES TO UPGRADE FIRST!
               setvar fta 6 setvar ftq 334
              }
             }
            }
           }
       }
   }
 }
enda

// Afa's Drop

eventloadactor AFAS_DROP state setpickupflags enda
useractor notenemy AFAS_DROP 0

 sizeat 40 40
 setvar ACTORSHEIGHT 21 setvar ACTORSWIDTH 27
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon

 state itemfullbright
 ifvare mainmenu 0 state fallflags

 ifvarg ITEMDROPPEDTIME 0
 {
  ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
 }
 else
 {
  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifmove RESPAWN_ACTOR_FLAG state respawnit 
   else
   {
    ifvare mainmenu 0
    {
     ifp pshrunk nullop
     else
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          state checkexplodeflag
          setvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags
          addvarvar AFASDROPS ACTORPICKUPAMOUNT
          ifvarg ACTORPICKUPAMOUNT 1
          {
           redefinequote 335 ^14FOUND 1 AFA'S DROP!
           redefinequote 336 ^14FOUND %ld AFA'S DROPS!
           qsprintf 335 336 ACTORPICKUPAMOUNT
          }
          else
          {
           redefinequote 335 ^14FOUND AN AFA'S DROP!
          }
          state grabinventory
         }
        }
       }
      }
     }
    }
   }
  }
 }
enda

// Unknown Medicene

eventloadactor FAUXLEVELUP state setpickupflags enda
useractor notenemy FAUXLEVELUP 0

 sizeat 28 28
 setvar ACTORSHEIGHT 32 setvar ACTORSWIDTH 20
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon

 state itemfullbright
 ifvare mainmenu 0 state fallflags

 ifvarg ITEMDROPPEDTIME 0
 {
  ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
 }
 else
 {
  ifvarand ACTORFLAGS 8 nullop
  else
  {
   ifmove RESPAWN_ACTOR_FLAG state respawnit 
   else
   {
    ifvare mainmenu 0
    {
     ifp pshrunk nullop
     else
     {
      ifvarg CURRENTHITPOINTS 0 // ifp palive
      {
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
        {
         ifcount 6
         {
          state checkexplodeflag
          setvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags
          addvarvar FAUXLEVELUPS ACTORPICKUPAMOUNT
          ifvarg ACTORPICKUPAMOUNT 1
          {
           redefinequote 335 ^14FOUND 1 UNKNOWN MEDICENE!
           redefinequote 336 ^14FOUND %ld UNKNOWN MEDICENES!
           qsprintf 335 336 ACTORPICKUPAMOUNT
          }
          else
          {
           redefinequote 335 ^14FOUND AN UNKNOWN MEDICENE!
          }
          state grabinventory
         }
        }
       }
      }
     }
    }
   }
  }
 }
enda

// Sun Ring [Equipment Item #1]
eventloadactor SUNRING state setpickupflags enda
useractor notenemy SUNRING 0 

 sizeat 48 48
 state itemfullbright
 setvar ACTORSHEIGHT 16 setvar ACTORSWIDTH 16
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         state checkexplodeflag

         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags
         addvarvar SUNRINGS ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A SUN RING!
          redefinequote 336 ^22FOUND %ld SUN RINGS!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else
         {
          redefinequote 335 ^22FOUND A SUN RING!
         }

         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Aqua Ring [Equipment Item #2]
eventloadactor AQUARING state setpickupflags enda
useractor notenemy AQUARING 0 

 sizeat 48 48
 state itemfullbright
 setvar ACTORSHEIGHT 16 setvar ACTORSWIDTH 16
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         state checkexplodeflag

         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags
         addvarvar AQUARINGS ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND AN AQUA RING!
          redefinequote 336 ^22FOUND %ld AQUA RINGS!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else
         {
          redefinequote 335 ^22FOUND AN AQUA RING!
         }

         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Plasma Ring [Equipment Item #3]
eventloadactor PLASMARING state setpickupflags enda
useractor notenemy PLASMARING 0 

 sizeat 48 48
 state itemfullbright
 setvar ACTORSHEIGHT 16 setvar ACTORSWIDTH 16
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         state checkexplodeflag

         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags
         addvarvar PLASMARINGS ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A PLASMA RING!
          redefinequote 336 ^22FOUND %ld PLASMA RINGS!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else
         {
          redefinequote 335 ^22FOUND A PLASMA RING!
         }
 
         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Spirit Ring [Equipment Item #4]
eventloadactor SPIRITRING state setpickupflags enda
useractor notenemy SPIRITRING 0 

 sizeat 48 48
 state itemfullbright
 setvar ACTORSHEIGHT 16 setvar ACTORSWIDTH 16
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        { 
         state checkexplodeflag 

         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags
         addvarvar SPIRITRINGS ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A SPIRIT RING!
          redefinequote 336 ^22FOUND %ld SPIRIT RINGS!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else
         {
          redefinequote 335 ^22FOUND A SPIRIT RING!
         }
 
         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Charm Ankh [Equipment Item #5]
eventloadactor CHARMANKH state setpickupflags enda
useractor notenemy CHARMANKH 0 

 sizeat 64 64
 state itemfullbright
 setvar ACTORSHEIGHT 16 setvar ACTORSWIDTH 16
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         state checkexplodeflag
 
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags
         addvarvar CHARMANKHS ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A CHARM ANKH!
          redefinequote 336 ^22FOUND %ld CHARM ANKHS!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else
         {
          redefinequote 335 ^22FOUND A CHARM ANKH!
         } 

         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Mirror Shield [Equipment Item #6]
eventloadactor MIRRORSHIELD state setpickupflags enda
useractor notenemy MIRRORSHIELD 0 

 sizeat 80 80
 state itemfullbright
 setvar ACTORSHEIGHT 16 setvar ACTORSWIDTH 16
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         state checkexplodeflag
 
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags
         addvarvar MIRRORSHIELDS ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A MIRROR SHIELD!
          redefinequote 336 ^22FOUND %ld MIRROR SHIELDS!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else
         {
          redefinequote 335 ^22FOUND A MIRROR SHIELD!
         }
 
         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// EXP Badge [Equipment Item #7]
eventloadactor EXPBADGE state setpickupflags enda
useractor notenemy EXPBADGE 0 

 sizeat 40 40
 state itemfullbright
 setvar ACTORSHEIGHT 16 setvar ACTORSWIDTH 16
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        { 
         state checkexplodeflag 

         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags
         addvarvar EXPBADGES ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND AN EXPERIENCE BADGE!
          redefinequote 336 ^22FOUND %ld EXPERIENCE BADGES!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else
         {
          redefinequote 335 ^22FOUND AN EXPERIENCE BADGE!
         }
 
         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Rank Badge [Equipment Item #8]
eventloadactor RANKBADGE state setpickupflags enda
useractor notenemy RANKBADGE 0 

 sizeat 40 40
 state itemfullbright
 setvar ACTORSHEIGHT 16 setvar ACTORSWIDTH 16
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         state checkexplodeflag
 
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags
         addvarvar RANKBADGES ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A RANK BADGE!
          redefinequote 336 ^22FOUND %ld RANK BADGES!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else
         {
          redefinequote 335 ^22FOUND A RANK BADGE!
         }
 
         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Money Badge [Equipment Item #9]
eventloadactor MONEYBADGE state setpickupflags enda
useractor notenemy MONEYBADGE 0 

 sizeat 40 40
 state itemfullbright
 setvar ACTORSHEIGHT 16 setvar ACTORSWIDTH 16
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         state checkexplodeflag
 
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags
         addvarvar MONEYBADGES ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A MONEY BADGE!
          redefinequote 336 ^22FOUND %ld MONEY BADGES!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else
         {
          redefinequote 335 ^22FOUND A MONEY BADGE!
         }

         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Teleporter Beacon

action BEACON-INACTIVE 0
action BEACON-ACTIVE -19

eventloadactor TELEBEACON state setpickupflags enda
useractor notenemy TELEBEACON 0

 sizeat 48 48
 state itemfullbright
 setvar ACTORSHEIGHT 16 setvar ACTORSWIDTH 19
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
ifvarg ITEMDROPPEDTIME 0
{
 ifvare mainmenu 0 subvar ITEMDROPPEDTIME 1
}
else
{

 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifvare telebeaconid -1
  {
   action BEACON-INACTIVE
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcanseetarget
      {
       ifcount 6
       {
        ifpdistl RETRIEVEDISTANCE
        {
         state checkexplodeflag

         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags
         addvarvar TELEBEACONS ACTORPICKUPAMOUNT
         ifvarand ACTORFLAGS 2 nullop
         else
         {
          sound FOUND_INVENTORY
          ifvare ACTORPICKUPAMOUNT 1
          { 
           redefinequote 836 ^14PICKED UP A TELEPORTER BEACON!
          }
          else
          {
           redefinequote 836 ^14PICKED UP %ld TELEPORTER BEACONS!
           qsprintf 836 836 ACTORPICKUPAMOUNT
          }
          setvarvar fta fta_normal setvar ftq 836
         }
         ifspawnedby TELEBEACON
          state getcode
         else
	    state quikget
        }
       }
      }
     }
    }
   }
  }
  else
  {
   action BEACON-ACTIVE
   getactor[THISACTOR].x telebeaconx
   getactor[THISACTOR].y telebeacony
   getactor[THISACTOR].z telebeaconz
   getactor[THISACTOR].sectnum telebeaconsectnum
   setactor[THISACTOR].cstat 1538
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 // ifp palive
     {
      ifcount 6
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifhitspace
        {
         ifp pfacing
         {
          sound FOUND_INVENTORY
          sound DUKE_GET
          addvar TELEBEACONS 1
          setactorvar[THISACTOR].telebeaconid -1
          setactorvar[THISACTOR].telebeaconstatus 0
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           sound FOUND_INVENTORY
           redefinequote 836 ^14PICKED UP AN ACTIVE TELEPORTER BEACON!
           setvarvar fta fta_normal setvar ftq 836
          }
          ifspawnedby TELEBEACON
           state getcode
          else
           state quikget
         }
        }
       }
      }
     }
    }
   }
  }
 }

}
enda

eventloadactor ENERGYSHELL_UPGRADED state setpickupflags enda
useractor notenemy ENERGYSHELL_UPGRADED 0

 ifvare LISA? 1
 {
  cstat 0
  setvar ACTORSHEIGHT 151 setvar ACTORSWIDTH 45
  state checkitemflags
  state checkitemflags2 // Checks Item Multiplications for Display Icon
 }
 else cstat 32768

 state getshieldcolors
 ifvare ESHIELDADVANCEMENT 1 killit

 sizeat 8 8 // 32 32 seems to be the correct size for a custom item relative to other items
 state itemfullbright
 ifvare mainmenu 0 state fallflags
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
      ifvarg CURRENTHITPOINTS 0 // ifp palive
       ifcanseetarget
       {
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
          {
           ifvare LISA? 1 // Lisa must be in your group in order to grab this item
           {
            state checkexplodeflag
            ifvare HAVEENERGYSHIELD? 1
            {
             ifvarn ESHIELDADVANCEMENT 1 setvar ESHIELDADVANCEMENT 1
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              redefinequote 335 ^20LISA'S BIO-SHIELD BECOMES MORE ADVANCED!!
              setvarvar fta fta_normal setvar ftq 335
              globalsound YEAH
              globalsound YEAH
              palfrom 32 0 32
             }
             setvar WORLDTILESHUFFLES 0
             state getworldtile
             state activationflag killit
            }
            else
            { 
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              redefinequote 334 ^10LISA NEEDS TO HAVE THE BIO-SHIELD FIRST!
              setvar fta 6 setvar ftq 334
             }
            }
           }
          }
       }
   }
 }
enda


//*********************
//*END OF PICKUP ITEMS*
//*********************