//***********************
//*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 globalsound DUKE_EATFOOD1
           ifvare CHARACTERSELECTED? 5 globalsound WANG_EATFOOD1
           ifvare CHARACTERSELECTED? 8 globalsound LISA_EATFOOD1
           ifvare CHARACTERSELECTED? 15 globalsound MAKEN_EATFOOD1
           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 globalsound DUKE_EATFOOD1
           ifvare CHARACTERSELECTED? 5 globalsound WANG_EATFOOD1
           ifvare CHARACTERSELECTED? 8 globalsound LISA_EATFOOD1
           ifvare CHARACTERSELECTED? 15 globalsound MAKEN_EATFOOD1
           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]
          ifvarvarl STEROIDSTIME STEROID_AMOUNT
          {
           state checkexplodeflag
  
           setvarvar STEROIDSTIME STEROID_AMOUNT
           setplayer[THISACTOR].steroids_amount 400

           setvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags state checkdoublepickupbonus
           subvar ACTORPICKUPAMOUNT 1
           addvarvar VITAMINXS ACTORPICKUPAMOUNT

           ifvarand ACTORFLAGS 2 nullop
           else
           {
            ifvarg ACTORPICKUPAMOUNT 0
            {
             globalsound FOUND_INVENTORY
             redefinequote 836 ^20VITAMIN X ^14[+%d ADDED TO INVENTORY!]
             qsprintf 836 836 ACTORPICKUPAMOUNT
             setvarvar fta fta_normal setvar ftq 836
            }
            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 state checkdoublepickupbonus
            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
          ifvarvarg BOOTSTIME TEMPVAR setvarvar BOOTSTIME TEMPVAR
          setplayer[THISACTOR].boot_amount BOOTSTIME

          setvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags state checkdoublepickupbonus
          subvar ACTORPICKUPAMOUNT 1
          addvarvar BOOTPAIRS ACTORPICKUPAMOUNT

          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            redefinequote 836 ^20BOOTS! ^14[+%d PAIRS ADDED TO INVENTORY!]
            qsprintf 836 836 ACTORPICKUPAMOUNT
            setvarvar fta fta_normal setvar ftq 836
           }
           else
           {
            setvarvar fta fta_normal setvar ftq 6
           }
           state playerstealjustbeforemonster
          }
	    ifspawnedby BOOTS state getcode else state quikget
ends

state pickupvehicle_boots
          state checkexplodeflag

          addvarvar TEMPVAR5 POWERUPBENEFIT
          setvar TEMPVAR BOOT_AMOUNT
          ifvarvarg TEMPVAR5 TEMPVAR setvarvar TEMPVAR5 TEMPVAR
          setactorvar[tempvehicleid].ENEMYBOOTSAMOUNT TEMPVAR5

          setvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags state checkdoublepickupbonus
          subvar ACTORPICKUPAMOUNT 1
          addvarvar BOOTPAIRS ACTORPICKUPAMOUNT

          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            redefinequote 836 ^15BOOTS [VEHICLE]! ^14[+%d PAIRS ADDED TO INVENTORY!]
            qsprintf 836 836 ACTORPICKUPAMOUNT
            setvarvar fta fta_normal setvar ftq 836
           }
           else
           {
            redefinequote 836 ^15GRABBED PROTECTIVE BOOTS FOR YOUR VEHICLE!
            setvarvar fta fta_normal setvar ftq 836
           }
           state playerstealjustbeforemonster
          }
	    ifspawnedby BOOTS state getcode else state quikget
ends

state pickupinventory_boots
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag

           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags state checkdoublepickupbonus

           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
           }
           state playerstealjustbeforemonster
           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
  setvar FLAGSSET? 1
 }
 ifvare FLAGSSET? 1
 {
  ifvarl POWERUPBENEFIT 1 setvar POWERUPBENEFIT BOOT_AMOUNT
  setvar FLAGSSET? 2
 }
 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
          ifvarvarl BOOTSTIME TEMPVAR state pickupcharacter_boots else state pickupinventory_boots
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           setvar TEMPVAR BOOT_AMOUNT
           ifvarvarl BOOTSTIME TEMPVAR state pickupcharacter_boots else state pickupinventory_boots
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           setvar TEMPVAR BOOT_AMOUNT
           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
           ifvarvarl BOOTSTIME TEMPVAR state pickupcharacter_boots
           else
           {
            setvar TEMPVAR BOOT_AMOUNT
            getactorvar[tempvehicleid].ENEMYBOOTSAMOUNT TEMPVAR5
            ifvarvarl TEMPVAR5 TEMPVAR state pickupvehicle_boots else state pickupinventory_boots
           }
          }
          ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
          {
           setvar TEMPVAR BOOT_AMOUNT
           getactorvar[tempvehicleid].ENEMYBOOTSAMOUNT TEMPVAR5
           ifvarvarl TEMPVAR5 TEMPVAR state pickupvehicle_boots
           else
           {
            setvar TEMPVAR BOOT_AMOUNT
            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
    {
     ifvarl ITEMSEEKB BOOT_AMOUNT
     {
      state checkexplodeflag

      addvarvar ITEMSEEKC POWERUPBENEFIT
      setvar TEMPVAR BOOT_AMOUNT
      ifvarvarg ITEMSEEKC TEMPVAR setvarvar ITEMSEEKC TEMPVAR
      setactorvar[ITEMSEEK].ENEMYBOOTSAMOUNT ITEMSEEKC

      state resetitemtarget
      state getitemseekerspecies

      setvar ACTORPICKUPAMOUNT 1
      state checkpickupamountflags
      subvar ACTORPICKUPAMOUNT 1
      ifvarg ACTORPICKUPAMOUNT 7
      {
       espawn BOOTS setactorvar[RETURN].ACTORFLAGS 384 state scatterdrops
       subvar ACTORPICKUPAMOUNT 8
      }
      ifvarg ACTORPICKUPAMOUNT 3
      {
       espawn BOOTS setactorvar[RETURN].ACTORFLAGS 256 state scatterdrops
       subvar ACTORPICKUPAMOUNT 4
      }
      ifvarg ACTORPICKUPAMOUNT 1
      {
       espawn BOOTS setactorvar[RETURN].ACTORFLAGS 128 state scatterdrops
       subvar ACTORPICKUPAMOUNT 2
      }
      ifvare ACTORPICKUPAMOUNT 1
      {
       espawn BOOTS state scatterdrops
       subvar ACTORPICKUPAMOUNT 1
      }

      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 16
     { 
      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 16
      {
       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
         {
          ifvarvarl NIGHTVISIONTIME HEAT_AMOUNT state grabheatsensoritem else state grabheatsensorinventory
         }
        }
        else
        {
         ifcanseetarget state grabheatsensorinventory
        }
       }
       else
       ifvare CHARACTERSELECTED? 4
       {
        state grabheatsensorinventory
       }
       else
       {
        ifcanseetarget
        {
         ifvarvarl NIGHTVISIONTIME HEAT_AMOUNT state grabheatsensoritem else state grabheatsensorinventory
        }
       }
      }
     }
    }
   }
  }
 }
 
}
enda

state character_shieldtally
             ifvarvarl RECEIVEDARMOR tempb ifvarg ACTORPICKUPAMOUNT 0
             {
              ifrnd 64 addvar RECEIVEDARMOR 875
              else ifrnd 85 addvar RECEIVEDARMOR 750
              else ifrnd 128 addvar RECEIVEDARMOR 500
              else addvar RECEIVEDARMOR 250
              subvar ACTORPICKUPAMOUNT 1
              addvar tempe 1
             }
ends

// SHIELD = 54

state pickupcharacter_shield
          state checkexplodeflag
	    ifvare ARMORISUSED? 1
	    {
            // TEMP4 = Maximum HP % to reach
            // tempb = becomes the % of health needed to heal to reach TEMP4 [tempb - TEMPARMOR = tempb]
            setvar tempb 1000
            setvar TEMP4 1000
            setvarvar TEMPARMOR CURRENTARMORPOINTS
            mulvar TEMPARMOR 1000
            divvarvar TEMPARMOR MAXARMORPOINTS
            subvarvar tempb TEMPARMOR

            setvar RECEIVEDARMOR 0
            setvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags state checkdoublepickupbonus
            setvar tempe 0
 
            setvar TEMPVAR5 16
            whilevarn TEMPVAR5 0
            {
             state character_shieldtally
             subvar TEMPVAR5 1
            }
            addvarvar USEDBODYARMORS ACTORPICKUPAMOUNT

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

            ifrnd 128 ifvarl ARMORPERCENT 333 setvar ARMORPERCENT 333
            else ifvarl ARMORPERCENT 667 setvar ARMORPERCENT 667
            ifvarg ARMORPERCENT 999 setvar ARMORPERCENT 1000

            ifvarand ACTORFLAGS 2 nullop
            else
            {
             ifvarg ACTORPICKUPAMOUNT 0
             {
              globalsound FOUND_INVENTORY
              redefinequote 836 ^20GOT USED ARMOR ^14[+%d SUITS ADDED TO INVENTORY!]
              qsprintf 836 836 ACTORPICKUPAMOUNT
              setvarvar fta fta_normal setvar ftq 836
             }
             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          
             state playerstealjustbeforemonster
            }
            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
            ifvarg ARMORPERCENT 999 setvar ARMORPERCENT 1000

            setvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags state checkdoublepickupbonus
            subvar ACTORPICKUPAMOUNT 1
            addvarvar BODYARMORS ACTORPICKUPAMOUNT

            setvarvar RECEIVEDARMOR MAXARMORPOINTS
            setvarvar CURRENTARMORPOINTS RECEIVEDARMOR
            state showhealing_playerap

            ifvarand ACTORFLAGS 2 nullop
            else
            {
             ifvarg ACTORPICKUPAMOUNT 0
             {
              globalsound FOUND_INVENTORY
              redefinequote 836 ^20ARMOR ^14[+%d SUITS ADDED TO INVENTORY!]
              qsprintf 836 836 ACTORPICKUPAMOUNT
              setvarvar fta fta_normal setvar ftq 836
             }
             else
             {
              setvarvar fta fta_normal setvar ftq 38
             }
             ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
             setvar PLAYERAPDAMAGED? -1
             state playerstealjustbeforemonster
            }
	    }
	    ifspawnedby SHIELD
	      state getcode
	    else
	      state quikget
ends

state pickupvehicle_shield
          getactorvar[tempvehicleid].ENEMYARMORPERCENT TEMPVAR3
          state checkexplodeflag
	    ifvare ARMORISUSED? 1
	    {
            // TEMP4 = Maximum HP % to reach
            // tempb = becomes the % of health needed to heal to reach TEMP4 [tempb - TEMPARMOR = tempb]
            setvar tempb 1000
            setvar TEMP4 1000
            setvarvar TEMPARMOR TEMPVAR4
            mulvar TEMPARMOR 1000
            divvarvar TEMPARMOR TEMPVAR5
            subvarvar tempb TEMPARMOR

            setvar RECEIVEDARMOR 0
            setvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags state checkdoublepickupbonus
            setvar tempe 0

            setvar TEMPVAR5 16
            whilevarn TEMPVAR5 0
            {
             state character_shieldtally
             subvar TEMPVAR5 1
            }
            addvarvar USEDBODYARMORS ACTORPICKUPAMOUNT

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

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

            ifvarand ACTORFLAGS 2 nullop
            else
            {
             ifvarg ACTORPICKUPAMOUNT 0
             {
              globalsound FOUND_INVENTORY
              redefinequote 836 ^15GOT USED ARMOR [VEHICLE] ^14[+%d SUITS ADDED TO INVENTORY!]
              qsprintf 836 836 ACTORPICKUPAMOUNT
              setvarvar fta fta_normal setvar ftq 836
             }
             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
             state playerstealjustbeforemonster
            }
            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
            ifvarg TEMPVAR3 999 setvar TEMPVAR3 1000
            setactorvar[tempvehicleid].ENEMYARMORPERCENT TEMPVAR3

            setvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags state checkdoublepickupbonus
            subvar ACTORPICKUPAMOUNT 1
            addvarvar BODYARMORS ACTORPICKUPAMOUNT

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

            ifvarand ACTORFLAGS 2 nullop
            else
            {
             globalsound USE_ARMORITEM3
             ifvarg ACTORPICKUPAMOUNT 0
             {
              globalsound FOUND_INVENTORY
              redefinequote 836 ^15ARMOR [VEHICLE] ^14[+%d SUITS ADDED TO INVENTORY!]
              qsprintf 836 836 ACTORPICKUPAMOUNT
              setvarvar fta fta_normal setvar ftq 836
             }
             else
             {
              redefinequote 836 ^15GRABBED A SUIT OF BODY ARMOR FOR YOUR VEHICLE!
              setvarvar fta fta_normal setvar ftq 836
             }
             setvar VEHICLEAPDAMAGED? -1
             state playerstealjustbeforemonster
            }
	    }
	    ifspawnedby SHIELD
	      state getcode
	    else
	      state quikget
ends

state pickupinventory_shield
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags state checkdoublepickupbonus
           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
            state playerstealjustbeforemonster
           }
           globalsound FOUND_INVENTORY
           ifspawnedby SHIELD
 	      state getcode
           else 
            state quikget
          }
ends

state actor_shieldtally
      ifvarvarl ITEMSEEKC tempb ifvarg ACTORPICKUPAMOUNT 0
      {
       ifrnd 64 addvar ITEMSEEKC 875
       else ifrnd 85 addvar ITEMSEEKC 750
       else ifrnd 128 addvar ITEMSEEKC 500
       else addvar ITEMSEEKC 250
       subvar ACTORPICKUPAMOUNT 1
       addvar tempe 1
      }
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 state pickupcharacter_shield // If Armor is less than max, grab and immediately wear
           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 state pickupvehicle_shield // If Armor is less than max, grab and immediately wear
           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

     ifvare ARMORISUSED? 1
     {
      // TEMP4 = Maximum HP % to reach
      // tempb = becomes the % of health needed to heal to reach TEMP4 [tempb - TEMPARMOR = tempb]
      setvar tempb 1000
      setvar TEMP4 1000
      setvarvar TEMPARMOR ITEMENEMYCURRENTAP
      mulvar TEMPARMOR 1000
      divvarvar TEMPARMOR ITEMENEMYMAXAP
      subvarvar tempb TEMPARMOR

      setvar ITEMSEEKC 0
      setvar ACTORPICKUPAMOUNT 1
      state checkpickupamountflags
      setvar tempe 0

      setvar TEMPVAR5 16
      whilevarn TEMPVAR5 0
      {
       state actor_shieldtally
       subvar TEMPVAR5 1
      }

      ifvarg ACTORPICKUPAMOUNT 7
      {
       espawn SHIELD setactorvar[RETURN].ARMORISUSED? 1 setactorvar[RETURN].ACTORFLAGS 384 state scatterdrops
       subvar ACTORPICKUPAMOUNT 8
      }
      ifvarg ACTORPICKUPAMOUNT 3
      {
       espawn SHIELD setactorvar[RETURN].ARMORISUSED? 1 setactorvar[RETURN].ACTORFLAGS 256 state scatterdrops
       subvar ACTORPICKUPAMOUNT 4
      }
      ifvarg ACTORPICKUPAMOUNT 1
      {
       espawn SHIELD setactorvar[RETURN].ARMORISUSED? 1 setactorvar[RETURN].ACTORFLAGS 128 state scatterdrops
       subvar ACTORPICKUPAMOUNT 2
      }
      ifvare ACTORPICKUPAMOUNT 1
      {
       espawn SHIELD setactorvar[RETURN].ARMORISUSED? 1 state scatterdrops
       subvar ACTORPICKUPAMOUNT 1
      }

      mulvarvar ITEMSEEKC ITEMENEMYMAXAP
      divvar ITEMSEEKC 1000
      addvarvar ITEMENEMYCURRENTAP ITEMSEEKC
      ifvarvarg ITEMENEMYCURRENTAP ITEMENEMYMAXAP setvarvar ITEMENEMYCURRENTAP ITEMENEMYMAXAP
      setactorvar[ITEMSEEK].ENEMYAP ITEMENEMYCURRENTAP
      state showhealing_actorap

      getactorvar[ITEMSEEK].ENEMYARMORPERCENT CURRENTENEMYARMORPERCENT
      ifrnd 128 ifvarl CURRENTENEMYARMORPERCENT 333 setvar CURRENTENEMYARMORPERCENT 333
      else ifvarl CURRENTENEMYARMORPERCENT 667 setvar CURRENTENEMYARMORPERCENT 667
      setactorvar[ITEMSEEK].ENEMYARMORPERCENT CURRENTENEMYARMORPERCENT

      ifvarand ACTORFLAGS 4 nullop
      else
      {
       state getitemseekerspecies
       ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT USED ARMOR!
       ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT USED ARMOR!
       sound KICK_HIT
       ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
       setactorvar[ITEMSEEK].ENEMYAPDAMAGED? -1          
      }
     }
     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
      ifvarg CURRENTENEMYARMORPERCENT 999 setvar CURRENTENEMYARMORPERCENT 1000

      setactorvar[ITEMSEEK].ENEMYARMORPERCENT CURRENTENEMYARMORPERCENT

      setvar ACTORPICKUPAMOUNT 1
      state checkpickupamountflags
      subvar ACTORPICKUPAMOUNT 1
      ifvarg ACTORPICKUPAMOUNT 7
      {
       espawn SHIELD setactorvar[RETURN].ACTORFLAGS 384 state scatterdrops
       subvar ACTORPICKUPAMOUNT 8
      }
      ifvarg ACTORPICKUPAMOUNT 3
      {
       espawn SHIELD setactorvar[RETURN].ACTORFLAGS 256 state scatterdrops
       subvar ACTORPICKUPAMOUNT 4
      }
      ifvarg ACTORPICKUPAMOUNT 1
      {
       espawn SHIELD setactorvar[RETURN].ACTORFLAGS 128 state scatterdrops
       subvar ACTORPICKUPAMOUNT 2
      }
      ifvare ACTORPICKUPAMOUNT 1
      {
       espawn SHIELD state scatterdrops
       subvar ACTORPICKUPAMOUNT 1
      }

      setvarvar ITEMSEEKC ITEMENEMYMAXAP
      addvarvar ITEMENEMYCURRENTAP ITEMSEEKC
      ifvarvarg ITEMSEEKC ITEMENEMYMAXAP setvarvar ITEMSEEKC ITEMENEMYMAXAP
      setactorvar[ITEMSEEK].ENEMYAP ITEMSEEKC
      state showhealing_actorap

      ifvarand ACTORFLAGS 4 nullop
      else
      {
       state getitemseekerspecies
       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
      }
     }


     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
          ifvarvarg SCUBATIME TEMPVAR setvarvar SCUBATIME TEMPVAR

          setvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags state checkdoublepickupbonus
          subvar ACTORPICKUPAMOUNT 1
          addvarvar SCUBATANKS ACTORPICKUPAMOUNT

          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            redefinequote 836 ^20SCUBA GEAR ^14[+%d SUITS ADDED TO INVENTORY!]
            qsprintf 836 836 ACTORPICKUPAMOUNT
            setvarvar fta fta_normal setvar ftq 836
           }
           else
           {
            setvarvar fta fta_normal setvar ftq 39
           }
           state playerstealjustbeforemonster
          }
          ifspawnedby AIRTANK
           state getcode
          else
           state quikget
ends

state pickupvehicle_airtank
          state checkexplodeflag

          addvarvar TEMPVAR4 POWERUPBENEFIT
          setvar TEMPVAR SCUBA_AMOUNT
          ifvarvarg TEMPVAR4 TEMPVAR setvarvar TEMPVAR4 TEMPVAR
          setactorvar[tempvehicleid].ENEMYAIRTANKAMOUNT TEMPVAR4

          setvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags state checkdoublepickupbonus
          subvar ACTORPICKUPAMOUNT 1
          addvarvar SCUBATANKS ACTORPICKUPAMOUNT

          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            redefinequote 836 ^15SCUBA GEAR [VEHICLE] ^14[+%d SUITS ADDED TO INVENTORY!]
            qsprintf 836 836 ACTORPICKUPAMOUNT
            setvarvar fta fta_normal setvar ftq 836
           }
           else
           {
            redefinequote 836 ^15GRABBED A SUIT OF SCUBA GEAR FOR YOUR VEHICLE!
            setvarvar fta fta_normal setvar ftq 836
           }
           state playerstealjustbeforemonster
          }
          ifspawnedby AIRTANK
           state getcode
          else
           state quikget
ends

state pickupinventory_airtank
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags state checkdoublepickupbonus
           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
            state playerstealjustbeforemonster
           }
           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
  setvar FLAGSSET? 1
 }
 ifvare FLAGSSET? 1
 {
  ifvarl POWERUPBENEFIT 1 setvar POWERUPBENEFIT SCUBA_AMOUNT
  setvar FLAGSSET? 2
 }

 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
          ifvarvarl SCUBATIME TEMPVAR state pickupcharacter_airtank else state pickupinventory_airtank
         }
         else
         {
          ifvare vehiclepickuptoggle 0 // Character Only
          {
           setvar TEMPVAR SCUBA_AMOUNT
           ifvarvarl SCUBATIME TEMPVAR state pickupcharacter_airtank else state pickupinventory_airtank
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           setvar TEMPVAR SCUBA_AMOUNT
           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
           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
           getactorvar[tempvehicleid].ENEMYAIRTANKAMOUNT TEMPVAR5
           ifvarvarl TEMPVAR5 TEMPVAR state pickupvehicle_airtank
           else
           {
            setvar TEMPVAR SCUBA_AMOUNT
            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

     ifvarvarl ITEMSEEKB TEMPVAR
     {
      state checkexplodeflag

      addvarvar ITEMSEEKC POWERUPBENEFIT
      setvar TEMPVAR SCUBA_AMOUNT
      ifvarvarg ITEMSEEKC TEMPVAR setvarvar ITEMSEEKC TEMPVAR
      setactorvar[ITEMSEEK].ENEMYAIRTANKAMOUNT ITEMSEEKC

      state resetitemtarget
      state getitemseekerspecies

      setvar ACTORPICKUPAMOUNT 1
      state checkpickupamountflags
      subvar ACTORPICKUPAMOUNT 1
      ifvarg ACTORPICKUPAMOUNT 7
      {
       espawn AIRTANK setactorvar[RETURN].ACTORFLAGS 384 state scatterdrops
       subvar ACTORPICKUPAMOUNT 8
      }
      ifvarg ACTORPICKUPAMOUNT 3
      {
       espawn AIRTANK setactorvar[RETURN].ACTORFLAGS 256 state scatterdrops
       subvar ACTORPICKUPAMOUNT 4
      }
      ifvarg ACTORPICKUPAMOUNT 1
      {
       espawn AIRTANK setactorvar[RETURN].ACTORFLAGS 128 state scatterdrops
       subvar ACTORPICKUPAMOUNT 2
      }
      ifvare ACTORPICKUPAMOUNT 1
      {
       espawn AIRTANK state scatterdrops
       subvar ACTORPICKUPAMOUNT 1
      }

      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
        {
         ifvarvarl HOLOFORMTIME HOLODUKE_AMOUNT
         {
          state checkexplodeflag

          setvarvar HOLOFORMTIME HOLODUKE_AMOUNT
          setplayer[THISACTOR].holoduke_amount HOLOFORMTIME

          setvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags state checkdoublepickupbonus
          subvar ACTORPICKUPAMOUNT 1
          addvarvar HOLOFORMS ACTORPICKUPAMOUNT

          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            ifvare CHARACTERSELECTED? 1 redefinequote 836 ^20HOLODUKE ^14[+%d ADDED TO INVENTORY!]
            ifvare CHARACTERSELECTED? 2 redefinequote 836 ^20HOLOJACK ^14[+%d ADDED TO INVENTORY!]
            ifvare CHARACTERSELECTED? 3 redefinequote 836 ^20HOLOBUBSY ^14[+%d ADDED TO INVENTORY!]
            ifvare CHARACTERSELECTED? 4 redefinequote 836 ^20HOLOAMI ^14[+%d ADDED TO INVENTORY!]
            ifvare CHARACTERSELECTED? 5 redefinequote 836 ^20HOLOHIGA ^14[+%d ADDED TO INVENTORY!]
            ifvare CHARACTERSELECTED? 6 redefinequote 836 ^20HOLOESSENCE ^14[+%d ADDED TO INVENTORY!]
            ifvare CHARACTERSELECTED? 7 redefinequote 836 ^20HOLOTED ^14[+%d ADDED TO INVENTORY!]
            ifvare CHARACTERSELECTED? 8 redefinequote 836 ^20HOLOLISA ^14[+%d ADDED TO INVENTORY!]
            ifvare CHARACTERSELECTED? 9 redefinequote 836 ^20HOLOCYBANIS ^14[+%d ADDED TO INVENTORY!]
            ifvare CHARACTERSELECTED? 10
            { 
             ifvare NETHRAFORM? 0 redefinequote 836 ^20HOLONETHRA ^14[+%d ADDED TO INVENTORY!]
             ifvare NETHRAFORM? 1 redefinequote 836 ^20HOLOCHRISTINA ^14[+%d ADDED TO INVENTORY!]
            }
            ifvare CHARACTERSELECTED? 11 redefinequote 836 ^20HOLOPAULA ^14[+%d ADDED TO INVENTORY!]
            ifvare CHARACTERSELECTED? 12 redefinequote 836 ^20HOLOLORI ^14[+%d ADDED TO INVENTORY!]
            ifvare CHARACTERSELECTED? 13 redefinequote 836 ^20HOLOMINAKO ^14[+%d ADDED TO INVENTORY!]
            ifvare CHARACTERSELECTED? 14
            {
             ifvare PUBLICBETA? 0
             {
              ifvare debugtoggle 0 redefinequote 836 ^20HOLONAFERIA ^14[+%d ADDED TO INVENTORY!]
              ifvare debugtoggle 1 redefinequote 836 ^20HOLOHINOTORI ^14[+%d ADDED TO INVENTORY!]
             }
             else
             {
              ifvare debugtoggle 0 redefinequote 836 ^20HOLO???????? ^14[+%d ADDED TO INVENTORY!]
              ifvare debugtoggle 1 redefinequote 836 ^20HOLOHINOTORI ^14[+%d ADDED TO INVENTORY!]
             }
            }
            ifvare CHARACTERSELECTED? 15 redefinequote 836 ^20HOLOMAKEN ^14[+%d ADDED TO INVENTORY!]
            qsprintf 836 836 ACTORPICKUPAMOUNT
            setvarvar fta fta_normal setvar ftq 836
           }
           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 state checkdoublepickupbonus
           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
  setvar FLAGSSET? 1
 }
 ifvare FLAGSSET? 1
 {
  ifvarl POWERUPBENEFIT 1 setvar POWERUPBENEFIT JETPACK_AMOUNT
  setvar FLAGSSET? 2
 }

 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
        {
         getplayer[THISACTOR].jetpack_amount JETPACKTIME
         ifvarvarl JETPACKTIME JETPACK_AMOUNT
	   {
          state checkexplodeflag

          addvarvar JETPACKTIME POWERUPBENEFIT
          ifvarg JETPACKTIME JETPACK_AMOUNT setvar JETPACKTIME JETPACK_AMOUNT
          setplayer[THISACTOR].jetpack_amount JETPACKTIME

          setvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags state checkdoublepickupbonus
          subvar ACTORPICKUPAMOUNT 1
          addvarvar JETPACKS ACTORPICKUPAMOUNT

  	    ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            redefinequote 836 ^20JETPACK ^14[+%d ADDED TO INVENTORY!]
            qsprintf 836 836 ACTORPICKUPAMOUNT
            setvarvar fta fta_normal setvar ftq 836
           }
           else setvarvar fta fta_normal setvar ftq 41
           state playerstealjustbeforemonster
          }
	    ifspawnedby JETPACK
	      state getcode
	    else
	      state quikget
	   }
         else
         {
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag

           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags state checkdoublepickupbonus
           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
            state playerstealjustbeforemonster
           }
           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].ENEMYHP ENEMYSHEALTH
    ifvarg ENEMYSHEALTH 0 // -1
    {
     getactorvar[ITEMSEEK].ENEMYJETPACKAMOUNT ITEMSEEKB
     ifvarl ITEMSEEKB JETPACK_AMOUNT
     {
      state checkexplodeflag

      addvarvar ITEMSEEKC POWERUPBENEFIT
      ifvarvarg ITEMSEEKC JETPACK_AMOUNT setvarvar ITEMSEEKC JETPACK_AMOUNT
      setactorvar[ITEMSEEK].ENEMYJETPACKAMOUNT ITEMSEEKC

      state resetitemtarget
      state getitemseekerspecies

      setvar ACTORPICKUPAMOUNT 1
      state checkpickupamountflags
      subvar ACTORPICKUPAMOUNT 1
      ifvarg ACTORPICKUPAMOUNT 7
      {
       espawn JETPACK setactorvar[RETURN].ACTORFLAGS 384 state scatterdrops
       subvar ACTORPICKUPAMOUNT 8
      }
      ifvarg ACTORPICKUPAMOUNT 3
      {
       espawn JETPACK setactorvar[RETURN].ACTORFLAGS 256 state scatterdrops
       subvar ACTORPICKUPAMOUNT 4
      }
      ifvarg ACTORPICKUPAMOUNT 1
      {
       espawn JETPACK setactorvar[RETURN].ACTORFLAGS 128 state scatterdrops
       subvar ACTORPICKUPAMOUNT 2
      }
      ifvare ACTORPICKUPAMOUNT 1
      {
       espawn JETPACK state scatterdrops
       subvar ACTORPICKUPAMOUNT 1
      }

      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

state calcitemremains_weaponammo
        getactor[THISACTOR].picnum TEMPVAR3 // Get's the actor's picnum to self-replicate itself
        ifvarg ACTORPICKUPAMOUNT 7
        {
         espawnvar TEMPVAR3 setactorvar[RETURN].ACTORFLAGS 384 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
         subvar ACTORPICKUPAMOUNT 8
        }
        ifvarg ACTORPICKUPAMOUNT 3
        {
         espawnvar TEMPVAR3 setactorvar[RETURN].ACTORFLAGS 256 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
         subvar ACTORPICKUPAMOUNT 4
        }
        ifvarg ACTORPICKUPAMOUNT 1
        {
         espawnvar TEMPVAR3 setactorvar[RETURN].ACTORFLAGS 128 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
         subvar ACTORPICKUPAMOUNT 2
        }
        ifvare ACTORPICKUPAMOUNT 1
        {
         espawnvar TEMPVAR3 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
         subvar ACTORPICKUPAMOUNT 1
        }
ends

state pistolcheckammo
         ifvarvarl TEMPVAR MAXPISTOL ifvarg ACTORPICKUPAMOUNT 0
         {
          addvarvar TEMPVAR TEMPVAR4
          ifvarvarg TEMPVAR MAXPISTOL setvarvar TEMPVAR MAXPISTOL
          subvar ACTORPICKUPAMOUNT 1
         }
ends

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 ifcount 6 ifpdistl RETRIEVEDISTANCE
      {
       getplayer[THISACTOR].ammo_amount 1 TEMPVAR
       ifvarvarl TEMPVAR MAXPISTOL
       {
        ifcanseetarget
	  {
         state checkexplodeflag

         getplayer[THISACTOR].ammo_amount 1 TEMPVAR
         setvar TEMPVAR4 PISTOLAMMOAMOUNT
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags state checkdoublepickupbonus
         setvar TEMPVAR5 16
         whilevarn TEMPVAR5 0
         {
          state pistolcheckammo
          subvar TEMPVAR5 1
         }
         setplayer[THISACTOR].ammo_amount 1 TEMPVAR

         state calcitemremains_weaponammo

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

state freezercheckammo
         ifvarvarl TEMPVAR MAXFREEZER ifvarg ACTORPICKUPAMOUNT 0
         {
          addvarvar TEMPVAR TEMPVAR4
          ifvarvarg TEMPVAR MAXFREEZER setvarvar TEMPVAR MAXFREEZER
          subvar ACTORPICKUPAMOUNT 1
         }
ends

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 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      getplayer[THISACTOR].ammo_amount 9 TEMPVAR
      ifvarvarl TEMPVAR MAXFREEZER
      {
       ifcanseetarget
	 {
        state checkexplodeflag

        getplayer[THISACTOR].ammo_amount 9 TEMPVAR
        setvar TEMPVAR4 FREEZEAMMOAMOUNT
        setvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         state freezercheckammo
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 9 TEMPVAR

        state calcitemremains_weaponammo

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

state shotguncheckammo
        ifvarvarl TEMPVAR MAXSHOTGUN ifvarg ACTORPICKUPAMOUNT 0
        {
         addvarvar TEMPVAR TEMPVAR4
         ifvarvarg TEMPVAR MAXSHOTGUN setvarvar TEMPVAR MAXSHOTGUN
         subvar ACTORPICKUPAMOUNT 1
        }
ends

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 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      getplayer[THISACTOR].ammo_amount 2 TEMPVAR
      ifvarvarl TEMPVAR MAXSHOTGUN
      {
       ifcanseetarget
	 {
        state checkexplodeflag

        getplayer[THISACTOR].ammo_amount 2 TEMPVAR              
        setvar TEMPVAR4 SHOTGUNAMMOAMOUNT
        setvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         state shotguncheckammo
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 2 TEMPVAR

        state calcitemremains_weaponammo

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

state shrinkercheckammo
        ifvarvarl TEMPVAR MAXSHRINKER ifvarg ACTORPICKUPAMOUNT 0
        {
         addvarvar TEMPVAR TEMPVAR4
         ifvarvarg TEMPVAR MAXSHRINKER setvarvar TEMPVAR MAXSHRINKER
         subvar ACTORPICKUPAMOUNT 1
        }
ends

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 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      getplayer[THISACTOR].ammo_amount 6 TEMPVAR
      ifvarvarl TEMPVAR MAXSHRINKER
      {
       ifcanseetarget
     	 {
        state checkexplodeflag

        getplayer[THISACTOR].ammo_amount 6 TEMPVAR
        setvar TEMPVAR4 CRYSTALAMMOAMOUNT
        setvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         state shrinkercheckammo
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 6 TEMPVAR

        state calcitemremains_weaponammo

        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 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      getplayer[THISACTOR].ammo_amount 11 TEMPVAR
      ifvarvarl TEMPVAR MAXEXPANDER
      {
       ifcanseetarget
	 {
        state checkexplodeflag

        getplayer[THISACTOR].ammo_amount 11 TEMPVAR
        setvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         ifvarvarl TEMPVAR MAXEXPANDER ifvarg ACTORPICKUPAMOUNT 0
         {
          addvarvar TEMPVAR GROWCRYSTALAMMOAMOUNT
          ifvarvarg TEMPVAR MAXEXPANDER setvarvar TEMPVAR MAXEXPANDER
          subvar ACTORPICKUPAMOUNT 1
         }
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 11 TEMPVAR

        state calcitemremains_weaponammo

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


state chainguncheckammo
        ifvarvarl TEMPVAR MAXCHAINGUN ifvarg ACTORPICKUPAMOUNT 0
        {
         addvarvar TEMPVAR TEMPVAR4
         ifvarvarg TEMPVAR MAXCHAINGUN setvarvar TEMPVAR MAXCHAINGUN
         subvar ACTORPICKUPAMOUNT 1
        }
ends

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 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      getplayer[THISACTOR].ammo_amount 3 TEMPVAR
      ifvarvarl TEMPVAR MAXCHAINGUN
      {
       ifcanseetarget
	 {
        state checkexplodeflag

        getplayer[THISACTOR].ammo_amount 3 TEMPVAR
        setvar TEMPVAR4 CHAINGUNAMMOAMOUNT
        setvarvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         state chainguncheckammo
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 3 TEMPVAR

        state calcitemremains_weaponammo

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

state devastatorcheckammo
        ifvarvarl TEMPVAR MAXDEVASTATOR ifvarg ACTORPICKUPAMOUNT 0
        {
         addvarvar TEMPVAR TEMPVAR4
         ifvarvarg TEMPVAR MAXDEVASTATOR setvarvar TEMPVAR MAXDEVASTATOR
         subvar ACTORPICKUPAMOUNT 1
        }
ends

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 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      getplayer[THISACTOR].ammo_amount 7 TEMPVAR
      ifvarvarl TEMPVAR MAXDEVASTATOR
      {
       ifcanseetarget
       {
        state checkexplodeflag

        getplayer[THISACTOR].ammo_amount 7 TEMPVAR
        setvar TEMPVAR4 DEVISTATORAMMOAMOUNT
        setvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         state devastatorcheckammo
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 7 TEMPVAR

        state calcitemremains_weaponammo

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

state rpgcheckammo
        ifvarvarl TEMPVAR MAXRPG ifvarg ACTORPICKUPAMOUNT 0
        {
         addvarvar TEMPVAR TEMPVAR4
         ifvarvarg TEMPVAR MAXRPG setvarvar TEMPVAR MAXRPG
         subvar ACTORPICKUPAMOUNT 1
        }
ends

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 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      getplayer[THISACTOR].ammo_amount 4 TEMPVAR
      ifvarvarl TEMPVAR MAXRPG
      {
       ifcanseetarget
	 {
        state checkexplodeflag

        getplayer[THISACTOR].ammo_amount 4 TEMPVAR
        setvar TEMPVAR4 RPGAMMOBOX
        setvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         state rpgcheckammo
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 4 TEMPVAR

        state calcitemremains_weaponammo

        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
 ifvarand PLAYERWEAPONBITFIELD 32 state itemfullbright else { state shadepulse setactor[THISACTOR].shade shade }
 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 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      getplayer[THISACTOR].ammo_amount 5 TEMPVAR
      ifvarvarl TEMPVAR MAXPIPEBOMB
      {
       ifcanseetarget
	 {
        state checkexplodeflag

        getplayer[THISACTOR].ammo_amount 5 TEMPVAR
        setvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         ifvarvarl TEMPVAR MAXPIPEBOMB ifvarg ACTORPICKUPAMOUNT 0
         {
          addvar TEMPVAR HANDBOMBBOX
          ifvarvarg TEMPVAR MAXPIPEBOMB setvarvar TEMPVAR MAXPIPEBOMB
          subvar ACTORPICKUPAMOUNT 1
         }
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 5 TEMPVAR

        state calcitemremains_weaponammo

        ifvarand ACTORFLAGS 2 nullop
        else
        {
         setvarvar fta fta_normal setvar ftq 55
        }	
        ifspawnedby HBOMBAMMO state getweaponcode else state quikweaponget
	 }
      }
     }
    }
   }
 }
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 PLAYERWEAPONBITFIELD 2 state itemfullbright else { state shadepulse setactor[THISACTOR].shade shade }
 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 state checkdoublepickupbonus
             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

state weapontotank
 ifvare oldskoolmode 0
 {
  ifrnd 2
  {
   espawn EMPTYTANK
   ifrnd 85 setactor[RETURN].pal 19 // Red Tank [Rockets]
   else ifrnd 128 setactor[RETURN].pal 17 // Blue Tank [Shotgun/Expander]
   else setactor[RETURN].pal 0 // Green Tank [Bullet/Laser]
  }
 }
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 PLAYERWEAPONBITFIELD 16 state itemfullbright else { state shadepulse setactor[THISACTOR].shade shade }
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      ifcanseetarget
      {
       getplayer[THISACTOR].gotweapon 4 TEMPVAR2
       ifvare TEMPVAR2 0
       {
        state checkexplodeflag
 
        getplayer[THISACTOR].ammo_amount 4 TEMPVAR
        setvar TEMPVAR4 RPGAMMOBOX
        setvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        ifvarg ACTORPICKUPAMOUNT 0
        {
         addweapon RPG_WEAPON 0
         addvarvar TEMPVAR TEMPVAR4
         ifvarvarg TEMPVAR MAXRPG setvarvar TEMPVAR MAXRPG
         subvar ACTORPICKUPAMOUNT 1
        }
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         state rpgcheckammo
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 4 TEMPVAR

        state calcitemremains_weaponammo

        ifvarand ACTORFLAGS 2 nullop else { setvarvar fta fta_normal setvar ftq 56 }
        ifspawnedby RPGSPRITE state getweaponcode else state quikweaponget
       }
       else
       {
        getplayer[THISACTOR].ammo_amount 4 TEMPVAR
        ifvarvarl TEMPVAR MAXRPG
        {
         state checkexplodeflag
	 
         getplayer[THISACTOR].ammo_amount 4 TEMPVAR
         setvar TEMPVAR4 RPGAMMOBOX
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags state checkdoublepickupbonus
         setvar TEMPVAR5 16
         whilevarn TEMPVAR5 0
         {
          state rpgcheckammo
          subvar TEMPVAR5 1
         }
         setplayer[THISACTOR].ammo_amount 4 TEMPVAR

         state calcitemremains_weaponammo

         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 PLAYERWEAPONBITFIELD 4 state itemfullbright else { state shadepulse setactor[THISACTOR].shade shade }
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      ifcanseetarget
      {
       getplayer[THISACTOR].gotweapon 2 TEMPVAR2
       ifvare TEMPVAR2 0
       {
        state checkexplodeflag

        getplayer[THISACTOR].ammo_amount 2 TEMPVAR
        ifspawnedby PIGCOP
        {
         ifrnd 85 setvar TEMPVAR4 4
         else ifrnd 85 setvar TEMPVAR4 3
         else ifrnd 128 setvar TEMPVAR4 2
         else setvar TEMPVAR4 1
        }
        else setvar TEMPVAR4 SHOTGUNAMMOAMOUNT
        setvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        ifvarg ACTORPICKUPAMOUNT 0
        {
         addweapon SHOTGUN_WEAPON 0
         addvarvar TEMPVAR TEMPVAR4
         ifvarvarg TEMPVAR MAXSHOTGUN setvarvar TEMPVAR MAXSHOTGUN
         subvar ACTORPICKUPAMOUNT 1
        }
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         state shotguncheckammo
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 2 TEMPVAR

        state calcitemremains_weaponammo

        ifvarand ACTORFLAGS 2 nullop else { setvarvar fta fta_normal setvar ftq 57 }
        ifspawnedby SHOTGUNSPRITE state getweaponcode else state quikweaponget
       }
       else
       {
        getplayer[THISACTOR].ammo_amount 2 TEMPVAR
        ifvarvarl TEMPVAR MAXSHOTGUN
        {
         state checkexplodeflag

         getplayer[THISACTOR].ammo_amount 2 TEMPVAR
         ifspawnedby PIGCOP
         {
          ifrnd 85 setvar TEMPVAR4 4
          else ifrnd 85 setvar TEMPVAR4 3
          else ifrnd 128 setvar TEMPVAR4 2
          else setvar TEMPVAR4 1
         }
         else setvar TEMPVAR4 SHOTGUNAMMOAMOUNT
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags state checkdoublepickupbonus
         setvar TEMPVAR5 16
         whilevarn TEMPVAR5 0
         {
          state shotguncheckammo
          subvar TEMPVAR5 1
         }
         setplayer[THISACTOR].ammo_amount 2 TEMPVAR

         state calcitemremains_weaponammo

         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 PLAYERWEAPONBITFIELD 2 state itemfullbright else { state shadepulse setactor[THISACTOR].shade shade }
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      ifcanseetarget
      {
       getplayer[THISACTOR].gotweapon 1 TEMPVAR2
       ifvare TEMPVAR2 0
       {
        state checkexplodeflag

        getplayer[THISACTOR].ammo_amount 1 TEMPVAR
        setvar TEMPVAR4 48
        setvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        ifvarg ACTORPICKUPAMOUNT 0
        {
         addweapon PISTOL_WEAPON 0
         addvarvar TEMPVAR TEMPVAR4
         ifvarvarg TEMPVAR MAXPISTOL setvarvar TEMPVAR MAXPISTOL
         subvar ACTORPICKUPAMOUNT 1
        }
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         state pistolcheckammo
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 1 TEMPVAR

        state calcitemremains_weaponammo

        state getweaponcode
       }
       else
       {
        getplayer[THISACTOR].ammo_amount 1 TEMPVAR
        ifvarvarl TEMPVAR MAXPISTOL
        {
         state checkexplodeflag

         getplayer[THISACTOR].ammo_amount 1 TEMPVAR
         setvar TEMPVAR4 48
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags state checkdoublepickupbonus
         setvar TEMPVAR5 16
         whilevarn TEMPVAR5 0
         {
          state pistolcheckammo
          subvar TEMPVAR5 1
         }
         setplayer[THISACTOR].ammo_amount 1 TEMPVAR

         state calcitemremains_weaponammo

         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 PLAYERWEAPONBITFIELD 256 state itemfullbright else { state shadepulse setactor[THISACTOR].shade shade }
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      ifcanseetarget
      {
       getplayer[THISACTOR].gotweapon 8 TEMPVAR2
       ifvare TEMPVAR2 0
       {
        state checkexplodeflag
        
        getplayer[THISACTOR].ammo_amount 8 TEMPVAR
        setvar TEMPVAR4 1
        setvarvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        ifvarg ACTORPICKUPAMOUNT 0
        {
         addweapon TRIPBOMB_WEAPON 0
         addvarvar TEMPVAR TEMPVAR4
         ifvarvarg TEMPVAR MAXTRIPBOMB setvarvar TEMPVAR MAXTRIPBOMB
         subvar ACTORPICKUPAMOUNT 1
        }
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         ifvarvarl TEMPVAR MAXTRIPBOMB ifvarg ACTORPICKUPAMOUNT 0
         {
          addvar TEMPVAR 1
          ifvarvarg TEMPVAR MAXTRIPBOMB setvarvar TEMPVAR MAXTRIPBOMB
          subvar ACTORPICKUPAMOUNT 1
         }
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 8 TEMPVAR

        state calcitemremains_weaponammo

        ifvarand ACTORFLAGS 2 nullop else { setvarvar fta fta_normal setvar ftq 58 }
        ifspawnedby TRIPBOMBSPRITE state getweaponcode else state quikweaponget
       }
       else
       {
        getplayer[THISACTOR].ammo_amount 8 TEMPVAR
        ifvarvarl TEMPVAR MAXTRIPBOMB
        {
         state checkexplodeflag
	
         getplayer[THISACTOR].ammo_amount 8 TEMPVAR
         setvar TEMPVAR4 1
         setvarvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags state checkdoublepickupbonus
         setvar TEMPVAR5 16
         whilevarn TEMPVAR5 0
         {
          ifvarvarl TEMPVAR MAXTRIPBOMB ifvarg ACTORPICKUPAMOUNT 0
          {
           addvar TEMPVAR 1
           ifvarvarg TEMPVAR MAXTRIPBOMB setvarvar TEMPVAR MAXTRIPBOMB
           subvar ACTORPICKUPAMOUNT 1
          }
          subvar TEMPVAR5 1
         }
         setplayer[THISACTOR].ammo_amount 8 TEMPVAR
 
         state calcitemremains_weaponammo
 
         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 PLAYERWEAPONBITFIELD 8 state itemfullbright else { state shadepulse setactor[THISACTOR].shade shade }
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      ifcanseetarget
      {
       getplayer[THISACTOR].gotweapon 3 TEMPVAR2
       ifvare TEMPVAR2 0
       {
        state checkexplodeflag
        
        getplayer[THISACTOR].ammo_amount 3 TEMPVAR
        setvar TEMPVAR4 CHAINGUNAMMOAMOUNT
        setvarvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        ifvarg ACTORPICKUPAMOUNT 0
        {
         addweapon CHAINGUN_WEAPON 0
         addvarvar TEMPVAR TEMPVAR4
         ifvarvarg TEMPVAR MAXCHAINGUN setvarvar TEMPVAR MAXCHAINGUN
         subvar ACTORPICKUPAMOUNT 1
        }
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         state chainguncheckammo
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 3 TEMPVAR

        state calcitemremains_weaponammo

        ifvarand ACTORFLAGS 2 nullop else { setvarvar fta fta_normal setvar ftq 54 }
        ifspawnedby CHAINGUNSPRITE state getweaponcode else state quikweaponget
       }
       else
       {
        getplayer[THISACTOR].ammo_amount 3 TEMPVAR
        ifvarvarl TEMPVAR MAXCHAINGUN
        {
         state checkexplodeflag
	
         getplayer[THISACTOR].ammo_amount 3 TEMPVAR
         setvar TEMPVAR4 CHAINGUNAMMOAMOUNT
         setvarvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags state checkdoublepickupbonus
         setvar TEMPVAR5 16
         whilevarn TEMPVAR5 0
         {
          state chainguncheckammo
          subvar TEMPVAR5 1
         }
         setplayer[THISACTOR].ammo_amount 3 TEMPVAR
 
         state calcitemremains_weaponammo

         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 PLAYERWEAPONBITFIELD 64 state itemfullbright else { state shadepulse setactor[THISACTOR].shade shade }
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      ifcanseetarget
      {
       getplayer[THISACTOR].gotweapon 6 TEMPVAR2
       ifvare TEMPVAR2 0
       {
        state checkexplodeflag

        getplayer[THISACTOR].ammo_amount 6 TEMPVAR
        setvar TEMPVAR4 10
        setvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        ifvarg ACTORPICKUPAMOUNT 0
        {
         addweapon SHRINKER_WEAPON 0
         addvarvar TEMPVAR TEMPVAR4
         ifvarvarg TEMPVAR MAXSHRINKER setvarvar TEMPVAR MAXSHRINKER
         subvar ACTORPICKUPAMOUNT 1
        }
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         state shrinkercheckammo
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 6 TEMPVAR

        state calcitemremains_weaponammo

        ifvarand ACTORFLAGS 2 nullop else { setvarvar fta fta_normal setvar ftq 60 }
        ifspawnedby SHRINKERSPRITE state getweaponcode else state quikweaponget
       }
       else
       {        
        getplayer[THISACTOR].ammo_amount 6 TEMPVAR
        ifvarvarl TEMPVAR MAXSHRINKER
        {
         state checkexplodeflag

         getplayer[THISACTOR].ammo_amount 6 TEMPVAR
         setvar TEMPVAR4 10
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags state checkdoublepickupbonus
         setvar TEMPVAR5 16
         whilevarn TEMPVAR5 0
         {
          state shrinkercheckammo
          subvar TEMPVAR5 1
         }
         setplayer[THISACTOR].ammo_amount 6 TEMPVAR

         state calcitemremains_weaponammo

         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 PLAYERWEAPONBITFIELD 512 state itemfullbright else { state shadepulse setactor[THISACTOR].shade shade }
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      ifcanseetarget
      {
       getplayer[THISACTOR].gotweapon 9 TEMPVAR2
       ifvare TEMPVAR2 0
       {
        state checkexplodeflag

        getplayer[THISACTOR].ammo_amount 9 TEMPVAR
        setvar TEMPVAR4 FREEZEAMMOAMOUNT
        setvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        ifvarg ACTORPICKUPAMOUNT 0
        {
         addweapon FREEZE_WEAPON 0
         addvarvar TEMPVAR TEMPVAR4
         ifvarvarg TEMPVAR MAXFREEZER setvarvar TEMPVAR MAXFREEZER
         subvar ACTORPICKUPAMOUNT 1
        }
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         state freezercheckammo
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 9 TEMPVAR

        state calcitemremains_weaponammo

        ifvarand ACTORFLAGS 2 nullop else { setvarvar fta fta_normal setvar ftq 59 }
        ifspawnedby FREEZESPRITE state getweaponcode else state quikweaponget
       }
       else
       {        
        getplayer[THISACTOR].ammo_amount 9 TEMPVAR
        ifvarvarl TEMPVAR MAXFREEZER
        {
         state checkexplodeflag

         getplayer[THISACTOR].ammo_amount 9 TEMPVAR
         setvar TEMPVAR4 FREEZEAMMOAMOUNT
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags state checkdoublepickupbonus
         setvar TEMPVAR5 16
         whilevarn TEMPVAR5 0
         {
          state freezercheckammo
          subvar TEMPVAR5 1
         }
         setplayer[THISACTOR].ammo_amount 9 TEMPVAR

         state calcitemremains_weaponammo

         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 PLAYERWEAPONBITFIELD 128 state itemfullbright else { state shadepulse setactor[THISACTOR].shade shade }
 ifvarand ACTORFLAGS 8 nullop
 else
 {
  ifmove RESPAWN_ACTOR_FLAG state respawnit
  else
   ifvare mainmenu 0
   {
    ifp pshrunk nullop
    else
    {
     ifvarg CURRENTHITPOINTS 0 ifcount 6 ifpdistl RETRIEVEDISTANCE
     {
      ifcanseetarget
      {
       getplayer[THISACTOR].gotweapon 7 TEMPVAR2
       ifvare TEMPVAR2 0
       {
        state checkexplodeflag

        getplayer[THISACTOR].ammo_amount 7 TEMPVAR
        setvar TEMPVAR4 DEVISTATORAMMOAMOUNT
        setvar ACTORPICKUPAMOUNT 1
        state checkpickupamountflags state checkdoublepickupbonus
        ifvarg ACTORPICKUPAMOUNT 0
        {
         addweapon DEVISTATOR_WEAPON 0
         addvarvar TEMPVAR TEMPVAR4
         ifvarvarg TEMPVAR MAXDEVASTATOR setvarvar TEMPVAR MAXDEVASTATOR
         subvar ACTORPICKUPAMOUNT 1
        }
        setvar TEMPVAR5 16
        whilevarn TEMPVAR5 0
        {
         state devastatorcheckammo
         subvar TEMPVAR5 1
        }
        setplayer[THISACTOR].ammo_amount 7 TEMPVAR
 
        state calcitemremains_weaponammo

        ifvarand ACTORFLAGS 2 nullop else { setvarvar fta fta_normal setvar ftq 87 }
        ifspawnedby DEVISTATORSPRITE state getweaponcode else state quikweaponget
       }
       else
       {
        getplayer[THISACTOR].ammo_amount 7 TEMPVAR
        ifvarvarl TEMPVAR MAXDEVASTATOR
        {
         state checkexplodeflag

         getplayer[THISACTOR].ammo_amount 7 TEMPVAR
         setvar TEMPVAR4 DEVISTATORAMMOAMOUNT
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags state checkdoublepickupbonus
         setvar TEMPVAR5 16
         whilevarn TEMPVAR5 0
         {
          state devastatorcheckammo
          subvar TEMPVAR5 1
         }
         setplayer[THISACTOR].ammo_amount 7 TEMPVAR
 
         state calcitemremains_weaponammo

         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

          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            ifvarg tempe 1
            {
             redefinequote 836 ^20%d SMALL MEDKITS: +%d HP ^14[+%d ADDED TO INVENTORY!]
             qsprintf 836 836 tempe TEMPHEALTH ACTORPICKUPAMOUNT
            }
            else
            {
             redefinequote 836 ^20SMALL MEDKIT: +%d HP ^14[+%d ADDED TO INVENTORY!]            
             qsprintf 836 836 TEMPHEALTH ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           else
           {
            ifvarg tempe 1
            {
             redefinequote 836 ^20%d SMALL MEDKITS: +%d HP
             qsprintf 836 836 tempe TEMPHEALTH
             setvarvar fta fta_normal setvar ftq 836
            }
            else
            {
             ifvare oldskoolmode 0 qsprintf 61 252 TEMPHEALTH
             setvarvar fta fta_normal setvar ftq 61
            }
           }
           state playerstealjustbeforemonster
          }
      	    ifspawnedby COLA
	     state getcode
          else
           state quikget
ends

state pickupvehicle_cola
          state checkexplodeflag

          state medikitvehicle

          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            ifvarg tempe 1
            {
             redefinequote 836 ^15%d SMALL MEDKITS [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
             qsprintf 836 836 tempe ACTORPICKUPAMOUNT
            }
            else
            {
             redefinequote 836 ^15SMALL MEDKIT [VEHICLE] ^14[+%d ADDED TO INVENTORY!]            
             qsprintf 836 836 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           else
           {
            ifvarg tempe 1
            {
             redefinequote 836 ^15%d SMALL MEDKITS [VEHICLE]
             qsprintf 836 836 tempe
             setvarvar fta fta_normal setvar ftq 836
            }
            else
            {
             redefinequote 836 ^15GRABBED A SMALL MEDIKIT FOR YOUR VEHICLE!
             setvarvar fta fta_normal setvar ftq 836
            }
           }
           state playerstealjustbeforemonster
          }
      	    ifspawnedby COLA
	     state getcode
          else
           state quikget
ends

state pickupinventory_cola
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag

           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags state checkdoublepickupbonus
           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
            state playerstealjustbeforemonster
           }
           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
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            ifvarg tempe 1
            {
             redefinequote 836 ^20%d LARGE MEDKITS: +%d HP ^14[+%d ADDED TO INVENTORY!]
             qsprintf 836 836 tempe TEMPHEALTH ACTORPICKUPAMOUNT
            }
            else
            {
             redefinequote 836 ^20LARGE MEDKIT: +%d HP ^14[+%d ADDED TO INVENTORY!]            
             qsprintf 836 836 TEMPHEALTH ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           else
           {
            ifvarg tempe 1
            {
             redefinequote 836 ^20%d LARGE MEDKITS: +%d HP
             qsprintf 836 836 tempe TEMPHEALTH
             setvarvar fta fta_normal setvar ftq 836
            }
            else
            {
             ifvare oldskoolmode 0 qsprintf 62 252 TEMPHEALTH
             setvarvar fta fta_normal setvar ftq 62
            }
           }
           state playerstealjustbeforemonster
          }
          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
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            ifvarg tempe 1
            {
             redefinequote 836 ^15%d LARGE MEDKITS [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
             qsprintf 836 836 tempe ACTORPICKUPAMOUNT
            }
            else
            {
             redefinequote 836 ^15LARGE MEDKIT [VEHICLE] ^14[+%d ADDED TO INVENTORY!]            
             qsprintf 836 836 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           else
           {
            ifvarg tempe 1
            {
             redefinequote 836 ^15%d LARGE MEDKITS [VEHICLE]
             qsprintf 836 836 tempe
             setvarvar fta fta_normal setvar ftq 836
            }
            else
            {
             redefinequote 836 ^15GRABBED A LARGE MEDIKIT FOR YOUR VEHICLE!
             setvarvar fta fta_normal setvar ftq 836
            }
           }
           state playerstealjustbeforemonster
          }
          ifspawnedby SIXPAK
           state getcode
          else
           state quikget
ends

state pickupinventory_sixpak
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags state checkdoublepickupbonus
           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
            state playerstealjustbeforemonster
           }
           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 atomduke2
              ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC ifvarg ACTORPICKUPAMOUNT 0
              {
               setvarvar TEMP7 MAXHITPOINTSATOMIC state checksecretrecipes setvarvar TEMPHEALTH TEMP7
               setvarvar CURRENTHITPOINTS MAXHITPOINTSATOMIC
               state showhealing_playerhp
               subvar ACTORPICKUPAMOUNT 1
               addvar tempe 1
              }
ends

state atomduke
              
              setvar TEMPHEALTH 0
              setvar ACTORPICKUPAMOUNT 1
              state checkpickupamountflags state checkdoublepickupbonus
	  	 setvar tempe 0

              setvar TEMPVAR5 16
              whilevarn TEMPVAR5 0
              {
               state atomduke2
               subvar TEMPVAR5 1
              }
              addvarvar ATOMICHEALTHS ACTORPICKUPAMOUNT

   	        ifvarand ACTORFLAGS 2 nullop
              else
              {
               ifvarg ACTORPICKUPAMOUNT 0
               {
                globalsound FOUND_INVENTORY
                ifvarg tempe 1
                {
                 redefinequote 836 ^20%d ATOMIC HEALTHS: HP BECOMES 200%! ^14[+%d ADDED TO INVENTORY!]
                 qsprintf 836 836 tempe ACTORPICKUPAMOUNT
                 setvarvar fta fta_normal setvar ftq 836
                }
                else
                {
                 redefinequote 836 ^20ATOMIC HEALTH: HP BECOMES 200%! ^14[+%d ADDED TO INVENTORY!]
                 qsprintf 836 836 ACTORPICKUPAMOUNT
                 setvarvar fta fta_normal setvar ftq 836
                }
               }
               else
               {
                ifvarg tempe 1
                {
                 redefinequote 836 ^20%d ATOMIC HEALTHS: HP BECOMES 200%!
                 qsprintf 836 836 tempe
                 setvarvar fta fta_normal setvar ftq 836
                }
                else
                {
                 redefinequote 836 ^20ATOMIC HEALTH: HP BECOMES 200%!
                 setvarvar fta fta_normal setvar ftq 836
                }
               }
               setvar PLAYERHPDAMAGED? -1
               state playerstealjustbeforemonster
              }
ends

state atomnormal2
              ifvarvarl TEMPHEALTH tempb ifvarg ACTORPICKUPAMOUNT 0
              {
               setvar TEMP7 500 state checksecretrecipes addvarvar TEMPHEALTH TEMP7
               subvar ACTORPICKUPAMOUNT 1
               addvar tempe 1
              }
ends

state atomnormal
              // TEMP4 = Maximum HP % to reach
              // tempb = becomes the % of health needed to heal to reach TEMP4 [tempb - TEMPARMOR = tempb]
	  	 setvar tempb 2000
              setvar TEMP4 2000
	  	 setvarvar TEMPARMOR CURRENTHITPOINTS
              mulvar TEMPARMOR 1000
	  	 divvarvar TEMPARMOR MAXHITPOINTS
              subvarvar tempb TEMPARMOR

              setvar TEMPHEALTH 0
              setvar ACTORPICKUPAMOUNT 1
              state checkpickupamountflags state checkdoublepickupbonus
	  	 setvar tempe 0

              setvar TEMPVAR5 16
              whilevarn TEMPVAR5 0
              {
               state atomnormal2
               subvar TEMPVAR5 1
              }
              addvarvar ATOMICHEALTHS ACTORPICKUPAMOUNT

              mulvarvar TEMPHEALTH MAXHITPOINTS
              divvar TEMPHEALTH 1000

              addvarvar CURRENTHITPOINTS TEMPHEALTH
              ifvarvarg CURRENTHITPOINTS MAXHITPOINTSATOMIC setvarvar CURRENTHITPOINTS MAXHITPOINTSATOMIC 
              state showhealing_playerhp

              ifvarand ACTORFLAGS 2 nullop
              else
              {
               ifvarg ACTORPICKUPAMOUNT 0
               {
                globalsound FOUND_INVENTORY
                ifvarg tempe 1
                {
                 redefinequote 836 ^20%d ATOMIC HEALTHS: +%d HP ^14[+%d ADDED TO INVENTORY!]
                 qsprintf 836 836 tempe TEMPHEALTH ACTORPICKUPAMOUNT
                 setvarvar fta fta_normal setvar ftq 836
                }
                else
                {
                 redefinequote 836 ^20%ATOMIC HEALTH: +%d HP ^14[+%d ADDED TO INVENTORY!]
                 qsprintf 836 836 TEMPHEALTH ACTORPICKUPAMOUNT
                 setvarvar fta fta_normal setvar ftq 836
                }
               }
               else
               {
                ifvarg tempe 1
                {
                 redefinequote 836 ^20%d ATOMIC HEALTHS: +%d HP
                 qsprintf 836 836 tempe TEMPHEALTH
                 setvarvar fta fta_normal setvar ftq 836
                }
                else
                {
                 ifvare oldskoolmode 0 qsprintf 19 260 TEMPHEALTH
                 setvarvar fta fta_normal setvar ftq 19
                }
               }
               setvar PLAYERHPDAMAGED? -1
               state playerstealjustbeforemonster
              }
ends

state pickupcharacter_atom
            state checkexplodeflag
            state gotmedsyoureallyneeded

            ifvare CHARACTERSELECTED? 1 // If Duke grabs the Atomic Health
            {
             ifvare oldskoolmode 0 state atomduke 
             else state atomnormal
            }
            else state atomnormal // Other Characters Get normal +50% HP recovery

            ifspawnedby ATOMICHEALTH state getcode else state quikget
ends

state pickupvehicle_atom
            state checkexplodeflag
            state gotmedsyoureallyneeded

            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR3
            // TEMP4 = Maximum HP % to reach
            // tempb = becomes the % of health needed to heal to reach TEMP4 [tempb - TEMPARMOR = tempb]
            setvar tempb 2000
            setvar TEMP4 2000
            setvarvar TEMPARMOR TEMPVAR4
            mulvar TEMPARMOR 1000
            divvarvar TEMPARMOR TEMPVAR3
            subvarvar tempb TEMPARMOR

            setvar TEMPHEALTH 0
            setvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags state checkdoublepickupbonus
  	      setvar tempe 0

            setvar TEMPVAR2 8
            whilevarn TEMPVAR2 0
            {
             state atomnormal2
             subvar TEMPVAR2 1
            }
            addvarvar ATOMICHEALTHS ACTORPICKUPAMOUNT

            mulvarvar TEMPHEALTH TEMPVAR3
            divvar TEMPHEALTH 1000

            addvarvar TEMPVAR4 TEMPHEALTH
            ifvarvarg TEMPVAR4 TEMPVAR5 setvarvar TEMPVAR4 TEMPVAR5
            setactorvar[tempvehicleid].ENEMYHP TEMPVAR4
            state showhealing_playerhp

            ifvarand ACTORFLAGS 2 nullop
            else
            {
             ifvarg ACTORPICKUPAMOUNT 0
             {
              globalsound FOUND_INVENTORY
              ifvarg tempe 1
              {
               redefinequote 836 ^15%d ATOMIC HEALTHS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
               qsprintf 836 836 tempe ACTORPICKUPAMOUNT
               setvarvar fta fta_normal setvar ftq 836
              }
              else
              {
               redefinequote 836 ^15ATOMIC HEALTH! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
               qsprintf 836 836 ACTORPICKUPAMOUNT
               setvarvar fta fta_normal setvar ftq 836
              }
             }
             else
             {
              ifvarg tempe 1
              {
               redefinequote 836 ^15%d ATOMIC HEALTHS! [VEHICLE]
               qsprintf 836 836 tempe
               setvarvar fta fta_normal setvar ftq 836
              }
              else
              {
               redefinequote 836 ^15COLLECTED AN ATOMIC HEALTH FOR YOUR VEHICLE!
               setvarvar fta fta_normal setvar ftq 836
              }
             }
             setvar VEHICLEHPDAMAGED? -1
             state playerstealjustbeforemonster
            }
            ifspawnedby ATOMICHEALTH state getcode else state quikget
ends

state pickupinventory_atom
           ifvarn oldskoolmode 1
           {
            state checkexplodeflag
            setvarvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags state checkdoublepickupbonus
            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
             state playerstealjustbeforemonster
            }
            globalsound FOUND_INVENTORY
      	      ifspawnedby ATOMICHEALTH
	       state getcode
            else
             state quikget
           }
ends

eventloadactor ATOMICHEALTH state setpickupflags enda
actor ATOMICHEALTH

  ifvare FLAGSSET? 0
  {
   ifvarand ACTORFLAGS 128 setvar FLAGSSET? 1
   ifvarand ACTORFLAGS 256 setvar FLAGSSET? 1
   ifvare PUBLICBETA? 1
   {
    ifvare oldskoolmode 0
    {
     ifrnd 64
     {
      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
   setactor[RETURN].pal 16
   setactorvar[RETURN].FLAGSSET? 1
   killit 
  }
  ifspritepal 12 // An AtomicHealth with a spritepal of 12 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 // No Vehicle [Character Only]
         {
          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

    ifvarg ITEMSEEKB 0 ifvarvarl ITEMSEEKB ITEMENEMYMAXHPATOMIC
    {
     state checkexplodeflag

     getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR3
     // TEMP4 = Maximum HP % to reach
     // tempb = becomes the % of health needed to heal to reach TEMP4 [tempb - TEMPARMOR = tempb]
     setvar tempb 2000
     setvar TEMP4 2000
     setvarvar TEMPARMOR ITEMSEEKB
     mulvar TEMPARMOR 1000
     divvarvar TEMPARMOR ITEMENEMYMAXHP
     subvarvar tempb TEMPARMOR

     setvar ITEMSEEKC 0
     setvar ACTORPICKUPAMOUNT 1
     state checkpickupamountflags
     setvar tempe 0

     setvar TEMPVAR5 16
     whilevarn TEMPVAR5 0
     {
      ifvarvarl ITEMSEEKC tempb ifvarg ACTORPICKUPAMOUNT 0
      {
       addvar ITEMSEEKC 500
       subvar ACTORPICKUPAMOUNT 1
       addvar tempe 1
      }
      subvar TEMPVAR5 1
     }

     mulvarvar ITEMSEEKC ITEMENEMYMAXHP
     divvar ITEMSEEKC 1000

     addvarvar ITEMSEEKB ITEMSEEKC
     ifvarvarg ITEMSEEKB ITEMENEMYMAXHPATOMIC setvarvar ITEMSEEKB ITEMENEMYMAXHPATOMIC
     setactorvar[ITEMSEEK].ENEMYHP ITEMSEEKB
     state showhealing_actorhp

     state resetitemtarget
     state getitemseekerspecies

     ifvarg ACTORPICKUPAMOUNT 7
     {
      espawn ATOMICHEALTH setactorvar[RETURN].FLAGSSET? 1 setactorvar[RETURN].ACTORFLAGS 384 state scatterdrops
      subvar ACTORPICKUPAMOUNT 8
     }
     ifvarg ACTORPICKUPAMOUNT 3
     {
      espawn ATOMICHEALTH setactorvar[RETURN].FLAGSSET? 1 setactorvar[RETURN].ACTORFLAGS 256 state scatterdrops
      subvar ACTORPICKUPAMOUNT 4
     }
     ifvarg ACTORPICKUPAMOUNT 1
     {
      espawn ATOMICHEALTH setactorvar[RETURN].FLAGSSET? 1 setactorvar[RETURN].ACTORFLAGS 128 state scatterdrops
      subvar ACTORPICKUPAMOUNT 2
     }
     ifvare ACTORPICKUPAMOUNT 1
     {
      espawn ATOMICHEALTH setactorvar[RETURN].FLAGSSET? 1 state scatterdrops
      subvar ACTORPICKUPAMOUNT 1
     }

     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 state checkdoublepickupbonus
               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
                state playerstealjustbeforemonster
               }
               globalsound FOUND_INVENTORY
               ifspawnedby FIRSTAID
                state getcode
               else
                state quikget
              }
ends

state minakograb_firstaid
             state checkexplodeflag

             setvar ACTORPICKUPAMOUNT 1
             state checkpickupamountflags state checkdoublepickupbonus

             setvarvar TEMPVAR MAXHITPOINTS
             mulvar TEMPVAR 3
             divvar TEMPVAR 2 

             setvarvar FIRSTAIDCURRENT TEMPVAR

             subvar ACTORPICKUPAMOUNT 1
             addvarvar PORTABLEMEDIKITS ACTORPICKUPAMOUNT

   	       ifvarand ACTORFLAGS 2 nullop
             else
             {
              ifvarg ACTORPICKUPAMOUNT 0
              {
               globalsound FOUND_INVENTORY
               redefinequote 836 ^20PORTABLE MEDIKIT ^14[+%d ADDED TO INVENTORY!]
               qsprintf 836 836 ACTORPICKUPAMOUNT
               setvarvar fta fta_normal setvar ftq 836
              }
              else setvarvar fta fta_normal setvar ftq 3
              setvar DISPLAYFAFLASHTIMER -28
              state playerstealjustbeforemonster
             }	
             ifspawnedby FIRSTAID
              state getcode
             else
              state quikget
ends

state othersgrab_firstaid
             state checkexplodeflag

             setvar ACTORPICKUPAMOUNT 1
             state checkpickupamountflags state checkdoublepickupbonus

	       setvarvar FIRSTAIDCURRENT MAXHITPOINTS

             subvar ACTORPICKUPAMOUNT 1
             addvarvar PORTABLEMEDIKITS ACTORPICKUPAMOUNT

   	       ifvarand ACTORFLAGS 2 nullop
             else
             {
              ifvarg ACTORPICKUPAMOUNT 0
              {
               globalsound FOUND_INVENTORY
               redefinequote 836 ^20PORTABLE MEDIKIT ^14[+%d ADDED TO INVENTORY!]
               qsprintf 836 836 ACTORPICKUPAMOUNT
               setvarvar fta fta_normal setvar ftq 836
              }
              else setvarvar fta fta_normal setvar ftq 3
              setvar DISPLAYFAFLASHTIMER -28
              state playerstealjustbeforemonster
             }	
	       ifspawnedby FIRSTAID
	        state getcode
	       else
	        state quikget
ends

state vehiclegrab_firstaid
             state checkexplodeflag

             setvar ACTORPICKUPAMOUNT 1
             state checkpickupamountflags state checkdoublepickupbonus

             setvarvar TEMPVAR4 TEMPVAR5
             setactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
             setactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5

             subvar ACTORPICKUPAMOUNT 1
             addvarvar PORTABLEMEDIKITS ACTORPICKUPAMOUNT

   	       ifvarand ACTORFLAGS 2 nullop
             else
             {
              ifvarg ACTORPICKUPAMOUNT 0
              {
               globalsound FOUND_INVENTORY
               redefinequote 836 ^15PORTABLE MEDIKIT ^14[+%d ADDED TO INVENTORY!]
               qsprintf 836 836 ACTORPICKUPAMOUNT
               setvarvar fta fta_normal setvar ftq 836
              }
              else
              {
               redefinequote 836 ^15PICKED UP A PORTABLE MEDIKIT FOR YOUR VEHICLE!
  	         setvarvar fta fta_normal setvar ftq 836
              }
              setactorvar[PLAYERID].VDISPLAYFAFLASHTIMER -28
              state playerstealjustbeforemonster
             }	
	       ifspawnedby FIRSTAID
	        state getcode
	     	else
	     	 state quikget
ends

eventloadactor FIRSTAID state setpickupflags enda
actor FIRSTAID

 ifvare FLAGSSET? 0
 {
  ifvarand ACTORFLAGS 128 setvar FLAGSSET? 1
  ifvarand ACTORFLAGS 256 setvar FLAGSSET? 1
  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 minakograb_firstaid
            else state pickupinventory_firstaid
           }
           else
           {
            ifvarvarl FIRSTAIDCURRENT MAXHITPOINTS state othersgrab_firstaid
            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 minakograb_firstaid
             else state pickupinventory_firstaid
            }
            else
            {
             ifvarvarl FIRSTAIDCURRENT MAXHITPOINTS state othersgrab_firstaid
             else state pickupinventory_firstaid
            }
           }
          }
          ifvare vehiclepickuptoggle 1 // Vehicle Only
          {
           ifcanseetarget
           {
            getactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
            getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
            ifvarvarl TEMPVAR4 TEMPVAR5 state vehiclegrab_firstaid
            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 minakograb_firstaid
             else
             {
              getactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
              getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
              ifvarvarl TEMPVAR4 TEMPVAR5 state vehiclegrab_firstaid
              else state pickupinventory_firstaid
             }
            }
            else
            {
             ifvarvarl FIRSTAIDCURRENT MAXHITPOINTS state othersgrab_firstaid
             else
             {
              getactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
              getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
              ifvarvarl TEMPVAR4 TEMPVAR5 state vehiclegrab_firstaid
              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 vehiclegrab_firstaid
            else
            {
             ifvare CHARACTERSELECTED? 13
             {
              setvarvar TEMPVAR MAXHITPOINTS mulvar TEMPVAR 3 divvar TEMPVAR 2
              ifvarvarl FIRSTAIDCURRENT TEMPVAR state minakograb_firstaid
              else state pickupinventory_firstaid
             }
             else
             {
              ifvarvarl FIRSTAIDCURRENT MAXHITPOINTS state othersgrab_firstaid
              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

            setvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags

            setactorvar[ITEMSEEK].ENEMYFIRSTAID ENEMYFIRSTAIDMAX

            state resetitemtarget
            state getitemseekerspecies
            subvar ACTORPICKUPAMOUNT 1

            ifvarg ACTORPICKUPAMOUNT 7
            {
             espawn FIRSTAID setactorvar[RETURN].FLAGSSET? 1 setactorvar[RETURN].ACTORFLAGS 384 state scatterdrops
             subvar ACTORPICKUPAMOUNT 8
            }
            ifvarg ACTORPICKUPAMOUNT 3
            {
             espawn FIRSTAID setactorvar[RETURN].FLAGSSET? 1 setactorvar[RETURN].ACTORFLAGS 256 state scatterdrops
             subvar ACTORPICKUPAMOUNT 4
            }
            ifvarg ACTORPICKUPAMOUNT 1
            {
             espawn FIRSTAID setactorvar[RETURN].FLAGSSET? 1 setactorvar[RETURN].ACTORFLAGS 128 state scatterdrops
             subvar ACTORPICKUPAMOUNT 2
            }
            ifvare ACTORPICKUPAMOUNT 1
            {
             espawn FIRSTAID setactorvar[RETURN].FLAGSSET? 1 state scatterdrops
             subvar ACTORPICKUPAMOUNT 1
            }

            ifvarand ACTORFLAGS 4 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

state energyitemsounds
               ifrnd 85 globalsound CANOPENED1
               else ifrnd 128 globalsound CANOPENED2
               else globalsound CANOPENED3
               ifrnd 128 globalsound SODAFIZZ1
               else globalsound SODAFIZZ2
ends

// Small Energy Drink
eventloadactor SMALLENERGYDRINK state setpickupflags enda
useractor notenemy SMALLENERGYDRINK
 setvar ACTORSHEIGHT 152 setvar ACTORSWIDTH 54
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 sizeat 4 4

 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
        {
         ifvarvarl CURRENTENERGYPOINTS MAXENERGYPOINTS // If you need energy immediately, grab item
         {
          state checkexplodeflag

          setvarvar TEMPVAR4 MAXENERGYPOINTS
          mulvar TEMPVAR4 222
          divvar TEMPVAR4 1000
          addvar TEMPVAR4 75
          addlogvar TEMPVAR4

          setvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags state checkdoublepickupbonus
          setvar TEMPVAR5 16
          whilevarn TEMPVAR5 0
          {
           ifvarvarl CURRENTENERGYPOINTS MAXENERGYPOINTS ifvarg ACTORPICKUPAMOUNT 0
           {
            state energyitemsounds
            addvarvar CURRENTENERGYPOINTS TEMPVAR4
            ifvarvarg CURRENTENERGYPOINTS MAXENERGYPOINTS setvarvar CURRENTENERGYPOINTS MAXENERGYPOINTS
            subvar ACTORPICKUPAMOUNT 1
           }
           subvar TEMPVAR5 1
          }
          addvarvar SMALLENERGYDRINKS ACTORPICKUPAMOUNT

          ifvare oldskoolmode 0 qsprintf 62 255 TEMPHEALTH
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            ifvarg tempe 1
            {
             redefinequote 836 ^20%d SMALL ENERGY DRINKS: +%d EP ^14[+%d ADDED TO INVENTORY!]
             qsprintf 836 836 tempe TEMPVAR4 ACTORPICKUPAMOUNT
            }
            else
            {
             redefinequote 836 ^20SMALL ENERGY DRINK: +%d EP ^14[+%d ADDED TO INVENTORY!]            
             qsprintf 836 836 TEMPVAR4 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           else
           {
            ifvarg tempe 1
            {
             redefinequote 836 ^20%d SMALL ENERGY DRINKS: +%d EP
             qsprintf 836 836 tempe TEMPVAR4
             setvarvar fta fta_normal setvar ftq 836
            }
            else
            {
             redefinequote 836 ^20SMALL ENERGY DRINK: +%d EP
             qsprintf 836 836 TEMPVAR4
             setvarvar fta fta_normal setvar ftq 836
            }
           }
           state playerstealjustbeforemonster
          }
    	    ifspawnedby SMALLENERGYDRINK state getcode else state quikget
         }
         else // If not, store in inventory
         {
          state checkexplodeflag
          setvarvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags state checkdoublepickupbonus
          addvarvar SMALLENERGYDRINKS ACTORPICKUPAMOUNT
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvare ACTORPICKUPAMOUNT 1
           {
            redefinequote 836 ^14 STORED A SMALL ENERGY DRINK INTO INVENTORY!
           }
           else
           {
            redefinequote 836 ^14 STORED %ld SMALL ENERGY DRINKS INTO INVENTORY!
            qsprintf 836 836 ACTORPICKUPAMOUNT
           }
           setvarvar fta fta_normal setvar ftq 836
           // state playerstealjustbeforemonster
           globalsound FOUND_INVENTORY
           ifspawnedby SMALLENERGYDRINK state getcode else state quikget
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
enda

// Large Energy Drink
eventloadactor LARGEENERGYDRINK state setpickupflags enda
useractor notenemy LARGEENERGYDRINK
 setvar ACTORSHEIGHT 203 setvar ACTORSWIDTH 116
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 sizeat 4 4

 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
        {
         ifvarvarl CURRENTENERGYPOINTS MAXENERGYPOINTS // If you need energy immediately, grab item
         {
          state checkexplodeflag

          setvarvar TEMPVAR4 MAXENERGYPOINTS
          mulvar TEMPVAR4 667
          divvar TEMPVAR4 1000
          addvar TEMPVAR4 225
          addlogvar TEMPVAR4

          setvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags state checkdoublepickupbonus
          setvar TEMPVAR5 16
          whilevarn TEMPVAR5 0
          {
           ifvarvarl CURRENTENERGYPOINTS MAXENERGYPOINTS ifvarg ACTORPICKUPAMOUNT 0
           {
            state energyitemsounds
            addvarvar CURRENTENERGYPOINTS TEMPVAR4
            ifvarvarg CURRENTENERGYPOINTS MAXENERGYPOINTS setvarvar CURRENTENERGYPOINTS MAXENERGYPOINTS
            subvar ACTORPICKUPAMOUNT 1
           }
           subvar TEMPVAR5 1
          }
          addvarvar LARGEENERGYDRINKS ACTORPICKUPAMOUNT

          ifvare oldskoolmode 0 qsprintf 62 255 TEMPHEALTH
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            ifvarg tempe 1
            {
             redefinequote 836 ^20%d LARGE ENERGY DRINKS: +%d EP ^14[+%d ADDED TO INVENTORY!]
             qsprintf 836 836 tempe TEMPVAR4 ACTORPICKUPAMOUNT
            }
            else
            {
             redefinequote 836 ^20LARGE ENERGY DRINK: +%d EP ^14[+%d ADDED TO INVENTORY!]            
             qsprintf 836 836 TEMPVAR4 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           else
           {
            ifvarg tempe 1
            {
             redefinequote 836 ^20%d LARGE ENERGY DRINKS: +%d EP
             qsprintf 836 836 tempe TEMPVAR4
             setvarvar fta fta_normal setvar ftq 836
            }
            else
            {
             redefinequote 836 ^20LARGE ENERGY DRINK: +%d EP
             qsprintf 836 836 TEMPVAR4
             setvarvar fta fta_normal setvar ftq 836
            }
           }
           state playerstealjustbeforemonster
          }
    	    ifspawnedby LARGEENERGYDRINK state getcode else state quikget
         }
         else // If not, store in inventory
         {
          state checkexplodeflag
          setvarvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags state checkdoublepickupbonus
          addvarvar LARGEENERGYDRINKS ACTORPICKUPAMOUNT
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvare ACTORPICKUPAMOUNT 1
           {
            redefinequote 836 ^14 STORED A LARGE ENERGY DRINK INTO INVENTORY!
           }
           else
           {
            redefinequote 836 ^14 STORED %ld LARGE ENERGY DRINKS INTO INVENTORY!
            qsprintf 836 836 ACTORPICKUPAMOUNT
           }
           setvarvar fta fta_normal setvar ftq 836
           // state playerstealjustbeforemonster
           globalsound FOUND_INVENTORY
           ifspawnedby LARGEENERGYDRINK state getcode else state quikget
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
enda

// Hyper Energy Drink
eventloadactor HYPERENERGYDRINK state setpickupflags enda
useractor notenemy HYPERENERGYDRINK
 setvar ACTORSHEIGHT 219 setvar ACTORSWIDTH 104
 state checkitemflags
 state checkitemflags2 // Checks Item Multiplications for Display Icon
 ifvare mainmenu 0 state fallflags
 sizeat 4 4

 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
        {
         ifvarvarl CURRENTENERGYPOINTS MAXENERGYPOINTSATOMIC // If you need energy immediately, grab item
         {
          state checkexplodeflag

          setvarvar TEMPVAR4 MAXENERGYPOINTSATOMIC
          addlogvar TEMPVAR4

          setvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags state checkdoublepickupbonus
          setvar TEMPVAR5 16
          whilevarn TEMPVAR5 0
          {
           ifvarvarl CURRENTENERGYPOINTS MAXENERGYPOINTSATOMIC ifvarg ACTORPICKUPAMOUNT 0
           {
            state energyitemsounds
            addvarvar CURRENTENERGYPOINTS TEMPVAR4
            ifvarvarg CURRENTENERGYPOINTS MAXENERGYPOINTSATOMIC setvarvar CURRENTENERGYPOINTS MAXENERGYPOINTSATOMIC
            subvar ACTORPICKUPAMOUNT 1
           }
           subvar TEMPVAR5 1
          }
          addvarvar HYPERENERGYDRINKS ACTORPICKUPAMOUNT

          ifvare oldskoolmode 0 qsprintf 62 255 TEMPHEALTH
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            ifvarg tempe 1
            {
             redefinequote 836 ^20%d HYPER ENERGY DRINKS: +%d EP ^14[+%d ADDED TO INVENTORY!]
             qsprintf 836 836 tempe TEMPVAR4 ACTORPICKUPAMOUNT
            }
            else
            {
             redefinequote 836 ^20HYPER ENERGY DRINK: +%d EP ^14[+%d ADDED TO INVENTORY!]            
             qsprintf 836 836 TEMPVAR4 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           else
           {
            ifvarg tempe 1
            {
             redefinequote 836 ^20%d HYPER ENERGY DRINKS: +%d EP
             qsprintf 836 836 tempe TEMPVAR4
             setvarvar fta fta_normal setvar ftq 836
            }
            else
            {
             redefinequote 836 ^20HYPER ENERGY DRINK: +%d EP
             qsprintf 836 836 TEMPVAR4
             setvarvar fta fta_normal setvar ftq 836
            }
           }
           state playerstealjustbeforemonster
          }
    	    ifspawnedby HYPERENERGYDRINK state getcode else state quikget
         }
         else // If not, store in inventory
         {
          state checkexplodeflag
          setvarvar ACTORPICKUPAMOUNT 1
          state checkpickupamountflags state checkdoublepickupbonus
          addvarvar HYPERENERGYDRINKS ACTORPICKUPAMOUNT
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvare ACTORPICKUPAMOUNT 1
           {
            redefinequote 836 ^14 STORED A HYPER ENERGY DRINK INTO INVENTORY!
           }
           else
           {
            redefinequote 836 ^14 STORED %ld HYPER ENERGY DRINKS INTO INVENTORY!
            qsprintf 836 836 ACTORPICKUPAMOUNT
           }
           setvarvar fta fta_normal setvar ftq 836
           // state playerstealjustbeforemonster
           globalsound FOUND_INVENTORY
           ifspawnedby HYPERENERGYDRINK state getcode else state quikget
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
enda


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

state moneypickupsounds-small
       ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON3
       ifvare CHARACTERSELECTED? 8 globalsound LISA_GETMONEYSMALL
       ifvare CHARACTERSELECTED? 15 globalsound MAKEN_GETMONEYSMALL
ends

state moneypickupsounds-medium
       ifvare CHARACTERSELECTED? 1 globalsound DUKE_GETWEAPON1
       ifvare CHARACTERSELECTED? 8 globalsound LISA_GETMONEYMEDIUM
       ifvare CHARACTERSELECTED? 15 globalsound MAKEN_GETMONEYMEDIUM
ends

state moneypickupsounds-large
       ifvare CHARACTERSELECTED? 1 globalsound JIBBED_ACTOR2
       ifvare CHARACTERSELECTED? 8 globalsound LISA_GETMONEYLARGE
       ifvare CHARACTERSELECTED? 15 globalsound MAKEN_GETMONEYLARGE
ends

state moneypickupsounds-larger
       ifvare CHARACTERSELECTED? 1 globalsound JIBBED_ACTOR4
       ifvare CHARACTERSELECTED? 8 globalsound LISA_GETMONEYLARGER
       ifvare CHARACTERSELECTED? 15 globalsound MAKEN_GETMONEYLARGER
ends

eventloadactor MONEYBAG
 getactor[THISACTOR].xvel xvelsav // xvel is the value multipler [sets dollars to (xvel*32768)]
 setactor[THISACTOR].xvel 0
 getactor[THISACTOR].yvel yvelsav // yvel is the additive dollars to the bag to added to the above [sets dollars to ([xvel*32768]+yvel)]. Can be from 0 to 32767.
 setactor[THISACTOR].yvel 0
 getactor[THISACTOR].zvel zvelsav // zvel is the cents in the bag >.>
 setactor[THISACTOR].zvel 0
 getactor[THISACTOR].extra TEMP4
 setactor[THISACTOR].extra -1

 // TEMP will be the actual Dollar amount to give to the player
 setvarvar MONEYBAGDOLLARS xvelsav
 setvar xvelsav 0
 ifvarg MONEYBAGDOLLARS 0 mulvar MONEYBAGDOLLARS 32768
 addvarvar MONEYBAGDOLLARS yvelsav
 setvar yvelsav 0
 // zvelsav will be the actual Cent amount to give to the player
 setvarvar MONEYBAGCENTS zvelsav
 setvar zvelsav 0
enda

useractor notenemy MONEYBAG
 setvar ACTORSHEIGHT 412 setvar ACTORSWIDTH 347
 ifvare mainmenu 0 fall
 ifvare SKILLSET? 0
 {
  sizeat 3 3
  // Makes the bag viewable on the player's hitscanner
  getactor[THISACTOR].cstat TEMP
  ifvarand TEMP 1 subvar TEMP 1
  ifvarand TEMP 256 subvar TEMP 256
  ifvarand TEMP 1024 nullop else addvar TEMP 1024
  ifvarg MONEYBAGDOLLARS 0 nullop else ifvarg MONEYBAGCENTS 0 nullop else { ifvarand TEMP 32768 nullop else addvar TEMP 32768 }
  setactor[THISACTOR].cstat TEMP
  setvar SKILLSET? 1
  setvar tempd 0
 }

 getactor[THISACTOR].owner temp
 ifvarvare temp THISACTOR // If the Bag is owned by itself, don't run the "assimilation" code. :P
 {
  // an empty moneybag should be removed so it can't be picked up for an empty reward :P
  ifvarl MONEYBAGDOLLARS 1 ifvarl MONEYBAGCENTS 1 killit 
 }
 else
 ifvare temp -1 // If the Bag is owned by no one, don't run the "assimilation" code. :P
 {
  // an empty moneybag should be removed so it can't be picked up for an empty reward :P
  ifvarl MONEYBAGDOLLARS 1 ifvarl MONEYBAGCENTS 1 killit 
 }
 else // if owned/dropped by someone, runs "assimilation" code which draws money actors with the same owner as the bags owner into it to prevent excessive money sprite spawns
 {
  ifvarl tempd 27 // A Timer for the Assimilation Process to it doesn't totally hog CPU usage
  {
   ifvarg MONEYBAGDOLLARS 0
   {
    getactor[THISACTOR].cstat TEMP
    ifvarand TEMP 32768 subvar TEMP 32768
    setactor[THISACTOR].cstat TEMP
   }
   else
   {
    ifvarg MONEYBAGCENTS 0
    {
     getactor[THISACTOR].cstat TEMP
     ifvarand TEMP 32768 subvar TEMP 32768
     setactor[THISACTOR].cstat TEMP
    }
   }

   setvar TEMPVAR5 10
   whilevarn TEMPVAR5 0
   {
    ifvarg MONEYBAGCENTS 99 { addvar MONEYBAGDOLLARS 1 subvar MONEYBAGCENTS 100 }
    subvar TEMPVAR5 1
   }
   addvar tempd 1
  }
  else
  {
   // an empty moneybag should be removed so it can't be picked up for an empty reward :P
   ifvarl MONEYBAGDOLLARS 1 ifvarl MONEYBAGCENTS 1 killit 
  }
 }

 state itemfullbright
 ifmove RESPAWN_ACTOR_FLAG state respawnit
 else ifvare mainmenu 0
 {
  ifp pshrunk nullop
  else ifvarg CURRENTHITPOINTS 0 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
  {
   setvarvar ACTORPICKUPAMOUNT MONEYBAGDOLLARS
   state checkmoneybadge
   addvarvar DOLLARS ACTORPICKUPAMOUNT
   addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
   setvarvar TEMP2 ACTORPICKUPAMOUNT

   setvarvar ACTORPICKUPAMOUNT MONEYBAGCENTS
   state checkmoneybadge
   addvarvar CENTS ACTORPICKUPAMOUNT
   addvarvar DISPLAYCENTS ACTORPICKUPAMOUNT
   setvarvar zvelsav ACTORPICKUPAMOUNT

   setvar TEMPVAR5 10
   whilevarn TEMPVAR5 0
   {
    ifvarg zvelsav 99 { addvar TEMP2 1 subvar zvelsav 100 }
    subvar TEMPVAR5 1
   }

   palfrom 24 0 64 sound MONEYSOUND sound MONEYSOUND
   ifvarg zvelsav -1 ifvarl zvelsav 10 redefinequote 125 ^13FOUND A BAG OF MONEY WITH ^20$%ld.0%ld^13 IN IT! :D
   else redefinequote 125 ^13FOUND A BAG OF MONEY WITH ^20$%ld.%ld^13 IN IT! :D
   qsprintf 125 125 TEMP2 zvelsav
   setvarvar fta fta_normal setvar ftq 125

   ifvarl TEMP2 1
   {
    ifvarg zvelsav 0 ifvarl zvelsav 5 { ifrnd 1 ifrnd 64 state moneypickupsounds-small }
    else ifvarg zvelsav 4 ifvarl zvelsav 10 { ifrnd 1 state moneypickupsounds-small }
    else ifvarg zvelsav 9 ifvarl zvelsav 25 { ifrnd 2 state moneypickupsounds-small }
    else ifvarg zvelsav 24 ifvarl zvelsav 50 { ifrnd 3 state moneypickupsounds-small }
    else ifvarg zvelsav 49 ifvarl zvelsav 100 { ifrnd 4 state moneypickupsounds-small }
   }
   else
   {
    ifvare TEMP2 1 { ifrnd 6 state moneypickupsounds-medium }
    else ifvarg TEMP2 1 ifvarl TEMP2 5 { ifrnd 12 state moneypickupsounds-medium }
    else ifvarg TEMP2 4 ifvarl TEMP2 9 { ifrnd 24 state moneypickupsounds-medium }
    else ifvare TEMP2 9 { ifrnd 30 state moneypickupsounds-medium }
    else ifvarg TEMP2 9 ifvarl TEMP2 20 { ifrnd 32 state moneypickupsounds-medium }
    else ifvarg TEMP2 19 ifvarl TEMP2 50 { ifrnd 48 state moneypickupsounds-medium }
    else ifvarg TEMP2 49 ifvarl TEMP2 80 { ifrnd 64 state moneypickupsounds-medium }
    else ifvarg TEMP2 79 ifvarl TEMP2 100 { ifrnd 80 state moneypickupsounds-medium }
    else ifvarg TEMP2 99 ifvarl TEMP2 500 { ifrnd 96 state moneypickupsounds-medium }
    else ifvarg TEMP2 499 ifvarl TEMP2 1000 { ifrnd 64 state moneypickupsounds-large }
    else ifvarg TEMP2 999 ifvarl TEMP2 5000 { ifrnd 96 state moneypickupsounds-large }
    else ifvarg TEMP2 4999 ifvarl TEMP2 10000 { ifrnd 128 state moneypickupsounds-large }
    else ifvarg TEMP2 9999 ifvarl TEMP2 100000 { ifrnd 160 state moneypickupsounds-large }
    else ifvarg TEMP2 99999 ifvarl TEMP2 1000000 { ifrnd 128 state moneypickupsounds-larger }
    else ifvarg TEMP2 999999 ifvarl TEMP2 1000000000 { ifrnd 192 state moneypickupsounds-larger }
    else ifvarg TEMP2 999999999 state moneypickupsounds-larger
   }

   state displaymoney
   ifspawnedby MONEYBAG state getcode else state quikget
  }
 }
enda

// Coin Money
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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 1 ifrnd 64 state moneypickupsounds-small
      redefinequote 125 ^13FOUND A PENNY!
      setvarvar fta fta_normal setvar ftq 125
     }
 
     setvarvar ACTORPICKUPAMOUNT 1
     state checkpickupamountflags state checkmoneybadge
     addvarvar CENTS ACTORPICKUPAMOUNT

     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYCENTS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 1 state moneypickupsounds-small
      redefinequote 125 ^13FOUND A NICKEL!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 5
     state checkpickupamountflags state checkmoneybadge
     addvarvar CENTS ACTORPICKUPAMOUNT

     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYCENTS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 2 state moneypickupsounds-small
      redefinequote 125 ^13FOUND A DIME!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 10
     state checkpickupamountflags state checkmoneybadge
     addvarvar CENTS ACTORPICKUPAMOUNT

     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYCENTS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 3 state moneypickupsounds-small
      redefinequote 125 ^13FOUND A QUARTER!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 25
     state checkpickupamountflags state checkmoneybadge
     addvarvar CENTS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYCENTS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 4 state moneypickupsounds-small
      redefinequote 125 ^13FOUND A HALF-DOLLAR!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 50
     state checkpickupamountflags state checkmoneybadge
     addvarvar CENTS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYCENTS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 6 state moneypickupsounds-medium
      redefinequote 125 ^13FOUND A SACAGAWEA DOLLAR!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 1
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      state displaymoney
     }
     ifspawnedby SACDOLLAR state getcode else state quikget
    }
  }
 }
enda

// Paper Money
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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 6 state moneypickupsounds-medium
      redefinequote 125 ^13FOUND A $1 BILL!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 1
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 12 state moneypickupsounds-medium
      redefinequote 125 ^13FOUND A $2 BILL!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 2
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 12 state moneypickupsounds-medium
      redefinequote 125 ^13FOUND A PAIR OF $ONES!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 2
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 24 state moneypickupsounds-medium
      redefinequote 125 ^13FOUND A $5 BILL!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 5
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 24 state moneypickupsounds-medium
      redefinequote 125 ^13FOUND FIVE ONE$ BILLS!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 5
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 30 state moneypickupsounds-medium
      redefinequote 125 ^13FOUND NINE ONE$ BILLS!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 9
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 32 state moneypickupsounds-medium
      redefinequote 125 ^13FOUND A $10 BILL!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 10
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 32 state moneypickupsounds-medium
      redefinequote 125 ^13FOUND TEN ONE$ BILLS!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 10
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 48 state moneypickupsounds-medium
      redefinequote 125 ^13FOUND A $20 BILL!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 20
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 64 state moneypickupsounds-medium
      redefinequote 125 ^13FOUND A $50 BILL!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 50
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 80 state moneypickupsounds-medium
      redefinequote 125 ^13FOUND FOUR TWENTY$ BILLS!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 80
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 96 state moneypickupsounds-medium
      redefinequote 125 ^13FOUND A $100 BILL!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 100
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 64 state moneypickupsounds-large
      redefinequote 125 ^13FOUND A $500 BILL!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 500
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 96 state moneypickupsounds-large
      redefinequote 125 ^13FOUND A $1000 BILL!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 1000
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 128 state moneypickupsounds-large
      redefinequote 125 ^13FOUND A $5000 BILL!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 5000
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 160 state moneypickupsounds-large
      redefinequote 125 ^13FOUND A $10000 BILL!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 10000
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 128 state moneypickupsounds-larger
      redefinequote 125 ^13FOUND A $100000 BILL!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 100000
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      ifrnd 192 state moneypickupsounds-larger
      redefinequote 125 ^13FOUND A MILLION$ BILL!
      setvarvar fta fta_normal setvar ftq 125
     }

     setvarvar ACTORPICKUPAMOUNT 1000000
     state checkpickupamountflags state checkmoneybadge
     addvarvar DOLLARS ACTORPICKUPAMOUNT
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvarvar DISPLAYDOLLARS ACTORPICKUPAMOUNT
      state displaymoney
     }
     ifspawnedby ONEMILLIONDOLLARS state getcode else state quikget
    }
   }
 }
enda

eventloadactor ONEBILLIONDOLLARS state setpickupflags enda
useractor notenemy ONEBILLIONDOLLARS
 killit break

 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 ifpdistl MONEYRETRIEVEDISTANCE ifcount 6 ifcanseetarget ifvarvarl DOLLARS MAXDOLLARS
    {
     state moneyfs
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      state moneypickupsounds-larger
      redefinequote 125 ^13FOUND A BILLION$ BILL!
      setvarvar fta fta_normal setvar ftq 125
     }

     addvar DOLLARS 1000000000
     ifvarand ACTORFLAGS 2 nullop
     else
     {
      addvar DISPLAYDOLLARS 1000000000
      state displaymoney
     }
     ifspawnedby ONEBILLIONDOLLARS state getcode else state quikget
    }
   }
 }
enda

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

state pickupcharacter_swmedikit
          state checkexplodeflag

          state medikitplayer

          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            ifvarg tempe 1
            {
             redefinequote 836 ^20%d MEDIUM MEDKITS: +%d HP ^14[+%d ADDED TO INVENTORY!]
             qsprintf 836 836 tempe TEMPHEALTH ACTORPICKUPAMOUNT
            }
            else
            {
             redefinequote 836 ^20 MEDIUM MEDKIT: +%d HP ^14[+%d ADDED TO INVENTORY!]            
             qsprintf 836 836 TEMPHEALTH ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           else
           {
            ifvarg tempe 1
            {
             redefinequote 836 ^20%d MEDIUM MEDKITS: +%d HP
             qsprintf 836 836 tempe TEMPHEALTH
             setvarvar fta fta_normal setvar ftq 836
            }
            else
            {
             qsprintf 145 253 TEMPHEALTH 
             setvarvar fta fta_normal setvar ftq 145
            }
           }
           state playerstealjustbeforemonster
          }
          ifspawnedby SWMEDIKIT
           state getcode
          else
           state quikget
ends

state pickupvehicle_swmedikit
          state checkexplodeflag

          state medikitvehicle

          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            ifvarg tempe 1
            {
             redefinequote 836 ^15%d MEDIUM MEDKITS [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
             qsprintf 836 836 tempe ACTORPICKUPAMOUNT
            }
            else
            {
             redefinequote 836 ^15MEDIUM MEDKIT [VEHICLE] ^14[+%d ADDED TO INVENTORY!]            
             qsprintf 836 836 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           else
           {
            ifvarg tempe 1
            {
             redefinequote 836 ^15%d MEDIUM MEDKITS [VEHICLE]
             qsprintf 836 836 tempe
             setvarvar fta fta_normal setvar ftq 836
            }
            else
            {
             redefinequote 836 ^15GRABBED A MEDIUM MEDIKIT FOR YOUR VEHICLE!
             setvarvar fta fta_normal setvar ftq 836
            }
           }
           state playerstealjustbeforemonster
          }
          ifspawnedby SWMEDIKIT
           state getcode
          else
           state quikget
ends

state pickupinventory_swmedikit
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags state checkdoublepickupbonus
           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
            state playerstealjustbeforemonster
           }
           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

          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            ifvarg tempe 1
            {
             redefinequote 836 ^20%d EXTRA-LARGE MEDKITS: +%d HP ^14[+%d ADDED TO INVENTORY!]
             qsprintf 836 836 tempe TEMPHEALTH ACTORPICKUPAMOUNT
            }
            else
            {
             redefinequote 836 ^20EXTRA-LARGE MEDKIT: +%d HP ^14[+%d ADDED TO INVENTORY!]            
             qsprintf 836 836 TEMPHEALTH ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           else
           {
            ifvarg tempe 1
            {
             redefinequote 836 ^20%d EXTRA-LARGE MEDKITS: +%d HP
             qsprintf 836 836 tempe TEMPHEALTH
             setvarvar fta fta_normal setvar ftq 836
            }
            else
            {
             qsprintf 147 253 TEMPHEALTH 
             setvarvar fta fta_normal setvar ftq 147
            }
           }
           state playerstealjustbeforemonster
          }
          ifspawnedby SWBIGMEDIKIT
           state getcode
          else
           state quikget
ends

state pickupvehicle_swbigmedikit
          state checkexplodeflag

          state medikitvehicle

          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 0
           {
            globalsound FOUND_INVENTORY
            ifvarg tempe 1
            {
             redefinequote 836 ^15%d EXTRA-LARGE MEDKITS [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
             qsprintf 836 836 tempe ACTORPICKUPAMOUNT
            }
            else
            {
             redefinequote 836 ^15EXTRA-LARGE MEDKIT [VEHICLE] ^14[+%d ADDED TO INVENTORY!]            
             qsprintf 836 836 ACTORPICKUPAMOUNT
            }
            setvarvar fta fta_normal setvar ftq 836
           }
           else
           {
            ifvarg tempe 1
            {
             redefinequote 836 ^15%d EXTRA-LARGE MEDKITS [VEHICLE]
             qsprintf 836 836 tempe
             setvarvar fta fta_normal setvar ftq 836
            }
            else
            {
             redefinequote 836 ^15GRABBED AN EXTRA-LARGE MEDIKIT FOR YOUR VEHICLE!
             setvarvar fta fta_normal setvar ftq 836
            }
           }
           state playerstealjustbeforemonster
          }
          ifspawnedby SWBIGMEDIKIT
           state getcode
          else
           state quikget
ends

state pickupinventory_swbigmedikit
          ifvarn oldskoolmode 1
          {
           state checkexplodeflag
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags state checkdoublepickupbonus
           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
            state playerstealjustbeforemonster
           }
           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

             ifvarand ACTORFLAGS 2 nullop
             else
             {
              ifvarg ACTORPICKUPAMOUNT 0
              {
               globalsound FOUND_INVENTORY
               ifvarg tempe 1
               {
                redefinequote 836 ^20%d MED PACKS!: +%d HP ^14[+%d ADDED TO INVENTORY!]
                qsprintf 836 836 tempe TEMPHEALTH ACTORPICKUPAMOUNT
               }
               else
               {
                redefinequote 836 ^20MED PACK!: +%d HP ^14[+%d ADDED TO INVENTORY!]            
                qsprintf 836 836 TEMPHEALTH ACTORPICKUPAMOUNT
               }
               setvarvar fta fta_normal setvar ftq 836
              }
              else
              {
               ifvarg tempe 1
               {
                redefinequote 836 ^20%d MED PACKS!: +%d HP
                qsprintf 836 836 tempe TEMPHEALTH
                setvarvar fta fta_normal setvar ftq 836
               }
               else
               {
                qsprintf 158 258 TEMPHEALTH 
	  	   setvarvar fta fta_normal setvar ftq 158
               }
              }
              state playerstealjustbeforemonster
             }
             ifspawnedby MEDPACK
              state getcode
             else
              state quikget
ends

state pickupvehicle_medpack
             state checkexplodeflag

 	 	state medikitvehicle

             ifvarand ACTORFLAGS 2 nullop
             else
             {
              ifvarg ACTORPICKUPAMOUNT 0
              {
               globalsound FOUND_INVENTORY
               ifvarg tempe 1
               {
                redefinequote 836 ^15%d MED PACKS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
                qsprintf 836 836 tempe ACTORPICKUPAMOUNT
               }
               else
               {
                redefinequote 836 ^15MED PACK! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]            
                qsprintf 836 836 ACTORPICKUPAMOUNT
               }
               setvarvar fta fta_normal setvar ftq 836
              }
              else
              {
               ifvarg tempe 1
               {
                redefinequote 836 ^15%d MED PACKS! [VEHICLE]
                qsprintf 836 836 tempe
                setvarvar fta fta_normal setvar ftq 836
               }
               else
               {
                redefinequote 836 ^15GRABBED A MED PACK FOR YOUR VEHICLE!
                setvarvar fta fta_normal setvar ftq 836
               }
              }
              state playerstealjustbeforemonster
             }
             ifspawnedby MEDPACK
              state getcode
             else
              state quikget
ends

state pickupinventory_medpack
            ifvarn oldskoolmode 1
            {
             state checkexplodeflag
             setvarvar ACTORPICKUPAMOUNT 1
             state checkpickupamountflags state checkdoublepickupbonus
             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
              state playerstealjustbeforemonster
             }
             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

             ifvarand ACTORFLAGS 2 nullop
             else
             {
              ifvarg ACTORPICKUPAMOUNT 0
              {
               globalsound FOUND_INVENTORY
               ifvarg tempe 1
               {
                redefinequote 836 ^20%d SURGERY KITS!: +%d HP ^14[+%d ADDED TO INVENTORY!]
                qsprintf 836 836 tempe TEMPHEALTH ACTORPICKUPAMOUNT
               }
               else
               {
                redefinequote 836 ^20SURGERY KIT!: +%d HP ^14[+%d ADDED TO INVENTORY!]            
                qsprintf 836 836 TEMPHEALTH ACTORPICKUPAMOUNT
               }
               setvarvar fta fta_normal setvar ftq 836
              }
              else
              {
               ifvarg tempe 1
               {
                redefinequote 836 ^20%d SURGERY KITS!: +%d HP
                qsprintf 836 836 tempe TEMPHEALTH
                setvarvar fta fta_normal setvar ftq 836
               }
               else
               {
 	     	   qsprintf 159 259 TEMPHEALTH 
                setvarvar fta fta_normal setvar ftq 159
               }
              }
              state playerstealjustbeforemonster
             }
	  	ifspawnedby SURGERYKIT
	  	 state getcode
	  	else
	    	 state quikget
ends

state pickupvehicle_surgerykit
             state checkexplodeflag

	  	state medikitvehicle

             ifvarand ACTORFLAGS 2 nullop
             else
             {
              ifvarg ACTORPICKUPAMOUNT 0
              {
               globalsound FOUND_INVENTORY
               ifvarg tempe 1
               {
                redefinequote 836 ^15%d SURGERY KITS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
                qsprintf 836 836 tempe ACTORPICKUPAMOUNT
               }
               else
               {
                redefinequote 836 ^15SURGERY KIT! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]            
                qsprintf 836 836 ACTORPICKUPAMOUNT
               }
               setvarvar fta fta_normal setvar ftq 836
              }
              else
              {
               ifvarg tempe 1
               {
                redefinequote 836 ^15%d SURGERY KITS! [VEHICLE]
                qsprintf 836 836 tempe
                setvarvar fta fta_normal setvar ftq 836
               }
               else
               {
                redefinequote 836 ^15GRABBED A SURGERY KIT FOR YOUR VEHICLE!
                setvarvar fta fta_normal setvar ftq 836
               }
              }
              state playerstealjustbeforemonster
             }
	  	ifspawnedby SURGERYKIT
	  	 state getcode
	  	else
	    	 state quikget
ends

state pickupinventory_surgerykit
            ifvarn oldskoolmode 1
            {
             state checkexplodeflag
             setvarvar ACTORPICKUPAMOUNT 1
             state checkpickupamountflags state checkdoublepickupbonus
             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
              state playerstealjustbeforemonster
             }
             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
           state playerstealjustbeforemonster
           state charactergrabbonus
          }
          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
           state playerstealjustbeforemonster
          }
          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
     state showhealing_actorhp

     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
           state playerstealjustbeforemonster
           state charactergrabbonus
          }
          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
           state playerstealjustbeforemonster
          }
          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
     ifvarg TEMPVAR3 0 addvarvar TEMPVAR3 ITEMSEEKC
     ifvarvarg ITEMSEEKB STATLIMITATOMIC setvarvar ITEMSEEKB STATLIMITATOMIC
     setactorvar[ITEMSEEK].ENEMYAP TEMPVAR3
     ifvarvarg temp STATLIMIT setvarvar temp STATLIMIT
     setactorvar[ITEMSEEK].ENEMYMAXAP temp
     ifvarg TEMPVAR3 0 state showhealing_actorap

     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
            ifvarand ACTORFLAGS 2 nullop
            else
            {
             state playerstealjustbeforemonster
             state charactergrabbonus
            }
	      ifspawnedby MAXHPAPUP
	       state getcode
	      else
	       state quikget
           }
          }
          else
          {
           state checkexplodeflag
           state maxhpapbonusgive
           ifvarand ACTORFLAGS 2 nullop
           else
           {
            state playerstealjustbeforemonster
            state charactergrabbonus
           }
           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
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              state playerstealjustbeforemonster
              state charactergrabbonus
             }
	       ifspawnedby MAXHPAPUP
	        state getcode
	       else
	        state quikget
            }
           }
           else
           {
            state checkexplodeflag
            ifvarand ACTORFLAGS 2 nullop
            else
            {
             state playerstealjustbeforemonster
             state charactergrabbonus
            }
            ifvarand ACTORFLAGS 2 nullop else state playerstealjustbeforemonster
            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
             ifvarand ACTORFLAGS 2 nullop else state playerstealjustbeforemonster
	       ifspawnedby MAXHPAPUP
	        state getcode
	       else
	        state quikget
            }
           }
           else
           {
            state checkexplodeflag
            state maxhpapbonusgive_vehicle
            ifvarand ACTORFLAGS 2 nullop else state playerstealjustbeforemonster
            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
               ifvarand ACTORFLAGS 2 nullop else state playerstealjustbeforemonster
	         ifspawnedby MAXHPAPUP
	          state getcode
	         else
	          state quikget
              }
             }
             else
             {
              state checkexplodeflag
              state maxhpapbonusgive_vehicle
              ifvarand ACTORFLAGS 2 nullop else state playerstealjustbeforemonster
              ifspawnedby MAXHPAPUP
               state getcode
              else
               state quikget
             }
            }
            else
            {
             state checkexplodeflag
             state maxhpapbonusgive
             ifvarand ACTORFLAGS 2 nullop
             else
             {
              state playerstealjustbeforemonster
              state charactergrabbonus
             }
	       ifspawnedby MAXHPAPUP
	        state getcode
	       else
	        state quikget
            }
           }
           else
           {
            state checkexplodeflag
            state maxhpapbonusgive
            ifvarand ACTORFLAGS 2 nullop
            else
            {
             state playerstealjustbeforemonster
             state charactergrabbonus
            }
            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
               ifvarand ACTORFLAGS 2 nullop
               else
               {
                state playerstealjustbeforemonster
                state charactergrabbonus
               }
	         ifspawnedby MAXHPAPUP
	          state getcode
	         else
	          state quikget
              }
             }
             else
             {
              state checkexplodeflag
              state maxhpapbonusgive
              ifvarand ACTORFLAGS 2 nullop
              else
              {
               state playerstealjustbeforemonster
               state charactergrabbonus
              }
              ifspawnedby MAXHPAPUP
               state getcode
              else
               state quikget
             }
            }
            else
            {
             state checkexplodeflag
             state maxhpapbonusgive_vehicle
             ifvarand ACTORFLAGS 2 nullop else state playerstealjustbeforemonster
	       ifspawnedby MAXHPAPUP
	        state getcode
	       else
	        state quikget
            }
           }
           else
           {
            state checkexplodeflag
            state maxhpapbonusgive_vehicle
            ifvarand ACTORFLAGS 2 nullop else state playerstealjustbeforemonster
            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
      ifvarand ACTORFLAGS 4 nullop else state monsterstealjustbeforeplayer
     }
    }
    else
    {
     state checkexplodeflag
     state maxhpapbonusgive2
     ifvarand ACTORFLAGS 4 nullop else state monsterstealjustbeforeplayer
    }
   }
  }
enda

// Max Energy Bonus
state pickupcharacter_maxepup
          state checkexplodeflag
          state calcmaxepbonus
          redefinequote 836 ^0MAXIMUM EP INCREASED! (+%ld)
      	    qsprintf 836 836 TEMPHITPOINTS
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvarvar fta fta_normal setvar ftq 836
           state playerstealjustbeforemonster
           state charactergrabbonus
          }
          ifspawnedby MAXEPUP
           state getcode
          else
           state quikget
ends

eventloadactor MAXEPUP state setpickupflags enda
useractor notenemy MAXEPUP 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 30 setvar ACTORSWIDTH 30
 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
        {
         ifvarvarl CURRENTENERGYPOINTS STATLIMITATOMIC state pickupcharacter_maxepup
        }
       }
      }
     }
    }
   }
  }
 }
enda
// End Max Energy Bonus

state pickupcharacter_atkup
          state checkexplodeflag
          state calcatkbonus
          qsprintf 326 329 ATKINCREASED
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           setvarvar fta fta_normal setvar ftq 326
           state playerstealjustbeforemonster
           state charactergrabbonus
          }
          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
           state playerstealjustbeforemonster
          }
          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
           state playerstealjustbeforemonster
           state charactergrabbonus
          }
          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
           state playerstealjustbeforemonster
          }
          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
            ifvarand ACTORFLAGS 2 nullop else
            {
             state playerstealjustbeforemonster
             state charactergrabbonus
            }
            ifspawnedby ATKDEFUP
             state getcode
            else
             state quikget
           }
          }
          else
          {
           state checkexplodeflag
           state atkdefbonusgive
           ifvarand ACTORFLAGS 2 nullop else
           {
            state playerstealjustbeforemonster
            state charactergrabbonus
           }
           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
             ifvarand ACTORFLAGS 2 nullop else
             {
              state playerstealjustbeforemonster
              state charactergrabbonus
             }
             ifspawnedby ATKDEFUP
              state getcode
             else
              state quikget
            }
           }
           else
           {
            state checkexplodeflag
            state atkdefbonusgive
            ifvarand ACTORFLAGS 2 nullop else
            {
             state playerstealjustbeforemonster
             state charactergrabbonus
            }
            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
             ifvarand ACTORFLAGS 2 nullop else state playerstealjustbeforemonster
             ifspawnedby ATKDEFUP
              state getcode
             else
              state quikget
            }
           }
           else
           {
            state checkexplodeflag
            state atkdefbonusgive_vehicle
            ifvarand ACTORFLAGS 2 nullop else state playerstealjustbeforemonster
            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
               ifvarand ACTORFLAGS 2 nullop else state playerstealjustbeforemonster
               ifspawnedby ATKDEFUP
                state getcode
               else
                state quikget
              }
             }
             else
             {
              state checkexplodeflag
              state atkdefbonusgive_vehicle
              ifvarand ACTORFLAGS 2 nullop else state playerstealjustbeforemonster
              ifspawnedby ATKDEFUP
               state getcode
              else
               state quikget
             }
            }
            else
            {
             state checkexplodeflag
             state atkdefbonusgive
             ifvarand ACTORFLAGS 2 nullop else
             {
              state playerstealjustbeforemonster
              state charactergrabbonus
             }
             ifspawnedby ATKDEFUP
              state getcode
             else
              state quikget
            }
           }
           else
           {
            state checkexplodeflag
            state atkdefbonusgive
            ifvarand ACTORFLAGS 2 nullop else
            {
             state playerstealjustbeforemonster
             state charactergrabbonus
            }
            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
               ifvarand ACTORFLAGS 2 nullop else
               {
                state playerstealjustbeforemonster
                state charactergrabbonus
               }
               ifspawnedby ATKDEFUP
                state getcode
               else
                state quikget
              }
             }
             else
             {
              state checkexplodeflag
              state atkdefbonusgive
              ifvarand ACTORFLAGS 2 nullop else
              {
               state playerstealjustbeforemonster
               state charactergrabbonus
              }
              ifspawnedby ATKDEFUP
               state getcode
              else
               state quikget
             }
            }
            else
            {
             state checkexplodeflag
             state atkdefbonusgive_vehicle
             ifvarand ACTORFLAGS 2 nullop else state playerstealjustbeforemonster
             ifspawnedby ATKDEFUP
              state getcode
             else
              state quikget
            }
           }
           else
           {
            state checkexplodeflag
            state atkdefbonusgive_vehicle
            ifvarand ACTORFLAGS 2 nullop else state playerstealjustbeforemonster
            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
      ifvarand ACTORFLAGS 4 nullop else state monsterstealjustbeforeplayer
     }
    }
    else
    {
     state checkexplodeflag
     state atkdefbonusgive2
     ifvarand ACTORFLAGS 4 nullop else state monsterstealjustbeforeplayer
    }
   }
  }
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
          ifvarand ACTORFLAGS 2 nullop else state charactergrabbonus
          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
          state playerstealjustbeforemonster
          state charactergrabbonus
         }
         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
           state playerstealjustbeforemonster
           state charactergrabbonus
          }
          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
          state charactergrabbonus
         }
         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
         state charactergrabbonus
        }
        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

         setvar TEMPVAR5 4
         whilevarn TEMPVAR5 0
         {
          state randomammoincrease
          subvar TEMPVAR5 1
         }

         ifvarand ACTORFLAGS 2 nullop
         else
         {
          redefinequote 334 ^23GOT A LARGE SATCHEL!
          setvarvar fta fta_normal setvar ftq 334
          state charactergrabbonus
         }
         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 TEMPHEALTH MAXHITPOINTSATOMIC
            setvarvar CURRENTHITPOINTS MAXHITPOINTSATOMIC
            ifvarvarg CURRENTHITPOINTS STATLIMITATOMIC setvarvar CURRENTHITPOINTS STATLIMITATOMIC
            state showhealing_playerhp

            setvarvar FIRSTAIDCURRENT MAXHITPOINTSATOMIC
            ifvarvarg FIRSTAIDCURRENT STATLIMITATOMIC setvarvar FIRSTAIDCURRENT STATLIMITATOMIC

            setvarvar RECEIVEDARMOR MAXARMORPOINTSATOMIC
            setvarvar CURRENTARMORPOINTS MAXARMORPOINTSATOMIC
            ifvarvarg CURRENTARMORPOINTS STATLIMITATOMIC setvarvar CURRENTARMORPOINTS STATLIMITATOMIC
            state showhealing_playerap

            setvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags state checkdoublepickupbonus
            subvar ACTORPICKUPAMOUNT 1
            addvarvar SUPERATOMS ACTORPICKUPAMOUNT

            ifvarand ACTORFLAGS 2 nullop
            else
            {
             ifvarg ACTORPICKUPAMOUNT 0
             {
              globalsound FOUND_INVENTORY
              redefinequote 836 ^20SUPER ATOM! 200% HP/AP/MEDIKIT! ^14[+%d ADDED TO INVENTORY!]
              qsprintf 836 836 ACTORPICKUPAMOUNT
              setvarvar fta fta_normal setvar ftq 836
             }
             else setvarvar fta fta_normal setvar ftq 151
             state playerstealjustbeforemonster
            }
	      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
            setvarvar TEMPHEALTH TEMPVAR5
            state showhealing_playerhp

            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
            setvarvar RECEIVEDARMOR TEMPVAR5
            state showhealing_playerap

            setvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags state checkdoublepickupbonus
            subvar ACTORPICKUPAMOUNT 1
            addvarvar SUPERATOMS ACTORPICKUPAMOUNT

            ifvarand ACTORFLAGS 2 nullop
            else
            {
             ifvarg ACTORPICKUPAMOUNT 0
             {
              globalsound FOUND_INVENTORY
              redefinequote 836 ^15SUPER ATOM! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
              qsprintf 836 836 ACTORPICKUPAMOUNT
              setvarvar fta fta_normal setvar ftq 836
             }
             else
             {
              redefinequote 836 ^15GRABBED A SUPER ATOM FOR YOUR VEHICLE!
              setvarvar fta fta_normal setvar ftq 836
             }
             state playerstealjustbeforemonster
            }
	      ifspawnedby SUPERATOM
	        state getcode
            else
	        state quikget
ends

state pickupinventory_superatom
            state checkexplodeflag
            setvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags state checkdoublepickupbonus
            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
             state playerstealjustbeforemonster
            }
            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 TEMPHEALTH MAXHITPOINTSATOMIC
           setvarvar CURRENTHITPOINTS MAXHITPOINTSATOMIC
           ifvarvarg CURRENTHITPOINTS STATLIMITATOMIC setvarvar CURRENTHITPOINTS STATLIMITATOMIC
           state showhealing_playerhp

           setvarvar FIRSTAIDCURRENT MAXHITPOINTSATOMIC
           ifvarvarg FIRSTAIDCURRENT STATLIMITATOMIC setvarvar FIRSTAIDCURRENT STATLIMITATOMIC

           setvarvar RECEIVEDARMOR MAXARMORPOINTSATOMIC
           setvarvar CURRENTARMORPOINTS MAXARMORPOINTSATOMIC
           ifvarvarg CURRENTARMORPOINTS STATLIMITATOMIC setvarvar CURRENTARMORPOINTS STATLIMITATOMIC
           state showhealing_playerap

           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 ITEMSEEKC ITEMENEMYMAXHPATOMIC
            state showhealing_actorhp

            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 ITEMSEEKC ITEMENEMYMAXAPATOMIC
            state showhealing_actorap

            setvarvar TEMP6 ENEMYFIRSTAIDMAX
            mulvar TEMP6 2
            getactorvar[ITEMSEEK].ENEMYFIRSTAID TEMP3
            ifvarvarl TEMP3 TEMP6 { ifvarand ACTORFLAGS 4 nullop else setactorvar[ITEMSEEK].EDISPLAYFAFLASHTIMER -28 }
            ifvarvarg TEMP6 STATLIMITATOMIC setvarvar TEMP6 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

            setvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags
            subvar ACTORPICKUPAMOUNT 1

            ifvarg ACTORPICKUPAMOUNT 7
            {
             espawn SUPERATOM  setactorvar[RETURN].ACTORFLAGS 384 setactor[RETURN].pal 16 setactor[RETURN].xrepeat 48 setactor[RETURN].yrepeat 48 setactorvar[RETURN].ACTORNATURALPAL 16 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
             subvar ACTORPICKUPAMOUNT 8
            }
            ifvarg ACTORPICKUPAMOUNT 3
            {
             espawn SUPERATOM setactorvar[RETURN].ACTORFLAGS 256 setactor[RETURN].pal 16 setactor[RETURN].xrepeat 48 setactor[RETURN].yrepeat 48 setactorvar[RETURN].ACTORNATURALPAL 16 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
             subvar ACTORPICKUPAMOUNT 4
            }
            ifvarg ACTORPICKUPAMOUNT 1
            {
             espawn SUPERATOM setactorvar[RETURN].ACTORFLAGS 128 setactor[RETURN].pal 16 setactor[RETURN].xrepeat 48 setactor[RETURN].yrepeat 48 setactorvar[RETURN].ACTORNATURALPAL 16 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
             subvar ACTORPICKUPAMOUNT 2
            }
            ifvare ACTORPICKUPAMOUNT 1
            {
             espawn SUPERATOM state scatterdrops setactor[RETURN].pal 16 setactor[RETURN].xrepeat 48 setactor[RETURN].yrepeat 48 setactorvar[RETURN].ACTORNATURALPAL 16 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
             subvar ACTORPICKUPAMOUNT 1
            }

            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


// COLORSHIELD = 67

state givearmor2a_vehicle
         // TEMP4 = Maximum AP % to reach
         // tempb = becomes the % of health needed to heal to reach TEMP4 [tempb - TEMPARMOR = tempb]
         setvar tempb 1000
         setvar TEMP4 1000
         setvarvar TEMPARMOR TEMPVAR4
         mulvar TEMPARMOR 1000
         divvarvar TEMPARMOR TEMPVAR5 
         subvarvar tempb TEMPARMOR

         setvar RECEIVEDARMOR 0
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags state checkdoublepickupbonus
         setvar tempe 0

         setvar TEMPVAR2 8
         whilevarn TEMPVAR2 0
         {
          state character_shieldtally
          subvar TEMPVAR2 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

         mulvarvar RECEIVEDARMOR TEMPVAR5
         divvar RECEIVEDARMOR 1000
         addvarvar TEMPVAR4 RECEIVEDARMOR
         ifvarvarg TEMPVAR4 TEMPVAR5 setvarvar TEMPVAR4 TEMPVAR5
         setactorvar[tempvehicleid].ENEMYAP TEMPVAR4
         state showhealing_playerap

         ifvarand ACTORFLAGS 2 nullop
         else
         {
          ifvarg ACTORPICKUPAMOUNT 0
          {
           globalsound FOUND_INVENTORY
           ifvarg tempe 1 // Consumed More than 1 Item and Storing the Rest
           {
            ifspritepal 14 redefinequote 167 ^15%d USED GREEN-CLASS ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 16 redefinequote 167 ^15%d USED BLUE-CLASS ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 23 redefinequote 167 ^15%d USED YELLOW-CLASS ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 10 redefinequote 167 ^15%d USED RED-CLASS ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 13 redefinequote 167 ^15%d USED GREY-CLASS ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 20 redefinequote 167 ^15%d USED WHITE-CLASS ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else redefinequote 167 ^15%d USED RANDOM-CLASS ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            qsprintf 167 167 tempe ACTORPICKUPAMOUNT
           }
           else // Consumed One Item and Storing the Rest
           {
            ifspritepal 14 redefinequote 167 ^15USED GREEN-CLASS ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 16 redefinequote 167 ^15USED BLUE-CLASS ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 23 redefinequote 167 ^15USED YELLOW-CLASS ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 10 redefinequote 167 ^15USED RED-CLASS ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 13 redefinequote 167 ^15USED GREY-CLASS ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 20 redefinequote 167 ^15USED WHITE-CLASS ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else redefinequote 167 ^15USED RANDOM-CLASS ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            qsprintf 167 167 ACTORPICKUPAMOUNT
           }
          }
          else // No Inventory to Store
          {
           ifvarg tempe 1 // Consumed More than 1 Item
           {
            ifspritepal 14 redefinequote 167 ^15%d USED GREEN-CLASS ARMORS! [VEHICLE]
            else ifspritepal 16 redefinequote 167 ^15%d USED BLUE-CLASS ARMORS! [VEHICLE]
            else ifspritepal 23 redefinequote 167 ^15%d USED YELLOW-CLASS ARMORS! [VEHICLE]
            else ifspritepal 10 redefinequote 167 ^15%d USED RED-CLASS ARMORS! [VEHICLE]
            else ifspritepal 13 redefinequote 167 ^15%d USED GREY-CLASS ARMORS! [VEHICLE]
            else ifspritepal 20 redefinequote 167 ^15%d USED WHITE-CLASS ARMORS! [VEHICLE]
            else redefinequote 167 ^15%d USED RANDOM-CLASS ARMORS! [VEHICLE]
            qsprintf 167 167 tempe
           }
           else // Consumed One Item
           {
            ifspritepal 14 redefinequote 167 ^15GOT USED GREEN-CLASS ARMOR FOR YOUR VEHICLE!
            else ifspritepal 16 redefinequote 167 ^15GOT USED BLUE-CLASS ARMOR FOR YOUR VEHICLE!
            else ifspritepal 23 redefinequote 167 ^15GOT USED YELLOW-CLASS ARMOR FOR YOUR VEHICLE!
            else ifspritepal 10 redefinequote 167 ^15GOT USED RED-CLASS ARMOR FOR YOUR VEHICLE!
            else ifspritepal 13 redefinequote 167 ^15GOT USED GREY-CLASS ARMOR FOR YOUR VEHICLE!
            else ifspritepal 20 redefinequote 167 ^15GOT USED WHITE-CLASS ARMOR FOR YOUR VEHICLE!
            else redefinequote 167 ^15GOT USED RANDOM-CLASS ARMOR FOR YOUR VEHICLE!
           }
          }
          setvar PLAYERAPDAMAGED? -1
          state playerstealjustbeforemonster
         }
ends
state givearmor2a
         // TEMP4 = Maximum AP % to reach
         // tempb = becomes the % of health needed to heal to reach TEMP4 [tempb - TEMPARMOR = tempb]
         setvar tempb 1000
         setvar TEMP4 1000
         setvarvar TEMPARMOR CURRENTARMORPOINTS
         mulvar TEMPARMOR 1000
         divvarvar TEMPARMOR MAXARMORPOINTS
         subvarvar tempb TEMPARMOR

         setvar RECEIVEDARMOR 0
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags state checkdoublepickupbonus
         setvar tempe 0

         setvar TEMPVAR2 8
         whilevarn TEMPVAR2 0
         {
          state character_shieldtally
          subvar TEMPVAR2 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

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

         ifvarand ACTORFLAGS 2 nullop
         else
         {
          ifvarg ACTORPICKUPAMOUNT 0
          {
           globalsound FOUND_INVENTORY
           ifvarg tempe 1 // Consumed More than 1 Item and Storing the Rest
           {
            ifspritepal 14 redefinequote 167 ^15%d USED GREEN-CLASS ARMORS! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 16 redefinequote 167 ^15%d USED BLUE-CLASS ARMORS! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 23 redefinequote 167 ^15%d USED YELLOW-CLASS ARMORS! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 10 redefinequote 167 ^15%d USED RED-CLASS ARMORS! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 13 redefinequote 167 ^15%d USED GREY-CLASS ARMORS! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 20 redefinequote 167 ^15%d USED WHITE-CLASS ARMORS! ^14[+%d ADDED TO INVENTORY!]
            else redefinequote 167 ^15%d USED RANDOM-CLASS ARMORS! ^14[+%d ADDED TO INVENTORY!]
            qsprintf 167 167 tempe ACTORPICKUPAMOUNT
           }
           else // Consumed One Item and Storing the Rest
           {
            ifspritepal 14 redefinequote 167 ^15USED GREEN-CLASS ARMOR! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 16 redefinequote 167 ^15USED BLUE-CLASS ARMOR! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 23 redefinequote 167 ^15USED YELLOW-CLASS ARMOR! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 10 redefinequote 167 ^15USED RED-CLASS ARMOR! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 13 redefinequote 167 ^15USED GREY-CLASS ARMOR! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 20 redefinequote 167 ^15USED WHITE-CLASS ARMOR! ^14[+%d ADDED TO INVENTORY!]
            else redefinequote 167 ^15USED RANDOM-CLASS ARMOR! ^14[+%d ADDED TO INVENTORY!]
            qsprintf 167 167 ACTORPICKUPAMOUNT
           }
          }
          else // No Inventory to Store
          {
           ifvarg tempe 1 // Consumed More than 1 Item
           {
            ifspritepal 14 redefinequote 167 ^15%d USED GREEN-CLASS ARMORS!
            else ifspritepal 16 redefinequote 167 ^15%d USED BLUE-CLASS ARMORS!
            else ifspritepal 23 redefinequote 167 ^15%d USED YELLOW-CLASS ARMORS!
            else ifspritepal 10 redefinequote 167 ^15%d USED RED-CLASS ARMORS!
            else ifspritepal 13 redefinequote 167 ^15%d USED GREY-CLASS ARMORS!
            else ifspritepal 20 redefinequote 167 ^15%d USED WHITE-CLASS ARMORS!
            else redefinequote 167 ^15%d USED RANDOM-CLASS ARMORS!
            qsprintf 167 167 tempe
           }
           else // Consumed One Item
           {
            ifspritepal 14 redefinequote 167 ^20GOT USED GREEN-CLASS ARMOR!
            else ifspritepal 16 redefinequote 167 ^20GOT USED BLUE-CLASS ARMOR!
            else ifspritepal 23 redefinequote 167 ^20GOT USED YELLOW-CLASS ARMOR!
            else ifspritepal 10 redefinequote 167 ^20GOT USED RED-CLASS ARMOR!
            else ifspritepal 13 redefinequote 167 ^20GOT USED GREY-CLASS ARMOR!
            else ifspritepal 20 redefinequote 167 ^20GOT USED WHITE-CLASS ARMOR!
            else redefinequote 167 ^20GOT USED RANDOM-CLASS ARMOR!
           }
          }
          setvar PLAYERAPDAMAGED? -1
          state playerstealjustbeforemonster
         }
ends

state givearmor2_vehicle
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags state checkdoublepickupbonus
         subvar ACTORPICKUPAMOUNT 1
         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

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

         ifvarand ACTORFLAGS 2 nullop
         else
         {
          ifvarg ACTORPICKUPAMOUNT 0
          {
           globalsound FOUND_INVENTORY
           ifvarg tempe 1 // Consumed More than 1 Item and Storing the Rest
           {
            ifspritepal 14 redefinequote 167 ^15%d GREEN-CLASS ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 16 redefinequote 167 ^15%d BLUE-CLASS ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 23 redefinequote 167 ^15%d YELLOW-CLASS ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 10 redefinequote 167 ^15%d RED-CLASS ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 13 redefinequote 167 ^15%d GREY-CLASS ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 20 redefinequote 167 ^15%d WHITE-CLASS ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else redefinequote 167 ^15%d RANDOM-CLASS ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            qsprintf 167 167 tempe ACTORPICKUPAMOUNT
           }
           else // Consumed One Item and Storing the Rest
           {
            ifspritepal 14 redefinequote 167 ^15GREEN-CLASS ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 16 redefinequote 167 ^15BLUE-CLASS ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 23 redefinequote 167 ^15YELLOW-CLASS ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 10 redefinequote 167 ^15RED-CLASS ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 13 redefinequote 167 ^15GREY-CLASS ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 20 redefinequote 167 ^15WHITE-CLASS ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            else redefinequote 167 ^15RANDOM-CLASS ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
            qsprintf 167 167 ACTORPICKUPAMOUNT
           }
          }
          else // No Inventory to Store
          {
           ifvarg tempe 1 // Consumed More than 1 Item
           {
            ifspritepal 14 redefinequote 167 ^15%d GREEN-CLASS ARMORS! [VEHICLE]
            else ifspritepal 16 redefinequote 167 ^15%d BLUE-CLASS ARMORS! [VEHICLE]
            else ifspritepal 23 redefinequote 167 ^15%d YELLOW-CLASS ARMORS! [VEHICLE]
            else ifspritepal 10 redefinequote 167 ^15%d RED-CLASS ARMORS! [VEHICLE]
            else ifspritepal 13 redefinequote 167 ^15%d GREY-CLASS ARMORS! [VEHICLE]
            else ifspritepal 20 redefinequote 167 ^15%d WHITE-CLASS ARMORS! [VEHICLE]
            else redefinequote 167 ^15%d RANDOM-CLASS ARMORS! [VEHICLE]
            qsprintf 167 167 tempe
           }
           else // Consumed One Item
           {
            ifspritepal 14 redefinequote 167 ^15GOT GREEN-CLASS ARMOR FOR YOUR VEHICLE!
            else ifspritepal 16 redefinequote 167 ^15GOT BLUE-CLASS ARMOR FOR YOUR VEHICLE!
            else ifspritepal 23 redefinequote 167 ^15GOT YELLOW-CLASS ARMOR FOR YOUR VEHICLE!
            else ifspritepal 10 redefinequote 167 ^15GOT RED-CLASS ARMOR FOR YOUR VEHICLE!
            else ifspritepal 13 redefinequote 167 ^15GOT GREY-CLASS ARMOR FOR YOUR VEHICLE!
            else ifspritepal 20 redefinequote 167 ^15GOT WHITE-CLASS ARMOR FOR YOUR VEHICLE!
            else redefinequote 167 ^15GOT RANDOM-CLASS ARMOR FOR YOUR VEHICLE!
           }
          }
          setvar PLAYERAPDAMAGED? -1
          state playerstealjustbeforemonster
         }
ends
state givearmor2
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags state checkdoublepickupbonus
         subvar ACTORPICKUPAMOUNT 1
         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

         setvarvar RECEIVEDARMOR MAXARMORPOINTS
         setvarvar CURRENTARMORPOINTS MAXARMORPOINTS
         state showhealing_playerap

         ifvarand ACTORFLAGS 2 nullop
         else
         {
          ifvarg ACTORPICKUPAMOUNT 0
          {
           globalsound FOUND_INVENTORY
           ifvarg tempe 1 // Consumed More than 1 Item and Storing the Rest
           {
            ifspritepal 14 redefinequote 167 ^15%d GREEN-CLASS ARMORS! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 16 redefinequote 167 ^15%d BLUE-CLASS ARMORS! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 23 redefinequote 167 ^15%d YELLOW-CLASS ARMORS! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 10 redefinequote 167 ^15%d RED-CLASS ARMORS! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 13 redefinequote 167 ^15%d GREY-CLASS ARMORS! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 20 redefinequote 167 ^15%d WHITE-CLASS ARMORS! ^14[+%d ADDED TO INVENTORY!]
            else redefinequote 167 ^15%d RANDOM-CLASS ARMORS! ^14[+%d ADDED TO INVENTORY!]
            qsprintf 167 167 tempe ACTORPICKUPAMOUNT
           }
           else // Consumed One Item and Storing the Rest
           {
            ifspritepal 14 redefinequote 167 ^15%d GREEN-CLASS ARMOR! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 16 redefinequote 167 ^15BLUE-CLASS ARMOR! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 23 redefinequote 167 ^15YELLOW-CLASS ARMOR! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 10 redefinequote 167 ^15RED-CLASS ARMOR! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 13 redefinequote 167 ^15GREY-CLASS ARMOR! ^14[+%d ADDED TO INVENTORY!]
            else ifspritepal 20 redefinequote 167 ^15WHITE-CLASS ARMOR! ^14[+%d ADDED TO INVENTORY!]
            else redefinequote 167 ^15RANDOM-CLASS ARMOR! ^14[+%d ADDED TO INVENTORY!]
            qsprintf 167 167 ACTORPICKUPAMOUNT
           }
          }
          else // No Inventory to Store
          {
           ifvarg tempe 1 // Consumed More than 1 Item
           {
            ifspritepal 14 redefinequote 167 ^15%d GREEN-CLASS ARMORS!
            else ifspritepal 16 redefinequote 167 ^15%d BLUE-CLASS ARMORS!
            else ifspritepal 23 redefinequote 167 ^15%d YELLOW-CLASS ARMORS!
            else ifspritepal 10 redefinequote 167 ^15%d RED-CLASS ARMORS!
            else ifspritepal 13 redefinequote 167 ^15%d GREY-CLASS ARMORS!
            else ifspritepal 20 redefinequote 167 ^15%d WHITE-CLASS ARMORS!
            else redefinequote 167 ^15%d RANDOM-CLASS ARMORS!
            qsprintf 167 167 tempe
           }
           else // Consumed One Item
           {
            ifspritepal 14 redefinequote 167 ^20GOT GREEN-CLASS ARMOR!
            else ifspritepal 16 redefinequote 167 ^20GOT BLUE-CLASS ARMOR!
            else ifspritepal 23 redefinequote 167 ^20GOT YELLOW-CLASS ARMOR!
            else ifspritepal 10 redefinequote 167 ^20GOT RED-CLASS ARMOR!
            else ifspritepal 13 redefinequote 167 ^20GOT GREY-CLASS ARMOR!
            else ifspritepal 20 redefinequote 167 ^20GOT WHITE-CLASS ARMOR!
            else redefinequote 167 ^20GOT RANDOM-CLASS ARMOR!
           }
          }
          setvar PLAYERAPDAMAGED? -1
          state playerstealjustbeforemonster
         }
ends

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	      
           }
           else
           {
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2
           }
	    }
          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
           }
           else
           {
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2
           }
          }
          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
           }
           else
           {
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2
           }
          }
          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
           }
           else
           {
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2
           }
          }
          else
          ifspritepal 13 // Grey Class Armor
          {
           randvar TEMPVAR4 99
           addvar TEMPVAR4 900
           state assesspickuprequirements
           ifvarvarg TEMPVAR TEMPVAR4 setvarvar TEMPVAR TEMPVAR4
           ifvarvarl ARMORPERCENT TEMPVAR setvarvar ARMORPERCENT TEMPVAR

           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2a
           }
           else
           {
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2
           }
          }
          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
           }
           else
           {
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2
           }
          }
          else
          {
           randvar TEMPVAR4 900
           addvar TEMPVAR4 100
           state assesspickuprequirements
           ifvarl TEMPVAR 100 setvar TEMPVAR 100
           ifvarvarg TEMPVAR TEMPVAR4 setvarvar TEMPVAR TEMPVAR4
           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
           }
           else
           {
            ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
            state givearmor2
           }
          }

          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
           }
           else
           {
            globalsound USE_ARMORITEM3
            state givearmor2_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
           }
           else
           {
            globalsound USE_ARMORITEM3
            state givearmor2_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
           }
           else
           {
            globalsound USE_ARMORITEM3
            state givearmor2_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
           }
           else
           {
            globalsound USE_ARMORITEM3
            state givearmor2_vehicle
           }
          }
          else
          ifspritepal 13 // Grey Class Armor
          {
           randvar TEMPVAR4 99
           addvar TEMPVAR4 900
           state assesspickuprequirements
           ifvarvarg TEMPVAR TEMPVAR4 setvarvar TEMPVAR TEMPVAR4
           ifvarvarl TEMPVAR3 TEMPVAR setvarvar TEMPVAR3 TEMPVAR

           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            globalsound USE_ARMORITEM3
            state givearmor2a_vehicle
           }
           else
           {
            globalsound USE_ARMORITEM3
            state givearmor2_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
           }
           else
           {
            globalsound USE_ARMORITEM3
            state givearmor2_vehicle
           }
          }
          else
          {
           randvar TEMPVAR4 900
           addvar TEMPVAR4 100
           state assesspickuprequirements
           ifvarl TEMPVAR 100 setvar TEMPVAR 100
           ifvarvarg TEMPVAR TEMPVAR4 setvarvar TEMPVAR TEMPVAR4
           ifvarvarl TEMPVAR3 TEMPVAR setvarvar TEMPVAR3 TEMPVAR

           randvar TEMPVAR3 1000
           ifvare ARMORISUSED? 1
           { 
            globalsound KICK_HIT
            globalsound USE_ARMORITEM3
            state givearmor2a_vehicle
           }
           else
           {
            globalsound USE_ARMORITEM3
            state givearmor2_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 state checkdoublepickupbonus
          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
           state playerstealjustbeforemonster
          }
          globalsound FOUND_INVENTORY
          ifspawnedby COLORSHIELD
           state getcode
          else
           state quikget
ends

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

     // TEMP4 = Maximum AP % to reach
     // tempb = becomes the % of health needed to heal to reach TEMP4 [tempb - TEMPARMOR = tempb]
     setvar tempb 1000
     setvar TEMP4 1000
     setvarvar TEMPARMOR ITEMENEMYCURRENTAP
     mulvar TEMPARMOR 1000
     divvarvar TEMPARMOR ITEMENEMYMAXAP
     subvarvar tempb TEMPARMOR

     setvar ITEMSEEKC 0
     setvar ACTORPICKUPAMOUNT 1
     state checkpickupamountflags
     setvar tempe 0

     ifvare ARMORISUSED? 1
     {
      setvar TEMPVAR2 8
      whilevarn TEMPVAR2 0
      {
       state actor_shieldtally
       subvar TEMPVAR2 1
      }
     }
     else
     {
      setvar TEMPVAR2 8
      whilevarn TEMPVAR2 0
      {
       ifvarvarl ITEMSEEKC tempb ifvarg ACTORPICKUPAMOUNT 0
       {
        addvar ITEMSEEKC 1000
        subvar ACTORPICKUPAMOUNT 1
        addvar tempe 1
       }
       subvar TEMPVAR2 1
      }
     }

     mulvarvar ITEMSEEKC ITEMENEMYMAXAP
     divvar ITEMSEEKC 1000

     ifvarg ACTORPICKUPAMOUNT 7
     {
      espawn COLORSHIELD
      ifvare ARMORISUSED? 1 setactorvar[RETURN].ARMORISUSED? 1
      setactorvar[RETURN].ACTORFLAGS 384
      ifspritepal 14 { setactor[RETURN].pal 14 setactorvar[RETURN].ACTORNATURALPAL 14 }
      else ifspritepal 16 { setactor[RETURN].pal 16 setactorvar[RETURN].ACTORNATURALPAL 16 }
      else ifspritepal 23 { setactor[RETURN].pal 23 setactorvar[RETURN].ACTORNATURALPAL 23 }
      else ifspritepal 10 { setactor[RETURN].pal 10 setactorvar[RETURN].ACTORNATURALPAL 10 }
      else ifspritepal 13 { setactor[RETURN].pal 13 setactorvar[RETURN].ACTORNATURALPAL 13 }
      else ifspritepal 20 { setactor[RETURN].pal 20 setactorvar[RETURN].ACTORNATURALPAL 20 }
      else { setactor[RETURN].pal 15 setactorvar[RETURN].ACTORNATURALPAL 15 }
      state scatterdrops
      setactorvar[RETURN].FLAGSSET? 1
      subvar ACTORPICKUPAMOUNT 8
     }
     ifvarg ACTORPICKUPAMOUNT 3
     {
      espawn COLORSHIELD
      ifvare ARMORISUSED? 1 setactorvar[RETURN].ARMORISUSED? 1
      setactorvar[RETURN].ACTORFLAGS 256
      ifspritepal 14 { setactor[RETURN].pal 14 setactorvar[RETURN].ACTORNATURALPAL 14 }
      else ifspritepal 16 { setactor[RETURN].pal 16 setactorvar[RETURN].ACTORNATURALPAL 16 }
      else ifspritepal 23 { setactor[RETURN].pal 23 setactorvar[RETURN].ACTORNATURALPAL 23 }
      else ifspritepal 10 { setactor[RETURN].pal 10 setactorvar[RETURN].ACTORNATURALPAL 10 }
      else ifspritepal 13 { setactor[RETURN].pal 13 setactorvar[RETURN].ACTORNATURALPAL 13 }
      else ifspritepal 20 { setactor[RETURN].pal 20 setactorvar[RETURN].ACTORNATURALPAL 20 }
      else { setactor[RETURN].pal 15 setactorvar[RETURN].ACTORNATURALPAL 15 }
      state scatterdrops
      setactorvar[RETURN].FLAGSSET? 1
      subvar ACTORPICKUPAMOUNT 4
     }
     ifvarg ACTORPICKUPAMOUNT 1
     {
      espawn COLORSHIELD
      ifvare ARMORISUSED? 1 setactorvar[RETURN].ARMORISUSED? 1
      setactorvar[RETURN].ACTORFLAGS 128
      ifspritepal 14 { setactor[RETURN].pal 14 setactorvar[RETURN].ACTORNATURALPAL 14 }
      else ifspritepal 16 { setactor[RETURN].pal 16 setactorvar[RETURN].ACTORNATURALPAL 16 }
      else ifspritepal 23 { setactor[RETURN].pal 23 setactorvar[RETURN].ACTORNATURALPAL 23 }
      else ifspritepal 10 { setactor[RETURN].pal 10 setactorvar[RETURN].ACTORNATURALPAL 10 }
      else ifspritepal 13 { setactor[RETURN].pal 13 setactorvar[RETURN].ACTORNATURALPAL 13 }
      else ifspritepal 20 { setactor[RETURN].pal 20 setactorvar[RETURN].ACTORNATURALPAL 20 }
      else { setactor[RETURN].pal 15 setactorvar[RETURN].ACTORNATURALPAL 15 }
      state scatterdrops
      setactorvar[RETURN].FLAGSSET? 1
      subvar ACTORPICKUPAMOUNT 2
     }
     ifvare ACTORPICKUPAMOUNT 1
     {
      espawn COLORSHIELD
      ifvare ARMORISUSED? 1 setactorvar[RETURN].ARMORISUSED? 1
      ifspritepal 14 { setactor[RETURN].pal 14 setactorvar[RETURN].ACTORNATURALPAL 14 }
      else ifspritepal 16 { setactor[RETURN].pal 16 setactorvar[RETURN].ACTORNATURALPAL 16 }
      else ifspritepal 23 { setactor[RETURN].pal 23 setactorvar[RETURN].ACTORNATURALPAL 23 }
      else ifspritepal 10 { setactor[RETURN].pal 10 setactorvar[RETURN].ACTORNATURALPAL 10 }
      else ifspritepal 13 { setactor[RETURN].pal 13 setactorvar[RETURN].ACTORNATURALPAL 13 }
      else ifspritepal 20 { setactor[RETURN].pal 20 setactorvar[RETURN].ACTORNATURALPAL 20 }
      else { setactor[RETURN].pal 15 setactorvar[RETURN].ACTORNATURALPAL 15 }
      state scatterdrops
      setactorvar[RETURN].FLAGSSET? 1
      subvar ACTORPICKUPAMOUNT 1
     }

             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 showhealing_actorap

     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 character_sshieldtally
            ifvarvarl RECEIVEDARMOR tempb ifvarg ACTORPICKUPAMOUNT 0
            {
             ifrnd 64 addvar RECEIVEDARMOR 1750 
             else ifrnd 85 addvar RECEIVEDARMOR 1500
             else ifrnd 128 addvar RECEIVEDARMOR 1000
             else addvar RECEIVEDARMOR 500
             subvar ACTORPICKUPAMOUNT 1
             addvar tempe 1
            }
ends

state pickupcharacter_supershield
           state checkexplodeflag
	     ifvare ARMORISUSED? 1
	     {
            // TEMP4 = Maximum AP % to reach
            // tempb = becomes the % of health needed to heal to reach TEMP4 [tempb - TEMPARMOR = tempb]
            setvar tempb 2000
            setvar TEMP4 2000
            setvarvar TEMPARMOR CURRENTARMORPOINTS
            mulvar TEMPARMOR 1000
            divvarvar TEMPARMOR MAXARMORPOINTS
            subvarvar tempb TEMPARMOR

            setvar RECEIVEDARMOR 0
            setvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags state checkdoublepickupbonus
            setvar tempe 0

            setvar TEMPVAR2 8
            whilevarn TEMPVAR2 0
            {
             state character_sshieldtally
             subvar TEMPVAR2 1
            }
            addvarvar USEDSUPERARMORS ACTORPICKUPAMOUNT

            mulvarvar RECEIVEDARMOR MAXARMORPOINTS
            divvar RECEIVEDARMOR 1000
            addvarvar CURRENTARMORPOINTS RECEIVEDARMOR
            ifvarvarg CURRENTARMORPOINTS MAXARMORPOINTSATOMIC setvarvar CURRENTARMORPOINTS MAXARMORPOINTSATOMIC
            state showhealing_playerap

            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
            {
             ifvarg ACTORPICKUPAMOUNT 0
             {
              globalsound FOUND_INVENTORY
              ifvarg tempe 1
              {
               redefinequote 836 ^20%d USED SUPER ARMORS! ^14[+%d ADDED TO INVENTORY!]
               qsprintf 836 836 tempe ACTORPICKUPAMOUNT
               setvarvar fta fta_normal setvar ftq 836
              }
              else
              {
               redefinequote 836 ^20USED SUPER ARMOR! ^14[+%d ADDED TO INVENTORY!]
               qsprintf 836 836 ACTORPICKUPAMOUNT
               setvarvar fta fta_normal setvar ftq 836
              }
             }
             else
             {
              ifvarg tempe 1
              {
               redefinequote 836 ^20%d USED SUPER ARMORS!
               qsprintf 836 836 tempe
               setvarvar fta fta_normal setvar ftq 836
              }
              else setvarvar fta fta_normal setvar ftq 149
             }
             globalsound KICK_HIT
             ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
             setvar PLAYERAPDAMAGED? -1
             palfrom 24 0 32
             state playerstealjustbeforemonster
            }
            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
            ifvarg ARMORPERCENT 999 setvar ARMORPERCENT 1000

	      setvarvar RECEIVEDARMOR MAXARMORPOINTSATOMIC
	      setvarvar CURRENTARMORPOINTS RECEIVEDARMOR
            state showhealing_playerap

            setvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags state checkdoublepickupbonus
            subvar ACTORPICKUPAMOUNT 1
            addvarvar SUPERARMORS ACTORPICKUPAMOUNT

            ifvarand ACTORFLAGS 2 nullop
            else
            {
             ifvarg ACTORPICKUPAMOUNT 0
             {
              ifvarg tempe 1
              {
               globalsound FOUND_INVENTORY
               redefinequote 836 ^20%d SUPER ARMORS! ^14[+%d ADDED TO INVENTORY!]
               qsprintf 836 836 tempe ACTORPICKUPAMOUNT
              }
              else
              {
               globalsound FOUND_INVENTORY
               redefinequote 836 ^20SUPER ARMOR! ^14[+%d ADDED TO INVENTORY!]
               qsprintf 836 836 ACTORPICKUPAMOUNT
              }
              setvarvar fta fta_normal setvar ftq 836
             }
             else
             {
              ifvarg tempe 1
              {
               redefinequote 836 ^20%d SUPER ARMORS!
               qsprintf 836 836 tempe
               setvarvar fta fta_normal setvar ftq 836
              }
              else
              {
               setvarvar fta fta_normal setvar ftq 148
              }
             }
             ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
             setvar PLAYERAPDAMAGED? -1
             state playerstealjustbeforemonster
            }
	      ifspawnedby SUPERSHIELD
	       state getcode
 	      else
 	       state quikget
	     }
ends

state pickupvehicle_supershield
           state checkexplodeflag
	     ifvare ARMORISUSED? 1
	     {
            // TEMP4 = Maximum AP % to reach
            // tempb = becomes the % of health needed to heal to reach TEMP4 [tempb - TEMPARMOR = tempb]
            setvar tempb 2000
            setvar TEMP4 2000
            setvarvar TEMPARMOR TEMPVAR4
            mulvar TEMPARMOR 1000
            getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR3
            divvarvar TEMPARMOR TEMPVAR3
            subvarvar tempb TEMPARMOR

            setvar RECEIVEDARMOR 0
            setvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags state checkdoublepickupbonus
            setvar tempe 0

            setvar TEMPVAR2 8
            whilevarn TEMPVAR2 0
            {
             state character_sshieldtally
             subvar TEMPVAR2 1
            }
            addvarvar USEDSUPERARMORS ACTORPICKUPAMOUNT

            getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR3
            mulvarvar RECEIVEDARMOR TEMPVAR3
            divvar RECEIVEDARMOR 1000

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

            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
            {
             ifvarg ACTORPICKUPAMOUNT 0
             {
              globalsound FOUND_INVENTORY
              ifvarg tempe 1
              {
               redefinequote 836 ^15%d USED SUPER ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
               qsprintf 836 836 tempe ACTORPICKUPAMOUNT
               setvarvar fta fta_normal setvar ftq 836
              }
              else
              {
               redefinequote 836 ^15USED SUPER ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
               qsprintf 836 836 ACTORPICKUPAMOUNT
               setvarvar fta fta_normal setvar ftq 836
              }
             }
             else
             {
              ifvarg tempe 1
              {
               redefinequote 836 ^15%d USED SUPER ARMORS! [VEHICLE]
               qsprintf 836 836 tempe
               setvarvar fta fta_normal setvar ftq 836
              }
              else
              {
               redefinequote 836 ^15GRABBED A SUIT OF USED SUPER ARMOR FOR YOUR VEHICLE!
               setvarvar fta fta_normal setvar ftq 836
              }
             }
             setvar VEHICLEAPDAMAGED? -1
             globalsound KICK_HIT
             globalsound USE_ARMORITEM3
             palfrom 24 0 32
             state playerstealjustbeforemonster
            }
            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
            ifvarg TEMPVAR3 999 setvar TEMPVAR3 1000
            setactorvar[tempvehicleid].ENEMYARMORPERCENT TEMPVAR3

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

            setvar ACTORPICKUPAMOUNT 1
            state checkpickupamountflags state checkdoublepickupbonus
            subvar ACTORPICKUPAMOUNT 1
            addvarvar SUPERARMORS ACTORPICKUPAMOUNT

            ifvarand ACTORFLAGS 2 nullop
            else
            {
             ifvarg ACTORPICKUPAMOUNT 0
             {
              globalsound FOUND_INVENTORY
              ifvarg tempe 1
              {
               redefinequote 836 ^15%d SUPER ARMORS! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
               qsprintf 836 836 tempe ACTORPICKUPAMOUNT
               setvarvar fta fta_normal setvar ftq 836
              }
              else
              {
               redefinequote 836 ^15SUPER ARMOR! [VEHICLE] ^14[+%d ADDED TO INVENTORY!]
               qsprintf 836 836 ACTORPICKUPAMOUNT
               setvarvar fta fta_normal setvar ftq 836
              }
             }
             else
             {
              ifvarg tempe 1
              {
               redefinequote 836 ^15%d SUPER ARMORS! [VEHICLE]
               qsprintf 836 836 tempe
               setvarvar fta fta_normal setvar ftq 836
              }
              else
              {
               redefinequote 836 ^15GRABBED A SUIT OF SUPER ARMOR FOR YOUR VEHICLE!
               setvarvar fta fta_normal setvar ftq 836
              }
             }
             globalsound USE_ARMORITEM3
             setvar VEHICLEAPDAMAGED? -1
             state playerstealjustbeforemonster
            }
	      ifspawnedby SUPERSHIELD
	       state getcode
	      else
 	       state quikget
	     }
//
ends

state pickupinventory_supershield
          state checkexplodeflag
	    ifvare ARMORISUSED? 1
          {
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags state checkdoublepickupbonus
           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
            state playerstealjustbeforemonster
           }
           globalsound FOUND_INVENTORY
           ifspawnedby SUPERSHIELD
	      state getcode
           else
	      state quikget
          }
          else
	    {
           setvarvar ACTORPICKUPAMOUNT 1
           state checkpickupamountflags state checkdoublepickupbonus
           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
            state playerstealjustbeforemonster
           }
           globalsound FOUND_INVENTORY
           ifspawnedby SUPERSHIELD
	      state getcode
           else
	      state quikget
	    }
ends

state actor_sshieldtally
       ifvarvarl ITEMSEEKC tempb ifvarg ACTORPICKUPAMOUNT 0
       {
        ifrnd 64 addvar ITEMSEEKC 1750
        else ifrnd 85 addvar ITEMSEEKC 1500
        else ifrnd 128 addvar ITEMSEEKC 1000
        else addvar ITEMSEEKC 500
        subvar ACTORPICKUPAMOUNT 1
        addvar tempe 1
       }
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
      {
       // TEMP4 = Maximum AP % to reach
       // tempb = becomes the % of health needed to heal to reach TEMP4 [tempb - TEMPARMOR = tempb]
       setvar tempb 2000
       setvar TEMP4 2000
       setvarvar TEMPARMOR ITEMENEMYCURRENTAP
       mulvar TEMPARMOR 1000
       divvarvar TEMPARMOR ITEMENEMYMAXAP
       subvarvar tempb TEMPARMOR

       setvar ITEMSEEKC 0
       setvar ACTORPICKUPAMOUNT 1
       state checkpickupamountflags
       setvar tempe 0

       setvar TEMPVAR2 8
       whilevarn TEMPVAR2 0
       {
        state actor_sshieldtally
        subvar TEMPVAR2 1
       }

       mulvarvar ITEMSEEKC ITEMENEMYMAXAP
       divvar ITEMSEEKC 1000
       addvarvar ITEMENEMYCURRENTAP ITEMSEEKC
       ifvarvarg ITEMENEMYCURRENTAP ITEMENEMYMAXAP setvarvar ITEMENEMYCURRENTAP ITEMENEMYMAXAP
       setactorvar[ITEMSEEK].ENEMYAP ITEMENEMYCURRENTAP
       state showhealing_actorap

       getactorvar[ITEMSEEK].ENEMYARMORPERCENT CURRENTENEMYARMORPERCENT

       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
       setactorvar[ITEMSEEK].ENEMYARMORPERCENT CURRENTENEMYARMORPERCENT

       setvar WORLDTILESHUFFLES 0
       state getworldtile
       state getitemseekerspecies

       ifvarg ACTORPICKUPAMOUNT 7
       {
        espawn SUPERSHIELD setactorvar[RETURN].ARMORISUSED? 1 setactorvar[RETURN].ACTORFLAGS 384 setactor[RETURN].pal 24 setactor[RETURN].xrepeat 48 setactor[RETURN].yrepeat 48 setactorvar[RETURN].ACTORNATURALPAL 24 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
        subvar ACTORPICKUPAMOUNT 8
       }
       ifvarg ACTORPICKUPAMOUNT 3
       {
        espawn SUPERSHIELD setactorvar[RETURN].ARMORISUSED? 1 setactorvar[RETURN].ACTORFLAGS 256 setactor[RETURN].pal 24 setactor[RETURN].xrepeat 48 setactor[RETURN].yrepeat 48 setactorvar[RETURN].ACTORNATURALPAL 24 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
        subvar ACTORPICKUPAMOUNT 4
       }
       ifvarg ACTORPICKUPAMOUNT 1
       {
        espawn SUPERSHIELD setactorvar[RETURN].ARMORISUSED? 1 setactorvar[RETURN].ACTORFLAGS 128 setactor[RETURN].pal 24 setactor[RETURN].xrepeat 48 setactor[RETURN].yrepeat 48 setactorvar[RETURN].ACTORNATURALPAL 24 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
        subvar ACTORPICKUPAMOUNT 2
       }
       ifvare ACTORPICKUPAMOUNT 1
       {
        espawn SUPERSHIELD setactorvar[RETURN].ARMORISUSED? 1 setactor[RETURN].pal 24 setactor[RETURN].xrepeat 48 setactor[RETURN].yrepeat 48 setactorvar[RETURN].ACTORNATURALPAL 24 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
        subvar ACTORPICKUPAMOUNT 1
       }

       ifvarand ACTORFLAGS 4 nullop
       else
       {
        ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT USED SUPER ARMOR!
        ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT USED SUPER ARMOR!
        sound KICK_HIT
        ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
       }
      }
      else
      {
       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
       ifvarg TEMPVAR 999 setvar TEMPVAR 1000
       ifvarvarl CURRENTENEMYARMORPERCENT TEMPVAR setvarvar CURRENTENEMYARMORPERCENT TEMPVAR
       setactorvar[ITEMSEEK].ENEMYARMORPERCENT CURRENTENEMYARMORPERCENT

       setvarvar ITEMSEEKC ITEMENEMYMAXAPATOMIC
       addvarvar ITEMENEMYCURRENTAP ITEMSEEKC
       ifvarvarg ITEMENEMYCURRENTAP ITEMENEMYMAXAPATOMIC setvarvar ITEMENEMYCURRENTAP ITEMENEMYMAXAPATOMIC
       setactorvar[ITEMSEEK].ENEMYAP ITEMENEMYCURRENTAP
       state showhealing_actorap

       setvar WORLDTILESHUFFLES 0
       state getworldtile
       state getitemseekerspecies

       setvar ACTORPICKUPAMOUNT 1
       state checkpickupamountflags
       subvar ACTORPICKUPAMOUNT 1
       ifvarg ACTORPICKUPAMOUNT 7
       {
        espawn SUPERSHIELD setactorvar[RETURN].ACTORFLAGS 384 setactor[RETURN].pal 24 setactor[RETURN].xrepeat 48 setactor[RETURN].yrepeat 48 setactorvar[RETURN].ACTORNATURALPAL 24 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
        subvar ACTORPICKUPAMOUNT 8
       }
       ifvarg ACTORPICKUPAMOUNT 3
       {
        espawn SUPERSHIELD setactorvar[RETURN].ACTORFLAGS 256 setactor[RETURN].pal 24 setactor[RETURN].xrepeat 48 setactor[RETURN].yrepeat 48 setactorvar[RETURN].ACTORNATURALPAL 24 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
        subvar ACTORPICKUPAMOUNT 4
       }
       ifvarg ACTORPICKUPAMOUNT 1
       {
        espawn SUPERSHIELD setactorvar[RETURN].ACTORFLAGS 128 setactor[RETURN].pal 24 setactor[RETURN].xrepeat 48 setactor[RETURN].yrepeat 48 setactorvar[RETURN].ACTORNATURALPAL 24 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
        subvar ACTORPICKUPAMOUNT 2
       }
       ifvare ACTORPICKUPAMOUNT 1
       {
        espawn SUPERSHIELD setactor[RETURN].pal 24 setactor[RETURN].xrepeat 48 setactor[RETURN].yrepeat 48 setactorvar[RETURN].ACTORNATURALPAL 24 state scatterdrops setactorvar[RETURN].FLAGSSET? 1
        subvar ACTORPICKUPAMOUNT 1
       }

       ifvarand ACTORFLAGS 4 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!
       }
      }
      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

             setvarvar ACTORPICKUPAMOUNT POWERUPBENEFIT
             state checkdoublepickupbonus
             setvarvar POWERUPBENEFIT ACTORPICKUPAMOUNT

   	 	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
              state playerstealjustbeforemonster
              ifvare PUBLICBETA? 0 setvar RNDMIZERLIMIT 192 else setvar RNDMIZERLIMIT 64 state rndmizer256
              ifvarvarg RNDMIZER RNDMIZERLIMIT
              {
               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

             setvarvar ACTORPICKUPAMOUNT POWERUPBENEFIT
             state checkdoublepickupbonus
             setvarvar POWERUPBENEFIT ACTORPICKUPAMOUNT

             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
              state playerstealjustbeforemonster
             }
             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 ifcanseetarget ifpdistl RETRIEVEDISTANCE ifcount 6
     {
      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

             setvarvar ACTORPICKUPAMOUNT POWERUPBENEFIT
             state checkdoublepickupbonus
             setvarvar POWERUPBENEFIT ACTORPICKUPAMOUNT

	       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
              state playerstealjustbeforemonster
              ifvare PUBLICBETA? 0 setvar RNDMIZERLIMIT 192 else setvar RNDMIZERLIMIT 64 state rndmizer256
              ifvarvarg RNDMIZER RNDMIZERLIMIT
              {
               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

             setvarvar ACTORPICKUPAMOUNT POWERUPBENEFIT
             state checkdoublepickupbonus
             setvarvar POWERUPBENEFIT ACTORPICKUPAMOUNT

             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
              state playerstealjustbeforemonster
             }
             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 ifcanseetarget ifpdistl RETRIEVEDISTANCE ifcount 6
     {
      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

             setvarvar ACTORPICKUPAMOUNT POWERUPBENEFIT
             state checkdoublepickupbonus
             setvarvar POWERUPBENEFIT ACTORPICKUPAMOUNT

	       addvarvar REGENTIME POWERUPBENEFIT
             ifvarand ACTORFLAGS 2 nullop
             else
             {
	        setvarvar fta fta_normal setvar ftq 229
	        sound REGEN_GRAB
	        sound DUKE_GET
  		 state artipickupsounds
              state playerstealjustbeforemonster
              ifvare PUBLICBETA? 0 setvar RNDMIZERLIMIT 192 else setvar RNDMIZERLIMIT 64 state rndmizer256
              ifvarvarg RNDMIZER RNDMIZERLIMIT
              {
               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

             setvarvar ACTORPICKUPAMOUNT POWERUPBENEFIT
             state checkdoublepickupbonus
             setvarvar POWERUPBENEFIT ACTORPICKUPAMOUNT

             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
              state playerstealjustbeforemonster
             }
	     	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 ifcanseetarget ifpdistl RETRIEVEDISTANCE ifcount 6
     {
      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

             setvarvar ACTORPICKUPAMOUNT POWERUPBENEFIT
             state checkdoublepickupbonus
             setvarvar POWERUPBENEFIT ACTORPICKUPAMOUNT

	       addvarvar APREGENTIME POWERUPBENEFIT
             ifvarand ACTORFLAGS 2 nullop
             else
             {
	        setvarvar fta fta_normal setvar ftq 233
	        sound REGEN_GRABAP
	        sound DUKE_GET
   		 state artipickupsounds
              state playerstealjustbeforemonster
              ifvare PUBLICBETA? 0 setvar RNDMIZERLIMIT 192 else setvar RNDMIZERLIMIT 64 state rndmizer256
              ifvarvarg RNDMIZER RNDMIZERLIMIT
              {
               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

             setvarvar ACTORPICKUPAMOUNT POWERUPBENEFIT
             state checkdoublepickupbonus
             setvarvar POWERUPBENEFIT ACTORPICKUPAMOUNT

             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
              state playerstealjustbeforemonster
             }
	     	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 ifcanseetarget ifpdistl RETRIEVEDISTANCE ifcount 6
     {
      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

             setvarvar ACTORPICKUPAMOUNT POWERUPBENEFIT
             state checkdoublepickupbonus
             setvarvar POWERUPBENEFIT ACTORPICKUPAMOUNT

	       addvarvar VAMPIRETIME POWERUPBENEFIT
             ifvarand ACTORFLAGS 2 nullop
             else
             {
	        setvarvar fta fta_normal setvar ftq 235
	        sound GRAB_VAMPIREITEM
	        sound DUKE_GET
   		 state artipickupsounds
              state playerstealjustbeforemonster
              ifvare PUBLICBETA? 0 setvar RNDMIZERLIMIT 192 else setvar RNDMIZERLIMIT 64 state rndmizer256
              ifvarvarg RNDMIZER RNDMIZERLIMIT
              {
               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

             setvarvar ACTORPICKUPAMOUNT POWERUPBENEFIT
             state checkdoublepickupbonus
             setvarvar POWERUPBENEFIT ACTORPICKUPAMOUNT

             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
              state playerstealjustbeforemonster
             }
             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 ifcanseetarget ifpdistl RETRIEVEDISTANCE ifcount 6
     {
      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

state checkcoilamounts
       ifvarg ACTORPICKUPAMOUNT 0
       {
        addvarvar TELEPORTERCOILS TEMPVAR4
        subvar ACTORPICKUPAMOUNT 1
        addvarvar tempe TEMPVAR4
       }
ends

eventloadactor COILS state setpickupflags enda
useractor notenemy COILS 0

 state itemfullbright
 sizeat 24 24
 setvar ACTORSHEIGHT 26 setvar ACTORSWIDTH 43
 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 ifpdistl RETRIEVEDISTANCE ifcount 6 ifcanseetarget
      {
       setvar TEMPVAR4 8
       setvar tempe 0
       setvar ACTORPICKUPAMOUNT 1
       state checkpickupamountflags state checkdoublepickupbonus

       setvar TEMPVAR2 16
       whilevarn TEMPVAR2 0
       {
        state checkcoilamounts
        subvar TEMPVAR2 1
       }

       state calcitemremains_weaponammo

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

	       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
              state playerstealjustbeforemonster
             }
	       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
     setvar ACTORPICKUPAMOUNT 50
     state checkpickupamountflags
     setvarvar ITEMSEEKC ITEMENEMYMAXHP
     mulvarvar ITEMSEEKC ACTORPICKUPAMOUNT
     divvar ITEMSEEKC 100
     addvarvar ITEMSEEKB ITEMSEEKC
     ifvarvarg ITEMSEEKB ITEMENEMYMAXHPATOMIC setvarvar ITEMSEEKB ITEMENEMYMAXHPATOMIC
     setactorvar[ITEMSEEK].ENEMYHP ITEMSEEKB
     state showhealing_actorhp

     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 state checkdoublepickupbonus
                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 %ld EXTRA LIVES FOR BUBSY!
                 qsprintf 335 335 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 state checkdoublepickupbonus
               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 %ld EXTRA LIVES FOR BUBSY!
               qsprintf 335 335 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 state checkdoublepickupbonus
               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 %ld EXTRA LIVES FOR BUBSY!
                qsprintf 335 335 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 state checkdoublepickupbonus
             addvarvar CONTINUES? ACTORPICKUPAMOUNT
             ifvarg ACTORPICKUPAMOUNT 1
             {
          	 ifvare GENDER? 0 redefinequote 335 ^20FOUND %ld CONTINUES! LUCKY BASTARD...
        	 ifvare GENDER? 1 redefinequote 335 ^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 %ld CONTINUES!
              qsprintf 335 335 CONTINUES?
        	 setvarvar fta fta_normal setvar ftq 335
             }
            }
           }
           else
           {
	      ifvarl CONTINUES? 5
 	      {
             state checkexplodeflag
             setvar ACTORPICKUPAMOUNT 1
             state checkpickupamountflags state checkdoublepickupbonus
             addvarvar CONTINUES? ACTORPICKUPAMOUNT
             ifvarg ACTORPICKUPAMOUNT 1
             {
          	 ifvare GENDER? 0 redefinequote 335 ^20FOUND %ld CONTINUES! LUCKY BASTARD...
        	 ifvare GENDER? 1 redefinequote 335 ^20FOUND %ld CONTINUES! LUCKY BITCH...
              qsprintf 335 335 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 %ld CONTINUES!
              qsprintf 335 335 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 state checkdoublepickupbonus
          addvarvar RESURRECTIONCHALICES ACTORPICKUPAMOUNT
          ifvarg ACTORPICKUPAMOUNT 1
          {
           redefinequote 335 ^6GOT %ld RESURRECTION CHALICES!! ROCK ON! :D
           qsprintf 335 335 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 state checkdoublepickupbonus
          addvarvar EYEDROPS ACTORPICKUPAMOUNT
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 1
           {
            redefinequote 335 ^14FOUND %ld EYEDROPS!
            qsprintf 335 335 ACTORPICKUPAMOUNT
            state playerstealjustbeforemonster
           }
           else redefinequote 335 ^14FOUND AN EYEDROP!
          }

          state grabinventory
         }
        }
       }
      }
     }
    }
   }
  }
 }

// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
    state checkenemypickuphealth
    ifvarg ITEMSEEKB 0
    {
     getactorvar[ITEMSEEK].ACTORSTATUS? ITEMSEEKC
     ifvarand ITEMSEEKC 16
     {
      state checkexplodeflag
      subvar ITEMSEEKC 16
      setactorvar[ITEMSEEK].ACTORSTATUS? ITEMSEEKC
      setactorvar[ITEMSEEK].ACTORDIMNESSTIMER 0
      state resetitemtarget
      state getitemseekerspecies

      setvar ACTORPICKUPAMOUNT 1
      state checkpickupamountflags
      subvar ACTORPICKUPAMOUNT 1
      ifvarg ACTORPICKUPAMOUNT 7
      {
       espawn EYEDROP setactorvar[RETURN].ACTORFLAGS 384 state scatterdrops
       subvar ACTORPICKUPAMOUNT 8
      }
      ifvarg ACTORPICKUPAMOUNT 3
      {
       espawn EYEDROP setactorvar[RETURN].ACTORFLAGS 256 state scatterdrops
       subvar ACTORPICKUPAMOUNT 4
      }
      ifvarg ACTORPICKUPAMOUNT 1
      {
       espawn EYEDROP setactorvar[RETURN].ACTORFLAGS 128 state scatterdrops
       subvar ACTORPICKUPAMOUNT 2
      }
      ifvare ACTORPICKUPAMOUNT 1
      {
       espawn EYEDROP state scatterdrops
       subvar ACTORPICKUPAMOUNT 1
      }

      ifvarand ACTORFLAGS 4 nullop
      else
      {
       globalsound DUKE_GET
       globalsound HEAL_AILMENT
       ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT AN EYEDROP! :(
       ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT AN EYEDROP! :O
      }
      state enemygrabitemflash
     }
    }
   }
  }
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 state checkdoublepickupbonus
          addvarvar ANTIDOTES ACTORPICKUPAMOUNT
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 1
           {
            redefinequote 335 ^14FOUND %ld ANTIDOTES!
            qsprintf 335 335 ACTORPICKUPAMOUNT
            state playerstealjustbeforemonster
           }
           else redefinequote 335 ^14FOUND AN ANTIDOTE!
          }

  
          state grabinventory
         }
        }
       }
      }
     }
    }
   }
  }
 }

// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
    state checkenemypickuphealth
    ifvarg ITEMSEEKB 0
    {
     getactorvar[ITEMSEEK].ACTORSTATUS? ITEMSEEKC
     ifvarand ITEMSEEKC 8
     {
      state checkexplodeflag
      subvar ITEMSEEKC 8
      setactorvar[ITEMSEEK].ACTORSTATUS? ITEMSEEKC
      setactorvar[ITEMSEEK].ACTORPOISONTIMER 0
      state resetitemtarget
      state getitemseekerspecies

      setvar ACTORPICKUPAMOUNT 1
      state checkpickupamountflags
      subvar ACTORPICKUPAMOUNT 1
      ifvarg ACTORPICKUPAMOUNT 7
      {
       espawn ANTIDOTE setactorvar[RETURN].ACTORFLAGS 384 state scatterdrops
       subvar ACTORPICKUPAMOUNT 8
      }
      ifvarg ACTORPICKUPAMOUNT 3
      {
       espawn ANTIDOTE setactorvar[RETURN].ACTORFLAGS 256 state scatterdrops
       subvar ACTORPICKUPAMOUNT 4
      }
      ifvarg ACTORPICKUPAMOUNT 1
      {
       espawn ANTIDOTE setactorvar[RETURN].ACTORFLAGS 128 state scatterdrops
       subvar ACTORPICKUPAMOUNT 2
      }
      ifvare ACTORPICKUPAMOUNT 1
      {
       espawn ANTIDOTE state scatterdrops
       subvar ACTORPICKUPAMOUNT 1
      }

      ifvarand ACTORFLAGS 4 nullop
      else
      {
       globalsound DUKE_GET
       globalsound HEAL_AILMENT
       ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT AN ANTIDOTE! :(
       ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT AN ANTIDOTE! :O
      }
      state enemygrabitemflash
     }
    }
   }
  }
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 state checkdoublepickupbonus
          addvarvar FOGHORNS ACTORPICKUPAMOUNT
          ifvarand ACTORFLAGS 2 nullop
          else
          {
           ifvarg ACTORPICKUPAMOUNT 1
           {
            redefinequote 335 ^14FOUND %ld FOGHORNS!
            qsprintf 335 335 ACTORPICKUPAMOUNT
            state playerstealjustbeforemonster
           }
           else redefinequote 335 ^14FOUND A FOGHORN!
          }

          state grabinventory
         }
        }
       }
      }
     }
    }
   }
  }
 }

// Allows Monsters to Pick Up This Item
  state itemseekingactor
  ifvare mainmenu 0
  {
   ifvarn ITEMSEEK -1
   {
    state checkenemypickuphealth
    ifvarg ITEMSEEKB 0
    {
     getactorvar[ITEMSEEK].ACTORSTATUS? ITEMSEEKC
     ifvarand ITEMSEEKC 128
     {
      state checkexplodeflag
      subvar ITEMSEEKC 128
      setactorvar[ITEMSEEK].ACTORSTATUS? ITEMSEEKC
      setactorvar[ITEMSEEK].ACTORCONFUSIONTIMER 0
      state resetitemtarget
      state getitemseekerspecies

      setvar ACTORPICKUPAMOUNT 1
      state checkpickupamountflags
      subvar ACTORPICKUPAMOUNT 1
      ifvarg ACTORPICKUPAMOUNT 7
      {
       espawn FOGHORN setactorvar[RETURN].ACTORFLAGS 384 state scatterdrops
       subvar ACTORPICKUPAMOUNT 8
      }
      ifvarg ACTORPICKUPAMOUNT 3
      {
       espawn FOGHORN setactorvar[RETURN].ACTORFLAGS 256 state scatterdrops
       subvar ACTORPICKUPAMOUNT 4
      }
      ifvarg ACTORPICKUPAMOUNT 1
      {
       espawn FOGHORN setactorvar[RETURN].ACTORFLAGS 128 state scatterdrops
       subvar ACTORPICKUPAMOUNT 2
      }
      ifvare ACTORPICKUPAMOUNT 1
      {
       espawn FOGHORN state scatterdrops
       subvar ACTORPICKUPAMOUNT 1
      }

      ifvarand ACTORFLAGS 4 nullop
      else
      {
       globalsound DUKE_GET
       globalsound HEAL_AILMENT
       ifvare ITEMSEEKSPECIESTYPE 0 redefinequote 185 ^10AN ENEMY GOT A FOGHORN! :(
       ifvare ITEMSEEKSPECIESTYPE 1 redefinequote 185 ^15A CIVILIAN GOT A FOGHORN! :O
      }
      state enemygrabitemflash
     }
    }
   }
  }
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!
            }
            else
            {
             ifvare CHARACTERSELECTED? 8 globalsound LISA_GRABSHIELD
            }            
            setvar ACTORPICKUPAMOUNT 16
            state checkpickupamountflags state checkdoublepickupbonus
            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 checkdoublepickupbonus

            state checkcellpickups

            setvarvar TEMP5 tempc
            mulvarvar TEMP5 ESHIELDDMGFACTOR
            ifvarn SHOWDAMAGEPLAYER 0 ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1
            {
             ifvarg TEMP5 0
             {
              setvarvar SHOWDAMAGE TEMP5
              // addlogvar TEMP5
              setvar SHOWDAMAGETYPE 5
              setvarvar SHOWDAMAGEACTORID PLAYERID
              state showdamage
             }
            }

            redefinequote 335 ^22FOUND %ld ENERGY CELLS!
            qsprintf 335 335 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 checkdoublepickupbonus

            state checkcellpickups

            setvarvar TEMP5 tempc
            mulvarvar TEMP5 ESHIELDDMGFACTOR
            ifvarn SHOWDAMAGEPLAYER 0 ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1
            {
             ifvarg TEMP5 0
             {
              setvarvar SHOWDAMAGE TEMP5
              // addlogvar TEMP5
              setvar SHOWDAMAGETYPE 5
              setvarvar SHOWDAMAGEACTORID PLAYERID
              state showdamage
             }
            }

            redefinequote 335 ^22FOUND %ld ENERGY CELLS!
            qsprintf 335 335 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 checkdoublepickupbonus

            state checkcellpickups

            setvarvar TEMP5 tempc
            mulvarvar TEMP5 ESHIELDDMGFACTOR
            ifvarn SHOWDAMAGEPLAYER 0 ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1
            {
             ifvarg TEMP5 0
             {
              setvarvar SHOWDAMAGE TEMP5
              // addlogvar TEMP5
              setvar SHOWDAMAGETYPE 5
              setvarvar SHOWDAMAGEACTORID PLAYERID
              state showdamage
             }
            }

            redefinequote 335 ^22FOUND %ld ENERGY CELLS!
            qsprintf 335 335 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 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 state checkdoublepickupbonus
          addvarvar AFASDROPS ACTORPICKUPAMOUNT
          ifvarg ACTORPICKUPAMOUNT 1
          {
           redefinequote 335 ^14FOUND %ld AFA'S DROPS!
           qsprintf 335 335 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 state checkdoublepickupbonus
          addvarvar FAUXLEVELUPS ACTORPICKUPAMOUNT
          ifvarg ACTORPICKUPAMOUNT 1
          {
           redefinequote 335 ^14FOUND %ld UNKNOWN MEDICENES!
           qsprintf 335 335 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 state checkdoublepickupbonus
         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 state checkdoublepickupbonus
         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 state checkdoublepickupbonus
         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 state checkdoublepickupbonus
         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 state checkdoublepickupbonus
         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 state checkdoublepickupbonus
         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 state checkdoublepickupbonus
         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 state checkdoublepickupbonus
         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 state checkdoublepickupbonus
         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

// Riot Shield [Equipment Item #10]
eventloadactor RIOTSHIELD state setpickupflags enda
useractor notenemy RIOTSHIELD 0 

 sizeat 28 28
 state itemfullbright
 setvar ACTORSHEIGHT 64 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
     {
      ifcanseetarget
      {
       ifpdistl RETRIEVEDISTANCE
       {
        ifcount 6
        {
         state checkexplodeflag
 
         setvar ACTORPICKUPAMOUNT 1
         state checkpickupamountflags state checkdoublepickupbonus
         addvarvar RIOTSHIELDS ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A TACTICAL RIOT SHIELD!
          redefinequote 336 ^22FOUND %ld TACTICAL RIOT SHIELDS!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else redefinequote 335 ^22FOUND A TACTICAL RIOT SHIELD!

         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Nyx Gloves [Equipment Item #11]
eventloadactor NYXGLOVEPAIR state setpickupflags enda
useractor notenemy NYXGLOVEPAIR 0 

 sizeat 10 10
 state itemfullbright
 setvar ACTORSHEIGHT 112 setvar ACTORSWIDTH 126
 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 state checkdoublepickupbonus
         addvarvar NYXGLOVEPAIRS ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A PAIR OF NYX GLOVES!
          redefinequote 336 ^22FOUND %ld PAIRS OF NYX GLOVES!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else redefinequote 335 ^22FOUND A PAIR OF NYX GLOVES!

         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Rabbit's Foot [Equipment Item #12]
eventloadactor RABBITSFOOT state setpickupflags enda
useractor notenemy RABBITSFOOT 0 

 sizeat 14 14
 state itemfullbright
 setvar ACTORSHEIGHT 48 setvar ACTORSWIDTH 67
 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 state checkdoublepickupbonus
         addvarvar RABBITSFOOTS ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A RABBIT'S FOOT!
          redefinequote 336 ^22FOUND %ld RABBIT'S FEET!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else redefinequote 335 ^22FOUND A RABBIT'S FOOT!

         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Jump Boots [Equipment Item #13]
eventloadactor JUMPBOOTPAIR state setpickupflags enda
useractor notenemy JUMPBOOTPAIR 0 

 sizeat 26 26
 state itemfullbright
 setvar ACTORSHEIGHT 34 setvar ACTORSWIDTH 36
 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 state checkdoublepickupbonus
         addvarvar JUMPBOOTPAIRS ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A PAIR OF JUMP BOOTS!
          redefinequote 336 ^22FOUND %ld PAIRS OF JUMP BOOTS!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else redefinequote 335 ^22FOUND A PAIR OF JUMP BOOTS!

         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// ShockAb Boots [Equipment Item #14]
eventloadactor SHOCKABBOOTPAIR state setpickupflags enda
useractor notenemy SHOCKABBOOTPAIR 0 

 sizeat 26 26
 state itemfullbright
 setvar ACTORSHEIGHT 34 setvar ACTORSWIDTH 36
 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 state checkdoublepickupbonus
         addvarvar SHOCKABBOOTPAIRS ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A PAIR OF SHOCKAB BOOTS!
          redefinequote 336 ^22FOUND %ld PAIRS OF SHOCKAB BOOTS!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else redefinequote 335 ^22FOUND A PAIR OF SHOCKAB BOOTS!

         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Happy Shoes [Equipment Item #15]
eventloadactor HAPPYSHOEPAIR state setpickupflags enda
useractor notenemy HAPPYSHOEPAIR 0 

 sizeat 8 8
 state itemfullbright
 setvar ACTORSHEIGHT 64 setvar ACTORSWIDTH 108
 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 state checkdoublepickupbonus
         addvarvar HAPPYSHOEPAIRS ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A PAIR OF HAPPY SHOES!
          redefinequote 336 ^22FOUND %ld PAIRS OF HAPPY SHOES!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else redefinequote 335 ^22FOUND A PAIR OF HAPPY SHOES!

         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Style Shoes [Equipment Item #16]
eventloadactor STYLESHOEPAIR state setpickupflags enda
useractor notenemy STYLESHOEPAIR 0 

 sizeat 8 8
 state itemfullbright
 setvar ACTORSHEIGHT 80 setvar ACTORSWIDTH 109
 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 state checkdoublepickupbonus
         addvarvar STYLESHOEPAIRS ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A PAIR OF STYLE SHOES!
          redefinequote 336 ^22FOUND %ld PAIRS OF STYLE SHOES!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else redefinequote 335 ^22FOUND A PAIR OF STYLE SHOES!

         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Charm Shoes [Equipment Item #17]
eventloadactor CHARMSHOEPAIR state setpickupflags enda
useractor notenemy CHARMSHOEPAIR 0 

 sizeat 8 8
 state itemfullbright
 setvar ACTORSHEIGHT 80 setvar ACTORSWIDTH 103
 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 state checkdoublepickupbonus
         addvarvar CHARMSHOEPAIRS ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A PAIR OF CHARM SHOES!
          redefinequote 336 ^22FOUND %ld PAIRS OF CHARM SHOES!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else redefinequote 335 ^22FOUND A PAIR OF CHARM SHOES!

         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Charm Shoes [Equipment Item #18]
eventloadactor POWERWRIST state setpickupflags enda
useractor notenemy POWERWRIST 0 

 sizeat 4 4
 state itemfullbright
 setvar ACTORSHEIGHT 152 setvar ACTORSWIDTH 115
 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 state checkdoublepickupbonus
         addvarvar POWERWRISTS ACTORPICKUPAMOUNT
         ifvarg ACTORPICKUPAMOUNT 1
         {
          redefinequote 335 ^22FOUND A POWER WRIST!
          redefinequote 336 ^22FOUND %ld POWER WRISTS!
          qsprintf 335 336 ACTORPICKUPAMOUNT
         }
         else redefinequote 335 ^22FOUND A POWER WRIST!

         state grabequippable
        }
       }
      }
     }
    }
   }
 }

}
enda

// Silk Carnation [Permenant Boost Item #1]
eventloadactor SILKCARNATION spritepal 10 setvar ACTORNATURALPAL 10 state setpickupflags enda
useractor notenemy SILKCARNATION 0 

 sizeat 12 12
 state itemfullbright
 spritepal 10
 setvar ACTORNATURALPAL 10
 setvar ACTORSHEIGHT 63 setvar ACTORSWIDTH 63
 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 state checkdoublepickupbonus
         addvarvar SILKCARNATIONS ACTORPICKUPAMOUNT

         ifvarand ACTORFLAGS 2 nullop
         else
         {
          sound FOUND_INVENTORY
          globalsound YEAH
          ifvare ACTORPICKUPAMOUNT 1
          { 
           redefinequote 836 ^14FOUND A SILK CARNATION!
          }
          else
          {
           redefinequote 836 ^14FOUND %ld SILK CARNATIONS!
           qsprintf 836 836 ACTORPICKUPAMOUNT
          }
          setvarvar fta fta_normal setvar ftq 836
         }
         ifspawnedby SILKCARNATION
          state getcode
         else
	    state quikget
        }
       }
      }
     }
    }
   }
 }
}
enda

// Rare Pirate Doubloon [Permenant Boost Item #2]
eventloadactor RAREPIRATEDOUBLOON state setpickupflags enda
useractor notenemy RAREPIRATEDOUBLOON 0 

 sizeat 10 10
 state itemfullbright
 setvar ACTORSHEIGHT 63 setvar ACTORSWIDTH 71
 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 state checkdoublepickupbonus
         addvarvar RAREPIRATEDOUBLOONS ACTORPICKUPAMOUNT

         ifvarand ACTORFLAGS 2 nullop
         else
         {
          sound FOUND_INVENTORY
          globalsound YEAH
          ifvare ACTORPICKUPAMOUNT 1
          { 
           redefinequote 836 ^14FOUND A RARE PIRATE DOUBLOON!
          }
          else
          {
           redefinequote 836 ^14FOUND %ld RARE PIRATE DOUBLOONS!
           qsprintf 836 836 ACTORPICKUPAMOUNT
          }
          setvarvar fta fta_normal setvar ftq 836
         }
         ifspawnedby RAREPIRATEDOUBLOON
          state getcode
         else
	    state quikget
        }
       }
      }
     }
    }
   }
 }

}
enda

// Pair of Fixed Dice [Permenant Boost Item #3]
eventloadactor FIXEDDICEPAIR state setpickupflags enda
useractor notenemy FIXEDDICEPAIR 0 

 sizeat 8 8
 state itemfullbright
 setvar ACTORSHEIGHT 67 setvar ACTORSWIDTH 67
 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 state checkdoublepickupbonus
         addvarvar FIXEDDICEPAIRS ACTORPICKUPAMOUNT

         ifvarand ACTORFLAGS 2 nullop
         else
         {
          sound FOUND_INVENTORY
          globalsound YEAH
          ifvare ACTORPICKUPAMOUNT 1
          { 
           redefinequote 836 ^14FOUND A PAIR OF FIXED DICE!
          }
          else
          {
           redefinequote 836 ^14FOUND %ld PAIRS OF FIXED DICE!
           qsprintf 836 836 ACTORPICKUPAMOUNT
          }
          setvarvar fta fta_normal setvar ftq 836
         }
         ifspawnedby FIXEDDICEPAIR
          state getcode
         else
	    state quikget
        }
       }
      }
     }
    }
   }
 }
}
enda

// Malakian Gem [Permenant Boost Item #4]
eventloadactor MALAKIANGEM spritepal 17 setvar ACTORNATURALPAL 17 state setpickupflags enda
useractor notenemy MALAKIANGEM 0 

 sizeat 12 12
 state itemfullbright
 spritepal 17
 setvar ACTORNATURALPAL 17
 setvar ACTORSHEIGHT 52 setvar ACTORSWIDTH 68
 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 state checkdoublepickupbonus
         addvarvar MALAKIANGEMS ACTORPICKUPAMOUNT

         ifvarand ACTORFLAGS 2 nullop
         else
         {
          sound FOUND_INVENTORY
          globalsound YEAH
          ifvare ACTORPICKUPAMOUNT 1
          { 
           redefinequote 836 ^14FOUND A MALAKIAN GEM!
          }
          else
          {
           redefinequote 836 ^14FOUND %ld MALAKIAN GEMS!
           qsprintf 836 836 ACTORPICKUPAMOUNT
          }
          setvarvar fta fta_normal setvar ftq 836
         }
         ifspawnedby MALAKIANGEM
          state getcode
         else
	    state quikget
        }
       }
      }
     }
    }
   }
 }
}
enda


// Safe Lock Box [Permenant Boost Item #5]
eventloadactor SAFELOCKBOX state setpickupflags enda
useractor notenemy SAFELOCKBOX 0 

 sizeat 14 14
 state itemfullbright
 setvar ACTORSHEIGHT 41 setvar ACTORSWIDTH 71
 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 state checkdoublepickupbonus
         addvarvar SAFELOCKBOXS ACTORPICKUPAMOUNT

         ifvarand ACTORFLAGS 2 nullop
         else
         {
          sound FOUND_INVENTORY
          globalsound YEAH
          ifvare ACTORPICKUPAMOUNT 1
          { 
           redefinequote 836 ^14FOUND A SAFE LOCK BOX!
          }
          else
          {
           redefinequote 836 ^14FOUND %ld SAFE LOCK BOXS!
           qsprintf 836 836 ACTORPICKUPAMOUNT
          }
          setvarvar fta fta_normal setvar ftq 836
         }
         ifspawnedby SAFELOCKBOX
          state getcode
         else
	    state quikget
        }
       }
      }
     }
    }
   }
 }
}
enda

// Secret Recipe [Permenant Boost Item #6]
eventloadactor SECRETRECIPE state setpickupflags enda
useractor notenemy SECRETRECIPE 0 

 sizeat 12 12
 state itemfullbright
 setvar ACTORSHEIGHT 72 setvar ACTORSWIDTH 63
 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 state checkdoublepickupbonus
         addvarvar SECRETRECIPES ACTORPICKUPAMOUNT

         ifvarand ACTORFLAGS 2 nullop
         else
         {
          sound FOUND_INVENTORY
          globalsound YEAH
          ifvare ACTORPICKUPAMOUNT 1
          { 
           redefinequote 836 ^14FOUND A SECRET RECIPE!
          }
          else
          {
           redefinequote 836 ^14FOUND %ld SECRET RECIPES!
           qsprintf 836 836 ACTORPICKUPAMOUNT
          }
          setvarvar fta fta_normal setvar ftq 836
         }
         ifspawnedby SECRETRECIPE
          state getcode
         else
	    state quikget
        }
       }
      }
     }
    }
   }
 }
}
enda

// Slurpee Machine [Permenant Boost Item #7]
eventloadactor SLURPEEMACHINE state setpickupflags enda
useractor notenemy SLURPEEMACHINE 0 

 sizeat 32 32
 state itemfullbright
 setvar ACTORSHEIGHT 78 setvar ACTORSWIDTH 48
 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 state checkdoublepickupbonus
         addvarvar SLURPEEMACHINES ACTORPICKUPAMOUNT

         ifvarand ACTORFLAGS 2 nullop
         else
         {
          sound FOUND_INVENTORY
          globalsound YEAH
          ifvare ACTORPICKUPAMOUNT 1
          { 
           redefinequote 836 ^14FOUND A SLURPEE MACHINE!
          }
          else
          {
           redefinequote 836 ^14FOUND %ld SLURPEE MACHINES!
           qsprintf 836 836 ACTORPICKUPAMOUNT
          }
          setvarvar fta fta_normal setvar ftq 836
         }
         ifspawnedby SLURPEEMACHINE
          state getcode
         else
	    state quikget
        }
       }
      }
     }
    }
   }
 }
}
enda

// Stock Ownership [Permenant Boost Item #8]
eventloadactor STOCKOWNERSHIP state setpickupflags enda
useractor notenemy STOCKOWNERSHIP 0 

 sizeat 12 12
 state itemfullbright
 setvar ACTORSHEIGHT 67 setvar ACTORSWIDTH 77
 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 state checkdoublepickupbonus
         addvarvar STOCKOWNERSHIPS ACTORPICKUPAMOUNT

         ifvarand ACTORFLAGS 2 nullop
         else
         {
          sound FOUND_INVENTORY
          globalsound YEAH
          ifvare ACTORPICKUPAMOUNT 1
          { 
           redefinequote 836 ^14FOUND A STOCK OWNERSHIP!
          }
          else
          {
           redefinequote 836 ^14FOUND %ld STOCK OWNERSHIPS!
           qsprintf 836 836 ACTORPICKUPAMOUNT
          }
          setvarvar fta fta_normal setvar ftq 836
         }
         ifspawnedby STOCKOWNERSHIP
          state getcode
         else
	    state quikget
        }
       }
      }
     }
    }
   }
 }
}
enda

// Transdimesnional Vault [Permenant Boost Item #9]
eventloadactor TRANSDIMENSIONALSAFE state setpickupflags enda
useractor notenemy TRANSDIMENSIONALSAFE 0 

 sizeat 32 32
 state itemfullbright
 setvar ACTORSHEIGHT 57 setvar ACTORSWIDTH 86
 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 state checkdoublepickupbonus
         addvarvar TRANSDIMENSIONALSAFES ACTORPICKUPAMOUNT

         ifvarand ACTORFLAGS 2 nullop
         else
         {
          sound FOUND_INVENTORY
          globalsound YEAH
          ifvare ACTORPICKUPAMOUNT 1
          { 
           redefinequote 836 ^14FOUND A TRANSDIMENSIONAL SAFE!
          }
          else
          {
           redefinequote 836 ^14FOUND %ld TRANSDIMENSIONAL SAFES!
           qsprintf 836 836 ACTORPICKUPAMOUNT
          }
          setvarvar fta fta_normal setvar ftq 836
         }
         ifspawnedby TRANSDIMENSIONALSAFE
          state getcode
         else
	    state quikget
        }
       }
      }
     }
    }
   }
 }
}
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 state checkdoublepickupbonus
         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 { espawn ENERGYSHELL 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*
//*********************