/*
       getactorvar[PLAYERID].VEHICLEID tempvehicleid
       ifvare tempvehicleid -1
       {
       }
       else
       {
        ifvare vehiclepickuptoggle 0 // Character Only
        {
        }
        ifvare vehiclepickuptoggle 1 // Vehicle Only
        {
        }
        ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
        {
        }
        ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
        {
        }
       }
*/

state showholonames_shop
   ifvare CHARACTERSELECTED? 1 redefinequote 332 HOLODUKE
   ifvare CHARACTERSELECTED? 2 redefinequote 332 HOLOJACK
   ifvare CHARACTERSELECTED? 3 redefinequote 332 HOLOBUBSY
   ifvare CHARACTERSELECTED? 4 redefinequote 332 HOLOAMI
   ifvare CHARACTERSELECTED? 5 redefinequote 332 HOLOHIGA
   ifvare CHARACTERSELECTED? 6 redefinequote 332 HOLOESSENCE
   ifvare CHARACTERSELECTED? 7 redefinequote 332 HOLOTED
   ifvare CHARACTERSELECTED? 8 redefinequote 332 HOLOLISA
   ifvare CHARACTERSELECTED? 9 redefinequote 332 HOLOCYBANIS
   ifvare CHARACTERSELECTED? 10 redefinequote 332 HOLONETHRA
   ifvare CHARACTERSELECTED? 11 redefinequote 332 HOLOPAULA
   ifvare CHARACTERSELECTED? 12 redefinequote 332 HOLOLORI
   ifvare CHARACTERSELECTED? 13 redefinequote 332 HOLOMINAKO
   ifvare CHARACTERSELECTED? 14 redefinequote 332 HOLO???????
   ifvare CHARACTERSELECTED? 15 redefinequote 332 HOLOMAKEN
ends

state shop_shownvtime
     setvar shade 0
     setvar digx 303 // 224
     subvar digy 2
     state orientation27
     state pal20
     redefinequote 598 X%
     redefinequote 599 %ld%%
     setvarvar TEMP2 NIGHTVISIONTIME
     divvar TEMP2 12
     qsprintf 598 599 TEMP2
     qstrlen TEMPVAR 598
     ifvarg TEMPVAR 0 
     { 
      setvarvar tempb TEMPVAR
      mulvar tempb 2
      subvarvar digx tempb
      subvar digx 2
     }    
     setvar tilenum 3087 // setvar tilenum 3010
     setvar temp 598
     state mt
ends

state shop_cheatdisplay1
    setvar digx 244
    redefinequote 332 $0.00
    setvar SHOPTEMP -1
ends

state shop_selection0cond
   ifvare shopselection 0 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                     else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection1cond
   ifvare shopselection 1 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                     else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection2cond
   ifvare shopselection 2 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                     else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection3cond
   ifvare shopselection 3 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                     else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection4cond
   ifvare shopselection 4 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                     else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection5cond
   ifvare shopselection 5 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                     else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection6cond
   ifvare shopselection 6 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                     else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection7cond
   ifvare shopselection 7 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                     else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection8cond
   ifvare shopselection 8 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                     else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection9cond
   ifvare shopselection 9 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                     else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection10cond
   ifvare shopselection 10 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                      else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection11cond
   ifvare shopselection 11 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                      else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection12cond
   ifvare shopselection 12 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                      else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection13cond
   ifvare shopselection 13 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                      else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection14cond
   ifvare shopselection 14 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                      else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection15cond
   ifvare shopselection 15 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                      else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection16cond
   ifvare shopselection 16 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                      else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection17cond
   ifvare shopselection 17 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                      else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection18cond
   ifvare shopselection 18 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                      else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection19cond
   ifvare shopselection 19 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                      else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection20cond
   ifvare shopselection 20 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                      else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_selection21cond
   ifvare shopselection 21 { ifvarvarg DOLLARS SHOPTEMP state pal22 else state pal21 } 
                      else { ifvarvarg DOLLARS SHOPTEMP state pal20 else state pal10 }
ends

state shop_showvehicleportraits
     ifvare VEHICLETYPE 0 setvar tilenum 7950
     else ifvare VEHICLETYPE 1 setvar tilenum 7951
     else ifvare VEHICLETYPE 2 setvar tilenum 7952
     else setvar tilenum 7955
     state digz16384
     setvar orientation 35
     setvar shade 16
     state pal0
ends

state shop_showinventoryportraits
    state digz16384
    setvar orientation 35
    setvar tilenum 7931
    setvar shade 16
    state pal0
ends

state shop_showinventoryamounts
    state pal15
    setvar digx 300
    subvar digy 2 // setvar digy 152 // 146
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    setvar shade 0
    state dn
ends

state shop_showcharacterportraits
    ifvare CHARACTERSELECTED? 1 setvar tilenum 7936 // Duke
    else ifvare CHARACTERSELECTED? 2 setvar tilenum 7937 // Jack
    else ifvare CHARACTERSELECTED? 3 { ifvare BUBSYFORM? 0 setvar tilenum 7938 else ifvare BUBSYFORM? 1 setvar tilenum 7962 } // Bubsy
    else ifvare CHARACTERSELECTED? 4 { ifvare AMIFORM? 0 setvar tilenum 7939 else ifvare AMIFORM? 1 setvar tilenum 7963 else ifvare AMIFORM? 2 setvar tilenum 7966 } // Ami
    else ifvare CHARACTERSELECTED? 5 setvar tilenum 7940 // Lo Wang
    else ifvare CHARACTERSELECTED? 6 setvar tilenum 7941 // ESSence
    else ifvare CHARACTERSELECTED? 7 setvar tilenum 7942 // Ted
    else ifvare CHARACTERSELECTED? 8 setvar tilenum 7943 // Lisa
    else ifvare CHARACTERSELECTED? 9 setvar tilenum 7944 // Cybanis
    else ifvare CHARACTERSELECTED? 10 { ifvare NETHRAFORM? 0 setvar tilenum 7945 else ifvare NETHRAFORM? 1 setvar tilenum 7964 } // Nethra/Christina
    else ifvare CHARACTERSELECTED? 11 setvar tilenum 7946 // Paula
    else ifvare CHARACTERSELECTED? 12 setvar tilenum 7947 // Lori
    else ifvare CHARACTERSELECTED? 13 { ifvare MINAKOFORM? 0 setvar tilenum 7948 else ifvare MINAKOFORM? 1 setvar tilenum 7965 else ifvare MINAKOFORM? 2 setvar tilenum 7968 } // Minako
    else ifvare CHARACTERSELECTED? 14 setvar tilenum 7957 // Mystery Lady
    else ifvare CHARACTERSELECTED? 15 setvar tilenum 7971 // Maken
    else setvar tilenum 7955 // ?
    state digz16384
    setvar orientation 35
    setvar shade 16
    state pal0
ends

state shop_assesscharacterHP
    state pal21
    redefinequote 598 X%
    redefinequote 599 %ld%%
    setvarvar TEMP2 CURRENTHITPOINTS
    mulvar TEMP2 100
    divvarvar TEMP2 MAXHITPOINTS
    qsprintf 598 599 TEMP2
    qstrlen TEMPVAR 598
    ifvarg TEMPVAR 0 
    { 
     setvarvar tempb TEMPVAR
     mulvar tempb 2
     subvarvar digx tempb
     subvar digx 2
    }    
    setvar temp 598
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    setvar shade 0
ends

state shop_assessvehicleHP
     state pal21
     redefinequote 598 X%
     redefinequote 599 %ld%%
     getactorvar[VEHICLEID].ENEMYHP TEMPVAR3
     setvarvar TEMP2 TEMPVAR3
     mulvar TEMP2 100
     getactorvar[VEHICLEID].ENEMYMAXHP TEMPVAR3
     divvarvar TEMP2 TEMPVAR3
     qsprintf 598 599 TEMP2
     qstrlen TEMPVAR 598
     ifvarg TEMPVAR 0 
     { 
      setvarvar tempb TEMPVAR
      mulvar tempb 2
      subvarvar digx tempb
      subvar digx 2
     }    
     setvar tilenum 3087 // setvar tilenum 3010
     state orientation27
     setvar temp 598
     setvar shade 0
ends

state shop_assesscharacterAP
    state pal17
    redefinequote 598 X%
    redefinequote 599 %ld%%
    setvarvar TEMP2 CURRENTARMORPOINTS
    mulvar TEMP2 100
    divvarvar TEMP2 MAXARMORPOINTS
    qsprintf 598 599 TEMP2
    qstrlen TEMPVAR 598
    ifvarg TEMPVAR 0 
    { 
     setvarvar tempb TEMPVAR
     mulvar tempb 2
     subvarvar digx tempb
     subvar digx 2
    }    
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    setvar temp 598
    setvar shade 0
ends

state shop_assessvehicleAP
    state pal17
    redefinequote 598 X%
    redefinequote 599 %ld%%
    getactorvar[VEHICLEID].ENEMYAP TEMPVAR3
    setvarvar TEMP2 TEMPVAR3
    mulvar TEMP2 100
    getactorvar[VEHICLEID].ENEMYMAXAP TEMPVAR3
    divvarvar TEMP2 TEMPVAR3
    qsprintf 598 599 TEMP2
    qstrlen TEMPVAR 598
    ifvarg TEMPVAR 0 
    { 
     setvarvar tempb TEMPVAR
     mulvar tempb 2
     subvarvar digx tempb
     subvar digx 2
    }    
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    setvar temp 598
    setvar shade 0
ends

state shop_assesscharacterFA
    state pal20
    redefinequote 598 X%
    redefinequote 599 %ld%%
    setvarvar TEMP2 FIRSTAIDCURRENT
    mulvar TEMP2 100
    divvarvar TEMP2 MAXHITPOINTS
    qsprintf 598 599 TEMP2
    qstrlen TEMPVAR 598
    ifvarg TEMPVAR 0 
    { 
     setvarvar tempb TEMPVAR
     mulvar tempb 2
     subvarvar digx tempb
     subvar digx 2
    }    
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    setvar temp 598
    setvar shade 0
ends

state shop_assessvehicleFA
    state pal20
     redefinequote 598 X%
     redefinequote 599 %ld%%
     getactorvar[VEHICLEID].ENEMYFIRSTAID TEMPVAR3
     setvarvar TEMP2 TEMPVAR3
     mulvar TEMP2 100
     getactorvar[VEHICLEID].ENEMYMAXHP TEMPVAR3
     divvarvar TEMP2 TEMPVAR3
     qsprintf 598 599 TEMP2
     qstrlen TEMPVAR 598
     ifvarg TEMPVAR 0 
     { 
      setvarvar tempb TEMPVAR
      mulvar tempb 2
      subvarvar digx tempb
      subvar digx 2
     }    
     setvar tilenum 3087 // setvar tilenum 3010
     state orientation27
     setvar temp 598
     setvar shade 0
ends

state shope_showinvsell
    setvar digx 300
    setvar digy 122
    state shop_showinventoryportraits
    state rs
ends

state shop_showmaxammoall
    setvar shade 0
    state pal20
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    setvarvar varname MAXPISTOL
    subvar digy 8 // 224
    state dn
    setvarvar varname MAXSHOTGUN
    addvar digy 6 // 224
    state dn
    setvarvar varname MAXCHAINGUN
    addvar digy 6 // 224
    state dn
    setvarvar varname MAXRPG
    addvar digy 6 // 224
    state dn
    setvarvar varname MAXPIPEBOMB
    addvar digy 6 // 224
    state dn
    setvarvar varname MAXSHRINKER
    addvar digy 6 // 224
    state dn
    setvarvar varname MAXDEVASTATOR
    addvar digy 6 // 224
    state dn
    setvarvar varname MAXTRIPBOMB
    addvar digy 6 // 224
    state dn
    setvarvar varname MAXFREEZER
    addvar digy 6 // 224
    state dn
    setvarvar varname MAXEXPANDER
    addvar digy 6 // 224
    state dn
    ifvare CHARACTERSELECTED? 8
    {
     setvar shade 8
     setvarvar varname MAXCELLS
     addvar digy 6 // 224
     state dn
    }
ends

state shop_showecells
    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state digz16384
    setvar orientation 35
    ifvare LISA? 1 setvarvar tilenum 7943 else setvar tilenum 7955
    setvar shade 16
    state pal0
    state rs

    setvar shade 0
    state pal0
    ifvare LISA? 1 setvarvar varname CURRENTCELLS else setvar varname 0 // Lisa must be available to have Cells, since they are specfic to her only.
    subvar digy 5 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
    state pal20
    ifvare LISA? 1 setvarvar varname MAXCELLS else setvar varname 0 // Lisa must be available to have Cells, since they are specfic to her only.
    addvar digy 6 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
ends

state shop_display

 ifvare shop_id -1
 {
  ifvarg shoptransitiontimer 0
  {
   ifvare shoptransitiontimer 1 setvar digz 7022
   else ifvare shoptransitiontimer 2 setvar digz 14043
   else ifvare shoptransitiontimer 3 setvar digz 21065
   else ifvare shoptransitiontimer 4 setvar digz 28087
   else ifvare shoptransitiontimer 5 setvar digz 35108
   else ifvare shoptransitiontimer 6 setvar digz 42130
   else ifvarg shoptransitiontimer 6 setvar digz 49152

   state pal0
   setvar shade 16
   state digx160
   setvar digy 100
   state orientation2 //  state orientation3
   setvar tilenum 2456 // For the shop background >.> (2456 or 8191)
   state rs
  }
 }

 ifvarn shop_id -1
 {
  ifvare shoptype 1 getactor[shopowner].extra shopownerhealth
  setvar digx 46
  setvar digy 20
  setvar tilenum 3087 // setvar tilenum 3010
  state orientation27
  setvarvar varname shopownerhealth
  ifvare debugtoggle 1 state dn

  ifvare shoptype 1 
  { 
   state digx160
   setvar digy 20
   setvar tilenum 3087 // setvar tilenum 3010
   state orientation27
   setvarvar varname shopowner
   ifvare debugtoggle 1 state dn
  }

  setvar digx 274
  setvar digy 20
  setvar tilenum 3087 // setvar tilenum 3010
  state orientation27
  setvarvar varname shop_id
  ifvare debugtoggle 1 state dn

  ifvare shoptype 1 
  { 
   ifvarl shopownerhealth 0 // exits the shop if the owner dies, but only if it's an actor [not a wall or a console cheat-activated shop]
   {
    setvar shop_id -1 
    setvar shoppage 0 
    setvar shopselection 0 
    setvar shopmode 0 
    setvar shopowner -1 
    setvar shopownerhealth -1
    setvar shoptype 0
    sound MENU_EXIT 
   }
  }

  ifvare gameover? 1
  {
    setvar shop_id -1 
    setvar shoppage 0 
    setvar shopselection 0 
    setvar shopmode 0 
    setvar shopowner -1 
    setvar shopownerhealth -1
    setvar shoptype 0
  }
    
  ifvarg shoptransitiontimer 6
  {
   // SHOP BACKGROUND
   state pal4
   state digx160
   setvar digy 100 // 129
   setvar digz 655360
   state orientation2 //  state orientation3
   setvar tilenum 7800 // For the shop background >.> (2456 or 8191)
   state rs
  }
  
  ifvarg shoptransitiontimer 0
  {
   ifvare shoptransitiontimer 1 setvar digz 7022
   else ifvare shoptransitiontimer 2 setvar digz 14043
   else ifvare shoptransitiontimer 3 setvar digz 21065
   else ifvare shoptransitiontimer 4 setvar digz 28087
   else ifvare shoptransitiontimer 5 setvar digz 35108
   else ifvare shoptransitiontimer 6 setvar digz 42130
   else ifvarg shoptransitiontimer 6 setvar digz 49152

   state pal0
   setvar shade 16
   state digx160
   setvar digy 100
   state orientation2 //  state orientation3
   setvar tilenum 2456 // For the shop background >.> (2456 or 8191)
   state rs
  }

  state shade0

// Titles
  ifvarg shoptransitiontimer 6
  { // ifvarg shoptransitiontimer 6

  setvar digy 20
  state orientation2
  state setquote332
  setvar tilenum 2822
  ifvare shopmode 0 
  { 
   setvar digx 256
   redefinequote 332 BUY ITEMS
  }
  else
  ifvare shopmode 1
  { 
   setvar digx 246
   redefinequote 332 SELL ITEMS
  }
  state gt

// Below Menu
 state pal0
 state shade-31
 setvar temp 1001

 state digx160
 setvar digy 177
 redefinequote 1001 

 getkeyname 501 17 0
 qstrcat 1001 501
 redefinequote 502 /
 qstrcat 1001 502
 getkeyname 503 18 0
 qstrcat 1001 503
 redefinequote 504 = TOGGLE BUY/SELL MODES
 qstrcat 1001 504
 qstrlen TEMPVAR 1001
 ifvarg TEMPVAR 0 
 { 
  setvarvar tempb TEMPVAR
  mulvar tempb 2
  subvarvar digx tempb
  subvar digx 2
 }
 state mt

 state digx160 // 89
 setvar digy 183
 redefinequote 1001 

 getkeyname 501 30 0
 qstrcat 1001 501
 redefinequote 502 =EXIT  
 qstrcat 1001 502

 getkeyname 503 31 0
 qstrcat 1001 503
 redefinequote 504 =SHIFT PG  
 qstrcat 1001 504

 getkeyname 505 6 0
 qstrcat 1001 505
 ifvare shopmode 0 redefinequote 506 =BUY ITEM
 else ifvare shopmode 1 redefinequote 506 =SELL ITEM
 qstrcat 1001 506

 setvar temp 1001
 qstrlen TEMPVAR 1001
 ifvarg TEMPVAR 0 
 { 
  setvarvar tempb TEMPVAR
  mulvar tempb 2
  subvarvar digx tempb
  subvar digx 3
 }
 state mt


 state digx160 // 89
 setvar digy 189
 redefinequote 1001 

 getkeyname 501 0 0
 qstrcat 1001 501
 redefinequote 502 =CURSOR UP  
 qstrcat 1001 502

 getkeyname 503 1 0
 qstrcat 1001 503
 redefinequote 504 =CURSOR DOWN
 qstrcat 1001 504

 setvar temp 1001
 qstrlen TEMPVAR 1001
 ifvarg TEMPVAR 0 
 { 
  setvarvar tempb TEMPVAR
  mulvar tempb 2
  subvarvar digx tempb
  subvar digx 2
 }
 state mt
state pal0

 setvar temp 332
  // Show Current Money
	state pal22
	setvar digx 41
	setvar digy 169
	ifvarg CENTS -1 ifvarl CENTS 10 setvar temp 193 else setvar temp 194 
	state mt

  // IMPORTANT: FROM HERE ON, YOU NEED TO DEFINE WHICH IDs SHOW WHAT TEXT AND DETAILS

ifvare shop_id 0
{
 ifvare shopmode 0 // Buying
 {
  ifvare shoppage 0
  {
   setvar digx 58
   state pal20
   state setquote332
 
   setvar digy 35 // 73 64 55 46
   redefinequote 332 SMALL MEDIKIT [+10%HP]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 74
   state shop_selection0cond
   state mt  

   setvar digy 41
   redefinequote 332 MEDIUM MEDIKIT [+20%HP]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 134
   state shop_selection1cond
   state mt 

   setvar digy 47
   redefinequote 332 LARGE MEDIKIT [+30%HP]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 199
   state shop_selection2cond
   state mt

   setvar digy 53
   redefinequote 332 EXTRA-LARGE MEDIKIT [+50%HP]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 334
   state shop_selection3cond
   state mt

   setvar digy 59
   redefinequote 332 ATOMIC HEALTH [+50%HP]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 624
   state shop_selection4cond
   state mt

   setvar digy 65
   redefinequote 332 SUPER ATOM [+200%HP/AP/FA]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 3999
   state shop_selection5cond
   state mt

   setvar digy 71
   redefinequote 332 BODY ARMOR [+100%AP]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 499
   state shop_selection6cond
   state mt

   setvar digy 77
   redefinequote 332 SUPER ARMOR [+200%AP]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1499
   state shop_selection7cond
   state mt

   setvar digy 83
   redefinequote 332 VITAMIN X
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 6399
   state shop_selection8cond
   state mt

   setvar digy 89
   redefinequote 332 NIGHT VISION GOGGLES
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 999
   state shop_selection9cond
   state mt

   setvar digy 95
   state showholonames_shop
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1249
   state shop_selection10cond
   state mt

   setvar digy 101
   redefinequote 332 JETPACK
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1499
   state shop_selection11cond
   state mt

   setvar digy 107
   redefinequote 332 SCUBA GEAR
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1499
   state shop_selection12cond
   state mt

   setvar digy 113
   redefinequote 332 PROTECTIVE BOOTS
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 999
   state shop_selection13cond
   state mt

   setvar digy 119
   redefinequote 332 PORTABLE MEDIKIT
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1999
   state shop_selection14cond
   state mt

   setvar digy 125
   redefinequote 332 EYEDROP
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 124
   state shop_selection15cond
   state mt

   setvar digy 131
   redefinequote 332 ANTIDOTE
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 174
   state shop_selection16cond
   state mt

   setvar digy 137
   redefinequote 332 FOGHORN
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 224
   state shop_selection17cond
   state mt

   setvar digy 143
   redefinequote 332 RESURRECTION CHALICE
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 2999
   state shop_selection18cond
   state mt

   setvar digy 149
   redefinequote 332 MAXIMUM HP/AP BONUS
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 6249
   state shop_selection19cond
   state mt

   setvar digy 155
   redefinequote 332 ATTACK/DEFENSE BONUS
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 6249
   state shop_selection20cond
   state mt

   setvar digy 161
   redefinequote 332 SPEED BONUS
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 3749
   state shop_selection21cond
   state mt

//

   setvar digx 248 // 224
   state pal20

   setvar digy 35
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 240
    redefinequote 332 $75.00
    setvar SHOPTEMP 74
   }
   state shop_selection0cond
   state mt

   setvar digy 41
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $135.00
    setvar SHOPTEMP 134
   }
   state shop_selection1cond
   state mt 

   setvar digy 47
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $200.00
    setvar SHOPTEMP 199
   }
   state shop_selection2cond
   state mt

   setvar digy 53
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $335.00
    setvar SHOPTEMP 334
   }
   state shop_selection3cond
   state mt

   setvar digy 59
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $625.00
    setvar SHOPTEMP 624
   }
   state shop_selection4cond
   state mt

   setvar digy 65
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $4000.00
    setvar SHOPTEMP 3999
   }
   state shop_selection5cond
   state mt

   setvar digy 71
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $500.00
    setvar SHOPTEMP 499
   }
   state shop_selection6cond
   state mt

   setvar digy 77
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $1500.00
    setvar SHOPTEMP 1499
   }
   state shop_selection7cond
   state mt

   setvar digy 83
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $6400.00
    setvar SHOPTEMP 6399
   }
   state shop_selection8cond
   state mt

   setvar digy 89
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $1000.00
    setvar SHOPTEMP 999
   }
   state shop_selection9cond
   state mt

   setvar digy 95
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $1250.00
    setvar SHOPTEMP 1249
   }
   state shop_selection10cond
   state mt

   setvar digy 101
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $1500.00
    setvar SHOPTEMP 1499
   }
   state shop_selection11cond
   state mt

   setvar digy 107
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $1500.00
    setvar SHOPTEMP 1499
   }
   state shop_selection12cond
   state mt

   setvar digy 113
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $1000.00
    setvar SHOPTEMP 999
   }
   state shop_selection13cond
   state mt

   setvar digy 119
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $2000.00
    setvar SHOPTEMP 1999
   }
   state shop_selection14cond
   state mt

   setvar digy 125
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $125.00
    setvar SHOPTEMP 124
   }
   state shop_selection15cond
   state mt

   setvar digy 131
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $175.00
    setvar SHOPTEMP 174
   }
   state shop_selection16cond
   state mt

   setvar digy 137
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $225.00
    setvar SHOPTEMP 224
   }
   state shop_selection17cond
   state mt

   setvar digy 143
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $3000.00
    setvar SHOPTEMP 2999
   }
   state shop_selection18cond
   state mt

   setvar digy 149
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $6250.00
    setvar SHOPTEMP 6249
   }
   state shop_selection19cond
   state mt

   setvar digy 155
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $6250.00
    setvar SHOPTEMP 6249
   }
   state shop_selection20cond
   state mt

   setvar digy 161
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $3750.00
    setvar SHOPTEMP 3749
   }
   state shop_selection21cond
   state mt
   // Maximum Items per page = 22

   // Item Pictures
   setvar diga 0
   
   ifvare shopselection 0
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 51
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar digx 303
    setvar digy 120 // 114
    state shop_assesscharacterHP
    state mt

    // Vehicle Stats
    ifvarn VEHICLEID -1
    {
     setvar digx 300 // 224
     addvar digy 20 // setvar digy 138 // 224
     state shop_showvehicleportraits
     state rs

     setvar digx 303 // 224
     subvar digy 2 // setvar digy 136 // 130
     state shop_assessvehicleHP
     state mt
    }

    // Inventory Amounts
    setvar digx 300 // 224
    addvar digy 20 // setvar digy 154 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname SMALLMEDIKITS
    state shop_showinventoryamounts
   }
   ifvare shopselection 1
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 34
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar digx 303
    setvar digy 120 // 114
    state shop_assesscharacterHP
    state mt

    // Vehicle Stats
    ifvarn VEHICLEID -1
    {
     setvar digx 300 // 224
     addvar digy 20 // setvar digy 138 // 224
     state shop_showvehicleportraits
     state rs

     setvar digx 303 // 224
     subvar digy 2 // setvar digy 136 // 130
     state shop_assessvehicleHP
     state mt
    }

    // Inventory Amounts
    setvar digx 300 // 224
    addvar digy 20 // setvar digy 154 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname SWMEDIKITS
    state shop_showinventoryamounts
   }
   ifvare shopselection 2
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 52
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar digx 303
    setvar digy 120 // 114
    state shop_assesscharacterHP
    state mt

    // Vehicle Stats
    ifvarn VEHICLEID -1
    {
     setvar digx 300 // 224
     addvar digy 20 // setvar digy 138 // 224
     state shop_showvehicleportraits
     state rs

     setvar digx 303 // 224
     subvar digy 2 // setvar digy 136 // 130
     state shop_assessvehicleHP
     state mt
    }

    // Inventory Amounts
    setvar digx 300 // 224
    addvar digy 20 // setvar digy 154 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname LARGEMEDIKITS
    state shop_showinventoryamounts
   }
   ifvare shopselection 3
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 35
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar digx 303
    setvar digy 120 // 114
    state shop_assesscharacterHP
    state mt

    // Vehicle Stats
    ifvarn VEHICLEID -1
    {
     setvar digx 300 // 224
     addvar digy 20 // setvar digy 138 // 224
     state shop_showvehicleportraits
     state rs

     setvar digx 303 // 224
     subvar digy 2 // setvar digy 136 // 130
     state shop_assessvehicleHP
     state mt
    }

    // Inventory Amounts
    setvar digx 300 // 224
    addvar digy 20 // setvar digy 154 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname SWBIGMEDIKITS
    state shop_showinventoryamounts
   }
   ifvare shopselection 4
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 100
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar digx 303
    setvar digy 120 // 114
    state shop_assesscharacterHP
    state mt

    // Vehicle Stats
    ifvarn VEHICLEID -1
    {
     setvar digx 300 // 224
     addvar digy 20 // setvar digy 138 // 224
     state shop_showvehicleportraits
     state rs

     setvar digx 303 // 224
     subvar digy 2 // setvar digy 136 // 130
     state shop_assessvehicleHP
     state mt
    }

    // Inventory Amounts
    setvar digx 300 // 224
    addvar digy 20 // setvar digy 154 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname ATOMICHEALTHS
    state shop_showinventoryamounts
   }
   ifvare shopselection 5
   {
    state pal16
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz49152
    setvar tilenum 100
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar digx 303
    setvar digy 119 // 119
    state shop_assesscharacterAP
    state mt

    setvar digx 303
    subvar digy 6 // 113
    state shop_assesscharacterHP
    state mt

    setvar digx 303
    addvar digy 12 // 125
    state shop_assesscharacterFA
    state mt

    // Vehicle Stats
    ifvarn VEHICLEID -1
    {
     setvar digx 300 // 224
     addvar digy 15 // setvar digy 138 // 224
     state shop_showvehicleportraits
     state rs

     setvar digx 303 // 224
     subvar digy 3 // setvar digy 136 // 130
     state shop_assessvehicleAP
     state mt

     setvar digx 303
     subvar digy 6 // 114
     state shop_assessvehicleHP
     state mt

     setvar digx 303
     addvar digy 12 // 114
     state shop_assessvehicleFA
     state mt
    }

    // Inventory Amounts
    setvar digx 300 // 224
    addvar digy 15 // setvar digy 154 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname SUPERATOMS
    state shop_showinventoryamounts

   }
   ifvare shopselection 6
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    ifvare ARMORAPPEARANCE? 0 { state digz32768 setvar tilenum 66 }
    ifvare ARMORAPPEARANCE? 1 { state digz32768 setvar tilenum 5383 }
    ifvare ARMORAPPEARANCE? 2 { state digz32768 setvar tilenum 5381 }
    ifvare ARMORAPPEARANCE? 3 { state digz32768 setvar tilenum 5382 }
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar digx 303
    setvar digy 120 // 114
    state shop_assesscharacterAP
    state mt

    // Vehicle Stats
    ifvarn VEHICLEID -1
    {
     setvar digx 300 // 224
     addvar digy 20 // setvar digy 138 // 224
     state shop_showvehicleportraits
     state rs

     setvar digx 303 // 224
     subvar digy 2 // setvar digy 136 // 130
     state shop_assessvehicleAP
     state mt
    }

    // Inventory Amounts
    setvar digx 300 // 224
    addvar digy 20 // setvar digy 154 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname BODYARMORS
    state shop_showinventoryamounts
   }
   ifvare shopselection 7
   {
    state pal24
    setvar digx 300 // 224
    setvar digy 98 // 224
    ifvare ARMORAPPEARANCE? 0 { state digz49152 setvar tilenum 66 }
    ifvare ARMORAPPEARANCE? 1 { state digz49152 setvar tilenum 5383 }
    ifvare ARMORAPPEARANCE? 2 { state digz49152 setvar tilenum 5381 }
    ifvare ARMORAPPEARANCE? 3 { state digz49152 setvar tilenum 5382 }
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar digx 303
    setvar digy 120 // 114
    state shop_assesscharacterAP
    state mt

    // Vehicle Stats
    ifvarn VEHICLEID -1
    {
     setvar digx 300 // 224
     addvar digy 20 // setvar digy 138 // 224
     state shop_showvehicleportraits
     state rs

     setvar digx 303 // 224
     subvar digy 2 // setvar digy 136 // 130
     state shop_assessvehicleAP
     state mt
    }

    // Inventory Amounts
    setvar digx 300 // 224
    addvar digy 20 // setvar digy 154 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname SUPERARMORS
    state shop_showinventoryamounts
   }
   ifvare shopselection 8
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 5424 // 55
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    setvar digx 303 // 224
    subvar digy 2
    state orientation27
    state pal20
    redefinequote 598 X%
    redefinequote 599 %ld%%
    setvarvar TEMP2 STEROIDSTIME
    divvar TEMP2 4
    qsprintf 598 599 TEMP2
    qstrlen TEMPVAR 598
    ifvarg TEMPVAR 0 
    { 
     setvarvar tempb TEMPVAR
     mulvar tempb 2
     subvarvar digx tempb
     subvar digx 2
    }    
    setvar tilenum 3087 // setvar tilenum 3010
    setvar temp 598
    state mt

    // Vehicles Cannot Use VitaminX

    // Inventory Amounts
    setvar digx 300 // 224
    addvar digy 20
    state shop_showinventoryportraits
    state rs

    setvarvar varname VITAMINXS
    state shop_showinventoryamounts
   }
   ifvare shopselection 9
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 59
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    ifvare CHARACTERSELECTED? 4
    {
     ifvare AMI? 1
     {
      setvar shade 0
      state pal20
      setvar digx 300 // 224
      setvar digy 122 // 224
      state digz98304
      setvar tilenum 8182
      state rs
      subvar digy 2
     }
     else state shop_shownvtime
    }
    else
    ifvare CHARACTERSELECTED? 8
    {
     ifvare LISA? 1
     {
      ifvare HAVEHACKERVISION? 1
      {
       setvar shade 0
       state pal20
       setvar digx 300 // 224
       setvar digy 122 // 224
       state digz98304
       setvar tilenum 8182
       state rs
       subvar digy 2
      }
      else state shop_shownvtime
     }
    }
    else state shop_shownvtime

    // Vehicles Cannot Use NVGoggles

    // Inventory Amounts
    setvar digx 300 // 224
    addvar digy 20
    state shop_showinventoryportraits
    state rs

    setvarvar varname HEATSENSORS
    state shop_showinventoryamounts
   }
   ifvare shopselection 10
   {    
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz24576
    ifvare CHARACTERSELECTED? 6 { state pal24 setvar tilenum 5426 }
    else ifvare CHARACTERSELECTED? 9 { state pal24 setvar tilenum 5430 }
    else { state pal0 setvar tilenum 1348 }
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    setvar digx 303 // 224
    subvar digy 2
    state orientation27
    state pal20
    redefinequote 598 X%
    redefinequote 599 %ld%%
    setvarvar TEMP2 HOLOFORMTIME
    divvar TEMP2 24
    qsprintf 598 599 TEMP2
    qstrlen TEMPVAR 598
    ifvarg TEMPVAR 0 
    { 
     setvarvar tempb TEMPVAR
     mulvar tempb 2
     subvarvar digx tempb
     subvar digx 2
    }    
    setvar tilenum 3087 // setvar tilenum 3010
    setvar temp 598
    state mt

    // Vehicles Cannot Use Holos

    // Inventory Amounts
    setvar digx 300 // 224
    addvar digy 20
    state shop_showinventoryportraits
    state rs

    setvarvar varname HOLOFORMS
    state shop_showinventoryamounts
   }
   ifvare shopselection 11
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 57
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    setvar digx 303 // 224
    subvar digy 2
    state orientation27
    state pal20
    redefinequote 598 X%
    redefinequote 599 %ld%%
    setvarvar TEMP2 JETPACKTIME
    divvar TEMP2 16
    qsprintf 598 599 TEMP2
    qstrlen TEMPVAR 598
    ifvarg TEMPVAR 0 
    { 
     setvarvar tempb TEMPVAR
     mulvar tempb 2
     subvarvar digx tempb
     subvar digx 2
    }    
    setvar tilenum 3087 // setvar tilenum 3010
    setvar temp 598
    state mt

    // Vehicles Cannot Use Jetpacks

    // Inventory Amounts
    setvar digx 300 // 224
    addvar digy 20
    state shop_showinventoryportraits
    state rs

    setvarvar varname JETPACKS
    state shop_showinventoryamounts
   }
   ifvare shopselection 12
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 56
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    setvar digx 303 // 224
    subvar digy 2
    state orientation27
    state pal20
    redefinequote 598 X%
    redefinequote 599 %ld%%
    setvarvar TEMP2 SCUBATIME
    divvar TEMP2 64
    qsprintf 598 599 TEMP2
    qstrlen TEMPVAR 598
    ifvarg TEMPVAR 0 
    { 
     setvarvar tempb TEMPVAR
     mulvar tempb 2
     subvarvar digx tempb
     subvar digx 2
    }    
    setvar tilenum 3087 // setvar tilenum 3010
    setvar temp 598
    state mt

    // Vehicle Stats
    ifvarn VEHICLEID -1
    {
     setvar digx 300 // 224
     addvar digy 20 // setvar digy 138 // 224
     state shop_showvehicleportraits
     state rs

     setvar shade 0
     setvar digx 303 // 224
     subvar digy 2 // setvar digy 136 // 130
     state orientation27
     state pal20
     redefinequote 598 X%
     redefinequote 599 %ld%%
     getactorvar[VEHICLEID].ENEMYAIRTANKAMOUNT TEMP2 // setvarvar TEMP2 SCUBATIME
     divvar TEMP2 64
     qsprintf 598 599 TEMP2
     qstrlen TEMPVAR 598
     ifvarg TEMPVAR 0 
     { 
      setvarvar tempb TEMPVAR
      mulvar tempb 2
      subvarvar digx tempb
      subvar digx 2
     }    
     setvar tilenum 3087 // setvar tilenum 3010
     setvar temp 598
     state mt
    }

    // Inventory Amounts
    setvar digx 300 // 224
    addvar digy 20
    state shop_showinventoryportraits
    state rs

    setvarvar varname SCUBATANKS
    state shop_showinventoryamounts
   }
   ifvare shopselection 13
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 61
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    setvar digx 303 // 224
    subvar digy 2
    state orientation27
    state pal20
    redefinequote 598 X%
    redefinequote 599 %ld%%
    setvarvar TEMP2 BOOTSTIME
    divvar TEMP2 2
    qsprintf 598 599 TEMP2
    qstrlen TEMPVAR 598
    ifvarg TEMPVAR 0 
    { 
     setvarvar tempb TEMPVAR
     mulvar tempb 2
     subvarvar digx tempb
     subvar digx 2
    }    
    setvar tilenum 3087 // setvar tilenum 3010
    setvar temp 598
    state mt

    // Vehicle Stats
    ifvarn VEHICLEID -1
    {
     setvar digx 300 // 224
     addvar digy 20 // setvar digy 138 // 224
     state shop_showvehicleportraits
     state rs

     setvar shade 0
     setvar digx 303 // 224
     subvar digy 2 // setvar digy 136 // 130
     state orientation27
     state pal20
     redefinequote 598 X%
     redefinequote 599 %ld%%
     getactorvar[VEHICLEID].ENEMYBOOTSAMOUNT TEMP2 // setvarvar TEMP2 SCUBATIME
     divvar TEMP2 2
     qsprintf 598 599 TEMP2
     qstrlen TEMPVAR 598
     ifvarg TEMPVAR 0 
     { 
      setvarvar tempb TEMPVAR
      mulvar tempb 2
      subvarvar digx tempb
      subvar digx 2
     }    
     setvar tilenum 3087 // setvar tilenum 3010
     setvar temp 598
     state mt
    }

    // Inventory Amounts
    setvar digx 300 // 224
    addvar digy 20
    state shop_showinventoryportraits
    state rs

    setvarvar varname BOOTPAIRS
    state shop_showinventoryamounts
   }
   ifvare shopselection 14
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 53
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar digx 303
    setvar digy 120 // 114
    state shop_assesscharacterFA
    state mt

    // Vehicle Stats
    ifvarn VEHICLEID -1
    {
     setvar digx 300 // 224
     addvar digy 20 // setvar digy 138 // 224
     state shop_showvehicleportraits
     state rs

     setvar digx 303 // 224
     subvar digy 2 // setvar digy 136 // 130
     state shop_assesscharacterFA
     state mt
    }

    // Inventory Amounts
    setvar digx 300 // 224
    addvar digy 20
    state shop_showinventoryportraits
    state rs

    setvarvar varname PORTABLEMEDIKITS
    state shop_showinventoryamounts
   }
   ifvare shopselection 15
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    setvar digz 25676
    setvar tilenum 5181
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname EYEDROPS
    setvar shade 0
    state orientation27
    state pal15
    setvar digx 300 // 224
    subvar digy 2 // setvar digy 152 // 146
    setvar tilenum 3087 // setvar tilenum 3010
    state dn
   }
   ifvare shopselection 16
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 5174
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname ANTIDOTES
    state shop_showinventoryamounts
   }
   ifvare shopselection 17
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz24576
    setvar tilenum 5182 
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname FOGHORNS
    state shop_showinventoryamounts
   }
   ifvare shopselection 18
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz49152
    setvar tilenum 5159 
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname RESURRECTIONCHALICES
    state shop_showinventoryamounts
   }
   ifvare shopselection 19
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 5258
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade -4
    state pal21
    setvarvar varname MAXHITPOINTS
    subvar digy 5 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
    state pal22
    setvarvar varname MAXARMORPOINTS
    addvar digy 6 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn

    // Vehicle Stats
    ifvarn VEHICLEID -1
    {
     setvar digx 300 // 224
     addvar digy 18 // setvar digy 138 // 224
     state shop_showvehicleportraits
     state rs

     setvar shade -4
     state pal21
     getactorvar[VEHICLEID].ENEMYMAXHP varname // setvarvar varname MAXHITPOINTS
     subvar digy 5 // 224
     setvar tilenum 3087 // setvar tilenum 3010
     state orientation27
     state dn
     state pal22
     getactorvar[VEHICLEID].ENEMYMAXAP varname // setvarvar varname MAXARMORPOINTS
     addvar digy 6 // 224
     setvar tilenum 3087 // setvar tilenum 3010
     state orientation27
     state dn 
    }
   }
   ifvare shopselection 20
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 5300
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 4
    state pal21
    setvarvar varname PLAYERATTACK
    subvar digy 5 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
    state pal22
    setvarvar varname PLAYERDEFENSE
    addvar digy 6 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn

    // Vehicle Stats
    ifvarn VEHICLEID -1
    {
     setvar digx 300 // 224
     addvar digy 18 // setvar digy 138 // 224
     state shop_showvehicleportraits
     state rs

     setvar shade 4
     state pal21
     getactorvar[VEHICLEID].ACTORATTACK varname // setvarvar varname PLAYERATTACK
     subvar digy 5 // 224
     setvar tilenum 3087 // setvar tilenum 3010
     state orientation27
     state dn
     state pal22
     getactorvar[VEHICLEID].ACTORDEFENSE varname // setvarvar varname PLAYERDEFENSE
     addvar digy 6 // 224
     setvar tilenum 3087 // setvar tilenum 3010
     state orientation27
     state dn
    }
   }
   ifvare shopselection 21
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 5331
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    state pal20
    setvarvar varname CHARACTERSPEEDTRUE
    ifvare debugtoggle 1
    {
     setvar digx 300 // 224
     subvar digy 2 // setvar digy 152 // 146
     setvar tilenum 3087 // setvar tilenum 3010
     state orientation27
     state dn
    }
    else
    {
     setvar digx 299 // 224
     subvar digy 2 // setvar digy 152 // 146
     state orientation27
 
     setvarvar TEMPVAR varname
     subvar TEMPVAR 46500
     divvar TEMPVAR 145
 
     setvarvar TEMPVAR2 varname
     subvar TEMPVAR2 46500
     mulvar TEMPVAR2 100
     divvar TEMPVAR2 145
     modvar TEMPVAR2 100
 
     ifvarg TEMPVAR2 -1 ifvarl TEMPVAR2 10
      redefinequote 598 %ld.0%ld
     else
      redefinequote 598 %ld.%ld

     qsprintf 598 598 TEMPVAR TEMPVAR2
     setvar temp 598
     qstrlen TEMPVAR3 598
     ifvarg TEMPVAR3 0
     {
      subvar TEMPVAR3 1
      mulvar TEMPVAR3 2
      subvarvar digx TEMPVAR3
     }
     state mt
    }
   }
  }
  else
  ifvare shoppage 1
  {
   // Item Names
   setvar digx 58
   state pal20
   state setquote332

   setvar digy 35 // 73 64 55 46
   redefinequote 332 SMALL AMMO SATCHEL
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 2749
   state shop_selection0cond
   state mt

   setvar digy 41
   redefinequote 332 LARGE AMMO SATCHEL
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 9999
   state shop_selection1cond
   state mt

   setvar digy 47
   redefinequote 332 TELEPORTER COILS [20 PACK]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 399
   state shop_selection2cond
   state mt
 
   setvar digy 53
   redefinequote 332 EXTRA-LIFE T-SHIRT [BUBSY ONLY]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 24999
   state shop_selection3cond
   state mt
 
   setvar digy 59
   redefinequote 332 CONTINUE ITEM
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 99999
   state shop_selection4cond
   state mt

   setvar digy 65
   redefinequote 332 ENERGY CELLS [5 PACK]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 249
   state shop_selection5cond
   state mt

   setvar digy 71
   redefinequote 332 ENERGY CELLS [30 PACK]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1249
   state shop_selection6cond
   state mt

   setvar digy 77
   redefinequote 332 ENERGY CELLS [80 PACK]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1249
   state shop_selection7cond
   state mt

   setvar digy 83
   ifvare HAVEENERGYSHIELD? 0
   {
    redefinequote 332 BIO-CELLULAR ENERGY SHIELD
    ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 32499
   }
   else
   {
    redefinequote 332 BIO-CELLULAR ENERGY SHIELD UPGRADE
    ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 19999
   }
   state shop_selection8cond
   state mt

   setvar digy 89
   redefinequote 332 LUNG-TIME BONUS
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 2749
   state shop_selection9cond
   state mt

   setvar digy 95
   redefinequote 332 MANTLE-STRENGTH BONUS
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 2749
   state shop_selection10cond
   state mt

   setvar digy 101
   redefinequote 332 AIR-JUMP BONUS
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 499999
   state shop_selection11cond
   state mt

   setvar digy 107
   redefinequote 332 AFA'S DROP
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 2499999
   state shop_selection12cond
   state mt

   setvar digy 113
   redefinequote 332 SUN RING
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 799999
   state shop_selection13cond
   state mt

   setvar digy 119
   redefinequote 332 AQUA RING
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 799999
   state shop_selection14cond
   state mt

   setvar digy 125
   redefinequote 332 PLASMA RING
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 799999
   state shop_selection15cond
   state mt

   setvar digy 131
   redefinequote 332 SPIRIT RING
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 799999
   state shop_selection16cond
   state mt

   setvar digy 137
   redefinequote 332 CHARM ANKH
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1249999
   state shop_selection17cond
   state mt

   setvar digy 143
   redefinequote 332 MIRROR SHIELD
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1999999
   state shop_selection18cond
   state mt

   setvar digy 149
   redefinequote 332 EXPERIENCE BADGE
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1624999
   state shop_selection19cond
   state mt

   setvar digy 155
   redefinequote 332 RANK BADGE
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1624999
   state shop_selection20cond
   state mt

   setvar digy 161
   redefinequote 332 MONEY BADGE
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1624999
   state shop_selection21cond
   state mt

   // Prices
   setvar digx 248 // 224
   state pal20
 
   setvar digy 35
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $2750.00
    setvar SHOPTEMP 2749
   }
   state shop_selection0cond
   state mt

   setvar digy 41
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 228
    redefinequote 332 $10000.00
    setvar SHOPTEMP 9999
   }
   state shop_selection1cond
   state mt

   setvar digy 47
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $400.00
    setvar SHOPTEMP 399
   }
   state shop_selection2cond
   state mt

   setvar digy 53
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 228
    redefinequote 332 $25000.00
    setvar SHOPTEMP 24999
   }
   state shop_selection3cond
   state mt

   setvar digy 59
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 224
    redefinequote 332 $100000.00
    setvar SHOPTEMP 99999
   }
   state shop_selection4cond
   state mt

   setvar digy 65
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $250.00
    setvar SHOPTEMP 249
   }
   state shop_selection5cond
   state mt

   setvar digy 71
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $1250.00
    setvar SHOPTEMP 1249
   }
   state shop_selection6cond
   state mt

   setvar digy 77
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $3250.00
    setvar SHOPTEMP 3249
   }
   state shop_selection7cond
   state mt

   setvar digy 83
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    ifvare HAVEENERGYSHIELD? 0
    {
     setvar digx 228
     redefinequote 332 $32500.00
     setvar SHOPTEMP 32499
    }
    else
    {
     setvar digx 228
     redefinequote 332 $20000.00
     setvar SHOPTEMP 19999
    }
   }
   state shop_selection8cond
   state mt

   setvar digy 89
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $2750.00
    setvar SHOPTEMP 2749
   }
   state shop_selection9cond
   state mt

   setvar digy 95
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 232
    redefinequote 332 $2750.00
    setvar SHOPTEMP 2749
   }
   state shop_selection10cond
   state mt

   setvar digy 101
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 224
    redefinequote 332 $500000.00
    setvar SHOPTEMP 499999
   }
   state shop_selection11cond
   state mt

   setvar digy 107
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 220
    redefinequote 332 $2500000.00
    setvar SHOPTEMP 2499999
   }
   state shop_selection12cond
   state mt

   setvar digy 113
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 224
    redefinequote 332 $800000.00
    setvar SHOPTEMP 799999
   }
   state shop_selection13cond
   state mt

   setvar digy 119
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 224
    redefinequote 332 $800000.00
    setvar SHOPTEMP 799999
   }
   state shop_selection14cond
   state mt

   setvar digy 125
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 224
    redefinequote 332 $800000.00
    setvar SHOPTEMP 799999
   }
   state shop_selection15cond
   state mt

   setvar digy 131
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 224
    redefinequote 332 $800000.00
    setvar SHOPTEMP 799999
   }
   state shop_selection16cond
   state mt

   setvar digy 137
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 220
    redefinequote 332 $1250000.00
    setvar SHOPTEMP 1249999
   }
   state shop_selection17cond
   state mt

   setvar digy 143
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 220
    redefinequote 332 $2000000.00
    setvar SHOPTEMP 1999999
   }
   state shop_selection18cond
   state mt

   setvar digy 149
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 220
    redefinequote 332 $1625000.00
    setvar SHOPTEMP 1624999
   }
   state shop_selection19cond
   state mt

   setvar digy 155
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 220
    redefinequote 332 $1625000.00
    setvar SHOPTEMP 1624999
   }
   state shop_selection20cond
   state mt

   setvar digy 161
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 220
    redefinequote 332 $1625000.00
    setvar SHOPTEMP 1624999
   }
   state shop_selection21cond
   state mt


   // Item Pictures
   setvar diga 0
   
   ifvare shopselection 0
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 5249
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    state shop_showmaxammoall
   }
   ifvare shopselection 1
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz65536
    setvar tilenum 5250
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    state shop_showmaxammoall
   }
   ifvare shopselection 2
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz49152
    setvar tilenum 43 
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname TELEPORTERCOILS
    state shop_showinventoryamounts
   }
   ifvare shopselection 3
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz49152
    setvar tilenum 5179
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state digz16384
    setvar orientation 35
    ifvare BUBSY? 1 setvarvar tilenum 7938 else setvar tilenum 7955
    setvar shade 16
    state pal0
    state rs

    ifvare BUBSY? 1 setvarvar varname BUBSYLIVES else setvar varname 0 // Bubsy must be available to have extra lives, since they are specfic to him only
    state shop_showinventoryamounts
   }
   ifvare shopselection 4
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz49152
    setvar tilenum 5279
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname CONTINUES?
    state shop_showinventoryamounts
   }
   ifvare shopselection 5
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz6000
    setvar tilenum 5218
    state rs

    state shop_showecells
   }
   ifvare shopselection 6
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz6000
    setvar tilenum 5219
    state rs

    state shop_showecells
   }
   ifvare shopselection 7
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz6000
    setvar tilenum 5220
    state rs

    state shop_showecells
   }
   ifvare shopselection 8
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz12000
    setvarvar TEMPVAR5 CURRENTBIOSHIELDPOWER
    ifvare CHARACTERSELECTED? 8 divvarvar TEMPVAR5 MAXHITPOINTS
    else
    {
     setvar CHARACTERARRAY 8
     getactorvar[CHARACTERARRAY].CHARACTERMAXHP TEMPVAR4
     divvarvar TEMPVAR5 TEMPVAR4
    }
    ifvarl TEMPVAR5 16 { state pal0 setvar digz 12000 }
    else ifvarg TEMPVAR5 15 ifvarl TEMPVAR5 64 { state pal17 setvar digz 12300 }
    else ifvarg TEMPVAR5 63 ifvarl TEMPVAR5 256 { state pal23 setvar digz 12600 }
    else ifvarg TEMPVAR5 255 ifvarl TEMPVAR5 1024 { state pal21 setvar digz 12900 }
    else ifvarg TEMPVAR5 1023 { state pal20 setvar digz 13200 }

    ifvare ESHIELDADVANCEMENT 0 setvar tilenum 5217 else setvar tilenum 5554
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state digz16384
    setvar orientation 35
    ifvare LISA? 1 setvarvar tilenum 7943 else setvar tilenum 7955
    setvar shade 16
    state pal0
    state rs

    setvar shade 0
    state pal17
    ifvare LISA? 1 { ifvare HAVEENERGYSHIELD? 1 setvarvar varname ESHIELDDMGFACTOR else setvar varname 0 } else setvar varname 0
    subvar digy 2 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
   }
//
   ifvare shopselection 9
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz98304
    setvar tilenum 6001
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    subvar digy 2
    state pal0
    setvarvar varname MAXAIRTIME
    ifvare debugtoggle 1
    {
     setvar digx 300 // 224
     setvar tilenum 3087 // setvar tilenum 3010
     state orientation27
     state dn
    }
    else
    {
     setvar digx 299 // 224
     state orientation27
 
     setvarvar TEMPVAR varname
     divvar TEMPVAR 26
 
     setvarvar TEMPVAR2 varname
     mulvar TEMPVAR2 100
     divvar TEMPVAR2 26
     modvar TEMPVAR2 100
 
     ifvarg TEMPVAR2 -1 ifvarl TEMPVAR2 10
     {
      redefinequote 598 %ld.0%ld
     }
     else
     {
      redefinequote 598 %ld.%ld
     }
     qsprintf 598 598 TEMPVAR TEMPVAR2
     setvar temp 598
     qstrlen TEMPVAR3 598
     ifvarg TEMPVAR3 0
     {
      subvar TEMPVAR3 1
      mulvar TEMPVAR3 2
      subvarvar digx TEMPVAR3
     }
     state mt
    }
   }
   ifvare shopselection 10
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz24576
    setvar tilenum 6012
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    subvar digy 2
    state pal14
    setvarvar varname MANTLINGTIMERMAX
    ifvare debugtoggle 1
    {
     setvar digx 300 // 224
     setvar tilenum 3087 // setvar tilenum 3010
     state orientation27
     state dn
    }
    else
    {
     setvar digx 299 // 224
     state orientation27
 
     setvarvar TEMPVAR varname
     divvar TEMPVAR 26
 
     setvarvar TEMPVAR2 varname
     mulvar TEMPVAR2 100
     divvar TEMPVAR2 26
     modvar TEMPVAR2 100
 
     ifvarg TEMPVAR2 -1 ifvarl TEMPVAR2 10
     {
      redefinequote 598 %ld.0%ld
     }
     else
     {
      redefinequote 598 %ld.%ld
     }
     qsprintf 598 598 TEMPVAR TEMPVAR2
     setvar temp 598
     qstrlen TEMPVAR3 598
     ifvarg TEMPVAR3 0
     {
      subvar TEMPVAR3 1
      mulvar TEMPVAR3 2
      subvarvar digx TEMPVAR3
     }
     state mt
    }
   }
   ifvare shopselection 11
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz16384
    setvar tilenum 6004
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    subvar digy 2
    state pal22
    setvarvar varname PLAYERMAXAIRJUMPS
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
   }
   ifvare shopselection 12
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    setvar digz 56320
    setvar tilenum 6027
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname AFASDROPS
    state shop_showinventoryamounts
   }
   ifvare shopselection 13
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz65536
    setvar tilenum 6013
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname SUNRINGS
    state shop_showinventoryamounts
   }
   ifvare shopselection 14
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz65536
    setvar tilenum 6016
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname AQUARINGS
    state shop_showinventoryamounts
   }
   ifvare shopselection 15
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz65536
    setvar tilenum 6015
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname PLASMARINGS
    state shop_showinventoryamounts
   }
   ifvare shopselection 16
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz65536
    setvar tilenum 6014
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname SPIRITRINGS
    state shop_showinventoryamounts
   }
   ifvare shopselection 17
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz65536
    setvar tilenum 6021
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname CHARMANKHS
    state shop_showinventoryamounts
   }
   ifvare shopselection 18
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz65536
    setvar tilenum 6017
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname MIRRORSHIELDS
    state shop_showinventoryamounts
   }
   ifvare shopselection 19
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz65536
    setvar tilenum 6025
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname EXPBADGES
    state shop_showinventoryamounts
   }
   ifvare shopselection 20
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz65536
    setvar tilenum 6024
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname RANKBADGES
    state shop_showinventoryamounts
   }
   ifvare shopselection 21
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz65536
    setvar tilenum 6033
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname MONEYBADGES
    state shop_showinventoryamounts
   }

  }
  else
  ifvare shoppage 2
  {
   // Item Names
   setvar digx 58
   state pal20
   state setquote332

   setvar digy 35 // 73 64 55 46
   redefinequote 332 PISTOL AMMO [12]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 199
   state shop_selection0cond
   state mt

   setvar digy 41 // 73 64 55 46
   redefinequote 332 SHOTGUN SHELLS [10]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 549
   state shop_selection1cond
   state mt

   setvar digy 47 // 73 64 55 46
   redefinequote 332 CHAINGUN BULLETS [50]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 449
   state shop_selection2cond
   state mt

   setvar digy 53 // 73 64 55 46
   redefinequote 332 RPG MISSILES [5]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 824
   state shop_selection3cond
   state mt

   setvar digy 59 // 73 64 55 46
   redefinequote 332 PIPEBOMB [1]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 149
   state shop_selection4cond
   state mt

   setvar digy 65 // 73 64 55 46
   redefinequote 332 BOX OF PIPEBOMBS [5]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 624
   state shop_selection5cond
   state mt

   setvar digy 71 // 73 64 55 46
   redefinequote 332 SHRINKER CRYSTAL [5]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 824
   state shop_selection6cond
   state mt

   setvar digy 77 // 73 64 55 46
   redefinequote 332 EXPANDER ANTENNA [20]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 824
   state shop_selection7cond
   state mt

   setvar digy 83 // 73 64 55 46
   redefinequote 332 DEVASTATOR MISSILES [15]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 674
   state shop_selection8cond
   state mt

   setvar digy 89 // 73 64 55 46
   redefinequote 332 LASER TRIPBOMB [1]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 249
   state shop_selection9cond
   state mt

   setvar digy 95 // 73 64 55 46
   redefinequote 332 FREEZETHROWER PACK [25]
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 949
   state shop_selection10cond
   state mt

   setvar digy 101 // 73 64 55 46
   redefinequote 332 UNKNOWN MEDICENE
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 2499999
   state shop_selection11cond
   state mt


   // Prices
   setvar digx 248 // 224
   state pal20
 
   setvar digy 35
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $200.00
    setvar SHOPTEMP 199
   }
   state shop_selection0cond
   state mt

   setvar digy 41
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $550.00
    setvar SHOPTEMP 549
   }
   state shop_selection1cond
   state mt

   setvar digy 47
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $450.00
    setvar SHOPTEMP 449
   }
   state shop_selection2cond
   state mt

   setvar digy 53
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $825.00
    setvar SHOPTEMP 824
   }
   state shop_selection3cond
   state mt

   setvar digy 59
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $150.00
    setvar SHOPTEMP 149
   }
   state shop_selection4cond
   state mt

   setvar digy 65
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $625.00
    setvar SHOPTEMP 624
   }
   state shop_selection5cond
   state mt

   setvar digy 71
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $825.00
    setvar SHOPTEMP 824
   }
   state shop_selection6cond
   state mt

   setvar digy 77
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $825.00
    setvar SHOPTEMP 824
   }
   state shop_selection7cond
   state mt

   setvar digy 83
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $675.00
    setvar SHOPTEMP 674
   }
   state shop_selection8cond
   state mt

   setvar digy 89
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $250.00
    setvar SHOPTEMP 249
   }
   state shop_selection9cond
   state mt

   setvar digy 95
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 236
    redefinequote 332 $950.00
    setvar SHOPTEMP 949
   }
   state shop_selection10cond
   state mt

   setvar digy 101
   ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state shop_cheatdisplay1
   else
   {
    setvar digx 220
    redefinequote 332 $2500000.00
    setvar SHOPTEMP 2499999
   }
   state shop_selection11cond
   state mt

   // Item Pictures
   setvar diga 0
   
   ifvare shopselection 0
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz16384
    setvar tilenum 40
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    state pal0
    getplayer[THISACTOR].ammo_amount 1 TEMPVAR
    setvarvar varname TEMPVAR
    subvar digy 5 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
    state pal20
    getplayer[THISACTOR].max_ammo_amount 1 TEMPVAR
    setvarvar varname TEMPVAR
    addvar digy 6 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
   }
   ifvare shopselection 1
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 49
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    state pal0
    getplayer[THISACTOR].ammo_amount 2 TEMPVAR
    setvarvar varname TEMPVAR
    subvar digy 5 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
    state pal20
    getplayer[THISACTOR].max_ammo_amount 2 TEMPVAR
    setvarvar varname TEMPVAR
    addvar digy 6 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
   }
   ifvare shopselection 2
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 41
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    state pal0
    getplayer[THISACTOR].ammo_amount 3 TEMPVAR
    setvarvar varname TEMPVAR
    subvar digy 5 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
    state pal20
    getplayer[THISACTOR].max_ammo_amount 3 TEMPVAR
    setvarvar varname TEMPVAR
    addvar digy 6 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
   }
   ifvare shopselection 3
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 44
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    state pal0
    getplayer[THISACTOR].ammo_amount 4 TEMPVAR
    setvarvar varname TEMPVAR
    subvar digy 5 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
    state pal20
    getplayer[THISACTOR].max_ammo_amount 4 TEMPVAR
    setvarvar varname TEMPVAR
    addvar digy 6 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
   }
   ifvare shopselection 4
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    setvar digz 8192
    setvar tilenum 26
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    state pal0
    getplayer[THISACTOR].ammo_amount 5 TEMPVAR
    setvarvar varname TEMPVAR
    subvar digy 5 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
    state pal20
    getplayer[THISACTOR].max_ammo_amount 5 TEMPVAR
    setvarvar varname TEMPVAR
    addvar digy 6 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
   }
   ifvare shopselection 5
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 47
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    state pal0
    getplayer[THISACTOR].ammo_amount 5 TEMPVAR
    setvarvar varname TEMPVAR
    subvar digy 5 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
    state pal20
    getplayer[THISACTOR].max_ammo_amount 5 TEMPVAR
    setvarvar varname TEMPVAR
    addvar digy 6 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
   }
   ifvare shopselection 6
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 46
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    state pal0
    getplayer[THISACTOR].ammo_amount 6 TEMPVAR
    setvarvar varname TEMPVAR
    subvar digy 5 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
    state pal20
    getplayer[THISACTOR].max_ammo_amount 6 TEMPVAR
    setvarvar varname TEMPVAR
    addvar digy 6 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
   }
   ifvare shopselection 7
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 45
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    state pal0
    getplayer[THISACTOR].ammo_amount 11 TEMPVAR
    setvarvar varname TEMPVAR
    subvar digy 5 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
    state pal20
    getplayer[THISACTOR].max_ammo_amount 11 TEMPVAR
    setvarvar varname TEMPVAR
    addvar digy 6 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
   }
   ifvare shopselection 8
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 42
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    state pal0
    getplayer[THISACTOR].ammo_amount 7 TEMPVAR
    setvarvar varname TEMPVAR
    subvar digy 5 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
    state pal20
    getplayer[THISACTOR].max_ammo_amount 7 TEMPVAR
    setvarvar varname TEMPVAR
    addvar digy 6 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
   }
   ifvare shopselection 9
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 27
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    state pal0
    getplayer[THISACTOR].ammo_amount 8 TEMPVAR
    setvarvar varname TEMPVAR
    subvar digy 5 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
    state pal20
    getplayer[THISACTOR].max_ammo_amount 8 TEMPVAR
    setvarvar varname TEMPVAR
    addvar digy 6 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
   }
   ifvare shopselection 10
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    state digz32768
    setvar tilenum 37
    state rs

    // Character Stats
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showcharacterportraits
    state rs

    setvar shade 0
    state pal0
    getplayer[THISACTOR].ammo_amount 9 TEMPVAR
    setvarvar varname TEMPVAR
    subvar digy 5 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
    state pal20
    getplayer[THISACTOR].max_ammo_amount 9 TEMPVAR
    setvarvar varname TEMPVAR
    addvar digy 6 // 224
    setvar tilenum 3087 // setvar tilenum 3010
    state orientation27
    state dn
   }
   ifvare shopselection 11
   {
    state pal0
    setvar digx 300 // 224
    setvar digy 100 // 224
    setvar digz 30720
    setvar tilenum 5284
    state rs

    // Inventory Amounts
    setvar digx 300 // 224
    setvar digy 122 // 224
    state shop_showinventoryportraits
    state rs

    setvarvar varname FAUXLEVELUPS
    state shop_showinventoryamounts
   }
  }
/*
  else
  ifvare shoppage 3
  {
  }
*/
 }
 else
 ifvare shopmode 1 // Selling
 {
  ifvare shoppage 0
  {
   setvar digx 58
   state pal20
   state setquote332

   setvar digy 35
   redefinequote 332 RESURRECTION CHALICE
   ifvare shopselection 0 { ifvarg RESURRECTIONCHALICES 0 state pal22 else state pal21 } 
                     else { ifvarg RESURRECTIONCHALICES 0 state pal20 else state pal10 }
   state mt  

   setvar digy 41
   redefinequote 332 EYEDROP
   ifvare shopselection 1 { ifvarg EYEDROPS 0 state pal22 else state pal21 } 
                     else { ifvarg EYEDROPS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 47 // 73 64 55 46
   redefinequote 332 ANTIDOTE
   ifvare shopselection 2 { ifvarg ANTIDOTES 0 state pal22 else state pal21 } 
                     else { ifvarg ANTIDOTES 0 state pal20 else state pal10 }
   state mt  

   setvar digy 53 // 73 64 55 46
   redefinequote 332 FOGHORN
   ifvare shopselection 3 { ifvarg FOGHORNS 0 state pal22 else state pal21 } 
                     else { ifvarg FOGHORNS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 59 // 73 64 55 46
   redefinequote 332 EXTRA LIFE T-SHIRT
   ifvare BUBSY? 1
   {
    ifvare shopselection 4 { ifvarg BUBSYLIVES 0 state pal22 else state pal21 } 
                      else { ifvarg BUBSYLIVES 0 state pal20 else state pal10 }
   }
   else
   {
    ifvare shopselection 4 state pal21 else state pal10
   }
   state mt  

   setvar digy 65
   redefinequote 332 CONTINUE ITEM
   ifvare shopselection 5 { ifvarg CONTINUES? 0 state pal22 else state pal21 } 
                     else { ifvarg CONTINUES? 0 state pal20 else state pal10 }
   state mt  

   setvar digy 71
   redefinequote 332 ENERGY CELLS [5/SELL]
   ifvare shopselection 6 { ifvarg CURRENTCELLS 4 state pal22 else state pal21 } 
                     else { ifvarg CURRENTCELLS 4 state pal20 else state pal10 }
   state mt  

   setvar digy 77
   redefinequote 332 TELEPORTER COILS [20/SELL]
   ifvare shopselection 7 { ifvarg TELEPORTERCOILS 19 state pal22 else state pal21 } 
                     else { ifvarg TELEPORTERCOILS 19 state pal20 else state pal10 }
   state mt  

   setvar digy 83
   redefinequote 332 SMALL MEDIKIT [+10%HP]
   ifvare shopselection 8 { ifvarg SMALLMEDIKITS 0 state pal22 else state pal21 } 
                     else { ifvarg SMALLMEDIKITS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 89
   redefinequote 332 MEDIUM MEDIKIT [+20%HP]
   ifvare shopselection 9 { ifvarg SWMEDIKITS 0 state pal22 else state pal21 } 
                     else { ifvarg SWMEDIKITS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 95
   redefinequote 332 LARGE MEDIKIT [+30%HP]
   ifvare shopselection 10 { ifvarg LARGEMEDIKITS 0 state pal22 else state pal21 } 
                     else { ifvarg LARGEMEDIKITS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 101
   redefinequote 332 EXTRA-LARGE MEDIKIT [+50%HP]
   ifvare shopselection 11 { ifvarg SWBIGMEDIKITS 0 state pal22 else state pal21 } 
                     else { ifvarg SWBIGMEDIKITS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 107
   redefinequote 332 BODY ARMOR [+100%AP]
   ifvare shopselection 12 { ifvarg BODYARMORS 0 state pal22 else state pal21 } 
                     else { ifvarg BODYARMORS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 113
   redefinequote 332 SUPER ARMOR [+200%AP]
   ifvare shopselection 13 { ifvarg SUPERARMORS 0 state pal22 else state pal21 } 
                     else { ifvarg SUPERARMORS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 119
   redefinequote 332 VITAMIN X
   ifvare shopselection 14 { ifvarg VITAMINXS 0 state pal22 else state pal21 } 
                     else { ifvarg VITAMINXS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 125
   redefinequote 332 NIGHT VISION GOGGLES
   ifvare shopselection 15 { ifvarg HEATSENSORS 0 state pal22 else state pal21 } 
                     else { ifvarg HEATSENSORS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 131
   state showholonames_shop
   ifvare shopselection 16 { ifvarg HOLOFORMS 0 state pal22 else state pal21 } 
                     else { ifvarg HOLOFORMS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 137
   redefinequote 332 JETPACK
   ifvare shopselection 17 { ifvarg JETPACKS 0 state pal22 else state pal21 } 
                     else { ifvarg JETPACKS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 143
   redefinequote 332 SCUBA GEAR
   ifvare shopselection 18 { ifvarg SCUBATANKS 0 state pal22 else state pal21 } 
                     else { ifvarg SCUBATANKS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 149
   redefinequote 332 PROTECTIVE BOOTS
   ifvare shopselection 19 { ifvarg BOOTPAIRS 0 state pal22 else state pal21 } 
                     else { ifvarg BOOTPAIRS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 155
   redefinequote 332 PORTABLE MEDIKIT
   ifvare shopselection 20 { ifvarg PORTABLEMEDIKITS 0 state pal22 else state pal21 } 
                     else { ifvarg PORTABLEMEDIKITS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 161
   redefinequote 332 AFA'S DROP
   ifvare shopselection 21 { ifvarg AFASDROPS 0 state pal22 else state pal21 } 
                     else { ifvarg AFASDROPS 0 state pal20 else state pal10 }
   state mt  




   setvar digx 248 // 224
   state pal20

   setvar digy 35
   setvar digx 232
   redefinequote 332 $2000.00
   ifvare shopselection 0 { ifvarg RESURRECTIONCHALICES 0 state pal22 else state pal21 } 
                     else { ifvarg RESURRECTIONCHALICES 0 state pal20 else state pal10 }
   state mt

   setvar digy 41
   setvar digx 240
   redefinequote 332 $83.33
   ifvare shopselection 1 { ifvarg EYEDROPS 0 state pal22 else state pal21 } 
                     else { ifvarg EYEDROPS 0 state pal20 else state pal10 }
   state mt

   setvar digy 47
   setvar digx 236
   redefinequote 332 $116.67
   ifvare shopselection 2 { ifvarg ANTIDOTES 0 state pal22 else state pal21 } 
                     else { ifvarg ANTIDOTES 0 state pal20 else state pal10 }
   state mt

   setvar digy 53
   setvar digx 236
   redefinequote 332 $150.00
   ifvare shopselection 3 { ifvarg FOGHORNS 0 state pal22 else state pal21 } 
                     else { ifvarg FOGHORNS 0 state pal20 else state pal10 }
   state mt

   setvar digy 59
   setvar digx 228
   redefinequote 332 $16666.67
   ifvare BUBSY? 1
   {
    ifvare shopselection 4 { ifvarg BUBSYLIVES 0 state pal22 else state pal21 } 
                      else { ifvarg BUBSYLIVES 0 state pal20 else state pal10 }
   }
   else
   {
    ifvare shopselection 4 state pal21 else state pal10
   }
   state mt

   setvar digy 65
   setvar digx 228
   redefinequote 332 $66666.67
   ifvare shopselection 5 { ifvarg CONTINUES? 0 state pal22 else state pal21 } 
                     else { ifvarg CONTINUES? 0 state pal20 else state pal10 }
   state mt

   setvar digy 71
   setvar digx 236
   redefinequote 332 $166.67
   ifvare shopselection 6 { ifvarg CURRENTCELLS 4 state pal22 else state pal21 } 
                     else { ifvarg CURRENTCELLS 4 state pal20 else state pal10 }
   state mt

   setvar digy 77
   setvar digx 236
   redefinequote 332 $266.67
   ifvare shopselection 7 { ifvarg TELEPORTERCOILS 19 state pal22 else state pal21 } 
                     else { ifvarg TELEPORTERCOILS 19 state pal20 else state pal10 }
   state mt

   setvar digy 83
   setvar digx 240
   redefinequote 332 $25.00
   ifvare shopselection 8 { ifvarg SMALLMEDIKITS 0 state pal22 else state pal21 } 
                     else { ifvarg SMALLMEDIKITS 0 state pal20 else state pal10 }
   state mt

   setvar digy 89
   setvar digx 240
   redefinequote 332 $45.00
   ifvare shopselection 9 { ifvarg SWMEDIKITS 0 state pal22 else state pal21 } 
                     else { ifvarg SWMEDIKITS 0 state pal20 else state pal10 }
   state mt

   setvar digy 95
   setvar digx 240
   redefinequote 332 $66.67
   ifvare shopselection 10 { ifvarg LARGEMEDIKITS 0 state pal22 else state pal21 } 
                     else { ifvarg LARGEMEDIKITS 0 state pal20 else state pal10 }
   state mt

   setvar digy 101
   setvar digx 236
   redefinequote 332 $223.33
   ifvare shopselection 11 { ifvarg SWBIGMEDIKITS 0 state pal22 else state pal21 } 
                     else { ifvarg SWBIGMEDIKITS 0 state pal20 else state pal10 }
   state mt

   setvar digy 107
   setvar digx 236
   redefinequote 332 $333.33
   ifvare shopselection 12 { ifvarg BODYARMORS 0 state pal22 else state pal21 } 
                     else { ifvarg BODYARMORS 0 state pal20 else state pal10 }
   state mt

   setvar digy 113
   setvar digx 232
   redefinequote 332 $1000.00
   ifvare shopselection 13 { ifvarg SUPERARMORS 0 state pal22 else state pal21 } 
                     else { ifvarg SUPERARMORS 0 state pal20 else state pal10 }
   state mt

   setvar digy 119
   setvar digx 232
   redefinequote 332 $3200.00
   ifvare shopselection 14 { ifvarg VITAMINXS 0 state pal22 else state pal21 } 
                     else { ifvarg VITAMINXS 0 state pal20 else state pal10 }
   state mt

   setvar digy 125
   setvar digx 236
   redefinequote 332 $500.00
   ifvare shopselection 15 { ifvarg HEATSENSORS 0 state pal22 else state pal21 } 
                     else { ifvarg HEATSENSORS 0 state pal20 else state pal10 }
   state mt

   setvar digy 131
   setvar digx 236
   redefinequote 332 $625.00
   ifvare shopselection 16 { ifvarg HOLOFORMS 0 state pal22 else state pal21 } 
                     else { ifvarg HOLOFORMS 0 state pal20 else state pal10 }
   state mt

   setvar digy 137
   setvar digx 236
   redefinequote 332 $750.00
   ifvare shopselection 17 { ifvarg JETPACKS 0 state pal22 else state pal21 } 
                     else { ifvarg JETPACKS 0 state pal20 else state pal10 }
   state mt

   setvar digy 143
   setvar digx 236
   redefinequote 332 $750.00
   ifvare shopselection 18 { ifvarg SCUBATANKS 0 state pal22 else state pal21 } 
                     else { ifvarg SCUBATANKS 0 state pal20 else state pal10 }
   state mt

   setvar digy 149
   setvar digx 236
   redefinequote 332 $500.00
   ifvare shopselection 19 { ifvarg BOOTPAIRS 0 state pal22 else state pal21 } 
                     else { ifvarg BOOTPAIRS 0 state pal20 else state pal10 }
   state mt

   setvar digy 155
   setvar digx 232
   redefinequote 332 $1000.00
   ifvare shopselection 20 { ifvarg PORTABLEMEDIKITS 0 state pal22 else state pal21 } 
                     else { ifvarg PORTABLEMEDIKITS 0 state pal20 else state pal10 }
   state mt

   setvar digy 161
   setvar digx 220
   redefinequote 332 $1250000.00
   ifvare shopselection 21 { ifvarg AFASDROPS 0 state pal22 else state pal21 } 
                     else { ifvarg AFASDROPS 0 state pal20 else state pal10 }
   state mt



   // Item Pictures
   setvar digx 300 // 224
   setvar digy 100 // 224
   setvar diga 0
   
   ifvare shopselection 0
   {
    state pal0
    state digz49152
    setvar tilenum 5159 
    setvarvar varname RESURRECTIONCHALICES
    state rs
   }
   ifvare shopselection 1
   {
    state pal0
    setvar digz 25676
    setvar tilenum 5181
    state rs
    setvarvar varname EYEDROPS
   }
   ifvare shopselection 2
   {
    state pal0
    state digz32768
    setvar tilenum 5174
    state rs
    setvarvar varname ANTIDOTES
   }
   ifvare shopselection 3
   {
    state pal0
    state digz24576
    setvar tilenum 5182 
    state rs
    setvarvar varname FOGHORNS
   }
   ifvare shopselection 4
   {
    state pal0
    state digz49152
    setvar tilenum 5179
    state rs
    ifvare BUBSY? 1 setvarvar varname BUBSYLIVES else setvar varname 0 // Bubsy must be available to have extra lives, since they are specfic to him only
   }
   ifvare shopselection 5
   {
    state pal0
    state digz49152
    setvar tilenum 5277
    state rs
    setvarvar varname CONTINUES?
   }
   ifvare shopselection 6
   {
    state pal0
    state digz6000
    setvar tilenum 5218
    state rs
    setvarvar varname CURRENTCELLS
   }
   ifvare shopselection 7
   {
    state pal0
    state digz49152
    setvar tilenum 43 
    state rs
    setvarvar varname TELEPORTERCOILS
   }
   ifvare shopselection 8
   {
    state pal0
    state digz32768
    setvar tilenum 51
    state rs
    setvarvar varname SMALLMEDIKITS
   }
   ifvare shopselection 9
   {
    state pal0
    state digz32768
    setvar tilenum 34
    state rs
    setvarvar varname SWMEDIKITS
   }
   ifvare shopselection 10
   {
    state pal0
    state digz32768
    setvar tilenum 52
    state rs
    setvarvar varname LARGEMEDIKITS
   }
   ifvare shopselection 11
   {
    state pal0
    state digz32768
    setvar tilenum 35
    state rs
    setvarvar varname SWBIGMEDIKITS
   }
   ifvare shopselection 12
   {
    state pal0
    ifvare ARMORAPPEARANCE? 0 { state digz32768 setvar tilenum 66 }
    ifvare ARMORAPPEARANCE? 1 { state digz32768 setvar tilenum 5383 }
    ifvare ARMORAPPEARANCE? 2 { state digz32768 setvar tilenum 5381 }
    ifvare ARMORAPPEARANCE? 3 { state digz32768 setvar tilenum 5382 }
    state rs
    setvarvar varname BODYARMORS
   }
   ifvare shopselection 13
   {
    state pal24
    ifvare ARMORAPPEARANCE? 0 { state digz49152 setvar tilenum 66 }
    ifvare ARMORAPPEARANCE? 1 { state digz49152 setvar tilenum 5383 }
    ifvare ARMORAPPEARANCE? 2 { state digz49152 setvar tilenum 5381 }
    ifvare ARMORAPPEARANCE? 3 { state digz49152 setvar tilenum 5382 }
    state rs
    setvarvar varname SUPERARMORS
   }
   ifvare shopselection 14
   {
    state pal0
    state digz32768
    setvar tilenum 5424
    state rs
    setvarvar varname VITAMINXS
   }
   ifvare shopselection 15
   {
    state pal0
    state digz32768
    setvar tilenum 59
    state rs
    setvarvar varname HEATSENSORS
   }
   ifvare shopselection 16
   {
    state pal0
    state digz24576
    ifvare CHARACTERSELECTED? 6 { state pal24 setvar tilenum 5426 }
    else ifvare CHARACTERSELECTED? 9 { state pal24 setvar tilenum 5430 }
    else { state pal0 setvar tilenum 1348 }
    state rs
    setvarvar varname HOLOFORMS
   }
   ifvare shopselection 17
   {
    state pal0
    state digz32768
    setvar tilenum 57
    state rs
    setvarvar varname JETPACKS
   }
   ifvare shopselection 18
   {
    state pal0
    state digz32768
    setvar tilenum 56
    state rs
    setvarvar varname SCUBATANKS
   }
   ifvare shopselection 19
   {
    state pal0
    state digz32768
    setvar tilenum 61
    state rs
    setvarvar varname BOOTPAIRS
   }
   ifvare shopselection 20
   {
    state pal0
    state digz32768
    setvar tilenum 53
    state rs
    setvarvar varname PORTABLEMEDIKITS
   }
   ifvare shopselection 21
   {
    state pal0
    setvar digz 56320
    setvar tilenum 6027
    state rs
    setvarvar varname AFASDROPS
   }

   state shope_showinvsell
   state shop_showinventoryamounts
  }
  else
  ifvare shoppage 1
  {
   setvar digx 58
   state pal20
   state setquote332

   setvar digy 35
   redefinequote 332 SUN RING
   ifvare shopselection 0 { ifvarg SUNRINGS 0 state pal22 else state pal21 } 
                     else { ifvarg SUNRINGS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 41
   redefinequote 332 AQUA RING
   ifvare shopselection 1 { ifvarg AQUARINGS 0 state pal22 else state pal21 } 
                     else { ifvarg AQUARINGS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 47 // 73 64 55 46
   redefinequote 332 PLASMA RING
   ifvare shopselection 2 { ifvarg PLASMARINGS 0 state pal22 else state pal21 } 
                     else { ifvarg PLASMARINGS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 53 // 73 64 55 46
   redefinequote 332 SPIRIT RING
   ifvare shopselection 3 { ifvarg SPIRITRINGS 0 state pal22 else state pal21 } 
                     else { ifvarg SPIRITRINGS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 59 // 73 64 55 46
   redefinequote 332 CHARM ANKH
   ifvare shopselection 4 { ifvarg CHARMANKHS 0 state pal22 else state pal21 } 
                     else { ifvarg CHARMANKHS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 65 // 73 64 55 46
   redefinequote 332 MIRROR SHIELD
   ifvare shopselection 5 { ifvarg MIRRORSHIELDS 0 state pal22 else state pal21 } 
                     else { ifvarg MIRRORSHIELDS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 71 // 73 64 55 46
   redefinequote 332 EXPERIENCE BADGE
   ifvare shopselection 6 { ifvarg EXPBADGES 0 state pal22 else state pal21 } 
                     else { ifvarg EXPBADGES 0 state pal20 else state pal10 }
   state mt  

   setvar digy 77 // 73 64 55 46
   redefinequote 332 RANK BADGE
   ifvare shopselection 7 { ifvarg RANKBADGES 0 state pal22 else state pal21 } 
                     else { ifvarg RANKBADGES 0 state pal20 else state pal10 }
   state mt  

   setvar digy 83 // 73 64 55 46
   redefinequote 332 MONEY BADGE
   ifvare shopselection 8 { ifvarg MONEYBADGES 0 state pal22 else state pal21 } 
                     else { ifvarg MONEYBADGES 0 state pal20 else state pal10 }
   state mt  

   setvar digy 89 // 73 64 55 46
   redefinequote 332 ATOMIC HEALTH [+50%HP]
   ifvare shopselection 9 { ifvarg ATOMICHEALTHS 0 state pal22 else state pal21 } 
                     else { ifvarg ATOMICHEALTHS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 95 // 73 64 55 46
   redefinequote 332 SUPER ATOM [+200%HP/AP/FA]
   ifvare shopselection 10 { ifvarg SUPERATOMS 0 state pal22 else state pal21 } 
                      else { ifvarg SUPERATOMS 0 state pal20 else state pal10 }
   state mt  

   setvar digy 101 // 73 64 55 46
   redefinequote 332 UNKNOWN MEDICENE
   ifvare shopselection 11 { ifvarg FAUXLEVELUPS 0 state pal22 else state pal21 } 
                      else { ifvarg FAUXLEVELUPS 0 state pal20 else state pal10 }
   state mt  



   setvar digx 248 // 224
   state pal20

   setvar digy 35
   setvar digx 224
   redefinequote 332 $400000.00
   ifvare shopselection 0 { ifvarg SUNRINGS 0 state pal22 else state pal21 } 
                     else { ifvarg SUNRINGS 0 state pal20 else state pal10 }
   state mt

   setvar digy 41
   setvar digx 224
   redefinequote 332 $400000.00
   ifvare shopselection 1 { ifvarg AQUARINGS 0 state pal22 else state pal21 } 
                     else { ifvarg AQUARINGS 0 state pal20 else state pal10 }
   state mt

   setvar digy 47
   setvar digx 224
   redefinequote 332 $400000.00
   ifvare shopselection 2 { ifvarg PLASMARINGS 0 state pal22 else state pal21 } 
                     else { ifvarg PLASMARINGS 0 state pal20 else state pal10 }
   state mt

   setvar digy 53
   setvar digx 224
   redefinequote 332 $400000.00
   ifvare shopselection 3 { ifvarg SPIRITRINGS 0 state pal22 else state pal21 } 
                     else { ifvarg SPIRITRINGS 0 state pal20 else state pal10 }
   state mt

   setvar digy 59
   setvar digx 224
   redefinequote 332 $625000.00
   ifvare shopselection 4 { ifvarg CHARMANKHS 0 state pal22 else state pal21 } 
                     else { ifvarg CHARMANKHS 0 state pal20 else state pal10 }
   state mt

   setvar digy 65
   setvar digx 220
   redefinequote 332 $1000000.00
   ifvare shopselection 5 { ifvarg MIRRORSHIELDS 0 state pal22 else state pal21 } 
                     else { ifvarg MIRRORSHIELDS 0 state pal20 else state pal10 }
   state mt

   setvar digy 71
   setvar digx 224
   redefinequote 332 $812500.00
   ifvare shopselection 6 { ifvarg EXPBADGES 0 state pal22 else state pal21 } 
                     else { ifvarg EXPBADGES 0 state pal20 else state pal10 }
   state mt

   setvar digy 77
   setvar digx 224
   redefinequote 332 $812500.00
   ifvare shopselection 7 { ifvarg RANKBADGES 0 state pal22 else state pal21 } 
                     else { ifvarg RANKBADGES 0 state pal20 else state pal10 }
   state mt

   setvar digy 83
   setvar digx 224
   redefinequote 332 $812500.00
   ifvare shopselection 8 { ifvarg MONEYBADGES 0 state pal22 else state pal21 } 
                     else { ifvarg MONEYBADGES 0 state pal20 else state pal10 }
   state mt

   setvar digy 89
   setvar digx 236
   redefinequote 332 $500.00
   ifvare shopselection 9 { ifvarg ATOMICHEALTHS 0 state pal22 else state pal21 } 
                     else { ifvarg ATOMICHEALTHS 0 state pal20 else state pal10 }
   state mt


   setvar digy 95
   setvar digx 232
   redefinequote 332 $3200.00
   ifvare shopselection 10 { ifvarg SUPERATOMS 0 state pal22 else state pal21 } 
                      else { ifvarg SUPERATOMS 0 state pal20 else state pal10 }
   state mt

   setvar digy 101
   setvar digx 220
   redefinequote 332 $1250000.00
   ifvare shopselection 11 { ifvarg FAUXLEVELUPS 0 state pal22 else state pal21 } 
                      else { ifvarg FAUXLEVELUPS 0 state pal20 else state pal10 }
   state mt





   // Item Pictures
   setvar digx 300 // 224
   setvar digy 100 // 224
   setvar diga 0
   
   ifvare shopselection 0
   {
    state pal0
    state digz65536
    setvar tilenum 6013
    setvarvar varname SUNRINGS
    state rs
   }
   ifvare shopselection 1
   {
    state pal0
    state digz65536
    setvar tilenum 6016
    state rs
    setvarvar varname AQUARINGS
   }
   ifvare shopselection 2
   {
    state pal0
    state digz65536
    setvar tilenum 6015
    state rs
    setvarvar varname PLASMARINGS
   }
   ifvare shopselection 3
   {
    state pal0
    state digz65536
    setvar tilenum 6014
    state rs
    setvarvar varname SPIRITRINGS
   }
   ifvare shopselection 4
   {
    state pal0
    state digz65536
    setvar tilenum 6021
    state rs
    setvarvar varname CHARMANKHS
   }
   ifvare shopselection 5
   {
    state pal0
    state digz65536
    setvar tilenum 6017
    state rs
    setvarvar varname MIRRORSHIELDS
   }
   ifvare shopselection 6
   {
    state pal0
    state digz65536
    setvar tilenum 6025
    state rs
    setvarvar varname EXPBADGES
   }
   ifvare shopselection 7
   {
    state pal0
    state digz65536
    setvar tilenum 6024
    state rs
    setvarvar varname RANKBADGES
   }
   ifvare shopselection 8
   {
    state pal0
    state digz65536
    setvar tilenum 6033
    state rs
    setvarvar varname MONEYBADGES
   }
   ifvare shopselection 9
   {
    state pal0
    state digz32768
    setvar tilenum 100
    state rs
    setvarvar varname ATOMICHEALTHS
   }
   ifvare shopselection 10
   {
    state pal16
    state digz49152
    setvar tilenum 100
    state rs
    setvarvar varname SUPERATOMS
   }
   ifvare shopselection 11
   {
    state pal16
    setvar digz 30720
    setvar tilenum 5284
    state rs
    setvarvar varname FAUXLEVELUPS
   }

   state shope_showinvsell
   state shop_showinventoryamounts
  }
/*
  else
  ifvare shoppage 2
  {
  }
  else
  ifvare shoppage 3
  {
  }
*/
 }

} // ifvare shop_id 0

  } // ifvarg shoptransitiontimer 6
 state pal0
 } // ifvarn shop_id -1
ends

state shop_buyitem
 sound MONEYSOUND
 ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS state cheatersound
 ifvare shoptype 1
 {
  ifrnd 85 globalsound SHOP_SOLD1
  else ifrnd 128 globalsound SHOP_SOLD2
  else globalsound SHOP_SOLD3
 }
ends

state shop_sellitem
 stopsound MENU_ERROR stopsound SHOP_FAIL
 sound MONEYSOUND
ends

state shop_buyfailed
       stopsound MONEYSOUND

       ifvare shoptype 0 globalsound MENU_ERROR
       else ifvare shoptype 1 globalsound SHOP_FAIL

       redefinequote 341 ^10YOU DON'T HAVE ENOUGH MONEY, CHEAPSKATE!
	 setvarvar fta fta_normal setvar ftq 341
ends

state shop_sellfailed
 stopsound MONEYSOUND
 stopsound SHOP_FAIL
 sound MENU_ERROR 
ends

state shop_moveup
 // Sounds
 sound EXITMENUSOUND
 stopsound MENU_SELECTED 
 stopsound MENU_ENTER 
 stopsound MENU_EXIT

   subvar shopselection 1
   // Menus
   ifvare shop_id 0
   {
    ifvare shopmode 0 // Buy Menu
    {
     ifvare shoppage 0
     {
      ifvarl shopselection 0 addvar shopselection 22
     }
     else
     ifvare shoppage 1
     {
      ifvarl shopselection 0 addvar shopselection 22
     }
     else
     ifvare shoppage 2
     {
      ifvarl shopselection 0 addvar shopselection 12
     }
     else
     ifvare shoppage 3
     {
      ifvare shopselection 0 setvar shopselection 0
     }
    }
    else
    ifvare shopmode 1 // Sell Menu
    {
     ifvare shoppage 0
     {
      ifvarl shopselection 0 addvar shopselection 22
     }
     else
     ifvare shoppage 1
     {
      ifvarl shopselection 0 addvar shopselection 12
     }
     else
     ifvare shoppage 2
     {
      ifvare shopselection 0 setvar shopselection 0
     }
     else
     ifvare shoppage 3
     {
      ifvare shopselection 0 setvar shopselection 0
     }
    }
   }
ends

state shop_movedown
 // Sounds
 sound EXITMENUSOUND
 stopsound MENU_SELECTED 
 stopsound MENU_ENTER 
 stopsound MENU_EXIT

   addvar shopselection 1
   // Menus
   ifvare shop_id 0
   {
    ifvare shopmode 0
    {
     ifvare shoppage 0
     {
      ifvarg shopselection 21 subvar shopselection 22
     }
     else
     ifvare shoppage 1
     {
      ifvarg shopselection 21 subvar shopselection 22
     }
     else
     ifvare shoppage 2
     {
      ifvarg shopselection 11 subvar shopselection 12
     }
     else
     ifvare shoppage 3
     {
      ifvare shopselection 0 setvar shopselection 0
     }
    }
    else
    ifvare shopmode 1
    {
     ifvare shoppage 0
     {
      ifvarg shopselection 21 subvar shopselection 22
     }
     else
     ifvare shoppage 1
     {
      ifvarg shopselection 11 subvar shopselection 12
     }
     else
     ifvare shoppage 2
     {
      ifvare shopselection 0 setvar shopselection 0
     }
     else
     ifvare shoppage 3
     {
      ifvare shopselection 0 setvar shopselection 0
     }
    }
   }
ends

state shop_shiftpage

 // Sounds
 sound MENU_SELECTED 
 stopsound MENU_ENTER 
 stopsound MENU_EXIT

   // Menus
   ifvare shop_id 0
   {
    ifvare shopmode 0
    {
     ifvare shoppage 0 setvar shoppage 1
     else ifvare shoppage 1 setvar shoppage 2
     else ifvare shoppage 2 setvar shoppage 0
//     else ifvare shoppage 3 setvar shoppage 0
    }
    else
    ifvare shopmode 1
    {
     ifvare shoppage 0 setvar shoppage 1
     else ifvare shoppage 1 setvar shoppage 0
//     else ifvare shoppage 2 setvar shoppage 3
//     else ifvare shoppage 3 setvar shoppage 0
    }
    setvar shopselection 0
   }
ends

state shop_changemodeup
 sound MENU_SELECTED 
 stopsound MENU_ENTER 
 stopsound MENU_EXIT

 ifvare shop_id 0
 {
  ifvare shopmode 0 { setvar shopmode 1 setvar shoppage 0 setvar shopselection 0 }
  else ifvare shopmode 1 { setvar shopmode 0 setvar shoppage 0 setvar shopselection 0 }
 }
ends

state shop_changemodedown
 sound MENU_SELECTED 
 stopsound MENU_ENTER 
 stopsound MENU_EXIT

 ifvare shop_id 0
 {
  ifvare shopmode 0 { setvar shopmode 1 setvar shoppage 0 setvar shopselection 0 }
  else ifvare shopmode 1 { setvar shopmode 0 setvar shoppage 0 setvar shopselection 0 }
 }
ends

state failedsell
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ANY OF THIS ITEM TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
ends

//*************************************************
//*States for Buying Items [Vehicle Pickup System]*
//*************************************************

// Small Medikit

state buyforcharacter_cola
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound USE_MEDIKITITEM
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 75
        subvarvar DOLLARS SHOPTEMP
        state gotmedsyoureallyneeded
        setvarvar TEMPHEALTH MAXHITPOINTS
        ifvare CHARACTERSELECTED? 13 mulvar TEMPHEALTH 150 else mulvar TEMPHEALTH 100
        divvar TEMPHEALTH 1000
        addvarvar CURRENTHITPOINTS TEMPHEALTH 
        ifvarvarg CURRENTHITPOINTS MAXHITPOINTS setvarvar CURRENTHITPOINTS MAXHITPOINTS
        setvar PLAYERHPDAMAGED? -1
        redefinequote 342 ^20BOUGHT A SMALL MEDKIT: +%ld HP
        qsprintf 342 342 TEMPHEALTH 
        setvarvar fta fta_normal setvar ftq 342
ends

state buyforvehicle_cola
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound VEHICLE_HEAL
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 75
        subvarvar DOLLARS SHOPTEMP
        setvarvar TEMPHEALTH TEMPVAR5
        mulvar TEMPHEALTH 100
        divvar TEMPHEALTH 1000
        addvarvar TEMPVAR4 TEMPHEALTH
        ifvarvarg TEMPVAR4 TEMPVAR5 setvarvar TEMPVAR4 TEMPVAR5
        setactorvar[tempvehicleid].ENEMYHP TEMPVAR4
        setvar VEHICLEHPDAMAGED? -1
        redefinequote 342 ^15BOUGHT A SMALL MEDKIT FOR YOUR VEHICLE: +%ld HP
        qsprintf 342 342 TEMPHEALTH 
        setvarvar fta fta_normal setvar ftq 342
ends

state buyforinventory_cola
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FOUND_INVENTORY
        redefinequote 341 ^14BOUGHT A SMALL MEDKIT AND STORED IT IN YOUR INVENTORY!
        addvar SMALLMEDIKITS 1
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 75
        subvarvar DOLLARS SHOPTEMP
 	  setvarvar fta fta_normal setvar ftq 341
ends

// Medium Medikit

state buyforcharacter_swmedikit
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound USE_MEDIKITITEM
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 135
        subvarvar DOLLARS SHOPTEMP
        state gotmedsyoureallyneeded
        setvarvar TEMPHEALTH MAXHITPOINTS
        ifvare CHARACTERSELECTED? 13 mulvar TEMPHEALTH 300 else mulvar TEMPHEALTH 200
        divvar TEMPHEALTH 1000
        addvarvar CURRENTHITPOINTS TEMPHEALTH
        ifvarvarg CURRENTHITPOINTS MAXHITPOINTS setvarvar CURRENTHITPOINTS MAXHITPOINTS
        setvar PLAYERHPDAMAGED? -1
        redefinequote 342 ^20BOUGHT A MEDIUM MEDKIT: +%ld HP
        qsprintf 342 342 TEMPHEALTH 
        setvarvar fta fta_normal setvar ftq 342
ends

state buyforvehicle_swmedikit
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound VEHICLE_HEAL
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 135
        subvarvar DOLLARS SHOPTEMP
        setvarvar TEMPHEALTH TEMPVAR5
        mulvar TEMPHEALTH 200
        divvar TEMPHEALTH 1000
        addvarvar TEMPVAR4 TEMPHEALTH
        ifvarvarg TEMPVAR4 TEMPVAR5 setvarvar TEMPVAR4 TEMPVAR5
        setactorvar[tempvehicleid].ENEMYHP TEMPVAR4
        setvar VEHICLEHPDAMAGED? -1
        redefinequote 342 ^15BOUGHT A MEDIUM MEDKIT FOR YOUR VEHICLE: +%ld HP
        qsprintf 342 342 TEMPHEALTH 
        setvarvar fta fta_normal setvar ftq 342
ends

state buyforinventory_swmedikit
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FOUND_INVENTORY
        redefinequote 341 ^14BOUGHT A MEDIUM MEDKIT AND STORED IT IN YOUR INVENTORY!
        addvar SWMEDIKITS 1
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 135
        subvarvar DOLLARS SHOPTEMP
 	  setvarvar fta fta_normal setvar ftq 341
ends

// Large Medikit

state buyforcharacter_sixpak
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound USE_MEDIKITITEM
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 200
        subvarvar DOLLARS SHOPTEMP
        state gotmedsyoureallyneeded
        setvarvar TEMPHEALTH MAXHITPOINTS
        ifvare CHARACTERSELECTED? 13 mulvar TEMPHEALTH 450 else mulvar TEMPHEALTH 300
        divvar TEMPHEALTH 1000
        addvarvar CURRENTHITPOINTS TEMPHEALTH
        ifvarvarg CURRENTHITPOINTS MAXHITPOINTS setvarvar CURRENTHITPOINTS MAXHITPOINTS
        setvar PLAYERHPDAMAGED? -1
        redefinequote 342 ^20BOUGHT A LARGE MEDKIT: +%ld HP
        qsprintf 342 342 TEMPHEALTH 
        setvarvar fta fta_normal setvar ftq 342
ends

state buyforvehicle_sixpak
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound VEHICLE_HEAL
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 200
        subvarvar DOLLARS SHOPTEMP
        setvarvar TEMPHEALTH TEMPVAR5
        mulvar TEMPHEALTH 300
        divvar TEMPHEALTH 1000
        addvarvar TEMPVAR4 TEMPHEALTH
        ifvarvarg TEMPVAR4 TEMPVAR5 setvarvar TEMPVAR4 TEMPVAR5
        setactorvar[tempvehicleid].ENEMYHP TEMPVAR4
        setvar VEHICLEHPDAMAGED? -1
        redefinequote 342 ^15BOUGHT A LARGE MEDKIT FOR YOUR VEHICLE: +%ld HP
        qsprintf 342 342 TEMPHEALTH 
        setvarvar fta fta_normal setvar ftq 342
ends

state buyforinventory_sixpak
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FOUND_INVENTORY
        redefinequote 341 ^14BOUGHT A LARGE MEDKIT AND STORED IT IN YOUR INVENTORY!
        addvar LARGEMEDIKITS 1
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 200
        subvarvar DOLLARS SHOPTEMP
 	  setvarvar fta fta_normal setvar ftq 341
ends

// Extra-Large Medikit

state buyforcharacter_swbigmedikit
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound USE_MEDIKITITEM
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 335
        subvarvar DOLLARS SHOPTEMP
        state gotmedsyoureallyneeded
        setvarvar TEMPHEALTH MAXHITPOINTS
        ifvare CHARACTERSELECTED? 13 mulvar TEMPHEALTH 750 else mulvar TEMPHEALTH 500
        divvar TEMPHEALTH 1000
        addvarvar CURRENTHITPOINTS TEMPHEALTH
        ifvarvarg CURRENTHITPOINTS MAXHITPOINTS setvarvar CURRENTHITPOINTS MAXHITPOINTS
        setvar PLAYERHPDAMAGED? -1
        redefinequote 342 ^20BOUGHT AN EXTRA-LARGE MEDKIT: +%ld HP
        qsprintf 342 342 TEMPHEALTH 
        setvarvar fta fta_normal setvar ftq 342
ends

state buyforvehicle_swbigmedikit
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound VEHICLE_HEAL
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 335
        subvarvar DOLLARS SHOPTEMP
        setvarvar TEMPHEALTH TEMPVAR5
        mulvar TEMPHEALTH 500
        divvar TEMPHEALTH 1000
        addvarvar TEMPVAR4 TEMPHEALTH
        ifvarvarg TEMPVAR4 TEMPVAR5 setvarvar TEMPVAR4 TEMPVAR5
        setactorvar[tempvehicleid].ENEMYHP TEMPVAR4
        setvar VEHICLEHPDAMAGED? -1
        redefinequote 342 ^15BOUGHT AN EXTRA-LARGE MEDKIT FOR YOUR VEHICLE: +%ld HP
        qsprintf 342 342 TEMPHEALTH 
        setvarvar fta fta_normal setvar ftq 342
ends

state buyforinventory_swbigmedikit
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FOUND_INVENTORY
        redefinequote 341 ^14BOUGHT A EXTRA-LARGE MEDKIT AND STORED IT IN YOUR INVENTORY!
        addvar SWBIGMEDIKITS 1
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 335
        subvarvar DOLLARS SHOPTEMP
 	  setvarvar fta fta_normal setvar ftq 341
ends

// Atomic Health

state buyforcharacter_atom
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound GETATOMICHEALTH
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 625
        subvarvar DOLLARS SHOPTEMP
        state gotmedsyoureallyneeded
        setvarvar TEMPHEALTH MAXHITPOINTS
        ifvare CHARACTERSELECTED? 1 mulvar TEMPHEALTH 2000 else mulvar TEMPHEALTH 500
        divvar TEMPHEALTH 1000
        addvarvar CURRENTHITPOINTS TEMPHEALTH
        ifvarvarg CURRENTHITPOINTS MAXHITPOINTSATOMIC setvarvar CURRENTHITPOINTS MAXHITPOINTSATOMIC
        ifvarvarg CURRENTHITPOINTS STATLIMITATOMIC setvarvar CURRENTHITPOINTS STATLIMITATOMIC
        setvar PLAYERHPDAMAGED? -1
        redefinequote 342 ^20BOUGHT AN ATOMIC HEALTH: +%ld HP
        qsprintf 342 342 TEMPHEALTH 
        setvarvar fta fta_normal setvar ftq 342
ends

state buyforvehicle_atom
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound GETATOMICHEALTH
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 625
        subvarvar DOLLARS SHOPTEMP
        getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR3        
        setvarvar TEMPHEALTH TEMPVAR3
        mulvar TEMPHEALTH 500
        divvar TEMPHEALTH 1000
        addvarvar TEMPVAR4 TEMPHEALTH
        ifvarvarg TEMPVAR4 TEMPVAR5 setvarvar TEMPVAR4 TEMPVAR5
        ifvarvarg TEMPVAR4 STATLIMITATOMIC setvarvar TEMPVAR4 STATLIMITATOMIC
        setactorvar[tempvehicleid].ENEMYHP TEMPVAR4
        setvar VEHICLEHPDAMAGED? -1
        redefinequote 342 ^15BOUGHT AN ATOMIC HEALTH FOR YOUR VEHICLE: +%ld HP
        qsprintf 342 342 TEMPHEALTH 
        setvarvar fta fta_normal setvar ftq 342
ends

state buyforinventory_atom
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FOUND_INVENTORY
        redefinequote 341 ^14BOUGHT AN ATOMIC HEALTH ITEM AND STORED IT IN YOUR INVENTORY!
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 625
        subvarvar DOLLARS SHOPTEMP
        addvar ATOMICHEALTHS 1
    	  setvarvar fta fta_normal setvar ftq 341
ends

// Super Atom

state buyforcharacter_superatom
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound GETATOMICHEALTH
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 4000
        subvarvar DOLLARS SHOPTEMP
        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 }	
        ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC setvar PLAYERHPDAMAGED? -1
        setvarvar CURRENTHITPOINTS MAXHITPOINTSATOMIC
        ifvarvarg CURRENTHITPOINTS STATLIMITATOMIC setvarvar CURRENTHITPOINTS STATLIMITATOMIC
        ifvarvarl FIRSTAIDCURRENT MAXHITPOINTSATOMIC setvar DISPLAYFAFLASHTIMER -28
        setvarvar FIRSTAIDCURRENT MAXHITPOINTSATOMIC
        ifvarvarg FIRSTAIDCURRENT STATLIMITATOMIC setvarvar FIRSTAIDCURRENT STATLIMITATOMIC
        ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTSATOMIC setvar PLAYERAPDAMAGED? -1
        setvarvar CURRENTARMORPOINTS MAXARMORPOINTSATOMIC
        ifvarvarg CURRENTARMORPOINTS STATLIMITATOMIC setvarvar CURRENTARMORPOINTS STATLIMITATOMIC
        redefinequote 341 ^20BOUGHT A SUPER ATOM: 200% HP/AP/FA
        setvarvar fta fta_normal setvar ftq 341
ends

state buyforvehicle_superatom
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound GETATOMICHEALTH
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 4000
        subvarvar DOLLARS SHOPTEMP

        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

        getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
        getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
        mulvar TEMPVAR5 2
        ifvarvarl TEMPVAR4 TEMPVAR5 setvar VEHICLEHPDAMAGED? -1
        setvarvar TEMPVAR4 TEMPVAR5
        ifvarvarg TEMPVAR4 STATLIMITATOMIC setvarvar TEMPVAR4 STATLIMITATOMIC
        setactorvar[tempvehicleid].ENEMYHP TEMPVAR4

        getactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
        getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
        mulvar TEMPVAR5 2
        ifvarvarl TEMPVAR4 TEMPVAR5 setactorvar[PLAYERID].VDISPLAYFAFLASHTIMER -28
        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 setvar VEHICLEAPDAMAGED? -1
        setvarvar TEMPVAR4 TEMPVAR5
        ifvarvarg TEMPVAR4 STATLIMITATOMIC setvarvar TEMPVAR4 STATLIMITATOMIC
        setactorvar[tempvehicleid].ENEMYAP TEMPVAR4

        redefinequote 341 ^15BOUGHT A SUPER ATOM FOR YOUR VEHICLE: 200% HP/AP/FA
        setvarvar fta fta_normal setvar ftq 341
ends

state buyforinventory_superatom
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FOUND_INVENTORY
        redefinequote 341 ^14BOUGHT A SUPER ATOM AND STORED IT IN YOUR INVENTORY!
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 4000
        subvarvar DOLLARS SHOPTEMP
        addvar SUPERATOMS 1
    	  setvarvar fta fta_normal setvar ftq 341
ends

// Body Armor

state buyforcharacter_shield
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 500
        subvarvar DOLLARS SHOPTEMP
	  ifrnd 64 { ifvarl ARMORPERCENT 333 setvar ARMORPERCENT 333 }
	  else ifrnd 85 { ifvarl ARMORPERCENT 500 setvar ARMORPERCENT 500 }
	  else ifrnd 128 { ifvarl ARMORPERCENT 750 setvar ARMORPERCENT 750 }
	  else { ifvarl ARMORPERCENT 900 setvar ARMORPERCENT 900 }
        setvarvar CURRENTARMORPOINTS MAXARMORPOINTS
        setvar PLAYERAPDAMAGED? -1
        redefinequote 341 ^20BOUGHT BODY ARMOR
        setvarvar fta fta_normal setvar ftq 341
ends

state buyforvehicle_shield
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound USE_ARMORITEM3
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 500
        subvarvar DOLLARS SHOPTEMP

        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

        setvarvar TEMPVAR4 TEMPVAR5
        setactorvar[tempvehicleid].ENEMYAP TEMPVAR4
        setvar VEHICLEAPDAMAGED? -1
        redefinequote 341 ^15BOUGHT BODY ARMOR FOR YOUR VEHICLE!
        setvarvar fta fta_normal setvar ftq 341
ends

state buyforinventory_shield
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FOUND_INVENTORY
        redefinequote 341 ^14BOUGHT A SUIT OF BODY ARMOR AND STORED IT IN YOUR INVENTORY!
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 500
        subvarvar DOLLARS SHOPTEMP
        addvar BODYARMORS 1
    	  setvarvar fta fta_normal setvar ftq 341
ends

// Super Armor

state buyforcharacter_supershield
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifrnd 128 globalsound USE_ARMORITEM1 else globalsound USE_ARMORITEM2
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1500
        subvarvar DOLLARS SHOPTEMP
	  ifrnd 64 { ifvarl ARMORPERCENT 333 setvar ARMORPERCENT 333 }
	  else ifrnd 85 { ifvarl ARMORPERCENT 500 setvar ARMORPERCENT 500 }
	  else ifrnd 128 { ifvarl ARMORPERCENT 750 setvar ARMORPERCENT 750 }
	  else { ifvarl ARMORPERCENT 900 setvar ARMORPERCENT 900 }
	  setvarvar CURRENTARMORPOINTS MAXARMORPOINTSATOMIC
        setvar PLAYERAPDAMAGED? -1
        redefinequote 341 ^20BOUGHT SUPER ARMOR
        setvarvar fta fta_normal setvar ftq 341
ends

state buyforvehicle_supershield
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound USE_ARMORITEM3
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1500
        subvarvar DOLLARS SHOPTEMP

        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

        setvarvar TEMPVAR4 TEMPVAR5
        setactorvar[tempvehicleid].ENEMYAP TEMPVAR4
        setvar VEHICLEAPDAMAGED? -1
        redefinequote 341 ^20BOUGHT SUPER ARMOR FOR YOUR VEHICLE!
        setvarvar fta fta_normal setvar ftq 341
ends

state buyforinventory_supershield
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FOUND_INVENTORY
        redefinequote 341 ^14BOUGHT A SUIT OF SUPER ARMOR AND STORED IT IN YOUR INVENTORY!
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1500
        subvarvar DOLLARS SHOPTEMP
        addvar SUPERARMORS 1
  	  setvarvar fta fta_normal setvar ftq 341
ends

// Scuba Tank

state buyforcharacter_airtank
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1500
        subvarvar DOLLARS SHOPTEMP
	  setplayer[THISACTOR].scuba_amount SCUBA_AMOUNT
        redefinequote 341 ^20BOUGHT SCUBA GEAR
        setvarvar fta fta_normal setvar ftq 341
ends

state buyforvehicle_airtank
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1500
        subvarvar DOLLARS SHOPTEMP
	  setactorvar[tempvehicleid].ENEMYAIRTANKAMOUNT SCUBA_AMOUNT
        redefinequote 341 ^15BOUGHT SCUBA GEAR FOR YOUR VEHICLE!
        setvarvar fta fta_normal setvar ftq 341
ends

state buyforinventory_airtank
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FOUND_INVENTORY
        redefinequote 341 ^14BOUGHT SCUBA GEAR AND STORED IT IN YOUR INVENTORY!
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1500
        subvarvar DOLLARS SHOPTEMP
        addvar SCUBATANKS 1
    	  setvarvar fta fta_normal setvar ftq 341
ends

// Protective Boots

state buyforcharacter_boots
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1000
        subvarvar DOLLARS SHOPTEMP
	  setplayer[THISACTOR].boot_amount BOOT_AMOUNT
        redefinequote 341 ^20BOUGHT PROTECTIVE BOOTS
        setvarvar fta fta_normal setvar ftq 341
ends

state buyforvehicle_boots
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1000
        subvarvar DOLLARS SHOPTEMP
	  setactorvar[tempvehicleid].ENEMYBOOTSAMOUNT BOOT_AMOUNT
        redefinequote 341 ^15BOUGHT PROTECTIVE BOOTS FOR YOUR VEHICLE!
        setvarvar fta fta_normal setvar ftq 341
ends

state buyforinventory_boots
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FOUND_INVENTORY
        redefinequote 341 ^14BOUGHT SOME PROTECTIVE BOOTS AND STORED THEM IN YOUR INVENTORY!
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1000
        subvarvar DOLLARS SHOPTEMP
        addvar BOOTPAIRS 1
        setvarvar fta fta_normal setvar ftq 341
ends

// Portable Medikit

state buyforcharacter_firstaid
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 200
        subvarvar DOLLARS SHOPTEMP
        ifvare CHARACTERSELECTED? 13
        {
	   setvarvar TEMPVAR MAXHITPOINTS
	   mulvarvar TEMPVAR 3
	   divvarvar TEMPVAR 2
         setvarvar FIRSTAIDCURRENT TEMPVAR
        }
        else setvarvar FIRSTAIDCURRENT MAXHITPOINTS
        setvar DISPLAYFAFLASHTIMER -28
        redefinequote 341 ^20BOUGHT A PORTABLE MEDIKIT
        setvarvar fta fta_normal setvar ftq 341
ends

state buyforvehicle_firstaid
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 200
        subvarvar DOLLARS SHOPTEMP
        setactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR5
        setactorvar[PLAYERID].VDISPLAYFAFLASHTIMER -28
        redefinequote 341 ^15BOUGHT A PORTABLE MEDIKIT FOR YOUR VEHICLE!
        setvarvar fta fta_normal setvar ftq 341
ends

state buyforinventory_firstaid
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FOUND_INVENTORY
        redefinequote 341 ^14BOUGHT A PORTABLE MEDIKIT AND STORED IT IN YOUR INVENTORY!
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 200
        subvarvar DOLLARS SHOPTEMP
        addvar PORTABLEMEDIKITS 1
    	  setvarvar fta fta_normal setvar ftq 341
ends

// Max HP/AP Bonus

state buyforcharacter_maxhpapup
          stopsound MENU_ERROR stopsound SHOP_FAIL
          state shop_buyitem
          globalsound BONUS_GRAB
          globalsound BONUS_GRAB
          globalsound BONUS_GRAB
          ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 6250
          subvarvar DOLLARS SHOPTEMP
          state maxhpapbonusgive redefinequote 341 ^20BOUGHT MAX HP/AP BONUS
          ifrnd 32
          {
           state maxhpapbonusgive redefinequote 341 ^20BOUGHT MAX HP/AP BONUS!
           ifrnd 32
           {
            state maxhpapbonusgive redefinequote 341 ^20BOUGHT MAX HP/AP BONUS!!
           }
          }
          setvarvar fta fta_normal setvar ftq 341
ends

state buyforvehicle_maxhpapup
          stopsound MENU_ERROR stopsound SHOP_FAIL
          state shop_buyitem
          globalsound BONUS_GRAB
          globalsound BONUS_GRAB
          globalsound BONUS_GRAB
          ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 6250
          subvarvar DOLLARS SHOPTEMP
          state maxhpapbonusgive_vehicle redefinequote 341 ^15BOUGHT MAX HP/AP BONUS FOR YOUR VEHICLE
          ifrnd 32
          {
           state maxhpapbonusgive_vehicle redefinequote 341 ^15BOUGHT MAX HP/AP BONUS FOR YOUR VEHICLE!
           ifrnd 32
           {
            state maxhpapbonusgive_vehicle redefinequote 341 ^15BOUGHT MAX HP/AP BONUS FOR YOUR VEHICLE!!
           }
          }
          setvarvar fta fta_normal setvar ftq 341
ends

// Attack/Defense Bonus

state buyforcharacter_atkdefup
          stopsound MENU_ERROR stopsound SHOP_FAIL
          state shop_buyitem
          globalsound BONUS_GRAB
          globalsound BONUS_GRAB
          globalsound BONUS_GRAB
          ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 6250
          subvarvar DOLLARS SHOPTEMP
          state atkdefbonusgive redefinequote 341 ^20BOUGHT ATTACK/DEFENSE BONUS
          ifrnd 32 
          {
           state atkdefbonusgive redefinequote 341 ^20BOUGHT ATTACK/DEFENSE BONUS!
           ifrnd 32
           {
            state atkdefbonusgive redefinequote 341 ^20BOUGHT ATTACK/DEFENSE BONUS!!
           }
          }
          setvarvar fta fta_normal setvar ftq 341
ends

state buyforvehicle_atkdefup
          stopsound MENU_ERROR stopsound SHOP_FAIL
          state shop_buyitem
          globalsound BONUS_GRAB
          globalsound BONUS_GRAB
          globalsound BONUS_GRAB
          ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 6250
          subvarvar DOLLARS SHOPTEMP
          state atkdefbonusgive_vehicle redefinequote 341 ^15BOUGHT ATTACK/DEFENSE BONUS FOR YOUR VEHICLE
          ifrnd 32 
          {
           state atkdefbonusgive_vehicle redefinequote 341 ^15BOUGHT ATTACK/DEFENSE BONUS FOR YOUR VEHICLE!
           ifrnd 32
           {
            state atkdefbonusgive_vehicle redefinequote 341 ^15BOUGHT ATTACK/DEFENSE BONUS FOR YOUR VEHICLE!!
           }
          }
          setvarvar fta fta_normal setvar ftq 341
ends

//
//
//

state shop_selection
ifvare com_pause 0
{
 // Sounds
 stopsound MENU_SELECTED 
 stopsound MENU_ENTER 
 stopsound MENU_EXIT

  // Menus
  ifvare shop_id 0
  {
//******************
//***Buying Items***
//******************
   ifvare shopmode 0 // Buying Items
   {
    ifvare shoppage 0
    {
     ifvare shopselection 0 
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 74
      ifvarvarg DOLLARS SHOPTEMP
      {
       getactorvar[PLAYERID].VEHICLEID tempvehicleid
       ifvare tempvehicleid -1
       {
        ifvarvarl CURRENTHITPOINTS MAXHITPOINTS
         state buyforcharacter_cola
        else
         state buyforinventory_cola
       }
       else
       {
        ifvare vehiclepickuptoggle 0 // Character Only
        {
         ifvarvarl CURRENTHITPOINTS MAXHITPOINTS
          state buyforcharacter_cola
         else
          state buyforinventory_cola
        }
        ifvare vehiclepickuptoggle 1 // Vehicle Only
        {
         getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
         ifvarvarl TEMPVAR4 TEMPVAR5
          state buyforvehicle_cola
         else
          state buyforinventory_cola
        }
        ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
        {
         ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state buyforcharacter_cola
         else
         {
          getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
          getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
          ifvarvarl TEMPVAR4 TEMPVAR5
           state buyforvehicle_cola
          else
           state buyforinventory_cola
         }
        }
        ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
        {
         getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
         ifvarvarl TEMPVAR4 TEMPVAR5 state buyforvehicle_cola
         else
         {
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS
           state buyforcharacter_cola
          else
           state buyforinventory_cola
         }
        }
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 1
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 134
      ifvarvarg DOLLARS SHOPTEMP
      {
       getactorvar[PLAYERID].VEHICLEID tempvehicleid
       ifvare tempvehicleid -1
       {
        ifvarvarl CURRENTHITPOINTS MAXHITPOINTS
         state buyforcharacter_swmedikit
        else
         state buyforinventory_swmedikit
       }
       else
       {
        ifvare vehiclepickuptoggle 0 // Character Only
        {
         ifvarvarl CURRENTHITPOINTS MAXHITPOINTS
          state buyforcharacter_swmedikit
         else
          state buyforinventory_swmedikit
        }
        ifvare vehiclepickuptoggle 1 // Vehicle Only
        {
         getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
         ifvarvarl TEMPVAR4 TEMPVAR5
          state buyforvehicle_swmedikit
         else
          state buyforinventory_swmedikit
        }
        ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
        {
         ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state buyforcharacter_swmedikit
         else
         {
          getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
          getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
          ifvarvarl TEMPVAR4 TEMPVAR5
           state buyforvehicle_swmedikit
          else
           state buyforinventory_swmedikit
         }
        }
        ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
        {
         getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
         ifvarvarl TEMPVAR4 TEMPVAR5 state buyforvehicle_swmedikit
         else
         {
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS
           state buyforcharacter_swmedikit
          else
           state buyforinventory_swmedikit
         }
        }
       }
      }
      else
      {
       stopsound MONEYSOUND
       sound MENU_ERROR
       redefinequote 341 ^10YOU DON'T NEED TO BUY THIS ITEM!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 2
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 199
      ifvarvarg DOLLARS SHOPTEMP
      {
       getactorvar[PLAYERID].VEHICLEID tempvehicleid
       ifvare tempvehicleid -1
       {
        ifvarvarl CURRENTHITPOINTS MAXHITPOINTS
         state buyforcharacter_sixpak
        else
         state buyforinventory_sixpak
       }
       else
       {
        ifvare vehiclepickuptoggle 0 // Character Only
        {
         ifvarvarl CURRENTHITPOINTS MAXHITPOINTS
          state buyforcharacter_sixpak
         else
          state buyforinventory_sixpak
        }
        ifvare vehiclepickuptoggle 1 // Vehicle Only
        {
         getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
         ifvarvarl TEMPVAR4 TEMPVAR5
          state buyforvehicle_sixpak
         else
          state buyforinventory_sixpak
        }
        ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
        {
         ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state buyforcharacter_sixpak
         else
         {
          getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
          getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
          ifvarvarl TEMPVAR4 TEMPVAR5
           state buyforvehicle_sixpak
          else
           state buyforinventory_sixpak
         }
        }
        ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
        {
         getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
         ifvarvarl TEMPVAR4 TEMPVAR5 state buyforvehicle_sixpak
         else
         {
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS
           state buyforcharacter_sixpak
          else
           state buyforinventory_sixpak
         }
        }
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 3
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 334
      ifvarvarg DOLLARS SHOPTEMP
      {
       getactorvar[PLAYERID].VEHICLEID tempvehicleid
       ifvare tempvehicleid -1
       {
        ifvarvarl CURRENTHITPOINTS MAXHITPOINTS
         state buyforcharacter_swbigmedikit
        else
         state buyforinventory_swbigmedikit
       }
       else
       {
        ifvare vehiclepickuptoggle 0 // Character Only
        {
         ifvarvarl CURRENTHITPOINTS MAXHITPOINTS
          state buyforcharacter_swbigmedikit
         else
          state buyforinventory_swbigmedikit
        }
        ifvare vehiclepickuptoggle 1 // Vehicle Only
        {
         getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
         ifvarvarl TEMPVAR4 TEMPVAR5
          state buyforvehicle_swbigmedikit
         else
          state buyforinventory_swbigmedikit
        }
        ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
        {
         ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state buyforcharacter_swbigmedikit
         else
         {
          getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
          getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
          ifvarvarl TEMPVAR4 TEMPVAR5
           state buyforvehicle_swbigmedikit
          else
           state buyforinventory_swbigmedikit
         }
        }
        ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
        {
         getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
         ifvarvarl TEMPVAR4 TEMPVAR5 state buyforvehicle_swbigmedikit
         else
         {
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS
           state buyforcharacter_swbigmedikit
          else
           state buyforinventory_swbigmedikit
         }
        }
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 4
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 624
      ifvarvarg DOLLARS SHOPTEMP
      {
       getactorvar[PLAYERID].VEHICLEID tempvehicleid
       ifvare tempvehicleid -1
       {
        ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC
         state buyforcharacter_atom
        else
         state buyforinventory_atom
       }
       else
       {
        ifvare vehiclepickuptoggle 0 // Character Only
        {
         ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC
          state buyforcharacter_atom
         else
          state buyforinventory_atom
        }
        ifvare vehiclepickuptoggle 1 // Vehicle Only
        {
         getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
         mulvar TEMPVAR5 2
         ifvarvarl TEMPVAR4 TEMPVAR5
          state buyforvehicle_atom
         else
          state buyforinventory_atom
        }
        ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
        {
         ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC state buyforcharacter_atom
         else
         {
          getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
          getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
          mulvar TEMPVAR5 2
          ifvarvarl TEMPVAR4 TEMPVAR5
           state buyforvehicle_atom
          else
           state buyforinventory_atom
         }
        }
        ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
        {
         getactorvar[tempvehicleid].ENEMYHP TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
         mulvar TEMPVAR5 2
         ifvarvarl TEMPVAR4 TEMPVAR5 state buyforvehicle_atom
         else
         {
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC
           state buyforcharacter_atom
          else
           state buyforinventory_atom
         }
        }
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 5
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 3999
      ifvarvarg DOLLARS SHOPTEMP
      {
       getactorvar[PLAYERID].VEHICLEID tempvehicleid
       ifvare tempvehicleid -1
       {
        setvar TEMP3 0
        state superatom_checkstatsplayer
        ifvarg TEMP3 0
         state buyforcharacter_superatom
        else
         state buyforinventory_superatom
       }
       else
       {
        ifvare vehiclepickuptoggle 0 // Character Only
        {
         setvar TEMP3 0
         state superatom_checkstatsplayer
         ifvarg TEMP3 0
          state buyforcharacter_superatom
         else
          state buyforinventory_superatom
        }
        ifvare vehiclepickuptoggle 1 // Vehicle Only
        {
         setvar TEMP3 0
         state superatom_checkstatsvehicle
         ifvarg TEMP3 0
          state buyforvehicle_superatom
         else
          state buyforinventory_superatom
        }
        ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
        {
         setvar TEMP3 0
         state superatom_checkstatsplayer
         ifvarg TEMP3 0 state buyforcharacter_superatom
         else
         {
          setvar TEMP3 0
          state superatom_checkstatsvehicle
          ifvarg TEMP3 0
           state buyforvehicle_superatom
          else
           state buyforinventory_superatom
         }
        }
        ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
        {
         setvar TEMP3 0
         state superatom_checkstatsvehicle
         ifvarg TEMP3 0 state buyforvehicle_superatom
         else
         {
          setvar TEMP3 0
          state superatom_checkstatsplayer
          ifvarg TEMP3 0
           state buyforcharacter_superatom
          else
           state buyforinventory_superatom
         }
        }
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 6
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 499
      ifvarvarg DOLLARS SHOPTEMP
      {
       getactorvar[PLAYERID].VEHICLEID tempvehicleid
       ifvare tempvehicleid -1
       {
        ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTS
         state buyforcharacter_shield
        else
         state buyforinventory_shield
       }
       else
       {
        ifvare vehiclepickuptoggle 0 // Character Only
        {
         ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTS
          state buyforcharacter_shield
         else
          state buyforinventory_shield
        }
        ifvare vehiclepickuptoggle 1 // Vehicle Only
        {
         getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
         ifvarvarl TEMPVAR4 TEMPVAR5
          state buyforvehicle_shield
         else
          state buyforinventory_shield
        }
        ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
        {
         ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTS state buyforcharacter_shield
         else
         {
          getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
          getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
          ifvarvarl TEMPVAR4 TEMPVAR5
           state buyforvehicle_shield
          else
           state buyforinventory_shield
         }
        }
        ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
        {
         getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
         ifvarvarl TEMPVAR4 TEMPVAR5 state buyforvehicle_shield
         else
         {
          ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTS
           state buyforcharacter_shield
          else
           state buyforinventory_shield
         }
        }
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 7
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else { setvar SHOPTEMP 1499 }
      ifvarvarg DOLLARS SHOPTEMP
      {
       getactorvar[PLAYERID].VEHICLEID tempvehicleid
       ifvare tempvehicleid -1
       {
        ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTSATOMIC
         state buyforcharacter_supershield
        else
         state buyforinventory_supershield
       }
       else
       {
        ifvare vehiclepickuptoggle 0 // Character Only
        {
         ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTSATOMIC
          state buyforcharacter_supershield
         else
          state buyforinventory_supershield
        }
        ifvare vehiclepickuptoggle 1 // Vehicle Only
        {
         getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
         mulvar TEMPVAR5 2
         ifvarvarl TEMPVAR4 TEMPVAR5
          state buyforvehicle_shield
         else
          state buyforinventory_shield
        }
        ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
        {
         ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTSATOMIC state buyforcharacter_supershield
         else
         {
          getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
          getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
          mulvar TEMPVAR5 2
          ifvarvarl TEMPVAR4 TEMPVAR5
           state buyforvehicle_shield
          else
           state buyforinventory_shield
         }
        }
        ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
        {
         getactorvar[tempvehicleid].ENEMYAP TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
         mulvar TEMPVAR5 2
         ifvarvarl TEMPVAR4 TEMPVAR5 state buyforvehicle_shield
         else
         {
          ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTSATOMIC
           state buyforcharacter_supershield
          else
           state buyforinventory_supershield
         }
        }
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 8
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 6399
      ifvarvarg DOLLARS SHOPTEMP
      {
       ifvarl STEROIDSTIME STEROID_AMOUNT
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 6400
        subvarvar DOLLARS SHOPTEMP
        setvar STEROIDSTIME STEROID_AMOUNT
	  setplayer[THISACTOR].steroids_amount 400
        redefinequote 341 ^20BOUGHT VITAMIN X
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FOUND_INVENTORY
        redefinequote 341 ^14BOUGHT SOME VITAMIN X AND STORED IT IN YOUR INVENTORY!
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 6400
        subvarvar DOLLARS SHOPTEMP
        addvar VITAMINXS 1
  	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 9
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 999
      ifvarvarg DOLLARS SHOPTEMP
      {
       ifvarn CHARACTERSELECTED? 4
       {
        ifvarl NIGHTVISIONTIME HEAT_AMOUNT
        {
         stopsound MENU_ERROR stopsound SHOP_FAIL
         state shop_buyitem
         globalsound DUKE_GET
         ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1000
         subvarvar DOLLARS SHOPTEMP
   	   setplayer[THISACTOR].heat_amount HEAT_AMOUNT
         redefinequote 341 ^20BOUGHT NIGHT-VISION GOGGLES
         setvarvar fta fta_normal setvar ftq 341
        }
        else
        {
         stopsound MENU_ERROR stopsound SHOP_FAIL
         state shop_buyitem
         globalsound DUKE_GET
         globalsound FOUND_INVENTORY
         redefinequote 341 ^14BOUGHT SOME NIGHT-VISION GOGGLES AND STORED THEM IN YOUR INVENTORY!
         ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1000
         subvarvar DOLLARS SHOPTEMP
         addvar HEATSENSORS 1
         setvarvar fta fta_normal setvar ftq 341
        }
       }
       else
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FOUND_INVENTORY
        redefinequote 341 ^14BOUGHT SOME NIGHT-VISION GOGGLES AND STORED THEM IN YOUR INVENTORY
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1000
        subvarvar DOLLARS SHOPTEMP
        addvar HEATSENSORS 1
        setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 10
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1249
      ifvarvarg DOLLARS SHOPTEMP
      {
       ifvarl HOLOFORMTIME HOLODUKE_AMOUNT
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1250
        subvarvar DOLLARS SHOPTEMP
	  setplayer[THISACTOR].holoduke_amount HOLODUKE_AMOUNT
        ifvare CHARACTERSELECTED? 1 redefinequote 341 ^20BOUGHT HOLODUKE
        ifvare CHARACTERSELECTED? 2 redefinequote 341 ^20BOUGHT HOLOJACK
        ifvare CHARACTERSELECTED? 3 redefinequote 341 ^20BOUGHT HOLOBUBSY
        ifvare CHARACTERSELECTED? 4 redefinequote 341 ^20BOUGHT HOLOAMI
        ifvare CHARACTERSELECTED? 5 redefinequote 341 ^20BOUGHT HOLOHIGA
        ifvare CHARACTERSELECTED? 6 redefinequote 341 ^20BOUGHT HOLOESSENCE
        ifvare CHARACTERSELECTED? 7 redefinequote 341 ^20BOUGHT HOLOTED
        ifvare CHARACTERSELECTED? 8 redefinequote 341 ^20BOUGHT HOLOLISA
        ifvare CHARACTERSELECTED? 9 redefinequote 341 ^20BOUGHT HOLOCYBANIS
        ifvare CHARACTERSELECTED? 10 redefinequote 341 ^20BOUGHT HOLONETHRA
        ifvare CHARACTERSELECTED? 11 redefinequote 341 ^20BOUGHT HOLOPAULA
        ifvare CHARACTERSELECTED? 12 redefinequote 341 ^20BOUGHT HOLOLORI
        ifvare CHARACTERSELECTED? 13 redefinequote 341 ^20BOUGHT HOLOMINAKO
        ifvare CHARACTERSELECTED? 14 redefinequote 341 ^20BOUGHT HOLO???????
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FOUND_INVENTORY
        redefinequote 341 ^14BOUGHT A HOLOFORM AND STORED IT IN YOUR INVENTORY!
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1250
        subvarvar DOLLARS SHOPTEMP
        addvar HOLOFORMS 1
        setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 11
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1499
      ifvarvarg DOLLARS SHOPTEMP
      {
       ifvarl JETPACKTIME JETPACK_AMOUNT
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1500
        subvarvar DOLLARS SHOPTEMP
	  setplayer[THISACTOR].jetpack_amount JETPACK_AMOUNT
        redefinequote 341 ^20BOUGHT A JETPACK
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FOUND_INVENTORY
        redefinequote 341 ^14BOUGHT A JETPACK AND STORED IT IN YOUR INVENTORY!
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1500
        subvarvar DOLLARS SHOPTEMP
        addvar JETPACKS 1
        setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 12
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1499
      ifvarvarg DOLLARS SHOPTEMP
      {
       getactorvar[PLAYERID].VEHICLEID tempvehicleid
       ifvare tempvehicleid -1
       {
        ifvarl SCUBATIME SCUBA_AMOUNT
         state buyforcharacter_airtank
        else
         state buyforinventory_airtank
       }
       else
       {
        ifvare vehiclepickuptoggle 0 // Character Only
        {
         ifvarl SCUBATIME SCUBA_AMOUNT
          state buyforcharacter_airtank
         else
          state buyforinventory_airtank
        }
        ifvare vehiclepickuptoggle 1 // Vehicle Only
        {
         getactorvar[tempvehicleid].ENEMYAIRTANKAMOUNT TEMPVAR4
         ifvarl TEMPVAR4 SCUBA_AMOUNT
          state buyforvehicle_airtank
         else
          state buyforinventory_airtank
        }
        ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
        {
         ifvarl SCUBATIME SCUBA_AMOUNT  state buyforcharacter_airtank
         else
         {
          getactorvar[tempvehicleid].ENEMYAIRTANKAMOUNT TEMPVAR4
          ifvarl TEMPVAR4 SCUBA_AMOUNT
           state buyforvehicle_airtank
          else
           state buyforinventory_airtank
         }
        }
        ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
        {
         getactorvar[tempvehicleid].ENEMYAIRTANKAMOUNT TEMPVAR4
         ifvarl TEMPVAR4 SCUBA_AMOUNT state buyforvehicle_airtank
         else
         {
          ifvarl SCUBATIME SCUBA_AMOUNT
           state buyforcharacter_airtank
          else
           state buyforinventory_airtank
         }
        }
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 13
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 999
      ifvarvarg DOLLARS SHOPTEMP
      {
       getactorvar[PLAYERID].VEHICLEID tempvehicleid
       ifvare tempvehicleid -1
       {
        ifvarl BOOTSTIME BOOT_AMOUNT
         state buyforcharacter_boots
        else
         state buyforinventory_boots
       }
       else
       {
        ifvare vehiclepickuptoggle 0 // Character Only
        {
         ifvarl BOOTSTIME BOOT_AMOUNT
          state buyforcharacter_boots
         else
          state buyforinventory_boots
        }
        ifvare vehiclepickuptoggle 1 // Vehicle Only
        {
         getactorvar[tempvehicleid].ENEMYBOOTSAMOUNT TEMPVAR4
         ifvarl TEMPVAR4 BOOT_AMOUNT
          state buyforvehicle_boots
         else
          state buyforinventory_boots
        }
        ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
        {
         ifvarl BOOTSTIME BOOT_AMOUNT state buyforcharacter_boots
         else
         {
          getactorvar[tempvehicleid].ENEMYBOOTSAMOUNT TEMPVAR4
          ifvarl TEMPVAR4 BOOT_AMOUNT
           state buyforvehicle_boots
          else
           state buyforinventory_boots
         }
        }
        ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
        {
         getactorvar[tempvehicleid].ENEMYBOOTSAMOUNT TEMPVAR4
         ifvarl TEMPVAR4 BOOT_AMOUNT state buyforvehicle_boots
         else
         {
          ifvarl BOOTSTIME BOOT_AMOUNT
           state buyforcharacter_boots
          else
           state buyforinventory_boots
         }
        }
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 14
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1999 
      ifvarvarg DOLLARS SHOPTEMP
      {
       getactorvar[PLAYERID].VEHICLEID tempvehicleid
       ifvare tempvehicleid -1
       {
        ifvarvarl FIRSTAIDCURRENT MAXHITPOINTS
         state buyforcharacter_firstaid
        else
         state buyforinventory_firstaid
       }
       else
       {
        ifvare vehiclepickuptoggle 0 // Character Only
        {
         ifvarvarl FIRSTAIDCURRENT MAXHITPOINTS
          state buyforcharacter_firstaid
         else
          state buyforinventory_firstaid
        }
        ifvare vehiclepickuptoggle 1 // Vehicle Only
        {
         getactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
         ifvarvarl TEMPVAR4 TEMPVAR5
          state buyforvehicle_firstaid
         else
          state buyforinventory_firstaid
        }
        ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
        {
         ifvarvarl FIRSTAIDCURRENT MAXHITPOINTS state buyforcharacter_firstaid
         else
         {
          getactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
          getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
          ifvarvarl TEMPVAR4 TEMPVAR5
           state buyforvehicle_firstaid
          else
           state buyforinventory_firstaid
         }
        }
        ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
        {
         getactorvar[tempvehicleid].ENEMYFIRSTAID TEMPVAR4
         getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
         ifvarvarl TEMPVAR4 TEMPVAR5 state buyforvehicle_firstaid
         else
         {
          ifvarvarl FIRSTAIDCURRENT MAXHITPOINTS
           state buyforcharacter_firstaid
          else
           state buyforinventory_firstaid
         }
        }
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 15
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 124
      ifvarvarg DOLLARS SHOPTEMP
      {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound FOUND_INVENTORY
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 125
        subvarvar DOLLARS SHOPTEMP
	  addvar EYEDROPS 1
        redefinequote 341 ^20BOUGHT AN EYEDROP AND STORED IT IN YOUR INVENTORY!
        setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 16
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 174
      ifvarvarg DOLLARS SHOPTEMP
      {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound FOUND_INVENTORY
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 175
        subvarvar DOLLARS SHOPTEMP
	  addvar ANTIDOTES 1
        redefinequote 341 ^20BOUGHT AN ANTIDOTE AND STORED IT IN YOUR INVENTORY!
        setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 17
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 224
      ifvarvarg DOLLARS SHOPTEMP
      {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound FOUND_INVENTORY
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 225
        subvarvar DOLLARS SHOPTEMP
	  addvar FOGHORNS 1
        redefinequote 341 ^20BOUGHT A FOGHORN AND STORED IT IN YOUR INVENTORY!
        setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 18
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 2999
      ifvarvarg DOLLARS SHOPTEMP
      {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound FOUND_BIGITEM
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 3000
        subvarvar DOLLARS SHOPTEMP
	  addvar RESURRECTIONCHALICES 1
        redefinequote 341 ^20BOUGHT A RESURRECTION CHALICE AND STORED IT IN YOUR INVENTORY
        setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 19
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 6249
      ifvarvarg DOLLARS SHOPTEMP
      {
       getactorvar[PLAYERID].VEHICLEID tempvehicleid
       ifvare tempvehicleid -1
       {
        setvarvar TEMPVAR STATLIMIT
        subvar TEMPVAR 1
 	  ifvarvarg MAXHITPOINTS TEMPVAR 	// If Player's Maximum HP is 524288
 	  {
         setvarvar TEMPVAR STATLIMIT
         subvar TEMPVAR 1
         ifvarvarg MAXARMORPOINTS TEMPVAR // If Player's Maximum AP is 524288
         {
          stopsound MONEYSOUND
          sound MENU_ERROR
          redefinequote 341 ^10YOU DON'T NEED TO BUY THIS ITEM!
	    setvarvar fta fta_normal setvar ftq 341
         }
         else state buyforcharacter_maxhpapup
        }
        else state buyforcharacter_maxhpapup
        }        
       else
       {
        ifvare vehiclepickuptoggle 0 // Character Only
        {
         setvarvar TEMPVAR STATLIMIT
         subvar TEMPVAR 1
 	   ifvarvarg MAXHITPOINTS TEMPVAR 	// If Player's Maximum HP is 524288
 	   {
          setvarvar TEMPVAR STATLIMIT
          subvar TEMPVAR 1
          ifvarvarg MAXARMORPOINTS TEMPVAR // If Player's Maximum AP is 524288
          {
           stopsound MONEYSOUND
           sound MENU_ERROR
           redefinequote 341 ^10YOU DON'T NEED TO BUY THIS ITEM!
           setvarvar fta fta_normal setvar ftq 341
          }
          else state buyforcharacter_maxhpapup
         }
         else state buyforcharacter_maxhpapup
        }
        ifvare vehiclepickuptoggle 1 // Vehicle Only
        {
         setvarvar TEMPVAR STATLIMIT
         subvar TEMPVAR 1
         getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
 	   ifvarvarg TEMPVAR5 TEMPVAR
 	   {
          setvarvar TEMPVAR STATLIMIT
          subvar TEMPVAR 1
          getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
          ifvarvarg TEMPVAR5 TEMPVAR
          {
           stopsound MONEYSOUND
           sound MENU_ERROR
           redefinequote 341 ^10YOU DON'T NEED TO BUY THIS ITEM!
           setvarvar fta fta_normal setvar ftq 341
          }
          else state buyforvehicle_maxhpapup
         }
         else state buyforvehicle_maxhpapup
        }
        ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
        {
         setvarvar TEMPVAR STATLIMIT
         subvar TEMPVAR 1
 	   ifvarvarg MAXHITPOINTS TEMPVAR 	// If Player's Maximum HP is 524288
 	   {
          setvarvar TEMPVAR STATLIMIT
          subvar TEMPVAR 1
          ifvarvarg MAXARMORPOINTS TEMPVAR // If Player's Maximum AP is 524288
          {
           setvarvar TEMPVAR STATLIMIT
           subvar TEMPVAR 1
           getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
 	     ifvarvarg TEMPVAR5 TEMPVAR
           {
            setvarvar TEMPVAR STATLIMIT
            subvar TEMPVAR 1
            getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
            ifvarvarg TEMPVAR5 TEMPVAR
            {
             stopsound MONEYSOUND
             sound MENU_ERROR
             redefinequote 341 ^10YOU DON'T NEED TO BUY THIS ITEM!
             setvarvar fta fta_normal setvar ftq 341
            }
            else state buyforvehicle_maxhpapup
           }
           else state buyforvehicle_maxhpapup
          }
          else state buyforcharacter_maxhpapup
         }
         else state buyforcharacter_maxhpapup
        }
        ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
        {
         setvarvar TEMPVAR STATLIMIT
         subvar TEMPVAR 1
         getactorvar[tempvehicleid].ENEMYMAXHP TEMPVAR5
 	   ifvarvarg TEMPVAR5 TEMPVAR
 	   {
          setvarvar TEMPVAR STATLIMIT
          subvar TEMPVAR 1
          getactorvar[tempvehicleid].ENEMYMAXAP TEMPVAR5
          ifvarvarg TEMPVAR5 TEMPVAR
          {
           setvarvar TEMPVAR STATLIMIT
           subvar TEMPVAR 1
 	     ifvarvarg MAXHITPOINTS TEMPVAR 	// If Player's Maximum HP is 524288
 	     {
            setvarvar TEMPVAR STATLIMIT
            subvar TEMPVAR 1
            ifvarvarg MAXARMORPOINTS TEMPVAR // If Player's Maximum AP is 524288
            {
             stopsound MONEYSOUND
             sound MENU_ERROR
             redefinequote 341 ^10YOU DON'T NEED TO BUY THIS ITEM!
             setvarvar fta fta_normal setvar ftq 341
            }
            else state buyforcharacter_maxhpapup
           }
           else state buyforcharacter_maxhpapup
          }
          else state buyforvehicle_maxhpapup
         }
         else state buyforvehicle_maxhpapup
        }
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 20
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else { setvar SHOPTEMP 6249 }
      ifvarvarg DOLLARS SHOPTEMP
      {
       getactorvar[PLAYERID].VEHICLEID tempvehicleid
       ifvare tempvehicleid -1
       {
        setvarvar TEMPVAR STATLIMIT
        subvar TEMPVAR 1
        ifvarvarg PLAYERATTACK STATLIMIT
        {
         setvarvar TEMPVAR STATLIMIT
         subvar TEMPVAR 1
         ifvarvarg PLAYERDEFENSE STATLIMIT
         {
          stopsound MONEYSOUND
          sound MENU_ERROR
          redefinequote 341 ^10YOU DON'T NEED TO BUY THIS ITEM!
	    setvarvar fta fta_normal setvar ftq 341
         }
         else state buyforcharacter_atkdefup
        }
        else state buyforcharacter_atkdefup
       }
       else
       {
        ifvare vehiclepickuptoggle 0 // Character Only
        {
         setvarvar TEMPVAR STATLIMIT
         subvar TEMPVAR 1
         ifvarvarg PLAYERATTACK STATLIMIT
         {
          setvarvar TEMPVAR STATLIMIT
          subvar TEMPVAR 1
          ifvarvarg PLAYERDEFENSE STATLIMIT
          {
           stopsound MONEYSOUND
           sound MENU_ERROR
           redefinequote 341 ^10YOU DON'T NEED TO BUY THIS ITEM!
           setvarvar fta fta_normal setvar ftq 341
          }
          else state buyforcharacter_atkdefup
         }
         else state buyforcharacter_atkdefup
        }
        ifvare vehiclepickuptoggle 1 // Vehicle Only
        {
         setvarvar TEMPVAR STATLIMIT
         subvar TEMPVAR 1
         getactorvar[tempvehicleid].ACTORATTACK TEMPVAR5
         ifvarvarg TEMPVAR5 STATLIMIT
         {
          setvarvar TEMPVAR STATLIMIT
          subvar TEMPVAR 1
          getactorvar[tempvehicleid].ACTORDEFENSE TEMPVAR5
          ifvarvarg TEMPVAR5 STATLIMIT
          {
           stopsound MONEYSOUND
           sound MENU_ERROR
           redefinequote 341 ^10YOU DON'T NEED TO BUY THIS ITEM!
           setvarvar fta fta_normal setvar ftq 341
          }
          else state buyforvehicle_atkdefup
         }
         else state buyforvehicle_atkdefup
        }
        ifvare vehiclepickuptoggle 2 // Character & Vehicle [Character before Vehicle]
        {
         setvarvar TEMPVAR STATLIMIT
         subvar TEMPVAR 1
         ifvarvarg PLAYERATTACK STATLIMIT
         {
          setvarvar TEMPVAR STATLIMIT
          subvar TEMPVAR 1
          ifvarvarg PLAYERDEFENSE STATLIMIT
          {
           setvarvar TEMPVAR STATLIMIT
           subvar TEMPVAR 1
           getactorvar[tempvehicleid].ACTORATTACK TEMPVAR5
           ifvarvarg TEMPVAR5 STATLIMIT
           {
            setvarvar TEMPVAR STATLIMIT
            subvar TEMPVAR 1
            getactorvar[tempvehicleid].ACTORDEFENSE TEMPVAR5
            ifvarvarg TEMPVAR5 STATLIMIT
            {
             stopsound MONEYSOUND
             sound MENU_ERROR
             redefinequote 341 ^10YOU DON'T NEED TO BUY THIS ITEM!
             setvarvar fta fta_normal setvar ftq 341
            }
            else state buyforvehicle_atkdefup
           }
           else state buyforvehicle_atkdefup
          }
          else state buyforcharacter_atkdefup
         }
         else state buyforcharacter_atkdefup
        }
        ifvare vehiclepickuptoggle 3 // Vehicle & Character [Vehicle before Character]
        {
         setvarvar TEMPVAR STATLIMIT
         subvar TEMPVAR 1
         getactorvar[tempvehicleid].ACTORATTACK TEMPVAR5
         ifvarvarg TEMPVAR5 STATLIMIT
         {
          setvarvar TEMPVAR STATLIMIT
          subvar TEMPVAR 1
          getactorvar[tempvehicleid].ACTORDEFENSE TEMPVAR5
          ifvarvarg TEMPVAR5 STATLIMIT
          {
           setvarvar TEMPVAR STATLIMIT
           subvar TEMPVAR 1
           ifvarvarg PLAYERATTACK STATLIMIT
           {
            setvarvar TEMPVAR STATLIMIT
            subvar TEMPVAR 1
            ifvarvarg PLAYERDEFENSE STATLIMIT
            {
             stopsound MONEYSOUND
             sound MENU_ERROR
             redefinequote 341 ^10YOU DON'T NEED TO BUY THIS ITEM!
             setvarvar fta fta_normal setvar ftq 341
            }
            else state buyforcharacter_atkdefup
           }
           else state buyforcharacter_atkdefup
          }
          else state buyforvehicle_atkdefup
         }
         else state buyforvehicle_atkdefup
        }
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 21
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 3749
      ifvarvarg DOLLARS SHOPTEMP
      {
       ifvarl CHARACTERSPEEDTRUE 61000
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound BONUS_GRAB
        globalsound BONUS_GRAB
        globalsound BONUS_GRAB
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 3750
        subvarvar DOLLARS SHOPTEMP
        state calcspdbonus redefinequote 341 ^20BOUGHT SPEED BONUS
        ifrnd 32
        {
         state calcspdbonus redefinequote 341 ^20BOUGHT SPEED BONUS!
         ifrnd 32
         {
          state calcspdbonus redefinequote 341 ^20BOUGHT SPEED BONUS!!
         }
        }        
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU DON'T NEED TO BUY THIS ITEM!
	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
    }
    ifvare shoppage 1
    {
     ifvare shopselection 0 
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 2749
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound BONUS_GRAB
       globalsound BONUS_GRAB
       globalsound BONUS_GRAB
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 2750
       subvarvar DOLLARS SHOPTEMP
       state randomammoincrease redefinequote 341 ^20BOUGHT A SMALL AMMO SATCHEL
       ifrnd 32
       {
        state randomammoincrease redefinequote 341 ^20BOUGHT A SMALL AMMO SATCHEL!
        ifrnd 32
        {
         state randomammoincrease redefinequote 341 ^20BOUGHT A SMALL AMMO SATCHEL!!
        }
       }
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 1
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 9999
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound BONUS_GRAB
       globalsound BONUS_GRAB
       globalsound BONUS_GRAB
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 10000
       subvarvar DOLLARS SHOPTEMP
       state randomammoincrease state randomammoincrease state randomammoincrease state randomammoincrease redefinequote 341 ^20BOUGHT A LARGE AMMO SATCHEL
       ifrnd 32
       {
        state randomammoincrease state randomammoincrease state randomammoincrease state randomammoincrease redefinequote 341 ^20BOUGHT A LARGE AMMO SATCHEL!
        ifrnd 32
        {
         state randomammoincrease state randomammoincrease state randomammoincrease state randomammoincrease redefinequote 341 ^20BOUGHT A LARGE AMMO SATCHEL!!
        }
       }
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 2
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 399
      ifvarvarg DOLLARS SHOPTEMP
      {
       ifvarl TELEPORTERCOILS 2400
 	 {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 400
        subvarvar DOLLARS SHOPTEMP
        addvar TELEPORTERCOILS 20
        ifvarg TELEPORTERCOILS 2400 setvar TELEPORTERCOILS 2400
        redefinequote 341 ^20BOUGHT 20 TELEPORTER COILS
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU HAVE ENOUGH OF THESE RIGHT NOW!
	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 3
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 24999
      ifvarvarg DOLLARS SHOPTEMP
      {
       ifvarl BUBSYLIVES 8
 	 {
        ifvare BUBSY? 1
        {
         stopsound MENU_ERROR stopsound SHOP_FAIL
         state shop_buyitem
         globalsound FOUND_BIGITEM
         ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 25000
         subvarvar DOLLARS SHOPTEMP
         addvar BUBSYLIVES 1
         redefinequote 341 ^20BOUGHT AN EXTRA-LIFE T-SHIRT
         setvarvar fta fta_normal setvar ftq 341
        }
        else
        {
         stopsound MONEYSOUND
         sound MENU_ERROR
         redefinequote 341 ^10NO ONE CAN USE THIS RIGHT NOW!
 	   setvarvar fta fta_normal setvar ftq 341
        }
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU HAVE ENOUGH OF THESE RIGHT NOW!
	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 4
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 99999
      ifvarvarg DOLLARS SHOPTEMP
      {
       ifvarl CONTINUES? 5
 	 {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        globalsound FORTUNECOOKIE1
        globalsound FOUND_BIGITEM
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 100000
        subvarvar DOLLARS SHOPTEMP
        addvar CONTINUES? 1
        redefinequote 341 ^20BOUGHT A CONTINUE ITEM
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU HAVE ENOUGH OF THESE RIGHT NOW!
	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 5
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 249
      ifvarvarg DOLLARS SHOPTEMP
      {
       ifvare LISA? 1
       {
        ifvarvarl CURRENTCELLS MAXCELLS
        {
         stopsound MENU_ERROR stopsound SHOP_FAIL
         state shop_buyitem
         globalsound FOUND_INVENTORY
         ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 250
         subvarvar DOLLARS SHOPTEMP
         addvar CURRENTCELLS 5
         ifvarvarg CURRENTCELLS MAXCELLS { setvarvar CURRENTCELLS MAXCELLS setvarvar DAMAGEINCELL ESHIELDDMGFACTOR }
         redefinequote 341 ^20BOUGHT 5 ENERGY CELLS
         setvarvar fta fta_normal setvar ftq 341
        }
        else
        {
         stopsound MONEYSOUND
         sound MENU_ERROR
         redefinequote 341 ^10YOU HAVE ENOUGH OF THESE RIGHT NOW!
	   setvarvar fta fta_normal setvar ftq 341
        }
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10NO ONE CAN USE THIS RIGHT NOW!
        setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 6
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1249
      ifvarvarg DOLLARS SHOPTEMP
      {
       ifvare LISA? 1
       {
        ifvarvarl CURRENTCELLS MAXCELLS
 	  {
         setvarvar TEMPVAR MAXCELLS
         subvarvar TEMPVAR CURRENTCELLS
         ifvarg TEMPVAR 29
         {
          stopsound MENU_ERROR stopsound SHOP_FAIL
          state shop_buyitem
          globalsound FOUND_INVENTORY
          ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1250
          subvarvar DOLLARS SHOPTEMP
          addvar CURRENTCELLS 30
          ifvarvarg CURRENTCELLS MAXCELLS { setvarvar CURRENTCELLS MAXCELLS setvarvar DAMAGEINCELL ESHIELDDMGFACTOR }
          redefinequote 341 ^20BOUGHT 30 ENERGY CELLS
          setvarvar fta fta_normal setvar ftq 341
         }
         else
         {
          stopsound MONEYSOUND
          sound MENU_ERROR
          redefinequote 341 ^10BUY A LESSER DENOMINATION OF THIS ITEM!
 	    setvarvar fta fta_normal setvar ftq 341
         }
        }
        else
        {
         stopsound MONEYSOUND
         sound MENU_ERROR
         redefinequote 341 ^10YOU HAVE ENOUGH OF THESE RIGHT NOW!
	   setvarvar fta fta_normal setvar ftq 341
        }
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10NO ONE CAN USE THIS RIGHT NOW!
        setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 7
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 3249
      ifvarvarg DOLLARS SHOPTEMP
      {
       ifvare LISA? 1
       {
        ifvarvarl CURRENTCELLS MAXCELLS
 	  {
         setvarvar TEMPVAR MAXCELLS
         subvarvar TEMPVAR CURRENTCELLS
         ifvarg TEMPVAR 79
         {
          stopsound MENU_ERROR stopsound SHOP_FAIL
          state shop_buyitem
          globalsound FOUND_INVENTORY
          ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 3250
          subvarvar DOLLARS SHOPTEMP
          addvar CURRENTCELLS 80
          ifvarvarg CURRENTCELLS MAXCELLS { setvarvar CURRENTCELLS MAXCELLS setvarvar DAMAGEINCELL ESHIELDDMGFACTOR }
          redefinequote 341 ^20BOUGHT 80 ENERGY CELLS
          setvarvar fta fta_normal setvar ftq 341
         }
         else
         {
          stopsound MONEYSOUND
          sound MENU_ERROR
          redefinequote 341 ^10BUY A LESSER DENOMINATION OF THIS ITEM!
          setvarvar fta fta_normal setvar ftq 341
         }
        }
        else
        {
         stopsound MONEYSOUND
         sound MENU_ERROR
         redefinequote 341 ^10YOU HAVE ENOUGH OF THESE RIGHT NOW!
         setvarvar fta fta_normal setvar ftq 341
        }
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10NO ONE CAN USE THIS RIGHT NOW!
        setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     ifvare shopselection 8
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else { ifvare HAVEENERGYSHIELD? 0 setvar SHOPTEMP 32499 else setvar SHOPTEMP 19999 }
      ifvarvarg DOLLARS SHOPTEMP
      {
       ifvare LISA? 1
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        ifvare HAVEENERGYSHIELD? 0
        { 
         setvar HAVEENERGYSHIELD? 1
         addvar ESHIELDDMGFACTOR 16
         setvarvar DAMAGEINCELL ESHIELDDMGFACTOR
         redefinequote 341 ^20BOUGHT BIO-CELL ENERGY SHIELD FOR LISA!
         ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 32500
         subvarvar DOLLARS SHOPTEMP
         setvarvar fta fta_normal setvar ftq 341
        }
        else
        { 
         addvar ESHIELDDMGFACTOR 16
         setvarvar DAMAGEINCELL ESHIELDDMGFACTOR
         redefinequote 341 ^20UPGRADED LISA'S BIO-CELL ENERGY SHIELD!
         ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 20000
         subvarvar DOLLARS SHOPTEMP
         setvarvar fta fta_normal setvar ftq 341
        }
        state shop_buyitem
        globalsound YEAH
        globalsound YEAH
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10NO ONE CAN USE THIS RIGHT NOW!
        setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 9
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 2749
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound BONUS_GRAB
       globalsound BONUS_GRAB
       globalsound BONUS_GRAB
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 2750
       subvarvar DOLLARS SHOPTEMP
       state airtimebonus redefinequote 341 ^20BOUGHT A LUNG-TIME BONUS
       ifrnd 32
       {
        state airtimebonus redefinequote 341 ^20BOUGHT A LUNG-TIME BONUS!
        ifrnd 32 
        {
         state airtimebonus redefinequote 341 ^20BOUGHT A LUNG-TIME BONUS!!
        }
       }
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 10
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 2749
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound BONUS_GRAB
       globalsound BONUS_GRAB
       globalsound BONUS_GRAB
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 2750
       subvarvar DOLLARS SHOPTEMP
       state mantlebonus redefinequote 341 ^20BOUGHT A MANTLE-STRENGTH BONUS
       ifrnd 32
       {
        state mantlebonus redefinequote 341 ^20BOUGHT A MANTLE-STRENGTH BONUS!
        ifrnd 32
        {
         state mantlebonus redefinequote 341 ^20BOUGHT A MANTLE-STRENGTH BONUS!!
        }
       }
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 11
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 499999
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound BONUS_GRAB
       globalsound BONUS_GRAB
       globalsound BONUS_GRAB
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 500000
       subvarvar DOLLARS SHOPTEMP
       state airjumpbonus redefinequote 341 ^20BOUGHT AN AIR-JUMP BONUS
       ifrnd 32
       {
        state airjumpbonus redefinequote 341 ^20BOUGHT AN AIR-JUMP BONUS!
        ifrnd 32
        {
         state airjumpbonus redefinequote 341 ^20BOUGHT AN AIR-JUMP BONUS!!
        }
       }
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 12
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 2499999
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound FOUND_INVENTORY
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 2500000
       subvarvar DOLLARS SHOPTEMP
       addvar AFASDROPS 1
       redefinequote 341 ^20BOUGHT AN AFA'S DROP!!!
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 13
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 799999
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound GRAB_EQUIPMENT
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 800000
       subvarvar DOLLARS SHOPTEMP
       addvar SUNRINGS 1
       redefinequote 341 ^20BOUGHT A SUN RING!!!
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 14
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 799999
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound GRAB_EQUIPMENT
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 800000
       subvarvar DOLLARS SHOPTEMP
       addvar AQUARINGS 1
       redefinequote 341 ^20BOUGHT AN AQUA RING!!!
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 15
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 799999
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound GRAB_EQUIPMENT
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 800000
       subvarvar DOLLARS SHOPTEMP
       addvar PLASMARINGS 1
       redefinequote 341 ^20BOUGHT A PLASMA RING!!!
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 16
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 799999
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound GRAB_EQUIPMENT
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 800000
       subvarvar DOLLARS SHOPTEMP
       addvar SPIRITRINGS 1
       redefinequote 341 ^20BOUGHT A SPIRIT RING!!!
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 17
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1249999
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound GRAB_EQUIPMENT
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1250000
       subvarvar DOLLARS SHOPTEMP
       addvar CHARMANKHS 1
       redefinequote 341 ^20BOUGHT A CHARM ANKH!!!
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 18
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1999999
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound GRAB_EQUIPMENT
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 2000000
       subvarvar DOLLARS SHOPTEMP
       addvar MIRRORSHIELDS 1
       redefinequote 341 ^20BOUGHT A MIRROR SHIELD!!!
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 19
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1624999
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound GRAB_EQUIPMENT
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1625000
       subvarvar DOLLARS SHOPTEMP
       addvar EXPBADGES 1
       redefinequote 341 ^20BOUGHT AN EXPERIENCE BADGE!!!
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 20
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1624999
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound GRAB_EQUIPMENT
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1625000
       subvarvar DOLLARS SHOPTEMP
       addvar RANKBADGES 1
       redefinequote 341 ^20BOUGHT A RANK BADGE!!!
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 21
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 1624999
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound GRAB_EQUIPMENT
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 1625000
       subvarvar DOLLARS SHOPTEMP
       addvar MONEYBADGES 1
       redefinequote 341 ^20BOUGHT A MONEY BADGE!!!
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
    }
    ifvare shoppage 2
    {
     ifvare shopselection 0 // Pistol Ammo
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 199
      ifvarvarg DOLLARS SHOPTEMP
      {
       getplayer[THISACTOR].ammo_amount 1 TEMPVAR
       ifvarvarl TEMPVAR MAXPISTOL
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 200
        subvarvar DOLLARS SHOPTEMP
        addvar TEMPVAR 12
        ifvarvarg TEMPVAR MAXPISTOL setvarvar TEMPVAR MAXPISTOL
        setplayer[THISACTOR].ammo_amount 1 TEMPVAR
        redefinequote 341 ^20BOUGHT AMMO FOR PISTOL!
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU HAVE ENOUGH PISTOL BULLETS!
	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 1 // SHOTGUN SHELLS
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 549
      ifvarvarg DOLLARS SHOPTEMP
      {
       getplayer[THISACTOR].ammo_amount 2 TEMPVAR
       ifvarvarl TEMPVAR MAXSHOTGUN
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 550
        subvarvar DOLLARS SHOPTEMP
        addvar TEMPVAR 10
        ifvarvarg TEMPVAR MAXSHOTGUN setvarvar TEMPVAR MAXSHOTGUN
        setplayer[THISACTOR].ammo_amount 2 TEMPVAR
        redefinequote 341 ^20BOUGHT AMMO FOR SHOTGUN!
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU HAVE ENOUGH SHOTGUN SHELLS!
	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 2 // CHAINGUN BULLETS
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 449
      ifvarvarg DOLLARS SHOPTEMP
      {
       getplayer[THISACTOR].ammo_amount 3 TEMPVAR
       ifvarvarl TEMPVAR MAXCHAINGUN
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 450
        subvarvar DOLLARS SHOPTEMP
        addvar TEMPVAR 50
        ifvarvarg TEMPVAR MAXCHAINGUN setvarvar TEMPVAR MAXCHAINGUN
        setplayer[THISACTOR].ammo_amount 3 TEMPVAR
        redefinequote 341 ^20BOUGHT AMMO FOR CHAINGUN CANNON!
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU HAVE ENOUGH CHAINGUN BULLETS!
	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 3 // RPG MISSILES
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 824
      ifvarvarg DOLLARS SHOPTEMP
      {
       getplayer[THISACTOR].ammo_amount 4 TEMPVAR
       ifvarvarl TEMPVAR MAXRPG
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 825
        subvarvar DOLLARS SHOPTEMP
        addvar TEMPVAR 5
        ifvarvarg TEMPVAR MAXRPG setvarvar TEMPVAR MAXRPG
        setplayer[THISACTOR].ammo_amount 4 TEMPVAR
        redefinequote 341 ^20BOUGHT AMMO FOR RPG!
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU HAVE ENOUGH RPG MISSILES!
	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 4 // Pipebomb [single]
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 149
      ifvarvarg DOLLARS SHOPTEMP
      {
       getplayer[THISACTOR].ammo_amount 5 TEMPVAR
       ifvarvarl TEMPVAR MAXPIPEBOMB
       {
        addweapon HANDBOMB_WEAPON 0
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 150
        subvarvar DOLLARS SHOPTEMP
        addvar TEMPVAR 1
        ifvarvarg TEMPVAR MAXPIPEBOMB setvarvar TEMPVAR MAXPIPEBOMB
        setplayer[THISACTOR].ammo_amount 5 TEMPVAR
        redefinequote 341 ^20BOUGHT A PIPEBOMB!
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU HAVE ENOUGH PIPEBOMBS!
	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 5 // Box of Pipebombs
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 624
      ifvarvarg DOLLARS SHOPTEMP
      {
       getplayer[THISACTOR].ammo_amount 5 TEMPVAR
       ifvarvarl TEMPVAR MAXPIPEBOMB
       {
        addweapon HANDBOMB_WEAPON 0
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 625
        subvarvar DOLLARS SHOPTEMP
        addvar TEMPVAR 5
        ifvarvarg TEMPVAR MAXPIPEBOMB setvarvar TEMPVAR MAXPIPEBOMB
        setplayer[THISACTOR].ammo_amount 5 TEMPVAR
        redefinequote 341 ^20BOUGHT A BOX OF PIPEBOMBS!
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU HAVE ENOUGH PIPEBOMBS!
	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 6 // Shrinker Crystal
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 824
      ifvarvarg DOLLARS SHOPTEMP
      {
       getplayer[THISACTOR].ammo_amount 6 TEMPVAR
       ifvarvarl TEMPVAR MAXSHRINKER
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 825
        subvarvar DOLLARS SHOPTEMP
        addvar TEMPVAR 5
        ifvarvarg TEMPVAR MAXSHRINKER setvarvar TEMPVAR MAXSHRINKER
        setplayer[THISACTOR].ammo_amount 6 TEMPVAR
        redefinequote 341 ^20BOUGHT AMMO FOR SHRINKER!
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU HAVE ENOUGH SHRINKER CRYSTALS!
	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 7 // Expander Antenna
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 824
      ifvarvarg DOLLARS SHOPTEMP
      {
       getplayer[THISACTOR].ammo_amount 11 TEMPVAR
       ifvarvarl TEMPVAR MAXEXPANDER
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 825
        subvarvar DOLLARS SHOPTEMP
        addvar TEMPVAR 20
        ifvarvarg TEMPVAR MAXEXPANDER setvarvar TEMPVAR MAXEXPANDER
        setplayer[THISACTOR].ammo_amount 11 TEMPVAR
        redefinequote 341 ^20BOUGHT AMMO FOR EXPANDER!
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU HAVE ENOUGH EXPANDER ANTENNAE!
	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 8 // Devastator Missiles
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 674
      ifvarvarg DOLLARS SHOPTEMP
      {
       getplayer[THISACTOR].ammo_amount 7 TEMPVAR
       ifvarvarl TEMPVAR MAXDEVASTATOR
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 675
        subvarvar DOLLARS SHOPTEMP
        addvar TEMPVAR 15
        ifvarvarg TEMPVAR MAXDEVASTATOR setvarvar TEMPVAR MAXDEVASTATOR
        setplayer[THISACTOR].ammo_amount 7 TEMPVAR
        redefinequote 341 ^20BOUGHT AMMO FOR DEVASTATOR!
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU HAVE ENOUGH DEVASTATOR MISSILES!
	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 9 // Tripbomb [single]
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 249
      ifvarvarg DOLLARS SHOPTEMP
      {
       getplayer[THISACTOR].ammo_amount 8 TEMPVAR
       ifvarvarl TEMPVAR MAXTRIPBOMB
       {
        addweapon TRIPBOMB_WEAPON 0
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 250
        subvarvar DOLLARS SHOPTEMP
        addvar TEMPVAR 1
        ifvarvarg TEMPVAR MAXTRIPBOMB setvarvar TEMPVAR MAXTRIPBOMB
        setplayer[THISACTOR].ammo_amount 8 TEMPVAR
        redefinequote 341 ^20BOUGHT A LASER TRIPBOMB!
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU HAVE ENOUGH TRIPBOMBS!
	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 10 // Freezethrower Pack
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 949
      ifvarvarg DOLLARS SHOPTEMP
      {
       getplayer[THISACTOR].ammo_amount 9 TEMPVAR
       ifvarvarl TEMPVAR MAXFREEZER
       {
        stopsound MENU_ERROR stopsound SHOP_FAIL
        state shop_buyitem
        globalsound DUKE_GET
        ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 950
        subvarvar DOLLARS SHOPTEMP
        addvar TEMPVAR 25
        ifvarvarg TEMPVAR MAXFREEZER setvarvar TEMPVAR MAXFREEZER
        setplayer[THISACTOR].ammo_amount 9 TEMPVAR
        redefinequote 341 ^20BOUGHT AMMO FOR FREEZETHROWER!
        setvarvar fta fta_normal setvar ftq 341
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU HAVE ENOUGH FREEZETHROWER PACKS!
	  setvarvar fta fta_normal setvar ftq 341
       }
      }
      else state shop_buyfailed
     }
     else
     ifvare shopselection 11 // Unknown Medicene
     {
      ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP -1 else setvar SHOPTEMP 2499999
      ifvarvarg DOLLARS SHOPTEMP
      {
       stopsound MENU_ERROR stopsound SHOP_FAIL
       state shop_buyitem
       globalsound FOUND_INVENTORY
       ifvarvare SHOPCHEATBITTOTAL SHOPCOMBOBITS setvar SHOPTEMP 0 else setvar SHOPTEMP 2500000
       subvarvar DOLLARS SHOPTEMP
       addvar FAUXLEVELUPS 1
       redefinequote 341 ^20BOUGHT AN UNKNOWN MEDICENE!!!
       setvarvar fta fta_normal setvar ftq 341
      }
      else state shop_buyfailed
     }
    }
/*
    ifvare shoppage 3
    {
    }
*/
   } // ifvare shopmode 0
   else
//*******************
//***Selling Items***
//*******************
   ifvare shopmode 1 // Selling Items
   {
    ifvare shoppage 0
    {
     ifvare shopselection 0 
     {
      ifvarg RESURRECTIONCHALICES 0
      {
        state shop_sellitem
        subvar RESURRECTIONCHALICES 1
        addvar DOLLARS 2000
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A RESURRECTION CHALICE
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 1
     {
      ifvarg EYEDROPS 0
      {
        state shop_sellitem
        subvar EYEDROPS 1
        addvar DOLLARS 83
        addvar CENTS 33
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD AN EYEDROP
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 2
     {
      ifvarg ANTIDOTES 0
      {
        state shop_sellitem
        subvar ANTIDOTES 1
        addvar DOLLARS 116
        addvar CENTS 67
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD AN ANTIDOTE
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 3
     {
      ifvarg FOGHORNS 0
      {
        state shop_sellitem
        subvar FOGHORNS 1
        addvar DOLLARS 150
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A FOGHORN
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 4
     {
       ifvarg BUBSYLIVES 0
 	 {
        ifvare BUBSY? 1
        {
         state shop_sellitem
         subvar BUBSYLIVES 1
         addvar DOLLARS 16666
         addvar CENTS 67
         ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
         redefinequote 341 ^20SOLD AN EXTRA-LIFE T-SHIRT
         setvarvar fta fta_normal setvar ftq 341
        }
        else state failedsell
       }
       else
       {
        stopsound MONEYSOUND
        sound MENU_ERROR
        redefinequote 341 ^10YOU DON'T HAVE ANY OF THIS ITEM TO SELL!
	  setvarvar fta fta_normal setvar ftq 341
       }
     }
     else
     ifvare shopselection 5
     {
      ifvarg CONTINUES? 0
      {
        state shop_sellitem
        subvar CONTINUES? 1
        addvar DOLLARS 66666
        addvar CENTS 67
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A CONTINUE ITEM
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 6
     {
      ifvarg CURRENTCELLS 4
      {
        state shop_sellitem
        subvar CURRENTCELLS 5
        addvar DOLLARS 166
        addvar CENTS 67
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD 5 ENERGY CELLS
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 7
     {
      ifvarg TELEPORTERCOILS 19
      {
        state shop_sellitem
        subvar TELEPORTERCOILS 20
        addvar DOLLARS 266
        addvar CENTS 67
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD 20 TELEPORTER COILS
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 8
     {
      ifvarg SMALLMEDIKITS 0
      {
        state shop_sellitem
        subvar SMALLMEDIKITS 1
        addvar DOLLARS 25
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A SMALL MEDIKIT
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS ITEM TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 9
     {
      ifvarg SWMEDIKITS 0
      {
        state shop_sellitem
        subvar SWMEDIKITS 1
        addvar DOLLARS 45
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A MEDIUM MEDIKIT
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS ITEM TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 10
     {
      ifvarg LARGEMEDIKITS 0
      {
        state shop_sellitem
        subvar LARGEMEDIKITS 1
        addvar DOLLARS 66
        addvar CENTS 67
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A LARGE MEDIKIT
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS ITEM TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 11
     {
      ifvarg SWBIGMEDIKITS 0
      {
        state shop_sellitem
        subvar SWBIGMEDIKITS 1
        addvar DOLLARS 223
        addvar CENTS 33
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD AN EXTRA-LARGE MEDIKIT
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS ITEM TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 12
     {
      ifvarg BODYARMORS 0
      {
        state shop_sellitem
        subvar BODYARMORS 1
        addvar DOLLARS 333
        addvar CENTS 33
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A SUIT OF BODY ARMOR
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS ITEM TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 13
     {
      ifvarg SUPERARMORS 0
      {
        state shop_sellitem
        subvar SUPERARMORS 1
        addvar DOLLARS 1000
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A SUIT OF SUPER ARMOR
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS ITEM TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 14
     {
      ifvarg VITAMINXS 0
      {
        state shop_sellitem
        subvar VITAMINXS 1
        addvar DOLLARS 3200
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A BOTTLE OF VITAMIN X
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS ITEM TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 15
     {
      ifvarg HEATSENSORS 0
      {
        state shop_sellitem
        subvar HEATSENSORS 1
        addvar DOLLARS 500
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A PAIR OF NV GOGGLES
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS ITEM TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 16
     {
      ifvarg HOLOFORMS 0
      {
        state shop_sellitem
        subvar HOLOFORMS 1
        addvar DOLLARS 625
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A HOLOFORM
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS ITEM TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 17
     {
      ifvarg JETPACKS 0
      {
        state shop_sellitem
        subvar JETPACKS 1
        addvar DOLLARS 750
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A JETPACK
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS ITEM TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 18
     {
      ifvarg SCUBATANKS 0
      {
        state shop_sellitem
        subvar SCUBATANKS 1
        addvar DOLLARS 750
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A SCUBA TANK
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS ITEM TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 19
     {
      ifvarg BOOTPAIRS 0
      {
        state shop_sellitem
        subvar BOOTPAIRS 1
        addvar DOLLARS 500
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A PAIR OF PROTECTIVE BOOTS
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS ITEM TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 20
     {
      ifvarg PORTABLEMEDIKITS 0
      {
        state shop_sellitem
        subvar PORTABLEMEDIKITS 1
        addvar DOLLARS 1000
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A PORTABLE MEDIKIT
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS ITEM TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
     else
     ifvare shopselection 21
     {
      ifvarg AFASDROPS 0
      {
        state shop_sellitem
        subvar AFASDROPS 1
        addvar DOLLARS 1250000
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD AN AFA'S DROP
        setvarvar fta fta_normal setvar ftq 341
      }
      else
      {
       state shop_sellfailed
       redefinequote 341 ^10YOU DON'T HAVE ENOUGH OF THIS ITEM TO SELL!
	 setvarvar fta fta_normal setvar ftq 341
      }
     }
    }
    ifvare shoppage 1
    {
     ifvare shopselection 0
     {
      ifvarg SUNRINGS 0
      {
        state shop_sellitem
        subvar SUNRINGS 1
        addvar DOLLARS 400000
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A SUN RING
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 1
     {
      ifvarg AQUARINGS 0
      {
        state shop_sellitem
        subvar AQUARINGS 1
        addvar DOLLARS 400000
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD AN AQUA RING
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 2
     {
      ifvarg PLASMARINGS 0
      {
        state shop_sellitem
        subvar PLASMARINGS 1
        addvar DOLLARS 400000
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A PLASMA RING
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 3
     {
      ifvarg SPIRITRINGS 0
      {
        state shop_sellitem
        subvar SPIRITRINGS 1
        addvar DOLLARS 400000
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A SPIRIT RING
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 4
     {
      ifvarg CHARMANKHS 0
      {
        state shop_sellitem
        subvar CHARMANKHS 1
        addvar DOLLARS 625000
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A CHARM ANKHS
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 5
     {
      ifvarg MIRRORSHIELDS 0
      {
        state shop_sellitem
        subvar MIRRORSHIELDS 1
        addvar DOLLARS 1000000
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A MIRROR SHIELD
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 6
     {
      ifvarg EXPBADGES 0
      {
        state shop_sellitem
        subvar EXPBADGES 1
        addvar DOLLARS 812500
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD AN EXPERIENCE BADGE
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 7
     {
      ifvarg RANKBADGES 0
      {
        state shop_sellitem
        subvar RANKBADGES 1
        addvar DOLLARS 812500
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A RANK BADGE
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 8
     {
      ifvarg MONEYBADGES 0
      {
        state shop_sellitem
        subvar MONEYBADGES 1
        addvar DOLLARS 812500
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A MONEY BADGE
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 9
     {
      ifvarg ATOMICHEALTHS 0
      {
        state shop_sellitem
        subvar ATOMICHEALTHS 1
        addvar DOLLARS 500
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD AN ATOMIC HEALTH ITEM
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 10
     {
      ifvarg SUPERATOMS 0
      {
        state shop_sellitem
        subvar SUPERATOMS 1
        addvar DOLLARS 3200
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD A SUPER-ATOM
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
     else
     ifvare shopselection 11
     {
      ifvarg FAUXLEVELUPS 0
      {
        state shop_sellitem
        subvar FAUXLEVELUPS 1
        addvar DOLLARS 1250000
        addvar CENTS 0
        ifvarg DOLLARS 2147483647 setvar DOLLARS 2147483647
        redefinequote 341 ^20SOLD AN UNKNOWN MEDICENE
        setvarvar fta fta_normal setvar ftq 341
      }
      else state failedsell
     }
    }

   } // ifvare shopmode 
  } // ifvare shop_id 0
   // End of Menus
setvar com_pause 6
}
ends

//********************
//********************
//********************
//********************
//********************
//******ATM CODE******
//********************
//********************
//********************
//********************
//********************

/*
===Acct#s & PINs===

==Playable==
Duke Nukem (ID: 1): 132995 & 3110
Jack Walker (ID: 2): 164702 & 7585
Bubsy Bobcat (ID: 3): 171792 & 1310
Ami Mizuno (ID: 4): 789152 & 4125
Higa Hakaisha (ID: 5): 171396 & 9254
ESSence Margalan (ID: 6): 218479 & 4196
Ted Maldoras (ID: 7): 195382 & 3735
Lisa Bates (ID: 8): 475394 & 8214
Cybanis Morgandos (ID: 9): 363851 & 5288
Christina Mitchell (ID: 10): 963246 & 1256
Paula Polestar (ID: 11): 180194 & 5007
Lori Stephens (ID: 12): 638192 & 6392
Minako Aino (ID: 13): 512560 & 1895
"Mystery Lady" (ID: 14): 198255 & 7364
Maken Shinkara (ID: 15): 918372 & 7873

==Non-Playable==
Pres. Bill Clinton: 132092 & 1310 (ID: 257) [Good]
Vice Pres. Al Gore: 890143 & 9613 (ID: 258) [Good]
George Broussard [3DR]: ? & ? (ID: 259) [Good]
Stephen Hornback [3DR]: ? & ? (ID: 260) [Good]
Jim Norwood [3DR]: ? & ? (ID: 261) [Good]
Frank Maddin [3DR]: ? & ? (ID: 262) [Good]
Stephen Cole [3DR]: ? & 1893 (ID: 263) [Good]
Frank Maddin [3DR]: ? & ? (ID: 264) [Good]
Joe Siegler [3DR]: 122994 & 2035 (ID: 265) [Good]
Lee Jackson [3DR]: ? & ? (ID: 266) [Good]
Chuck Jones [3DR]: ? & ? (ID: 267) [Good]
Keith Schuler [3DR]: ? & ? (ID: 268) [Good]
Randy Pitchford II [3DR]: ? & ? (ID: 269) [Good]
Brian Martel [3DR]: ? & ? (ID: 270) [Good]
Snake Plissken: ? & ? (ID: 271) [Good]
Indiana Jones: ? & ? (ID: 272) [Good]
Gen. Gregory Graves [EDF]: ? & ? (ID: 273) [Good]
Donald Harrison [EDF]: ? & ? (ID: 274) [Good]
Cameron Bates [EDF]: ? & ? (ID: 275) [Good]
Kasey Shinkara [EDF]: ? & ? (ID: 276) [Good]
Victoria Bates [NPC]: ? & ? (ID: 277) [Good]
Harold Bates [NPC]: ? & ? (ID: 278) [Good]
John R. Blade [NPC]: 010345 & 2019 (ID: 279) [Cameo-Good]
Elexis Sinclaire [NPC]: 010333 & 6969 (ID: 280) [Cameo-Evil]
Jerold Bates [NPC]: ? & ? (ID: 281) [Good]
Ness Itoi [NPC]: ? & ? (ID: 282) [Good]

Comm. Ion Zerman: ? & ? (ID: ?) [Evil]
Pigcop Coln. Ramone: ? & ? (ID: ?) [Evil]
Comm. Kenneth Fertang: ? & ? (ID: ?) [Evil]
[Unknown LARD member]: ? & 1077 (ID: ?) [Evil]
Tankanori Zilla: ? & ? (ID: ?) [Evil]
Mantra Zilla: ? & ? (ID: ?) [Evil]

*/

state displayaccountvalue
  redefinequote 332 YOUR ACCOUNT: $0000000000.00
  ifvarg TEMP -1
  ifvarl TEMP 10
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 YOUR ACCOUNT: $000000000%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 YOUR ACCOUNT: $000000000%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 9
  ifvarl TEMP 100
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 YOUR ACCOUNT: $00000000%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 YOUR ACCOUNT: $00000000%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 99
  ifvarl TEMP 1000
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 YOUR ACCOUNT: $0000000%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 YOUR ACCOUNT: $0000000%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 999
  ifvarl TEMP 10000
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 YOUR ACCOUNT: $000000%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 YOUR ACCOUNT: $000000%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 9999
  ifvarl TEMP 100000
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 YOUR ACCOUNT: $00000%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 YOUR ACCOUNT: $00000%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 99999
  ifvarl TEMP 1000000
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 YOUR ACCOUNT: $0000%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 YOUR ACCOUNT: $0000%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 999999
  ifvarl TEMP 10000000
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 YOUR ACCOUNT: $000%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 YOUR ACCOUNT: $000%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 9999999
  ifvarl TEMP 100000000
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 YOUR ACCOUNT: $00%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 YOUR ACCOUNT: $00%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 99999999
  ifvarl TEMP 1000000000
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 YOUR ACCOUNT: $0%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 YOUR ACCOUNT: $0%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 999999999
  ifvarl TEMP 2147483647
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 YOUR ACCOUNT: $%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 YOUR ACCOUNT: $%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
ends

  state getatmdollarcents
   getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMP
   getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS tempb
  ends

state displayaccountinfo
  state digx320
  setvar digy 131 // 160
  state pal22
  ifvare atm_acctnum 132995 // Duke
  {
   setvar CHARACTERARRAY 1
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 164702 // Jack
  {
   setvar CHARACTERARRAY 2
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 171792 // Bubsy
  {
   setvar CHARACTERARRAY 3
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 789152 // Ami
  {
   setvar CHARACTERARRAY 4
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 171396 // Higa
  {
   setvar CHARACTERARRAY 5
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 218479 // ESSence
  {
   setvar CHARACTERARRAY 6
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 195382 // Ted
  {
   setvar CHARACTERARRAY 7
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 475394 // Lisa
  {
   setvar CHARACTERARRAY 8
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 363851 // Cybanis
  {
   setvar CHARACTERARRAY 9
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 963246 // Christina
  {
   setvar CHARACTERARRAY 10
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 180194 // Paula
  {
   setvar CHARACTERARRAY 11
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 638192 // Lori
  {
   setvar CHARACTERARRAY 12
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 512560 // Minako
  {
   setvar CHARACTERARRAY 13
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 198255 // "Mystery Lady"
  {
   setvar CHARACTERARRAY 14
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 918372 // Maken
  {
   setvar CHARACTERARRAY 15
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 132092 // President Clinton (NPC)
  {
   setvar CHARACTERARRAY 257
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 890143 // Vice-President Gore (NPC)
  {
   setvar CHARACTERARRAY 258
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 122994 // Joe Siegler [3DR]
  {
   setvar CHARACTERARRAY 265
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 10345 // John R. Blade [Cameo]
  {
   setvar CHARACTERARRAY 279
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 10333 // Elexis Sinclaire [Cameo]
  {
   setvar CHARACTERARRAY 280
   state getatmdollarcents
  }   
  else
  {
   setvar TEMP 0
   setvar tempb 0
  }
  state displayaccountvalue 
  state gtz
ends

state displayaccountamountwithwire
  state digx320
  setvar digy 78
  state pal22
  ifvare atm_acctnum 132995 // Duke
  {
   setvar CHARACTERARRAY 1
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 164702 // Jack
  {
   setvar CHARACTERARRAY 2
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 171792 // Bubsy
  {
   setvar CHARACTERARRAY 3
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 789152 // Ami
  {
   setvar CHARACTERARRAY 4
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 171396 // Higa
  {
   setvar CHARACTERARRAY 5
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 218479 // ESSence
  {
   setvar CHARACTERARRAY 6
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 195382 // Ted
  {
   setvar CHARACTERARRAY 7
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 475394 // Lisa
  {
   setvar CHARACTERARRAY 8
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 363851 // Cybanis
  {
   setvar CHARACTERARRAY 9
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 963246 // Christina
  {
   setvar CHARACTERARRAY 10
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 180194 // Paula
  {
   setvar CHARACTERARRAY 11
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 638192 // Lori
  {
   setvar CHARACTERARRAY 12
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 512560 // Minako
  {
   setvar CHARACTERARRAY 13
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 198255 // "Mystery Lady"
  {
   setvar CHARACTERARRAY 14
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 918372 // Maken
  {
   setvar CHARACTERARRAY 15
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 132092 // President Clinton (NPC)
  {
   setvar CHARACTERARRAY 257
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 890143 // Vice-President Gore (NPC)
  {
   setvar CHARACTERARRAY 258
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 122994 // Joe Siegler [3DR]
  {
   setvar CHARACTERARRAY 265
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 10345 // John R. Blade [Cameo]
  {
   setvar CHARACTERARRAY 279
   state getatmdollarcents
  }   
  else
  ifvare atm_acctnum 10333 // Elexis Sinclaire [Cameo]
  {
   setvar CHARACTERARRAY 280
   state getatmdollarcents
  }   
  else
  {
   setvar TEMP 0
   setvar tempb 0
  }
  state displayaccountvalue 
  state gtz
ends

state showatmwdwinput
  setvarvar varname atm_amount_dollars
  setvarvar atm_amount_dollars atm_amount_all
  divvarvar atm_amount_dollars 100
  setvarvar atm_amount_cents atm_amount_all
  modvarvar atm_amount_cents 100
  setvarvar varname atm_amount_cents

  setvar textscale 49152 // 49152
  state settilealphanum
  state digx320
  setvar digy 110
  redefinequote 332 $00000.00
  ifvarg atm_amount_all -1
  ifvarl atm_amount_all 10
  {
   redefinequote 2002 $00000.0%ld
   qsprintf 332 2002 atm_amount_cents
  }
  else
  ifvarg atm_amount_all 9
  ifvarl atm_amount_all 100
  {
   redefinequote 2002 $00000.%ld
   qsprintf 332 2002 atm_amount_cents
  }
  else
  ifvarg atm_amount_all 99
  ifvarl atm_amount_all 1000
  {
   ifvarg atm_amount_cents -1
   ifvarl atm_amount_cents 10
   {
    redefinequote 2002 $0000%ld.0%ld
   }
   else
   {
    redefinequote 2002 $0000%ld.%ld
   }
   qsprintf 332 2002 atm_amount_dollars atm_amount_cents
  }
  else
  ifvarg atm_amount_all 999
  ifvarl atm_amount_all 10000
  {
   ifvarg atm_amount_cents -1
   ifvarl atm_amount_cents 10
   {
    redefinequote 2002 $000%ld.0%ld
   }
   else
   {
    redefinequote 2002 $000%ld.%ld
   }
   qsprintf 332 2002 atm_amount_dollars atm_amount_cents
  }
  else
  ifvarg atm_amount_all 9999
  ifvarl atm_amount_all 100000
  {
   ifvarg atm_amount_cents -1
   ifvarl atm_amount_cents 10
   {
    redefinequote 2002 $00%ld.0%ld
   }
   else
   {
    redefinequote 2002 $00%ld.%ld
   }
   qsprintf 332 2002 atm_amount_dollars atm_amount_cents
  }
  else
  ifvarg atm_amount_all 99999
  ifvarl atm_amount_all 1000000
  {
   ifvarg atm_amount_cents -1
   ifvarl atm_amount_cents 10
   {
    redefinequote 2002 $0%ld.0%ld
   }
   else
   {
    redefinequote 2002 $0%ld.%ld
   }
   qsprintf 332 2002 atm_amount_dollars atm_amount_cents
  }
  else
  ifvarg atm_amount_all 999999
  ifvarl atm_amount_all 10000000
  {
   ifvarg atm_amount_cents -1
   ifvarl atm_amount_cents 10
   {
    redefinequote 2002 $%ld.0%ld
   }
   else
   {
    redefinequote 2002 $%ld.%ld
   }
   qsprintf 332 2002 atm_amount_dollars atm_amount_cents
  }
  state pal22
  state gtz
ends

state atm_display
ifvarn atm_id -1
{
/*
  ifvare atm_type 0 nullop
  else
  ifvare atm_type 1 nullop // Sprite Based
  else
*/
  ifvare atm_type 2 // Wall Based
  {
   getwall[hitwall].picnum temp
   ifvare temp 867 nullop
   else
   {
    setvar atm_id -1
    setvar atm_type 0
    setvar atm_mode 0
    setvar atm_action 0 
    setvar atm_acctnum 0
    setvar atm_pinnum 0
    setvar atm_amount_all 0
    setvar atm_errortype 0
   }
  }

  // ATM BACKGROUND
  state pal0
  state digx160
  setvar digy 120
  state digz49152
  state orientation2
  setvar tilenum 3580 // 3581
  state rs

  ifvarg atm_button1timer 0 // Upper-Left Button Pressed
  {
   state pal0
   setvar digx 28 // 28
   setvar digy 48 // 48
   state digz49152
   state orientation2
   setvar tilenum 3476 // 3581
   state rs
  }

  ifvarg atm_button2timer 0 // MidUpper-Left Button Pressed
  {
   state pal0
   setvar digx 28 // 28
   setvar digy 82 // 82
   state digz49152
   state orientation2
   setvar tilenum 3477 // 3581
   state rs
  }

  ifvarg atm_button3timer 0 // MidLower-Left Button Pressed
  {
   state pal0
   setvar digx 28 // 28
   setvar digy 118 // 82
   state digz49152
   state orientation2
   setvar tilenum 3478 // 3581
   state rs
  }

  ifvarg atm_button4timer 0 // Lower-Left Button Pressed
  {
   state pal0
   setvar digx 28 // 28
   setvar digy 153 // 82
   state digz49152
   state orientation2
   setvar tilenum 3479 // 3581
   state rs
  }

  ifvarg atm_button5timer 0 // Upper-Right Button Pressed
  {
   state pal0
   setvar digx 292 // 292
   setvar digy 48 // 48
   state digz49152
   state orientation2
   setvar tilenum 3480 // 3581
   state rs
  }

  ifvarg atm_button6timer 0 // MidUpper-Right Button Pressed
  {
   state pal0
   setvar digx 292 // 292
   setvar digy 82 // 82
   state digz49152
   state orientation2
   setvar tilenum 3481 // 3581
   state rs
  }

  ifvarg atm_button7timer 0 // MidLower-Right Button Pressed
  {
   state pal0
   setvar digx 292 // 28
   setvar digy 118 // 82
   state digz49152
   state orientation2
   setvar tilenum 3482 // 3581
   state rs
  }

  ifvarg atm_button8timer 0 // Lower-Right Button Pressed
  {
   state pal0
   setvar digx 292 // 28
   setvar digy 153 // 82
   state digz49152
   state orientation2
   setvar tilenum 3483 // 3581
   state rs
  }

// Optional Screen Backgrounds
  state pal0
  setvar digx 158 // 160
  setvar digy 97 // 120
  setvar digz 49500 // 49152
  state shadepulse3
  ifvare atm_background 0 setvar tilenum 3579
  ifvare atm_background 1 setvar tilenum 3578
  ifvare atm_background 2 setvar tilenum 3576
  ifvare atm_background 3 setvar tilenum 3575
  ifvare atm_background 4 setvar tilenum 3574
  ifvare atm_background 5 setvar tilenum 3573
  ifvare atm_background 6 setvar tilenum 3572
  ifvare atm_background 7 setvar tilenum 3571
  ifvare atm_background 8 setvar tilenum 3570
  ifvare atm_background 9 setvar tilenum 3569
  ifvare atm_background 10 setvar tilenum 3568
  ifvare atm_background 11 setvar tilenum 3567
  ifvare atm_background 12 setvar tilenum 3566
  ifvare atm_background 13 setvar tilenum 3565
  ifvare atm_background 14 setvar tilenum 3564
  ifvare atm_background 15 setvar tilenum 3563
  ifvare atm_background 16 setvar tilenum 3562
  ifvare atm_background 17 setvar tilenum 3561
  ifvare atm_background 18 setvar tilenum 3560
  ifvare atm_background 19 setvar tilenum 3559
  ifvare atm_background 20 setvar tilenum 3558
  ifvare atm_background 21 setvar tilenum 3557
  ifvare atm_background 22 setvar tilenum 3556
  ifvare atm_background 23 setvar tilenum 3555
  ifvare atm_background 24 setvar tilenum 3554
  ifvare atm_background 25 setvar tilenum 3553
  ifvare atm_background 26 setvar tilenum 3552
  ifvare atm_background 27 setvar tilenum 3551
  ifvare atm_background 28 setvar tilenum 3550
  ifvare atm_background 29 setvar tilenum 3549
  ifvare atm_background 30 setvar tilenum 3548
  ifvare atm_background 31 setvar tilenum 3547
  ifvare atm_background 32 setvar tilenum 3546
  ifvare atm_background 33 setvar tilenum 3545
  ifvare atm_background 34 setvar tilenum 3544
  ifvare atm_background 35 setvar tilenum 3543
  ifvare atm_background 36 setvar tilenum 3542
  ifvare atm_background 37 setvar tilenum 3541
  state orientation2 
  state rs

  state shade0
  state setquote332

  state orientation3
  state settilealphanum
  setvar textscale 49152
  setvar digx 25 // 25
  setvar digy 10 // 44
  redefinequote 332 ACCT#
  state pal10
  state gtz

  state settile2837
  setvar digx 28 // 25
  setvar digy 16 // 44
  ifvare CHARACTERSELECTED? 1 setvar varname 132995
  ifvare CHARACTERSELECTED? 2 setvar varname 164702
  ifvare CHARACTERSELECTED? 3 setvar varname 171792
  ifvare CHARACTERSELECTED? 4 setvar varname 789152
  ifvare CHARACTERSELECTED? 5 setvar varname 171396
  ifvare CHARACTERSELECTED? 6 setvar varname 218479
  ifvare CHARACTERSELECTED? 7 setvar varname 195382
  ifvare CHARACTERSELECTED? 8 setvar varname 475394
  ifvare CHARACTERSELECTED? 9 setvar varname 363851
  ifvare CHARACTERSELECTED? 10 setvar varname 963246
  ifvare CHARACTERSELECTED? 11 setvar varname 180194
  ifvare CHARACTERSELECTED? 12 setvar varname 638192
  ifvare CHARACTERSELECTED? 13 setvar varname 512560
  ifvare CHARACTERSELECTED? 14 setvar varname 198255
  ifvare CHARACTERSELECTED? 15 setvar varname 918372
  state pal21
  state dnz

  state settilealphanum
  setvar digx 580 // 25
  setvar digy 10 // 44
  redefinequote 332 PIN#
  state pal10
  state gtz

  state settile2837
  setvar digx 301 // 25
  setvar digy 16 // 44
  ifvare CHARACTERSELECTED? 1 setvar varname 3110
  ifvare CHARACTERSELECTED? 2 setvar varname 7585
  ifvare CHARACTERSELECTED? 3 setvar varname 1310
  ifvare CHARACTERSELECTED? 4 setvar varname 4125
  ifvare CHARACTERSELECTED? 5 setvar varname 9254
  ifvare CHARACTERSELECTED? 6 setvar varname 4196
  ifvare CHARACTERSELECTED? 7 setvar varname 3735
  ifvare CHARACTERSELECTED? 8 setvar varname 8214
  ifvare CHARACTERSELECTED? 9 setvar varname 5288
  ifvare CHARACTERSELECTED? 10 setvar varname 1256
  ifvare CHARACTERSELECTED? 11 setvar varname 5007
  ifvare CHARACTERSELECTED? 12 setvar varname 6392
  ifvare CHARACTERSELECTED? 13 setvar varname 1895
  ifvare CHARACTERSELECTED? 14 setvar varname 7364
  ifvare CHARACTERSELECTED? 15 setvar varname 7873
  state pal21
  state dnz

  state orientation2
  setvar textscale 98304
  state settilealphanum
  // Top Left Button (Steroids Button)
  setvar digx 51 // 25
  setvar digy 48 // 44
  getkeyname 332 48 0
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 8 // 12
   subvarvar digx TEMPVAR
  }
  state pal16
  state gtz

  // Middle-Top Left Button (Jetpack Button)
  setvar digx 51 // 25
  setvar digy 82
  getkeyname 332 33 0
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 8 // 12
   subvarvar digx TEMPVAR
  }
  state pal16
  state gtz

  // Middle-Bottom Left Button (Jump Button)
  setvar digx 51 // 25
  setvar digy 118
  getkeyname 332 9 0
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 8 // 12
   subvarvar digx TEMPVAR
  }
  state pal16
  state gtz

  // Bottom Left Button (Inv_Right Button)
  setvar digx 53 // 25
  setvar digy 152
  getkeyname 332 31 0
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 8 // 12
   subvarvar digx TEMPVAR
  }
  state pal16
  state gtz

  // Top Right Button (Night Vision Button)
  setvar digx 581 // 290
  setvar digy 48 // 44
  getkeyname 332 34 0
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 8 // 12
   subvarvar digx TEMPVAR
  }
  state pal16
  state gtz

  // Middle-Top Right Button (Holoduke Button)
  setvar digx 581 // 290
  setvar digy 82
  getkeyname 332 32 0
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 8 // 12
   subvarvar digx TEMPVAR
  }
  state pal16
  state gtz

  // Middle-Bottom Right Button (Crouch Button)
  setvar digx 581 // 290
  setvar digy 118
  getkeyname 332 10 0
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 8 // 12
   subvarvar digx TEMPVAR
  }
  state pal16
  state gtz

  // Bottom Right Button (Inv_Left Button)
  setvar digx 583 // 290
  setvar digy 152
  getkeyname 332 30 0
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 8 // 12
   subvarvar digx TEMPVAR
  }
  state pal16
  state gtz

 setvar textscale 65536
 state settilealphanum
 // Screen Displays
 ifvare atm_mode 0 // Welcome Screen
 {
  // Top Left Button (Steroids Button)
  setvar digx 133
  setvar digy 48
  redefinequote 332 LOG-IN
  state pal22
  state gtz

  // Middle-Top Left Button (Jetpack Button)
  setvar digx 133
  setvar digy 82
  redefinequote 332 -
  state pal22
  state gtz

  // Middle-Bottom Left Button (Jump Button)
  setvar digx 133
  setvar digy 118
  redefinequote 332 -
  state pal22
  state gtz

  // Bottom Left Button (Inv_Right Button)
  setvar digx 133
  setvar digy 152
  redefinequote 332 -
  state pal22
  state gtz

  // Top Right Button (Night Vision Button)
  setvar digx 499
  setvar digy 48
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Middle Right Button (Holoduke Button)
  setvar digx 499
  setvar digy 82
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Crouch Button)
  setvar digx 499
  setvar digy 118
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Inv_Left Button)
  setvar digx 499 // 453
  setvar digy 152
  redefinequote 332 EXIT
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  setvar textscale 49152 // 49152
  ifvare atm_wscreen 1
  {
   // Welcome Screen #1
   state digx320
   setvar digy 72
   redefinequote 332 "WELCOME TO THE
   state pal22
   state gtz
   state digx320
   setvar digy 78
   redefinequote 332 LOS ANGELES ATM!"
   state pal22
   state gtz
  }
  ifvare atm_wscreen 2
  {
   // Welcome Screen #2
   state digx320
   setvar digy 69
   redefinequote 332 "WELCOME TO THE
   state pal22
   state gtz
   state digx320
   setvar digy 75
   redefinequote 332 FEDERAL LOAN AND
   state pal22
   state gtz
   state digx320
   setvar digy 81
   redefinequote 332 TRUST ATM!"
   state pal22
   state gtz
  }
  ifvare atm_wscreen 3
  {
   // Welcome Screen #1
   state digx320
   setvar digy 69
   redefinequote 332 "WELCOME TO THE
   state pal22
   state gtz
   state digx320
   setvar digy 75
   redefinequote 332 WASHINGTON D.C.
   state pal22
   state gtz
   state digx320
   setvar digy 81
   redefinequote 332 ATM!"
   state pal22
   state gtz
  }
  ifvare atm_wscreen 4
  {
   // Welcome Screen #1
   state digx320
   setvar digy 72
   redefinequote 332 "WELCOME TO THE
   state pal22
   state gtz
   state digx320
   setvar digy 78
   redefinequote 332 LAS VEGAS ATM!"
   state pal22
   state gtz
  }

  state digx320
  setvar digy 134
  ifvare atm_extquote 1 redefinequote 332 "NEED CASH? :)"
  ifvare atm_extquote 2 redefinequote 332 "L.A.R.D. SUCKS!!  D:" 
  ifvare atm_extquote 3 redefinequote 332 "FEED ME A STRAY CAT!  :D"
  ifvare atm_extquote 4 redefinequote 332 "EYE OF HORNED SOLITUDE ROCKS!  ;D"
  ifvare atm_extquote 5 redefinequote 332 "'SUP? :D"
  ifvare atm_extquote 6
  {
   ifvare GENDER? 0 redefinequote 332 "HEY DUDE, YOU ROCK!  XD"
   else ifvare GENDER? 1 redefinequote 332 "HEY CHICKY, YOU'RE A CUTE ONE!  :)"
   else redefinequote 332 "WHAT THE HELL ARE YOU?! >_O"
  }
  ifvare atm_extquote 7 redefinequote 332 "THIS PLACE SUCKS! :("
  ifvare atm_extquote 8 redefinequote 332 "IT'S SOOOO BORING HERE! :\"
  ifvare atm_extquote 9 redefinequote 332 "DUKE NUKEM 3D ROCKS!  XD"
  ifvare atm_extquote 10 redefinequote 332 "HTTP://WWW.ATM.COM"
  ifvare atm_extquote 11 redefinequote 332 "I'M SO LONELY... :("
  ifvare atm_extquote 12 redefinequote 332 "YOU SEEN THAT FURINJI CHICK? :D"
  ifvare atm_extquote 13 redefinequote 332 "GOT ANY FOOD? :O"
  ifvare atm_extquote 14 redefinequote 332 "SHADOW WARRIOR ROCKS!  XD"
  ifvare atm_extquote 15 redefinequote 332 "THAT MYSTERIOUS CHICK IS HOT!  :)"
  ifvare atm_extquote 16 redefinequote 332 "HTTP://WWW.ZXDWARE.NET/NR/"
  ifvare atm_extquote 17 redefinequote 332 "HTTP://WWW.ZXDWARE.NET/MISFITS/"
  ifvare atm_extquote 18 redefinequote 332 "HTTP://WWW.FIREBALL20XL.COM"
  ifvare atm_extquote 19 redefinequote 332 "HTTP://WWW.FETCHQUEST.COM"
  ifvare atm_extquote 20 redefinequote 332 "HTTP://DEEPERTHOUGHT.DUKERTCM.COM"
  state pal22
  state gtz
 }

 setvar textscale 65536
 state settilealphanum
 // Screen Displays
 ifvare atm_mode 1 // Enter Account # Screen
 {
  // Top Left Button (Steroids Button)
  setvar digx 133
  setvar digy 48
  redefinequote 332 CONFIRM
  state pal22
  state gtz

  // Middle-Top Left Button (Jetpack Button)
  setvar digx 133
  setvar digy 82
  redefinequote 332 -
  state pal22
  state gtz

  // Middle-Bottom Left Button (Jump Button)
  setvar digx 133
  setvar digy 118
  redefinequote 332 -
  state pal22
  state gtz

  // Bottom Left Button (Inv_Right Button)
  setvar digx 133
  setvar digy 152
  redefinequote 332 -
  state pal22
  state gtz

  // Top Right Button (Night Vision Button)
  setvar digx 499
  setvar digy 48
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Middle Right Button (Holoduke Button)
  setvar digx 499
  setvar digy 82
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Crouch Button)
  setvar digx 499
  setvar digy 118
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Inv_Left Button)
  setvar digx 489 // 453
  setvar digy 152
  redefinequote 332 CANCEL
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  setvar textscale 49152 // 49152
  state settile2837
  // Entering ACCT#
  state digx160
  setvar digy 100
  setvarvar varname atm_acctnum
  state pal22
  state dnz

  setvar textscale 49152
  state settilealphanum
  // Screen Text
  state digx320
  setvar digy 72
  redefinequote 332 ENTER YOUR ACCOUNT # BELOW:
  state pal22
  state gtz
  // Screen Text
  state digx320
  setvar digy 78
  redefinequote 332 (ACCT # IS 6 DIGITS LONG)
  state pal22
  state gtz
 }

 setvar textscale 65536
 state settilealphanum
 // Screen Displays
 ifvare atm_mode 2 // Enter Pin # Screen
 {
  // Top Left Button (Steroids Button)
  setvar digx 133
  setvar digy 48
  redefinequote 332 CONFIRM
  state pal22
  state gtz

  // Middle-Top Left Button (Jetpack Button)
  setvar digx 133
  setvar digy 82
  redefinequote 332 -
  state pal22
  state gtz

  // Middle-Bottom Left Button (Jump Button)
  setvar digx 133
  setvar digy 118
  redefinequote 332 -
  state pal22
  state gtz

  // Bottom Left Button (Inv_Right Button)
  setvar digx 133
  setvar digy 152
  redefinequote 332 -
  state pal22
  state gtz

  // Top Right Button (Night Vision Button)
  setvar digx 499
  setvar digy 48
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Middle Right Button (Holoduke Button)
  setvar digx 499
  setvar digy 82
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Crouch Button)
  setvar digx 499
  setvar digy 118
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Inv_Left Button)
  setvar digx 489 // 453
  setvar digy 152
  redefinequote 332 CANCEL
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  setvar textscale 49152 // 49152
  state settile2837
  // Entering PIN#
  state digx160
  setvar digy 100
  setvarvar varname atm_pinnum
  state pal22
  state dnz

  setvar textscale 49152
  state settilealphanum
  // Screen Text
  state digx320
  setvar digy 72
  ifvare atm_acctnum 132995 redefinequote 332 WELCOME MR. NUKEM. PLEASE
  ifvare atm_acctnum 164702 redefinequote 332 WELCOME MR. WALKER. PLEASE
  ifvare atm_acctnum 171792 redefinequote 332 WELCOME MR. BOBCAT. PLEASE
  ifvare atm_acctnum 789152 redefinequote 332 WELCOME MISS MIZUNO. PLEASE
  ifvare atm_acctnum 171396 redefinequote 332 WELCOME MR. HAKAISHA. PLEASE
  ifvare atm_acctnum 218479 redefinequote 332 WELCOME MR. MARGALAN. PLEASE
  ifvare atm_acctnum 195382 redefinequote 332 WELCOME MR. MALDORAS. PLEASE
  ifvare atm_acctnum 475394 redefinequote 332 WELCOME MISS BATES. PLEASE
  ifvare atm_acctnum 363851 redefinequote 332 WELCOME MR. MORGANDOS. PLEASE
  ifvare atm_acctnum 963246 redefinequote 332 WELCOME MISS MITCHELL. PLEASE
  ifvare atm_acctnum 180194 redefinequote 332 WELCOME MISS POLESTAR. PLEASE
  ifvare atm_acctnum 638192 redefinequote 332 WELCOME MISS STEPHENS. PLEASE
  ifvare atm_acctnum 512560 redefinequote 332 WELCOME MISS AINO. PLEASE
  ifvare atm_acctnum 198255 redefinequote 332 WELCOME MISS MARBOROSHI. PLEASE
  ifvare atm_acctnum 918372 redefinequote 332 WELCOME MISS SHINKARA. PLEASE
  ifvare atm_acctnum 132092 redefinequote 332 WELCOME MR CLINTON. PLEASE
  ifvare atm_acctnum 890143 redefinequote 332 WELCOME MR GORE. PLEASE
  ifvare atm_acctnum 122994 redefinequote 332 WELCOME MR SIEGLER. PLEASE
  ifvare atm_acctnum 10345 redefinequote 332 WELCOME MR BLADE. PLEASE
  ifvare atm_acctnum 10333 redefinequote 332 WELCOME MISS SINCLAIRE. PLEASE
  state pal22
  state gtz
  // Screen Text
  state digx320
  setvar digy 78
  ifvare atm_acctnum 132995 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 164702 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 171792 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 789152 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 171396 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 218479 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 195382 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 475394 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 363851 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 963246 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 180194 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 638192 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 512560 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 198255 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 918372 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 132092 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 890143 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 122994 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 10345 redefinequote 332 ENTER YOUR PIN # BELOW:
  ifvare atm_acctnum 10333 redefinequote 332 ENTER YOUR PIN # BELOW:
  state pal22
  state gtz
 }

 setvar textscale 65536
 state settilealphanum
 // Screen Displays
 ifvare atm_mode 3 // Options Screen
 {
  // Top Left Button (Steroids Button)
  setvar digx 133
  setvar digy 48
  redefinequote 332 WITHDRAW
  state pal22
  state gtz

  // Middle-Top Left Button (Jetpack Button)
  setvar digx 133
  setvar digy 82
  redefinequote 332 -
  state pal22
  state gtz

  // Middle-Bottom Left Button (Jump Button)
  setvar digx 133
  setvar digy 118
  redefinequote 332 -
  state pal22
  state gtz

  // Bottom Left Button (Inv_Right Button)
  setvar digx 133
  setvar digy 152
  redefinequote 332 WIRE
  state pal22
  state gtz

  // Top Right Button (Night Vision Button)
  setvar digx 495
  setvar digy 48
  redefinequote 332 DEPOSIT
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Middle Right Button (Holoduke Button)
  setvar digx 499
  setvar digy 82
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Crouch Button)
  setvar digx 499
  setvar digy 118
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Inv_Left Button)
  setvar digx 491 // 453
  setvar digy 152
  redefinequote 332 LOGOUT
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz



  setvar textscale 49152
  state settilealphanum
  // Screen Text
  ifvare atm_acctnum 132995 // Duke
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MR. NUKEM!  ALIENS
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332 GOT YOU DOWN? MAYBE SOME
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332 CASH AND CHICKS WILL CHEER 
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332 YOU RIGHT UP!  :)"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 164702 // Jack
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MR. WALKER!  HOW IS
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332 'PLAYING HERO' GOING FOR YOU?
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332 MAYBE YOU CAN USE SOME EXTRA
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332 CASH FOR HELP!  :P"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 171792 // Bubsy
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MR. BOBCAT!  MOVIE
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332 BUSINESS SLOW? MAYBE YOU
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332 NEED SOME NEW INSPIRATION
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332 IN YOUR LIFE!  :P"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 789152 // Ami
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MISS MIZUNO!  STILL
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332 CRAMMING AT THE BOOKS? AN
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332 ADVENTURE OF LARGE PROPORTIONS
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332 WILL LOOSEN YOU UP!  :)"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 171396 // Higa
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MR. HAKAISHA!  ZILLA
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332 PISSING YOU OFF? MAYBE YOU
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332 NEED A NEW WEAPON WITH HIS
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332 NAME ON IT!  >:D"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 218479 // ESSence
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MR. MARGALAN!  IF YOU
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332 ARE FEELING DEPRESSED, DO NOT
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332 WORRY, FOR THERE ARE 'TRUE'
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332 FRIENDS OUT THERE FOR YOU!  :D"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 195382 // Ted
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MR. MALDORAS!  HOW'S
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332 THE BATTLE GOING FOR YOU? IF
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332 YOU NEED HELP, CASH CAN ALWAYS
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332 DO YOU GOOD!  ;)"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 475394 // Lisa
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MISS BATES!  YOU'RE
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332 STILL JUST AS CUTE AND LOVELY
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332 AS LAST TIME!  WHAT BRINGS YOU
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332 HERE, BABY? ;D"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 363851 // Cybanis
  {
   state digx320
   setvar digy 63
   redefinequote 332 "WELCOME MR. MORGANDOS!  DO
   state pal22
   state gtz

   state digx320
   setvar digy 69
   redefinequote 332 NOT LET YOUR QUEST FOR JUSTICE
   state pal22
   state gtz

   state digx320
   setvar digy 75
   redefinequote 332 BECOME PURE VENGEANCE, OR YOU 
   state pal22
   state gtz

   state digx320
   setvar digy 81
   redefinequote 332 WILL LOSE YOURSELF IN TOTAL
   state pal22
   state gtz

   state digx320
   setvar digy 87
   redefinequote 332 DARKNESS!  :\"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 963246 // Christina/Nethra
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MISS MITCHELL!  THE
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332 FUTURE IS BRIGHT LIKE A STAR,
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332 AND YOUR STAR SHINES BRIGHT!
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332 SUCCESS WILL COME SOON!  :)"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 180194 // Paula
  {
   state digx320
   setvar digy 63
   redefinequote 332 "WELCOME MISS POLESTAR!  ON
   state pal22
   state gtz

   state digx320
   setvar digy 69
   redefinequote 332 ANOTHER ADVENTURE TO SAVE THE
   state pal22
   state gtz

   state digx320
   setvar digy 75
   redefinequote 332 WORLD FROM ALIENS?!  MAN, YOU
   state pal22
   state gtz

   state digx320
   setvar digy 81
   redefinequote 332 GO THROUGH THOSE LIKE HOT
   state pal22
   state gtz

   state digx320
   setvar digy 87
   redefinequote 332 CAKES!  NEED ANY CASH? :P"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 638192 // Lori
  {
   state digx320
   setvar digy 63
   redefinequote 332 "WELCOME MISS STEPHENS!  YOU
   state pal22
   state gtz

   state digx320
   setvar digy 69
   redefinequote 332 MUST REMEMBER YOU ARE QUITE
   state pal22
   state gtz

   state digx320
   setvar digy 75
   redefinequote 332 UNIQUE AMONG MOST PEOPLE IN
   state pal22
   state gtz

   state digx320
   setvar digy 81
   redefinequote 332 THE WORLD!  USE THAT TO YOUR
   state pal22
   state gtz

   state digx320
   setvar digy 87
   redefinequote 332 ADVANTAGE!  :D"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 512560 // Minako
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MISS AINO!  YOU LOVE
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332 YOUR FRIENDS, BUT DON'T ALLOW
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332 ANGER TO TAKE HOLD OF YOU! LET
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332 HAPPINESS DO THE TALKING! :)"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 198255 // Mystery Lady
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MISS MABOROSHI!  THE
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332 WORLD IS A BIG PLACE ISN'T IT?
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332 WHAT YOU NEED IS SOMEONE WHO
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332 LOVES YOU MUCH AND ALWAYS!  :)"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 918372 // Maken
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MISS SHINKARA!  SOME
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332 LESSONS TAKE LONGER THAN OTHERS
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332 TO LEARN IN LIFE, AND HOPEFULLY
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332 YOU'LL COME TO TERMS SOON!  :\"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 132092
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MR CLINTON!  SO HOW'S
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332 TIME IN OFFICE GOING, MR. PRES-
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332 IDENT? DON'T FEEL BAD ABOUT THE
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332 INVASION, FOR ALL IS GOOD! :)"
   state pal22
   state gtz
  }
  else
  ifvare atm_acctnum 122994
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MR SIEGLER!  PLANNING
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332 ON ANY MORE IN-GAME ROLES FOR
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332 3D REALMS IN THE FUTURE? :)"
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332  
   state pal22
   state gtz
  }   
  else
  ifvare atm_acctnum 890143
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MR GORE!  KEEPING IN
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332 TOUCH WITH NATURE LATELY? KEEP
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332 UP THE GOOD WORK, MR. VICE-
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332 PRESIDENT! ;)"
   state pal22
   state gtz
  }   
  else
  ifvare atm_acctnum 10345
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MR BLADE!"
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332  
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332  
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332  
   state pal22
   state gtz
  }   
  else
  ifvare atm_acctnum 10333
  {
   state digx320
   setvar digy 66
   redefinequote 332 "WELCOME MISS SINCLAIRE!"
   state pal22
   state gtz

   state digx320
   setvar digy 72
   redefinequote 332  
   state pal22
   state gtz

   state digx320
   setvar digy 78
   redefinequote 332  
   state pal22
   state gtz

   state digx320
   setvar digy 84
   redefinequote 332  
   state pal22
   state gtz
  }   

  // Screen Text
  state digx320
  setvar digy 102
  redefinequote 332 PLEASE SELECT AN OPTION:
  state pal22
  state gtz

  state displayaccountinfo

  setvar textscale 49152
  state settilealphanum
  // Error Messages
  ifvarg atm_serrortimer 0
  {
   state digx320
   setvar digy 162

   ifvare atm_serrortype 1 // Withdraw Error
    redefinequote 332 ERROR: NO MONEY IN ACCOUNT!
   else ifvare atm_serrortype 2 // Deposit Error
    redefinequote 332 ERROR: YOU HAVE NO MONEY!
   else ifvare atm_serrortype 3 // Wire Funds Error
    redefinequote 332 ERROR: NO MONEY IN ACCOUNT!
   else // Unknown Error
    redefinequote 332 ERROR: !!UNKNOWN ERROR!!

   state pal22
   state gtz   
   subvar atm_serrortimer 1
  }
 }

 setvar textscale 65536
 state settilealphanum
 // Screen Displays
 ifvare atm_mode 4 // Withdrawl Screen
 {
  // Top Left Button (Steroids Button)
  setvar digx 133
  setvar digy 48
  redefinequote 332 WITHDRAW CASH
  state pal22
  state gtz

  // Middle-Top Left Button (Jetpack Button)
  setvar digx 133
  setvar digy 82
  redefinequote 332 -
  state pal22
  state gtz

  // Middle-Bottom Left Button (Jump Button)
  setvar digx 133
  setvar digy 118
  redefinequote 332 -
  state pal22
  state gtz

  // Bottom Left Button (Inv_Right Button)
  setvar digx 133
  setvar digy 152
  redefinequote 332 -
  state pal22
  state gtz

  // Top Right Button (Night Vision Button)
  setvar digx 499
  setvar digy 48
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Middle Right Button (Holoduke Button)
  setvar digx 499
  setvar digy 82
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Crouch Button)
  setvar digx 499
  setvar digy 118
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Inv_Left Button)
  setvar digx 489 // 453
  setvar digy 152
  redefinequote 332 CANCEL
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz
/*
  setvar textscale 49152 // 49152
  state settile2837
  // Entering Withdraw Amount
  state digx160
  setvar digy 120
  setvarvar varname atm_amount_all
  state pal22
  state dnz

  state digx160
  setvar digy 130
  setvarvar varname atm_amount_dollars
  setvarvar atm_amount_dollars atm_amount_all
  divvarvar atm_amount_dollars 100
  state pal22
  state dnz

  state digx160
  setvar digy 140
  setvarvar atm_amount_cents atm_amount_all
  modvarvar atm_amount_cents 100
  setvarvar varname atm_amount_cents
  state pal22
  state dnz
*/

  setvar textscale 49152
  state settilealphanum
  state digx320
  setvar digy 72
  redefinequote 332 ENTER THE AMOUNT TO WITHDRAW:
  state pal22
  state gtz

  state displayaccountamountwithwire

  state showatmwdwinput

  setvar textscale 49152
  state settilealphanum
  // Error Messages
  ifvarg atm_serrortimer 0
  {
   state digx320
   setvar digy 162

   ifvare atm_serrortype 1 // No Amount Entered
    redefinequote 332 ERROR: NO VALUE ENTERED!
   else ifvare atm_serrortype 2 // Overflow Error
    redefinequote 332 ERROR: INSUFFICANT FUND AMOUNT!
   else // Unknown Error
    redefinequote 332 ERROR: !!UNKNOWN ERROR!!

   state pal22
   state gtz   
   subvar atm_serrortimer 1
  }
 }

 setvar textscale 65536
 state settilealphanum
 // Screen Displays
 ifvare atm_mode 5 // Deposit Screen
 {
  // Top Left Button (Steroids Button)
  setvar digx 133
  setvar digy 48
  redefinequote 332 DEPOSIT CASH
  state pal22
  state gtz

  // Middle-Top Left Button (Jetpack Button)
  setvar digx 133
  setvar digy 82
  redefinequote 332 -
  state pal22
  state gtz

  // Middle-Bottom Left Button (Jump Button)
  setvar digx 133
  setvar digy 118
  redefinequote 332 -
  state pal22
  state gtz

  // Bottom Left Button (Inv_Right Button)
  setvar digx 133
  setvar digy 152
  redefinequote 332 -
  state pal22
  state gtz

  // Top Right Button (Night Vision Button)
  setvar digx 499
  setvar digy 48
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Middle Right Button (Holoduke Button)
  setvar digx 499
  setvar digy 82
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Crouch Button)
  setvar digx 499
  setvar digy 118
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Inv_Left Button)
  setvar digx 489 // 453
  setvar digy 152
  redefinequote 332 CANCEL
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  setvar textscale 49152
  state settilealphanum
  state digx320
  setvar digy 72
  redefinequote 332 ENTER THE AMOUNT TO DEPOSIT:
  state pal22
  state gtz

  state digx320
  setvar digy 78
  state pal22

  setvarvar TEMP DOLLARS
  setvarvar tempb CENTS

  redefinequote 332 CURRENT MONEY: $0000000000.00
  ifvarg TEMP -1
  ifvarl TEMP 10
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 CURRENT MONEY: $000000000%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 CURRENT MONEY: $000000000%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 9
  ifvarl TEMP 100
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 CURRENT MONEY: $00000000%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 CURRENT MONEY: $00000000%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 99
  ifvarl TEMP 1000
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 CURRENT MONEY: $0000000%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 CURRENT MONEY: $0000000%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 999
  ifvarl TEMP 10000
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 CURRENT MONEY: $000000%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 CURRENT MONEY: $000000%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 9999
  ifvarl TEMP 100000
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 CURRENT MONEY: $00000%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 CURRENT MONEY: $00000%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 99999
  ifvarl TEMP 1000000
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 CURRENT MONEY: $0000%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 CURRENT MONEY: $0000%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 999999
  ifvarl TEMP 10000000
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 CURRENT MONEY: $000%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 CURRENT MONEY: $000%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 9999999
  ifvarl TEMP 100000000
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 CURRENT MONEY: $00%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 CURRENT MONEY: $00%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 99999999
  ifvarl TEMP 1000000000
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 CURRENT MONEY: $0%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 CURRENT MONEY: $0%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  else
  ifvarg TEMP 999999999
  ifvarl TEMP 2147483647
  {
   ifvarg tempb -1
   ifvarl tempb 10
   {
    redefinequote 2002 CURRENT MONEY: $%ld.0%ld
    qsprintf 332 2002 TEMP tempb
   }
   else
   {
    redefinequote 2002 CURRENT MONEY: $%ld.%ld
    qsprintf 332 2002 TEMP tempb
   }
  }
  state gtz

  state showatmwdwinput

  setvar textscale 49152
  state settilealphanum
  // Error Messages
  ifvarg atm_serrortimer 0
  {
   state digx320
   setvar digy 162

   ifvare atm_serrortype 1 // No Amount Entered
    redefinequote 332 ERROR: NO VALUE ENTERED!
   else ifvare atm_serrortype 2 // Not Enough Money
    redefinequote 332 ERROR: AMOUNT TOO HIGH TO DEPOSIT!
   else // Unknown Error
    redefinequote 332 ERROR: !!UNKNOWN ERROR!!

   state pal22
   state gtz   
   subvar atm_serrortimer 1
  }
 }

 setvar textscale 65536
 state settilealphanum
 // Screen Displays
 ifvare atm_mode 6 // "Please Take Cash" Screen
 {
  // Top Left Button (Steroids Button)
  setvar digx 133
  setvar digy 48
  redefinequote 332 OPTIONS
  state pal22
  state gtz

  // Middle-Top Left Button (Jetpack Button)
  setvar digx 133
  setvar digy 82
  redefinequote 332 -
  state pal22
  state gtz

  // Middle-Bottom Left Button (Jump Button)
  setvar digx 133
  setvar digy 118
  redefinequote 332 -
  state pal22
  state gtz

  // Bottom Left Button (Inv_Right Button)
  setvar digx 133
  setvar digy 152
  redefinequote 332 -
  state pal22
  state gtz

  // Top Right Button (Night Vision Button)
  setvar digx 499
  setvar digy 48
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Middle Right Button (Holoduke Button)
  setvar digx 499
  setvar digy 82
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Crouch Button)
  setvar digx 499
  setvar digy 118
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Inv_Left Button)
  setvar digx 499 // 453
  setvar digy 152
  redefinequote 332 EXIT
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  setvar textscale 49152
  ifvare atm_action 0
  {
   // Screen Text
   state digx320
   setvar digy 72
   redefinequote 332 YOUR MONEY HAS BEEN DISPENSED.
   state pal22
   state gtz
   state digx320
   setvar digy 78
   redefinequote 332 MORE OPTIONS OR EXIT?
   state pal22
   state gtz
  }
  ifvare atm_action 1
  {
   // Screen Text
   state digx320
   setvar digy 72
   redefinequote 332 YOUR MONEY HAS BEEN DEPOSITED.
   state pal22
   state gtz
   state digx320
   setvar digy 78
   redefinequote 332 MORE OPTIONS OR EXIT?
   state pal22
   state gtz
  }
  ifvare atm_action 2
  {
   // Screen Text
   state digx320
   setvar digy 72
   redefinequote 332 YOUR MONEY HAS BEEN WIRED.
   state pal22
   state gtz
   state digx320
   setvar digy 78
   redefinequote 332 MORE OPTIONS OR EXIT?
   state pal22
   state gtz
  }
 }

 setvar textscale 65536
 state settilealphanum
 // Screen Displays
 ifvare atm_mode 7 // "Wire Funds Entry" Screen
 {
  // Top Left Button (Steroids Button)
  setvar digx 133
  setvar digy 48
  redefinequote 332 CONFIRM
  state pal22
  state gtz

  // Middle-Top Left Button (Jetpack Button)
  setvar digx 133
  setvar digy 82
  redefinequote 332 -
  state pal22
  state gtz

  // Middle-Bottom Left Button (Jump Button)
  setvar digx 133
  setvar digy 118
  redefinequote 332 -
  state pal22
  state gtz

  // Bottom Left Button (Inv_Right Button)
  setvar digx 133
  setvar digy 152
  redefinequote 332 -
  state pal22
  state gtz

  // Top Right Button (Night Vision Button)
  setvar digx 499
  setvar digy 48
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Middle Right Button (Holoduke Button)
  setvar digx 499
  setvar digy 82
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Crouch Button)
  setvar digx 499
  setvar digy 118
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Inv_Left Button)
  setvar digx 489 // 453
  setvar digy 152
  redefinequote 332 CANCEL
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  setvar textscale 49152
  state settilealphanum
  state digx320
  setvar digy 72
  redefinequote 332 ENTER THE AMOUNT TO WIRE:
  state pal22
  state gtz

  state displayaccountamountwithwire

  state showatmwdwinput

  setvar textscale 49152
  state settilealphanum
  // Error Messages
  ifvarg atm_serrortimer 0
  {
   state digx320
   setvar digy 162

   ifvare atm_serrortype 1 // No Amount Entered
    redefinequote 332 ERROR: NO VALUE ENTERED!
   else ifvare atm_serrortype 2 // Overflow Error
    redefinequote 332 ERROR: INSUFFICANT FUNDS!
   else // Unknown Error
    redefinequote 332 ERROR: !!UNKNOWN ERROR!!

   state pal22
   state gtz   
   subvar atm_serrortimer 1
  }
 }

 setvar textscale 65536
 state settilealphanum
 // Screen Displays
 ifvare atm_mode 8 // "Wire Funds To" Screen
 {
  // Top Left Button (Steroids Button)
  setvar digx 133
  setvar digy 48
  redefinequote 332 CONFIRM
  state pal22
  state gtz

  // Middle-Top Left Button (Jetpack Button)
  setvar digx 133
  setvar digy 82
  redefinequote 332 -
  state pal22
  state gtz

  // Middle-Bottom Left Button (Jump Button)
  setvar digx 133
  setvar digy 118
  redefinequote 332 -
  state pal22
  state gtz

  // Bottom Left Button (Inv_Right Button)
  setvar digx 133
  setvar digy 152
  redefinequote 332 -
  state pal22
  state gtz

  // Top Right Button (Night Vision Button)
  setvar digx 499
  setvar digy 48
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Middle Right Button (Holoduke Button)
  setvar digx 499
  setvar digy 82
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Crouch Button)
  setvar digx 499
  setvar digy 118
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Inv_Left Button)
  setvar digx 489 // 453
  setvar digy 152
  redefinequote 332 CANCEL
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  setvar textscale 49152
  state settilealphanum
  state digx320
  setvar digy 72
  redefinequote 332 ENTER THE ACCOUNT # TO WIRE TO:
  state pal22
  state gtz

  setvar textscale 49152 // 49152
  state settile2837
  // Entering Wire ACCT#
  state digx160
  setvar digy 100
  setvarvar varname atm_wacctnum
  state pal22
  state dnz

  setvar textscale 49152
  state settilealphanum
  // Error Messages
  ifvarg atm_serrortimer 0
  {
   state digx320
   setvar digy 162

   ifvare atm_serrortype 1 // No Amount Entered
    redefinequote 332 ERROR: CANNOT WIRE TO OWN ACCOUNT!
   else // Unknown Error
    redefinequote 332 ERROR: !!UNKNOWN ERROR!!

   state pal22
   state gtz   
   subvar atm_serrortimer 1
  }
 }

 setvar textscale 65536
 state settilealphanum
 // Screen Displays
 ifvare atm_mode 9 // "ERROR" Screen
 {
  // Top Left Button (Steroids Button)
  setvar digx 133
  setvar digy 48
  redefinequote 332 LOG-IN
  state pal22
  state gtz

  // Middle-Top Left Button (Jetpack Button)
  setvar digx 133
  setvar digy 82
  redefinequote 332 -
  state pal22
  state gtz

  // Middle-Bottom Left Button (Jump Button)
  setvar digx 133
  setvar digy 118
  redefinequote 332 -
  state pal22
  state gtz

  // Bottom Left Button (Inv_Right Button)
  setvar digx 133
  setvar digy 152
  redefinequote 332 -
  state pal22
  state gtz

  // Top Right Button (Night Vision Button)
  setvar digx 491
  setvar digy 48
  redefinequote 332 RETURN
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Middle Right Button (Holoduke Button)
  setvar digx 499
  setvar digy 82
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Crouch Button)
  setvar digx 499
  setvar digy 118
  redefinequote 332 -
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  // Bottom Right Button (Inv_Left Button)
  setvar digx 499 // 453
  setvar digy 152
  redefinequote 332 EXIT
  qstrlen TEMPVAR 332
  ifvarg TEMPVAR 0
  {
   subvar TEMPVAR 1
   mulvar TEMPVAR 16
   subvarvar digx TEMPVAR
  }
  state pal22
  state gtz

  setvar textscale 49152
  state settilealphanum
  ifvare atm_errortype 1
  {
   // Screen Text
   state digx320
   setvar digy 69
   redefinequote 332 YOU HAVE ENTERED A BAD
   state pal22
   state gtz
   state digx320
   setvar digy 75
   redefinequote 332 ACCOUNT NUMBER. PLEASE TRY
   state pal22
   state gtz
   state digx320
   setvar digy 81
   redefinequote 332 AND ENTER ANOTHER NUMBER.
   state pal22
   state gtz
  }
  else
  ifvare atm_errortype 2
  {
   // Screen Text
   state digx320
   setvar digy 69
   redefinequote 332 YOU HAVE ENTERED THE
   state pal22
   state gtz
   state digx320
   setvar digy 75
   redefinequote 332 WRONG PIN NUMBER. PLEASE TRY
   state pal22
   state gtz
   state digx320
   setvar digy 81
   redefinequote 332 AND ENTER ANOTHER PIN NUMBER.
   state pal22
   state gtz
  }
 }
}
ends

state getatmacctvalues
          ifvare atm_acctnum 132995 // Duke
          {
           setvar CHARACTERARRAY 1
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 164702 // Jack
          {
           setvar CHARACTERARRAY 2
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 171792 // Bubsy
          {
           setvar CHARACTERARRAY 3
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 789152 // Ami
          {
           setvar CHARACTERARRAY 4
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 171396 // Higa
          {
           setvar CHARACTERARRAY 5
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 218479 // ESSence
          {
           setvar CHARACTERARRAY 6
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 195382 // Ted
          {
           setvar CHARACTERARRAY 7
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 475394 // Lisa
          {
           setvar CHARACTERARRAY 8
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 363851 // Cybanis
          {
           setvar CHARACTERARRAY 9
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 963246 // Christina/Nethra
          {
           setvar CHARACTERARRAY 10
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 180194 // Paula
          {
           setvar CHARACTERARRAY 11
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 638192 // Lori
          {
           setvar CHARACTERARRAY 12
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 512560 // Minako
          {
           setvar CHARACTERARRAY 13
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 198255 // "Mystery Lady"
          {
           setvar CHARACTERARRAY 14
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 918372 // Maken
          {
           setvar CHARACTERARRAY 15
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 132092 // President Clinton (NPC)
          {
           setvar CHARACTERARRAY 257
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 890143 // Vice-President Gore (NPC)
          {
           setvar CHARACTERARRAY 258
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 122994 // Joe Siegler [3DR]
          {
           setvar CHARACTERARRAY 265
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 10345 // John R. Blade [Cameo]
          {
           setvar CHARACTERARRAY 279
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
          else
          ifvare atm_acctnum 10333 // Elexis Sinclaire [Cameo]
          {
           setvar CHARACTERARRAY 280
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMPDOLLARS
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS TEMPCENTS
          }
ends

state cmd_depositmoney
          getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS tempd
          getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS tempe
          addvarvar tempd atm_amount_cents
          ifvarg tempd 99 // checks for Cent overflow and corrects
          {
           addvar tempe 1
           subvar tempd 100
          }
          addvarvar tempe atm_amount_dollars
          ifvarg tempe 2000000000 // if total account after calculation is over 2 billion dollars, don't add
          {
           setvar atm_amount_all 0
           state randomatmbeeps sound MENU_ERROR
          }
          else
          {
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS tempb
           getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS tempc
           addvarvar tempb atm_amount_cents
           ifvarg tempb 99 { addvar tempc 1 subvar tempb 100 }
           subvarvar CENTS atm_amount_cents
           addvarvar tempc atm_amount_dollars
           subvarvar DOLLARS atm_amount_dollars
           setactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS tempb
           setactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS tempc
           setvarvar DISPLAYDOLLARS atm_amount_dollars
           setvarvar DISPLAYCENTS atm_amount_cents
           state moneydisplaycheck
           setvar MONEYGAIN -1
           state displaymoney
           setvar atm_amount_all 0
           setvar atm_mode 6
           sound MONEYSOUND
          }
ends

state cmd_depositmoney2
          ifvare atm_acctnum 132995 // Duke
          {
           setvar CHARACTERARRAY 1
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 164702 // Jack
          {
           setvar CHARACTERARRAY 2
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 171792 // Bubsy
          {
           setvar CHARACTERARRAY 3
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 789152 // Ami
          {
           setvar CHARACTERARRAY 4
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 171396 // Higa
          {
           setvar CHARACTERARRAY 5
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 218479 // ESSence
          {
           setvar CHARACTERARRAY 6
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 195382 // Ted
          {
           setvar CHARACTERARRAY 7
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 475394 // Lisa
          {
           setvar CHARACTERARRAY 8
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 363851 // Cybanis
          {
           setvar CHARACTERARRAY 9
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 963246 // Christina/Nethra
          {
           setvar CHARACTERARRAY 10
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 180194 // Paula
          {
           setvar CHARACTERARRAY 11
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 638192 // Lori
          {
           setvar CHARACTERARRAY 12
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 512560 // Minako
          {
           setvar CHARACTERARRAY 13
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 198255 // "Mystery Lady"
          {
           setvar CHARACTERARRAY 14
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 918372 // Maken
          {
           setvar CHARACTERARRAY 15
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 132092 // President Clinton (NPC)
          {
           setvar CHARACTERARRAY 257
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 890143 // Vice-President Gore (NPC)
          {
           setvar CHARACTERARRAY 258
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 122994 // Joe Siegler [3DR]
          {
           setvar CHARACTERARRAY 265
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 10345 // John R. Blade [Cameo]
          {
           setvar CHARACTERARRAY 279
           state cmd_depositmoney
          }
          else
          ifvare atm_acctnum 10333 // Elexis Sinclaire [Cameo]
          {
           setvar CHARACTERARRAY 280
           state cmd_depositmoney
          }
          else // No one
          {
           setvar atm_amount_all 0
           setvar atm_mode 6
          }
ends

state cmd_withdrawmoney
          getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMP
          getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS tempb
          subvarvar tempb atm_amount_cents
          ifvarl tempb 0
          {
           addvar tempb 100
           subvar TEMP 1
          }
          subvarvar TEMP atm_amount_dollars
          setactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMP
          setactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS tempb
          setvarvar DISPLAYDOLLARS atm_amount_dollars
          setvarvar DISPLAYCENTS atm_amount_cents
          state moneydisplaycheck
          setvar MONEYGAIN 1
          state displaymoney
          setvar atm_amount_all 0
          setvar atm_mode 6
          sound MONEYSOUND
          sound ATM_DISPENSE
ends

state cmd_withdrawmoney2
          addvarvar CENTS atm_amount_cents
          addvarvar DOLLARS atm_amount_dollars
          ifvare atm_acctnum 132995 // Duke
          {
           setvar CHARACTERARRAY 1
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 164702 // Jack
          {
           setvar CHARACTERARRAY 2
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 171792 // Bubsy
          {
           setvar CHARACTERARRAY 3
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 789152 // Ami
          {
           setvar CHARACTERARRAY 4
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 171396 // Higa
          {
           setvar CHARACTERARRAY 5
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 218479 // ESSence
          {
           setvar CHARACTERARRAY 6
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 195382 // Ted
          {
           setvar CHARACTERARRAY 7
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 475394 // Lisa
          {
           setvar CHARACTERARRAY 8
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 363851 // Cybanis
          {
           setvar CHARACTERARRAY 9
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 963246 // Christina/Nethra
          {
           setvar CHARACTERARRAY 10
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 180194 // Paula
          {
           setvar CHARACTERARRAY 11
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 638192 // Lori
          {
           setvar CHARACTERARRAY 12
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 512560 // Minako
          {
           setvar CHARACTERARRAY 13
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 198255 // "Mystery Lady"
          {
           setvar CHARACTERARRAY 14
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 918372 // Maken
          {
           setvar CHARACTERARRAY 15
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 132092 // President Clinton (NPC)
          {
           setvar CHARACTERARRAY 257
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 890143 // Vice-President Gore (NPC)
          {
           setvar CHARACTERARRAY 258
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 122994 // Joe Siegler [3DR]
          {
           setvar CHARACTERARRAY 265
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 10345 // John R. Blade [Cameo]
          {
           setvar CHARACTERARRAY 279
           state cmd_withdrawmoney
          }
          else
          ifvare atm_acctnum 10333 // Elexis Sinclaire [Cameo]
          {
           setvar CHARACTERARRAY 280
           state cmd_withdrawmoney
          }
          else // No one
          {
           setvar atm_amount_all 0
           setvar atm_mode 6
          }
ends

state cmd_wiremoney_sender
          getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMP
          getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS tempb
          subvarvar tempb atm_amount_cents
          ifvarl tempb 0
          {
           addvar tempb 100
           subvar TEMP 1
          }
          subvarvar TEMP atm_amount_dollars
          setactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS TEMP
          setactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS tempb
          setvar atm_amount_all 0
          setvar atm_mode 6
          state randomatmbeeps
ends

state cmd_wiremoney_receiver
          getactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS tempc
          getactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS tempd
          addvarvar tempd atm_amount_cents
          ifvarg tempd 99
          {
           subvar tempd 100
           addvar tempc 1
          }
          addvarvar tempc atm_amount_dollars
          setactorvar[CHARACTERARRAY].CHARACTERATMMONEYDOLLARS tempc
          setactorvar[CHARACTERARRAY].CHARACTERATMMONEYCENTS tempd
          setvar atm_amount_all 0
          setvar atm_mode 6
          state randomatmbeeps
ends

//*************
//*ATM BUTTONS*
//*************

state atm-upperleftbutton
    ifvare atm_mode 0 // Welcome Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      setvar atm_mode 1
      setvar atm_amount_all 0
      setvar atm_errortype 0
      setvar atm_serrortimer 0
      setvar atm_serrortype 0
      state randomatmbeeps
     }
     setvar atm_button1timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 1 // Enter Acct#
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      ifvare atm_acctnum 132995 { setvar atm_mode 2 state randomatmbeeps } // Duke's ID
      else ifvare atm_acctnum 164702 { setvar atm_mode 2 state randomatmbeeps } // Jack's ID
      else ifvare atm_acctnum 171792 { setvar atm_mode 2 state randomatmbeeps } // Bubsy's ID
      else ifvare atm_acctnum 789152 { setvar atm_mode 2 state randomatmbeeps } // Ami's ID
      else ifvare atm_acctnum 171396 { setvar atm_mode 2 state randomatmbeeps } // Higa's ID
      else ifvare atm_acctnum 218479 { setvar atm_mode 2 state randomatmbeeps } // ESSence's ID
      else ifvare atm_acctnum 195382 { setvar atm_mode 2 state randomatmbeeps } // Ted's ID
      else ifvare atm_acctnum 475394 { setvar atm_mode 2 state randomatmbeeps } // Lisa's ID
      else ifvare atm_acctnum 363851 { setvar atm_mode 2 state randomatmbeeps } // Cybanis's ID
      else ifvare atm_acctnum 963246 { setvar atm_mode 2 state randomatmbeeps } // Nethra's ID
      else ifvare atm_acctnum 180194 { setvar atm_mode 2 state randomatmbeeps } // Paula's ID
      else ifvare atm_acctnum 638192 { setvar atm_mode 2 state randomatmbeeps } // Lori's ID
      else ifvare atm_acctnum 512560 { setvar atm_mode 2 state randomatmbeeps } // Minako's ID
      else ifvare atm_acctnum 198255 { setvar atm_mode 2 state randomatmbeeps } // Mystery Lady's ID
      else ifvare atm_acctnum 918372 { setvar atm_mode 2 state randomatmbeeps } // Maken's ID
      else ifvare atm_acctnum 132092 { setvar atm_mode 2 state randomatmbeeps } // President Clinton's ID [NPC]
      else ifvare atm_acctnum 890143 { setvar atm_mode 2 state randomatmbeeps } // Vice-President Gore's ID [NPC]
      else ifvare atm_acctnum 122994 { setvar atm_mode 2 state randomatmbeeps } // Joe Siegler's ID [NPC]
      else ifvare atm_acctnum 10345 { setvar atm_mode 2 state randomatmbeeps } // John R. Blade [Cameo]
      else ifvare atm_acctnum 10333 { setvar atm_mode 2 state randomatmbeeps } // Elexis Sinclaire [Cameo]
      else { setvar atm_acctnum 0 setvar atm_pinnum 0 setvar atm_mode 9 setvar atm_errortype 1 state randomatmbeeps sound MENU_ERROR }
     }
     setvar atm_button1timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 2 // Enter PIN#
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      ifvare atm_pinnum 3110 { setvar atm_mode 3 state randomatmbeeps } // Duke's PIN
      else ifvare atm_pinnum 7585 { setvar atm_mode 3 state randomatmbeeps } // Jack's PIN
      else ifvare atm_pinnum 1310 { setvar atm_mode 3 state randomatmbeeps } // Bubsy's PIN
      else ifvare atm_pinnum 4125 { setvar atm_mode 3 state randomatmbeeps } // Ami's PIN
      else ifvare atm_pinnum 9254 { setvar atm_mode 3 state randomatmbeeps } // Higa's PIN
      else ifvare atm_pinnum 4196 { setvar atm_mode 3 state randomatmbeeps } // ESSence's PIN
      else ifvare atm_pinnum 3735 { setvar atm_mode 3 state randomatmbeeps } // Ted's PIN
      else ifvare atm_pinnum 8214 { setvar atm_mode 3 state randomatmbeeps } // Lisa's PIN
      else ifvare atm_pinnum 5288 { setvar atm_mode 3 state randomatmbeeps } // Cybanis's PIN
      else ifvare atm_pinnum 1256 { setvar atm_mode 3 state randomatmbeeps } // Nethra's PIN
      else ifvare atm_pinnum 5007 { setvar atm_mode 3 state randomatmbeeps } // Paula's PIN
      else ifvare atm_pinnum 6392 { setvar atm_mode 3 state randomatmbeeps } // Lori's PIN
      else ifvare atm_pinnum 1895 { setvar atm_mode 3 state randomatmbeeps } // Minako's PIN
      else ifvare atm_pinnum 7364 { setvar atm_mode 3 state randomatmbeeps } // Mystery Lady's PIN
      else ifvare atm_pinnum 7873 { setvar atm_mode 3 state randomatmbeeps } // Maken's PIN
      else ifvare atm_pinnum 1310 { setvar atm_mode 3 state randomatmbeeps } // President Clinton's PIN [NPC]
      else ifvare atm_pinnum 9613 { setvar atm_mode 3 state randomatmbeeps } // Vice-President Gore's PIN [NPC]
      else ifvare atm_pinnum 2035 { setvar atm_mode 3 state randomatmbeeps } // Joe Siegler's PIN [NPC]
      else ifvare atm_pinnum 2019 { setvar atm_mode 3 state randomatmbeeps } // John R. Blade [Cameo]
      else ifvare atm_pinnum 6969 { setvar atm_mode 3 state randomatmbeeps } // Elexis Sinclaire [Cameo]
      else { setvar atm_acctnum 0 setvar atm_pinnum 0 setvar atm_mode 9 setvar atm_errortype 2 state randomatmbeeps sound MENU_ERROR }
     }
     setvar atm_button1timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 3 // Options Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {      
      state getatmacctvalues
      ifvarg TEMPDOLLARS 0
      {
       setvar atm_mode 4
       setvar atm_amount_all 0
       setvar atm_action 0 
       setvar atm_errortype 0
       setvar atm_serrortimer 0
       setvar atm_serrortype 0
       state randomatmbeeps
      }
      else
      {
       ifvarg TEMPCENTS 0
       {
        setvar atm_mode 4
        setvar atm_amount_all 0
        setvar atm_action 0 
        setvar atm_errortype 0
        setvar atm_serrortimer 0
        setvar atm_serrortype 0
        state randomatmbeeps
       }
       else
       {
        setvar atm_errortype 0
        setvar atm_serrortimer 26
        setvar atm_serrortype 1
        state randomatmbeeps sound MENU_ERROR
       }
      }
     }
     setvar atm_button1timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 4 // Withdraw Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
//***************************
//*Insert Withdraw Code Here*
//***************************
      ifvare atm_amount_all 0 // if any amount isn't entered
      {
       setvar atm_amount_all 0
       setvar atm_serrortimer 26
       setvar atm_serrortype 1
       state randomatmbeeps sound MENU_ERROR
      }
      else // if any amount IS entered
      {
       state getatmacctvalues

       ifvarvarg atm_amount_dollars TEMPDOLLARS // too much dollars
       {
        setvar atm_amount_all 0
        setvar atm_serrortimer 26
        setvar atm_serrortype 2
        state randomatmbeeps sound MENU_ERROR
       }
       else
       {
        ifvarvarg atm_amount_cents TEMPCENTS // too much cents
        {
         ifvarg TEMPDOLLARS 0
         {
          subvarvar TEMPCENTS atm_amount_cents
          ifvarl TEMPCENTS 0
          {
           ifvarg TEMPDOLLARS 0
           {
            addvar TEMPCENTS 100
            subvar TEMPDOLLARS 1
            subvarvar TEMPDOLLARS atm_amount_dollars
            ifvarg TEMPDOLLARS -1 state cmd_withdrawmoney2
            else
            {
             setvar atm_amount_all 0
             setvar atm_serrortimer 26
             setvar atm_serrortype 2
             state randomatmbeeps sound MENU_ERROR
            }
           }
          }
          else state cmd_withdrawmoney2
         }
         else
         {
          setvar atm_amount_all 0
          setvar atm_serrortimer 26
          setvar atm_serrortype 2
          state randomatmbeeps sound MENU_ERROR
         }
        }
        else state cmd_withdrawmoney2
       }
      }
//************************
//*End Withdraw Code Here*
//************************
     }
     setvar atm_button1timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 5 // Deposit Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
//**************************
//*Insert Deposit Code Here*
//**************************
      ifvare atm_amount_all 0 // if any amount isn't entered
      {
       setvar atm_amount_all 0
       setvar atm_serrortimer 26
       setvar atm_serrortype 1
       state randomatmbeeps sound MENU_ERROR
      }
      else // if any amount IS entered
      {
       setvarvar TEMPDOLLARS DOLLARS
       ifvarvarg atm_amount_dollars TEMPDOLLARS // too much dollars
       {
        setvar atm_amount_all 0
        setvar atm_serrortimer 26
        setvar atm_serrortype 2
        state randomatmbeeps sound MENU_ERROR
       }
       else
       {
        setvarvar TEMPCENTS CENTS
        ifvarvarg atm_amount_cents TEMPCENTS // too much cents
        {
         ifvarg TEMPDOLLARS 0
         {
          setvarvar TEMPCENTS CENTS
          subvarvar TEMPCENTS atm_amount_cents
          ifvarl TEMPCENTS 0
          {
           setvarvar TEMPDOLLARS DOLLARS
           ifvarg TEMPDOLLARS 0
           {
            addvar TEMPCENTS 100
            subvar TEMPDOLLARS 1
            subvarvar TEMPDOLLARS atm_amount_dollars
            ifvarg TEMPDOLLARS -1 state cmd_depositmoney2
            else
            {
             setvar atm_amount_all 0
             setvar atm_serrortimer 26
             setvar atm_serrortype 2
             state randomatmbeeps sound MENU_ERROR
            }
           }
          }
          else state cmd_depositmoney2
         }
         else
         {
          setvar atm_amount_all 0
          setvar atm_serrortimer 26
          setvar atm_serrortype 2
          state randomatmbeeps sound MENU_ERROR
         }
        }
        else state cmd_depositmoney2
       }
      }
//***********************
//*End Deposit Code Here*
//***********************
     }
     setvar atm_button1timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 6 // "Transaction Finished" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      setvar atm_mode 3
      setvar atm_action 0 
      setvar atm_amount_all 0
      setvar atm_wacctnum 0
      setvar atm_errortype 0
      setvar atm_serrortimer 0
      setvar atm_serrortype 0
      state randomatmbeeps
     }
     setvar atm_button1timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 7 // "Wire Amount" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
//*****************************
//*Insert Wire Funds Code Here*
//*****************************
      ifvare atm_amount_all 0 // if any amount isn't entered
      {
       setvar atm_amount_all 0
       setvar atm_serrortimer 26
       setvar atm_serrortype 1
       state randomatmbeeps sound MENU_ERROR
      }
      else // if any amount IS entered
      {
       state getatmacctvalues

       ifvarvarg atm_amount_dollars TEMPDOLLARS // too much dollars
       {
        setvar atm_amount_all 0
        setvar atm_serrortimer 26
        setvar atm_serrortype 2
        state randomatmbeeps sound MENU_ERROR
       }
       else
       {
        ifvarvarg atm_amount_cents TEMPCENTS // too much cents
        {
         ifvarg TEMPDOLLARS 0
         {
          subvarvar TEMPCENTS atm_amount_cents
          ifvarl TEMPCENTS 0
          {
           ifvarg TEMPDOLLARS 0
           {
            addvar TEMPCENTS 100
            subvar TEMPDOLLARS 1
            subvarvar TEMPDOLLARS atm_amount_dollars
            ifvarg TEMPDOLLARS -1
            {
             setvar atm_mode 8
             setvar atm_wacctnum 0
             setvar atm_errortype 0
             setvar atm_serrortimer 0
             setvar atm_serrortype 0
             state randomatmbeeps
            }
            else
            {
             setvar atm_amount_all 0
             setvar atm_serrortimer 26
             setvar atm_serrortype 2
             state randomatmbeeps sound MENU_ERROR
            }
           }
          }
          else
          {
           setvar atm_mode 8
           setvar atm_wacctnum 0
           setvar atm_errortype 0
           setvar atm_serrortimer 0
           setvar atm_serrortype 0
           state randomatmbeeps
          }
         }
         else
         {
          setvar atm_amount_all 0
          setvar atm_serrortimer 26
          setvar atm_serrortype 2
          state randomatmbeeps sound MENU_ERROR
         }
        }
        else
        {       
         setvar atm_mode 8
         setvar atm_wacctnum 0
         setvar atm_errortype 0
         setvar atm_serrortimer 0
         setvar atm_serrortype 0
         state randomatmbeeps
        }      
       }
      }
//**************************
//*End Wire Funds Code Here*
//**************************
     }
     setvar atm_button1timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 8 // "Wire To" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
//*****************************
//*Insert Wire Funds Code Here*
//*****************************
      ifvarvare atm_wacctnum atm_acctnum // Wiring money to yourself is pointless :P
      {
       setvar atm_wacctnum 0
       setvar atm_errortype 0
       setvar atm_serrortimer 26
       setvar atm_serrortype 1
       state randomatmbeeps sound MENU_ERROR
      }
      else
      {
       // Sending Accounts
       ifvare atm_acctnum 132995 // Duke
       {
        setvar CHARACTERARRAY 1
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 164702 // Jack
       {
        setvar CHARACTERARRAY 2
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 171792 // Bubsy
       {
        setvar CHARACTERARRAY 3
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 789152 // Ami
       {
        setvar CHARACTERARRAY 4
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 171396 // Higa
       {
        setvar CHARACTERARRAY 5
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 218479 // ESSence
       {
        setvar CHARACTERARRAY 6
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 195382 // Ted
       {
        setvar CHARACTERARRAY 7
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 475394 // Lisa
       {
        setvar CHARACTERARRAY 8
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 363851 // Cybanis
       {
        setvar CHARACTERARRAY 9
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 963246 // Christina/Nethra
       {
        setvar CHARACTERARRAY 10
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 180194 // Paula
       {
        setvar CHARACTERARRAY 11
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 638192 // Lori
       {
        setvar CHARACTERARRAY 12
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 512560 // Minako
       {
        setvar CHARACTERARRAY 13
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 198255 // "Mystery Lady"
       {
        setvar CHARACTERARRAY 14
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 918372 // Maken
       {
        setvar CHARACTERARRAY 15
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 132092 // President Clinton (NPC)
       {
        setvar CHARACTERARRAY 257
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 890143 // Vice-President Gore (NPC)
       {
        setvar CHARACTERARRAY 258
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 122994 // Joe Siegler [3DR]
       {
        setvar CHARACTERARRAY 265
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 10345 // John R. Blade [?]
       {
        setvar CHARACTERARRAY 279
        state cmd_wiremoney_sender
       }
       else
       ifvare atm_acctnum 10333 // Elexis Sinclaire [Cameo]
       {
        setvar CHARACTERARRAY 280
        state cmd_wiremoney_sender
       }

       // Receiving Accounts
       ifvare atm_wacctnum 132995 // Duke
       {
        setvar CHARACTERARRAY 1
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 164702 // Jack
       {
        setvar CHARACTERARRAY 2
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 171792 // Bubsy
       {
        setvar CHARACTERARRAY 3
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 789152 // Ami
       {
        setvar CHARACTERARRAY 4
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 171396 // Higa
       {
        setvar CHARACTERARRAY 5
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 218479 // ESSence
       {
        setvar CHARACTERARRAY 6
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 195382 // Ted
       {
        setvar CHARACTERARRAY 7
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 475394 // Lisa
       {
        setvar CHARACTERARRAY 8
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 363851 // Cybanis
       {
        setvar CHARACTERARRAY 9
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 963246 // Christina/Nethra
       {
        setvar CHARACTERARRAY 10
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 180194 // Paula
       {
        setvar CHARACTERARRAY 11
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 638192 // Lori
       {
        setvar CHARACTERARRAY 12
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 512560 // Minako
       {
        setvar CHARACTERARRAY 13
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 198255 // "Mystery Lady"
       {
        setvar CHARACTERARRAY 14
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 918372 // Maken
       {
        setvar CHARACTERARRAY 15
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 132092 // President Clinton (NPC)
       {
        setvar CHARACTERARRAY 257
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 890143 // Vice-President Gore (NPC)
       {
        setvar CHARACTERARRAY 258
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 122994 // Joe Siegler [3DR]
       {
        setvar CHARACTERARRAY 265
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 10345 // John R. Blade [?]
       {
        setvar CHARACTERARRAY 279
        state cmd_wiremoney_receiver
       }
       else
       ifvare atm_wacctnum 10333 // Elexis Sinclaire [Cameo]
       {
        setvar CHARACTERARRAY 280
        state cmd_wiremoney_receiver
       }

       setvar atm_mode 6
       setvar atm_errortype 0
       state randomatmbeeps
      }
//**************************
//*End Wire Funds Code Here*
//**************************
     }
     setvar atm_button1timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 9 // "ERROR" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      setvar atm_mode 1
      setvar atm_amount_all 0
      setvar atm_wacctnum 0
      setvar atm_errortype 0
      setvar atm_action 0 
      setvar atm_serrortimer 0
      setvar atm_serrortype 0
      state randomatmbeeps
     }
     setvar atm_button1timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
ends

state atm-midupperleftbutton
ifvare atm_mode 0 // Welcome Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvarvar mpresstime temp
     setvar atm_button2timer 13
     state setreturn-1
    }
    else
    ifvare atm_mode 1 // Enter Acct#
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button2timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 2 // Enter PIN#
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button2timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 3 // Options Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button2timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 4 // Withdraw Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button2timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 5 // Deposit Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button2timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 6 // "Take Cash" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button2timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 7 // Wire Amount Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button2timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 8 // Wire To Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button2timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 9 // "ERROR" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button2timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
ends

state atm-midlowerleftbutton
ifvare atm_mode 0 // Welcome Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button3timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 1 // Enter Acct#
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button3timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 2 // Enter PIN#
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button3timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 3 // Options Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button3timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 4 // Withdraw Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button3timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 5 // Deposit Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      sound MENU_ERROR
     }
     setvar atm_button3timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 6 // "Take Cash" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button3timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 7 // Wire Amount Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button3timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 8 // Wire To Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button3timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 9 // "ERROR" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button3timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
ends

state atm-lowerleftbutton
ifvare atm_mode 0 // Welcome Screen
          {
           state getpartime
           addvar mpresstime 1
           ifvarvare temp mpresstime nullop else
           {
            state randomatmbeeps sound MENU_ERROR
           }
           setvar atm_button4timer 13
           setvarvar mpresstime temp
           state setreturn-1
          }
          else
          ifvare atm_mode 1 // Enter Acct#
          {
           state getpartime
           addvar mpresstime 1
           ifvarvare temp mpresstime nullop else
           {
            state randomatmbeeps sound MENU_ERROR
           }
           setvar atm_button4timer 13
           setvarvar mpresstime temp
           state setreturn-1
          }
          else
          ifvare atm_mode 2 // Enter PIN#
          {
           state getpartime
           addvar mpresstime 1
           ifvarvare temp mpresstime nullop else
           {
            state randomatmbeeps sound MENU_ERROR
           }
           setvar atm_button4timer 13
           setvarvar mpresstime temp
           state setreturn-1
          }
          else
          ifvare atm_mode 3 // Options Screen
          {
           state getpartime
           addvar mpresstime 1
           ifvarvare temp mpresstime nullop else
           {
            state getatmacctvalues
            ifvarg TEMPDOLLARS 0
            {
             setvar atm_mode 7
             setvar atm_action 2
             setvar atm_amount_all 0
             setvar atm_errortype 0
             setvar atm_serrortimer 0
             setvar atm_serrortype 0
             state randomatmbeeps
            }
            else
            {
             ifvarg TEMPCENTS 0
             {
              setvar atm_mode 7
              setvar atm_action 2
              setvar atm_amount_all 0
              setvar atm_errortype 0
              setvar atm_serrortimer 0
              setvar atm_serrortype 0
              state randomatmbeeps
             }
             else
             {
              setvar atm_errortype 0
              setvar atm_serrortimer 26
              setvar atm_serrortype 3
              state randomatmbeeps sound MENU_ERROR
             }
            }
           }
           setvar atm_button4timer 13
           setvarvar mpresstime temp
           state setreturn-1
          }
          else
          ifvare atm_mode 4 // Withdraw Screen
          {
           state getpartime
           addvar mpresstime 1
           ifvarvare temp mpresstime nullop else
           {
            state randomatmbeeps sound MENU_ERROR
           }
           setvar atm_button4timer 13
           setvarvar mpresstime temp
           state setreturn-1
          }
          else
          ifvare atm_mode 5 // Deposit Screen
          {
           state getpartime
           addvar mpresstime 1
           ifvarvare temp mpresstime nullop else
           {
            state randomatmbeeps sound MENU_ERROR
           }
           setvar atm_button4timer 13
           setvarvar mpresstime temp
           state setreturn-1
          }
          else
          ifvare atm_mode 6 // "Take Cash" Screen
          {
           state getpartime
           addvar mpresstime 1
           ifvarvare temp mpresstime nullop else
           {
            state randomatmbeeps sound MENU_ERROR
           }
           setvar atm_button4timer 13
           setvarvar mpresstime temp
           state setreturn-1
          }
          else
          ifvare atm_mode 7 // Wire Amount Screen
          {
           state getpartime
           addvar mpresstime 1
           ifvarvare temp mpresstime nullop else
           {
            state randomatmbeeps sound MENU_ERROR
           }
           setvar atm_button4timer 13
           setvarvar mpresstime temp
           state setreturn-1
          }
          else
          ifvare atm_mode 8 // Wire To Screen
          {
           state getpartime
           addvar mpresstime 1
           ifvarvare temp mpresstime nullop else
           {
            state randomatmbeeps sound MENU_ERROR
           }
           setvar atm_button4timer 13
           setvarvar mpresstime temp
           state setreturn-1
          }
          else
          ifvare atm_mode 9 // "ERROR" Screen
          {
           state getpartime
           addvar mpresstime 1
           ifvarvare temp mpresstime nullop else
           {
            state randomatmbeeps sound MENU_ERROR
           }
           setvar atm_button4timer 13
           setvarvar mpresstime temp
           state setreturn-1
          }
ends

state atm-upperrightbutton
ifvare atm_mode 0 // Welcome Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      setvar atm_errortype 0
      setvar atm_serrortimer 0
      setvar atm_serrortype 0
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button5timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 1 // Enter Acct#
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      setvar atm_serrortimer 0
      setvar atm_serrortype 0
      setvar atm_errortype 0
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button5timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 2 // Enter PIN#
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      setvar atm_serrortimer 0
      setvar atm_serrortype 0
      setvar atm_errortype 0
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button5timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 3 // Options Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      ifvarg DOLLARS 0
      {
       setvar atm_mode 5
       setvar atm_action 1
       setvar atm_amount_all 0
       setvar atm_errortype 0
       setvar atm_serrortimer 0
       setvar atm_serrortype 0
       state randomatmbeeps
      }
      else
      {
       ifvarg CENTS 0
       {
        setvar atm_mode 5
        setvar atm_action 1
        setvar atm_amount_all 0
        setvar atm_errortype 0
        setvar atm_serrortimer 0
        setvar atm_serrortype 0
        state randomatmbeeps
       }
       else
       {
        setvar atm_errortype 0
        setvar atm_serrortimer 26
        setvar atm_serrortype 2
        state randomatmbeeps sound MENU_ERROR
       }
      }
     }
     setvar atm_button5timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 4 // Withdraw Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      setvar atm_serrortimer 0
      setvar atm_serrortype 0
      setvar atm_errortype 0
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button5timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 5 // Deposit Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      setvar atm_serrortimer 0
      setvar atm_serrortype 0
      setvar atm_errortype 0
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button5timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 6 // "Take Cash" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      setvar atm_serrortimer 0
      setvar atm_serrortype 0
      setvar atm_errortype 0
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button5timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 7 // "Wire Amount" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      setvar atm_serrortimer 0
      setvar atm_serrortype 0
      setvar atm_errortype 0
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button5timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 8 // "Wire To" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      setvar atm_serrortimer 0
      setvar atm_serrortype 0
      setvar atm_errortype 0
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button5timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 9 // "ERROR" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      setvar atm_errortype 0
      setvar atm_amount_all 0
      setvar atm_mode 0
      setvar atm_action 0
      setvar atm_serrortimer 0
      setvar atm_serrortype 0
      state randomatmbeeps
     }
     setvar atm_button5timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
ends

state atm-midupperrightbutton
    ifvare atm_mode 0 // Welcome Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button6timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 1 // Enter Acct#
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button6timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 2 // Enter PIN#
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button6timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 3 // Options Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button6timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 4 // Withdraw Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button6timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 5 // Deposit Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button6timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 6 // "Take Cash" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button6timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 7 // Wire Amount Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button6timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 8 // Wire To Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button6timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 9 // "ERROR" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button6timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
ends

state atm-midlowerrightbutton
ifvare atm_mode 0 // Welcome Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button7timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 1 // Enter Acct#
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button7timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 2 // Enter PIN#
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button7timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 3 // Options Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button7timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 4 // Withdraw Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button7timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 5 // Deposit Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button7timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 6 // "Take Cash" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button7timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 7 // Wire Amount Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button7timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 8 // Wire To Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button7timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
    else
    ifvare atm_mode 9 // "ERROR" Screen
    {
     state getpartime
     addvar mpresstime 1
     ifvarvare temp mpresstime nullop else
     {
      state randomatmbeeps sound MENU_ERROR
     }
     setvar atm_button7timer 13
     setvarvar mpresstime temp
     state setreturn-1
    }
ends

state atm-lowerrightbutton
ifvare atm_mode 0 // Welcome Screen
        {
         state getpartime
         addvar mpresstime 1
         ifvarvare temp mpresstime nullop else
         {
          setvar atm_id -1 
          setvar atm_type 0
          setvar atm_mode 0
          setvar atm_action 0 
          setvar atm_acctnum 0
          setvar atm_pinnum 0
          setvar atm_amount_all 0
          setvar atm_errortype 0
          setvar atm_serrortimer 0
          setvar atm_serrortype 0
          state randomatmbeeps sound MENU_EXIT 
         }
         setvar atm_button8timer 13
         setvarvar mpresstime temp
         state setreturn-1
        }
        else
        ifvare atm_mode 1 // Enter Acct#
        {
         state getpartime
         addvar mpresstime 1
         ifvarvare temp mpresstime nullop else
         {
          setvar atm_mode 0
          setvar atm_action 0 
          setvar atm_acctnum 0
          setvar atm_pinnum 0
          setvar atm_amount_all 0
          setvar atm_errortype 0
          setvar atm_serrortimer 0
          setvar atm_serrortype 0
          state randomatmbeeps
         }
         setvar atm_button8timer 13
         setvarvar mpresstime temp
         state setreturn-1
        }
        else
        ifvare atm_mode 2 // Enter PIN#
        {
         state getpartime
         addvar mpresstime 1
         ifvarvare temp mpresstime nullop else
         {
          setvar atm_mode 0
          setvar atm_action 0 
          setvar atm_acctnum 0
          setvar atm_pinnum 0
          setvar atm_amount_all 0
          setvar atm_errortype 0
          setvar atm_serrortimer 0
          setvar atm_serrortype 0
          state randomatmbeeps
         }
         setvar atm_button8timer 13
         setvarvar mpresstime temp
         state setreturn-1
        }
        else
        ifvare atm_mode 3 // Options Screen
        {
         state getpartime
         addvar mpresstime 1
         ifvarvare temp mpresstime nullop else
         {
          setvar atm_mode 0
          setvar atm_action 0 
          setvar atm_acctnum 0
          setvar atm_pinnum 0
          setvar atm_amount_all 0
          setvar atm_errortype 0
          setvar atm_serrortimer 0
          setvar atm_serrortype 0
          state randomatmbeeps
         }
         setvar atm_button8timer 13
         setvarvar mpresstime temp
         state setreturn-1
        }
        else
        ifvare atm_mode 4 // Withdraw Screen
        {
         state getpartime
         addvar mpresstime 1
         ifvarvare temp mpresstime nullop else
         {
          setvar atm_mode 0
          setvar atm_action 0 
          setvar atm_acctnum 0
          setvar atm_pinnum 0
          setvar atm_amount_all 0
          setvar atm_errortype 0
          setvar atm_serrortimer 0
          setvar atm_serrortype 0
          state randomatmbeeps
         }
         setvar atm_button8timer 13
         setvarvar mpresstime temp
         state setreturn-1
        }
        else
        ifvare atm_mode 5 // Deposit Screen
        {
         state getpartime
         addvar mpresstime 1
         ifvarvare temp mpresstime nullop else
         {
          setvar atm_mode 0
          setvar atm_action 0 
          setvar atm_acctnum 0
          setvar atm_pinnum 0
          setvar atm_amount_all 0
          setvar atm_errortype 0
          setvar atm_serrortimer 0
          setvar atm_serrortype 0
          state randomatmbeeps
         }
         setvar atm_button8timer 13
         setvarvar mpresstime temp
         state setreturn-1
        }
        else
        ifvare atm_mode 6 // "Take Cash" Screen
        {
         state getpartime
         addvar mpresstime 1
         ifvarvare temp mpresstime nullop else
         {
          setvar atm_id -1 
          setvar atm_type 0
          setvar atm_mode 0
          setvar atm_action 0 
          setvar atm_acctnum 0
          setvar atm_pinnum 0
          setvar atm_amount_all 0
          setvar atm_errortype 0
          setvar atm_serrortimer 0
          setvar atm_serrortype 0
          state randomatmbeeps sound MENU_EXIT 
         }
         setvar atm_button8timer 13
         setvarvar mpresstime temp
         state setreturn-1
        }
        else
        ifvare atm_mode 7 // "Wire To" Screen
        {
         state getpartime
         addvar mpresstime 1
         ifvarvare temp mpresstime nullop else
         {
          setvar atm_mode 0
          setvar atm_action 0 
          setvar atm_acctnum 0
          setvar atm_pinnum 0
          setvar atm_amount_all 0
          setvar atm_errortype 0
          setvar atm_serrortimer 0
          setvar atm_serrortype 0
          state randomatmbeeps sound MENU_EXIT 
         }
         setvar atm_button8timer 13
         setvarvar mpresstime temp
         state setreturn-1
        }
        else
        ifvare atm_mode 8 // "Wire Amount" Screen
        {
         state getpartime
         addvar mpresstime 1
         ifvarvare temp mpresstime nullop else
         {
          setvar atm_mode 0
          setvar atm_action 0 
          setvar atm_acctnum 0
          setvar atm_pinnum 0
          setvar atm_amount_all 0
          setvar atm_errortype 0
          setvar atm_serrortimer 0
          setvar atm_serrortype 0
          state randomatmbeeps sound MENU_EXIT 
         }
         setvar atm_button8timer 13
         setvarvar mpresstime temp
         state setreturn-1
        }
        else
        ifvare atm_mode 9 // "ERROR" Screen
        {
         state getpartime
         addvar mpresstime 1
         ifvarvare temp mpresstime nullop else
         {
          setvar atm_id -1
          setvar atm_type 0
          setvar atm_mode 0
          setvar atm_action 0 
          setvar atm_acctnum 0
          setvar atm_pinnum 0
          setvar atm_amount_all 0
          setvar atm_errortype 0
          setvar atm_serrortimer 0
          setvar atm_serrortype 0
          state randomatmbeeps sound MENU_EXIT 
         }
         setvar atm_button8timer 13
         setvarvar mpresstime temp
         state setreturn-1
        }
ends

state atm-backspacekey
ifvare atm_mode 1 // Account Number
         {
          ifvare atm_acctnum 0 // If you hit backspace when the code is 0, you cancel out of the ACCT#
          {
           setvar atm_mode 0
           setvar atm_action 0
          }
          else
          ifvarg atm_acctnum 0 // Else if it's above 0, you divide by 10 to emulate a backspace key
          {
           divvar atm_acctnum 10
           ifvarl atm_acctnum 0 setvar atm_acctnum 0
          }
          state randomatmbeeps
          state setreturn-1
         }
         else
         ifvare atm_mode 2 // PIN#
         {
          ifvare atm_pinnum 0 // If you hit backspace when the code is 0, you cancel out of the PIN#
          {
           setvar atm_mode 1
           setvar atm_action 0
          }
          else
          ifvarg atm_pinnum 0 // Else if it's above 0, you divide by 10 to emulate a backspace key
          {
           divvar atm_pinnum 10
           ifvarl atm_pinnum 0 setvar atm_pinnum 0
          }
          state randomatmbeeps
          state setreturn-1
         }
         else
         ifvare atm_mode 4 // Withdraw
         {
          ifvarg atm_amount_all 0 // divide by 10 to emulate a backspace key
          {
           divvar atm_amount_all 10
           ifvarl atm_amount_all 0 setvar atm_amount_all 0
          }
          state randomatmbeeps
          state setreturn-1
         }
         else
         ifvare atm_mode 5 // Deposit
         {
          ifvarg atm_amount_all 0 // divide by 10 to emulate a backspace key
          {
           divvar atm_amount_all 10
           ifvarl atm_amount_all 0 setvar atm_amount_all 0
          }
          state randomatmbeeps
          state setreturn-1
         }
         else
         ifvare atm_mode 7 // Wire Funds
         {
          ifvarg atm_amount_all 0 // divide by 10 to emulate a backspace key
          {
           divvar atm_amount_all 10
           ifvarl atm_amount_all 0 setvar atm_amount_all 0
          }
          state randomatmbeeps
          state setreturn-1
         }
         else
         ifvare atm_mode 8 // Wire To
         {
          ifvarg atm_wacctnum 0 // divide by 10 to emulate a backspace key
          {
           divvar atm_wacctnum 10
           ifvarl atm_wacctnum 0 setvar atm_wacctnum 0
          }
          state randomatmbeeps
          state setreturn-1
         }
ends

//******************
//***END ATM CODE***
//******************

