onevent EVENT_DISPLAYREST
 setuserdef[THISACTOR].screen_size 3

								      getuserdef[THISACTOR].pause_on temp
								      ifvarg temp 0 { ifvarn gameover? 0 { setvar temp 0 setuserdef[THISACTOR].pause_on 0 } }
								      ifvarg temp 0
								      {
                                                             ifvare oldskoolmode 0
                                                             {
									 ifvare temp 1
									 {
									  setuserdef[THISACTOR].pause_on 2 // Removes the Old "GAME PAUSED"
									  displayrandvar pausequote 4
									 }

                                                              state vehicledisplays

									 // Dim the Foreground
									 setvar digx 0
									 setvar digy 0
									 state digz65536
									 setvar tilenum 7801
									 state pal4
									 state orientation27
									 state rs

									 // "Paused" Text
									 state digx320
									 setvar digy 8
									 setvar textscale 65536
									 setvar tilenum 2908 // 2934

									 state pal0

									 state orientation26
									 redefinequote 332 GAME PAUSED
									 state setquote332
									 state gtz

									 // Show a random pause-quote dependant on the character currently selected
									 state dialouge-pausedgame


                                                              // Show Game-Totals
                                                              state settilealphanum
                                                              state pal16
                                                              state orientation27
                                                              setvar textscale 49152

                                                              setvar digx 70
                                                              state pal13
                                                              setvar digy 128
									 redefinequote 332 CURRENT LEVEL TIME
									 state setquote332
									 state gtz

                                                              setvar digx 322
                                                              setvar digy 128
									 state gettruetimedisplayspaused_level // redefinequote 332 00WEEKS 00DAYS 00:00:00.00
									 state setquote332
									 state gtz

                                                              setvar digx 70
                                                              state pal20
                                                              setvar digy 135
									 redefinequote 332 TOTAL GAME TIME
									 state setquote332
									 state gtz

                                                              setvar digx 322
                                                              setvar digy 135
									 state gettruetimedisplayspaused_game
									 state setquote332
									 state gtz

                                                              setvar digx 70
                                                              state pal23
                                                              setvar digy 146
									 redefinequote 332 CHARACTER'S KILLS
									 state setquote332
									 state gtz

                                                              setvar digx 455
                                                              state pal23
                                                              setvar digy 146
                                                              setvarvar CHARACTERARRAY CHARACTERSELECTED?
                                                              getactorvar[CHARACTERARRAY].CHARACTERENEMIESKILLED TEMPVAR
                                                              setvarvar TEMPVAR4 TEMPVAR
                                                              ifvarn ENEMIES_KILLED_GAME 0
                                                              {
									  mulvar TEMPVAR4 10000
									  divvarvar TEMPVAR4 ENEMIES_KILLED_GAME
									  setvarvar TEMPVAR2 TEMPVAR4
									  divvar TEMPVAR2 100
									  setvarvar TEMPVAR3 TEMPVAR4
									  modvar TEMPVAR3 100
									  ifvarg TEMPVAR3 -1 ifvarl TEMPVAR3 10 redefinequote 332 [%ld.0%ld% KILLS]
									  else redefinequote 332 [%ld.%ld% KILLS]
									  qsprintf 332 332 TEMPVAR2 TEMPVAR3
                                                              }
                                                              else redefinequote 332 [N/A]
									 state setquote332
									 state gtz

                                                              setvar digx 70
                                                              state pal16
                                                              setvar digy 153
									 redefinequote 332 TOTAL ENEMIES KILLED
									 state setquote332
									 state gtz
                                                              state pal22
                                                              setvar digy 160
									 redefinequote 332 TOTAL SECRETS FOUND
									 state setquote332
									 state gtz
                                                              state pal20
                                                              setvar digy 167
									 redefinequote 332 TOTAL MEMORBILIA FOUND
									 state setquote332
									 state gtz
                                                              state pal15
                                                              setvar digy 174
									 redefinequote 332 TOTAL CIVILIANS SAVED
									 state setquote332
									 state gtz
                                                              state pal10
                                                              setvar digy 181
									 redefinequote 332 TOTAL CIVILIANS KILLED
									 state setquote332
									 state gtz

                                                              state settile2837
                                                              state orientation27
                                                              setvar textscale 49152
                                                              setvar digx 190

                                                              state pal23
                                                              setvar digy 146
                                                              setvarvar CHARACTERARRAY CHARACTERSELECTED?
                                                              getactorvar[CHARACTERARRAY].CHARACTERENEMIESKILLED TEMPVAR
                                                              setvarvar varname TEMPVAR
                                                              state dnz

                                                              state pal16
                                                              setvar digy 153
                                                              setvarvar varname ENEMIES_KILLED_GAME
                                                              state dnz
                                                              state pal22
                                                              setvar digy 160
                                                              setvarvar varname SECRETSFOUND_GAME
                                                              state dnz
                                                              state pal20
                                                              setvar digy 167
                                                              setvarvar varname RANKITEMSFOUND_GAME
                                                              state dnz
                                                              state pal15
                                                              setvar digy 174
                                                              setvarvar varname CIVILIANSSAVED_GAME
                                                              state dnz
                                                              state pal10
                                                              setvar digy 181
                                                              setvarvar varname CIVILIANSKILLED_GAME
                                                              state dnz

                                                              state settilealphanum
                                                              state orientation27
                                                              setvar textscale 49152
                                                              setvar digx 455

                                                              state pal16
                                                              setvar digy 153
									 redefinequote 332 /
									 state setquote332
									 state gtz
                                                              state pal22
                                                              setvar digy 160
									 redefinequote 332 /
									 state setquote332
									 state gtz
                                                              state pal20
                                                              setvar digy 167
									 redefinequote 332 /
									 state setquote332
									 state gtz
                                                              state pal15
                                                              setvar digy 174
									 redefinequote 332 /
									 state setquote332
									 state gtz
                                                              state pal10
                                                              setvar digy 181
									 redefinequote 332 /
									 state setquote332
									 state gtz

                                                              state settile2837
                                                              state orientation27
                                                              setvar textscale 49152
                                                              state settile2837
                                                              state orientation27
                                                              setvar textscale 49152
                                                              setvar digx 270

                                                              state pal16
                                                              setvar digy 153
                                                              setvarvar varname MAX_ENEMIES_KILLED_GAME
                                                              state dnz
                                                              state pal22
                                                              setvar digy 160
                                                              setvarvar varname MAX_SECRETSFOUND_GAME
                                                              state dnz
                                                              state pal20
                                                              setvar digy 167
                                                              setvarvar varname MAX_RANKITEMSFOUND_GAME
                                                              state dnz
                                                              state pal15
                                                              setvar digy 174
                                                              setvarvar varname MAX_CIVILIANSSAVED_GAME
                                                              state dnz
                                                              state pal10
                                                              setvar digy 181
                                                              setvarvar varname MAX_CIVILIANSKILLED_GAME
                                                              state dnz
                                                             }
								      }
								      else
								      {
									setvar pausequote -1
									setvar pausequotenew -1
									setvar pausetimer 0
                                                             setvar pauseinit 0
                                                             setvar pauseinit2 0

ifvarl gameover? 1 ifvarg TIMERRAWFORMAT 0
{ // ifvarl gameover? 1

 ifvarvarg TEMPHEALTH STATLIMIT setvarvar TEMPHEALTH STATLIMIT					// Prevents the HP from going over the absolute limit
 ifvarvarg TEMPARMOR STATLIMIT setvarvar TEMPARMOR STATLIMIT						// Prevents the Armor Max from going over the absolute limit
 ifvarvarg MAXHITPOINTS STATLIMIT setvarvar MAXHITPOINTS STATLIMIT					// Prevents the HP Max from going over the absolute limit
 ifvarvarg MAXARMORPOINTS STATLIMIT setvarvar MAXARMORPOINTS STATLIMIT				// Prevents the Armor Max from going over the absolute limit
 ifvarvarg MAXENERGYPOINTS STATLIMIT setvarvar MAXENERGYPOINTS STATLIMIT				// Prevents the Energy Max from going over the absolute limit
 setvarvar MAXHITPOINTSATOMIC MAXHITPOINTS
 mulvar MAXHITPOINTSATOMIC 2
 ifvarvarg MAXHITPOINTSATOMIC STATLIMITATOMIC setvarvar MAXHITPOINTSATOMIC STATLIMITATOMIC
 setvarvar MAXARMORPOINTSATOMIC MAXARMORPOINTS
 mulvar MAXARMORPOINTSATOMIC 2
 ifvarvarg MAXARMORPOINTSATOMIC STATLIMITATOMIC setvarvar MAXARMORPOINTSATOMIC STATLIMITATOMIC
 setvarvar MAXENERGYPOINTSATOMIC MAXENERGYPOINTS
 mulvar MAXENERGYPOINTSATOMIC 2
 ifvarvarg MAXENERGYPOINTSATOMIC STATLIMITATOMIC setvarvar MAXENERGYPOINTSATOMIC STATLIMITATOMIC

 setvarvar STATLIMITATOMIC STATLIMIT
 mulvar STATLIMITATOMIC 2
 setvarvar STATLIMITMAXIMUM STATLIMIT
 mulvar STATLIMITMAXIMUM 4


 ifvarl CURRENTHITPOINTS 0 setvar CURRENTHITPOINTS 0
 ifvarl CURRENTARMORPOINTS 0 setvar CURRENTARMORPOINTS 0
 ifvarl CURRENTENERGYPOINTS 0 setvar CURRENTENERGYPOINTS 0

 // getplayer[THISACTOR].falling_counter fallcounter

 {

  // **************************************
  // * Levels and EXP Requirements (Duke) *
  // **************************************

   ifvarl EXPPTS 80 // +80
   {
    setvar PLAYERLEVEL 1
    setvar EXPTONEXT 80
   }
   else
   ifvarl EXPPTS 200 // +120 (40)
   {
    setvar PLAYERLEVEL 2
    setvar EXPTONEXT 200
   }
   else
   ifvarl EXPPTS 360 // +160 (40)
   {
    setvar PLAYERLEVEL 3
    setvar EXPTONEXT 360
   }
   else
   ifvarl EXPPTS 560 // +200 (40)
   {
    setvar PLAYERLEVEL 4
    setvar EXPTONEXT 560
   }
   else
   ifvarl EXPPTS 800 // +240 (40)
   {
    setvar PLAYERLEVEL 5
    setvar EXPTONEXT 800
   }
   else
   ifvarl EXPPTS 1080 // +280 (40)
   {
    setvar PLAYERLEVEL 6
    setvar EXPTONEXT 1080
   }
   else
    ifvarl EXPPTS 1400 // +320 (40)
   {
    setvar PLAYERLEVEL 7
    setvar EXPTONEXT 1400
   }
   else
    ifvarl EXPPTS 1760 // +360 (40)
   {
    setvar PLAYERLEVEL 8
    setvar EXPTONEXT 1760
   }
   else
    ifvarl EXPPTS 2160 // +400 (40)
   {
    setvar PLAYERLEVEL 9
    setvar EXPTONEXT 2160
   }
   else
    ifvarl EXPPTS 2600 // +440 (40)
   {
    setvar PLAYERLEVEL 10
    setvar EXPTONEXT 2600
   }
   else
    ifvarl EXPPTS 3080 // +480 (40)
   {
    setvar PLAYERLEVEL 11
    setvar EXPTONEXT 3080
   }
   else
    ifvarl EXPPTS 3600 // +520 (40)
   {
    setvar PLAYERLEVEL 12
    setvar EXPTONEXT 3600
   }
   else
    ifvarl EXPPTS 4160 // +560 (40)
   {
    setvar PLAYERLEVEL 13
    setvar EXPTONEXT 4160
   }
   else
    ifvarl EXPPTS 4760 // +600 (40)
   {
    setvar PLAYERLEVEL 14
    setvar EXPTONEXT 4760
   }
   else
    ifvarl EXPPTS 5200 // +640 (40)
   {
    setvar PLAYERLEVEL 15
    setvar EXPTONEXT 5200
   }
   else
    ifvarl EXPPTS 5880 // +680 (40)
   {
    setvar PLAYERLEVEL 16
    setvar EXPTONEXT 5880
   }
   else
    ifvarl EXPPTS 6600 // +720 (40)
   {
    setvar PLAYERLEVEL 17
    setvar EXPTONEXT 6600
   }
   else
    ifvarl EXPPTS 7360 // +760 (40)
   {
    setvar PLAYERLEVEL 18
    setvar EXPTONEXT 7360
   }
   else
    ifvarl EXPPTS 8160 // +800 (40)
   {
    setvar PLAYERLEVEL 19
    setvar EXPTONEXT 8160
   }
   else
    ifvarl EXPPTS 9000 // +840 (40)
   {
    setvar PLAYERLEVEL 20
    setvar EXPTONEXT 9000
   }
   else
    ifvarl EXPPTS 9880 // +880 (40)
   {
    setvar PLAYERLEVEL 21
    setvar EXPTONEXT 9880
   }
   else
    ifvarl EXPPTS 10800 // +920 (40)
   {
    setvar PLAYERLEVEL 22
    setvar EXPTONEXT 10800
   }
   else
    ifvarl EXPPTS 11760 // +960 (40)
   {
    setvar PLAYERLEVEL 23
    setvar EXPTONEXT 11760
   }
   else
    ifvarl EXPPTS 12760 // +1000 (40)
   {
    setvar PLAYERLEVEL 24
    setvar EXPTONEXT 12760
   }
   else
    ifvarl EXPPTS 13840 // +1080 (80)
   {
    setvar PLAYERLEVEL 25
    setvar EXPTONEXT 13840
   }
   else
    ifvarl EXPPTS 15000 // +1160 (80)
   {
    setvar PLAYERLEVEL 26
    setvar EXPTONEXT 15000
   }
   else
    ifvarl EXPPTS 16240 // +1240 (80)
   {
    setvar PLAYERLEVEL 27
    setvar EXPTONEXT 16240
   }
   else
    ifvarl EXPPTS 17560 // +1320 (80)
   {
    setvar PLAYERLEVEL 28
    setvar EXPTONEXT 17560
   }
   else
    ifvarl EXPPTS 18960 // +1400 (80)
   {
    setvar PLAYERLEVEL 29
    setvar EXPTONEXT 18960
   }
   else
    ifvarl EXPPTS 20440 // +1480 (80)
   {
    setvar PLAYERLEVEL 30
    setvar EXPTONEXT 20440
   }
   else
    ifvarl EXPPTS 22000 // +1560 (80)
   {
    setvar PLAYERLEVEL 31
    setvar EXPTONEXT 22000
   }
   else
    ifvarl EXPPTS 23640 // +1640 (80)
   {
    setvar PLAYERLEVEL 32
    setvar EXPTONEXT 23640
   }
   else
    ifvarl EXPPTS 25360 // +1720 (80)
   {
    setvar PLAYERLEVEL 33
    setvar EXPTONEXT 25360
   }
   else
    ifvarl EXPPTS 27160 // +1800 (80)
   {
    setvar PLAYERLEVEL 34
    setvar EXPTONEXT 27160
   }
   else
    ifvarl EXPPTS 29040 // +1880 (80)
   {
    setvar PLAYERLEVEL 35
    setvar EXPTONEXT 29040
   }
   else
    ifvarl EXPPTS 33120 // +4080 (160)
   {
    setvar PLAYERLEVEL 36
    setvar EXPTONEXT 33120
   }
   else
    ifvarl EXPPTS 35400 // +2280 (160)
   {
    setvar PLAYERLEVEL 37
    setvar EXPTONEXT 35400
   }
   else
    ifvarl EXPPTS 37740 // +2440 (160)
   {
    setvar PLAYERLEVEL 38
    setvar EXPTONEXT 37740
   }
   else
    ifvarl EXPPTS 40340 // +2600 (160)
   {
    setvar PLAYERLEVEL 39
    setvar EXPTONEXT 40340
   }
   else
    ifvarl EXPPTS 43100 // +2760 (160)
   {
    setvar PLAYERLEVEL 40
    setvar EXPTONEXT 43100
   }
   else
    ifvarl EXPPTS 45920 // +2920 (160)
   {
    setvar PLAYERLEVEL 41
    setvar EXPTONEXT 45900
   }
   else
    ifvarl EXPPTS 49160 // +3240 (320)
   {
    setvar PLAYERLEVEL 42
    setvar EXPTONEXT 49160
   }
   else
    ifvarl EXPPTS 52720 // +3560 (320)
   {
    setvar PLAYERLEVEL 43
    setvar EXPTONEXT 52760
   }
   else
    ifvarl EXPPTS 56600 // +3880 (320)
   {
    setvar PLAYERLEVEL 44
    setvar EXPTONEXT 56600
   }
   else
    ifvarl EXPPTS 61120 // +4520 (640)
   {
    setvar PLAYERLEVEL 45
    setvar EXPTONEXT 61120
   }
   else
    ifvarl EXPPTS 65280 // +5160 (640)
   {
    setvar PLAYERLEVEL 46
    setvar EXPTONEXT 65280
   }
   else
    ifvarl EXPPTS 71080 // +5800 (640)
   {
    setvar PLAYERLEVEL 47
    setvar EXPTONEXT 71080
   }
   else
    ifvarl EXPPTS 77440 // +6440 (640)
   {
    setvar PLAYERLEVEL 48
    setvar EXPTONEXT 77440
   }
   else
    ifvarl EXPPTS 84520 // +7080 (640)
   {
    setvar PLAYERLEVEL 49
    setvar EXPTONEXT 84520
   }
   else
    ifvarl EXPPTS 91240 // +7720 (640)
   {
    setvar PLAYERLEVEL 50
    setvar EXPTONEXT 91240
   }
   else
    ifvarl EXPPTS 99600 // +8360 (640)
   {
    setvar PLAYERLEVEL 51
    setvar EXPTONEXT 99600
   }
   else
    ifvarl EXPPTS 108600 // +9000 (640)
   {
    setvar PLAYERLEVEL 52
    setvar EXPTONEXT 108600
   }
   else
    ifvarl EXPPTS 118400 // +9800 (800)
   {
    setvar PLAYERLEVEL 53
    setvar EXPTONEXT 118400
   }
   else
    ifvarl EXPPTS 129000 // +10600 (800)
   {
    setvar PLAYERLEVEL 54
    setvar EXPTONEXT 129000
   }
   else
    ifvarl EXPPTS 140800 // +11800 (1200)
   {
    setvar PLAYERLEVEL 55
    setvar EXPTONEXT 140800
   }
   else
    ifvarl EXPPTS 154200 // +13400 (1600)
   {
    setvar PLAYERLEVEL 56
    setvar EXPTONEXT 154200
   }
   else
    ifvarl EXPPTS 209600 // +15400 (2000)
   {
    setvar PLAYERLEVEL 57
    setvar EXPTONEXT 209600
   }
   else
    ifvarl EXPPTS 227400 // +17800 (2400)
   {
    setvar PLAYERLEVEL 58
    setvar EXPTONEXT 227400
   }
   else
    ifvarl EXPPTS 248000 // +20600 (2800)
   {
    setvar PLAYERLEVEL 59
    setvar EXPTONEXT 248000
   }
   else
    ifvarl EXPPTS 271800 // +23800 (3200)
   {
    setvar PLAYERLEVEL 60
    setvar EXPTONEXT 271800
   }
   else
    ifvarl EXPPTS 299200 // +27400 (3600)
   {
    setvar PLAYERLEVEL 61
    setvar EXPTONEXT 299200
   }
   else
    ifvarl EXPPTS 320600 // +31400 (4000)
   {
    setvar PLAYERLEVEL 62
    setvar EXPTONEXT 320600
   }
   else
    ifvarl EXPPTS 356400 // +35800 (4400)
   {
    setvar PLAYERLEVEL 63
    setvar EXPTONEXT 356400
   }
   else
    ifvarl EXPPTS 397000 // +40600 (4800)
   {
    setvar PLAYERLEVEL 64
    setvar EXPTONEXT 397000
   }
   else
    ifvarl EXPPTS 442800 // +45800 (5200)
   {
    setvar PLAYERLEVEL 65
    setvar EXPTONEXT 442800
   }
   else
    ifvarl EXPPTS 494200 // +51400 (5600)
   {
    setvar PLAYERLEVEL 66
    setvar EXPTONEXT 494200
   }
   else
    ifvarl EXPPTS 551600 // +57400 (6000)
   {
    setvar PLAYERLEVEL 67
    setvar EXPTONEXT 551600
   }
   else
    ifvarl EXPPTS 615400 // +63800 (6400)
   {
    setvar PLAYERLEVEL 68
    setvar EXPTONEXT 615400
   }
   else
    ifvarl EXPPTS 676000 // +70600 (6800)
   {
    setvar PLAYERLEVEL 69
    setvar EXPTONEXT 676000
   }
   else
    ifvarl EXPPTS 753800 // +77800 (7200)
   {
    setvar PLAYERLEVEL 70
    setvar EXPTONEXT 753800
   }
   else
    ifvarl EXPPTS 839200 // +85400 (7600)
   {
    setvar PLAYERLEVEL 71
    setvar EXPTONEXT 839200
   }
   else
    ifvarl EXPPTS 932600 // +93400 (8000)
   {
    setvar PLAYERLEVEL 72
    setvar EXPTONEXT 932600
   }
   else
    ifvarl EXPPTS 1034400 // +101800 (8400)
   {
    setvar PLAYERLEVEL 73
    setvar EXPTONEXT 1034400
   }
   else
    ifvarl EXPPTS 1145000 // +110600 (8800)
   {
    setvar PLAYERLEVEL 74
    setvar EXPTONEXT 1145000
   }
   else
    ifvarl EXPPTS 1254800 // +119800 (9200)
   {
    setvar PLAYERLEVEL 75
    setvar EXPTONEXT 1254800
   }
   else
    ifvarl EXPPTS 1384200 // +129400 (9600)
   {
    setvar PLAYERLEVEL 76
    setvar EXPTONEXT 1384200
   }
   else
    ifvarl EXPPTS 1513600 // +139400 (10000)
   {
    setvar PLAYERLEVEL 77
    setvar EXPTONEXT 1513600
   }
   else
    ifvarl EXPPTS 1663600 // +150000 (10600)
   {
    setvar PLAYERLEVEL 78
    setvar EXPTONEXT 1663600
   }
   else
    ifvarl EXPPTS 1823600 // +160000 (10000)
   {
    setvar PLAYERLEVEL 79
    setvar EXPTONEXT 1823600
   }
   else
    ifvarl EXPPTS 1993600 // +170000 (10000)
   {
    setvar PLAYERLEVEL 80
    setvar EXPTONEXT 1993600
   }
   else
    ifvarl EXPPTS 2173600 // +180000 (10000)
   {
    setvar PLAYERLEVEL 81
    setvar EXPTONEXT 2173600
   }
   else
    ifvarl EXPPTS 2363600 // +190000 (10000)
   {
    setvar PLAYERLEVEL 82
    setvar EXPTONEXT 2363600
   }
   else
    ifvarl EXPPTS 2563600 // +200000 (10000)
   {
    setvar PLAYERLEVEL 83
    setvar EXPTONEXT 2563600
   }
   else
    ifvarl EXPPTS 2783600 // +220000 (20000)
   {
    setvar PLAYERLEVEL 84
    setvar EXPTONEXT 2783600
   }
   else
    ifvarl EXPPTS 3023600 // +240000 (20000)
   {
    setvar PLAYERLEVEL 85
    setvar EXPTONEXT 3023600
   }
   else
    ifvarl EXPPTS 3283600 // +260000 (20000)
   {
    setvar PLAYERLEVEL 86
    setvar EXPTONEXT 3283600
   }
   else
    ifvarl EXPPTS 3563600 // +280000 (20000)
   {
    setvar PLAYERLEVEL 87
    setvar EXPTONEXT 3563600
   }
   else
    ifvarl EXPPTS 3863600 // +300000 (20000)
   {
    setvar PLAYERLEVEL 88
    setvar EXPTONEXT 3863600
   }
   else
    ifvarl EXPPTS 4183600 // +320000 (20000)
   {
    setvar PLAYERLEVEL 89
    setvar EXPTONEXT 4183600
   }
   else
    ifvarl EXPPTS 4523600 // +340000 (20000)
   {
    setvar PLAYERLEVEL 90
    setvar EXPTONEXT 4523600
   }
   else
    ifvarl EXPPTS 4883600 // +360000 (20000)
   {
    setvar PLAYERLEVEL 91
    setvar EXPTONEXT 4883600
   }
   else
    ifvarl EXPPTS 5263600 // +380000 (20000)
   {
    setvar PLAYERLEVEL 92
    setvar EXPTONEXT 5263600
   }
   else
    ifvarl EXPPTS 5663600 // +400000 (20000)
   {
    setvar PLAYERLEVEL 93
    setvar EXPTONEXT 5663600
   }
   else
    ifvarl EXPPTS 6103600 // +440000 (40000)
   {
    setvar PLAYERLEVEL 94
    setvar EXPTONEXT 6103600
   }
   else
    ifvarl EXPPTS 6583600 // +480000 (40000)
   {
    setvar PLAYERLEVEL 95
    setvar EXPTONEXT 6583600
   }
   else
    ifvarl EXPPTS 7103600 // +520000 (40000)
   {
    setvar PLAYERLEVEL 96
    setvar EXPTONEXT 7103600
   }
   else
    ifvarl EXPPTS 7663600 // +560000 (40000)
   {
    setvar PLAYERLEVEL 97
    setvar EXPTONEXT 7663600
   }
   else
    ifvarl EXPPTS 8263600 // +600000 (40000)
   {
    setvar PLAYERLEVEL 98
    setvar EXPTONEXT 8263600
   }
   else
    ifvarl EXPPTS 9163600 // +900000 (300000)
   {
    setvar PLAYERLEVEL 99
    setvar EXPTONEXT 9163600
   }
   else
    ifvarg EXPPTS 9163599
   {
    setvar PLAYERLEVEL 100
    setvar EXPPTS 9163600
    setvar EXPTONEXT 9163600
   }

 }

// *********************
// * Money Calculation *
// *********************
  ifvarl DOLLARS 0 ifvarg DOLLARS -1073741823 { setvar DOLLARS 0 setvar CENTS 0 }
  ifvarl DOLLARS -1073741823 { setvarvar DOLLARS MAXDOLLARS setvar CENTS 0 }
  ifvarvare DOLLARS MAXDOLLARS { setvarvar DOLLARS MAXDOLLARS setvar CENTS 0 }
  ifvarvarg DOLLARS MAXDOLLARS { setvarvar DOLLARS MAXDOLLARS setvar CENTS 0 }
//  setvarvar TRUEDOLLARS DOLLARS
//  setvarvar TRUECENTS CENTS

ifvarg CENTS -1
 ifvarl CENTS 10 
    qsprintf 193 197 DOLLARS CENTS 
 else
    qsprintf 194 198 DOLLARS CENTS 

setvarvar MAXHITPOINTSATOMIC MAXHITPOINTS
mulvar MAXHITPOINTSATOMIC 2

setvarvar MAXARMORPOINTSATOMIC MAXARMORPOINTS
mulvar MAXARMORPOINTSATOMIC 2

setvarvar MAXENERGYPOINTSATOMIC MAXENERGYPOINTS
mulvar MAXENERGYPOINTSATOMIC 2

// Damage Screens
getuserdef[THISACTOR].overhead_on tempb
ifvarn tempb 2
{
 getplayer[THISACTOR].over_shoulder_on tempb
 ifvare tempb 0
 {
  getplayer[THISACTOR].newowner TEMP
  ifvare TEMP -1
  { 
   // Damage Screen #2 - Frozen Over
   getactorvar[PLAYERID].FROZEN? varname
   ifvare varname 1
   {
    state shadepulse3
    divvar shade 3
    setvar pal 1
    setvar digx 160
    setvar digy 100
    setvar digz 65536
    setvar tilenum 3517
    state orientation1
    state rs
   } 
 
   // Damage Screen #1 - Main
   ifvarg DAMAGEHUETIMER 0
   {
    // Outer Edges [33% Trans]
    state shadepulse2
    divvar shade 5
    addvar shade 13
    setvarvar pal DAMAGEHUEPAL

    setvar varname 246 // 316 // 473
    mulvarvar varname DAMAGEHUETIMER
    ifvarg varname 49152 setvar varname 49152
    setvar digz 114688 // 65536
    subvarvar digz varname // 65536

    // Left Edges [33% Trans]
    setvar digx 160
    setvar digy 100
    setvar tilenum 3519 // 3518
    state orientation1
    state rs
   }
  }
 }
}

// Display Player's Overhead Sprite
getuserdef[THISACTOR].overhead_on tempb
ifvarn tempb 0
{

 state shade0
 setvar digx 160
 setvar digy 100
 ifvare VEHICLEID -1
 {
  ifvare CHARACTERSELECTED? 1 setvar digz 24576
  else ifvare CHARACTERSELECTED? 5 setvar digz 12288
  else ifvare CHARACTERSELECTED? 6 setvar digz 12288
  else ifvare CHARACTERSELECTED? 9 setvar digz 10240
  else ifvare CHARACTERSELECTED? 10 { ifvare NETHRAFORM? 0 setvar digz 10240 else setvar digz 24576 }
  else setvar digz 24576
 }
 else
 {
  ifvarg VEHICLETYPE -1 ifvarl VEHICLETYPE 3 setvar digz 13824 // 18432
 }

 // Get Min Zoom DigZ
 setvarvar tempd digz
 mulvar tempd 34
 divvar tempd 100

 // Get Max Zoom DigZ
 setvarvar tempe digz
 mulvar tempe 200
 divvar tempe 100

 // Get the Proper Zoom of the Overhead Sprite [based roughly on the zoom of the normal sprite]

 // Based on Map Zoom First
 getplayer[THISACTOR].zoom tempc
 mulvar tempc 100
 divvar tempc 768 // Normal Zoom is 768
 ifvarl tempc 34 { setvar tempc 34 }
 ifvarg tempc 200 { setvar tempc 200 }

 // Based on Player Height from Ground Second
 getsector[THISACTOR].floorz TEMPVAR2
 setvarvar TEMPVAR4 TEMPVAR2
 addvar TEMPVAR4 -9850
 getplayer[THISACTOR].posz TEMPVAR
 setvarvar TEMPVAR5 TEMPVAR4
 subvarvar TEMPVAR5 TEMPVAR
 setvarvar tempf TEMPVAR5
 ifvarg TEMPVAR5 -1 divvar tempf 150 else divvar tempf 75
 ifvarl tempf -66 setvar tempf -66
 else ifvarg tempf 100 setvar tempf 100

 setvarvar tempg tempf
 mulvarvar tempg tempc
 divvar tempg 100

 // Final Zoom Calculations
 addvarvar tempc tempg

 getplayer[THISACTOR].zoom tempb

 // Small Zoom
 ifvarl tempb 305
 {
  ifvarl tempc 34 setvar tempc 34
  ifvarg tempc 80 setvar tempc 80
 }
 // Small-Normal Zoom
 ifvarg tempb 304 ifvarl tempb 561
 {
  ifvarl tempc 54 setvar tempc 54
  ifvarg tempc 100 setvar tempc 100
 }
 // Normal Zoom
 ifvarg tempb 560 ifvarl tempb 817
 {
  ifvarl tempc 74 setvar tempc 74
  ifvarg tempc 120 setvar tempc 120
 }
 // Normal Zoom
 ifvarg tempb 816 ifvarl tempb 1073
 {
  ifvarl tempc 94 setvar tempc 94
  ifvarg tempc 100 setvar tempc 140
 }
 // Large Zoom
 ifvarg tempb 1072 ifvarl tempb 1329
 {
  ifvarl tempc 114 setvar tempc 114
  ifvarg tempc 160 setvar tempc 160
 }
 // Large Zoom
 ifvarg tempb 1328 ifvarl tempb 1585
 {
  ifvarl tempc 114 setvar tempc 134
  ifvarg tempc 180 setvar tempc 180
 }
 // Extra-Large Zoom
 ifvarg tempb 1584 ifvarl tempb 1841
 {
  ifvarl tempc 154 setvar tempc 154
  ifvarg tempc 200 setvar tempc 200
 }
 // Extra-Large Zoom
 ifvarg tempb 1840			
 {
  ifvarl tempc 174 setvar tempc 174
  ifvarg tempc 200 setvar tempc 200
 }

 // Overall Scale Limits
 ifvarl tempc 34 setvar tempc 34
 ifvarg tempc 200 setvar tempc 200

 mulvarvar digz tempc
 divvar digz 100

 ifvarvarl digz tempd setvarvar digz tempd
 else { ifvarvarg digz tempe setvarvar digz tempe }
//

 ifvare OVERHEADSPRITE 0 
 {
  ifvare VEHICLEID -1
  {
   ifvare CHARACTERSELECTED? 1 setvar tilenum 6182
   else ifvare CHARACTERSELECTED? 5 setvar tilenum 6178
   else ifvare CHARACTERSELECTED? 6 setvar tilenum 6186
   else ifvare CHARACTERSELECTED? 9 setvar tilenum 6190
   else ifvare CHARACTERSELECTED? 10 { ifvare NETHRAFORM? 0 setvar tilenum 6194 else setvar tilenum 5276 }
   else setvar tilenum 5276
  }
  else
  {
   ifvarg VEHICLETYPE -1 ifvarl VEHICLETYPE 3 setvar tilenum 6170
  }
 }
 ifvarg OVERHEADSPRITE 0 ifvarl OVERHEADSPRITE 5
 {
  ifvare VEHICLEID -1
  {
   ifvare CHARACTERSELECTED? 1 setvar tilenum 6182
   else ifvare CHARACTERSELECTED? 5 setvar tilenum 6178
   else ifvare CHARACTERSELECTED? 6 setvar tilenum 6186
   else ifvare CHARACTERSELECTED? 9 setvar tilenum 6190
   else ifvare CHARACTERSELECTED? 10 { ifvare NETHRAFORM? 0 setvar tilenum 6194 else setvar tilenum 5276 }
   else setvar tilenum 5276
  }
  else
  {
   ifvarg VEHICLETYPE -1 ifvarl VEHICLETYPE 3 setvar tilenum 6170
  }
 }
 ifvarg OVERHEADSPRITE 4 ifvarl OVERHEADSPRITE 9
 {
  ifvare VEHICLEID -1
  {
   ifvare CHARACTERSELECTED? 1 setvar tilenum 6183
   else ifvare CHARACTERSELECTED? 5 setvar tilenum 6179
   else ifvare CHARACTERSELECTED? 6 setvar tilenum 6187
   else ifvare CHARACTERSELECTED? 9 setvar tilenum 6191
   else ifvare CHARACTERSELECTED? 10 { ifvare NETHRAFORM? 0 setvar tilenum 6195 else setvar tilenum 5276 }
   else setvar tilenum 5276
  }
  else
  {
   ifvarg VEHICLETYPE -1 ifvarl VEHICLETYPE 3 setvar tilenum 6170
  }
 }
 ifvarg OVERHEADSPRITE 8 ifvarl OVERHEADSPRITE 13
 {
  ifvare VEHICLEID -1
  {
   ifvare CHARACTERSELECTED? 1 setvar tilenum 6184
   else ifvare CHARACTERSELECTED? 5 setvar tilenum 6180
   else ifvare CHARACTERSELECTED? 6 setvar tilenum 6188
   else ifvare CHARACTERSELECTED? 9 setvar tilenum 6192
   else ifvare CHARACTERSELECTED? 10 { ifvare NETHRAFORM? 0 setvar tilenum 6196 else setvar tilenum 5276 }
   else setvar tilenum 5276
  }
  else
  {
   ifvarg VEHICLETYPE -1 ifvarl VEHICLETYPE 3 setvar tilenum 6170
  }
 }
 ifvarg OVERHEADSPRITE 12 ifvarl OVERHEADSPRITE 17
 {
  ifvare VEHICLEID -1
  {
   ifvare CHARACTERSELECTED? 1 setvar tilenum 6185
   else ifvare CHARACTERSELECTED? 5 setvar tilenum 6181
   else ifvare CHARACTERSELECTED? 6 setvar tilenum 6189
   else ifvare CHARACTERSELECTED? 9 setvar tilenum 6193
   else ifvare CHARACTERSELECTED? 10 { ifvare NETHRAFORM? 0 setvar tilenum 6197 else setvar tilenum 5276 }
   else setvar tilenum 5276
  }
  else
  {
   ifvarg VEHICLETYPE -1 ifvarl VEHICLETYPE 3 setvar tilenum 6170
  }
 }
 getactor[PLAYERID].pal tempb
 setvarvar pal tempb
 getactor[PLAYERID].shade tempb
 setvarvar shade tempb
 state orientation0

 state rs

// <256 = Smallest Sprites
// 768 = Normal Size Sprites
// 1536> = Largest Sprites

}

// Controlled Camera Displays
getplayer[THISACTOR].newowner TEMP
ifvarn TEMP -1
{ 
 getactorvar[TEMP].extrasav TEMP2
 ifvare TEMP2 1
 {
  state shade0
  setvar digx 320
  setvar textscale 32768
  state setquote332
  state settilealphanum
  state orientation10

  setvar digy 14
  redefinequote 332 ^20THIS IS A CONTROLLABLE SECURITY CAMERA
  state gtz

  setvar digy 19
  state pal15
  getkeyname 332 2 0
  redefinequote 346 ^15 = TURN CAMERA LEFT
  qstrcat 332 346
  state gtz

  setvar digy 24
  state pal15
  getkeyname 332 3 0
  redefinequote 346 ^15 = TURN CAMERA RIGHT
  qstrcat 332 346
  state gtz
  
  setvar digy 29
  state pal15
  getkeyname 332 17 0
  redefinequote 346 ^15 = AIM CAMERA UP
  qstrcat 332 346
  state gtz
  
  setvar digy 34
  state pal15
  getkeyname 332 18 0
  redefinequote 346 ^15 = AIM CAMERA DOWN
  qstrcat 332 346
  state gtz
  
 }
}

// Vehicle Displays
getuserdef[THISACTOR].pause_on TEMPVAR 
ifvare TEMPVAR 0 state vehicledisplays

getuserdef[THISACTOR].overhead_on TEMPVAR4
ifvarn TEMPVAR4 2
{
 getplayer[THISACTOR].over_shoulder_on TEMPVAR4
 ifvare TEMPVAR4 0
 {
  // PK Shield "Hit" Display[s]
  ifvarg PKSHIELDHIT_TIMER 0
  {
   ifvare PKSHIELDHIT_TIMER 1 setvar shade 4
   ifvare PKSHIELDHIT_TIMER 2 setvar shade 3
   ifvare PKSHIELDHIT_TIMER 3 setvar shade 2
   ifvare PKSHIELDHIT_TIMER 4 setvar shade 1
   ifvare PKSHIELDHIT_TIMER 5 setvar shade 0
   ifvare PKSHIELDHIT_TIMER 6 setvar shade 1
   ifvare PKSHIELDHIT_TIMER 7 setvar shade 2
   ifvare PKSHIELDHIT_TIMER 8 setvar shade 3
   ifvare PKSHIELDHIT_TIMER 9 setvar shade 4
   ifvare PKSHIELDHITTYPE 0 state pal0 else state pal21
   // Main "Shield Orb" flickers for 5 tics
   ifvarg PKSHIELDHIT_TIMER 3 ifvarl PKSHIELDHIT_TIMER 7
   {
    setvar digx 160
    setvar digy 100
    setvar digz 65536
    setvar tilenum 7801
    state orientation43

    state rs
   }
   // Main Quadra of Shield Crystals
   setvar digx 160
   setvar digy 100
   setvar digz 65536
   ifvare PKSHIELDHITTYPE 0 setvar tilenum 7804 else setvar tilenum 7808
   ifvarg PKSHIELDHIT_TIMER 0 ifvarl PKSHIELDHIT_TIMER 4 state orientation43
   else ifvarg PKSHIELDHIT_TIMER 3 ifvarl PKSHIELDHIT_TIMER 7 state orientation11
   else ifvarg PKSHIELDHIT_TIMER 6 ifvarl PKSHIELDHIT_TIMER 10 state orientation43
   state rs
  }
 }
}

state shade0
// Display Fortune Cookie Fortunes

   setvar TEMPVAR5 0
   ifvarg PLAYERSTATUS? 0 addvar TEMPVAR5 1
   ifvarg QUADTIME 0 addvar TEMPVAR5 1
   ifvarg INVULNTIME 0 addvar TEMPVAR5 1
   ifvarg REGENTIME 0 addvar TEMPVAR5 1
   ifvarg APREGENTIME 0 addvar TEMPVAR5 1
   ifvarg VAMPIRETIME 0 addvar TEMPVAR5 1


state digx160 // 2
setvar digy 110
ifvarg winterclothes 0 nullop else addvar digy 6
ifvarg freezetimer 0 nullop else addvar digy 6
ifvarg TEMPVAR5 0 nullop else addvar digy 11 // ifvarg PLAYERSTATUS? 0 nullop else addvar digy 11
ifvarg PARTYSIZE 1 nullop else addvar digy 6
ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6

ifvarg FORTUNECOOKIETIMER 0 ifvarl FORTUNECOOKIETIMER 40 state orientation59
ifvarg FORTUNECOOKIETIMER 39 state orientation27
setvar temp 272
qstrlen TEMPVAR 272
ifvarg TEMPVAR 0
{
 subvar TEMPVAR 1
 mulvar TEMPVAR 2
 addvar TEMPVAR 4
 subvarvar digx TEMPVAR
}
state pal20
ifvarg FORTUNECOOKIETIMER 0 state mt

// Display Entry Field for Passcode entries on Keypads :P

state shade0
ifvarn pad_id -1
{
	  getactorvar[pad_id].pnum TEMPVAR
        ifvarn TEMPVAR -1
        {
         // Show Black Digital Background Thing :P
	   setvar digx 96
	   setvar digy 31
	   setvar tilenum 3705
	   state digz32768
	   state orientation26
	   state rs
         // Show Code Itself
	   state digx160
	   setvar digy 32
         state pal22
	   setvar tilenum 3461
	   state orientation27 // 1+2+8+16
	   setvarvar varname TEMPVAR
	   state dn

         // Show Large Keypad thingy :P
	   setvar digx 96
	   setvar digy 44
	   setvar tilenum 3069
	   setvar digz 28436
	   state orientation26
	   state rs

         // Show Pressed Numbers
         ifvarg pad_button1timer 0
         {
          // 1
 	    setvar digx 110
 	    setvar digy 54
	    setvar tilenum 3051
	    setvar digz 28436
	    state orientation26
	    state rs
         }
         ifvarg pad_button2timer 0
         {
          // 2
	    setvar digx 133
	    setvar digy 54
	    setvar tilenum 3052
	    setvar digz 28436
	    state orientation26
	    state rs
         }
         ifvarg pad_button3timer 0
         {
          // 3
	    setvar digx 156
	    setvar digy 54
	    setvar tilenum 3053
	    setvar digz 28436
	    state orientation26
	    state rs
         }
         ifvarg pad_button4timer 0
         {
          // 4
	    setvar digx 111
	    setvar digy 73
	    setvar tilenum 3054
	    setvar digz 28436
	    state orientation26
	    state rs
         }
         ifvarg pad_button5timer 0
         {
          // 5
	    setvar digx 133
	    setvar digy 73
	    setvar tilenum 3055
	    setvar digz 28436
	    state orientation26
	    state rs
         }
         ifvarg pad_button6timer 0
         {
          // 6
	    setvar digx 156
	    setvar digy 73
	    setvar tilenum 3056
	    setvar digz 28436
	    state orientation26
	    state rs
         }
         ifvarg pad_button7timer 0
         {
          // 7
	    setvar digx 111
	    setvar digy 91
	    setvar tilenum 3057
	    setvar digz 28436
	    state orientation26
	    state rs
         }
         ifvarg pad_button8timer 0
         {
          // 8
	    setvar digx 133
	    setvar digy 91
	    setvar tilenum 3058
	    setvar digz 28436
	    state orientation26
	    state rs
         }
         ifvarg pad_button9timer 0
         {
          // 9
	    setvar digx 156
	    setvar digy 91
	    setvar tilenum 3059
	    setvar digz 28436
	    state orientation26
	    state rs
         }
         ifvarg pad_button10timer 0
         {
          // 0
	    setvar digx 133
	    setvar digy 109
	    setvar tilenum 3060
	    setvar digz 28436
	    state orientation26
	    state rs
         }
         ifvarg pad_button11timer 0
         {
          // Backspace
	    setvar digx 185
	    setvar digy 73
	    setvar tilenum 3061
	    setvar digz 28436
	    state orientation26
	    state rs
         }
         ifvarg pad_button12timer 0
         {
          // Enter
	    setvar digx 185
	    setvar digy 91
	    setvar tilenum 3062
	    setvar digz 28436
	    state orientation26
	    state rs
         }
        } 
}


//
																						ifvare oldskoolmode 0
																						{
//************************
//* Quick-Status Display *
//************************

setvar diga 0
			ifvarn statusdisplaytoggle 0 ifvarg PARTYALIVE 0
			{

// Fordenator Code - "MORTAL KOMBAT!"
 ifvarg FORDENTIMER 0
 {
  setvar digx 280
  setvar digy 161
  state digz32768
  setvar diga 0
  state pal0
  state shade0
  ifvarg shop_id -1 state orientation59 // 1+2+8+16+12
  else
  {
   ifvarg atm_id -1 state orientation59 // 1+2+8+16+12
   else state orientation26 // 16+8+2
  }
  ifvare FORDENTYPE 0
  {
   ifvare FORDENTIMER 1 setvar tilenum 3833
   ifvare FORDENTIMER 2 setvar tilenum 3835
   ifvare FORDENTIMER 3 setvar tilenum 3837
   ifvarg FORDENTIMER 3 { ifvarl FORDENTIMER 17 setvar tilenum 3839 } // 4-16
   ifvare FORDENTIMER 17 setvar tilenum 3837
   ifvare FORDENTIMER 18 setvar tilenum 3835
   ifvare FORDENTIMER 19 setvar tilenum 3833
   ifvarg FORDENTIMER 19 setvar tilenum 3831
  }
  ifvare FORDENTYPE 1
  {
   ifvare FORDENTIMER 1 setvar tilenum 3824
   ifvare FORDENTIMER 2 setvar tilenum 3826
   ifvare FORDENTIMER 3 setvar tilenum 3828
   ifvarg FORDENTIMER 3 { ifvarl FORDENTIMER 17 setvar tilenum 3830 } // 4-16
   ifvare FORDENTIMER 17 setvar tilenum 3828
   ifvare FORDENTIMER 18 setvar tilenum 3826
   ifvare FORDENTIMER 19 setvar tilenum 3824
   ifvarg FORDENTIMER 19 setvar tilenum 3822
  }
  state rs
  subvar FORDENTIMER 1
 }
// End Fordenator Code

     ifvarg PARTYSIZE 0
     {
      setvarvar TEMPVAR PARTYALIVE
      mulvar TEMPVAR 100
      ifvarn PARTYSIZE 0 divvarvar TEMPVAR PARTYSIZE
     }

// Show Alive / Total Character Count (Quick Party)
      ifvarg shop_id -1 state orientation49 // 1+16+32
      else
      {
       ifvarg atm_id -1 state orientation49 // 16+1
       else state orientation17 // 16+1
      }
      state settile3087 

ifvare mainmenu 0
{ // ifvare mainmenu 0

// Global Timer
      setvar digy 187 // 170

      ifvarg TEMPVAR 75 state pal0 
      else ifvarl TEMPVAR 76 ifvarg TEMPVAR 50 state pal23
      else ifvarl TEMPVAR 51 ifvarg TEMPVAR 25 state pal21 
      else ifvarl TEMPVAR 26 state pal10

     setvarvar TEMP3 PARTYSIZE
     subvarvar TEMP3 PARTYALIVE

     ifvarg PARTYALIVE 0
     {
      setvar TEMPVAR 0
      ifvarvarl PARTYALIVE PARTYSIZE
      {
       state checkreschalices
       ifvarg ITEMARRAYID_AMOUNTTEMP 0 addvar TEMPVAR 1

       ifvare NETHRA? 1
       {
        setvar CHARACTERARRAY 10
        getactorvar[CHARACTERARRAY].CHARACTERHP TEMP
        ifvarg TEMP 0 addvar TEMPVAR 1
       }

       ifvare MYSTERY1? 1
       {
        ifvare PUBLICBETA? 0
        {
         setvar CHARACTERARRAY 14
         getactorvar[CHARACTERARRAY].CHARACTERHP TEMP
         ifvarg TEMP 0 addvar TEMPVAR 1
        }
       }
      }

      ifvarg PARTYSIZE 1
      {
       ifvarg TEMPVAR 0 state shadepulse else state shade0 

       // Meter
      	 setvar digy 144 // 126
       ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
       ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	 setvar digx 30
	 setvar digz 58982 // 65536
	 setvar tilenum 7680 // 746

	 setvarvar TEMPVAR4 PARTYALIVE
	 mulvar TEMPVAR4 1000
	 divvarvar TEMPVAR4 PARTYSIZE
	 setvarvar TEMPVAR5 TEMPVAR4
	 divvar TEMPVAR5 31
	 addvarvar tilenum TEMPVAR5
	 addvar shade 13
	 state rs
	 state settile3087 
 	 subvar shade 13

       // Show "PARTY STATUS" Text
	 setvar digy 145 // 127
       ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
       ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	 setvar digx 10 // 190
	 redefinequote 332 PARTY
	 state setquote332
	 state mt

       setvar digx 13 // 190
       ifvarg PARTYALIVE -1 ifvarl PARTYALIVE 10 addvar digx 55
       ifvarg PARTYALIVE 9 ifvarl PARTYALIVE 100 addvar digx 57
       setvarvar varname PARTYALIVE
       state dn
 
       setvar digx 13 // 190
       ifvarg PARTYALIVE -1 ifvarl PARTYALIVE 10 addvar digx 59
       ifvarg PARTYALIVE 9 ifvarl PARTYALIVE 100 addvar digx 63
 	 state showslash
  	 state mt

       setvar digx 13 // 190
       ifvarg PARTYALIVE -1 ifvarl PARTYALIVE 10 addvar digx 67
       ifvarg PARTYALIVE 9 ifvarl PARTYALIVE 100 addvar digx 71
       setvarvar varname PARTYSIZE
       ifvarg PARTYSIZE -1 ifvarl PARTYSIZE 10 addvar digx 0
       ifvarg PARTYSIZE 9 ifvarl PARTYSIZE 100 addvar digx 2
       state dn
      }       
      state shade0
     }

} // ifvare mainmenu 0

	setvar digx 2
// Show Current Character's name

ifvare mainmenu 0
{ // ifvare mainmenu 0

	setvar digy 193 // 182

      ifvarg shop_id -1 state orientation49 // 32+16+1
      else
      {
       ifvarg atm_id -1 state orientation49 // 32+16+1
       else state orientation49 // 32+16+1
      }
	
      state settile3087 

	ifvarl CHARACTERSELECTED? 1 setvarvar CHARACTERSELECTED? CHARACTEROLD
	ifvare CHARACTERSELECTED? 1
      { 
       redefinequote 318 DUKE NUKEM 
 	 state pal17
      }
	ifvare CHARACTERSELECTED? 2
      { 
 	 redefinequote 318 JACK WALKER
 	 state pal17
      }
	ifvare CHARACTERSELECTED? 3
      { 
       ifvare BUBSYFORM? 0 redefinequote 318 BUBSY BOBCAT
       ifvare BUBSYFORM? 1
       {
        redefinequote 318 BUBSY BOBCAT [THE MASK FORM]
        setvarvar TEMPVAR6 CURRENTENERGYPOINTS
        mulvar TEMPVAR6 1000
        divvarvar TEMPVAR6 MAXENERGYPOINTS
        ifvarl TEMPVAR6 26 state shadepulse3 else state shade0
       }
 	 state pal23
      }
	ifvare CHARACTERSELECTED? 4
      { 
       ifvare AMIFORM? 0 redefinequote 318 AMI MIZUNO [CIVILIAN]
       ifvare AMIFORM? 1 redefinequote 318 AMI MIZUNO [SENSHI]
       ifvare AMIFORM? 2
       {
        redefinequote 318 AMI MIZUNO [BALANCED]
        setvarvar TEMPVAR6 CURRENTENERGYPOINTS
        mulvar TEMPVAR6 1000
        divvarvar TEMPVAR6 MAXENERGYPOINTS
        ifvarl TEMPVAR6 26 state shadepulse3 else state shade0
       }
 	 state pal0
      }
	ifvare CHARACTERSELECTED? 5
      { 
	 redefinequote 318 HIGA "LO WANG" HAKAISHA
 	 state pal15
      }
	ifvare CHARACTERSELECTED? 6
      {
     redefinequote 318 ESSENCE MARGALAN	  
     // ifvare ESSENCEFORM? 0 redefinequote 318 ESSENCE MARGALAN
     // ifvarg ESSENCEFORM? 0 redefinequote 318 ESSENCE MARGALAN [NOARMOR]
 	 state pal12
      }
	ifvare CHARACTERSELECTED? 7
      { 
	 redefinequote 318 TED MALDORAS
 	 state pal17
      }
	ifvare CHARACTERSELECTED? 8
      { 
	 redefinequote 318 LISA BATES
 	 state pal17
      }
	ifvare CHARACTERSELECTED? 9
      { 
	 redefinequote 318 CYBANIS MORGANDOS
 	 state pal12
	}
	ifvare CHARACTERSELECTED? 10
      { 
       ifvare NETHRAFORM? 0 redefinequote 318 NETHRA MABOROSHI
       ifvarg NETHRAFORM? 0 redefinequote 318 CHRISTINA MITCHELL
 	 state pal0
	}
	ifvare CHARACTERSELECTED? 11
      {
 	 redefinequote 318 PAULA POLESTAR
 	 state pal20
	}
	ifvare CHARACTERSELECTED? 12
      {
	 redefinequote 318 LORI STEPHENS
 	 state pal15
	}
	ifvare CHARACTERSELECTED? 13
      {
	 ifvare MINAKOFORM? 0 redefinequote 318 MINAKO AINO [CIVILIAN]
	 ifvare MINAKOFORM? 1 redefinequote 318 MINAKO AINO [SENSHI]
	 ifvare MINAKOFORM? 2
       {
        redefinequote 318 MINAKO AINO [BALANCED]
        setvarvar TEMPVAR6 CURRENTENERGYPOINTS
        mulvar TEMPVAR6 1000
        divvarvar TEMPVAR6 MAXENERGYPOINTS
        ifvarl TEMPVAR6 26 state shadepulse3 else state shade0
       }
 	 state pal23
	}
	ifvare CHARACTERSELECTED? 14
      {
       ifvare debugtoggle 0
       {
        ifvare PUBLICBETA? 1 redefinequote 318 ??????? ?????????
        else redefinequote 318 NAFERIA MABOROSHI
       }
       else
       {
        ifvare PUBLICBETA? 1 redefinequote 318 HINOTORI GENKAI
        else redefinequote 318 NAFERIA MABOROSHI
       }
 	 state pal0
	}
	ifvare CHARACTERSELECTED? 15
      {
	 redefinequote 318 MAKEN SHINKARA
 	 state pal10
	}
	ifvarg CHARACTERSELECTED? 15 setvarvar CHARACTERSELECTED? CHARACTEROLD

	setvar temp 318
	state mt
      state shade0

      getplayer[THISACTOR].holster_weapon temp
      ifvare temp 1
      {
       addvar digx 1 // 182
       addvar digy -3 // 182
       redefinequote 318 ----
       setvar temp 318
       state pal23
       state mt
       subvar digx 1 // 182
       subvar digy -3 // 182
      }


} // ifvare mainmenu 0

// Show the character's weapon numbers

      ifvarg shop_id -1 state orientation49 // 32+16+1
      else
      {
       ifvarg atm_id -1 state orientation49 // 32+16+1
       else state orientation49 // 32+16+1
      }
      state settile3087 

ifvare mainmenu 0
{ // ifvare mainmenu 0

	setvar temp 325
      // Weapon 1
	  setvar digx 112 // 136
      redefinequote 325 1
      ifvare PLAYERWEAPON? 0 state shadepulse3
      state pal20
	ifvarand PLAYERWEAPONBITFIELD 1 state mt

      state shade0
      // Weapon 2
	  addvar digx 10 // setvar digx 144
      redefinequote 325 2
      ifvare PLAYERWEAPON? 1 state shadepulse3
      getplayer[THISACTOR].ammo_amount 1 TEMPVAR4
      getplayer[THISACTOR].max_ammo_amount 1 TEMPVAR5
      setvarvar AMMOPERCENTAGE TEMPVAR4
      mulvar AMMOPERCENTAGE 1000
      ifvarn TEMPVAR5 0 divvarvar AMMOPERCENTAGE TEMPVAR5
      state ammocolors
	ifvarand PLAYERWEAPONBITFIELD 2 state mt

      state shade0
      // Weapon 3
	  addvar digx 10 // setvar digx 152
      redefinequote 325 3
      ifvare PLAYERWEAPON? 2 state shadepulse3
      getplayer[THISACTOR].ammo_amount 2 TEMPVAR4
      getplayer[THISACTOR].max_ammo_amount 2 TEMPVAR5
      setvarvar AMMOPERCENTAGE TEMPVAR4
      mulvar AMMOPERCENTAGE 1000
      ifvarn TEMPVAR5 0 divvarvar AMMOPERCENTAGE TEMPVAR5
      state ammocolors
	ifvarand PLAYERWEAPONBITFIELD 4 state mt

      state shade0
      // Weapon 4
	  addvar digx 10 // state digx160
	  ifvare CHAINGUNMODE 0 
	  {
       redefinequote 325 4B
	  }
	  else
	  ifvare CHAINGUNMODE 1 
	  {
       redefinequote 325 4R
	  }
	  else
	  {
       redefinequote 325 4
	  }
      ifvare PLAYERWEAPON? 3 state shadepulse3
      getplayer[THISACTOR].ammo_amount 3 TEMPVAR4
      getplayer[THISACTOR].max_ammo_amount 3 TEMPVAR5
      setvarvar AMMOPERCENTAGE TEMPVAR4
      mulvar AMMOPERCENTAGE 1000
      ifvarn TEMPVAR5 0 divvarvar AMMOPERCENTAGE TEMPVAR5
      state ammocolors
	ifvarand PLAYERWEAPONBITFIELD 8 state mt
      
      state shade0
      // Weapon 5
	  addvar digx 10 // setvar digx 168
	  ifvare DEATHMISSILEMODE 0 
	  {
       redefinequote 325 5G
	  }
	  else
	  ifvare DEATHMISSILEMODE 1 
	  {
       redefinequote 325 5S
	  }
	  else
	  {
       redefinequote 325 5
	  }
      ifvare PLAYERWEAPON? 4 state shadepulse3
      getplayer[THISACTOR].ammo_amount 4 TEMPVAR4
      getplayer[THISACTOR].max_ammo_amount 4 TEMPVAR5
      setvarvar AMMOPERCENTAGE TEMPVAR4
      mulvar AMMOPERCENTAGE 1000
      ifvarn TEMPVAR5 0 divvarvar AMMOPERCENTAGE TEMPVAR5
      state ammocolors
	ifvarand PLAYERWEAPONBITFIELD 16 state mt

      state shade0
      // Weapon 6
	  addvar digx 10 // setvar digx 176
      redefinequote 325 6
      ifvare PLAYERWEAPON? 5 state shadepulse3
      getplayer[THISACTOR].ammo_amount 5 TEMPVAR4
      getplayer[THISACTOR].max_ammo_amount 5 TEMPVAR5
      setvarvar AMMOPERCENTAGE TEMPVAR4
      mulvar AMMOPERCENTAGE 1000
      ifvarn TEMPVAR5 0 divvarvar AMMOPERCENTAGE TEMPVAR5
      state ammocolors
	ifvarand PLAYERWEAPONBITFIELD 32 state mt

      state shade0
      // Weapon 7
	  addvar digx 10 // setvar digx 184
      redefinequote 325 7
      ifvare PLAYERWEAPON? 6 state shadepulse3
      getplayer[THISACTOR].ammo_amount 6 TEMPVAR4
      getplayer[THISACTOR].max_ammo_amount 6 TEMPVAR5
      setvarvar AMMOPERCENTAGE TEMPVAR4
      mulvar AMMOPERCENTAGE 1000
      ifvarn TEMPVAR5 0 divvarvar AMMOPERCENTAGE TEMPVAR5
      state ammocolors
	ifvarand PLAYERWEAPONBITFIELD 64 state mt

      state shade0
      // Weapon 8
	  addvar digx 10 // setvar digx 192
      redefinequote 325 8
      ifvare PLAYERWEAPON? 7 state shadepulse3
      getplayer[THISACTOR].ammo_amount 7 TEMPVAR4
      getplayer[THISACTOR].max_ammo_amount 7 TEMPVAR5
      setvarvar AMMOPERCENTAGE TEMPVAR4
      mulvar AMMOPERCENTAGE 1000
      ifvarn TEMPVAR5 0 divvarvar AMMOPERCENTAGE TEMPVAR5
      state ammocolors
	ifvarand PLAYERWEAPONBITFIELD 128 state mt

      state shade0
      // Weapon 9
	  addvar digx 10 // setvar digx 200
      redefinequote 325 9
      ifvare PLAYERWEAPON? 8 state shadepulse3
      getplayer[THISACTOR].ammo_amount 8 TEMPVAR4
      getplayer[THISACTOR].max_ammo_amount 8 TEMPVAR5
      setvarvar AMMOPERCENTAGE TEMPVAR4
      mulvar AMMOPERCENTAGE 1000
      ifvarn TEMPVAR5 0 divvarvar AMMOPERCENTAGE TEMPVAR5
      state ammocolors
	ifvarand PLAYERWEAPONBITFIELD 256 state mt
      
      state shade0
      // Weapon 10
	  addvar digx 10 // setvar digx 208
      redefinequote 325 10
      ifvare PLAYERWEAPON? 9 state shadepulse3
      getplayer[THISACTOR].ammo_amount 9 TEMPVAR4
      getplayer[THISACTOR].max_ammo_amount 9 TEMPVAR5
      setvarvar AMMOPERCENTAGE TEMPVAR4
      mulvar AMMOPERCENTAGE 1000
      ifvarn TEMPVAR5 0 divvarvar AMMOPERCENTAGE TEMPVAR5
      state ammocolors
	ifvarand PLAYERWEAPONBITFIELD 512 state mt

      state shade0
      // Weapon 11
	  addvar digx 10 // setvar digx 220
      redefinequote 325 11
      ifvare PLAYERWEAPON? 11 state shadepulse3
      getplayer[THISACTOR].ammo_amount 11 TEMPVAR4
      getplayer[THISACTOR].max_ammo_amount 11 TEMPVAR5
      setvarvar AMMOPERCENTAGE TEMPVAR4
      mulvar AMMOPERCENTAGE 1000
      ifvarn TEMPVAR5 0 divvarvar AMMOPERCENTAGE TEMPVAR5
      state ammocolors
	ifvarand PLAYERWEAPONBITFIELD 1024 state mt
//

} // ifvare mainmenu 0

      state shade0
	setvar diga 0

ifvare mainmenu 0
{ // ifvare mainmenu 0

// Show Character's Icon at Bottom Left Corner
	setvar digx 1 // 2
	setvar digy 173 // 172 
	setvar digz 19661 // 16834
 	state pal0
      ifvarg shop_id -1 state orientation49 // 32+16+1
      else
      {
       ifvarg atm_id -1 state orientation49 // 32+16+1
       else state orientation17 // 16+1
      }
	setvar shade -16
	ifvare CHARACTERSELECTED? 1 setvar tilenum 7936
	ifvare CHARACTERSELECTED? 2 setvar tilenum 7937
	ifvare CHARACTERSELECTED? 3
      {
       ifvare BUBSYFORM? 0 setvar tilenum 7938
       else ifvare BUBSYFORM? 1
       {
        setvar tilenum 7962
        setvarvar TEMPVAR6 CURRENTENERGYPOINTS
        mulvar TEMPVAR6 1000
        divvarvar TEMPVAR6 MAXENERGYPOINTS
        ifvarl TEMPVAR6 26 state shadepulse3 else state shade0
       }
      }
	ifvare CHARACTERSELECTED? 4
      {
       ifvare AMIFORM? 0 setvar tilenum 7939
       else ifvare AMIFORM? 1 setvar tilenum 7963
       else ifvare AMIFORM? 2
       {
        setvar tilenum 7966
        setvarvar TEMPVAR6 CURRENTENERGYPOINTS
        mulvar TEMPVAR6 1000
        divvarvar TEMPVAR6 MAXENERGYPOINTS
        ifvarl TEMPVAR6 26 state shadepulse3 else state shade0
       }
      }
	ifvare CHARACTERSELECTED? 5 setvar tilenum 7940
	ifvare CHARACTERSELECTED? 6 setvar tilenum 7941
	ifvare CHARACTERSELECTED? 7 setvar tilenum 7942
	ifvare CHARACTERSELECTED? 8 setvar tilenum 7943
	ifvare CHARACTERSELECTED? 9 setvar tilenum 7944
	ifvare CHARACTERSELECTED? 10 { ifvare NETHRAFORM? 0 setvar tilenum 7945 else ifvarg NETHRAFORM? 0 setvar tilenum 7964 }
	ifvare CHARACTERSELECTED? 11 setvar tilenum 7946
	ifvare CHARACTERSELECTED? 12 setvar tilenum 7947
	ifvare CHARACTERSELECTED? 13
      {
       ifvare MINAKOFORM? 0 setvar tilenum 7948
       else ifvare MINAKOFORM? 1 setvar tilenum 7965
       else ifvare MINAKOFORM? 2 
       {
        setvar tilenum 7968
        setvarvar TEMPVAR6 CURRENTENERGYPOINTS
        mulvar TEMPVAR6 1000
        divvarvar TEMPVAR6 MAXENERGYPOINTS
        ifvarl TEMPVAR6 26 state shadepulse3 else state shade0
       }
      }
	ifvare CHARACTERSELECTED? 14 setvar tilenum 7957
	ifvare CHARACTERSELECTED? 15 setvar tilenum 7971
      state rs
      state shade0

			}

} // ifvare mainmenu 0

 ifvare mainmenu 0
 { // ifvare mainmenu 0

//*****************
//* Stat Displays *
//*****************

      ifvarg shop_id -1 state orientation59 // 32+16+8+1
      else
      {
       ifvarg atm_id -1 state orientation59 // 32+16+8+1
       else state orientation27 // 16+8+1
      }
	state shade0

     ifvare CURRENTWEAPON 0 nullop
     else ifvare CURRENTWEAPON 10 nullop
     else
     {
	setvarvar AMMOPERCENTAGE CURRENTAMMOA
	mulvar AMMOPERCENTAGE 1000
	ifvarn MAXIMUMAMMO 0 divvarvar AMMOPERCENTAGE MAXIMUMAMMO
	qsprintf 290 291 AMMOPERCENTAGE
     }

//
// Attempt to reposition things in the display >.>
//
 ifvarn statusdisplaytoggle 0 ifvarg PARTYALIVE 0
 {

//****************
//*Money Detector*
//****************

// Money-Detector
   ifvare ISRADARON? 1
   {
    ifvare GOTMONEYRADAR? 1
    {
     ifvarn MONEYANG -1 // ifvare menutoggle 0
     {
	ifvarn MONEYID -1 
	{
 	 state orientation1
	 setvar digx 512 // 284
	 setvar digy 145 // 185
	 setvar digz 32768
	 setvar textscale 32768
	 ifvare MONEYSEE 1 
       {
        ifvare MONEYRIGGED 1 state pal21
        else state pal22
       }
       else
       {
        ifvare MONEYRIGGED 1 state pal10
        else state pal14
       }
       setvar tilenum STARTALPHANUM
       redefinequote 332 MONEY
       setvar temp 332
	 getactor[MONEYID].picnum TEMPVAR
       ifvarg TEMPVAR 5119 ifvarl TEMPVAR 5147 state gtz

 	 state orientation1
	 setvar digx 264 // 284
	 setvar digy 157 // 185

	 getactor[MONEYID].picnum temp
       ifvare temp 5133 state shadepulse2
       else ifvare temp 5134 state shadepulse2
       else ifvare temp 5135 state shadepulse2
       else ifvare temp 5136 state shadepulse2
       else ifvare temp 5137 state shadepulse3
       else ifvare temp 5138 state shadepulse3
       else ifvare temp 5139 state shadepulse3
       else ifvare temp 5140 state shadepulse3
       else state shade0

       ifvare temp 5146 setvar digz 4072 else setvar digz 8144 // 7168 // 16384
       setvar diga 0
       ifvarg temp 5119 ifvarl temp 5147 setvarvar tilenum temp else setvar tilenum 5372
       ifvare temp 5146
       {
	  getactor[MONEYID].pal TEMPVAR
        setvarvar pal TEMPVAR
       }
       else state pal0
       state rs

	 ifvare MONEYSEE 1 
       {
        ifvare MONEYRIGGED 1 state pal21
        else state pal22
       }
       else
       {
        ifvare MONEYRIGGED 1 state pal10
        else state pal14
       }
	 setvarvar digz MONEYDIST
	 divvar digz 5
	 setvarvar diga MONEYANG
	 addvar diga 1024
	 getactor[MONEYID].picnum temp
       ifvarg temp 5119 ifvarl temp 5147 setvar tilenum 5154 else setvar tilenum 5372
// 	 setvar tilenum 5154
 	 state rs
       state shade0
      }	
     }
    }

// Gemstone-Detector
    ifvare GOTMONEYRADAR? 1
    {
     ifvarn GEMANG -1 // ifvare menutoggle 0
     {
	ifvarn GEMID -1 
	{
 	 state orientation1
	 setvar digx 584 // 284
	 setvar digy 145 // 185
	 setvar digz 32768
	 setvar textscale 32768
	 ifvare GEMSEE 1 
       {
        ifvare GEMRIGGED 1 state pal21
        else state pal22
       }
       else
       {
        ifvare GEMRIGGED 1 state pal10
        else state pal14
       }
       setvar tilenum STARTALPHANUM
       redefinequote 332 GEM
       setvar temp 332
	 getactor[GEMID].picnum TEMPVAR
       ifvarg TEMPVAR GEMRINGSILVER state gtz
       else ifvarl TEMPVAR GEMRINGGOLD state gtz

 	 state orientation1
	 setvar digx 296 // 284
	 setvar digy 157 // 185

	 ifvare GEMSEE 1 
       {
        ifvare GEMRIGGED 1 state pal21
        else state pal22
       }
       else
       {
        ifvare GEMRIGGED 1 state pal10
        else state pal14
       }
	 setvarvar digz GEMDIST
	 divvar digz 5
	 setvarvar diga GEMANG
	 addvar diga 1024
	 getactor[GEMID].picnum temp
       ifvare temp GEMRINGSILVER setvar tilenum 5154
       else ifvare temp GEMRINGGOLD setvar tilenum 5154
       else setvar tilenum 5372
 	 state rs


	 getactor[GEMID].pal temp
       ifvare temp 11 nullop
       else ifvare temp 16 nullop
       else ifvare temp 0 nullop
       else ifvare temp 14 state shadepulse2
       else ifvare temp 21 state shadepulse2
       else ifvare temp 10 state shadepulse2
       else ifvare temp 23 state shadepulse3
       else ifvare temp 12 state shadepulse3
       else state shade0
       setvarvar pal temp

	 getactor[GEMID].picnum temp
       ifvare temp GEMRINGSILVER setvarvar tilenum temp
       else ifvare temp GEMRINGGOLD setvarvar tilenum temp
       else setvar tilenum 5372
       setvar digz 5120 // 2048
       setvar diga 0
       state rs
       state shade0
      }	
     }
    }
   }

state shade0
setvar diga 0

      ifvarg shop_id -1 state orientation59 // 32+16+8+1
      else
      {
       ifvarg atm_id -1 state orientation59 // 32+16+8+1
       else state orientation27 // 16+8+1
      }

// Show Character's Status Ailments/Buffs
	state settile3087 
	// Display the word "Status"
	setvar digy 139
      ifvarg PARTYSIZE 1 nullop else addvar digy 6
      ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 6 // 190
	redefinequote 332 STATUS
	state setquote332
	state pal20
      setvar TEMPVAR5 0
      ifvarg PLAYERSTATUS? 0 addvar TEMPVAR5 1
      ifvarg QUADTIME 0 addvar TEMPVAR5 1
      ifvarg INVULNTIME 0 addvar TEMPVAR5 1
      ifvarg REGENTIME 0 addvar TEMPVAR5 1
      ifvarg APREGENTIME 0 addvar TEMPVAR5 1
      ifvarg VAMPIRETIME 0 addvar TEMPVAR5 1
      ifvarg TEMPVAR5 0 state mt

     state pal0
     state digz24576 // 16x17 [28x28]
     setvar digz 14336
     setvar digy 138
     ifvarg PARTYSIZE 1 nullop else addvar digy 6
     ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
     ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6

     ifvarand PLAYERSTATUS? 1 // Dead
     {
	setvar digx 32 // +25
	setvar tilenum 8100
	state rs
     }
     ifvarand PLAYERSTATUS? 2 // Hasted
     {
	setvar digx 32 // +25
	setvar tilenum 8106
      ifvarl PLAYERHASTETIMER 130 { state shadepulse4 addvar shade 8 }
	state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 0 // Buffs are Positive
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname PLAYERHASTETIMER
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     ifvarand PLAYERSTATUS? 4 // Slowed
     {
	setvar digx 32 // 40
      ifvarand PLAYERSTATUS? 2 addvar digx 7
	setvar tilenum 8107
      ifvarl PLAYERSLOWTIMER 130 { state shadepulse4 addvar shade 8 }
	state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 21 // Ailments are Negative
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname PLAYERSLOWTIMER
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     ifvarand PLAYERSTATUS? 8 // Poisoned
     {
	setvar digx 32 // 48
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
	setvar tilenum 8101
      ifvarl PLAYERPOISONTIMER 130 { state shadepulse4 addvar shade 8 }
	state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 21 // Ailments are Negative
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname PLAYERPOISONTIMER
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     ifvarand PLAYERSTATUS? 16 // Dimness
     {
	setvar digx 32 // 56
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
      ifvarand PLAYERSTATUS? 8 addvar digx 7
	setvar tilenum 8102
      ifvarl PLAYERDIMNESSTIMER 130 { state shadepulse4 addvar shade 8 }
	state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 21 // Ailments are Negative
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname PLAYERDIMNESSTIMER
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     ifvarand PLAYERSTATUS? 32 // Triad Refractor
     {
	setvar digx 32 // 64
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
      ifvarand PLAYERSTATUS? 8 addvar digx 7
      ifvarand PLAYERSTATUS? 16 addvar digx 7
	setvar tilenum 8104
      ifvarl PLAYERREFRACTORTIMER 130 { state shadepulse4 addvar shade 8 }
	state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 0 // Buffs are Negative
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname PLAYERREFRACTORTIMER
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     ifvarand PLAYERSTATUS? 64 // Triad Ragnarok
     {
	setvar digx 32 // 72
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
      ifvarand PLAYERSTATUS? 8 addvar digx 7
      ifvarand PLAYERSTATUS? 16 addvar digx 7
      ifvarand PLAYERSTATUS? 32 addvar digx 7
	setvar tilenum 8105
      ifvarl PLAYERRAGNAROKTIMER 130 { state shadepulse4 addvar shade 8 }
	state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 20 // Ragnarok is Double-Edged
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname PLAYERRAGNAROKTIMER
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     ifvarand PLAYERSTATUS? 128 // Confusion
     {
	setvar digx 32 // 80
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
      ifvarand PLAYERSTATUS? 8 addvar digx 7
      ifvarand PLAYERSTATUS? 16 addvar digx 7
      ifvarand PLAYERSTATUS? 32 addvar digx 7
      ifvarand PLAYERSTATUS? 64 addvar digx 7
	setvar tilenum 8103
      ifvarl PLAYERCONFUSIONTIMER 130 { state shadepulse4 addvar shade 8 }
	state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 21 // Ailments are Negative
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname PLAYERCONFUSIONTIMER
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     ifvarand PLAYERSTATUS? 256 // Mercury Aqua Protection
     {
	setvar digx 32 // 88
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
      ifvarand PLAYERSTATUS? 8 addvar digx 7
      ifvarand PLAYERSTATUS? 16 addvar digx 7
      ifvarand PLAYERSTATUS? 32 addvar digx 7
      ifvarand PLAYERSTATUS? 64 addvar digx 7
      ifvarand PLAYERSTATUS? 128 addvar digx 7
	setvar tilenum 8109
      ifvarl PLAYERAQUAPROTECTTIMER 130 { state shadepulse4 addvar shade 8 }
	state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 20 // Aqua-Protection is Double-Edged
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname PLAYERAQUAPROTECTTIMER
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     ifvarand PLAYERSTATUS? 512 // Damage Shell
     {
	setvar digx 32 // 96
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
      ifvarand PLAYERSTATUS? 8 addvar digx 7
      ifvarand PLAYERSTATUS? 16 addvar digx 7
      ifvarand PLAYERSTATUS? 32 addvar digx 7
      ifvarand PLAYERSTATUS? 64 addvar digx 7
      ifvarand PLAYERSTATUS? 128 addvar digx 7
      ifvarand PLAYERSTATUS? 256 addvar digx 7
	setvar tilenum 8108
      ifvarl PLAYERSHELLTIMER 130 { state shadepulse4 addvar shade 8 }
	state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 0 // Buffs are Positive
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname PLAYERSHELLTIMER
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     ifvarand PLAYERSTATUS? 1024 // Psychic Shield
     {
      setvar digx 32 // 104
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
      ifvarand PLAYERSTATUS? 8 addvar digx 7
      ifvarand PLAYERSTATUS? 16 addvar digx 7
      ifvarand PLAYERSTATUS? 32 addvar digx 7
      ifvarand PLAYERSTATUS? 64 addvar digx 7
      ifvarand PLAYERSTATUS? 128 addvar digx 7
      ifvarand PLAYERSTATUS? 256 addvar digx 7
      ifvarand PLAYERSTATUS? 512 addvar digx 7
      setvar tilenum 8110
      ifvarl PLAYERPSISHIELDTIMER 2 { state shadepulse4 addvar shade 8 }
	state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 0 // Buffs are Positive
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname PLAYERPSISHIELDTIMER
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     ifvarand PLAYERSTATUS? 2048 // Triad Blitzkrieg
     {
      setvar digx 32 // 112
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
      ifvarand PLAYERSTATUS? 8 addvar digx 7
      ifvarand PLAYERSTATUS? 16 addvar digx 7
      ifvarand PLAYERSTATUS? 32 addvar digx 7
      ifvarand PLAYERSTATUS? 64 addvar digx 7
      ifvarand PLAYERSTATUS? 128 addvar digx 7
      ifvarand PLAYERSTATUS? 256 addvar digx 7
      ifvarand PLAYERSTATUS? 512 addvar digx 7
      ifvarand PLAYERSTATUS? 1024 addvar digx 7
      setvar tilenum 8111
      ifvarl PLAYERBLITZKRIEGTIMER 130 { state shadepulse4 addvar shade 8 }
	state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 0 // Buffs are Positive
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname PLAYERBLITZKRIEGTIMER
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     ifvarand PLAYERSTATUS? 4096 // Triad Booster
     {
      setvar digx 32 // 120
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
      ifvarand PLAYERSTATUS? 8 addvar digx 7
      ifvarand PLAYERSTATUS? 16 addvar digx 7
      ifvarand PLAYERSTATUS? 32 addvar digx 7
      ifvarand PLAYERSTATUS? 64 addvar digx 7
      ifvarand PLAYERSTATUS? 128 addvar digx 7
      ifvarand PLAYERSTATUS? 256 addvar digx 7
      ifvarand PLAYERSTATUS? 512 addvar digx 7
      ifvarand PLAYERSTATUS? 1024 addvar digx 7
      ifvarand PLAYERSTATUS? 2048 addvar digx 7
      setvar tilenum 8112
      ifvarl PLAYERBOOSTERTIMER 130 { state shadepulse4 addvar shade 8 }
	state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 0 // Buffs are Positive
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname PLAYERBOOSTERTIMER
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     ifvarand PLAYERSTATUS? 8192 // Bloodlusting
     {
      setvar digx 32 // 128
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
      ifvarand PLAYERSTATUS? 8 addvar digx 7
      ifvarand PLAYERSTATUS? 16 addvar digx 7
      ifvarand PLAYERSTATUS? 32 addvar digx 7
      ifvarand PLAYERSTATUS? 64 addvar digx 7
      ifvarand PLAYERSTATUS? 128 addvar digx 7
      ifvarand PLAYERSTATUS? 256 addvar digx 7
      ifvarand PLAYERSTATUS? 512 addvar digx 7
      ifvarand PLAYERSTATUS? 1024 addvar digx 7
      ifvarand PLAYERSTATUS? 2048 addvar digx 7
      ifvarand PLAYERSTATUS? 4096 addvar digx 7
      setvar tilenum 8113
      ifvarl PLAYERBLOODLUSTTIMER 130 { state shadepulse4 addvar shade 8 }
	state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 0 // Buffs are Positive
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname PLAYERBLOODLUSTTIMER
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }

     state digz12288
     // Show Quad Damage Icon
     ifvarg QUADTIME 0
     {
 	setvar digx 32 // 136
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
      ifvarand PLAYERSTATUS? 8 addvar digx 7
      ifvarand PLAYERSTATUS? 16 addvar digx 7
      ifvarand PLAYERSTATUS? 32 addvar digx 7
      ifvarand PLAYERSTATUS? 64 addvar digx 7
      ifvarand PLAYERSTATUS? 128 addvar digx 7
      ifvarand PLAYERSTATUS? 256 addvar digx 7
      ifvarand PLAYERSTATUS? 512 addvar digx 7
      ifvarand PLAYERSTATUS? 1024 addvar digx 7
      ifvarand PLAYERSTATUS? 2048 addvar digx 7
      ifvarand PLAYERSTATUS? 4096 addvar digx 7
      ifvarand PLAYERSTATUS? 8192 addvar digx 7
      setvar tilenum 8071 // 5272
      ifvarl QUADTIME 130 { state shadepulse4 addvar shade 8 }
      state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 23 // Powerups are Unique
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname QUADTIME
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     state digz12288
     // Show Icon of The Defender Icon
     ifvarg INVULNTIME 0
     {
 	setvar digx 32 // 136
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
      ifvarand PLAYERSTATUS? 8 addvar digx 7
      ifvarand PLAYERSTATUS? 16 addvar digx 7
      ifvarand PLAYERSTATUS? 32 addvar digx 7
      ifvarand PLAYERSTATUS? 64 addvar digx 7
      ifvarand PLAYERSTATUS? 128 addvar digx 7
      ifvarand PLAYERSTATUS? 256 addvar digx 7
      ifvarand PLAYERSTATUS? 512 addvar digx 7
      ifvarand PLAYERSTATUS? 1024 addvar digx 7
      ifvarand PLAYERSTATUS? 2048 addvar digx 7
      ifvarand PLAYERSTATUS? 4096 addvar digx 7
      ifvarand PLAYERSTATUS? 8192 addvar digx 7
      ifvarg QUADTIME 0 addvar digx 7
      setvar tilenum 8072 // 5272
      ifvarl INVULNTIME 130 { state shadepulse4 addvar shade 8 }
      state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 23 // Powerups are Unique
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname INVULNTIME
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     // Show Regeneration Ankh Icon
     ifvarg REGENTIME 0
     {
 	setvar digx 32 // 136
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
      ifvarand PLAYERSTATUS? 8 addvar digx 7
      ifvarand PLAYERSTATUS? 16 addvar digx 7
      ifvarand PLAYERSTATUS? 32 addvar digx 7
      ifvarand PLAYERSTATUS? 64 addvar digx 7
      ifvarand PLAYERSTATUS? 128 addvar digx 7
      ifvarand PLAYERSTATUS? 256 addvar digx 7
      ifvarand PLAYERSTATUS? 512 addvar digx 7
      ifvarand PLAYERSTATUS? 1024 addvar digx 7
      ifvarand PLAYERSTATUS? 2048 addvar digx 7
      ifvarand PLAYERSTATUS? 4096 addvar digx 7
      ifvarand PLAYERSTATUS? 8192 addvar digx 7
      ifvarg QUADTIME 0 addvar digx 7
      ifvarg INVULNTIME 0 addvar digx 7
      setvar tilenum 8073 // 5272
      ifvarl REGENTIME 130 { state shadepulse4 addvar shade 8 }
      state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 23 // Powerups are Unique
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname REGENTIME
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     // Show Shield Emblem Icon
     ifvarg APREGENTIME 0
     {
 	setvar digx 32 // 136
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
      ifvarand PLAYERSTATUS? 8 addvar digx 7
      ifvarand PLAYERSTATUS? 16 addvar digx 7
      ifvarand PLAYERSTATUS? 32 addvar digx 7
      ifvarand PLAYERSTATUS? 64 addvar digx 7
      ifvarand PLAYERSTATUS? 128 addvar digx 7
      ifvarand PLAYERSTATUS? 256 addvar digx 7
      ifvarand PLAYERSTATUS? 512 addvar digx 7
      ifvarand PLAYERSTATUS? 1024 addvar digx 7
      ifvarand PLAYERSTATUS? 2048 addvar digx 7
      ifvarand PLAYERSTATUS? 4096 addvar digx 7
      ifvarand PLAYERSTATUS? 8192 addvar digx 7
      ifvarg QUADTIME 0 addvar digx 7
      ifvarg INVULNTIME 0 addvar digx 7
      ifvarg REGENTIME 0 addvar digx 7
      setvar tilenum 8074 // 5272
      ifvarl APREGENTIME 130 { state shadepulse4 addvar shade 8 }
      state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 23 // Powerups are Unique
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname APREGENTIME
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }
     // Show Vampire Mask Icon
     ifvarg VAMPIRETIME 0
     {
 	setvar digx 32 // 136
      ifvarand PLAYERSTATUS? 2 addvar digx 7
      ifvarand PLAYERSTATUS? 4 addvar digx 7
      ifvarand PLAYERSTATUS? 8 addvar digx 7
      ifvarand PLAYERSTATUS? 16 addvar digx 7
      ifvarand PLAYERSTATUS? 32 addvar digx 7
      ifvarand PLAYERSTATUS? 64 addvar digx 7
      ifvarand PLAYERSTATUS? 128 addvar digx 7
      ifvarand PLAYERSTATUS? 256 addvar digx 7
      ifvarand PLAYERSTATUS? 512 addvar digx 7
      ifvarand PLAYERSTATUS? 1024 addvar digx 7
      ifvarand PLAYERSTATUS? 2048 addvar digx 7
      ifvarand PLAYERSTATUS? 4096 addvar digx 7
      ifvarand PLAYERSTATUS? 8192 addvar digx 7
      ifvarg QUADTIME 0 addvar digx 7
      ifvarg INVULNTIME 0 addvar digx 7
      ifvarg REGENTIME 0 addvar digx 7
      ifvarg APREGENTIME 0 addvar digx 7
      setvar tilenum 8075 // 5272
      ifvarl VAMPIRETIME 130 { state shadepulse4 addvar shade 8 }
      state rs

	setvar tilenum 3087 // Blue Digital Text
	setvar pal 23 // Powerups are Unique
	addvar digx 3
	subvar digy 4
	setvar textscale 45056
	setvarvar varname VAMPIRETIME
	divvar varname 26
	state dnz

	subvar digx 3 // +25
	addvar digy 4 // +25
	setvar pal 0
	setvar shade 0
     }



	setvar shade 0
	state pal20
	state settile3087 

	state pal0
      //***EXP Stuff*** [w/ level in brackets]

      // Meter [EXP]
      	setvar digy 150 // 162
      ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 30	
	setvar digz 58982 // 65536
	setvar tilenum 7680 // 746
      state getexpmetertable
      setvarvar TEMPVAR2 TEMPVAR4
      subvarvar TEMPVAR2 TEMPVAR3
      setvarvar TEMPVAR6 TEMPVAR4
      subvarvar TEMPVAR6 EXPPTS
      setvarvar varname TEMPVAR2
      subvarvar varname TEMPVAR6

	setvarvar TEMPVAR5 varname
	mulvar TEMPVAR5 32
	ifvarn TEMPVAR2 0 divvarvar TEMPVAR5 TEMPVAR2
      ifvare PLAYERTEMPLEVEL 100 setvar TEMPVAR5 32
      ifvarl TEMPVAR5 0 setvar TEMPVAR5 0
      ifvarg TEMPVAR5 32 setvar TEMPVAR5 32
	// divvar TEMPVAR5 31

	addvarvar tilenum TEMPVAR5
	addvar shade 13
	state rs
	state settile3087 
	subvar shade 13

	// Display the word "EXP"
	setvar digy 151 // 163
      ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 18 // 288
	redefinequote 332 EXP
	state setquote332
	state mt
	// display the actual experience amount
	setvar digy 151 // 163
      ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 52 // 288
	setvarvar varname EXPPTS
	ifvarg varname -1 ifvarl varname 10 addvar digx 16
	else ifvarg varname 9 ifvarl varname 100 addvar digx 18
	else ifvarg varname 99 ifvarl varname 1000 addvar digx 20
	else ifvarg varname 999 ifvarl varname 10000 addvar digx 22
	else ifvarg varname 9999 ifvarl varname 100000 addvar digx 24
	else ifvarg varname 99999 ifvarl varname 1000000 addvar digx 26
	else ifvarg varname 999999 ifvarl varname 10000000 addvar digx 28
	else ifvarg varname 9999999 ifvarl varname 100000000 addvar digx 30
	state dn
	// Display the word "/" (for EXP)
      ifvarl PLAYERTEMPLEVEL 100
      {
	 setvar digy 151 // 163
       ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
       ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	 setvar digx 52 // 288
	 redefinequote 332 /
	 state setquote332
	 ifvarg EXPPTS -1 ifvarl EXPPTS 10 addvar digx 20
	 else ifvarg EXPPTS 9 ifvarl EXPPTS 100 addvar digx 24
	 else ifvarg EXPPTS 99 ifvarl EXPPTS 1000 addvar digx 28
	 else ifvarg EXPPTS 999 ifvarl EXPPTS 10000 addvar digx 32
	 else ifvarg EXPPTS 9999 ifvarl EXPPTS 100000 addvar digx 36
	 else ifvarg EXPPTS 99999 ifvarl EXPPTS 1000000 addvar digx 40
	 else ifvarg EXPPTS 999999 ifvarl EXPPTS 10000000 addvar digx 44
	 else ifvarg EXPPTS 9999999 ifvarl EXPPTS 100000000 addvar digx 48
	 // ifvarl PLAYERTEMPLEVEL 100 
	 state mt
      }
	// display the actual experience requirement amount
      ifvarl PLAYERTEMPLEVEL 100
	{
	 setvar digy 151 // 163
       ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
       ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	 setvar digx 52 // 288
	 setvarvar varname EXPTONEXT
	 ifvarg EXPPTS -1 ifvarl EXPPTS 10 addvar digx 28
	 else ifvarg EXPPTS 9 ifvarl EXPPTS 100 addvar digx 32
	 else ifvarg EXPPTS 99 ifvarl EXPPTS 1000 addvar digx 36
	 else ifvarg EXPPTS 999 ifvarl EXPPTS 10000 addvar digx 40
	 else ifvarg EXPPTS 9999 ifvarl EXPPTS 100000 addvar digx 44
	 else ifvarg EXPPTS 99999 ifvarl EXPPTS 1000000 addvar digx 48
	 else ifvarg EXPPTS 999999 ifvarl EXPPTS 10000000 addvar digx 52
	 else ifvarg EXPPTS 9999999 ifvarl EXPPTS 100000000 addvar digx 56
	 ifvarg varname -1 ifvarl varname 10 addvar digx 0
	 else ifvarg varname 9 ifvarl varname 100 addvar digx 2
	 else ifvarg varname 99 ifvarl varname 1000 addvar digx 4
	 else ifvarg varname 999 ifvarl varname 10000 addvar digx 6
	 else ifvarg varname 9999 ifvarl varname 100000 addvar digx 8
	 else ifvarg varname 99999 ifvarl varname 1000000 addvar digx 10 
	 else ifvarg varname 999999 ifvarl varname 10000000 addvar digx 12 
	 else ifvarg varname 9999999 ifvarl varname 100000000 addvar digx 14
 	 // ifvarl PLAYERTEMPLEVEL 100 
	 state dn
      }
	// Display EXP level [1 to 100]
	setvar digy 151 // 163
      ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 52 // 288
 	state shade0
	setvarvar varname PLAYERTEMPLEVEL
	ifvarl varname 11 state pal0
	ifvarg varname 10 ifvarl varname 21 state pal16
	ifvarg varname 20 ifvarl varname 31 state pal22
	ifvarg varname 30 ifvarl varname 41 state pal14
	ifvarg varname 40 ifvarl varname 51 state pal12
	ifvarg varname 50 ifvarl varname 61 state pal13
	ifvarg varname 60 ifvarl varname 71 state pal23
	ifvarg varname 70 ifvarl varname 81 state pal7
	ifvarg varname 80 ifvarl varname 91 state pal21
	ifvarg varname 90 ifvarl varname 100 state pal10
	ifvarg varname 99 state paletteflasher
	ifvarg EXPPTS -1 ifvarl EXPPTS 10 addvar digx 20
	else ifvarg EXPPTS 9 ifvarl EXPPTS 100 addvar digx 24
	else ifvarg EXPPTS 99 ifvarl EXPPTS 1000 addvar digx 28
	else ifvarg EXPPTS 999 ifvarl EXPPTS 10000 addvar digx 32
	else ifvarg EXPPTS 9999 ifvarl EXPPTS 100000 addvar digx 36
	else ifvarg EXPPTS 99999 ifvarl EXPPTS 1000000 addvar digx 40
	else ifvarg EXPPTS 999999 ifvarl EXPPTS 10000000 addvar digx 44
 	else ifvarg EXPPTS 9999999 ifvarl EXPPTS 100000000 addvar digx 48
      ifvarl PLAYERTEMPLEVEL 100 
      {
	 ifvarg EXPTONEXT -1 ifvarl EXPTONEXT 10 addvar digx 0
	 else ifvarg EXPTONEXT 9 ifvarl EXPTONEXT 100 addvar digx 4
	 else ifvarg EXPTONEXT 99 ifvarl EXPTONEXT 1000 addvar digx 8
	 else ifvarg EXPTONEXT 999 ifvarl EXPTONEXT 10000 addvar digx 12
	 else ifvarg EXPTONEXT 9999 ifvarl EXPTONEXT 100000 addvar digx 16
	 else ifvarg EXPTONEXT 99999 ifvarl EXPTONEXT 1000000 addvar digx 20 
	 else ifvarg EXPTONEXT 999999 ifvarl EXPTONEXT 10000000 addvar digx 24 
	 else ifvarg EXPTONEXT 9999999 ifvarl EXPTONEXT 100000000 addvar digx 28
	 addvar digx 14
      }
      else
      {
	 addvar digx 2
      }
  	redefinequote 332 
	redefinequote 401 [
	qstrcat 332 401
  	redefinequote 615 %ld
      qsprintf 615 615 PLAYERLEVEL
	qstrcat 332 615
	redefinequote 403 ]
	qstrcat 332 403
	state setquote332
	state mt   
	state pal0
	state shade0   


	state pal23
      //***RANK Stuff***

      // Meter [RANK]
      	setvar digy 156
      ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 30
	setvar digz 58982 // 65536
	setvar tilenum 7680 // 746
	setvarvar varname RANKPOINTS
	ifvarl varname -262143999
      {
       setvar TEMPVAR3 -262144000 setvar TEMPVAR4 -262144000
      }
	else ifvarg varname -262144000 ifvarl varname -65536000
      {
       setvar TEMPVAR3 -262144000 setvar TEMPVAR4 -65536000
      }
	else ifvarg varname -65536001 ifvarl varname -16384000 
      {
       setvar TEMPVAR3 -65536000 setvar TEMPVAR4 -16384000
      }
	else ifvarg varname -16384001 ifvarl varname -4096000
      {
       setvar TEMPVAR3 -16384000 setvar TEMPVAR4 -4096000
      }
	else ifvarg varname -4096001 ifvarl varname -1024000
      {
       setvar TEMPVAR3 -4096000 setvar TEMPVAR4 -1024000
      }
	else ifvarg varname -1024001 ifvarl varname -256000 
      {
       setvar TEMPVAR3 -1024000 setvar TEMPVAR4 -256000
      }
	else ifvarg varname -256001 ifvarl varname -64000 
      {
       setvar TEMPVAR3 -256000 setvar TEMPVAR4 -64000
      }
	else ifvarg varname -64001 ifvarl varname -16000
      {
       setvar TEMPVAR3 -64000 setvar TEMPVAR4 -16000
      }
	else ifvarg varname -16001 ifvarl varname -4000 
      {
       setvar TEMPVAR3 -16000 setvar TEMPVAR4 -4000
      }
	else ifvarg varname -4001 ifvarl varname 0
      {
       setvar TEMPVAR3 -4000 setvar TEMPVAR4 0
      }
	else ifvarg varname -1 ifvarl varname 4001
      {
       setvar TEMPVAR3 0 setvar TEMPVAR4 4000
      }
	else ifvarg varname 4000 ifvarl varname 16001
      {
       setvar TEMPVAR3 4000 setvar TEMPVAR4 16000
      }
	else ifvarg varname 16000 ifvarl varname 64001
      {
       setvar TEMPVAR3 16000 setvar TEMPVAR4 64000
      }
	else ifvarg varname 64000 ifvarl varname 256001
      {
       setvar TEMPVAR3 64000 setvar TEMPVAR4 256000
      }
	else ifvarg varname 256000 ifvarl varname 1024001
      {
       setvar TEMPVAR3 256000 setvar TEMPVAR4 1024000
      }
	else ifvarg varname 1024000 ifvarl varname 4096001
      {
       setvar TEMPVAR3 1024000 setvar TEMPVAR4 4096000
      }
	else ifvarg varname 4096000 ifvarl varname 16384001
      {
       setvar TEMPVAR3 4096000 setvar TEMPVAR4 16384000
      }
	else ifvarg varname 16384000 ifvarl varname 65536001
      {
       setvar TEMPVAR3 16384000 setvar TEMPVAR4 65536000
      }
	else ifvarg varname 65536000 ifvarl varname 262144000
      {
       setvar TEMPVAR3 65536000 setvar TEMPVAR4 262143999
      }
	else ifvarg varname 262143999
      {
       setvar TEMPVAR3 262143999 setvar TEMPVAR4 262143999
      }
      setvarvar TEMPVAR2 TEMPVAR4
      subvarvar TEMPVAR2 TEMPVAR3
      setvarvar TEMPVAR6 TEMPVAR4
      subvarvar TEMPVAR6 RANKPOINTS
      setvarvar varname TEMPVAR2
      subvarvar varname TEMPVAR6

	setvarvar TEMPVAR5 varname
	mulvar TEMPVAR5 32
	ifvarn TEMPVAR2 0 divvarvar TEMPVAR5 TEMPVAR2
      ifvarl RANKPOINTS -65536000 setvar TEMPVAR5 32
      ifvarg RANKPOINTS 65536000 setvar TEMPVAR5 32
      ifvarl TEMPVAR5 0 setvar TEMPVAR5 0
      ifvarg TEMPVAR5 32 setvar TEMPVAR5 32
	// divvar TEMPVAR5 31

	addvarvar tilenum TEMPVAR5
	addvar shade 13
	state rs
	state settile3087 
	subvar shade 13

	// Display the word "RANK"
	setvar digy 157 // 175
      ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 14 // 288

	redefinequote 332 RANK
	state setquote332
	state mt
	// display the actual rank point amount
	setvar digy 157 // 175
      ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 48 // 288

	setvarvar varname RANKPOINTS
	// ifvarg varname -10000000000 
	ifvarl varname -999999999 addvar digx 40
	else ifvarg varname -1000000000 ifvarl varname -99999999 addvar digx 38
	else ifvarg varname -100000000 ifvarl varname -9999999 addvar digx 36
	else ifvarg varname -10000000 ifvarl varname -999999 addvar digx 34
	else ifvarg varname -1000000 ifvarl varname -99999 addvar digx 32
	else ifvarg varname -100000 ifvarl varname -9999 addvar digx 30
	else ifvarg varname -10000 ifvarl varname -999 addvar digx 28
	else ifvarg varname -1000 ifvarl varname -99 addvar digx 26
	else ifvarg varname -100 ifvarl varname -9 addvar digx 24
	else ifvarg varname -10 ifvarl varname 0 addvar digx 22
	else ifvarg varname -1 ifvarl varname 10 addvar digx 20
	else ifvarg varname 9 ifvarl varname 100 addvar digx 22
	else ifvarg varname 99 ifvarl varname 1000 addvar digx 24
	else ifvarg varname 999 ifvarl varname 10000 addvar digx 26
	else ifvarg varname 9999 ifvarl varname 100000 addvar digx 28
	else ifvarg varname 99999 ifvarl varname 1000000 addvar digx 30
	else ifvarg varname 999999 ifvarl varname 10000000 addvar digx 32
	else ifvarg varname 9999999 ifvarl varname 100000000 addvar digx 34
	else ifvarg varname 99999999 ifvarl varname 1000000000 addvar digx 36
	else ifvarg varname 999999999 addvar digx 38
	state dn
	// Display RANK level [N to ZZ]

	setvar digy 157 // 175
      ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 48 // 288

	ifvarl RANKPOINTS -999999999 addvar digx 66
	else ifvarg RANKPOINTS -1000000000 ifvarl RANKPOINTS -99999999 addvar digx 62
	else ifvarg RANKPOINTS -100000000 ifvarl RANKPOINTS -9999999 addvar digx 58
	else ifvarg RANKPOINTS -10000000 ifvarl RANKPOINTS -999999 addvar digx 54
	else ifvarg RANKPOINTS -1000000 ifvarl RANKPOINTS -99999 addvar digx 50
	else ifvarg RANKPOINTS -100000 ifvarl RANKPOINTS -9999 addvar digx 46
	else ifvarg RANKPOINTS -10000 ifvarl RANKPOINTS -999 addvar digx 42
	else ifvarg RANKPOINTS -1000 ifvarl RANKPOINTS -99 addvar digx 38
	else ifvarg RANKPOINTS -100 ifvarl RANKPOINTS -9 addvar digx 34
	else ifvarg RANKPOINTS -10 ifvarl RANKPOINTS 0 addvar digx 30
	else ifvarg RANKPOINTS -1 ifvarl RANKPOINTS 10 addvar digx 26
	else ifvarg RANKPOINTS 9 ifvarl RANKPOINTS 100 addvar digx 30
	else ifvarg RANKPOINTS 99 ifvarl RANKPOINTS 1000 addvar digx 34
	else ifvarg RANKPOINTS 999 ifvarl RANKPOINTS 10000 addvar digx 38
	else ifvarg RANKPOINTS 9999 ifvarl RANKPOINTS 100000 addvar digx 42
	else ifvarg RANKPOINTS 99999 ifvarl RANKPOINTS 1000000 addvar digx 46
	else ifvarg RANKPOINTS 999999 ifvarl RANKPOINTS 10000000 addvar digx 50
	else ifvarg RANKPOINTS 9999999 ifvarl RANKPOINTS 100000000 addvar digx 54
	else ifvarg RANKPOINTS 99999999 ifvarl RANKPOINTS 1000000000 addvar digx 58
	else ifvarg RANKPOINTS 999999999 addvar digx 62
	state shade0   
	setvarvar varname RANKPOINTS
	ifvarl varname -262143999
      {
       state pal15 redefinequote 332 [0]
      }
	else ifvarg varname -262144000 ifvarl varname -65536000
      {
       state pal15 redefinequote 332 [N]
      }
	else ifvarg varname -65536001 ifvarl varname -16384000 
      {
       state pal15 redefinequote 332 [M]
      }
	else ifvarg varname -16384001 ifvarl varname -4096000
      {
       state pal15 redefinequote 332 [L]
      }
	else ifvarg varname -4096001 ifvarl varname -1024000
      {
       state pal15 redefinequote 332 [K]
      }
	else ifvarg varname -1024001 ifvarl varname -256000 
      {
       state pal21 redefinequote 332 [J]
      }
	else ifvarg varname -256001 ifvarl varname -64000 
      {
       state pal21 redefinequote 332 [I]
      }
	else ifvarg varname -64001 ifvarl varname -16000
      {
       state pal21 redefinequote 332 [H]
      }
	else ifvarg varname -16001 ifvarl varname -4000 
      {
       state pal21 redefinequote 332 [G]
      }
	else ifvarg varname -4001 ifvarl varname 0
      {
       state pal21 redefinequote 332 [F]
      }
	else ifvare varname 0
      {
       state pal20 redefinequote 332 [-]
      }
	else ifvarg varname 0 ifvarl varname 4001
      {
       state pal0 redefinequote 332 [E]
      }
	else ifvarg varname 4000 ifvarl varname 16001
      {
       state pal0 redefinequote 332 [D]
      }
	else ifvarg varname 16000 ifvarl varname 64001
      {
       state pal0 redefinequote 332 [C]
      }
	else ifvarg varname 64000 ifvarl varname 256001
      {
       state pal0 redefinequote 332 [B]
      }
	else ifvarg varname 256000 ifvarl varname 1024001
      {
       state pal0 redefinequote 332 [A]
      }
	else ifvarg varname 1024000 ifvarl varname 4096001
      {
       state pal22 redefinequote 332 [S]
      }
	else ifvarg varname 4096000 ifvarl varname 16384001
      {
       state pal22 redefinequote 332 [SS]
      }
	else ifvarg varname 16384000 ifvarl varname 65536000
      {
       state pal22 redefinequote 332 [Z]
      }
	else ifvarg varname 65535999 ifvarl varname 262144000
      {
       state shadepulse
       state pal22 redefinequote 332 [ZZ]
      }
	else ifvarg varname 262143999
      {
       state shadepulse state paletteflasher redefinequote 332 [NR]
      }
	state setquote332
	state mt   
	state pal0
	state shade0   
//

      // ***HP/AP Stuff***

      setvarvar TEMPVAR2 DISPLAYHPFLASHTIMER
      state displayhealthflashtimers
      ifvarl HPFACTOR 251 state shadepulse

      // Meter [HP]
      	setvar digy 162
      ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 30
	setvar digz 58982 // 65536
	setvar tilenum 7680 // 746
	setvarvar TEMPVAR5 HPFACTOR
	divvar TEMPVAR5 31
	addvarvar tilenum TEMPVAR5
	addvar shade 13
	state rs
	state settile3087 
	subvar shade 13

	// Display the word "HP"
	setvar digy 163
      ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 22 // 288
	redefinequote 332 HP
	state setquote332
	state mt
	// Shows "Current HP" 
	setvar digy 163 // 175
      ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 56 // 288
      setvarvar varname CURRENTHITPOINTS
	ifvarg CURRENTHITPOINTS -1 ifvarl CURRENTHITPOINTS 10 addvar digx 12
	else ifvarg CURRENTHITPOINTS 9 ifvarl CURRENTHITPOINTS 100 addvar digx 14
	else ifvarg CURRENTHITPOINTS 99 ifvarl CURRENTHITPOINTS 1000 addvar digx 16
	else ifvarg CURRENTHITPOINTS 999 ifvarl CURRENTHITPOINTS 10000 addvar digx 18
	else ifvarg CURRENTHITPOINTS 9999 ifvarl CURRENTHITPOINTS 100000 addvar digx 20
	else ifvarg CURRENTHITPOINTS 99999 ifvarl CURRENTHITPOINTS 1000000 addvar digx 22
	else ifvarg CURRENTHITPOINTS 999999 ifvarl CURRENTHITPOINTS 10000000 addvar digx 24
	else ifvarg CURRENTHITPOINTS 9999999 ifvarl CURRENTHITPOINTS 100000000 addvar digx 26
 	state dn
	// Display the word "/" (for HP)
	setvar digy 163
      ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 56 // 288
	redefinequote 332 /
	state setquote332
	ifvarg CURRENTHITPOINTS -1 ifvarl CURRENTHITPOINTS 10 addvar digx 16
	else ifvarg CURRENTHITPOINTS 9 ifvarl CURRENTHITPOINTS 100 addvar digx 20
	else ifvarg CURRENTHITPOINTS 99 ifvarl CURRENTHITPOINTS 1000 addvar digx 24
	else ifvarg CURRENTHITPOINTS 999 ifvarl CURRENTHITPOINTS 10000 addvar digx 28
	else ifvarg CURRENTHITPOINTS 9999 ifvarl CURRENTHITPOINTS 100000 addvar digx 32
	else ifvarg CURRENTHITPOINTS 99999 ifvarl CURRENTHITPOINTS 1000000 addvar digx 36
	else ifvarg CURRENTHITPOINTS 999999 ifvarl CURRENTHITPOINTS 10000000 addvar digx 40
	else ifvarg CURRENTHITPOINTS 9999999 ifvarl CURRENTHITPOINTS 100000000 addvar digx 44
	state mt
	// Shows "Maximum HP" 
	setvar digy 163
      ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 56 // 288
	setvarvar varname MAXHITPOINTS
	ifvarg CURRENTHITPOINTS -1 ifvarl CURRENTHITPOINTS 10 addvar digx 16
	else ifvarg CURRENTHITPOINTS 9 ifvarl CURRENTHITPOINTS 100 addvar digx 20
	else ifvarg CURRENTHITPOINTS 99 ifvarl CURRENTHITPOINTS 1000 addvar digx 24
	else ifvarg CURRENTHITPOINTS 999 ifvarl CURRENTHITPOINTS 10000 addvar digx 28
	else ifvarg CURRENTHITPOINTS 9999 ifvarl CURRENTHITPOINTS 100000 addvar digx 32
	else ifvarg CURRENTHITPOINTS 99999 ifvarl CURRENTHITPOINTS 1000000 addvar digx 36
	else ifvarg CURRENTHITPOINTS 999999 ifvarl CURRENTHITPOINTS 10000000 addvar digx 40
	else ifvarg CURRENTHITPOINTS 9999999 ifvarl CURRENTHITPOINTS 100000000 addvar digx 44
	ifvarg MAXHITPOINTS -1 ifvarl MAXHITPOINTS 10 addvar digx 8
	else ifvarg MAXHITPOINTS 9 ifvarl MAXHITPOINTS 100 addvar digx 10
	else ifvarg MAXHITPOINTS 99 ifvarl MAXHITPOINTS 1000 addvar digx 12
	else ifvarg MAXHITPOINTS 999 ifvarl MAXHITPOINTS 10000 addvar digx 14
	else ifvarg MAXHITPOINTS 9999 ifvarl MAXHITPOINTS 100000 addvar digx 16
	else ifvarg MAXHITPOINTS 99999 ifvarl MAXHITPOINTS 1000000 addvar digx 18
	else ifvarg MAXHITPOINTS 999999 ifvarl MAXHITPOINTS 10000000 addvar digx 20
	else ifvarg MAXHITPOINTS 9999999 ifvarl MAXHITPOINTS 100000000 addvar digx 22
 	state dn

	// Adding FA to this line [for compression]
    ifvarg FIRSTAIDCURRENT 0
    {
     setvarvar TEMPVAR2 DISPLAYHPFLASHTIMER
     state displayhealthflashtimers
     ifvarl FAFACTOR 251 state shadepulse else setvar shade 4

	 // Display Medikit Value
	 setvar digy 163
     ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
     ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	 setvar digx 56 // 288
	 ifvarg CURRENTHITPOINTS -1 ifvarl CURRENTHITPOINTS 10 addvar digx 16
	 else ifvarg CURRENTHITPOINTS 9 ifvarl CURRENTHITPOINTS 100 addvar digx 20
	 else ifvarg CURRENTHITPOINTS 99 ifvarl CURRENTHITPOINTS 1000 addvar digx 24
	 else ifvarg CURRENTHITPOINTS 999 ifvarl CURRENTHITPOINTS 10000 addvar digx 28
	 else ifvarg CURRENTHITPOINTS 9999 ifvarl CURRENTHITPOINTS 100000 addvar digx 32
	 else ifvarg CURRENTHITPOINTS 99999 ifvarl CURRENTHITPOINTS 1000000 addvar digx 36
	 else ifvarg CURRENTHITPOINTS 999999 ifvarl CURRENTHITPOINTS 10000000 addvar digx 40
	 else ifvarg CURRENTHITPOINTS 9999999 ifvarl CURRENTHITPOINTS 100000000 addvar digx 44
	 ifvarg MAXHITPOINTS -1 ifvarl MAXHITPOINTS 10 addvar digx 2
	 else ifvarg MAXHITPOINTS 9 ifvarl MAXHITPOINTS 100 addvar digx 6
	 else ifvarg MAXHITPOINTS 99 ifvarl MAXHITPOINTS 1000 addvar digx 10
	 else ifvarg MAXHITPOINTS 999 ifvarl MAXHITPOINTS 10000 addvar digx 14
	 else ifvarg MAXHITPOINTS 9999 ifvarl MAXHITPOINTS 100000 addvar digx 18
	 else ifvarg MAXHITPOINTS 99999 ifvarl MAXHITPOINTS 1000000 addvar digx 24
	 else ifvarg MAXHITPOINTS 999999 ifvarl MAXHITPOINTS 10000000 addvar digx 28
 	 else ifvarg MAXHITPOINTS 9999999 ifvarl MAXHITPOINTS 100000000 addvar digx 32
     addvar digx 13
 	 // state dn
	 redefinequote 332 
	 redefinequote 411 (
	 qstrcat 332 411
  	 redefinequote 615 %ld 
     qsprintf 615 615 FIRSTAIDCURRENT
	 qstrcat 332 615

     ifvare automedikittoggle 1
     { 
	  redefinequote 412 <AUTO>
	  qstrcat 332 412
     }
     else
     {
	  redefinequote 412 [
	  qstrcat 332 412
	  getkeyname 413 35 0
	  qstrcat 332 413
	  redefinequote 414 ]
	  qstrcat 332 414
     }
	 redefinequote 415 )
	 qstrcat 332 415

	 state setquote332
	 state mt 
    }
	else // Shows a display to let you know you can press the medikit button to quick-give a reserve medikit
	{
     state checkportablemedikits
     ifvarg ITEMARRAYID_AMOUNTTEMP 0
	 {
	  // Display Medikit Value
	  setvar digy 163
      ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	  setvar digx 56 // 288
	  ifvarg CURRENTHITPOINTS -1 ifvarl CURRENTHITPOINTS 10 addvar digx 16
	  else ifvarg CURRENTHITPOINTS 9 ifvarl CURRENTHITPOINTS 100 addvar digx 20
	  else ifvarg CURRENTHITPOINTS 99 ifvarl CURRENTHITPOINTS 1000 addvar digx 24
	  else ifvarg CURRENTHITPOINTS 999 ifvarl CURRENTHITPOINTS 10000 addvar digx 28
	  else ifvarg CURRENTHITPOINTS 9999 ifvarl CURRENTHITPOINTS 100000 addvar digx 32
	  else ifvarg CURRENTHITPOINTS 99999 ifvarl CURRENTHITPOINTS 1000000 addvar digx 36
	  else ifvarg CURRENTHITPOINTS 999999 ifvarl CURRENTHITPOINTS 10000000 addvar digx 40
	  else ifvarg CURRENTHITPOINTS 9999999 ifvarl CURRENTHITPOINTS 100000000 addvar digx 44
	  ifvarg MAXHITPOINTS -1 ifvarl MAXHITPOINTS 10 addvar digx 2
	  else ifvarg MAXHITPOINTS 9 ifvarl MAXHITPOINTS 100 addvar digx 6
	  else ifvarg MAXHITPOINTS 99 ifvarl MAXHITPOINTS 1000 addvar digx 10
	  else ifvarg MAXHITPOINTS 999 ifvarl MAXHITPOINTS 10000 addvar digx 14
	  else ifvarg MAXHITPOINTS 9999 ifvarl MAXHITPOINTS 100000 addvar digx 18
	  else ifvarg MAXHITPOINTS 99999 ifvarl MAXHITPOINTS 1000000 addvar digx 24
	  else ifvarg MAXHITPOINTS 999999 ifvarl MAXHITPOINTS 10000000 addvar digx 28
 	  else ifvarg MAXHITPOINTS 9999999 ifvarl MAXHITPOINTS 100000000 addvar digx 32
      addvar digx 13
 	  // state dn
	  redefinequote 332 
	  redefinequote 411 (
	  qstrcat 332 411
  	  redefinequote 615 %ld FA KITS 
      qsprintf 615 615 ITEMARRAYID_AMOUNTTEMP
	  qstrcat 332 615

	  redefinequote 412 [
	  qstrcat 332 412
	  getkeyname 413 35 0
	  qstrcat 332 413
	  redefinequote 414 ]
	  qstrcat 332 414

	  redefinequote 415 )
	  qstrcat 332 415

	  state setquote332
 	  state mt 
	
	
	 }
	}
      state shade0 state pal0
/*
     // Heal/DMG Display
     setvar tilenum 2822 
     setvar temp 332
     setvar digy 168 addvar digy 1
     setvarvar digx digx_test
     setvar textscale 40960
     setvar pal 21
     redefinequote 332 +2097152
     state gtz     
*/
     state settile3087 
     state shade0 state pal0
      state shade0

      ifvarg CURRENTARMORPOINTS 0
      {
       setvarvar TEMPVAR2 DISPLAYAPFLASHTIMER
       state displayarmorflashtimers
       ifvarl APFACTOR 251 state shadepulse 

       // Meter [AP]
	 setvar digy 168
       ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	 setvar digx 30
	 setvar digz 58982 // 65536
	 setvar tilenum 7680 // 746
	 setvarvar TEMPVAR5 APFACTOR
	 divvar TEMPVAR5 31
	 addvarvar tilenum TEMPVAR5
	 addvar shade 13
	 state rs
	 state settile3087 
	 subvar shade 13

	 // Display the word "AP"
	 setvar digy 169
       ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	 setvar digx 22 // 288
	 redefinequote 332 AP
	 state setquote332
	 state mt
	 // Shows "Current AP"
	 setvar digy 169 // 175
       ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	 setvar digx 56 // 288
	 setvarvar varname CURRENTARMORPOINTS
	 ifvarg CURRENTARMORPOINTS -1 ifvarl CURRENTARMORPOINTS 10 addvar digx 12
	 else ifvarg CURRENTARMORPOINTS 9 ifvarl CURRENTARMORPOINTS 100 addvar digx 14
	 else ifvarg CURRENTARMORPOINTS 99 ifvarl CURRENTARMORPOINTS 1000 addvar digx 16
	 else ifvarg CURRENTARMORPOINTS 999 ifvarl CURRENTARMORPOINTS 10000 addvar digx 18
	 else ifvarg CURRENTARMORPOINTS 9999 ifvarl CURRENTARMORPOINTS 100000 addvar digx 20
	 else ifvarg CURRENTARMORPOINTS 99999 ifvarl CURRENTARMORPOINTS 1000000 addvar digx 22
	 else ifvarg CURRENTARMORPOINTS 999999 ifvarl CURRENTARMORPOINTS 10000000 addvar digx 24
	 else ifvarg CURRENTARMORPOINTS 9999999 ifvarl CURRENTARMORPOINTS 100000000 addvar digx 26
 	 state dn
	 // Display the word "/" (for AP)
	 setvar digy 169
       ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	 setvar digx 56 // 288
	 redefinequote 332 /
	 state setquote332
	 ifvarg CURRENTARMORPOINTS -1 ifvarl CURRENTARMORPOINTS 10 addvar digx 16
	 else ifvarg CURRENTARMORPOINTS 9 ifvarl CURRENTARMORPOINTS 100 addvar digx 20
	 else ifvarg CURRENTARMORPOINTS 99 ifvarl CURRENTARMORPOINTS 1000 addvar digx 24
	 else ifvarg CURRENTARMORPOINTS 999 ifvarl CURRENTARMORPOINTS 10000 addvar digx 28
	 else ifvarg CURRENTARMORPOINTS 9999 ifvarl CURRENTARMORPOINTS 100000 addvar digx 32
	 else ifvarg CURRENTARMORPOINTS 99999 ifvarl CURRENTARMORPOINTS 1000000 addvar digx 36
	 else ifvarg CURRENTARMORPOINTS 999999 ifvarl CURRENTARMORPOINTS 10000000 addvar digx 40
	 else ifvarg CURRENTARMORPOINTS 9999999 ifvarl CURRENTARMORPOINTS 100000000 addvar digx 44
	 state mt
	 // Shows "Maximum AP" 
	 setvar digy 169
       ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	 setvar digx 56 // 288
	 setvarvar varname MAXARMORPOINTS
	 ifvarg CURRENTARMORPOINTS -1 ifvarl CURRENTARMORPOINTS 10 addvar digx 16
	 else ifvarg CURRENTARMORPOINTS 9 ifvarl CURRENTARMORPOINTS 100 addvar digx 20
	 else ifvarg CURRENTARMORPOINTS 99 ifvarl CURRENTARMORPOINTS 1000 addvar digx 24
	 else ifvarg CURRENTARMORPOINTS 999 ifvarl CURRENTARMORPOINTS 10000 addvar digx 28
	 else ifvarg CURRENTARMORPOINTS 9999 ifvarl CURRENTARMORPOINTS 100000 addvar digx 32
	 else ifvarg CURRENTARMORPOINTS 99999 ifvarl CURRENTARMORPOINTS 1000000 addvar digx 36
	 else ifvarg CURRENTARMORPOINTS 999999 ifvarl CURRENTARMORPOINTS 10000000 addvar digx 40
	 else ifvarg CURRENTARMORPOINTS 9999999 ifvarl CURRENTARMORPOINTS 100000000 addvar digx 44
	 ifvarg MAXARMORPOINTS -1 ifvarl MAXARMORPOINTS 10 addvar digx 8
	 else ifvarg MAXARMORPOINTS 9 ifvarl MAXARMORPOINTS 100 addvar digx 10
	 else ifvarg MAXARMORPOINTS 99 ifvarl MAXARMORPOINTS 1000 addvar digx 12
	 else ifvarg MAXARMORPOINTS 999 ifvarl MAXARMORPOINTS 10000 addvar digx 14
	 else ifvarg MAXARMORPOINTS 9999 ifvarl MAXARMORPOINTS 100000 addvar digx 16
	 else ifvarg MAXARMORPOINTS 99999 ifvarl MAXARMORPOINTS 1000000 addvar digx 18
	 else ifvarg MAXARMORPOINTS 999999 ifvarl MAXARMORPOINTS 10000000 addvar digx 20
	 else ifvarg MAXARMORPOINTS 9999999 ifvarl MAXARMORPOINTS 100000000 addvar digx 22
 	 state dn
       // Adding AB% to this line [for compression]
       ifvarg ARMORPERCENT 0
       { 
	  // Display Medikit Value
	  setvar digy 169
        ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	  setvar digx 56 // 288
	  ifvarg CURRENTARMORPOINTS -1 ifvarl CURRENTARMORPOINTS 10 addvar digx 16
	  else ifvarg CURRENTARMORPOINTS 9 ifvarl CURRENTARMORPOINTS 100 addvar digx 20
	  else ifvarg CURRENTARMORPOINTS 99 ifvarl CURRENTARMORPOINTS 1000 addvar digx 24
	  else ifvarg CURRENTARMORPOINTS 999 ifvarl CURRENTARMORPOINTS 10000 addvar digx 28
	  else ifvarg CURRENTARMORPOINTS 9999 ifvarl CURRENTARMORPOINTS 100000 addvar digx 32
	  else ifvarg CURRENTARMORPOINTS 99999 ifvarl CURRENTARMORPOINTS 1000000 addvar digx 36
	  else ifvarg CURRENTARMORPOINTS 999999 ifvarl CURRENTARMORPOINTS 10000000 addvar digx 40
	  else ifvarg CURRENTARMORPOINTS 9999999 ifvarl CURRENTARMORPOINTS 100000000 addvar digx 44
	  ifvarg MAXARMORPOINTS -1 ifvarl MAXARMORPOINTS 10 addvar digx 2
	  else ifvarg MAXARMORPOINTS 9 ifvarl MAXARMORPOINTS 100 addvar digx 6
	  else ifvarg MAXARMORPOINTS 99 ifvarl MAXARMORPOINTS 1000 addvar digx 10
	  else ifvarg MAXARMORPOINTS 999 ifvarl MAXARMORPOINTS 10000 addvar digx 14
	  else ifvarg MAXARMORPOINTS 9999 ifvarl MAXARMORPOINTS 100000 addvar digx 18
	  else ifvarg MAXARMORPOINTS 99999 ifvarl MAXARMORPOINTS 1000000 addvar digx 24
	  else ifvarg MAXARMORPOINTS 999999 ifvarl MAXARMORPOINTS 10000000 addvar digx 28
 	  else ifvarg MAXARMORPOINTS 9999999 ifvarl MAXARMORPOINTS 100000000 addvar digx 32
        addvar digx 13
	  redefinequote 332 
	  redefinequote 411 (
	  qstrcat 332 411
 	  // Display Armor Absorbsion %
	  setvarvar PERCENTUPPER ARMORPERCENT
	  divvar PERCENTUPPER 10
	  setvarvar PERCENTLOWER ARMORPERCENT
	  modvar PERCENTLOWER 10
	  qsprintf 222 223 PERCENTUPPER PERCENTLOWER
	  qstrcat 332 222
	  redefinequote 412 )
	  qstrcat 332 412

	  state mt
       }

      }
      state shade0 // stops future shadepulses from leaking out

/*
     // Heal/DMG Display
     setvar tilenum 2822 
     setvar temp 332
     setvar digy 174 addvar digy 1
     setvarvar digx digx_test
     setvar textscale 40960
     setvar pal 22
     redefinequote 332 +2097152
     state gtz     
*/

     state settile3087 
     state shade0 state pal0
      state shade0 state pal0

      state pal0
      setvarvar EPFACTOR CURRENTENERGYPOINTS
      mulvar EPFACTOR 1000
      divvarvar EPFACTOR MAXENERGYPOINTS
      ifvarl EPFACTOR 251 state shadepulse

      // Meter
      	setvar digy 174
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 30
	setvar digz 58982 // 65536
	setvar tilenum 7680 // 746
	setvarvar TEMPVAR5 EPFACTOR
	divvar TEMPVAR5 31
	addvarvar tilenum TEMPVAR5
	addvar shade 13
	state rs
	state settile3087 
	subvar shade 13

	// Display the word "EP"
	setvar digy 175
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 22 // 288
	redefinequote 332 EP
	state setquote332
	state mt
	// Shows "Current EP"
	setvar digy 175 // 175
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 56 // 288
	setvarvar varname CURRENTENERGYPOINTS
	ifvarg CURRENTENERGYPOINTS -1 ifvarl CURRENTENERGYPOINTS 10 addvar digx 12
	else ifvarg CURRENTENERGYPOINTS 9 ifvarl CURRENTENERGYPOINTS 100 addvar digx 14
	else ifvarg CURRENTENERGYPOINTS 99 ifvarl CURRENTENERGYPOINTS 1000 addvar digx 16
	else ifvarg CURRENTENERGYPOINTS 999 ifvarl CURRENTENERGYPOINTS 10000 addvar digx 18
	else ifvarg CURRENTENERGYPOINTS 9999 ifvarl CURRENTENERGYPOINTS 100000 addvar digx 20
	else ifvarg CURRENTENERGYPOINTS 99999 ifvarl CURRENTENERGYPOINTS 1000000 addvar digx 22
	else ifvarg CURRENTENERGYPOINTS 999999 ifvarl CURRENTENERGYPOINTS 10000000 addvar digx 24
	else ifvarg CURRENTENERGYPOINTS 9999999 ifvarl CURRENTENERGYPOINTS 100000000 addvar digx 26
 	state dn
	// Display the word "/" (for EP)
	setvar digy 175
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 56 // 288
	redefinequote 332 /
	state setquote332
	ifvarg CURRENTENERGYPOINTS -1 ifvarl CURRENTENERGYPOINTS 10 addvar digx 16
	else ifvarg CURRENTENERGYPOINTS 9 ifvarl CURRENTENERGYPOINTS 100 addvar digx 20
	else ifvarg CURRENTENERGYPOINTS 99 ifvarl CURRENTENERGYPOINTS 1000 addvar digx 24
	else ifvarg CURRENTENERGYPOINTS 999 ifvarl CURRENTENERGYPOINTS 10000 addvar digx 28
	else ifvarg CURRENTENERGYPOINTS 9999 ifvarl CURRENTENERGYPOINTS 100000 addvar digx 32
	else ifvarg CURRENTENERGYPOINTS 99999 ifvarl CURRENTENERGYPOINTS 1000000 addvar digx 36
	else ifvarg CURRENTENERGYPOINTS 999999 ifvarl CURRENTENERGYPOINTS 10000000 addvar digx 40
	else ifvarg CURRENTENERGYPOINTS 9999999 ifvarl CURRENTENERGYPOINTS 100000000 addvar digx 44
	state mt
	// Shows "Maximum EP" 
	setvar digy 175
      ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
	setvar digx 56 // 288
	setvarvar varname MAXENERGYPOINTS
	ifvarg CURRENTENERGYPOINTS -1 ifvarl CURRENTENERGYPOINTS 10 addvar digx 16
	else ifvarg CURRENTENERGYPOINTS 9 ifvarl CURRENTENERGYPOINTS 100 addvar digx 20
	else ifvarg CURRENTENERGYPOINTS 99 ifvarl CURRENTENERGYPOINTS 1000 addvar digx 24
	else ifvarg CURRENTENERGYPOINTS 999 ifvarl CURRENTENERGYPOINTS 10000 addvar digx 28
	else ifvarg CURRENTENERGYPOINTS 9999 ifvarl CURRENTENERGYPOINTS 100000 addvar digx 32
	else ifvarg CURRENTENERGYPOINTS 99999 ifvarl CURRENTENERGYPOINTS 1000000 addvar digx 36
	else ifvarg CURRENTENERGYPOINTS 999999 ifvarl CURRENTENERGYPOINTS 10000000 addvar digx 40
	else ifvarg CURRENTENERGYPOINTS 9999999 ifvarl CURRENTENERGYPOINTS 100000000 addvar digx 44
	ifvarg MAXENERGYPOINTS -1 ifvarl MAXENERGYPOINTS 10 addvar digx 8
	else ifvarg MAXENERGYPOINTS 9 ifvarl MAXENERGYPOINTS 100 addvar digx 10
	else ifvarg MAXENERGYPOINTS 99 ifvarl MAXENERGYPOINTS 1000 addvar digx 12
	else ifvarg MAXENERGYPOINTS 999 ifvarl MAXENERGYPOINTS 10000 addvar digx 14
	else ifvarg MAXENERGYPOINTS 9999 ifvarl MAXENERGYPOINTS 100000 addvar digx 16
	else ifvarg MAXENERGYPOINTS 99999 ifvarl MAXENERGYPOINTS 1000000 addvar digx 18
	else ifvarg MAXENERGYPOINTS 999999 ifvarl MAXENERGYPOINTS 10000000 addvar digx 20
	else ifvarg MAXENERGYPOINTS 9999999 ifvarl MAXENERGYPOINTS 100000000 addvar digx 22
 	state dn
      state shade0 // stops future shadepulses from leaking out
/*
     // Heal/DMG Display
     setvar tilenum 2822 
     setvar temp 332
     setvar digy 180 addvar digy 1
     setvarvar digx digx_test
     setvar textscale 40960
     setvar pal 0
     redefinequote 332 +2097152
     state gtz     
*/
     state settile3087 
     state shade0 state pal0
     ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1
     {
      // Eshield
      setvarvar TEMPVAR5 CURRENTBIOSHIELDPOWER
      divvarvar TEMPVAR5 MAXHITPOINTS
      ifvarl TEMPVAR5 16 state pal0
      else ifvarg TEMPVAR5 15 ifvarl TEMPVAR5 64 state pal17
      else ifvarg TEMPVAR5 63 ifvarl TEMPVAR5 256 state pal23
      else ifvarg TEMPVAR5 255 ifvarl TEMPVAR5 1024 state pal21
      else ifvarg TEMPVAR5 1023 state pal20

      ifvare ENERGYSHIELDMODE 0
      {
       setvar shade 0
       addvar shade 12
       setvarvar EPFACTOR CURRENTBIOSHIELDPOWER
       mulvar EPFACTOR 1000
       divvarvar EPFACTOR MAXBIOSHIELDPOWER
      }
      else
      {
       setvarvar EPFACTOR CURRENTBIOSHIELDPOWER
       mulvar EPFACTOR 1000
       divvarvar EPFACTOR MAXBIOSHIELDPOWER
       ifvarl EPFACTOR 251 state shadepulse
      }

      // Meter
      	setvar digy 180
	setvar digx 30

	setvar digz 58982 // 65536
	setvar tilenum 7680 // 746
	setvarvar TEMPVAR5 EPFACTOR
	divvar TEMPVAR5 31
	addvarvar tilenum TEMPVAR5
	addvar shade 13
	state rs
	state settile3087 
	subvar shade 13

	// Display the word "ES"
	setvar digy 181
	setvar digx 22
	redefinequote 332 ES
	state setquote332
	state mt

	// Shows "Current ES"
	setvar digy 181 // 175
	setvar digx 56
	setvarvar varname CURRENTBIOSHIELDPOWER
	ifvarg CURRENTBIOSHIELDPOWER -1 ifvarl CURRENTBIOSHIELDPOWER 10 addvar digx 12
	else ifvarg CURRENTBIOSHIELDPOWER 9 ifvarl CURRENTBIOSHIELDPOWER 100 addvar digx 14
	else ifvarg CURRENTBIOSHIELDPOWER 99 ifvarl CURRENTBIOSHIELDPOWER 1000 addvar digx 16
	else ifvarg CURRENTBIOSHIELDPOWER 999 ifvarl CURRENTBIOSHIELDPOWER 10000 addvar digx 18
	else ifvarg CURRENTBIOSHIELDPOWER 9999 ifvarl CURRENTBIOSHIELDPOWER 100000 addvar digx 20
	else ifvarg CURRENTBIOSHIELDPOWER 99999 ifvarl CURRENTBIOSHIELDPOWER 1000000 addvar digx 22
	else ifvarg CURRENTBIOSHIELDPOWER 999999 ifvarl CURRENTBIOSHIELDPOWER 10000000 addvar digx 24
	else ifvarg CURRENTBIOSHIELDPOWER 9999999 ifvarl CURRENTBIOSHIELDPOWER 100000000 addvar digx 26
 	state dn
	// Display the word "/" (for ES)
	setvar digy 181
	setvar digx 56
	redefinequote 332 /
	state setquote332
	ifvarg CURRENTBIOSHIELDPOWER -1 ifvarl CURRENTBIOSHIELDPOWER 10 addvar digx 16
	else ifvarg CURRENTBIOSHIELDPOWER 9 ifvarl CURRENTBIOSHIELDPOWER 100 addvar digx 20
	else ifvarg CURRENTBIOSHIELDPOWER 99 ifvarl CURRENTBIOSHIELDPOWER 1000 addvar digx 24
	else ifvarg CURRENTBIOSHIELDPOWER 999 ifvarl CURRENTBIOSHIELDPOWER 10000 addvar digx 28
	else ifvarg CURRENTBIOSHIELDPOWER 9999 ifvarl CURRENTBIOSHIELDPOWER 100000 addvar digx 32
	else ifvarg CURRENTBIOSHIELDPOWER 99999 ifvarl CURRENTBIOSHIELDPOWER 1000000 addvar digx 36
	else ifvarg CURRENTBIOSHIELDPOWER 999999 ifvarl CURRENTBIOSHIELDPOWER 10000000 addvar digx 40
	else ifvarg CURRENTBIOSHIELDPOWER 9999999 ifvarl CURRENTBIOSHIELDPOWER 100000000 addvar digx 44
	state mt
	// Shows "Maximum ES" 
	setvar digy 181
	setvar digx 56 // 288
	setvarvar varname MAXBIOSHIELDPOWER
	ifvarg CURRENTBIOSHIELDPOWER -1 ifvarl CURRENTBIOSHIELDPOWER 10 addvar digx 16
	else ifvarg CURRENTBIOSHIELDPOWER 9 ifvarl CURRENTBIOSHIELDPOWER 100 addvar digx 20
	else ifvarg CURRENTBIOSHIELDPOWER 99 ifvarl CURRENTBIOSHIELDPOWER 1000 addvar digx 24
	else ifvarg CURRENTBIOSHIELDPOWER 999 ifvarl CURRENTBIOSHIELDPOWER 10000 addvar digx 28
	else ifvarg CURRENTBIOSHIELDPOWER 9999 ifvarl CURRENTBIOSHIELDPOWER 100000 addvar digx 32
	else ifvarg CURRENTBIOSHIELDPOWER 99999 ifvarl CURRENTBIOSHIELDPOWER 1000000 addvar digx 36
	else ifvarg CURRENTBIOSHIELDPOWER 999999 ifvarl CURRENTBIOSHIELDPOWER 10000000 addvar digx 40
	else ifvarg CURRENTBIOSHIELDPOWER 9999999 ifvarl CURRENTBIOSHIELDPOWER 100000000 addvar digx 44
	ifvarg MAXBIOSHIELDPOWER -1 ifvarl MAXBIOSHIELDPOWER 10 addvar digx 8
	else ifvarg MAXBIOSHIELDPOWER 9 ifvarl MAXBIOSHIELDPOWER 100 addvar digx 10
	else ifvarg MAXBIOSHIELDPOWER 99 ifvarl MAXBIOSHIELDPOWER 1000 addvar digx 12
	else ifvarg MAXBIOSHIELDPOWER 999 ifvarl MAXBIOSHIELDPOWER 10000 addvar digx 14
	else ifvarg MAXBIOSHIELDPOWER 9999 ifvarl MAXBIOSHIELDPOWER 100000 addvar digx 16
	else ifvarg MAXBIOSHIELDPOWER 99999 ifvarl MAXBIOSHIELDPOWER 1000000 addvar digx 18
	else ifvarg MAXBIOSHIELDPOWER 999999 ifvarl MAXBIOSHIELDPOWER 10000000 addvar digx 20
	else ifvarg MAXBIOSHIELDPOWER 9999999 ifvarl MAXBIOSHIELDPOWER 100000000 addvar digx 22
 	state dn
      state shade0
     }

      state shade0 state pal0 // Stops future shadepulses from leaking
	state pal21
	// Display the word "ATK"
	setvar digx 22 // 288
	setvar digy 187

	redefinequote 332 ATK
	state setquote332
	state mt
	// display the actual physical strength
	setvar digx 22 // 288
	setvar digy 187
	setvarvar varname PLAYERATTACK
	ifvarg PLAYERATTACK -1 ifvarl PLAYERATTACK 10 addvar digx 16
	else ifvarg PLAYERATTACK 9 ifvarl PLAYERATTACK 100 addvar digx 18
	else ifvarg PLAYERATTACK 99 ifvarl PLAYERATTACK 1000 addvar digx 20
	else ifvarg PLAYERATTACK 999 ifvarl PLAYERATTACK 10000 addvar digx 22
	else ifvarg PLAYERATTACK 9999 ifvarl PLAYERATTACK 100000 addvar digx 24
	else ifvarg PLAYERATTACK 99999 ifvarl PLAYERATTACK 1000000 addvar digx 26
	else ifvarg PLAYERATTACK 999999 ifvarl PLAYERATTACK 10000000 addvar digx 28
	else ifvarg PLAYERATTACK 9999999 ifvarl PLAYERATTACK 100000000 addvar digx 32
	state dn

	state pal22
	// Display the word "DEF"
	setvar digx 22 // 288
	setvar digy 187
	redefinequote 332 DEF
	state setquote332
	ifvarg PLAYERATTACK -1 ifvarl PLAYERATTACK 10 addvar digx 21
	else ifvarg PLAYERATTACK 9 ifvarl PLAYERATTACK 100 addvar digx 25
	else ifvarg PLAYERATTACK 99 ifvarl PLAYERATTACK 1000 addvar digx 29
	else ifvarg PLAYERATTACK 999 ifvarl PLAYERATTACK 10000 addvar digx 33
	else ifvarg PLAYERATTACK 9999 ifvarl PLAYERATTACK 100000 addvar digx 37
	else ifvarg PLAYERATTACK 99999 ifvarl PLAYERATTACK 1000000 addvar digx 41
	else ifvarg PLAYERATTACK 999999 ifvarl PLAYERATTACK 10000000 addvar digx 45
	else ifvarg PLAYERATTACK 9999999 ifvarl PLAYERATTACK 100000000 addvar digx 49
	state mt
	// display the actual physical defense
	setvar digx 22 // 288
	setvar digy 187
	setvarvar varname PLAYERDEFENSE
	ifvarg PLAYERATTACK -1 ifvarl PLAYERATTACK 10 addvar digx 21
	else ifvarg PLAYERATTACK 9 ifvarl PLAYERATTACK 100 addvar digx 25
	else ifvarg PLAYERATTACK 99 ifvarl PLAYERATTACK 1000 addvar digx 29
	else ifvarg PLAYERATTACK 999 ifvarl PLAYERATTACK 10000 addvar digx 33
	else ifvarg PLAYERATTACK 9999 ifvarl PLAYERATTACK 100000 addvar digx 37
	else ifvarg PLAYERATTACK 99999 ifvarl PLAYERATTACK 1000000 addvar digx 41
	else ifvarg PLAYERATTACK 999999 ifvarl PLAYERATTACK 10000000 addvar digx 45
	else ifvarg PLAYERATTACK 9999999 ifvarl PLAYERATTACK 100000000 addvar digx 49
	ifvarg PLAYERDEFENSE -1 ifvarl PLAYERDEFENSE 10 addvar digx 16
	else ifvarg PLAYERDEFENSE 9 ifvarl PLAYERDEFENSE 100 addvar digx 18
	else ifvarg PLAYERDEFENSE 99 ifvarl PLAYERDEFENSE 1000 addvar digx 20
	else ifvarg PLAYERDEFENSE 999 ifvarl PLAYERDEFENSE 10000 addvar digx 22
	else ifvarg PLAYERDEFENSE 9999 ifvarl PLAYERDEFENSE 100000 addvar digx 24
	else ifvarg PLAYERDEFENSE 99999 ifvarl PLAYERDEFENSE 1000000 addvar digx 26
	else ifvarg PLAYERDEFENSE 999999 ifvarl PLAYERDEFENSE 10000000 addvar digx 28
	else ifvarg PLAYERDEFENSE 9999999 ifvarl PLAYERDEFENSE 100000000 addvar digx 30
	state dn

	state pal20

/*
      // Meter
      	setvar digy 186
	setvar digx 21 addvar digx 12
	setvar digz 58982 // 65536
	ifvarg PLAYERATTACK -1 ifvarl PLAYERATTACK 10 addvar digx 21
	else ifvarg PLAYERATTACK 9 ifvarl PLAYERATTACK 100 addvar digx 25
	else ifvarg PLAYERATTACK 99 ifvarl PLAYERATTACK 1000 addvar digx 29
	else ifvarg PLAYERATTACK 999 ifvarl PLAYERATTACK 10000 addvar digx 33
	else ifvarg PLAYERATTACK 9999 ifvarl PLAYERATTACK 100000 addvar digx 37
	else ifvarg PLAYERATTACK 99999 ifvarl PLAYERATTACK 1000000 addvar digx 41
	else ifvarg PLAYERATTACK 999999 ifvarl PLAYERATTACK 10000000 addvar digx 45
	else ifvarg PLAYERATTACK 9999999 ifvarl PLAYERATTACK 100000000 addvar digx 49
	ifvarg PLAYERDEFENSE -1 ifvarl PLAYERDEFENSE 10 addvar digx 21
	else ifvarg PLAYERDEFENSE 9 ifvarl PLAYERDEFENSE 100 addvar digx 25
	else ifvarg PLAYERDEFENSE 99 ifvarl PLAYERDEFENSE 1000 addvar digx 29
	else ifvarg PLAYERDEFENSE 999 ifvarl PLAYERDEFENSE 10000 addvar digx 33
	else ifvarg PLAYERDEFENSE 9999 ifvarl PLAYERDEFENSE 100000 addvar digx 37
	else ifvarg PLAYERDEFENSE 99999 ifvarl PLAYERDEFENSE 1000000 addvar digx 41
	else ifvarg PLAYERDEFENSE 999999 ifvarl PLAYERDEFENSE 10000000 addvar digx 45
	else ifvarg PLAYERDEFENSE 9999999 ifvarl PLAYERDEFENSE 100000000 addvar digx 49
      ifvarand PLAYERSTATUS? 2 state paletteflasher else ifvarand PLAYERSTATUS? 4 { state shadepulse4 addvar shade 10 }
	setvar tilenum 7680 // 746
      ifvare debugtoggle 1 setvarvar CHARACTERSPEEDVISUAL CHARACTERSPEEDDEBUG else setvarvar CHARACTERSPEEDVISUAL CHARACTERSPEEDSTAT
      ifvare debugtoggle 1
      {
	 setvarvar TEMPVAR4 CHARACTERSPEEDVISUAL
	 subvar TEMPVAR4 46500
	 mulvar TEMPVAR4 1000
	 divvar TEMPVAR4 14500
      }      
      else
      {
	 setvarvar TEMPVAR4 CHARACTERSPEEDVISUAL
	 mulvar TEMPVAR4 1000
	 divvar TEMPVAR4 100
      }
	setvarvar TEMPVAR5 TEMPVAR4
	divvar TEMPVAR5 31
	addvarvar tilenum TEMPVAR5
	addvar shade 13
	state rs
	state settile3087 
	subvar shade 13
*/

	// Display the word "SPD"
	setvar digx 22 // 288
	setvar digy 187
	redefinequote 332 SPD
	state setquote332
	ifvarg PLAYERATTACK -1 ifvarl PLAYERATTACK 10 addvar digx 21
	else ifvarg PLAYERATTACK 9 ifvarl PLAYERATTACK 100 addvar digx 25
	else ifvarg PLAYERATTACK 99 ifvarl PLAYERATTACK 1000 addvar digx 29
	else ifvarg PLAYERATTACK 999 ifvarl PLAYERATTACK 10000 addvar digx 33
	else ifvarg PLAYERATTACK 9999 ifvarl PLAYERATTACK 100000 addvar digx 37
	else ifvarg PLAYERATTACK 99999 ifvarl PLAYERATTACK 1000000 addvar digx 41
	else ifvarg PLAYERATTACK 999999 ifvarl PLAYERATTACK 10000000 addvar digx 45
	else ifvarg PLAYERATTACK 9999999 ifvarl PLAYERATTACK 100000000 addvar digx 49
	ifvarg PLAYERDEFENSE -1 ifvarl PLAYERDEFENSE 10 addvar digx 21
	else ifvarg PLAYERDEFENSE 9 ifvarl PLAYERDEFENSE 100 addvar digx 25
	else ifvarg PLAYERDEFENSE 99 ifvarl PLAYERDEFENSE 1000 addvar digx 29
	else ifvarg PLAYERDEFENSE 999 ifvarl PLAYERDEFENSE 10000 addvar digx 33
	else ifvarg PLAYERDEFENSE 9999 ifvarl PLAYERDEFENSE 100000 addvar digx 37
	else ifvarg PLAYERDEFENSE 99999 ifvarl PLAYERDEFENSE 1000000 addvar digx 41
	else ifvarg PLAYERDEFENSE 999999 ifvarl PLAYERDEFENSE 10000000 addvar digx 45
	else ifvarg PLAYERDEFENSE 9999999 ifvarl PLAYERDEFENSE 100000000 addvar digx 49
      ifvarand PLAYERSTATUS? 2 state paletteflasher else ifvarand PLAYERSTATUS? 4 { state shadepulse4 addvar shade 10 }
	state mt
      state shade0
	state pal20
	// display the actual speed [ ([CHARACTERSPEEDTRUE - 46500 ] / CHARACTERSPEEDVAL (155) = CHARACTERSPEEDVAR), so '50' is Duke's normal speed with a runspeed of 53200 ]

	setvar digy 187
      setvar digx 22
      ifvare debugtoggle 1 setvarvar CHARACTERSPEEDVISUAL CHARACTERSPEEDDEBUG else setvarvar CHARACTERSPEEDVISUAL CHARACTERSPEEDSTAT
 	setvarvar varname CHARACTERSPEEDVISUAL
	ifvarg PLAYERATTACK -1 ifvarl PLAYERATTACK 10 addvar digx 21
	else ifvarg PLAYERATTACK 9 ifvarl PLAYERATTACK 100 addvar digx 25
	else ifvarg PLAYERATTACK 99 ifvarl PLAYERATTACK 1000 addvar digx 29
	else ifvarg PLAYERATTACK 999 ifvarl PLAYERATTACK 10000 addvar digx 33
	else ifvarg PLAYERATTACK 9999 ifvarl PLAYERATTACK 100000 addvar digx 37
	else ifvarg PLAYERATTACK 99999 ifvarl PLAYERATTACK 1000000 addvar digx 41
	else ifvarg PLAYERATTACK 999999 ifvarl PLAYERATTACK 10000000 addvar digx 45
	else ifvarg PLAYERATTACK 9999999 ifvarl PLAYERATTACK 100000000 addvar digx 49
	ifvarg PLAYERDEFENSE -1 ifvarl PLAYERDEFENSE 10 addvar digx 21
	else ifvarg PLAYERDEFENSE 9 ifvarl PLAYERDEFENSE 100 addvar digx 25
	else ifvarg PLAYERDEFENSE 99 ifvarl PLAYERDEFENSE 1000 addvar digx 29
	else ifvarg PLAYERDEFENSE 999 ifvarl PLAYERDEFENSE 10000 addvar digx 33
	else ifvarg PLAYERDEFENSE 9999 ifvarl PLAYERDEFENSE 100000 addvar digx 37
	else ifvarg PLAYERDEFENSE 99999 ifvarl PLAYERDEFENSE 1000000 addvar digx 41
	else ifvarg PLAYERDEFENSE 999999 ifvarl PLAYERDEFENSE 10000000 addvar digx 45
	else ifvarg PLAYERDEFENSE 9999999 ifvarl PLAYERDEFENSE 100000000 addvar digx 49
	ifvarg CHARACTERSPEEDVISUAL -1 ifvarl CHARACTERSPEEDVISUAL 10 addvar digx 16
	else ifvarg CHARACTERSPEEDVISUAL 9 ifvarl CHARACTERSPEEDVISUAL 100 addvar digx 18
	else ifvarg CHARACTERSPEEDVISUAL 99 ifvarl CHARACTERSPEEDVISUAL 1000 addvar digx 20
	else ifvarg CHARACTERSPEEDVISUAL 999 ifvarl CHARACTERSPEEDVISUAL 10000 addvar digx 22
	else ifvarg CHARACTERSPEEDVISUAL 9999 ifvarl CHARACTERSPEEDVISUAL 100000 addvar digx 24
	else ifvarg CHARACTERSPEEDVISUAL 99999 ifvarl CHARACTERSPEEDVISUAL 1000000 addvar digx 26
	else ifvarg CHARACTERSPEEDVISUAL 999999 ifvarl CHARACTERSPEEDVISUAL 10000000 addvar digx 28
	else ifvarg CHARACTERSPEEDVISUAL 9999999 ifvarl CHARACTERSPEEDVISUAL 100000000 addvar digx 30
      ifvarand PLAYERSTATUS? 2 state paletteflasher else ifvarand PLAYERSTATUS? 4 { state shadepulse4 addvar shade 10 }
	state dn
      state shade0
	state pal22

  ifvarg PLAYERMAXAIRJUMPS 0
  {
      ifvarg PLAYERMAXAIRJUMPS 0 ifvare AIRJUMPRATIO 0 state shadepulse
	state pal22

      	// Display the word "AIRJUMPS"
	setvar digx 22 // 288
	setvar digy 187
	redefinequote 332 AIRJUMPS
	state setquote332
	ifvarg PLAYERATTACK -1 ifvarl PLAYERATTACK 10 addvar digx 21
	else ifvarg PLAYERATTACK 9 ifvarl PLAYERATTACK 100 addvar digx 25
	else ifvarg PLAYERATTACK 99 ifvarl PLAYERATTACK 1000 addvar digx 29
	else ifvarg PLAYERATTACK 999 ifvarl PLAYERATTACK 10000 addvar digx 33
	else ifvarg PLAYERATTACK 9999 ifvarl PLAYERATTACK 100000 addvar digx 37
	else ifvarg PLAYERATTACK 99999 ifvarl PLAYERATTACK 1000000 addvar digx 41
	else ifvarg PLAYERATTACK 999999 ifvarl PLAYERATTACK 10000000 addvar digx 45
	else ifvarg PLAYERATTACK 9999999 ifvarl PLAYERATTACK 100000000 addvar digx 49
	ifvarg PLAYERDEFENSE -1 ifvarl PLAYERDEFENSE 10 addvar digx 21
	else ifvarg PLAYERDEFENSE 9 ifvarl PLAYERDEFENSE 100 addvar digx 25
	else ifvarg PLAYERDEFENSE 99 ifvarl PLAYERDEFENSE 1000 addvar digx 29
	else ifvarg PLAYERDEFENSE 999 ifvarl PLAYERDEFENSE 10000 addvar digx 33
	else ifvarg PLAYERDEFENSE 9999 ifvarl PLAYERDEFENSE 100000 addvar digx 37
	else ifvarg PLAYERDEFENSE 99999 ifvarl PLAYERDEFENSE 1000000 addvar digx 41
	else ifvarg PLAYERDEFENSE 999999 ifvarl PLAYERDEFENSE 10000000 addvar digx 45
	else ifvarg PLAYERDEFENSE 9999999 ifvarl PLAYERDEFENSE 100000000 addvar digx 49
      ifvarn debugtoggle 1
      {
 	 ifvarg CHARACTERSPEEDVISUAL -1 ifvarl CHARACTERSPEEDVISUAL 10 addvar digx 21
 	 else ifvarg CHARACTERSPEEDVISUAL 9 ifvarl CHARACTERSPEEDVISUAL 100 addvar digx 25
	 else ifvarg CHARACTERSPEEDVISUAL 99 ifvarl CHARACTERSPEEDVISUAL 1000 addvar digx 29
	 else ifvarg CHARACTERSPEEDVISUAL 999 ifvarl CHARACTERSPEEDVISUAL 10000 addvar digx 33
	 else ifvarg CHARACTERSPEEDVISUAL 9999 ifvarl CHARACTERSPEEDVISUAL 100000 addvar digx 37
	 else ifvarg CHARACTERSPEEDVISUAL 99999 ifvarl CHARACTERSPEEDVISUAL 1000000 addvar digx 41
	 else ifvarg CHARACTERSPEEDVISUAL 999999 ifvarl CHARACTERSPEEDVISUAL 10000000 addvar digx 45
	 else ifvarg CHARACTERSPEEDVISUAL 9999999 ifvarl CHARACTERSPEEDVISUAL 100000000 addvar digx 49
      }
      else
      {
	 ifvarg CHARACTERSPEEDTRUE -1 ifvarl CHARACTERSPEEDTRUE 10 addvar digx 21
	 else ifvarg CHARACTERSPEEDTRUE 9 ifvarl CHARACTERSPEEDTRUE 100 addvar digx 25
	 else ifvarg CHARACTERSPEEDTRUE 99 ifvarl CHARACTERSPEEDTRUE 1000 addvar digx 29
	 else ifvarg CHARACTERSPEEDTRUE 999 ifvarl CHARACTERSPEEDTRUE 10000 addvar digx 33
	 else ifvarg CHARACTERSPEEDTRUE 9999 ifvarl CHARACTERSPEEDTRUE 100000 addvar digx 37
	 else ifvarg CHARACTERSPEEDTRUE 99999 ifvarl CHARACTERSPEEDTRUE 1000000 addvar digx 41
	 else ifvarg CHARACTERSPEEDTRUE 999999 ifvarl CHARACTERSPEEDTRUE 10000000 addvar digx 45
	 else ifvarg CHARACTERSPEEDTRUE 9999999 ifvarl CHARACTERSPEEDTRUE 100000000 addvar digx 49
      }
	state mt
	// display the actual AIRJUMPS
	setvar digy 187
      setvar digx 22
	setvarvar varname PLAYERMAXAIRJUMPS
	subvarvar varname multijumpflag
      ifvarl varname 0 setvar varname 0
	ifvarg PLAYERATTACK -1 ifvarl PLAYERATTACK 10 addvar digx 21
	else ifvarg PLAYERATTACK 9 ifvarl PLAYERATTACK 100 addvar digx 25
	else ifvarg PLAYERATTACK 99 ifvarl PLAYERATTACK 1000 addvar digx 29
	else ifvarg PLAYERATTACK 999 ifvarl PLAYERATTACK 10000 addvar digx 33
	else ifvarg PLAYERATTACK 9999 ifvarl PLAYERATTACK 100000 addvar digx 37
	else ifvarg PLAYERATTACK 99999 ifvarl PLAYERATTACK 1000000 addvar digx 41
	else ifvarg PLAYERATTACK 999999 ifvarl PLAYERATTACK 10000000 addvar digx 45
	else ifvarg PLAYERATTACK 9999999 ifvarl PLAYERATTACK 100000000 addvar digx 49
	ifvarg PLAYERDEFENSE -1 ifvarl PLAYERDEFENSE 10 addvar digx 21
	else ifvarg PLAYERDEFENSE 9 ifvarl PLAYERDEFENSE 100 addvar digx 25
	else ifvarg PLAYERDEFENSE 99 ifvarl PLAYERDEFENSE 1000 addvar digx 29
	else ifvarg PLAYERDEFENSE 999 ifvarl PLAYERDEFENSE 10000 addvar digx 33
	else ifvarg PLAYERDEFENSE 9999 ifvarl PLAYERDEFENSE 100000 addvar digx 37
	else ifvarg PLAYERDEFENSE 99999 ifvarl PLAYERDEFENSE 1000000 addvar digx 41
	else ifvarg PLAYERDEFENSE 999999 ifvarl PLAYERDEFENSE 10000000 addvar digx 45
	else ifvarg PLAYERDEFENSE 9999999 ifvarl PLAYERDEFENSE 100000000 addvar digx 49
     ifvarn debugtoggle 1
     {
	ifvarg CHARACTERSPEEDVISUAL -1 ifvarl CHARACTERSPEEDVISUAL 10 addvar digx 21
	else ifvarg CHARACTERSPEEDVISUAL 9 ifvarl CHARACTERSPEEDVISUAL 100 addvar digx 25
	else ifvarg CHARACTERSPEEDVISUAL 99 ifvarl CHARACTERSPEEDVISUAL 1000 addvar digx 29
	else ifvarg CHARACTERSPEEDVISUAL 999 ifvarl CHARACTERSPEEDVISUAL 10000 addvar digx 33
	else ifvarg CHARACTERSPEEDVISUAL 9999 ifvarl CHARACTERSPEEDVISUAL 100000 addvar digx 37
	else ifvarg CHARACTERSPEEDVISUAL 99999 ifvarl CHARACTERSPEEDVISUAL 1000000 addvar digx 41
	else ifvarg CHARACTERSPEEDVISUAL 999999 ifvarl CHARACTERSPEEDVISUAL 10000000 addvar digx 45
	else ifvarg CHARACTERSPEEDVISUAL 9999999 ifvarl CHARACTERSPEEDVISUAL 100000000 addvar digx 49
     }
     else
     {
	ifvarg CHARACTERSPEEDTRUE -1 ifvarl CHARACTERSPEEDTRUE 10 addvar digx 21
	else ifvarg CHARACTERSPEEDTRUE 9 ifvarl CHARACTERSPEEDTRUE 100 addvar digx 25
	else ifvarg CHARACTERSPEEDTRUE 99 ifvarl CHARACTERSPEEDTRUE 1000 addvar digx 29
	else ifvarg CHARACTERSPEEDTRUE 999 ifvarl CHARACTERSPEEDTRUE 10000 addvar digx 33
	else ifvarg CHARACTERSPEEDTRUE 9999 ifvarl CHARACTERSPEEDTRUE 100000 addvar digx 37
	else ifvarg CHARACTERSPEEDTRUE 99999 ifvarl CHARACTERSPEEDTRUE 1000000 addvar digx 41
	else ifvarg CHARACTERSPEEDTRUE 999999 ifvarl CHARACTERSPEEDTRUE 10000000 addvar digx 45
	else ifvarg CHARACTERSPEEDTRUE 9999999 ifvarl CHARACTERSPEEDTRUE 100000000 addvar digx 49
     }
     ifvarg varname -1 ifvarl varname 10 addvar digx 36
     else ifvarg varname 9 ifvarl varname 100 addvar digx 38
     else ifvarg varname 99 ifvarl varname 1000 addvar digx 40
     else ifvarg varname 999 ifvarl varname 10000 addvar digx 42
     else ifvarg varname 9999 ifvarl varname 100000 addvar digx 44
     else ifvarg varname 99999 ifvarl varname 1000000 addvar digx 46
     else ifvarg varname 999999 ifvarl varname 10000000 addvar digx 48
     else ifvarg varname 9999999 ifvarl varname 100000000 addvar digx 50
     state dn
     state shade0
  }

     ifvare CURRENTWEAPON 0 nullop
     else ifvare CURRENTWEAPON 10 nullop
     else
     {
	state ammocolors

      // Meter
      	setvar digy 192
	setvar digx 239 addvar digx 20
	setvar digz 58982 // 65536
	setvar tilenum 7680 // 746
	setvarvar TEMPVAR5 AMMOPERCENTAGE
	divvar TEMPVAR5 31
	addvarvar tilenum TEMPVAR5
	addvar shade 13
	state rs
	state settile3087 
	subvar shade 13

	// Shows the "AMMO" text
	setvar digy 193 // 187
	setvar digx 240 // 136
	setvar temp 214
	state mt
	// Shows "Current Ammo" 
	setvar digy 193 // 187
	setvar digx 240 // 136
      ifvare CURRENTWEAPON 9 addvar digx 4
      else ifvare CURRENTWEAPON 11 addvar digx 4
	setvarvar varname CURRENTAMMOA
      ifvarg varname -1 ifvarl varname 10 addvar digx 24
      else ifvarg varname 9 ifvarl varname 100 addvar digx 26
      else ifvarg varname 99 ifvarl varname 1000 addvar digx 28
      else ifvarg varname 999 ifvarl varname 10000 addvar digx 30
      else ifvarg varname 9999 ifvarl varname 100000 addvar digx 32
      else ifvarg varname 99999 ifvarl varname 1000000 addvar digx 34
      else ifvarg varname 999999 ifvarl varname 10000000 addvar digx 36
 	state dn
	// Shows "/" text [AMMO]
	setvar digy 193 // 187
	setvar digx 240 // 136
	state showslash
      ifvare CURRENTWEAPON 9 addvar digx 4
      else ifvare CURRENTWEAPON 11 addvar digx 4
      ifvarg CURRENTAMMOA -1 ifvarl CURRENTAMMOA 10 addvar digx 28
      else ifvarg CURRENTAMMOA 9 ifvarl CURRENTAMMOA 100 addvar digx 32
      else ifvarg CURRENTAMMOA 99 ifvarl CURRENTAMMOA 1000 addvar digx 36
      else ifvarg CURRENTAMMOA 999 ifvarl CURRENTAMMOA 10000 addvar digx 40
      else ifvarg CURRENTAMMOA 9999 ifvarl CURRENTAMMOA 100000 addvar digx 44
      else ifvarg CURRENTAMMOA 99999 ifvarl CURRENTAMMOA 1000000 addvar digx 48
      else ifvarg CURRENTAMMOA 999999 ifvarl CURRENTAMMOA 10000000 addvar digx 52
	state mt
	// Shows "Maximum Ammo" 
	setvar digy 193 // 187
	setvar digx 240 // 136
      ifvare CURRENTWEAPON 9 addvar digx 4
      else ifvare CURRENTWEAPON 11 addvar digx 4
	setvarvar varname MAXIMUMAMMO
      ifvarg CURRENTAMMOA -1 ifvarl CURRENTAMMOA 10 addvar digx 28
      else ifvarg CURRENTAMMOA 9 ifvarl CURRENTAMMOA 100 addvar digx 32
      else ifvarg CURRENTAMMOA 99 ifvarl CURRENTAMMOA 1000 addvar digx 36
      else ifvarg CURRENTAMMOA 999 ifvarl CURRENTAMMOA 10000 addvar digx 40
      else ifvarg CURRENTAMMOA 9999 ifvarl CURRENTAMMOA 100000 addvar digx 44
      else ifvarg CURRENTAMMOA 99999 ifvarl CURRENTAMMOA 1000000 addvar digx 48
      else ifvarg CURRENTAMMOA 999999 ifvarl CURRENTAMMOA 10000000 addvar digx 52
      ifvarg varname -1 ifvarl varname 10 addvar digx 8
      else ifvarg varname 9 ifvarl varname 100 addvar digx 10
      else ifvarg varname 99 ifvarl varname 1000 addvar digx 12
      else ifvarg varname 999 ifvarl varname 10000 addvar digx 14
      else ifvarg varname 9999 ifvarl varname 100000 addvar digx 16
      else ifvarg varname 99999 ifvarl varname 1000000 addvar digx 18
      else ifvarg varname 999999 ifvarl varname 10000000 addvar digx 20
 	state dn
     }

/*
		state pal23
      Show "Coils" Text
	setvar digy 121
	setvar digx 10 // 190
	redefinequote 382 COILS
	setvar temp 382
	state mt
	display the coil amount
	setvar digy 121
	setvar digx 10 // 190
      state checktelecoils
	setvarvar varname ITEMARRAYID_AMOUNTTEMP
      ifvarg varname -1 ifvarl varname 10 addvar digx 24
      else ifvarg varname 9 ifvarl varname 100 addvar digx 26
      else ifvarg varname 99 ifvarl varname 1000 addvar digx 28
      else ifvarg varname 999 ifvarl varname 10000 addvar digx 30
      else ifvarg varname 9999 ifvarl varname 100000 addvar digx 32
      else ifvarg varname 99999 ifvarl varname 1000000 addvar digx 34
      else ifvarg varname 999999 ifvarl varname 10000000 addvar digx 36
	state dn
*/

      // Show Money
	state pal22
	setvar digy 187
	setvar digx 240 // 190
	ifvarg CENTS -1 ifvarl CENTS 10 setvar temp 193 else setvar temp 194 
	state mt

     setvar digy 3
     ifvarn ftq 777
     {
      setvar digx 1
      addvar digy 6
      redefinequote 332 MENUS = 
      state setquote332
      getkeyname 401 30 0 
      qstrcat 332 401 
      state pal21
      state mt    
      state shade0
     }
     else
     {
      ifvare fta 0
      {
       setvar digx 1
       addvar digy 6
       redefinequote 332 MENUS = 
       state setquote332
       getkeyname 401 30 0 
       qstrcat 332 401 
       state pal21
       state mt    
       state shade0
      }
     }

     ifvarn CURRENTWEAPON 0
     {
      ifvare DEFENSEMODE? 1 state shadepulse
      setvar digx 1
      addvar digy 6 // ifvarn ftq 777 setvar digy 15 else { ifvare fta 0 setvar digy 15 else setvar digy 9 }
      redefinequote 332 DEFEND = 
      state setquote332
      getkeyname 401 42 0 
      qstrcat 332 401 
      state pal21
      state mt    
      state shade0
     }

     ifvarn SPRITEID-HOLDING -1
     {
      state shadepulse
      setvar digx 1
      addvar digy 6 // ifvarn ftq 777 setvar digy 15 else { ifvare fta 0 setvar digy 15 else setvar digy 9 }
      redefinequote 332 THROW = 
      state setquote332
      getkeyname 401 5 0 
      qstrcat 332 401 
      state pal21
      state mt    
      state shade0
     }

     ifvare CHARACTERSELECTED? 3
     {
      ifvare VEHICLEID -1
      {
       ifvare GLIDING? 1 state shadepulse
       setvar digx 1
       addvar digy 6 // ifvarn ftq 777 setvar digy 15 else { ifvare fta 0 setvar digy 15 else setvar digy 9 }
       redefinequote 332 GLIDE = 
       state setquote332
       getkeyname 401 11 0 
       qstrcat 332 401 
       state pal21
       state mt    
       state shade0
      }
     }

     ifvare CHARACTERSELECTED? 9
     {
      ifvarand bits 262144 state shadepulse
	setvar digx 1
      addvar digy 6 // ifvarn ftq 777 setvar digy 15 else { ifvare fta 0 setvar digy 15 else setvar digy 9 }
	redefinequote 332 TELEKENESIS = 
	state setquote332
	getkeyname 401 41 0
	qstrcat 332 401
	state pal21
	state mt    
      state shade0
     }

     ifvare PLAYERWEAPON? 3 // Chaingun Equipped
     {
      ifvarand bits 262144 state shadepulse
	setvar digx 1
      addvar digy 6 // ifvarn ftq 777 setvar digy 15 else { ifvare fta 0 setvar digy 15 else setvar digy 9 }
    ifvare CHAINGUNMODE 0 redefinequote 332 ROCKETS [CHAINGUN] = 
	else redefinequote 332 BULLETS [CHAINGUN] = 
	state setquote332
	getkeyname 401 22 0
	qstrcat 332 401
	state pal21
	state mt    
      state shade0
     }

     ifvare PLAYERWEAPON? 4 // RPG Equipped
     {
      ifvarand bits 262144 state shadepulse
	setvar digx 1
      addvar digy 6 // ifvarn ftq 777 setvar digy 15 else { ifvare fta 0 setvar digy 15 else setvar digy 9 }
    ifvare DEATHMISSILEMODE 0 redefinequote 332 DEATHSTROKES [RPG] = 
	else redefinequote 332 DEATHGATES [RPG] = 
	state setquote332
	getkeyname 401 23 0
	qstrcat 332 401
	state pal21
	state mt    
      state shade0
     }

	 } // ifvarn statusdisplaytoggle 2
state shade0
//
// End of redisplay attempt
//
	state orientation27 // 16+8+2+1

  ifvarn statusdisplaytoggle 2
  {
   ifvare statusdisplaytoggle 1
   {
    setvar digx 2
   }
   else
   {
    state calchppercentage
    qsprintf 277 278 HPPERCENTAGE
    state calcappercentage
    qsprintf 279 280 APPERCENTAGE
   }
  } // ifvarn statusdisplaytoggle 2

state healpaneldisplay

//
ifvarand miscdisplaytoggle 4
{     
     ifvarg DISPLAYMONEYTIMER 0
     {
      // Display the Money Amount
      state settilealphanum

      setvarvar tempb DISPLAYDOLLARS
      ifvarl tempb 0 mulvar tempb -1

      setvarvar tempc DISPLAYCENTS
      ifvarl tempc 0 mulvar tempc -1

      setvar MONEYGAIN 0
      ifvare DISPLAYDOLLARS 0 //
      {
       ifvare DISPLAYCENTS 0
       {
        setvar DISPLAYMONEYTIMER 0
       }
       else ifvarg DISPLAYCENTS 0 // Positive
       {
        state pal22
        setvar MONEYGAIN 1
       }
       else ifvarl DISPLAYCENTS 0 // Negative
       {
        state pal10
        setvar MONEYGAIN -1
       }
      }
      else ifvarg DISPLAYDOLLARS 0 // Positive
      {
       state pal22
       setvar MONEYGAIN 1
      }
      else ifvarl DISPLAYDOLLARS 0 // Negative
      {
       state pal10
       setvar MONEYGAIN -1
      }

      ifvarg tempc -1 ifvarl tempc 10
      {
       ifvare MONEYGAIN 1 redefinequote 332 +$%d.0%d
       ifvare MONEYGAIN -1 redefinequote 332 -$%d.0%d
       qsprintf 332 332 tempb tempc
      }
      else
      {
       ifvare MONEYGAIN 1 redefinequote 332 +$%d.%d
       ifvare MONEYGAIN -1 redefinequote 332 -$%d.%d
       qsprintf 332 332 tempb tempc
      }

      ifvarg DISPLAYMONEYTIMER 0 ifvarl DISPLAYMONEYTIMER 20 state orientation26
      else ifvarg DISPLAYMONEYTIMER 19 ifvarl DISPLAYMONEYTIMER 37 state orientation27
      else ifvarg DISPLAYMONEYTIMER 36 ifvarl DISPLAYMONEYTIMER 55 state orientation59 
      setvarvar digx 478 // 1
      setvarvar digy 182 // 148
      setvar temp 332
      setvar textscale 40960
      state gtz

      ifvarg DISPLAYMONEYTIMER 53 { setvar DISPLAYDOLLARS 0 setvar DISPLAYCENTS 0 setvar DISPLAYMONEYTIMER 0 setvar MONEYGAIN 0 }
     }
}

// ********************************************
// ********************************************
// ********************************************
// ** NR'S CODE FOR DISPLAYING DAMAGE VALUES **
// ********************************************
// ********************************************
// ********************************************

// *******************
// *******************
// ** PLAYER DAMAGE **
// *******************
// *******************
 setvarvar PLAYERDISPLAYDAMAGE PLAYERDAMAGETEMP
 setvarvar PLAYERDISPLAYARMORDAMAGE PLAYERARMORDAMAGETEMP
 setvarvar PLAYERDISPLAYCELLDAMAGE CELLDAMAGETEMP

 setvarvar PLAYERDISPLAYTOTALDAMAGE PLAYERDISPLAYDAMAGE
 addvarvar PLAYERDISPLAYTOTALDAMAGE PLAYERDISPLAYARMORDAMAGE
 addvarvar PLAYERDISPLAYTOTALDAMAGE PLAYERDISPLAYCELLDAMAGE

 setvarvar TOTALNULLDAMAGE NULLDAMAGE
 addvarvar TOTALNULLDAMAGE ARMORNULLDAMAGE
 addvarvar TOTALNULLDAMAGE BIOSHIELDNULLDAMAGE

ifvarand miscdisplaytoggle 1
{
      ifvarn BOSSMETERID3 -1 setvar BOSSMETERTEMP 16 // 32
      else
      {
       ifvarn BOSSMETERID2 -1 setvar BOSSMETERTEMP 9 // 20
       else
       {
        ifvarn BOSSMETERID1 -1 setvar BOSSMETERTEMP 2 // 8
        else setvar BOSSMETERTEMP 0
       }
      }

	// DISPLAY ATTACKER'S SPRITE WHEN HIT
	setvar atkx 160 // 160
	setvar atky 132 // 136
      subvarvar atky BOSSMETERTEMP      

      setvar TEMPVAR5 0
      ifvare ATTACKINGACTORPICNUM 4010 // ICYFLOOR
      {
  	  setvar atkz 43690
        addvar TEMPVAR5 1
      }
      else
      ifvare ATTACKINGACTORPICNUM 888 // ATMBROKE
      {
        setvarvar ATTACKINGACTORPAL 0
  	  setvar atkz 43690
        addvar TEMPVAR5 1
      }
      else
      ifvare ATTACKINGACTORPICNUM 3607 // COMPACTHANDSCANNER
      {
  	  setvar atkz 43690
        addvar TEMPVAR5 1
      }
      else
      ifvare ATTACKINGACTORPICNUM 3620 // COMPACTHANDSCANNER2
      {
  	  setvar atkz 43690
        addvar TEMPVAR5 1
      }
      else
      ifvare ATTACKINGACTORPICNUM 4082 // HANDSCANNER1
      {
  	  setvar atkz 43690
        addvar TEMPVAR5 1
      }
      else
      ifvare ATTACKINGACTORPICNUM 4084 // HANDSCANNER2
      {
  	  setvar atkz 43690
        addvar TEMPVAR5 1
      }
      else
      ifvare ATTACKINGACTORPICNUM 5175 // NEWPLUG
      {
  	  setvar atkz 43690
        addvar TEMPVAR5 1
      }
      else ifvare ATTACKINGACTORPICNUM 5385 setvar atkz 40960 // NEWFLOORSLIME
      else ifvare ATTACKINGACTORPICNUM 5388 setvar atkz 40960 // NEWHURTRAIL
      else ifvare ATTACKINGACTORPICNUM 5389 setvar atkz 40960 // NEWFLOORPLASMA
      else ifvare ATTACKINGACTORPICNUM 5395 setvar atkz 40960 // NEWPURPLELAVA
      else ifvare ATTACKINGACTORPICNUM 3796 setvar atkz 40960 // AMOEBACID
      else ifvare ATTACKINGACTORPICNUM 4091 setvar atkz 40960 // MEGALAVA
      else ifvare ATTACKINGACTORPICNUM W_FORCEFIELD setvar atkz 40960
      else ifvare ATTACKINGACTORPICNUM 5190 setvar atkz 30720 // NEWBLOODPOOL
      else ifvare ATTACKINGACTORPICNUM 2375 setvar atkz 24756 // GREENSLIME+5
      else ifvare ATTACKINGACTORPICNUM 2333 setvar atkz 24756 // FLOORFLAME
      else ifvare ATTACKINGACTORPICNUM 3780 setvar atkz 20480 // HOTLAVA
      else ifvare ATTACKINGACTORPICNUM 5401 setvar atkz 20480 // ULTRALAVA
      else ifvare ATTACKINGACTORPICNUM 5443 setvar atkz 20480 // HYPERMAGMA
      else ifvare ATTACKINGACTORPICNUM 6911 setvar atkz 20480 // FALLDAMAGEICONDUKE
      else ifvare ATTACKINGACTORPICNUM 6909 // DROWNDAMAGEICONLOWANG
      {
 	 setvar atkz 15855
       setvarvar ATTACKINGACTORPAL 15
      }
      else ifvare ATTACKINGACTORPICNUM 6908 // FALLDAMAGEICONNETHRA
      {
 	 setvar atkz 15855
       setvarvar ATTACKINGACTORPAL 20
      }
      else ifvare ATTACKINGACTORPICNUM 5216 // POISONSYMBOL
      {
  	 setvar atkz 16384
       addvar TEMPVAR5 1
      }
      else ifvarg ATTACKINGACTORPICNUM 5119 ifvarl ATTACKINGACTORPICNUM 5126 setvar atkz 16384 // Coin Money
      else ifvarg ATTACKINGACTORPICNUM 5125 ifvarl ATTACKINGACTORPICNUM 5146 setvar atkz 12378 // Paper Money
      else ifvare ATTACKINGACTORPICNUM 5146 setvar atkz 6189 // MONEYBAG
      else ifvare ATTACKINGACTORPICNUM 3069 // KEYPAD
      {
  	 setvar atkz 8192
       addvar TEMPVAR5 1
      }
      else ifvare ATTACKINGACTORPICNUM 4890 setvar atkz 8192 // NATURALLIGHTNING
      else ifvare ATTACKINGACTORPICNUM 6733 setvar atkz 13107 // ANIMEGIRL1
      else ifvare ATTACKINGACTORPICNUM 6737 setvar atkz 13107 // ANIMEGIRL2
      else ifvare ATTACKINGACTORPICNUM 6741 setvar atkz 13107 // ANIMEGIRL3
      else ifvare ATTACKINGACTORPICNUM 6746 setvar atkz 13107 // ANIMEGIRL4
      else ifvarg ATTACKINGACTORPICNUM 5150 ifvarl ATTACKINGACTORPICNUM 5154 setvar atkz 1
      else ifvarg ATTACKINGACTORPICNUM 5159 ifvarl ATTACKINGACTORPICNUM 5169 setvar atkz 1
      else ifvare ATTACKINGACTORPICNUM 5920 // DRAGONICRIP
      {
       setvar ATTACKINGACTORPICNUM 1820
       setvar ATTACKINGACTORPAL 14
      }
      else ifvare ATTACKINGACTORPICNUM 5921 // DRAGONICRIPBULLET
      {
       setvar ATTACKINGACTORPICNUM 1820
       setvar ATTACKINGACTORPAL 14
      }
      else ifvare ATTACKINGACTORPICNUM 5154 // POINTERARROW
      {
       setvar ATTACKINGACTORPICNUM 1898
       setvar ATTACKINGACTORPAL 0
      }
      else setvar atkz 21845

	setvar atka 0
	setvarvar ATTACKERTILENUM ATTACKINGACTORPICNUM
	setvarvar ATTACKERPAL ATTACKINGACTORPAL
      ifvarg ATTACKERDISPLAYTIMER -1 ifvarl ATTACKERDISPLAYTIMER 27 setvar atkorientation 3
      else ifvarg ATTACKERDISPLAYTIMER 26 ifvarl ATTACKERDISPLAYTIMER 54 setvar atkorientation 35

     ifvarg ATTACKERDISPLAYTIMER -1
     {
      setvar TEMPVAR4 0
  	ifvarg PLAYERDISPLAYTOTALDAMAGE 0 addvar TEMPVAR4 1
  	ifvarg TOTALNULLDAMAGE 0 addvar TEMPVAR4 1
      ifvare CHARACTERSELECTED? 8 { ifvare HAVEENERGYSHIELD? 1 { ifvare ENERGYSHIELDMODE 1 { ifvarg PLAYERDISPLAYCELLDAMAGE 0 { addvar TEMPVAR4 1 setvar TEMPHITCHARACTERVAR 8 }  else ifvare BIOSHIELDNULLDAMAGE 1 { addvar TEMPVAR4 1 setvar TEMPHITCHARACTERVAR 8 } } } }

  	ifvarg TEMPVAR4 0
      {
       // Show Portrait of Character/Vehicle taking Damage behind Enemy Display
       ifvarn VEHICLEID -1
       {
        ifvare TEMPVAR5 0
        {
         ifvare VEHICLETYPE 0 setvar TEMPVAR2 7950 // Green Riot Tank
         else ifvare VEHICLETYPE 1 setvar TEMPVAR2 7951 // Blue Riot Tank
         else ifvare VEHICLETYPE 2 setvar TEMPVAR2 7952 // Red Riot Tank
         else setvar TEMPVAR2 7955 // ?
        }
        else
        {
         ifvare TEMPHITCHARACTERVAR 1 setvar TEMPVAR2 7936 // Duke
         else ifvare TEMPHITCHARACTERVAR 2 setvar TEMPVAR2 7937 // Jack
         else ifvare TEMPHITCHARACTERVAR 3 { ifvare BUBSYFORM? 0 setvar TEMPVAR2 7938 else ifvare BUBSYFORM? 1 setvar TEMPVAR2 7962 } // Bubsy
         else ifvare TEMPHITCHARACTERVAR 4 { ifvare AMIFORM? 0 setvar TEMPVAR2 7939 else ifvare AMIFORM? 1 setvar TEMPVAR2 7963 else ifvare AMIFORM? 2 setvar TEMPVAR2 7966 } // Ami
         else ifvare TEMPHITCHARACTERVAR 5 setvar TEMPVAR2 7940 // Lo Wang
         else ifvare TEMPHITCHARACTERVAR 6 setvar TEMPVAR2 7941 // ESSence
         else ifvare TEMPHITCHARACTERVAR 7 setvar TEMPVAR2 7942 // Ted
         else ifvare TEMPHITCHARACTERVAR 8 setvar TEMPVAR2 7943 // Lisa
         else ifvare TEMPHITCHARACTERVAR 9 setvar TEMPVAR2 7944 // Cybanis
         else ifvare TEMPHITCHARACTERVAR 10 { ifvare NETHRAFORM? 0 setvar TEMPVAR2 7945 else ifvare NETHRAFORM? 1 setvar TEMPVAR2 7964 } // Nethra/Christina
         else ifvare TEMPHITCHARACTERVAR 11 setvar TEMPVAR2 7946 // Paula
         else ifvare TEMPHITCHARACTERVAR 12 setvar TEMPVAR2 7947 // Lori
         else ifvare TEMPHITCHARACTERVAR 13 { ifvare MINAKOFORM? 0 setvar TEMPVAR2 7948 else ifvare MINAKOFORM? 1 setvar TEMPVAR2 7965 else ifvare MINAKOFORM? 2 setvar TEMPVAR2 7968 } // Minako
         else ifvare TEMPHITCHARACTERVAR 14 setvar TEMPVAR2 7957 // Mystery Lady
         else ifvare TEMPHITCHARACTERVAR 15 setvar TEMPVAR2 7971 // Maken
         else setvar TEMPVAR2 7955 // ?
        }
       }
       else
       {
         ifvare TEMPHITCHARACTERVAR 1 setvar TEMPVAR2 7936 // Duke
         else ifvare TEMPHITCHARACTERVAR 2 setvar TEMPVAR2 7937 // Jack
         else ifvare TEMPHITCHARACTERVAR 3 { ifvare BUBSYFORM? 0 setvar TEMPVAR2 7938 else ifvare BUBSYFORM? 1 setvar TEMPVAR2 7962 } // Bubsy
         else ifvare TEMPHITCHARACTERVAR 4 { ifvare AMIFORM? 0 setvar TEMPVAR2 7939 else ifvare AMIFORM? 1 setvar TEMPVAR2 7963 else ifvare AMIFORM? 2 setvar TEMPVAR2 7966 } // Ami
         else ifvare TEMPHITCHARACTERVAR 5 setvar TEMPVAR2 7940 // Lo Wang
         else ifvare TEMPHITCHARACTERVAR 6 setvar TEMPVAR2 7941 // ESSence
         else ifvare TEMPHITCHARACTERVAR 7 setvar TEMPVAR2 7942 // Ted
         else ifvare TEMPHITCHARACTERVAR 8 setvar TEMPVAR2 7943 // Lisa
         else ifvare TEMPHITCHARACTERVAR 9 setvar TEMPVAR2 7944 // Cybanis
         else ifvare TEMPHITCHARACTERVAR 10 { ifvare NETHRAFORM? 0 setvar TEMPVAR2 7945 else ifvare NETHRAFORM? 1 setvar TEMPVAR2 7964 } // Nethra/Christina
         else ifvare TEMPHITCHARACTERVAR 11 setvar TEMPVAR2 7946 // Paula
         else ifvare TEMPHITCHARACTERVAR 12 setvar TEMPVAR2 7947 // Lori
         else ifvare TEMPHITCHARACTERVAR 13 { ifvare MINAKOFORM? 0 setvar TEMPVAR2 7948 else ifvare MINAKOFORM? 1 setvar TEMPVAR2 7965 else ifvare MINAKOFORM? 2 setvar TEMPVAR2 7968 } // Minako
         else ifvare TEMPHITCHARACTERVAR 14 setvar TEMPVAR2 7957 // Mystery Lady
         else ifvare TEMPHITCHARACTERVAR 15 setvar TEMPVAR2 7971 // Maken
         else setvar TEMPVAR2 7955 // ?
       }
       rotatesprite atkx atky 30720 atka TEMPVAR2 shade 0 35 ZERO ZERO xdim ydim // 40960

       mulvar atkz 750
       divvar atkz 1000
       // Show Attacking Monster/Player
       ifvarn ATTACKERTILENUM APLAYER
  	 { 
        rotatesprite atkx atky atkz atka ATTACKERTILENUM shade ATTACKERPAL atkorientation ZERO ZERO xdim ydim
  	 }
  	 else
  	 { 
        ifvarn VEHICLEID -1
        {
         ifvarg VEHICLETYPE -1 ifvarl VEHICLETYPE 3 { setvar MELEEATTACKER EMPTYTANK setvar atkz 30720 }
         ifvare VEHICLETYPE 0 setvar MELEEATTACKERPAL 0
         else ifvare VEHICLETYPE 1 setvar MELEEATTACKERPAL 17
         else ifvare VEHICLETYPE 2 setvar MELEEATTACKERPAL 19
         else setvar MELEEATTACKERPAL 0
        }
        else
        {
         setvar atkz 20480
         setvarvar MELEEATTACKERPAL 0
         ifvare TEMPHITCHARACTERVAR 1 setvar MELEEATTACKER 7911
         else ifvare TEMPHITCHARACTERVAR 2 setvar MELEEATTACKER 7912
         else ifvare TEMPHITCHARACTERVAR 3 setvar MELEEATTACKER 7913
         else ifvare TEMPHITCHARACTERVAR 4 { ifvare AMIFORM? 0 setvar MELEEATTACKER 7927 else setvar MELEEATTACKER 7914 }
         else ifvare TEMPHITCHARACTERVAR 5 { setvar MELEEATTACKER 7915 setvarvar MELEEATTACKERPAL 15 }
         else ifvare TEMPHITCHARACTERVAR 6 setvar MELEEATTACKER 7916
         else ifvare TEMPHITCHARACTERVAR 7 setvar MELEEATTACKER 7917
         else ifvare TEMPHITCHARACTERVAR 8 setvar MELEEATTACKER 7918
         else ifvare TEMPHITCHARACTERVAR 9 setvar MELEEATTACKER 7919
         else ifvare TEMPHITCHARACTERVAR 10 { ifvare NETHRAFORM? 0 setvar MELEEATTACKER 7926 else ifvare NETHRAFORM? 1 setvar MELEEATTACKER 7920 }
         else ifvare TEMPHITCHARACTERVAR 11 setvar MELEEATTACKER 7921
         else ifvare TEMPHITCHARACTERVAR 12 setvar MELEEATTACKER 7922
         else ifvare TEMPHITCHARACTERVAR 13 { ifvare MINAKOFORM? 0 setvar MELEEATTACKER 7928 else setvar MELEEATTACKER 7923 }
         else ifvare TEMPHITCHARACTERVAR 14 setvar MELEEATTACKER 7924
         else ifvare TEMPHITCHARACTERVAR 15 setvar MELEEATTACKER 7925
         else { setvar MELEEATTACKER APLAYER setvar atkz 21845 }
        }
        rotatesprite atkx atky atkz atka MELEEATTACKER 0 MELEEATTACKERPAL atkorientation ZERO ZERO xdim ydim
  	 }
      }

     }

    ifvare ATTACKINGACTORPICNUM 5385 nullop // NEWFLOORSLIME
    else ifvare ATTACKINGACTORPICNUM 5388 nullop // NEWHURTRAIL
    else ifvare ATTACKINGACTORPICNUM 5389 nullop // NEWFLOORPLASMA
    else ifvare ATTACKINGACTORPICNUM 5395 nullop // NEWPURPLELAVA
    else ifvare ATTACKINGACTORPICNUM 3796 nullop // AMOEBACID
    else ifvare ATTACKINGACTORPICNUM 3780 nullop // HOTLAVA
    else ifvare ATTACKINGACTORPICNUM 4091 nullop // MEGALAVA
    else ifvare ATTACKINGACTORPICNUM 5401 nullop // ULTRALAVA
    else ifvare ATTACKINGACTORPICNUM 5443 nullop // HYPERMAGMA
    else ifvare ATTACKINGACTORPICNUM 6911 nullop // FALLDAMAGEICONDUKE
    else ifvare ATTACKINGACTORPICNUM 6910 nullop // DROWNDAMAGEICONDUKE
    else ifvare ATTACKINGACTORPICNUM 6909 nullop // DROWNDAMAGEICONLOWANG
    else ifvare ATTACKINGACTORPICNUM 6908 nullop // FALLDAMAGEICONNETHRA
    else ifvare ATTACKINGACTORPICNUM 4010 nullop // ICYFLOOR
    else ifvare ATTACKINGACTORPICNUM 888 nullop // ATMBROKE
    else ifvare ATTACKINGACTORPICNUM 911 nullop // CACTUS
    else ifvare ATTACKINGACTORPICNUM 3069 nullop // KEYPAD
    else ifvare ATTACKINGACTORPICNUM 3607 nullop // COMPACTHANDSCANNER1
    else ifvare ATTACKINGACTORPICNUM 3620 nullop // COMPACTHANDSCANNER2
    else ifvare ATTACKINGACTORPICNUM 4082 nullop // HANDSCANNER1
    else ifvare ATTACKINGACTORPICNUM 4084 nullop // HANDSCANNER2
    else ifvare ATTACKINGACTORPICNUM 5175 nullop // NEWPLUG
    else ifvare ATTACKINGACTORPICNUM 5190 nullop // NEWBLOODPOOL
    else ifvare ATTACKINGACTORPICNUM 5216 nullop // POISONSYMBOL
    else ifvare ATTACKINGACTORPICNUM 4890 nullop // NATURALLIGHTNING
    else ifvare ATTACKINGACTORPICNUM 1088 nullop // REACTOR
    else ifvare ATTACKINGACTORPICNUM 578 nullop // REACTOR2
    else ifvare ATTACKINGACTORPICNUM 2375 nullop // GREENSLIME+5
    else ifvare ATTACKINGACTORPICNUM 2333 nullop // FLOORFLAME
    else ifvare ATTACKINGACTORPICNUM W_FORCEFIELD nullop
    else ifvarg ATTACKINGACTORPICNUM 5119 ifvarl ATTACKINGACTORPICNUM 5126 nullop // Coin Money
    else ifvarg ATTACKINGACTORPICNUM 5125 ifvarl ATTACKINGACTORPICNUM 5146 nullop // Paper Money
    else ifvare ATTACKINGACTORPICNUM 5146 nullop // MONEYBAG
    else ifvarg ATTACKINGACTORPICNUM 5150 ifvarl ATTACKINGACTORPICNUM 5154 nullop
    else ifvarg ATTACKINGACTORPICNUM 5159 ifvarl ATTACKINGACTORPICNUM 5169 nullop
    else ifvare ATTACKINGACTORPICNUM 5920 nullop // ?
    else ifvare ATTACKINGACTORPICNUM 5921 nullop // ?
    else ifvare ATTACKINGACTORPICNUM -1 nullop // ?
    else
    {
     // SHOWS THE ANGLE OF THE ATTACK WHEN HIT
     setvarvar SYSDIFFANGLEREFINED SYSDIFFANGLE
     subvar SYSDIFFANGLEREFINED 1024
     state digx160 // 160
     setvar digy 132 // 136
     subvarvar digy BOSSMETERTEMP      
     setvarvar ATTACKERPAL ATTACKINGACTORPAL
     ifvarg ATTACKERDISPLAYTIMER -1 ifvarl ATTACKERDISPLAYTIMER 27 state orientation3 
     else ifvarg ATTACKERDISPLAYTIMER 26 ifvarl ATTACKERDISPLAYTIMER 54 state orientation35

     ifvarg ATTACKERDISPLAYTIMER -1
     {
      setvar TEMPVAR4 0
  	ifvarg PLAYERDISPLAYTOTALDAMAGE 0 addvar TEMPVAR4 1
  	ifvarg TOTALNULLDAMAGE 0 addvar TEMPVAR4 1

      ifvarg TEMPVAR4 0
      {
       ifvarn ATTACKERTILENUM APLAYER // ifvarn tilenum APLAYER
       { 
        setvar digz 4096
        setvarvar diga SYSDIFFANGLEREFINED
        setvar tilenum 5154
        setvarvar pal ATTACKINGACTORPAL

        mulvar digz 750
        divvar digz 1000
        state rs
       }
       else
       { 
        setvar digz 4096
        setvar diga 0
        setvar tilenum 5372 // 5373
        setvarvar pal MELEEATTACKERPAL

        mulvar digz 750
        divvar digz 1000
        state rs
       }
      }

     }
    }



    //*************************************
    //*************************************
    //**DISPLAYS PLAYER'S HP/AP/EP DAMAGE**
    //*************************************
    //*************************************
      setvar digx 320
      setvar TEMPVAR4 0
  	ifvarg PLAYERDISPLAYTOTALDAMAGE 0 addvar TEMPVAR4 1
  	ifvarg TOTALNULLDAMAGE 0 addvar TEMPVAR4 1
      ifvarg TEMPVAR4 0
      {
       setvar digy 138
       subvarvar digy BOSSMETERTEMP      
       setvar digz 49152
       setvar textscale 49152
       state settilealphanum

       mulvar digz 750
       divvar digz 1000
       mulvar textscale 750
       divvar textscale 1000
       state paletteflasher
       ifvarg ATTACKERDISPLAYTIMER -1 ifvarl ATTACKERDISPLAYTIMER 19 state orientation18
       else ifvarg ATTACKERDISPLAYTIMER 18 ifvarl ATTACKERDISPLAYTIMER 36 state orientation19
       else ifvarg ATTACKERDISPLAYTIMER 35 ifvarl ATTACKERDISPLAYTIMER 54 state orientation51
       ifvare ACTORCRITICAL? 0 redefinequote 333 
       ifvare ACTORCRITICAL? 1 redefinequote 333 CRITICAL HIT!
       ifvare ACTORCRITICAL? 2 redefinequote 333 SUPER CRITICAL HIT!!
       ifvare ACTORCRITICAL? 3 redefinequote 333 MEGA CRITICAL HIT!!!
       ifvare ACTORCRITICAL? 4 redefinequote 333 GIGA CRITICAL HIT!!!!
       setvar temp 333 
       state gtz
       setvar digz 65536
       setvar textscale 65536
      }

      //************************
	//*DISPLAYS HEALTH DAMAGE*
      //************************
	setvar digy 144 // 148
      subvarvar digy BOSSMETERTEMP
	ifvarg ACTORCRITICAL? 0 setvar tilenum 6385 else state settile2837
	state pal21
	ifvarg PLAYERDISPLAYDAMAGE 0
	{ 
	 state digx160
	 ifvarg ATTACKERDISPLAYTIMER -1 ifvarl ATTACKERDISPLAYTIMER 19 state orientation26
       else ifvarg ATTACKERDISPLAYTIMER 18 ifvarl ATTACKERDISPLAYTIMER 36 state orientation27
       else ifvarg ATTACKERDISPLAYTIMER 35 ifvarl ATTACKERDISPLAYTIMER 54 state orientation59

	 setvar digz 65536
	 mulvar digz 750
	 divvar digz 1000
	 setvar textscale 65536
	 mulvar textscale 750
	 divvar textscale 1000
	 setvarvar varname PLAYERDISPLAYDAMAGE
  	 state dnz

       ifvarg PLAYERDISPLAYDAMAGE -1 ifvarl PLAYERDISPLAYDAMAGE 10 { ifvarg ACTORCRITICAL? 0 setvar digx 364 else setvar digx 348 }
       else ifvarg PLAYERDISPLAYDAMAGE 9 ifvarl PLAYERDISPLAYDAMAGE 100 { ifvarg ACTORCRITICAL? 0 setvar digx 373 else setvar digx 356 }
       else ifvarg PLAYERDISPLAYDAMAGE 99 ifvarl PLAYERDISPLAYDAMAGE 1000 { ifvarg ACTORCRITICAL? 0 setvar digx 382 else setvar digx 364 }
       else ifvarg PLAYERDISPLAYDAMAGE 999 ifvarl PLAYERDISPLAYDAMAGE 10000 { ifvarg ACTORCRITICAL? 0 setvar digx 392 else setvar digx 372 }
       else ifvarg PLAYERDISPLAYDAMAGE 9999 ifvarl PLAYERDISPLAYDAMAGE 100000 { ifvarg ACTORCRITICAL? 0 setvar digx 403 else setvar digx 380 }
       else ifvarg PLAYERDISPLAYDAMAGE 99999 ifvarl PLAYERDISPLAYDAMAGE 1000000 { ifvarg ACTORCRITICAL? 0 setvar digx 415 else setvar digx 388 }
       else ifvarg PLAYERDISPLAYDAMAGE 999999 ifvarl PLAYERDISPLAYDAMAGE 10000000 { ifvarg ACTORCRITICAL? 0 setvar digx 428 else setvar digx 396 }
       else ifvarg PLAYERDISPLAYDAMAGE 9999999 ifvarl PLAYERDISPLAYDAMAGE 100000000 { ifvarg ACTORCRITICAL? 0 setvar digx 442 else setvar digx 408 }
       addvar digx -6
	 setvarvar varname PLAYERDISPLAYDAMAGE

       ifvare VEHICLEID -1
       {
        ifvarg TEMPHITCHARACTERVAR -1
         ifvarl TEMPHITCHARACTERVAR 16
        {
 	   mulvar varname 1000    
         setvarvar CHARACTERARRAY TEMPHITCHARACTERVAR
         getactorvar[CHARACTERARRAY].CHARACTERMAXHP TEMPVAR
         ifvarn TEMPVAR 0 divvarvar varname TEMPVAR
        }
       }
       else
       {
 	  mulvar varname 1000    
        getactorvar[VEHICLEID].ENEMYMAXHP TEMPVAR
        ifvarn TEMPVAR 0 divvarvar varname TEMPVAR
       }

       ifvarl varname 2001 
       {
        setvarvar PERCENTUPPER varname
        divvar PERCENTUPPER 10
        setvarvar PERCENTLOWER varname
        modvar PERCENTLOWER 10
        qsprintf 388 389 PERCENTUPPER PERCENTLOWER
        setvar temp 388
       }
       else
       {
        setvar temp 390
       }
       state settilealphanum
	 setvar digz 65536
	 mulvar digz 750
	 divvar digz 1000
	 setvar textscale 65536
	 mulvar textscale 750
	 divvar textscale 1000
       state gtz

	 ifvarg HEALTHDAMAGETIMER 52 { setvar PLAYERDISPLAYDAMAGE 0 setvar PLAYERDAMAGETEMP 0 setvar MELEEATTACKER -1 setvar MELEEATTACKERPAL 0 setvar HEALTHDAMAGETIMER 0 }
      }
      // Show's "NO DAMAGE!" on health
      ifvarg TOTALNULLDAMAGE 0
      {
       ifvare NULLDAMAGE 1
       {
        setvar temp 201
	  setvar digy 144 // 148
        subvarvar digy BOSSMETERTEMP      
        setvarvar digx 265 // digx_test // 232
        state settilealphanum
        ifvarg ATTACKERDISPLAYTIMER -1 ifvarl ATTACKERDISPLAYTIMER 19 state orientation18
        else ifvarg ATTACKERDISPLAYTIMER 18 ifvarl ATTACKERDISPLAYTIMER 36 state orientation19
        else ifvarg ATTACKERDISPLAYTIMER 35 ifvarl ATTACKERDISPLAYTIMER 54 state orientation51
 	  setvar digz 65536
	  mulvar digz 750
	  divvar digz 1000
	  setvar textscale 65536
	  mulvar textscale 750
	  divvar textscale 1000
        ifvare PLAYERDISPLAYDAMAGE 0 state gtz
        ifvarg HEALTHDAMAGETIMER 52 { setvar NULLDAMAGE 0 setvar MELEEATTACKER -1 setvar MELEEATTACKERPAL 0 setvar HEALTHDAMAGETIMER 0 }
       }
      }

      //***********************
	//*DISPLAYS ARMOR DAMAGE*
      //***********************
	setvar digy 144 // 148
      setvar TEMPVAR5 0
      ifvarg PLAYERDISPLAYDAMAGE 0 addvar TEMPVAR5 1 
      ifvare NULLDAMAGE 1 addvar TEMPVAR5 1
      ifvarg TEMPVAR5 0 addvar digy 6
	ifvarg ACTORCRITICAL? 0
      {
       ifvarg PLAYERDISPLAYARMORDAMAGE 0 // If damage is detected to armor, change font to bold for critical, but continue to check for health damage
       {
        ifvarg PLAYERDISPLAYDAMAGE 0 addvar digy 6
        setvar tilenum 6385
       } 
       else // if no damage is done to armor, keep font normal but check for health damage
       {
        ifvarg PLAYERDISPLAYDAMAGE 0 addvar digy 6
        state settile2837
       }
      } 
      else state settile2837

      subvarvar digy BOSSMETERTEMP      
	state pal22
	ifvarg PLAYERDISPLAYARMORDAMAGE 0
	{ 
	 setvar ARMORNULLDAMAGE 0
	 state digx160
	 ifvarg ATTACKERDISPLAYTIMER -1 ifvarl ATTACKERDISPLAYTIMER 19 state orientation26
       else ifvarg ATTACKERDISPLAYTIMER 18 ifvarl ATTACKERDISPLAYTIMER 36 state orientation27
       else ifvarg ATTACKERDISPLAYTIMER 35 ifvarl ATTACKERDISPLAYTIMER 54 state orientation59

	 setvar digz 65536
	 mulvar digz 750
	 divvar digz 1000
	 setvar textscale 65536
	 mulvar textscale 750
	 divvar textscale 1000
	 setvarvar varname PLAYERDISPLAYARMORDAMAGE
  	 state dnz

       ifvarg PLAYERDISPLAYARMORDAMAGE -1 ifvarl PLAYERDISPLAYARMORDAMAGE 10 { ifvarg ACTORCRITICAL? 0 setvar digx 364 else setvar digx 348 }
       else ifvarg PLAYERDISPLAYARMORDAMAGE 9 ifvarl PLAYERDISPLAYARMORDAMAGE 100 { ifvarg ACTORCRITICAL? 0 setvar digx 373 else setvar digx 356 }
       else ifvarg PLAYERDISPLAYARMORDAMAGE 99 ifvarl PLAYERDISPLAYARMORDAMAGE 1000 { ifvarg ACTORCRITICAL? 0 setvar digx 382 else setvar digx 364 }
       else ifvarg PLAYERDISPLAYARMORDAMAGE 999 ifvarl PLAYERDISPLAYARMORDAMAGE 10000 { ifvarg ACTORCRITICAL? 0 setvar digx 392 else setvar digx 372 }
       else ifvarg PLAYERDISPLAYARMORDAMAGE 9999 ifvarl PLAYERDISPLAYARMORDAMAGE 100000 { ifvarg ACTORCRITICAL? 0 setvar digx 403 else setvar digx 380 }
       else ifvarg PLAYERDISPLAYARMORDAMAGE 99999 ifvarl PLAYERDISPLAYARMORDAMAGE 1000000 { ifvarg ACTORCRITICAL? 0 setvar digx 415 else setvar digx 388 }
       else ifvarg PLAYERDISPLAYARMORDAMAGE 999999 ifvarl PLAYERDISPLAYARMORDAMAGE 10000000 { ifvarg ACTORCRITICAL? 0 setvar digx 428 else setvar digx 396 }
       else ifvarg PLAYERDISPLAYARMORDAMAGE 9999999 ifvarl PLAYERDISPLAYARMORDAMAGE 100000000 { ifvarg ACTORCRITICAL? 0 setvar digx 442 else setvar digx 408 }
       addvar digx -6
	 setvarvar varname PLAYERDISPLAYARMORDAMAGE

       ifvare VEHICLEID -1
       {
        ifvarg TEMPHITCHARACTERVAR -1
         ifvarl TEMPHITCHARACTERVAR 16
        {
         mulvar varname 1000    
         setvarvar CHARACTERARRAY TEMPHITCHARACTERVAR
         getactorvar[CHARACTERARRAY].CHARACTERMAXAP TEMPVAR
         ifvarn TEMPVAR 0 divvarvar varname TEMPVAR
        }
       }
       else
       {
        mulvar varname 1000
        getactorvar[VEHICLEID].ENEMYMAXAP TEMPVAR
        ifvarn TEMPVAR 0 divvarvar varname TEMPVAR
       }

       ifvarl varname 2001 
       {
        setvarvar PERCENTUPPER varname
        divvar PERCENTUPPER 10
        setvarvar PERCENTLOWER varname
        modvar PERCENTLOWER 10
        qsprintf 388 389 PERCENTUPPER PERCENTLOWER
        setvar temp 388
       }
       else
       {
        setvar temp 390
       }
       state settilealphanum
	 setvar digz 65536
	 mulvar digz 750
	 divvar digz 1000
	 setvar textscale 65536
	 mulvar textscale 750
	 divvar textscale 1000
       state gtz

	 ifvarg ARMORDAMAGETIMER 52 { setvar PLAYERDISPLAYARMORDAMAGE 0 setvar PLAYERARMORDAMAGETEMP 0 setvar MELEEATTACKER -1 setvar MELEEATTACKERPAL 0 setvar ARMORDAMAGETIMER 0 }
	}
      // Show's "NO DAMAGE!" on armor
      ifvarg TOTALNULLDAMAGE 0
      {
	 ifvare ARMORNULLDAMAGE 1
	 {
	  setvar temp 201
	  setvar digy 150 // 156
        subvarvar digy BOSSMETERTEMP      
	  setvarvar digx 265 // digx_test // 232
	  state settilealphanum
	  ifvarg ATTACKERDISPLAYTIMER -1 ifvarl ATTACKERDISPLAYTIMER 19 state orientation18
        else ifvarg ATTACKERDISPLAYTIMER 18 ifvarl ATTACKERDISPLAYTIMER 36 state orientation19
        else ifvarg ATTACKERDISPLAYTIMER 35 ifvarl ATTACKERDISPLAYTIMER 54 state orientation51
 	  setvar digz 65536
	  mulvar digz 750
	  divvar digz 1000
	  setvar textscale 65536
	  mulvar textscale 750
	  divvar textscale 1000
	  ifvare PLAYERDISPLAYARMORDAMAGE 0 state gtz
 	  ifvarg ARMORDAMAGETIMER 52 { setvar ARMORNULLDAMAGE 0 setvar MELEEATTACKER -1 setvar MELEEATTACKERPAL 0 setvar ARMORDAMAGETIMER 0 } 
	 }
      }

      //****************************************
	//*DISPLAYS BIO-SHIELD DAMAGE (LISA ONLY)*
      //****************************************
	setvar digy 144 // 148
      setvar TEMPVAR5 0
      ifvarg PLAYERDISPLAYDAMAGE 0 addvar TEMPVAR5 1 
      ifvare NULLDAMAGE 1 addvar TEMPVAR5 1
      ifvarg TEMPVAR5 0 addvar digy 6
      setvar TEMPVAR5 0
      ifvarg PLAYERDISPLAYARMORDAMAGE 0 addvar TEMPVAR5 1 
      ifvare ARMORNULLDAMAGE 1 addvar TEMPVAR5 1
      ifvarg TEMPVAR5 0 addvar digy 6
	ifvarg ACTORCRITICAL? 0
      {
       ifvarg PLAYERDISPLAYCELLDAMAGE 0
       {
        ifvarg PLAYERDISPLAYDAMAGE 0 addvar digy 6
        ifvarg PLAYERDISPLAYARMORDAMAGE 0 addvar digy 6
        setvar tilenum 6385
       }
       else
       {
        ifvarg PLAYERDISPLAYDAMAGE 0 addvar digy 6
        ifvarg PLAYERDISPLAYARMORDAMAGE 0 addvar digy 6
        state settile2837
       }
      }
      else state settile2837

      subvarvar digy BOSSMETERTEMP      
	state pal16
	ifvarg ATTACKERDISPLAYTIMER -1 ifvarl ATTACKERDISPLAYTIMER 19 state orientation26
      else ifvarg ATTACKERDISPLAYTIMER 18 ifvarl ATTACKERDISPLAYTIMER 36 state orientation27
      else ifvarg ATTACKERDISPLAYTIMER 35 ifvarl ATTACKERDISPLAYTIMER 54 state orientation59
	ifvare CHARACTERSELECTED? 8
      {
	 ifvare HAVEENERGYSHIELD? 1
       {
	  ifvare ENERGYSHIELDMODE 1 
        {
 	   ifvarg PLAYERDISPLAYCELLDAMAGE 0
	   { 
  	    setvar BIOSHIELDNULLDAMAGE 0
	    state digx160
	    setvarvar varname PLAYERDISPLAYCELLDAMAGE
	    setvar digz 65536
	    mulvar digz 750
	    divvar digz 1000
	    setvar textscale 65536
	    mulvar textscale 750
	    divvar textscale 1000
  	    state dnz

          ifvarg PLAYERDISPLAYCELLDAMAGE -1 ifvarl PLAYERDISPLAYCELLDAMAGE 10 { ifvarg ACTORCRITICAL? 0 setvar digx 364 else setvar digx 348 }
          else ifvarg PLAYERDISPLAYCELLDAMAGE 9 ifvarl PLAYERDISPLAYCELLDAMAGE 100 { ifvarg ACTORCRITICAL? 0 setvar digx 373 else setvar digx 356 }
          else ifvarg PLAYERDISPLAYCELLDAMAGE 99 ifvarl PLAYERDISPLAYCELLDAMAGE 1000 { ifvarg ACTORCRITICAL? 0 setvar digx 382 else setvar digx 364 }
          else ifvarg PLAYERDISPLAYCELLDAMAGE 999 ifvarl PLAYERDISPLAYCELLDAMAGE 10000 { ifvarg ACTORCRITICAL? 0 setvar digx 392 else setvar digx 372 }
          else ifvarg PLAYERDISPLAYCELLDAMAGE 9999 ifvarl PLAYERDISPLAYCELLDAMAGE 100000 { ifvarg ACTORCRITICAL? 0 setvar digx 403 else setvar digx 380 }
          else ifvarg PLAYERDISPLAYCELLDAMAGE 99999 ifvarl PLAYERDISPLAYCELLDAMAGE 1000000 { ifvarg ACTORCRITICAL? 0 setvar digx 415 else setvar digx 388 }
          else ifvarg PLAYERDISPLAYCELLDAMAGE 999999 ifvarl PLAYERDISPLAYCELLDAMAGE 10000000 { ifvarg ACTORCRITICAL? 0 setvar digx 428 else setvar digx 396 }
          else ifvarg PLAYERDISPLAYCELLDAMAGE 9999999 ifvarl PLAYERDISPLAYCELLDAMAGE 100000000 { ifvarg ACTORCRITICAL? 0 setvar digx 442 else setvar digx 408 }
          addvar digx -6

          setvarvar TEMP2 PLAYERDISPLAYCELLDAMAGE
          divvarvar TEMP2 ESHIELDDMGFACTOR
          setvarvar TEMP3 PLAYERDISPLAYCELLDAMAGE
          modvarvar TEMP3 ESHIELDDMGFACTOR

          ifvarg TEMP3 0
          {
           qsprintf 391 392 TEMP2 TEMP3 ESHIELDDMGFACTOR
           setvar temp 391
          }
          else
          {
           qsprintf 393 394 TEMP2
           setvar temp 393
          }

	    state settilealphanum
	    setvar digz 65536
	    mulvar digz 750
	    divvar digz 1000
	    setvar textscale 65536
	    mulvar textscale 750
          divvar textscale 1000
          state gtz

  	    ifvarg CELLDAMAGETIMER 52 { setvar PLAYERDISPLAYCELLDAMAGE 0 setvar CELLDAMAGETEMP 0 setvar MELEEATTACKER -1 setvar MELEEATTACKERPAL 0 setvar CELLDAMAGETIMER 0 }
	   }
 	   else
	   {
	    setvar PLAYERDISPLAYCELLDAMAGE 0
	    setvar CELLDAMAGETEMP 0
	    setvar CELLDAMAGETIMER 0
	   }
        }
 	  else
	  {
	   setvar PLAYERDISPLAYCELLDAMAGE 0
	   setvar CELLDAMAGETEMP 0
	   setvar CELLDAMAGETIMER 0
	   setvar BIOSHIELDNULLDAMAGE 0
	  }
       }
 	 else
	 {
	  setvar PLAYERDISPLAYCELLDAMAGE 0
	  setvar CELLDAMAGETEMP 0
	  setvar CELLDAMAGETIMER 0
	  setvar BIOSHIELDNULLDAMAGE 0
	 }
      }
 	else
	{
	 setvar PLAYERDISPLAYCELLDAMAGE 0
	 setvar CELLDAMAGETEMP 0
	 setvar CELLDAMAGETIMER 0
	 setvar BIOSHIELDNULLDAMAGE 0
	}

      // Show's "NO DAMAGE!" for energy-shield
      ifvarg TOTALNULLDAMAGE 0
      { 
       ifvare BIOSHIELDNULLDAMAGE 1
       {
	  setvar temp 201
	  setvar digy 156 // 156
        subvarvar digy BOSSMETERTEMP      
	  setvarvar digx 265 // digx_test // 232
	  state settilealphanum
	  ifvarg ATTACKERDISPLAYTIMER -1 ifvarl ATTACKERDISPLAYTIMER 19 state orientation18
        else ifvarg ATTACKERDISPLAYTIMER 18 ifvarl ATTACKERDISPLAYTIMER 36 state orientation19
        else ifvarg ATTACKERDISPLAYTIMER 35 ifvarl ATTACKERDISPLAYTIMER 54 state orientation51

 	  setvar digz 65536
	  mulvar digz 750
	  divvar digz 1000
	  setvar textscale 65536
	  mulvar textscale 750
	  divvar textscale 1000
	  ifvare PLAYERDISPLAYCELLDAMAGE 0 state gtz
 	  ifvarg CELLDAMAGETIMER 52 { setvar BIOSHIELDNULLDAMAGE 0 setvar MELEEATTACKER -1 setvar MELEEATTACKERPAL 0 setvar CELLDAMAGETIMER 0 } 
	 }
      }


// *****************************
// *****************************
// *****************************
      
	 ifvarg ATTACKERDISPLAYTIMER 52
       {
        setvar PLAYERDISPLAYDAMAGE 0
        setvar PLAYERDAMAGETEMP 0
        setvar PLAYERARMORDAMAGETEMP 0
        setvar CELLDAMAGETEMP 0
        setvar PLAYERDISPLAYARMORDAMAGE 0
        setvar PLAYERDISPLAYCELLDAMAGE 0
        setvar PLAYERDISPLAYTOTALDAMAGE 0
        setvar NULLDAMAGE 0
        setvar ARMORNULLDAMAGE 0
        setvar BIOSHIELDNULLDAMAGE 0
        setvar HEALTHDAMAGETIMER 0
        setvar ARMORDAMAGETIMER 0
        setvar CELLDAMAGETIMER 0
        setvar TOTALNULLDAMAGE 0
        setvar ATTACKERDISPLAYTIMER 0
        setvar TEMPHITCHARACTERVAR 0
       }
}


// ********************
// ********************
// ** MONSTER DAMAGE **
// ********************
// ********************
 setvarvar TARGETDISPLAYDAMAGE DAMAGETEMP
 setvarvar ENEMYDISPLAYARMORDAMAGE ENEMYARMORDAMAGETEMP

ifvarand miscdisplaytoggle 1
{
 // Shows the Target's Picture and Pal
    setvar defx 160
    setvar defy 27

    ifvare DEFENDINGACTORDEBUG 6733 setvar defz 13107 // ANIMEGIRL1
    else ifvare DEFENDINGACTORDEBUG 6737 setvar defz 13107 // ANIMEGIRL2
    else ifvare DEFENDINGACTORDEBUG 6741 setvar defz 13107 // ANIMEGIRL3
    else ifvare DEFENDINGACTORDEBUG 6746 setvar defz 13107 // ANIMEGIRL4
    else setvar defz 21845

    setvar defa 0
    setvarvar DEFENDERTILENUM DEFENDINGACTORDEBUG // DEFENDINGACTORDEBUG
    setvarvar DEFENDERPAL DEFENDINGACTORPAL
    ifvarg DEFENDERDISPLAYTIMER -1 ifvarl DEFENDERDISPLAYTIMER 17 setvar deforientation 3
    else ifvarg DEFENDERDISPLAYTIMER 26 ifvarl DEFENDERDISPLAYTIMER 54 setvar deforientation 35

    setvar TEMPVAR4 0
    ifvarg ENEMYNULLDAMAGE 0 addvar TEMPVAR4 1
    ifvarg TARGETDISPLAYDAMAGE 0 addvar TEMPVAR4 1
    ifvarg ENEMYDISPLAYARMORDAMAGE 0 addvar TEMPVAR4 1

    ifvarg TEMPVAR4 0
    {
        ifvare TEMPATKCHARACTERVAR 1 setvar TEMPVAR2 7936 // Duke
        else ifvare TEMPATKCHARACTERVAR 2 setvar TEMPVAR2 7937 // Jack
        else ifvare TEMPATKCHARACTERVAR 3 { ifvare BUBSYFORM? 0 setvar TEMPVAR2 7938 else ifvare BUBSYFORM? 1 setvar TEMPVAR2 7962 } // Bubsy
        else ifvare TEMPATKCHARACTERVAR 4 { ifvare AMIFORM? 0 setvar TEMPVAR2 7939 else ifvare AMIFORM? 1 setvar TEMPVAR2 7963 else ifvare AMIFORM? 2 setvar TEMPVAR2 7966 } // Ami
        else ifvare TEMPATKCHARACTERVAR 5 setvar TEMPVAR2 7940 // Lo Wang
        else ifvare TEMPATKCHARACTERVAR 6 setvar TEMPVAR2 7941 // ESSence
        else ifvare TEMPATKCHARACTERVAR 7 setvar TEMPVAR2 7942 // Ted
        else ifvare TEMPATKCHARACTERVAR 8 setvar TEMPVAR2 7943 // Lisa
        else ifvare TEMPATKCHARACTERVAR 9 setvar TEMPVAR2 7944 // Cybanis
        else ifvare TEMPATKCHARACTERVAR 10 { ifvare NETHRAFORM? 0 setvar TEMPVAR2 7945 else ifvare NETHRAFORM? 1 setvar TEMPVAR2 7964 } // Nethra/Christina
        else ifvare TEMPATKCHARACTERVAR 11 setvar TEMPVAR2 7946 // Paula
        else ifvare TEMPATKCHARACTERVAR 12 setvar TEMPVAR2 7947 // Lori
        else ifvare TEMPATKCHARACTERVAR 13 { ifvare MINAKOFORM? 0 setvar TEMPVAR2 7948 else ifvare MINAKOFORM? 1 setvar TEMPVAR2 7965 else ifvare MINAKOFORM? 2 setvar TEMPVAR2 7968 } // Minako
        else ifvare TEMPATKCHARACTERVAR 14 setvar TEMPVAR2 7957 // Mystery Lady
        else ifvare TEMPATKCHARACTERVAR 15 setvar TEMPVAR2 7971 // Maken
        else setvar TEMPVAR2 7955 // ?
        rotatesprite defx defy 30720 defa TEMPVAR2 shade 0 35 ZERO ZERO xdim ydim
        ifvarn VEHICLEID -1
        {
         ifvare VEHICLETYPE 0 setvar TEMPVAR2 7950 // Green Riot Tank
         else ifvare VEHICLETYPE 1 setvar TEMPVAR2 7951 // Blue Riot Tank
         else ifvare VEHICLETYPE 2 setvar TEMPVAR2 7952 // Red Riot Tank
         else setvar TEMPVAR2 7955 // ?
         rotatesprite defx defy 30720 defa TEMPVAR2 shade 0 35 ZERO ZERO xdim ydim
        }

      mulvar defz 750
      divvar defz 1000
      rotatesprite defx defy defz defa DEFENDERTILENUM shade DEFENDINGACTORPAL deforientation ZERO ZERO xdim ydim
    }

    setvar digx 320
    ifvarg DEFENDERDISPLAYTIMER 0 ifvarl DEFENDERDISPLAYTIMER 53
    {
     setvar digy 33
     setvar digz 49152
     setvar textscale 49152
     state settilealphanum
     state paletteflasher
     mulvar digz 750
     divvar digz 1000
     mulvar textscale 750
     divvar textscale 1000
     ifvarg DEFENDERDISPLAYTIMER -1 ifvarl DEFENDERDISPLAYTIMER 19 state orientation18
     else ifvarg DEFENDERDISPLAYTIMER 18 ifvarl DEFENDERDISPLAYTIMER 36 state orientation19
     else ifvarg DEFENDERDISPLAYTIMER 35 ifvarl DEFENDERDISPLAYTIMER 54 state orientation51
     ifvare CRITICAL? 0 redefinequote 333 
     ifvare CRITICAL? 1 redefinequote 333 CRITICAL HIT!
     ifvare CRITICAL? 2 redefinequote 333 SUPER CRITICAL HIT!!
     ifvare CRITICAL? 3 redefinequote 333 MEGA CRITICAL HIT!!!
     ifvare CRITICAL? 4 redefinequote 333 GIGA CRITICAL HIT!!!!
     setvar temp 333 
     state gtz
     setvar digz 65536
     setvar textscale 65536
    }

    state digx160
    setvar digy 39
    ifvarg CRITICAL? 0 setvar tilenum 6385 else state settile2837
    state pal10
    ifvarg DEFENDERDISPLAYTIMER -1 ifvarl DEFENDERDISPLAYTIMER 19 state orientation26
    else ifvarg DEFENDERDISPLAYTIMER 18 ifvarl DEFENDERDISPLAYTIMER 36 state orientation27
    else ifvarg DEFENDERDISPLAYTIMER 35 ifvarl DEFENDERDISPLAYTIMER 54 state orientation59

      //************************
	//*DISPLAYS HEALTH DAMAGE*
      //************************
      ifvarg TARGETDISPLAYDAMAGE 0
      { 
       setvar digz 65536
       mulvar digz 750
       divvar digz 1000
       setvar textscale 65536
       mulvar textscale 750
       divvar textscale 1000
       setvarvar varname TARGETDISPLAYDAMAGE
       state dnz

       ifvarg TARGETDISPLAYDAMAGE -1 ifvarl TARGETDISPLAYDAMAGE 10 { ifvarg CRITICAL? 0 setvar digx 364 else setvar digx 348 }
       else ifvarg TARGETDISPLAYDAMAGE 9 ifvarl TARGETDISPLAYDAMAGE 100 { ifvarg CRITICAL? 0 setvar digx 373 else setvar digx 356 }
       else ifvarg TARGETDISPLAYDAMAGE 99 ifvarl TARGETDISPLAYDAMAGE 1000 { ifvarg CRITICAL? 0 setvar digx 382 else setvar digx 364 }
       else ifvarg TARGETDISPLAYDAMAGE 999 ifvarl TARGETDISPLAYDAMAGE 10000 { ifvarg CRITICAL? 0 setvar digx 392 else setvar digx 372 }
       else ifvarg TARGETDISPLAYDAMAGE 9999 ifvarl TARGETDISPLAYDAMAGE 100000 { ifvarg CRITICAL? 0 setvar digx 403 else setvar digx 380 }
       else ifvarg TARGETDISPLAYDAMAGE 99999 ifvarl TARGETDISPLAYDAMAGE 1000000 { ifvarg CRITICAL? 0 setvar digx 415 else setvar digx 388 }
       else ifvarg TARGETDISPLAYDAMAGE 999999 ifvarl TARGETDISPLAYDAMAGE 10000000 { ifvarg CRITICAL? 0 setvar digx 428 else setvar digx 396 }  	 
       else ifvarg TARGETDISPLAYDAMAGE 9999999 ifvarl TARGETDISPLAYDAMAGE 100000000 { ifvarg CRITICAL? 0 setvar digx 442 else setvar digx 408 }  	 
       addvar digx -6
       setvarvar varname TARGETDISPLAYDAMAGE
       mulvar varname 1000    
       ifvarn TEMPHITENEMYVARHP 0 divvarvar varname TEMPHITENEMYVARHP
       ifvarl varname 2001 
       {
        setvarvar PERCENTUPPER varname
        divvar PERCENTUPPER 10
        setvarvar PERCENTLOWER varname
        modvar PERCENTLOWER 10
        qsprintf 388 389 PERCENTUPPER PERCENTLOWER
        setvar temp 388
       }
       else
       {
        setvar temp 390
       }
       state settilealphanum
	 setvar digz 65536
	 mulvar digz 750
	 divvar digz 1000
	 setvar textscale 65536
	 mulvar textscale 750
       divvar textscale 1000
       state gtz

       ifvarg DEFENDERDISPLAYTIMER 52 { setvar TARGETDISPLAYDAMAGE 0 setvar DAMAGETEMP 0 setvar DEFENDERDISPLAYTIMER 0 }
      }
      // Show's "NO DAMAGE!" or "INVULNERABLE!" on health
      ifvare ENEMYNULLDAMAGE 1
      {
       ifvare ENEMYINVULN? 1 
       { 
        redefinequote 333 INVULNERABLE!
        setvar temp 333 
        setvar digx 243 // 210
       } 
       else 
       {
        setvar temp 201 
        setvar digx 265 // 232
       }
       state settilealphanum
       ifvarg DEFENDERDISPLAYTIMER -1 ifvarl DEFENDERDISPLAYTIMER 19 state orientation18
       else ifvarg DEFENDERDISPLAYTIMER 18 ifvarl DEFENDERDISPLAYTIMER 36 state orientation19
       else ifvarg DEFENDERDISPLAYTIMER 35 ifvarl DEFENDERDISPLAYTIMER 54 state orientation51
       setvar digz 65536
       mulvar digz 750
       divvar digz 1000 
       setvar textscale 65536 
       mulvar textscale 750
       divvar textscale 1000
       state gtz
       ifvarg DEFENDERDISPLAYTIMER 52 { setvar ENEMYNULLDAMAGE 0 setvar MELEEATTACKER -1 setvar MELEEATTACKERPAL 0 setvar DEFENDERDISPLAYTIMER 0 state orientation0 }
      }

      //***********************
	//*DISPLAYS ARMOR DAMAGE*
      //***********************
      setvar digy 39
      setvar TEMPVAR5 0
      ifvarg TARGETDISPLAYDAMAGE 0 addvar TEMPVAR5 1 
      ifvare ENEMYNULLDAMAGE 1 addvar TEMPVAR5 1
      ifvarg TEMPVAR5 0 addvar digy 6
      ifvarg CRITICAL? 0 // if a critical is detected, check to see if the font for armor damage needs to change, else leave it at normal
      {
       ifvarg ENEMYDISPLAYARMORDAMAGE 0 // If damage is detected to armor, change font to bold for critical, but continue to check for health damage
       {
        ifvarg TARGETDISPLAYDAMAGE 0 addvar digy 6
        setvar tilenum 6385
       } 
       else // if no damage is done to armor, keep font normal but check for health damage
       {
        ifvarg TARGETDISPLAYDAMAGE 0 addvar digy 6
        state settile2837
       }
      }
      else state settile2837 

      state pal14
      ifvarg ENEMYDISPLAYARMORDAMAGE 0
      { 
       setvar ENEMYARMORNULLDAMAGE 0
       state digx160
       ifvarg ENEMYARMORDISPLAYTIMER -1 ifvarl ENEMYARMORDISPLAYTIMER 19 state orientation26
       else ifvarg ENEMYARMORDISPLAYTIMER 18 ifvarl ENEMYARMORDISPLAYTIMER 36 state orientation27
       else ifvarg ENEMYARMORDISPLAYTIMER 35 ifvarl ENEMYARMORDISPLAYTIMER 54 state orientation59

       setvar digz 65536
       mulvar digz 750
       divvar digz 1000
       setvar textscale 65536
       mulvar textscale 750
       divvar textscale 1000
       setvarvar varname ENEMYDISPLAYARMORDAMAGE
       state dnz

       ifvarg ENEMYDISPLAYARMORDAMAGE -1 ifvarl ENEMYDISPLAYARMORDAMAGE 10 { ifvarg CRITICAL? 0 setvar digx 364 else setvar digx 348 }
       else ifvarg ENEMYDISPLAYARMORDAMAGE 9 ifvarl ENEMYDISPLAYARMORDAMAGE 100 { ifvarg CRITICAL? 0 setvar digx 373 else setvar digx 356 }
       else ifvarg ENEMYDISPLAYARMORDAMAGE 99 ifvarl ENEMYDISPLAYARMORDAMAGE 1000 { ifvarg CRITICAL? 0 setvar digx 382 else setvar digx 364 }
       else ifvarg ENEMYDISPLAYARMORDAMAGE 999 ifvarl ENEMYDISPLAYARMORDAMAGE 10000 { ifvarg CRITICAL? 0 setvar digx 392 else setvar digx 372 }
       else ifvarg ENEMYDISPLAYARMORDAMAGE 9999 ifvarl ENEMYDISPLAYARMORDAMAGE 100000 { ifvarg CRITICAL? 0 setvar digx 403 else setvar digx 380 }
       else ifvarg ENEMYDISPLAYARMORDAMAGE 99999 ifvarl ENEMYDISPLAYARMORDAMAGE 1000000 { ifvarg CRITICAL? 0 setvar digx 415 else setvar digx 388 }
       else ifvarg ENEMYDISPLAYARMORDAMAGE 999999 ifvarl ENEMYDISPLAYARMORDAMAGE 10000000 { ifvarg CRITICAL? 0 setvar digx 428 else setvar digx 396 }  	 
       else ifvarg ENEMYDISPLAYARMORDAMAGE 9999999 ifvarl ENEMYDISPLAYARMORDAMAGE 100000000 { ifvarg CRITICAL? 0 setvar digx 442 else setvar digx 408 }  	 
       addvar digx -6
	 setvarvar varname ENEMYDISPLAYARMORDAMAGE
	 mulvar varname 1000    
       ifvarn TEMPHITENEMYVARAP 0 divvarvar varname TEMPHITENEMYVARAP
       ifvarl varname 2001 
       {
        setvarvar PERCENTUPPER varname
        divvar PERCENTUPPER 10
        setvarvar PERCENTLOWER varname
        modvar PERCENTLOWER 10
        qsprintf 388 389 PERCENTUPPER PERCENTLOWER
        setvar temp 388
       }
       else
       {
        setvar temp 390
       }
       state settilealphanum
	 setvar digz 65536
	 mulvar digz 750
	 divvar digz 1000
	 setvar textscale 65536
	 mulvar textscale 750
       divvar textscale 1000
       state gtz

       ifvarg ENEMYARMORDISPLAYTIMER 52 { setvar ENEMYDISPLAYARMORDAMAGE 0 setvar ENEMYARMORDAMAGETEMP 0 setvar MELEEATTACKER -1 setvar MELEEATTACKERPAL 0 setvar ENEMYARMORDISPLAYTIMER 0 }
      }

      // Show's "NO DAMAGE!" or "INVULNERABLE!" on armor
      ifvare ENEMYARMORNULLDAMAGE 1
      {
       setvar ENEMYDISPLAYARMORDAMAGE 0
       ifvare ENEMYINVULN? 1 
       { 
        redefinequote 333 INVULNERABLE!
        setvar temp 333 
        setvar digx 243 // 210
       } 
       else 
       {
        setvar temp 201 
        setvar digx 265 // 232
       }
       state settilealphanum
       ifvarg ENEMYARMORDISPLAYTIMER -1 ifvarl ENEMYARMORDISPLAYTIMER 19 state orientation18
       else ifvarg ENEMYARMORDISPLAYTIMER 18 ifvarl ENEMYARMORDISPLAYTIMER 36 state orientation19
       else ifvarg ENEMYARMORDISPLAYTIMER 35 ifvarl ENEMYARMORDISPLAYTIMER 54 state orientation51
       setvar digz 65536
       mulvar digz 750
       divvar digz 1000
       setvar textscale 65536
       mulvar textscale 750
       divvar textscale 1000
       state gtz
       ifvarg ENEMYARMORDISPLAYTIMER 52 { setvar ENEMYARMORNULLDAMAGE 0 setvar MELEEATTACKER -1 setvar MELEEATTACKERPAL 0 setvar ENEMYARMORDISPLAYTIMER 0 state orientation0 }
      }
}

//********************************
//********************************
//** DISPLAY EXP & RANK REWARDS **
//********************************
//********************************
ifvarand miscdisplaytoggle 8
{
    // DISPLAY RANK REWARDS
    setvar digx 220
    setvar digy 96
    state settile2837 
    ifvarl DISPLAYRANKPOINTS 0 state pal21 else state pal23
    ifvarg RANKDISPLAYTIMER -1 ifvarl RANKDISPLAYTIMER 19 state orientation26
    else ifvarg RANKDISPLAYTIMER 18 ifvarl RANKDISPLAYTIMER 36 state orientation27
    else ifvarg RANKDISPLAYTIMER 35 ifvarl RANKDISPLAYTIMER 54 state orientation59

    //***************
    //*"RANK" Amount*
    //***************
    ifvarn DISPLAYRANKPOINTS 0
    {
     setvarvar varname DISPLAYRANKPOINTS
     setvar digz 65536
     mulvar digz 750
     divvar digz 1000
     setvar textscale 65536
     mulvar textscale 750
     divvar textscale 1000
     state dnz
     ifvarg RANKDISPLAYTIMER 52 { setvar DISPLAYRANKPOINTS 0 setvar RANKDISPLAYTIMER 0 }
    }
    //*************
    //*"RANK" Text*
    //*************
    setvar digy 156
    // ifvarg ACTORCRITICAL? 0 setvar tilenum 2930 else state settile2837
    state pal21
    setvarvar digx 415 // 402
    setvar digy 90
    setvar temp 268
    state settilealphanum
    ifvarl DISPLAYRANKPOINTS 0 state pal21 else state pal23
    ifvarg RANKDISPLAYTIMER -1 ifvarl RANKDISPLAYTIMER 19 state orientation26
    else ifvarg RANKDISPLAYTIMER 18 ifvarl RANKDISPLAYTIMER 36 state orientation27
    else ifvarg RANKDISPLAYTIMER 35 ifvarl RANKDISPLAYTIMER 54 state orientation59
    setvar digz 65536
    mulvar digz 750
    divvar digz 1000
    setvar textscale 65536
    mulvar textscale 750
    divvar textscale 1000
    ifvarn DISPLAYRANKPOINTS 0 state gtz

    // DISPLAY EXP REWARDS
    setvar digx 100
    setvar digy 96
    state settile2837
    state pal16
    ifvarg EXPDISPLAYTIMER -1 ifvarl EXPDISPLAYTIMER 19 state orientation26
    else ifvarg EXPDISPLAYTIMER 18 ifvarl EXPDISPLAYTIMER 36 state orientation27
    else ifvarg EXPDISPLAYTIMER 35 ifvarl EXPDISPLAYTIMER 54 state orientation59

    //**************
    //*"EXP" Amount*
    //**************
    ifvarg DISPLAYEXPPOINTS 0
    { 
     setvarvar varname DISPLAYEXPPOINTS
     setvar digz 65536
     mulvar digz 750
     divvar digz 1000
     setvar textscale 65536
     mulvar textscale 750
     divvar textscale 1000
     state dnz
     ifvarg EXPDISPLAYTIMER 52 { setvar DISPLAYEXPPOINTS 0 setvar DISPLAYEXPPOINTSOTHERS 0 setvar EXPDISPLAYTIMER 0 }
    }
    ifvarg PARTYSIZE 1
    {
     ifvarg PARTYALIVE 1
     {
      //*********************************
      //*"EXP" Amount [Other Characters]*
      //*********************************
      ifvarg DISPLAYEXPPOINTSOTHERS 0
      { 
       setvar digx 100
       setvar digy 102
       state pal0
       setvarvar varname DISPLAYEXPPOINTSOTHERS
       setvar digz 65536
       mulvar digz 750
       divvar digz 1000
       setvar textscale 65536
       mulvar textscale 750
       divvar textscale 1000
       state dnz
       ifvarg EXPDISPLAYTIMER -1 ifvarl EXPDISPLAYTIMER 19 state orientation24
       else ifvarg EXPDISPLAYTIMER 18 ifvarl EXPDISPLAYTIMER 36 state orientation25
       else ifvarg EXPDISPLAYTIMER 35 ifvarl EXPDISPLAYTIMER 54 state orientation57
       state settilealphanum
       ifvarg DISPLAYEXPPOINTSOTHERS -1 ifvarl DISPLAYEXPPOINTSOTHERS 10 setvar digx 185 // 175
       else ifvarg DISPLAYEXPPOINTSOTHERS 9 ifvarl DISPLAYEXPPOINTSOTHERS 100 setvar digx 177 // 167
       else ifvarg DISPLAYEXPPOINTSOTHERS 99 ifvarl DISPLAYEXPPOINTSOTHERS 1000 setvar digx 168 // 158
       else ifvarg DISPLAYEXPPOINTSOTHERS 999 ifvarl DISPLAYEXPPOINTSOTHERS 10000 setvar digx 159 // 149
       else ifvarg DISPLAYEXPPOINTSOTHERS 9999 ifvarl DISPLAYEXPPOINTSOTHERS 100000 setvar digx 149 // 139
       else ifvarg DISPLAYEXPPOINTSOTHERS 99999 ifvarl DISPLAYEXPPOINTSOTHERS 1000000 setvar digx 139 // 129
       else ifvarg DISPLAYEXPPOINTSOTHERS 999999 ifvarl DISPLAYEXPPOINTSOTHERS 10000000 setvar digx 128 // 118
       else ifvarg DISPLAYEXPPOINTSOTHERS 9999999 ifvarl DISPLAYEXPPOINTSOTHERS 100000000 setvar digx 117 // 107
       else ifvarg DISPLAYEXPPOINTSOTHERS 99999999 ifvarl DISPLAYEXPPOINTSOTHERS 1000000000 setvar digx 105 // 95
       else ifvarg DISPLAYEXPPOINTSOTHERS 999999999 setvar digx 93 // 83
       redefinequote 382 [
       setvar temp 382
       setvar digz 65536
       mulvar digz 750
       divvar digz 1000
       setvar textscale 65536
       mulvar textscale 750
       divvar textscale 1000
       state gtz
       ifvarg DISPLAYEXPPOINTSOTHERS -1 ifvarl DISPLAYEXPPOINTSOTHERS 10 setvar digx 207 // 211
       else ifvarg DISPLAYEXPPOINTSOTHERS 9 ifvarl DISPLAYEXPPOINTSOTHERS 100 setvar digx 215 // 219
       else ifvarg DISPLAYEXPPOINTSOTHERS 99 ifvarl DISPLAYEXPPOINTSOTHERS 1000 setvar digx 224 // 228
       else ifvarg DISPLAYEXPPOINTSOTHERS 999 ifvarl DISPLAYEXPPOINTSOTHERS 10000 setvar digx 231 // 237
       else ifvarg DISPLAYEXPPOINTSOTHERS 9999 ifvarl DISPLAYEXPPOINTSOTHERS 100000 setvar digx 243 // 247
       else ifvarg DISPLAYEXPPOINTSOTHERS 99999 ifvarl DISPLAYEXPPOINTSOTHERS 1000000 setvar digx 253 // 257
       else ifvarg DISPLAYEXPPOINTSOTHERS 999999 ifvarl DISPLAYEXPPOINTSOTHERS 10000000 setvar digx 264 // 268
       else ifvarg DISPLAYEXPPOINTSOTHERS 9999999 ifvarl DISPLAYEXPPOINTSOTHERS 100000000 setvar digx 275 // 279
       else ifvarg DISPLAYEXPPOINTSOTHERS 99999999 ifvarl DISPLAYEXPPOINTSOTHERS 1000000000 setvar digx 287 // 291
       else ifvarg DISPLAYEXPPOINTSOTHERS 999999999 setvar digx 299 // 303
       redefinequote 382 ]
       setvar temp 382
       setvar digz 65536
       mulvar digz 750
       divvar digz 1000
       setvar textscale 65536
       mulvar textscale 750
       divvar textscale 1000
       state gtz
       ifvarg EXPDISPLAYTIMER 52 { setvar DISPLAYEXPPOINTS 0 setvar DISPLAYEXPPOINTSOTHERS 0 setvar EXPDISPLAYTIMER 0 }
      }
     }
    }

    //************
    //*"EXP" Text*
    //************
    setvarvar digx 183 // 172
    setvar digy 90
    setvar temp 267
    state settilealphanum
    state pal16
    ifvarg EXPDISPLAYTIMER -1 ifvarl EXPDISPLAYTIMER 19 state orientation26
    else ifvarg EXPDISPLAYTIMER 18 ifvarl EXPDISPLAYTIMER 36 state orientation27
    else ifvarg EXPDISPLAYTIMER 35 ifvarl EXPDISPLAYTIMER 54 state orientation59
    setvar digz 65536
    mulvar digz 750
    divvar digz 1000
    setvar textscale 65536
    mulvar textscale 750
    divvar textscale 1000
    ifvarg DISPLAYEXPPOINTS 0 state gtz
}

ifvarand miscdisplaytoggle 2
{
    //************************
    //************************
    //**Stat Boost Gains @_@**
    //************************
    //************************

     setvarvar digx 464 // digx_test // 28
     setvarvar digy 177 // 146 // digy_test // 20
     //*******************
     //*Show Max HP Gains*
     //*******************
     ifvarg HPINCREASED 0
     {
      setvarvar digy 177
      ifvarg APINCREASED 0 addvar digy -4
      ifvarg EPINCREASED 0 addvar digy -4
      ifvarg ATKINCREASED 0 addvar digy -4
      ifvarg DEFINCREASED 0 addvar digy -4
      ifvarg SPDINCREASED 0 addvar digy -4
      ifvarg AIRINCREASED 0 addvar digy -4
      ifvarg MNTINCREASED 0 addvar digy -4
      ifvarg JUMINCREASED 0 addvar digy -4
      state statgains-bossmetercheck
      setvar textscale 48152
      mulvar textscale 750
      divvar textscale 1000
      setvar temp 204
      state pal21
      state settilealphanum
      ifvarg HPLUPDISPLAY -1 ifvarl HPLUPDISPLAY 19 state orientation18
      else ifvarg HPLUPDISPLAY 18 ifvarl HPLUPDISPLAY 36 state orientation19
      else ifvarg HPLUPDISPLAY 35 ifvarl HPLUPDISPLAY 54 state orientation51 
      state gtz
      ifvarg HPLUPDISPLAY 52 { setvar HPINCREASED 0 setvar HPLUPDISPLAY 0 state orientation0 }
     }
 
     //*******************
     //*Show Max AP Gains*
     //*******************
     ifvarg APINCREASED 0
     {
      setvarvar digy 177
      ifvarg EPINCREASED 0 addvar digy -4
      ifvarg ATKINCREASED 0 addvar digy -4
      ifvarg DEFINCREASED 0 addvar digy -4
      ifvarg SPDINCREASED 0 addvar digy -4
      ifvarg AIRINCREASED 0 addvar digy -4
      ifvarg MNTINCREASED 0 addvar digy -4
      ifvarg JUMINCREASED 0 addvar digy -4
      state statgains-bossmetercheck
      setvar textscale 48152
      mulvar textscale 750
      divvar textscale 1000
      setvar temp 205
      state pal22
      state settilealphanum
      ifvarg APLUPDISPLAY -1 ifvarl APLUPDISPLAY 19 state orientation18
      else ifvarg APLUPDISPLAY 18 ifvarl APLUPDISPLAY 36 state orientation19
      else ifvarg APLUPDISPLAY 35 ifvarl APLUPDISPLAY 54 state orientation51 
      state gtz
      ifvarg APLUPDISPLAY 52 { setvar APINCREASED 0 setvar APLUPDISPLAY 0 state orientation0 }
     }

     //*******************
     //*Show Max EP Gains*
     //*******************
     ifvarg EPINCREASED 0
     {
      setvarvar digy 177
      ifvarg ATKINCREASED 0 addvar digy -4
      ifvarg DEFINCREASED 0 addvar digy -4
      ifvarg SPDINCREASED 0 addvar digy -4
      ifvarg AIRINCREASED 0 addvar digy -4
      ifvarg MNTINCREASED 0 addvar digy -4
      ifvarg JUMINCREASED 0 addvar digy -4
      state statgains-bossmetercheck
      setvar textscale 48152
      mulvar textscale 750
      divvar textscale 1000
      setvar temp 238
      state pal0
      state settilealphanum
      ifvarg EPLUPDISPLAY -1 ifvarl EPLUPDISPLAY 19 state orientation18
      else ifvarg EPLUPDISPLAY 18 ifvarl EPLUPDISPLAY 36 state orientation19
      else ifvarg EPLUPDISPLAY 35 ifvarl EPLUPDISPLAY 54 state orientation51
      state gtz
      ifvarg EPLUPDISPLAY 52 { setvar EPINCREASED 0 setvar EPLUPDISPLAY 0 state orientation0 }
     }

     //********************
     //*Show Max ATK Gains*
     //********************
     ifvarg ATKINCREASED 0
     {
      setvarvar digy 177
      ifvarg DEFINCREASED 0 addvar digy -4
      ifvarg SPDINCREASED 0 addvar digy -4
      ifvarg AIRINCREASED 0 addvar digy -4
      ifvarg MNTINCREASED 0 addvar digy -4
      ifvarg JUMINCREASED 0 addvar digy -4
      state statgains-bossmetercheck
      setvar textscale 48152
      mulvar textscale 750
      divvar textscale 1000
      setvar temp 206
      state pal10
      state settilealphanum
      ifvarg ATKLUPDISPLAY -1 ifvarl ATKLUPDISPLAY 19 state orientation18
      else ifvarg ATKLUPDISPLAY 18 ifvarl ATKLUPDISPLAY 36 state orientation19
      else ifvarg ATKLUPDISPLAY 35 ifvarl ATKLUPDISPLAY 54 state orientation51
      state gtz
      ifvarg ATKLUPDISPLAY 52 { setvar ATKINCREASED 0 setvar ATKLUPDISPLAY 0 state orientation0 }
     }

     //********************
     //*Show Max DEF Gains*
     //********************
     ifvarg DEFINCREASED 0
     {
      setvarvar digy 177
      ifvarg SPDINCREASED 0 addvar digy -4
      ifvarg AIRINCREASED 0 addvar digy -4
      ifvarg MNTINCREASED 0 addvar digy -4
      ifvarg JUMINCREASED 0 addvar digy -4
      state statgains-bossmetercheck
      setvar textscale 48152
      mulvar textscale 750
      divvar textscale 1000
      setvar temp 207
      state pal14
      state settilealphanum
      ifvarg DEFLUPDISPLAY -1 ifvarl DEFLUPDISPLAY 19 state orientation18
      else ifvarg DEFLUPDISPLAY 18 ifvarl DEFLUPDISPLAY 36 state orientation19
      else ifvarg DEFLUPDISPLAY 35 ifvarl DEFLUPDISPLAY 54 state orientation51 
      state gtz
      ifvarg DEFLUPDISPLAY 52 { setvar DEFINCREASED 0 setvar DEFLUPDISPLAY 0 state orientation0 }
     }

     //****************
     //*Show SPD Gains*
     //****************
     ifvarg SPDINCREASED 0
     {
      setvarvar digy 177
      ifvarg AIRINCREASED 0 addvar digy -4
      ifvarg MNTINCREASED 0 addvar digy -4
      ifvarg JUMINCREASED 0 addvar digy -4
      state statgains-bossmetercheck
      setvarvar SPDINCREASEDWHOLE SPDINCREASED
      ifvarn SPDINCREASEDDIV 0 divvarvar SPDINCREASEDWHOLE SPDINCREASEDDIV
      setvarvar SPDINCREASEDPART SPDINCREASED
      modvarvar SPDINCREASEDPART SPDINCREASEDDIV
      qsprintf 721 724 SPDINCREASEDWHOLE SPDINCREASEDPART SPDINCREASEDDIV
      ifvare debugtoggle 1 setvar temp 208 else setvar temp 721
      setvar textscale 48152
      mulvar textscale 750
      divvar textscale 1000
      state pal20
      state settilealphanum
      ifvarg SPDLUPDISPLAY -1 ifvarl SPDLUPDISPLAY 19 state orientation18
      else ifvarg SPDLUPDISPLAY 18 ifvarl SPDLUPDISPLAY 36 state orientation19
      else ifvarg SPDLUPDISPLAY 35 ifvarl SPDLUPDISPLAY 54 state orientation51 
      state gtz
      ifvarg SPDLUPDISPLAY 52 { setvar SPDINCREASED 0 setvar SPDLUPDISPLAY 0 state orientation0 }
     }

     //********************
     //*Show AIRTIME Gains*
     //********************
     ifvarg AIRINCREASED 0
     {
      setvarvar digy 177
      ifvarg MNTINCREASED 0 addvar digy -4
      ifvarg JUMINCREASED 0 addvar digy -4
      state statgains-bossmetercheck
      setvarvar AIRINCREASEDWHOLE AIRINCREASED
      ifvarn AIRINCREASEDDIV 0 divvarvar AIRINCREASEDWHOLE AIRINCREASEDDIV
      setvarvar AIRINCREASEDPART AIRINCREASED
      modvarvar AIRINCREASEDPART AIRINCREASEDDIV
      qsprintf 722 725 AIRINCREASEDWHOLE AIRINCREASEDPART AIRINCREASEDDIV
      ifvare debugtoggle 1 setvar temp 709 else setvar temp 722
      setvar textscale 48152
      mulvar textscale 750
      divvar textscale 1000
      state pal1
      state settilealphanum
      ifvarg AIRLUPDISPLAY -1 ifvarl AIRLUPDISPLAY 19 state orientation18
      else ifvarg AIRLUPDISPLAY 18 ifvarl AIRLUPDISPLAY 36 state orientation19
      else ifvarg AIRLUPDISPLAY 35 ifvarl AIRLUPDISPLAY 54 state orientation51 
      state gtz
      ifvarg AIRLUPDISPLAY 52 { setvar AIRINCREASED 0 setvar AIRLUPDISPLAY 0 state orientation0 }
     }

     //**********************
     //*Show MANT-TIME Gains*
     //**********************
     ifvarg MNTINCREASED 0
     {
      setvarvar digy 177
      ifvarg JUMINCREASED 0 addvar digy -4
      state statgains-bossmetercheck
      setvarvar MNTINCREASEDWHOLE MNTINCREASED
      ifvarn MNTINCREASEDDIV 0 divvarvar MNTINCREASEDWHOLE MNTINCREASEDDIV
      setvarvar MNTINCREASEDPART MNTINCREASED
      modvarvar MNTINCREASEDPART MNTINCREASEDDIV
      qsprintf 723 726 MNTINCREASEDWHOLE MNTINCREASEDPART MNTINCREASEDDIV
      ifvare debugtoggle 1 setvar temp 710 else setvar temp 723
      setvar textscale 48152
      mulvar textscale 750
      divvar textscale 1000
      state pal14
      state settilealphanum
      ifvarg MNTLUPDISPLAY -1 ifvarl MNTLUPDISPLAY 19 state orientation18
      else ifvarg MNTLUPDISPLAY 18 ifvarl MNTLUPDISPLAY 36 state orientation19
      else ifvarg MNTLUPDISPLAY 35 ifvarl MNTLUPDISPLAY 54 state orientation51 
      state gtz
      ifvarg MNTLUPDISPLAY 52 { setvar MNTINCREASED 0 setvar MNTLUPDISPLAY 0 state orientation0 }
     }

     //********************
     //*Show AIRJUMP Gains*
     //********************
     ifvarg JUMINCREASED 0
     {
      setvarvar digy 177
      addvar digy 0
      state statgains-bossmetercheck
      setvar textscale 48152
      mulvar textscale 750
      divvar textscale 1000
      setvar temp 711
      state pal22
      state settilealphanum
      ifvarg JUMLUPDISPLAY -1 ifvarl JUMLUPDISPLAY 19 state orientation18
      else ifvarg JUMLUPDISPLAY 18 ifvarl JUMLUPDISPLAY 36 state orientation19
      else ifvarg JUMLUPDISPLAY 35 ifvarl JUMLUPDISPLAY 54 state orientation51 
      state gtz
      ifvarg JUMLUPDISPLAY 52 { setvar JUMINCREASED 0 setvar JUMLUPDISPLAY 0 state orientation0 }
     }

}

//******************
//******************
//**Ami's VR Visor**
//******************
//******************

ifvare CHARACTERSELECTED? 4 // Makes Ami the sole user of the ability to read the detailed stats of monsters if she is using her VR Visor[they interface with her portable computer] :P
ifvarl AUTOMAPMODE 2
{ // ifvarl AUTOMAPMODE 2
 { // Blank line

  ifvarg CURRENTHITPOINTS 0 // ifp palive
  { // ifvarg CURRENTHITPOINTS 0 // ifp palive

   ifvare NIGHTVISION 1
   { // ifvare NIGHTVISION 1

    // VR Visor' Crosshair

    state digx160
    setvar digy 100
    setvar digz 131072
    setvar diga 0
    ifvarn hitsprite -1 
    { 
     ifvarl NPC_TYPE 1 state pal0
     else ifvare NPC_TYPE 1 state pal2
     else ifvare NPC_TYPE 2 state pal22
     else ifvare NPC_TYPE 3 state pal23
     else ifvare NPC_TYPE 4 state pal20 // Important Characters = White
     else ifvare NPC_TYPE 5 state pal4 // Major Enemies = Black
     else ifvarg NPC_TYPE 5 state pal0
     // Monsters = Red
     // Allies = Green
     // Neutral = Green
    } 
    else 
    { 
     setvar NPC_TYPE 0
     state pal0 
    }

    // Mercury Symbol

    state orientation33
    setvar tilenum 7802
    state rs 
    setvar digx 312
    setvar digy 8
    setvar digz 8192
    state pal0 
    setvar tilenum 7803
    state rs 

    // Visor Overlay
    state orientation37
    setvarvar digx 160 // 312
    setvarvar digy 105 // 8
    setvarvar digz 327680 // 8192
    setvar diga 1024
    state pal0 
    setvar tilenum 5512 // 5475 // 7803
    getplayer[THISACTOR].player_par TEMPVAR5
    modvar TEMPVAR5 48
    ifvare TEMPVAR5 0 setvar shade 0
    ifvare TEMPVAR5 1 setvar shade 0
    ifvare TEMPVAR5 2 setvar shade 1
    ifvare TEMPVAR5 3 setvar shade 1
    ifvare TEMPVAR5 4 setvar shade 2
    ifvare TEMPVAR5 5 setvar shade 2
    ifvare TEMPVAR5 6 setvar shade 3
    ifvare TEMPVAR5 7 setvar shade 3
    ifvare TEMPVAR5 8 setvar shade 4
    ifvare TEMPVAR5 9 setvar shade 4
    ifvare TEMPVAR5 10 setvar shade 5
    ifvare TEMPVAR5 11 setvar shade 5
    ifvare TEMPVAR5 12 setvar shade 6
    ifvare TEMPVAR5 13 setvar shade 6
    ifvare TEMPVAR5 14 setvar shade 7
    ifvare TEMPVAR5 15 setvar shade 7
    ifvare TEMPVAR5 16 setvar shade 8
    ifvare TEMPVAR5 17 setvar shade 8
    ifvare TEMPVAR5 18 setvar shade 9
    ifvare TEMPVAR5 19 setvar shade 9
    ifvare TEMPVAR5 20 setvar shade 10
    ifvare TEMPVAR5 21 setvar shade 10
    ifvare TEMPVAR5 22 setvar shade 11
    ifvare TEMPVAR5 23 setvar shade 11
    ifvare TEMPVAR5 24 setvar shade 12
    ifvare TEMPVAR5 25 setvar shade 12
    ifvare TEMPVAR5 26 setvar shade 11
    ifvare TEMPVAR5 27 setvar shade 11
    ifvare TEMPVAR5 28 setvar shade 10
    ifvare TEMPVAR5 29 setvar shade 10
    ifvare TEMPVAR5 30 setvar shade 9
    ifvare TEMPVAR5 31 setvar shade 9
    ifvare TEMPVAR5 32 setvar shade 8
    ifvare TEMPVAR5 33 setvar shade 8
    ifvare TEMPVAR5 34 setvar shade 7
    ifvare TEMPVAR5 35 setvar shade 7
    ifvare TEMPVAR5 36 setvar shade 6
    ifvare TEMPVAR5 37 setvar shade 6
    ifvare TEMPVAR5 38 setvar shade 5
    ifvare TEMPVAR5 39 setvar shade 5
    ifvare TEMPVAR5 40 setvar shade 4
    ifvare TEMPVAR5 41 setvar shade 4
    ifvare TEMPVAR5 42 setvar shade 3
    ifvare TEMPVAR5 43 setvar shade 3
    ifvare TEMPVAR5 44 setvar shade 2
    ifvare TEMPVAR5 45 setvar shade 2
    ifvare TEMPVAR5 46 setvar shade 1
    ifvare TEMPVAR5 47 setvar shade 1
    state rs 
    state shade0 

//*****************************************
//*****************************************
//***NR'S CODE FOR MONSTER HEALTH VALUES***
//*****************************************
//*****************************************

// 2472 - Big Red Digital Number (PCs/NPCs)
// 2837 - Medium Numbers (Mini-Boss)
// 2930 - Thick Red Large Numbers (ESS-Rank)
// 2992 - White Large Numbers (Boss-Rank)
// 3011 - Small Green Numbers 
// 3087 - Small Blue Numbers (Normal Enemies)

	ifvarn hitsector -1
	{
	 ifvare hitwall -1
	 {
	  ifvare hitsprite -1
	  {

	   ifvare HAVEMERCURYCOMPUTER? 1
	   {
	    // Normal-Ceiling Scan
	    getsector[hitsector].lotag TEMP
	    ifvare TEMP 2 // Ceiling Picnum
	    {
 	     getsector[hitsector].ceilingpicnum TEMPVAR
 	     ifvarn TEMPVAR -1 // Ceiling Picnum
 	     {
 	      getceilzofslope hitsector hitx hity TEMPVAR4
 	      setvarvar TEMPVAR2 TEMPVAR4
 	      addvarvar TEMPVAR2 128
 	      setvarvar TEMPVAR3 TEMPVAR4
 	      subvarvar TEMPVAR3 128
 	      ifvarvarg hitz TEMPVAR3
 	       ifvarvarl hitz TEMPVAR2
 	      {
 	       state setquote332
 	       setvar digx 88
 	       setvar digy 48
  	       state pal20
  	       redefinequote 332 CL-TYPE:
  	       state mt
   
             state showfloorthreattypes
 		
 	       state setquote332
 	       setvar digx 88
 	       setvar digy 147
 	       state pal20
	       redefinequote 332 FL-TYPE:
	       state mt
	  
             state showfloorthreattypes
	      }
	     }
	    }
	    else
	    {
	      getceilzofslope hitsector hitx hity TEMPVAR4
	      setvarvar TEMPVAR2 TEMPVAR4
	      addvarvar TEMPVAR2 128
	      setvarvar TEMPVAR3 TEMPVAR4
	      subvarvar TEMPVAR3 128
	      ifvarvarg hitz TEMPVAR3
	       ifvarvarl hitz TEMPVAR2
	      {
	       state setquote332
	       setvar digx 88
	       setvar digy 48
	       state pal20
	       redefinequote 332 CL-TYPE:
	       state mt
	       setvar digx 209
	       state pal20
	       redefinequote 332 [SAFE]
	       state mt
	      }
	    }


	    // Normal-Floor Scan
	
	    getsector[hitsector].lotag TEMP
	    ifvare TEMP 2
	    {
	     getsector[hitsector].ceilingpicnum TEMPVAR
	     ifvarn TEMPVAR -1 // Ceiling Picnum
	     {
	      getflorzofslope hitsector hitx hity TEMPVAR4
	      setvarvar TEMPVAR2 TEMPVAR4
	      addvarvar TEMPVAR2 128
	      setvarvar TEMPVAR3 TEMPVAR4
	      subvarvar TEMPVAR3 128
	      ifvarvarg hitz TEMPVAR3
	       ifvarvarl hitz TEMPVAR2
	      {
	       state setquote332
	       setvar digx 88
	       setvar digy 48
	       state pal20
	       redefinequote 332 CL-TYPE:
	       state mt
	  
	       state showfloorthreattypes

	       state setquote332
	       setvar digx 88
	       setvar digy 147
	       state pal20
	       redefinequote 332 FL-TYPE:
	       state mt
  
	       state showfloorthreattypes

	      }
	     }
	    }
	    else
	    {
	     getsector[hitsector].floorpicnum TEMPVAR
	     ifvarn TEMPVAR -1 // Floor Picnum
	     {
	      getflorzofslope hitsector hitx hity TEMPVAR4
	      setvarvar TEMPVAR2 TEMPVAR4
	      addvarvar TEMPVAR2 128
	      setvarvar TEMPVAR3 TEMPVAR4
	      subvarvar TEMPVAR3 128
	      ifvarvarg hitz TEMPVAR3
	       ifvarvarl hitz TEMPVAR2
	      {
	       state setquote332
	       setvar digx 88
	       setvar digy 147
	       state pal20
	       redefinequote 332 FL-TYPE:
	       state mt
	  
	       state showfloorthreattypes

	      }
	     }
	    }

	    // Tileemu-Ceiling Scan
	    getsector[hitsector].lotag TEMP
	    ifvare TEMP 2 // Ceiling Picnum
	    {
	     getsector[hitsector].hitag TEMPVAR
	     ifvarn TEMPVAR -1 // Ceiling Picnum
	     {
	      getceilzofslope hitsector hitx hity TEMPVAR4
	      setvarvar TEMPVAR2 TEMPVAR4
	      addvarvar TEMPVAR2 128
	      setvarvar TEMPVAR3 TEMPVAR4
	      subvarvar TEMPVAR3 128
	      ifvarvarg hitz TEMPVAR3
	       ifvarvarl hitz TEMPVAR2
	      {
	       state setquote332
	       setvar digx 88
	       setvar digy 54
	       state pal20
	       redefinequote 332 EC-TYPE:
	       state mt
	  
	       state showfloorthreattypes

	       state setquote332
	       setvar digx 88
	       setvar digy 141
	       state pal20
	       redefinequote 332 EF-TYPE:
	       state mt
	  
	       state showfloorthreattypes

	      }
	     }
	    }
	    else
	    {
	      getceilzofslope hitsector hitx hity TEMPVAR4
	      setvarvar TEMPVAR2 TEMPVAR4
	      addvarvar TEMPVAR2 128
	      setvarvar TEMPVAR3 TEMPVAR4
	      subvarvar TEMPVAR3 128
	      ifvarvarg hitz TEMPVAR3
	       ifvarvarl hitz TEMPVAR2
	      {
	       state setquote332
	       setvar digx 88
	       setvar digy 54
	       state pal20
	       redefinequote 332 EC-TYPE:
	       state mt
	       setvar digx 209
	       state pal20
	     	redefinequote 332 [SAFE]
	    	state mt
	      }
	    }
	
	    // Emulated-Floor Scan
	
	    getsector[hitsector].lotag TEMP
	    ifvare TEMP 2
	    {
	     getsector[hitsector].hitag TEMPVAR
	     ifvarn TEMPVAR -1 // Ceiling Picnum
	     {
	      getflorzofslope hitsector hitx hity TEMPVAR4
	      setvarvar TEMPVAR2 TEMPVAR4
	      addvarvar TEMPVAR2 128
	      setvarvar TEMPVAR3 TEMPVAR4
	      subvarvar TEMPVAR3 128
	      ifvarvarg hitz TEMPVAR3
	       ifvarvarl hitz TEMPVAR2
	      {
	       state setquote332
	       setvar digx 88
	       setvar digy 54
	       state pal20
	       redefinequote 332 EC-TYPE:
	       state mt
	  
	       state showfloorthreattypes
	
	       state setquote332
	       setvar digx 88
	       setvar digy 141
	       state pal20
	       redefinequote 332 EF-TYPE:
	       state mt
  
	       state showfloorthreattypes

	      }
	     }
	    }
	    else
	    {
	     getsector[hitsector].hitag TEMPVAR
	     ifvarn TEMPVAR -1 // Floor Picnum
	     {
	      getflorzofslope hitsector hitx hity TEMPVAR4
	      setvarvar TEMPVAR2 TEMPVAR4
	      addvarvar TEMPVAR2 128
	      setvarvar TEMPVAR3 TEMPVAR4
	      subvarvar TEMPVAR3 128
	      ifvarvarg hitz TEMPVAR3
	       ifvarvarl hitz TEMPVAR2
	      {
	       state setquote332
	       setvar digx 88
	       setvar digy 141
	       state pal20
	       redefinequote 332 EF-TYPE:
	       state mt
	  
	       state showfloorthreattypes

	      }
	     }
	    }
	
	   }
	  } // ifvare hitsprite -1
	 } // ifvare hitwall -1
	} // ifvarn hitsector -1

	state shade0

ifvarn hitsprite -1
{ // ifvarn hitsprite -1
       getactor[hitsprite].statnum TARGETTYPE
       getactor[hitsprite].picnum TARGETSPECIES
       getactor[hitsprite].pal TARGETPAL
       getactorvar[hitsprite].ENEMYLEVEL ENEMYLEVELDISPLAY
       getactorvar[hitsprite].CLOAKED? TARGETCLOAKED?
       getactorvar[hitsprite].ENEMYMAXAP TARGETMAXAP

 //**************************
 //**Start Scanner Displays**
 //**************************
 ifvare TARGETCLOAKED? 0
 {
    ifvare TARGETTYPE 1
    {
        setvar digy 81
	  ifvare SHOWTARGETHEALTH? 1 ifvarg ENEMYLEVELDISPLAY 0 ifvarg TARGETHEALTH 0
	  {
	   // Shows "LEVEL:" text
	   setvar digx 135
	   setvar temp 338
	   setvar textscale 49152
	   state pal16
	   state settilealphanum
	   state orientation27
	   state gtz

         // DISPLAYS ENEMY'S LEVEL
	   state digx160
	   state settile2837
 	   state pal16
	   state orientation27
  	   setvar textscale 49152
	   setvarvar varname ENEMYLEVELDISPLAY
	   state dnz

         getactorvar[hitsprite].ACTORFLAGS TEMP
         ifvarand TEMP 512
 	   {
 	    // Shows "[ELITE]" text
 	    setvar digx 360
 	    redefinequote 332 [ELITE] 
	    state setquote332
	    setvar textscale 49152
	    state pal16
	    state settilealphanum
	    state orientation27
	    state gtz
	   }
        }

        state vrvisorflashhp
	  ifvare SHOWTARGETHEALTH? 1 ifvarg TARGETHEALTH 0
        {
         addvar digy 8
 	   getactorvar[hitsprite].ENEMYHP TEMPVAR
	   setvar digx 127
	   state settile2837
  	   setvar textscale 49152
	   state orientation27
	   setvarvar varname TEMPVAR
	   state dnz

         // Shows "HP:" text
	   setvar digx 135
	   setvar temp 165
	   setvar textscale 49152
	   state settilealphanum
	   state orientation27
         state gtz
	
         // Shows "/" text [HP]
	   state digx320
	   state showslash
	   setvar textscale 49152
	   state settilealphanum
	   state orientation27	
         state gtz 

         getactorvar[hitsprite].ENEMYMAXHP TEMPVAR
         // Maximum HITPOINTS
	   setvar digx 193
	   state settile2837
	   state orientation27
  	   setvar textscale 49152
	   setvarvar varname TEMPVAR
	   state dnz
	  }

        state vrvisorflashfa
        getactorvar[hitsprite].ENEMYFIRSTAID TEMPVAR
 	  ifvare SHOWTARGETHEALTH? 1 ifvarg TARGETHEALTH 0 ifvarg TEMPVAR 0
	  {
         // DISPLAYS ENEMY'S FIRSTAID AMOUNT
	   qsprintf 179 180 TEMPVAR
	   setvar digx 455
	   setvar temp 179
	   setvar textscale 49152
	   state settilealphanum
         state orientation27
         state gtz
	  }

        state vrvisorflashap
        getactorvar[hitsprite].ENEMYMAXAP TARGETMAXAP
  	  ifvare SHOWTARGETHEALTH? 1 ifvarg TARGETHEALTH 0 ifvarg TARGETMAXAP 0
  	  {
         addvar digy 8
	   getactorvar[hitsprite].ENEMYAP TEMPVAR
	   // Current ARMORPOINTS
	   setvar digx 127
	   state settile2837
  	   setvar textscale 49152
	   state orientation27
	   setvarvar varname TEMPVAR
	   state dnz

  	   // Shows "AP:" text
  	   setvar digx 135
  	   setvar temp 176
	   setvar textscale 49152
  	   state settilealphanum
  	   state orientation27
  	   state gtz
	
         // Shows "/" text [AP]
	   state digx320
	   state showslash
	   setvar textscale 49152
	   state settilealphanum
	   state orientation27
         state gtz

         // Maximum ARMORPOINTS
	   setvar digx 193
	   state settile2837
	   state orientation27
  	   setvar textscale 49152
	   setvarvar varname TARGETMAXAP
	   state dnz

         getactorvar[hitsprite].ENEMYARMORPERCENT TEMPVAR5 // divvar TEMPVAR5 10
         ifvarg TEMPVAR5 0
         {
          getactorvar[hitsprite].ENEMYARMORPERCENT TEMPVAR3
          divvar TEMPVAR3 10
          getactorvar[hitsprite].ENEMYARMORPERCENT TEMPVAR4
          modvar TEMPVAR4 10
          // Armor ABSORBSION
	    qsprintf 183 184 TEMPVAR3 TEMPVAR4
 	    setvar digx 455
	    setvar temp 183
  	    setvar textscale 49152
	    state settilealphanum
          state orientation27	
          state gtz
         }
	  }

	  ifvare SHOWTARGETDEFENSE? 1 ifvarg TARGETHEALTH 0
	  {
         getactorvar[hitsprite].ACTORATTACK TARGETATTACK
	   ifvare SHOWTARGETHEALTH? 1 ifvarg TARGETHEALTH 0 ifvarg TARGETATTACK 0
	   {
          addvar digy 8
	    // Shows "ATK:" text
	    setvar digx 135
	    setvar temp 324
	    state pal21
  	    setvar textscale 49152
	    state settilealphanum
	    state orientation27
	    state gtz

	    // Shows "ATTACK" Value
	    state digx160
	    state settile2837
	    state pal21
  	    setvar textscale 49152
	    state orientation27
	    setvarvar varname TARGETATTACK
	    state dnz
	   }

         getactorvar[hitsprite].ACTORDEFENSE TEMPVAR
	   ifvare SHOWTARGETHEALTH? 1 ifvarg TARGETHEALTH 0 ifvarg TEMPVAR 0
	   {
          addvar digy 8
	    // Shows "DEF:" text
	    setvar digx 135
	    setvar temp 166
	    state pal23
  	    setvar textscale 49152
	    state settilealphanum
	    state orientation27
	    state gtz

	    // Shows "Defense" Value
	    state digx160
	    state settile2837
	    state pal23
	    setvar textscale 49152
	    state orientation27
	    setvarvar varname TEMPVAR
	    state dnz
	   }
	  }

	  // DISPLAY ENEMY QUAD TIME
	  getactorvar[hitsprite].ENEMYQUADTIME TEMPVAR
	  ifvare SHOWTARGETHEALTH? 1 ifvarg TARGETHEALTH 0 ifvarg TEMPVAR 0
	  {
         addvar digy 8
	   // Shows "QUAD:" text
	   setvar digx 135
	   setvar temp 186
	   state pal16
	   state settilealphanum
     	   setvar textscale 49152
	   state orientation27
	   state gtz

	   state digx160
	   state settile2837
	   state pal16
  	   setvar textscale 49152
	   state orientation27
         divvar TEMPVAR 26
	   setvarvar varname TEMPVAR
	   state dnz
	  }

	  // DISPLAY ENEMY INVULN TIME
	  getactorvar[hitsprite].ENEMYINVULNTIME TEMPVAR
	  ifvare SHOWTARGETHEALTH? 1 ifvarg TARGETHEALTH 0 ifvarg TEMPVAR 0
	  {
         addvar digy 8
	   // Shows "INVULN:" text
	   setvar digx 135
	   setvar temp 217
	   state pal23
	   state settilealphanum
  	   setvar textscale 49152
	   state orientation27
	   state gtz

	   state digx160
	   state settile2837
	   state pal23
  	   setvar textscale 49152
	   state orientation27
	   divvar TEMPVAR 26
	   setvarvar varname TEMPVAR
	   state dnz
	  }

	  // DISPLAY ENEMY REGEN TIME
 	  getactorvar[hitsprite].ENEMYREGENTIME TEMPVAR
	  ifvare SHOWTARGETHEALTH? 1 ifvarg TARGETHEALTH 0 ifvarg TEMPVAR 0
	  {
         addvar digy 8
	   // Shows "REGEN:" text
	   setvar digx 135
	   setvar temp 226
	   state pal21
	   state settilealphanum
  	   setvar textscale 49152
	   state orientation27
	   state gtz

	   state digx160
	   state settile2837
	   state pal21
  	   setvar textscale 49152
	   state orientation27
	   divvar TEMPVAR 26
	   setvarvar varname TEMPVAR
	   state dnz
	  }

	  // DISPLAY ENEMY AP-REGEN TIME
 	  getactorvar[hitsprite].ENEMYAPREGENTIME TEMPVAR
	  ifvare SHOWTARGETHEALTH? 1 ifvarg TARGETHEALTH 0 ifvarg TEMPVAR 0
 	  {
         addvar digy 8
	   // Shows "APREGEN:" text
	   setvar digx 135
	   setvar temp 230
	   state pal11
	   state settilealphanum
  	   setvar textscale 49152
	   state orientation27
	   state gtz

	   state digx160
	   state settile2837 
	   state pal11
  	   setvar textscale 49152
	   state orientation27
	   divvar TEMPVAR 26
	   setvarvar varname TEMPVAR
	   state dnz
	  }

	  // DISPLAY ENEMY VAMPIRE TIME
 	  getactorvar[hitsprite].ENEMYVAMPIRETIME TEMPVAR
	  ifvare SHOWTARGETHEALTH? 1 ifvarg TARGETHEALTH 0 ifvarg TEMPVAR 0
	  {
         addvar digy 8
	   // Shows "VAMPIRE:" text
	   setvar digx 135
	   setvar temp 236
	   state pal10
	   state settilealphanum
  	   setvar textscale 49152
	   state orientation27
	   state gtz

	   state digx160
	   state settile2837
	   state pal10
  	   setvar textscale 49152
	   state orientation27
	   divvar TEMPVAR 26
	   setvarvar varname TEMPVAR
	   state dnz
	  }

        // DISPLAY ENEMY ELEMENTAL ATTRIBUTES        
        getactorvar[hitsprite].ACTORABSORBFLAGS TEMPVAR
	  ifvare SHOWTARGETHEALTH? 1 ifvarg TARGETHEALTH 0 ifvarn TEMPVAR 0
	  {
         addvar digy 8
	   // Shows "ABSORBS:" text
	   setvar digx 135
	   state setquote332
         redefinequote 332 ABSORBS:
	   state pal10
	   state settilealphanum
  	   setvar textscale 49152
	   state orientation27
	   state gtz

         setvar digx 118 // 131
	   state pal0
         state displayresisticons
	  }
        getactorvar[hitsprite].ACTORIMMUNEFLAGS TEMPVAR
	  ifvare SHOWTARGETHEALTH? 1 ifvarg TARGETHEALTH 0 ifvarn TEMPVAR 0
	  {
         addvar digy 8
	   // Shows "IMMUNE:" text
	   setvar digx 135
	   state setquote332
         redefinequote 332 IMMUNE TO:
	   state pal21
	   state settilealphanum
  	   setvar textscale 49152
	   state orientation27
	   state gtz

         setvar digx 118 // 131
	   state pal0
         state displayresisticons
	  }
        getactorvar[hitsprite].ACTORSTRONGFLAGS TEMPVAR
	  ifvare SHOWTARGETHEALTH? 1 ifvarg TARGETHEALTH 0 ifvarn TEMPVAR 0
	  {
         addvar digy 8
	   // Shows "RESISTS:" text
	   setvar digx 135
	   state setquote332
         redefinequote 332 RESISTS:
	   state pal13
	   state settilealphanum
  	   setvar textscale 49152
	   state orientation27
	   state gtz

         setvar digx 118 // 131
	   state pal0
         state displayresisticons
	  }
        getactorvar[hitsprite].ACTORWEAKNESSFLAGS TEMPVAR
	  ifvare SHOWTARGETHEALTH? 1 ifvarg TARGETHEALTH 0 ifvarn TEMPVAR 0
	  {
         addvar digy 8
	   // Shows "WEAK TO:" text
	   setvar digx 135
	   state setquote332
         redefinequote 332 WEAK TO:
	   state pal20
	   state settilealphanum
  	   setvar textscale 49152
	   state orientation27
	   state gtz

         setvar digx 118 // 131
	   state pal0
         state displayresisticons
	  }

        // ACTOR NAME DISPLAYS
	  ifvare TARGETTYPE 1
	  {
	   getactor[hitsprite].statnum TARGETTYPE
	   getactor[hitsprite].picnum TARGETSPECIES
	   getactor[hitsprite].pal TARGETPAL
	
	   ifvare TARGETSPECIES LIZTROOP state liztrooptargetting
	   else ifvare TARGETSPECIES LIZTROOPRUNNING state liztrooptargetting
	   else ifvare TARGETSPECIES LIZTROOPJUSTSIT state liztrooptargetting
	   else ifvare TARGETSPECIES LIZTROOPONTOILET state liztrooptargetting
	   else ifvare TARGETSPECIES LIZTROOPSTAYPUT state liztrooptargetting
	   else ifvare TARGETSPECIES LIZTROOPSHOOT state liztrooptargetting
	   else ifvare TARGETSPECIES LIZTROOPDUCKING state liztrooptargetting
	   else ifvare TARGETSPECIES LIZTROOPJETPACK state liztrooptargetting
	   else ifvare TARGETSPECIES PIGCOP state pigcoptargetting
	   else ifvare TARGETSPECIES PIGCOPSTAYPUT state pigcoptargetting
	   else ifvare TARGETSPECIES PIGCOPDIVE state pigcoptargetting
	   else ifvare TARGETSPECIES RECON
	   { 
	    state digx320
	    state oldskooltarget
	    redefinequote 142 PIGCOP RECON PATROL VEHICLE
	   } 
	   else ifvare TARGETSPECIES TANK
	   { 
	    state digx320 // 192 (100%), 230 (75%)
	    ifvare TARGETPAL 9
	    {
	     state oldskooltarget
	     redefinequote 142 PIGCOP RIOT TANK
	     setvar NPC_TYPE 1
	    }
	    else
	    {
	     state monstertarget
	     ifvare TARGETPAL 17 redefinequote 142 PIGCOP RIOT TANK [BLUE]
	     else ifvare TARGETPAL 19 redefinequote 142 PIGCOP RIOT TANK [RED]
	     else redefinequote 142 PIGCOP RIOT TANK [GREEN]
	     setvar NPC_TYPE 1
	    }
	   } 
	   else ifvare TARGETSPECIES EMPTYTANK
	   { 
	    state digx320
	    ifvare TARGETPAL 9
	    {
	     state oldskooltarget
	     redefinequote 142 EMPTY RIOT TANK [DRIVABLE]
	     setvar NPC_TYPE 2
	    }
	    else
	    {
	     state monstertarget
	     ifvare TARGETPAL 17 redefinequote 142 EMPTY BLUE RIOT TANK [DRIVABLE]
           else ifvare TARGETPAL 19 redefinequote 142 EMPTY RED RIOT TANK [DRIVABLE]
           else redefinequote 142 EMPTY GREEN RIOT TANK [DRIVABLE]
	     setvar NPC_TYPE 2
	    }
         }
	   else ifvare TARGETSPECIES 1870 // SCORPIONTANK
	   { 
	    state digx320
	    ifvare TARGETPAL 9
	    {
	     state oldskooltarget
	     redefinequote 142 PIGCOP SCORPION TANK
	     setvar NPC_TYPE 1
	    }
	    else
	    {
	     state monstertarget
	     redefinequote 142 PIGCOP SCORPION TANK
	     setvar NPC_TYPE 1
	    }
	   } 
	   else ifvare TARGETSPECIES LIZMAN state lizmantargetting
	   else ifvare TARGETSPECIES LIZMANJUMP state lizmantargetting
	   else ifvare TARGETSPECIES LIZMANSTAYPUT state lizmantargetting
	   else ifvare TARGETSPECIES LIZMANSPITTING state lizmantargetting
	   else ifvare TARGETSPECIES OCTABRAIN state octabraintargetting
	   else ifvare TARGETSPECIES OCTABRAINSTAYPUT state octabraintargetting
	   else ifvare TARGETSPECIES DRONE
	   { 
	    ifvare TARGETPAL 9
	    {
	     state oldskooltarget
	     redefinequote 142 SENTRY DRONE
    	     setvar NPC_TYPE 1
	     state digx320
	    }
	    else
	    ifvare TARGETPAL 25
	    {
	     state monstertarget
	     redefinequote 142 SUPER DRONE
           setvar NPC_TYPE 1
	     state digx320
	    }
	    else
	    {
	     state monstertarget
	     redefinequote 142 SENTRY DRONE
      	     setvar NPC_TYPE 1
	     state digx320
	    }
	   } 
	   else ifvare TARGETSPECIES GREENSLIME
	   { 
	    state digx320
	    ifvare TARGETPAL 9
	    {
	     state oldskooltarget
	     redefinequote 142 PROTOZOID SLIMER
           setvar NPC_TYPE 1
	    }
	    else
	    {
	     state monstertarget
	     redefinequote 142 PROTOZOID SLIMER
           setvar NPC_TYPE 1
	    }
	   } 
	   else ifvarg TARGETSPECIES 2370 ifvarl TARGETSPECIES 2378
	   { 
	    state digx320
	    ifvare TARGETPAL 9
	    {
	     state oldskooltarget
	     redefinequote 142 PROTOZOID SLIMER
           setvar NPC_TYPE 1
	    }
	    else
	    {
	     state monstertarget
	     redefinequote 142 PROTOZOID SLIMER
	     setvar NPC_TYPE 1
	    }
	   } 
	   else ifvare TARGETSPECIES EGG
	   { 
	    state digx320
	    ifvare TARGETPAL 9
	    {
	     state oldskooltarget
	     redefinequote 142 PROTOZOID SLIMER'S EGG
	     setvar NPC_TYPE 1
	    }
	    else
	    {
	     state monstertarget
	     redefinequote 142 PROTOZOID SLIMER'S EGG
	     setvar NPC_TYPE 1
	    }
	   } 
	   else ifvare TARGETSPECIES COMMANDER state commandertargetting
	   else ifvare TARGETSPECIES COMMANDERSTAYPUT state commandertargetting
	   else ifvare TARGETSPECIES NEWBEAST state newbeasttargetting
	   else ifvare TARGETSPECIES NEWBEASTSTAYPUT state newbeasttargetting
	   else ifvare TARGETSPECIES NEWBEASTJUMP state newbeasttargetting
	   else ifvare TARGETSPECIES NEWBEASTHANG state newbeasttargetting
	   else ifvare TARGETSPECIES NEWBEASTHANGDEAD
	   { 
	    ifvare TARGETPAL 17
	    {
	     state oddtarget
	     redefinequote 142 DEAD LESSER NAFERIAITE
	     state digx320
           setvar NPC_TYPE 1
	    }
	    else
	    ifvare TARGETPAL 20
	    {
	     state oddtarget
	     redefinequote 142 DEAD GREATER NAFERIAITE
	     state digx320
    	     setvar NPC_TYPE 1
	    }
	    else
	    {
	     state oddtarget
	     redefinequote 142 DEAD PROTECTOR DRONE
	     state digx320
           setvar NPC_TYPE 1
	    }
	   } 
	   else ifvare TARGETSPECIES BOSS1 state boss1targetting
	   else ifvare TARGETSPECIES BOSS1STAYPUT state boss1targetting
	   else ifvare TARGETSPECIES BOSS3 state boss3targetting
	   else ifvare TARGETSPECIES BOSS3STAYPUT state boss3targetting
	   else ifvare TARGETSPECIES BOSS3LOB state boss3targetting
	   else ifvare TARGETSPECIES BOSS2 state boss2targetting
	   else ifvare TARGETSPECIES BOSS2STAYPUT state boss2targetting
	   else ifvare TARGETSPECIES BOSS2SHOOT state boss2targetting
	   else ifvare TARGETSPECIES BOSS2BREATH state boss2targetting
	   else ifvare TARGETSPECIES BOSS4 state boss4targetting
	   else ifvare TARGETSPECIES BOSS4STAYPUT state boss4targetting
	   else ifvare TARGETSPECIES ROTATEGUN
	   { 
	    ifvare TARGETPAL 9
	    {
	     state oldskooltarget
	     redefinequote 142 MOUNTED TURRET
	     state digx320
	     setvar NPC_TYPE 1
	    }
	    else
	    ifvare TARGETPAL 17
	    {
	     state monstertarget
	     redefinequote 142 MOUNTED SHOTGUN TURRET
	     state digx320
	     setvar NPC_TYPE 1
	    }
	    else
	    ifvare TARGETPAL 19
	    {
	     state monstertarget
	     redefinequote 142 MOUNTED ROCKET TURRET
	     state digx320
	     setvar NPC_TYPE 1
	    }
	    else
	    {
	     state monstertarget
	     redefinequote 142 MOUNTED TURRET
	     state digx320
           setvar NPC_TYPE 1
	    }
	   } 
	   else ifvare TARGETSPECIES SHARK
	   { 
	    ifvare TARGETPAL 9
	    {
	     state oldskooltarget
	     redefinequote 142 SHARK
	     state digx320
	     setvar NPC_TYPE 3
	    }
	    else
	    ifvare TARGETPAL 24
	    {
	     state monstertarget
	     redefinequote 142 BLOODTOOTH SHARK
	     state digx320
	     setvar NPC_TYPE 1
	    }
	    else
	    {
	     state monstertarget
	     redefinequote 142 SHARK
	     state digx320
	     setvar NPC_TYPE 3
	    }
	   } 
	   else ifvare TARGETSPECIES PODFEM1
	   { 
	    state oldskooltarget
	    redefinequote 142 PODDED LADY
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES FEM7
	   { 
	    state oldskooltarget
	    redefinequote 142 DANCER
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES FEM1
	   { 
	    state oldskooltarget
	    redefinequote 142 STRIPPER
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES FEM2
	   { 
	    state oldskooltarget
	    redefinequote 142 STRIPPER
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES FEM3
	   { 
	    state oldskooltarget
	    redefinequote 142 YOUNG WOMAN
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES FEM4
	   { 
	    state oldskooltarget
	    redefinequote 142 DANCING LADY
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES FEM5
	   { 
	    state oldskooltarget
	    redefinequote 142 CAPTURED WOMAN
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES FEM6
	   { 
	    state oldskooltarget
	    redefinequote 142 CAPTURED WOMAN
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES NAKED1
	   { 
	    state oldskooltarget
	    redefinequote 142 CAPTURED WOMAN
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES FEM10
	   { 
	    state oldskooltarget
	    redefinequote 142 XXX-STACY ACTRESSES
	    state digx320
	    setvar NPC_TYPE 2
	   }
	   else ifvare TARGETSPECIES FEM9
	   { 
	    state oldskooltarget
	    redefinequote 142 CHEERLEADER
	    state digx320
	    setvar NPC_TYPE 2
	   }
	   else ifvare TARGETSPECIES TOUGHGAL
	   { 
	    state oldskooltarget
	    redefinequote 142 TOUGH GAL
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES ROBOTDOG
	   { 
	    state oldskooltarget
	    redefinequote 142 BORDER COLLIE
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES ROBOTDOG2
	   { 
	    state oldskooltarget
	    redefinequote 142 GREAT DANE PUPPY
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES DANCE1 // ENDWORLD Dancer #1
	   { 
	    state oldskooltarget
	    redefinequote 142 DANCER
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES DANCE2 // ENDWORLD Dancer #2
	   { 
	    state oldskooltarget
	    redefinequote 142 DANCER
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES DANCE3 // ENDWORLD Dancer #3
	   { 
	    state oldskooltarget
	    redefinequote 142 DANCER
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES DANCE5 // ENDWORLD Dancer #5
	   { 
	    state oldskooltarget
	    redefinequote 142 DANCER
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES DANCE6 // ENDWORLD Dancer #6
	   { 
	    state oldskooltarget
	    redefinequote 142 DANCER
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES DANCE7 // ENDWORLD Dancer #7
	   { 
	    state oldskooltarget
	    redefinequote 142 DANCER
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES DANCE9 // ENDWORLD Dancer #9
	   { 
	    state oldskooltarget
	    redefinequote 142 DANCER
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES DEALER // Weapons Dealer
	   { 
	    state oldskooltarget
	    redefinequote 142 WEAPONS DEALER
	    state digx320 // 200
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES STAND1 // Male NPC
	   { 
	    state oldskooltarget
	    redefinequote 142 STANDING GUY
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES STAND3 // Male NPC
	   { 
	    state oldskooltarget
	    redefinequote 142 STANDING GUY
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES STAND4 // Male NPC
	   { 
	    state oldskooltarget
	    redefinequote 142 STANDING GUY
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES WOLFDUDE
	   { 
	    state oldskooltarget
	    redefinequote 142 BJ BLAZKOWICZ
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES COP1 // Cop #1
	   { 
	    state oldskooltarget
	    redefinequote 142 POLICE OFFICER
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES COP2 // Cop #1
	   { 
	    state oldskooltarget
	    redefinequote 142 SWAT OFFICER
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES PUNKDUDE // Punk-Looking Guy
	   { 
	    state oldskooltarget
	    redefinequote 142 PUNK GUY
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES SITTINGDUDE // Sitting Guy
	   { 
	    state oldskooltarget
	    redefinequote 142 SITTING GUY
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES ANIMEGIRL1 // SW Anime Chick #1 [Tool Girl]
	   { 
	    state monstertarget
	    redefinequote 142 DRILL-WIELDING LADY
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES ANIMEGIRL2 // SW Anime Chick #2 [Hotrod Girl]
	   { 
	    state monstertarget
	    redefinequote 142 HOTROD SHOWGIRL
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES ANIMEGIRL3 // SW Anime Chick #3 ['Sailor' Babe]
	   { 
	    state monstertarget
	    redefinequote 142 SAILOR BABE
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES ANIMEGIRL4 // SW Anime Chick #4 [Washing Girl]
	   { 
	    state monstertarget
	    redefinequote 142 WASHING GIRL
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES 1338  // Helicopter
	   { 
	    state oldskooltarget
	    redefinequote 142 HELICOPTER
	    state digx320
	    setvar NPC_TYPE 2
	   } 
	   else ifvare TARGETSPECIES PRESIDENTCLINTON // President Bill Clinton
	   { 
	    state monstertarget
	    redefinequote 142 PRESIDENT BILL CLINTON
	    state digx320
	    setvar NPC_TYPE 4
	   } 
	   else // If the target is scannable but is not defined above :P
	   { 
	    setvar SHOWTARGETNAME? 0
	    setvar SHOWTARGETHEALTH? 0
	    setvar SHOWTARGETDEFENSE? 0
	    redefinequote 142 (UNIDENTIFIED ENTITY)
          state digx320
	    setvar NPC_TYPE 0
	   } 
	  } // ifvare TARGETTYPE 1

	  ifvare SHOWTARGETNAME? 1
	  {
	   ifvarg TARGETHEALTH 0
	   {
	    ifvarg ENEMYLEVELDISPLAY 0 setvar digy 71 else setvar digy 79 // 67
	    setvar tilenum 2822
	    setvarvar pal TARGETPAL
	    setvar temp 142
	    setvar textscale 57344
	    state orientation27
	    state gtz
	   }
	  } // ifvare SHOWTARGETNAME? 1
    } // ifvare TARGETTYPE 1

 } // ifvare TARGETCLOAKED? 0
 //************************
 //**End Scanner Displays**
 //************************
} // ifvarn hitsprite -1

   } // ifvare NIGHTVISION 1
  } // ifvarg CURRENTHITPOINTS 0 // ifp palive
 } // Blank line
} // ifvarl AUTOMAPMODE 2

 //*****************
 //**Hacker Vision**
 //*****************

ifvarand CHEATBITFIELD? 2
{
 ifvarl AUTOMAPMODE 2 state hackervision
}
else
{
 ifvare CHARACTERSELECTED? 8 ifvare HAVEHACKERVISION? 1 ifvarl AUTOMAPMODE 2 // Makes Lisa Able to use "Hacker Vision" :P
 {
  ifvarg CURRENTHITPOINTS 0
  {
   ifvare NIGHTVISION 1 state hackervision
  }
 }
 ifvare CHARACTERSELECTED? 15 ifvarl AUTOMAPMODE 2 // Maken has natural "Hacker Vision" :P
 {
  ifvarg CURRENTHITPOINTS 0 state hackervision
 }
}

//*************************
//*NORMAL HITSCAN DISPLAYS*
//*************************

ifvarl AUTOMAPMODE 2 //
{ // ifvarl AUTOMAPMODE 2
// To be stated later
   ifvarn normalhitscantoggle 0
   {
    ifvarn hitsprite -1
    { // ifvarn hitsprite -1
     getactor[hitsprite].statnum TARGETTYPE
     getactor[hitsprite].picnum TARGETSPECIES
     getactor[hitsprite].pal TARGETPAL
     getactorvar[hitsprite].ENEMYLEVEL ENEMYLEVELDISPLAY
     getactorvar[hitsprite].CLOAKED? TARGETCLOAKED? 
 
     setvar TEMPVAR5 0
     ifvare TARGETCLOAKED? 0 // Monster is visible
     {
      ifvare TARGETTYPE 1 // Awake [Monsters]
      {
       getactor[hitsprite].cstat tempc
       ifvarand tempc 32768 nullop
       else
       {
        getactor[hitsprite].cstat tempc
        ifvarand tempc 1024
        {
         getactorvar[hitsprite].ACTORFLAGS CALCVAR2
         ifvare TARGETSPECIES CRATE1
         {
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 30 redefinequote 142 WOODEN CRATE
          else redefinequote 142 METALLIC CRATE

          getactorvar[hitsprite].ACTORPHYSICSFLAGS TEMPVAR3
          ifvare TEMPVAR3 0 redefinequote 143 ^20 [^10WEIGHT: %d LBS^20]
          else ifvare TEMPVAR3 1 redefinequote 143 ^20 [^14WEIGHT: %d LBS^20]
          else ifvare TEMPVAR3 3 redefinequote 143 ^20 [^22WEIGHT: %d LBS^20]
          else ifvare TEMPVAR3 7 redefinequote 143 ^20 [^16WEIGHT: %d LBS^20]
          else ifvare TEMPVAR3 15 redefinequote 143 ^20 [^0WEIGHT: %d LBS^20]

          getactorvar[hitsprite].ACTORWEIGHT TEMPVAR3
          qsprintf 143 143 TEMPVAR3
          qstrcat 142 143
          state pal20
         }
         else
         ifvare TARGETSPECIES CRATE2
         {
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 30 redefinequote 142 METALLIC CRATE
          else redefinequote 142 WOODEN CRATE

          getactorvar[hitsprite].ACTORPHYSICSFLAGS TEMPVAR3
          ifvare TEMPVAR3 0 redefinequote 143 ^20 [^10WEIGHT: %d LBS^20]
          else ifvare TEMPVAR3 1 redefinequote 143 ^20 [^14WEIGHT: %d LBS^20]
          else ifvare TEMPVAR3 3 redefinequote 143 ^20 [^22WEIGHT: %d LBS^20]
          else ifvare TEMPVAR3 7 redefinequote 143 ^20 [^16WEIGHT: %d LBS^20]
          else ifvare TEMPVAR3 15 redefinequote 143 ^20 [^0WEIGHT: %d LBS^20]

          getactorvar[hitsprite].ACTORWEIGHT TEMPVAR3
          qsprintf 143 143 TEMPVAR3
          qstrcat 142 143
          state pal20
         }
         else
         ifvare TARGETSPECIES TELEBEACON
         {
          getactorvar[hitsprite].telebeaconid TEMPVAR3
          ifvare TEMPVAR3 -1 redefinequote 142 TELEPORTER BEACON [INACTIVE]
          else redefinequote 142 TELEPORTER BEACON [ACTIVE (# %d)]
          qsprintf 142 142 TEMPVAR3          
          state pal14
         }
         else
         ifvare TARGETSPECIES FAUXLEVELUP
         {
          redefinequote 142 POTENTYLENE 
          state checkactorpickupamounts
          state pal14
         }
         else
         ifvare TARGETSPECIES DONUTS
         {
          redefinequote 142 BOX OF DONUTS 
          state checkactorpickupamounts
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pal20 else state pal21
         }
         else ifvare TARGETSPECIES DONUTS2
         {
          redefinequote 142 PAIR OF DONUTS 
          state checkactorpickupamounts
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pal20 else state pal21
         }
         else ifvare TARGETSPECIES COLA
         {
          redefinequote 142 SMALL MEDIKIT 
          state checkactorpickupamounts
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pal20 else state pal14
         }
         else ifvare TARGETSPECIES SWMEDIKIT 
         {
          redefinequote 142 MEDIUM MEDIKIT 
          state checkactorpickupamounts
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pal20 else state pal14
         }
         else ifvare TARGETSPECIES SIXPAK 
         {
          redefinequote 142 LARGE MEDIKIT 
          state checkactorpickupamounts
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pal20 else state pal14
         }
         else ifvare TARGETSPECIES SWBIGMEDIKIT
         {
          redefinequote 142 EXTRA-LARGE MEDIKIT 
          state checkactorpickupamounts
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pal20 else state pal14
         }
         else ifvare TARGETSPECIES MEDPACK
         {
          redefinequote 142 MED PACK 
          state checkactorpickupamounts
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pal20 else state pal14
         }
         else ifvare TARGETSPECIES SURGERYKIT
         {
          redefinequote 142 SURGERY KIT 
          state checkactorpickupamounts
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTS state pal20 else state pal14
         }
         else ifvare TARGETSPECIES SMALLENERGYDRINK
         {
          redefinequote 142 SMALL ENERGY DRINK 
          state checkactorpickupamounts
          ifvarvarl CURRENTENERGYPOINTS MAXENERGYPOINTS state pal20 else state pal14
         }
         else ifvare TARGETSPECIES LARGEENERGYDRINK
         {
          redefinequote 142 LARGE ENERGY DRINK 
          state checkactorpickupamounts
          ifvarvarl CURRENTENERGYPOINTS MAXENERGYPOINTS state pal20 else state pal14
         }
         else ifvare TARGETSPECIES HYPERENERGYDRINK
         {
          redefinequote 142 HYPER ENERGY DRINK 
          state checkactorpickupamounts
          ifvarvarl CURRENTENERGYPOINTS MAXENERGYPOINTSATOMIC state pal20 else state pal14
         }
         else ifvare TARGETSPECIES WINTERCLOTHES
         {
          redefinequote 142 WINTER SUIT 
          state checkactorpickupamounts
          ifvarl winterclothes 100 state pal20 else state pal14
         }
         else ifvare TARGETSPECIES SHIELD
         {
          getactorvar[hitsprite].ARMORISUSED? TEMPVAR3
          ifvare TEMPVAR3 1 redefinequote 142 BODY ARMOR [USED] 
          else redefinequote 142 BODY ARMOR 
          state checkactorpickupamounts
          ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTS state pal20 else state pal14
         }
         else ifvare TARGETSPECIES COLORSHIELD
         {
          getactorvar[hitsprite].ARMORISUSED? TEMPVAR3
          ifvare TARGETPAL 10
          {
           ifvare TEMPVAR3 1 redefinequote 142 RED-CLASS ARMOR [USED] 
           else redefinequote 142 RED-CLASS ARMOR 
          }
          else
          ifvare TARGETPAL 13
          {
           ifvare TEMPVAR3 1 redefinequote 142 GRAY-CLASS ARMOR [USED] 
           else redefinequote 142 GRAY-CLASS ARMOR 
          }
          else
          ifvare TARGETPAL 14
          {
           ifvare TEMPVAR3 1 redefinequote 142 GREEN-CLASS ARMOR [USED] 
           else redefinequote 142 GREEN-CLASS ARMOR 
          }
          else
          ifvare TARGETPAL 16
          {
           ifvare TEMPVAR3 1 redefinequote 142 BLUE-CLASS ARMOR [USED] 
           else redefinequote 142 BLUE-CLASS ARMOR 
          }
          else
          ifvare TARGETPAL 20
          {
           ifvare TEMPVAR3 1 redefinequote 142 WHITE-CLASS ARMOR [USED] 
           else redefinequote 142 WHITE-CLASS ARMOR 
          }
          else
          ifvare TARGETPAL 23
          {
           ifvare TEMPVAR3 1 redefinequote 142 YELLOW-CLASS ARMOR [USED] 
           else redefinequote 142 YELLOW-CLASS ARMOR 
          }
          else
          {
           ifvare TEMPVAR3 1 redefinequote 142 RANDOM-CLASS ARMOR [USED] 
           else redefinequote 142 RANDOM-CLASS ARMOR 
          }
          state checkactorpickupamounts
          ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTS state pal20 else state pal14
         }
         else ifvare TARGETSPECIES SUPERSHIELD
         {
          getactorvar[hitsprite].ARMORISUSED? TEMPVAR3
          ifvare TEMPVAR3 1 redefinequote 142 SUPER BODY ARMOR [USED] 
          else redefinequote 142 SUPER BODY ARMOR 
          state checkactorpickupamounts
          ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTSATOMIC state pal20 else state pal14
         }
         else ifvare TARGETSPECIES GREENTANKCAPSULE
         {
          redefinequote 142 RIOT-TANK CAPSULE [GREEN] 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES BLUETANKCAPSULE
         {
          redefinequote 142 RIOT-TANK CAPSULE [BLUE] 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES REDTANKCAPSULE
         {
          redefinequote 142 RIOT-TANK CAPSULE [RED] 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES RESURRECTIONCHALICE
         {
          redefinequote 142 RESURRECTION CHALICE 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES EYEDROP
         {
          redefinequote 142 EYEDROP 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES ANTIDOTE
         {
          redefinequote 142 ANTIDOTE 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES FOGHORN
         {
          redefinequote 142 FOGHORN 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES ACCESSCARD
         {
          ifvare TARGETPAL 0 redefinequote 142 BLUE ACCESS CARD 
          else ifvare TARGETPAL 21 redefinequote 142 RED ACCESS CARD 
          else ifvare TARGETPAL 23 redefinequote 142 YELLOW ACCESS CARD 
          else ifvare TARGETPAL 22 redefinequote 142 GREEN ACCESS CARD 
          else ifvare TARGETPAL 15 redefinequote 142 BROWN ACCESS CARD 
          else ifvare TARGETPAL 12 redefinequote 142 SILVER ACCESS CARD 
          else ifvare TARGETPAL 24 redefinequote 142 BLOODY ACCESS CARD 
          state checkactorpickupamounts
          state pal13
         }
         else ifvare TARGETSPECIES ACCESSCARD2
         {
          ifvare TARGETPAL 0 redefinequote 142 BLUE ACCESS CARD 
          else ifvare TARGETPAL 21 redefinequote 142 RED ACCESS CARD 
          else ifvare TARGETPAL 23 redefinequote 142 YELLOW ACCESS CARD 
          else ifvare TARGETPAL 22 redefinequote 142 GREEN ACCESS CARD 
          else ifvare TARGETPAL 15 redefinequote 142 BROWN ACCESS CARD 
          else ifvare TARGETPAL 12 redefinequote 142 SILVER ACCESS CARD 
          else ifvare TARGETPAL 24 redefinequote 142 BLOODY ACCESS CARD 
          state checkactorpickupamounts
          state pal13
         }
         else ifvare TARGETSPECIES AMMO
         {
          redefinequote 142 PISTOL CLIP 
          state checkactorpickupamounts
          state pal0
         }
         else ifvare TARGETSPECIES SHOTGUNAMMO
         {
          redefinequote 142 BOX OF SHOTGUN SHELLS 
          state checkactorpickupamounts
          state pal0
         }
         else ifvare TARGETSPECIES BATTERYAMMO
         {
          redefinequote 142 BOX OF CHAINGUN AMMO 
          state checkactorpickupamounts
          state pal0
         }
         else ifvare TARGETSPECIES FREEZEAMMO
         {
          redefinequote 142 FREEZETHROWER PACK 
          state checkactorpickupamounts
          state pal0
         }
         else ifvare TARGETSPECIES CRYSTALAMMO
         {
          redefinequote 142 SHRINKER CRYSTAL 
          state checkactorpickupamounts
          state pal0
         }
         else ifvare TARGETSPECIES GROWAMMO
         {
          redefinequote 142 EXPANDER ANTENNA 
          state checkactorpickupamounts
          state pal0
         }
         else ifvare TARGETSPECIES DEVISTATORAMMO
         {
          redefinequote 142 DEVASTATOR MISSILES 
          state checkactorpickupamounts
          state pal0
         }
         else ifvare TARGETSPECIES RPGAMMO
         {
          redefinequote 142 RPG MISSILES 
          state checkactorpickupamounts
          state pal0
         }
         else ifvare TARGETSPECIES AMMOLOTS
         {
          redefinequote 142 PISTOL 
          state checkactorpickupamounts
          state pal13
         }
         else ifvare TARGETSPECIES FIRSTGUNSPRITE
         {
          redefinequote 142 PISTOL 
          state checkactorpickupamounts
          state pal13
         }
         else ifvare TARGETSPECIES SHOTGUNSPRITE
         {
          redefinequote 142 SHOTGUN 
          state checkactorpickupamounts
          state pal13
         }
         else ifvare TARGETSPECIES CHAINGUNSPRITE
         {
          redefinequote 142 RIPPER CHAINGUN 
          state checkactorpickupamounts
          state pal13
         }
         else ifvare TARGETSPECIES RPGSPRITE
         {
          redefinequote 142 RPG LAUNCHER 
          state checkactorpickupamounts
          state pal13
         }
         else ifvare TARGETSPECIES SHRINKERSPRITE
         {
          redefinequote 142 SHRINKER/EXPANDER 
          state checkactorpickupamounts
          state pal13
         }
         else ifvare TARGETSPECIES DEVISTATORSPRITE
         {
          redefinequote 142 DEVASTATOR WEAPON 
          state checkactorpickupamounts
          state pal13
         }
         else ifvare TARGETSPECIES TRIPBOMBSPRITE
         {
          redefinequote 142 LASER TRIPBOMB 
          state checkactorpickupamounts
          state pal13
         }
         else ifvare TARGETSPECIES FREEZESPRITE
         {
          redefinequote 142 FREEZETHROWER 
          state checkactorpickupamounts
          state pal13
         }
         else ifvare TARGETSPECIES HBOMBAMMO
         {
          redefinequote 142 BOX OF PIPEBOMBS 
          state checkactorpickupamounts
          state pal13
         }
         else ifvare TARGETSPECIES ENERGYCELL_SMALL
         {
          redefinequote 142 SINGLE ENERGY CELL 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES ENERGYCELL_MEDIUM
         {
          redefinequote 142 GROUP OF ENERGY CELLS 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES ENERGYCELL_LARGE
         {
          redefinequote 142 CLUSTER OF ENERGY CELLS 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES ATOMICHEALTH
         {
          redefinequote 142 ATOMIC HEALTH 
          state checkactorpickupamounts
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC state pal16 else state pal10
         }
         else ifvare TARGETSPECIES SUPERATOM
         {
          ifvare TARGETPAL 12
          {
           redefinequote 142 HYPER ATOM 
           state checkactorpickupamounts
           setvar TEMP3 0
           state superatom_maincheck
           ifvarg TEMP3 0 state pal16 else state pal10
          }
          else
          {
           redefinequote 142 SUPER ATOM 
           state checkactorpickupamounts
           setvar TEMP3 0
           ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC addvar TEMP3 1
           ifvarvarl FIRSTAIDCURRENT MAXHITPOINTSATOMIC addvar TEMP3 1
           ifvarvarl CURRENTARMORPOINTS MAXARMORPOINTSATOMIC addvar TEMP3 1
           ifvarg TEMP3 0 state pal16 else state pal10
          }
         }
         else ifvare TARGETSPECIES FORTUNECOOKIE
         {
          redefinequote 142 FORTUNE COOKIE 
          state checkactorpickupamounts
          ifvarvarl CURRENTHITPOINTS MAXHITPOINTSATOMIC state pal16 else state pal10
         }
         else ifvare TARGETSPECIES ENERGYSHELL
         {
          redefinequote 142 BIO-CELLULAR ENERGY SHIELD 
          state checkactorpickupamounts
          state pal15
         }
         else ifvare TARGETSPECIES ENERGYSHELL_UPGRADED
         {
          redefinequote 142 BIO-CELLULAR ENERGY SHIELD ADVANCEMENT UPGRADE
          state checkactorpickupamounts
          state pal15
         }
         else ifvare TARGETSPECIES HACKERVISION
         {
          redefinequote 142 HACKER VISION NODE 
          state checkactorpickupamounts
          state pal15
         }
         else ifvare TARGETSPECIES MERCURYCOMPUTER
         {
          redefinequote 142 MERCURY MINI-COMPUTER 
          state checkactorpickupamounts
          state pal15
         }
         else ifvare TARGETSPECIES MONEYRADAR
         {
          redefinequote 142 MONEY/GEM RADAR 
          state checkactorpickupamounts
          state pal15
         }
         else ifvare TARGETSPECIES PORTABLEATM
         {
          redefinequote 142 MOBILE ATM MACHINE 
          state checkactorpickupamounts
          state pal15
         }
         else ifvare TARGETSPECIES MEMBERSHIPCARD
         {
          ifvare CARDMEMBERSHIP? 0 redefinequote 142 BRONZE AKAIKUTSU CARD 
          ifvare CARDMEMBERSHIP? 1 redefinequote 142 SILVER AKAIKUTSU CARD 
          ifvare CARDMEMBERSHIP? 2 redefinequote 142 GOLD AKAIKUTSU CARD 
          ifvare CARDMEMBERSHIP? 3 redefinequote 142 PLATINUM AKAIKUTSU CARD 
          ifvare CARDMEMBERSHIP? 4 redefinequote 142 DIAMOND AKAIKUTSU CARD 
          state checkactorpickupamounts
          state pal15
         }
         else ifvare TARGETSPECIES COILS
         {
          redefinequote 142 TELEPORTER COILS 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES ONELIFETSHIRT
         {
          redefinequote 142 EXTRA-LIFE T-SHIRT 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES TWOLIFETSHIRT
         {
          redefinequote 142 DOUBLE EXTRA-LIFE T-SHIRT 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES CONTINUEITEM
         {
          redefinequote 142 CONTINUE 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES SUNRING
         {
          redefinequote 142 SUN RING 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES AQUARING
         {
          redefinequote 142 AQUA RING 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES PLASMARING
         {
          redefinequote 142 PLASMA RING 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES SPIRITRING
         {
          redefinequote 142 SPIRIT RING 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES CHARMANKH
         {
          redefinequote 142 CHARM ANKH 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES MIRRORSHIELD
         {
          redefinequote 142 MIRROR SHIELD 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES EXPBADGE
         {
          redefinequote 142 EXPERIENCE BADGE 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES RANKBADGE
         {
          redefinequote 142 RANK BADGE 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES MONEYBADGE
         {
          redefinequote 142 MONEY BADGE 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES RIOTSHIELD
         {
          redefinequote 142 TACTICAL RIOT SHIELD 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES NYXGLOVEPAIR
         {
          redefinequote 142 PAIR OF NYX GLOVES 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES RABBITSFOOT
         {
          redefinequote 142 RABBIT'S FOOT 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES JUMPBOOTPAIR
         {
          redefinequote 142 PAIR OF JUMP BOOTS 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES SHOCKABBOOTPAIR
         {
          redefinequote 142 PAIR OF SHOCKAB BOOTS 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES HAPPYSHOEPAIR
         {
          redefinequote 142 PAIR OF HAPPY SHOES 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES STYLESHOEPAIR
         {
          redefinequote 142 PAIR OF STYLE SHOES 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES CHARMSHOEPAIR
         {
          redefinequote 142 PAIR OF CHARM SHOES 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES POWERWRIST
         {
          redefinequote 142 POWER WRIST 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES HOCKEYMASK
         {
          redefinequote 142 HOCKEY MASK 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES GEMSTONECROWN
         {
          redefinequote 142 GEMSTONE CROWN 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES IRONRUNE
         {
          redefinequote 142 IRON RUNE 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES TWILIGHTCAPE
         {
          redefinequote 142 TWILIGHT CAPE 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES SNAKEARMBAND
         {
          redefinequote 142 SNAKE ARMBAND 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES MEDICBAG
         {
          redefinequote 142 MEDIC BAG 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES SERPENTHELMET
         {
          redefinequote 142 SERPENT HELMET 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES ENERGYINCURMENT
         {
          redefinequote 142 ENERGY INCURMENT 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES YINYANGORB
         {
          redefinequote 142 YIN-YANG ORB 
          state checkactorpickupamounts
          state pal14
         }
         else ifvare TARGETSPECIES SHIKONJEWEL
         {
          redefinequote 142 JEWEL OF FOUR SOULS 
          state checkactorpickupamounts
          state paletteflasher // state pal23
         }
         else ifvare TARGETSPECIES MYSTERYBOX
         {
          redefinequote 142 MYSTERY BOX 
          state checkactorpickupamounts
          state paletteflasher // state pal23
         }
         else ifvare TARGETSPECIES SILKCARNATION
         {
          redefinequote 142 SILK CARNATION 
          state checkactorpickupamounts
          state pal20
         }
         else ifvare TARGETSPECIES RAREPIRATEDOUBLOON
         {
          redefinequote 142 RARE PIRATE DOUBLOON 
          state checkactorpickupamounts
          state pal20
         }
         else ifvare TARGETSPECIES FIXEDDICEPAIR
         {
          redefinequote 142 PAIR OF FIXED DICE 
          state checkactorpickupamounts
          state pal20
         }
         else ifvare TARGETSPECIES MALAKIANGEM
         {
          redefinequote 142 MALAKIAN GEM 
          state checkactorpickupamounts
          state pal20
         }
         else ifvare TARGETSPECIES SAFELOCKBOX
         {
          redefinequote 142 SAFE LOCK BOX 
          state checkactorpickupamounts
          state pal20
         }
         else ifvare TARGETSPECIES SECRETRECIPE
         {
          redefinequote 142 SECRET RECIPE 
          state checkactorpickupamounts
          state pal20
         }
         else ifvare TARGETSPECIES SLURPEEMACHINE
         {
          redefinequote 142 SLURPEE MACHINE 
          state checkactorpickupamounts
          state pal20
         }
         else ifvare TARGETSPECIES STOCKOWNERSHIP
         {
          redefinequote 142 STOCK OWNERSHIP 
          state checkactorpickupamounts
          state pal20
         }
         else ifvare TARGETSPECIES TRANSDIMENSIONALSAFE
         {
          redefinequote 142 TRANSDIMENSIONAL SAFE 
          state checkactorpickupamounts
          state pal20
         }
         else ifvare TARGETSPECIES BLOODPACTSHIELD
         {
          redefinequote 142 BLOODPACT SHIELD 
          state checkactorpickupamounts
          state pal20
         }
         else ifvare TARGETSPECIES STEROIDS
         {
          redefinequote 142 VITAMIN X 
          state checkactorpickupamounts
          ifvarl STEROIDSTIME STEROID_AMOUNT state pal15 else state pal14
         }
         else ifvare TARGETSPECIES FIRSTAID
         {
          redefinequote 142 PORTABLE MEDIKIT 
          state checkactorpickupamounts
          ifvarvarl FIRSTAIDCURRENT MAXHITPOINTS state pal15 else state pal14
         }
         else ifvare TARGETSPECIES AIRTANK
         {
          redefinequote 142 SCUBA GEAR 
          state checkactorpickupamounts
          ifvarl SCUBATIME SCUBA_AMOUNT state pal15 else state pal14
         }
         else ifvare TARGETSPECIES HEATSENSOR
         {
          redefinequote 142 NIGHT-VISION GOGGLES 
          state checkactorpickupamounts
          ifvarl NIGHTVISIONTIME HEAT_AMOUNT state pal15 else state pal14
         }
         else ifvare TARGETSPECIES BOOTS
         {
          redefinequote 142 PROTECTIVE BOOTS 
          state checkactorpickupamounts
          ifvarl BOOTSTIME BOOT_AMOUNT state pal15 else state pal14
         }
         else ifvare TARGETSPECIES JETPACK
         {
          redefinequote 142 JETPACK 
          state checkactorpickupamounts
          ifvarl JETPACKTIME JETPACK_AMOUNT state pal15 else state pal14
         }
         else ifvare TARGETSPECIES HOLODUKE
         {
          ifvare CHARACTERSELECTED? 1 redefinequote 142 HOLODUKE 
          ifvare CHARACTERSELECTED? 2 redefinequote 142 HOLOJACK 
          ifvare CHARACTERSELECTED? 3 redefinequote 142 HOLOBUBSY 
          ifvare CHARACTERSELECTED? 4 redefinequote 142 HOLOAMI 
          ifvare CHARACTERSELECTED? 5 redefinequote 142 HOLOHIGA 
          ifvare CHARACTERSELECTED? 6 redefinequote 142 HOLOESSENCE 
          ifvare CHARACTERSELECTED? 7 redefinequote 142 HOLOTED 
          ifvare CHARACTERSELECTED? 8 redefinequote 142 HOLOLISA 
          ifvare CHARACTERSELECTED? 9 redefinequote 142 HOLOCYBANIS 
          ifvare CHARACTERSELECTED? 10
          { 
           ifvare NETHRAFORM? 0 redefinequote 142 HOLONETHRA 
           else redefinequote 142 HOLOCHRISTINA 
          }
          ifvare CHARACTERSELECTED? 11 redefinequote 142 HOLOPAULA 
          ifvare CHARACTERSELECTED? 12 redefinequote 142 HOLOLORI 
          ifvare CHARACTERSELECTED? 13 redefinequote 142 HOLOMINAKO 
          ifvare CHARACTERSELECTED? 14
          { 
           ifvare debugtoggle 0
           {
            ifvare PUBLICBETA? 1 redefinequote 321 HOLO??????? 
            else redefinequote 321 HOLONAFERIA 
           }
           else
           {
            ifvare PUBLICBETA? 1 redefinequote 321 HOLOHINOTORI 
            else redefinequote 321 HOLONAFERIA 
           }
           redefinequote 142 HOLO??????? 
          }
          ifvare CHARACTERSELECTED? 15
          { 
           redefinequote 142 HOLOMAKEN 
          }
          state checkactorpickupamounts
          ifvarl HOLOFORMTIME HOLODUKE_AMOUNT state pal15 else state pal14
         }
         else ifvare TARGETSPECIES MAXHPUP
         {
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 9 redefinequote 142 MAXIMUM HP BONUS [VERY LARGE] 
          else ifvare TEMPVAR3 3 redefinequote 142 MAXIMUM HP BONUS [LARGE] 
          else redefinequote 142 MAXIMUM HP BONUS 
          state checkactorpickupamounts
          state pal23
         }
         else ifvare TARGETSPECIES MAXAPUP
         {
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 9 redefinequote 142 MAXIMUM AP BONUS [VERY LARGE] 
          else ifvare TEMPVAR3 3 redefinequote 142 MAXIMUM AP BONUS [LARGE] 
          else redefinequote 142 MAXIMUM HP BONUS 
          state checkactorpickupamounts
          state pal23
         }
         else ifvare TARGETSPECIES MAXHPAPUP
         {
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 9 redefinequote 142 MAXIMUM HP/AP BONUS [VERY LARGE] 
          else ifvare TEMPVAR3 3 redefinequote 142 MAXIMUM HP/AP BONUS [LARGE] 
          else redefinequote 142 MAXIMUM HP/AP BONUS 
          state checkactorpickupamounts
          state pal23
         }
         else ifvare TARGETSPECIES MAXEPUP
         {
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 9 redefinequote 142 MAXIMUM EP BONUS [VERY LARGE] 
          else ifvare TEMPVAR3 3 redefinequote 142 MAXIMUM EP BONUS [LARGE] 
          else redefinequote 142 MAXIMUM EP BONUS 
          state checkactorpickupamounts
          state pal23
         }
         else ifvare TARGETSPECIES ATKUP
         {
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 9 redefinequote 142 ATTACK BONUS [VERY LARGE] 
          else ifvare TEMPVAR3 3 redefinequote 142 ATTACK BONUS [LARGE] 
          else redefinequote 142 ATTACK BONUS 
          state checkactorpickupamounts
          state pal23
         }
         else ifvare TARGETSPECIES DEFUP
         {
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 9 redefinequote 142 DEFENSE BONUS [VERY LARGE] 
          else ifvare TEMPVAR3 3 redefinequote 142 DEFENSE BONUS [LARGE] 
          else redefinequote 142 DEFENSE BONUS 
          state checkactorpickupamounts
          state pal23
         }
         else ifvare TARGETSPECIES ATKDEFUP
         {
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 9 redefinequote 142 ATTACK/DEFENSE BONUS [VERY LARGE] 
          else ifvare TEMPVAR3 3 redefinequote 142 ATTACK/DEFENSE BONUS [LARGE] 
          else redefinequote 142 ATTACK/DEFENSE BONUS 
          state checkactorpickupamounts
          state pal23
         }
         else ifvare TARGETSPECIES SPDUP
         {
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 9 redefinequote 142 SPEED BONUS [VERY LARGE] 
          else ifvare TEMPVAR3 3 redefinequote 142 SPEED BONUS [LARGE] 
          else redefinequote 142 SPEED BONUS 
          state checkactorpickupamounts
          state pal23
         }
         else ifvare TARGETSPECIES AIRTIMEBONUS
         {
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 9 redefinequote 142 UNDERWATER AIR TIME BONUS [VERY LARGE] 
          else ifvare TEMPVAR3 3 redefinequote 142 UNDERWATER AIR TIME BONUS [LARGE] 
          else redefinequote 142 UNDERWATER AIR TIME BONUS 
          state checkactorpickupamounts
          state pal23
         }
         else ifvare TARGETSPECIES MANTLEBONUS
         {
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 9 redefinequote 142 MANTLING STRENGTH BONUS [VERY LARGE] 
          else ifvare TEMPVAR3 3 redefinequote 142 MANTLING STRENGTH BONUS [LARGE] 
          else redefinequote 142 MANTLING STRENGTH BONUS 
          state checkactorpickupamounts
          state pal23
         }
         else ifvare TARGETSPECIES AIRJUMPBONUS
         {
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 9 redefinequote 142 AIR-JUMP BONUS [VERY LARGE] 
          else ifvare TEMPVAR3 3 redefinequote 142 AIR-JUMP BONUS [LARGE] 
          else redefinequote 142 AIR-JUMP BONUS 
          state checkactorpickupamounts
          state pal23
         }
         else ifvare TARGETSPECIES SATCHEL_SMALL
         {
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 9 redefinequote 142 SMALL AMMO SATCHEL [VERY LARGE] 
          else ifvare TEMPVAR3 3 redefinequote 142 SMALL AMMO SATCHEL [LARGE] 
          else redefinequote 142 SMALL AMMO SATCHEL 
          state checkactorpickupamounts
          state pal23
         }
         else ifvare TARGETSPECIES SATCHEL_LARGE
         {
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 9 redefinequote 142 LARGE AMMO SATCHEL [VERY LARGE] 
          else ifvare TEMPVAR3 3 redefinequote 142 LARGE AMMO SATCHEL [LARGE] 
          else redefinequote 142 LARGE AMMO SATCHEL 
          state checkactorpickupamounts
          state pal23
         }
         else ifvare TARGETSPECIES AFAS_DROP
         {
          redefinequote 142 AFA'S DROP 
          state checkactorpickupamounts
          state pal23
         }
         else ifvare TARGETSPECIES QUADDAMAGE
         {
          redefinequote 142 QUAD DAMAGE 
          state checkactorpickupamounts
          state pal8
         }
         else ifvare TARGETSPECIES ICONOFTHEDEFENDER
         {
          redefinequote 142 ICON OF THE DEFENDER 
          state checkactorpickupamounts
          state pal8
         }
         else ifvare TARGETSPECIES REGENITEM
         {
          redefinequote 142 REGENERATION ANKH 
          state checkactorpickupamounts
          state pal8
         }
         else ifvare TARGETSPECIES APREGENITEM
         {
          redefinequote 142 SHIELD EMBLEM 
          state checkactorpickupamounts
          state pal8
         }
         else ifvare TARGETSPECIES 5486 // Spinning Shield Emblem
         {
          redefinequote 142 SHIELD EMBLEM 
          state checkactorpickupamounts
          state pal8
         }
         else ifvare TARGETSPECIES VAMPIREITEM
         {
          redefinequote 142 VAMPIRE MASK 
          state checkactorpickupamounts
          state pal8
         }
         else ifvare TARGETSPECIES PENNY
         {
          redefinequote 142 $0.01 [COIN] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES NICKEL
         {
          redefinequote 142 $0.05 [COIN] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES DIME
         {
          redefinequote 142 $0.10 [COIN] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES QUARTER
         {
          redefinequote 142 $0.25 [COIN] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES HALFDOLLAR

         {
          redefinequote 142 $0.50 [COIN] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES SACDOLLAR
         {
          redefinequote 142 $1.00 [COIN] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES ONEDOLLAR
         {
          redefinequote 142 $1.00 [PAPER] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES TWODOLLARS
         {
          redefinequote 142 $2.00 [PAPER] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES TWODOLLARBUNDLE
         {
          redefinequote 142 $2.00 [PAPER BUNDLE] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES FIVEDOLLARS
         {
          redefinequote 142 $5.00 [PAPER] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES FIVEDOLLARBUNDLE
         {
          redefinequote 142 $5.00 [PAPER BUNDLE] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES NINEDOLLARBUNDLE
         {
          redefinequote 142 $9.00 [PAPER BUNDLE] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES TENDOLLARS
         {
          redefinequote 142 $10.00 [PAPER] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES TENDOLLARBUNDLE
         {
          redefinequote 142 $10.00 [PAPER BUNDLE] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES TWENTYDOLLARS
         {
          redefinequote 142 $20.00 [PAPER] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES FIFTYDOLLARS
         {
          redefinequote 142 $50.00 [PAPER] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES EIGHTYDOLLARBUNDLE
         {
          redefinequote 142 $80.00 [PAPER BUNDLE] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES ONEHUNDREDDOLLARS
         {
          redefinequote 142 $100.00 [PAPER] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES FIVEHUNDREDDOLLARS
         {
          redefinequote 142 $500.00 [PAPER] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES ONETHOUSANDDOLLARS
         {
          redefinequote 142 $1000.00 [PAPER] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES FIVETHOUSANDDOLLARS
         {
          redefinequote 142 $5000.00 [PAPER] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES TENTHOUSANDDOLLARS
         {
          redefinequote 142 $10000.00 [PAPER] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES ONEHUNDREDTHOUSANDDOLLARS
         {
          redefinequote 142 $100000.00 [PAPER] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES ONEMILLIONDOLLARS
         {
          redefinequote 142 $1000000.00 [PAPER] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES ONEBILLIONDOLLARS
         {
          redefinequote 142 $1000000000.00 [PAPER] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES GEMRINGSILVER
         {          
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 11 redefinequote 142 ZIRCON RING [SILVER] 
          else ifvare TEMPVAR3 16 redefinequote 142 AQUAMARINE RING [SILVER] 
          else ifvare TEMPVAR3 0 redefinequote 142 TURQUIOSE RING [SILVER] 
          else ifvare TEMPVAR3 14 redefinequote 142 EMERALD RING [SILVER] 
          else ifvare TEMPVAR3 21 redefinequote 142 GARNET RING [SILVER] 
          else ifvare TEMPVAR3 10 redefinequote 142 RUBY RING [SILVER] 
          else ifvare TEMPVAR3 23 redefinequote 142 CITRINE RING [SILVER] 
          else ifvare TEMPVAR3 12 redefinequote 142 DIAMOND RING [SILVER] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES GEMRINGGOLD
         {          
          getactor[hitsprite].pal TEMPVAR3
          ifvare TEMPVAR3 11 redefinequote 142 ZIRCON RING [GOLD] 
          else ifvare TEMPVAR3 16 redefinequote 142 AQUAMARINE RING [GOLD] 
          else ifvare TEMPVAR3 0 redefinequote 142 TURQUIOSE RING [GOLD] 
          else ifvare TEMPVAR3 14 redefinequote 142 EMERALD RING [GOLD] 
          else ifvare TEMPVAR3 21 redefinequote 142 GARNET RING [GOLD] 
          else ifvare TEMPVAR3 10 redefinequote 142 RUBY RING [GOLD] 
          else ifvare TEMPVAR3 23 redefinequote 142 CITRINE RING [GOLD] 
          else ifvare TEMPVAR3 12 redefinequote 142 DIAMOND RING [GOLD] 
          state checkactorpickupamounts
          state pal22
         }
         else ifvare TARGETSPECIES MONEYBAG
         {
          getactorvar[hitsprite].MONEYBAGDOLLARS TEMPVAR2
          getactorvar[hitsprite].MONEYBAGCENTS TEMPVAR3
          ifvarg TEMPVAR3 -1 ifvarl TEMPVAR3 10 redefinequote 142 MONEY BAG [WITH ^14$%d.0%d^22 INSIDE] 
          else redefinequote 142 MONEY BAG [WITH ^14$%d.%d^22 INSIDE] 
          qsprintf 142 142 TEMPVAR2 TEMPVAR3
          state pal22
         }
         else ifvarg TARGETSPECIES 8191 ifvarl TARGETSPECIES 8448 // Worldtiles
         {
          setvarvar tempb TARGETSPECIES
          subvar tempb 8191
          redefinequote 142 WORLDTILE #
          redefinequote 332 %d
          qsprintf 332 332 tempb
          qstrcat 142 332
          state checkactorpickupamounts
          state paletteflasher
         }
         else
         ifvare TARGETSPECIES PODFEM1
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 PODDED LADY
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES FEM7
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 DANCER
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES FEM1
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 STRIPPER
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES FEM2
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 STRIPPER
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES FEM3
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 YOUNG WOMAN
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES FEM4
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 DANCING LADY
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES FEM5
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 CAPTURED WOMAN
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES FEM6
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 CAPTURED WOMAN
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES NAKED1
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 CAPTURED WOMAN
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES FEM10
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 XXX-STACY ACTRESSES 
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES FEM9
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 CHEERLEADER
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES TOUGHGAL
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 TOUGH GAL
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES ROBOTDOG
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 BORDER COLLIE
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES ROBOTDOG2
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 GREAT DANE PUPPY
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES DANCE1
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 DANCER
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES DANCE2
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 DANCER
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES DANCE3
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 DANCER
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES DANCE5
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 DANCER
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES DANCE6
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 DANCER
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES DANCE7
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 DANCER
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES DANCE9
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 DANCER
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES DEALER
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 WEAPONS DEALER 
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES STAND1
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 STANDING GUY
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES STAND3
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 STANDING GUY
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES STAND4
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 STANDING GUY
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES WOLFDUDE
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 BJ BLAZKOWICZ
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES COP1
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 POLICE OFFICER
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES COP2
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 SWAT OFFICER
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES PUNKDUDE
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 PUNK DUDE
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES SITTINGDUDE
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 SITTING DUDE
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES ANIMEGIRL1
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 DRILL-WIELDING LADY
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES ANIMEGIRL2
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 HOTROD SHOWGIRL
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES ANIMEGIRL3
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 SAILOR BABE
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES ANIMEGIRL4
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 WASHING GIRL
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES 1338
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 HELICOPTER
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES PRESIDENTCLINTON
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 PRESIDENT BILL CLINTON
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES EGG
         { 
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 PROTOZOID SLIMER'S EGG
           state pal10
          }
         } 
         else
         ifvare TARGETSPECIES GREENSLIME
         { 
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 PROTOZOID SLIMER
           state pal10
          }
         } 
         else 
         ifvarg TARGETSPECIES 2370 ifvarl TARGETSPECIES 2378
         { 
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 PROTOZOID SLIMER
           state pal10
          }
         } 
         else
         ifvare TARGETSPECIES SHARK
         { 
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 9 redefinequote 142 SHARK
           else ifvare TARGETPAL 24 redefinequote 142 BLOODTOOTH SHARK
           else redefinequote 142 SHARK
           state pal10
          }
         } 
         else
         ifvare TARGETSPECIES ROTATEGUN
         { 
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 9 redefinequote 142 MOUNTED TURRET
           else ifvare TARGETPAL 17 redefinequote 142 MOUNTED SHOTGUN TURRET
           else ifvare TARGETPAL 19 redefinequote 142 MOUNTED ROCKET TURRET
           else redefinequote 142 MOUNTED TURRET
           state pal10
          }
         } 
         else
         ifvare TARGETSPECIES LIZTROOP
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 11
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ASSAULT TROOPER
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 PREDATAR [GRUNT]
           }
           else
           ifvare TARGETPAL 10
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ASSAULT CAPTAIN
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 PREDATAR [CAPTAIN]
           }
           else
           ifvare TARGETPAL 21
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ASSAULT CAPTAIN
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 PREDATAR [CAPTAIN]
           }
           else
           ifvare TARGETPAL 19
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 RAVAGER CAPTAIN
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 PREDATAR [DEMOLITIONIST]
           }
           else
           ifvare TARGETPAL 14
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 SHRINK TROOPER
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 PREDATAR [SHRINKER]
           }
           else
           ifvare TARGETPAL 17
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 COMMANDER ZERMAN
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 COMMANDER ION ZERMAN
           }
           else
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ASSAULT TROOPER
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 PREDATAR [GRUNT]
           }
           state pal10
          }
         }
         else
         ifvare TARGETSPECIES LIZTROOPONTOILET
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 11
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ASSAULT TROOPER
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 PREDATAR [GRUNT]
           }
           else
           ifvare TARGETPAL 10
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ASSAULT CAPTAIN
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 PREDATAR [CAPTAIN]
           }
           else
           ifvare TARGETPAL 21
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ASSAULT CAPTAIN
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 PREDATAR [CAPTAIN]
           }
           else
           ifvare TARGETPAL 19
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 RAVAGER CAPTAIN
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 PREDATAR [DEMOLITIONIST]
           }
           else
           ifvare TARGETPAL 14
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 SHRINK TROOPER
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 PREDATAR [SHRINKER]
           }
           else
           ifvare TARGETPAL 17
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 COMMANDER ZERMAN
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 COMMANDER ION ZERMAN
           }
           else
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ASSAULT TROOPER
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 PREDATAR [GRUNT]
           }
           state pal10
          }
         }
         else
         ifvare TARGETSPECIES LIZMAN
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 9
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ENFORCER
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 ANFARCIAR [GRUNT]
           }
           else
           ifvare TARGETPAL 6
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 BIO-WARRIOR ENFORCER
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 ANFARCIAR [ATOMIC]
           }
           else
           ifvare TARGETPAL 19
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 LASER-ENFORCER
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 ANFARCIAR [HYPERBLASTER]
           }
           else
           ifvare TARGETPAL 17
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 COMMANDER FERTANG
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 COMMANDER KENNETH FERTANG
           }
           else
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ENFORCER
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 ANFARCIAR [GRUNT]
           }
           state pal10
          }
         }
         else
         ifvare TARGETSPECIES DRONE
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 9 redefinequote 142 SENTRY DRONE
           else ifvare TARGETPAL 25 redefinequote 142 SUPER DRONE
           else redefinequote 142 SENTRY DRONE
           state pal10
          }
         }
         else
         ifvare TARGETSPECIES OCTABRAIN
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 9 redefinequote 142 OCTABRAIN
           else ifvare TARGETPAL 14 redefinequote 142 OCTANINE
           else redefinequote 142 OCTABRAIN
           state pal10
          }
         }
         else
         ifvare TARGETSPECIES PIGCOP
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 9 redefinequote 142 PIGCOP 
           else ifvare TARGETPAL 21 redefinequote 142 PIGCOP CAPTAIN
           else ifvare TARGETPAL 14 redefinequote 142 PIGCOP SARGEANT
           else ifvare TARGETPAL 24 redefinequote 142 PIGCOP COLONEL RAMONE
           else redefinequote 142 PIGCOP 
           state pal10
          }
         }
         else 
         ifvare TARGETSPECIES RECON
         { 
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 PIGCOP RECON PATROL VEHICLE
           state pal10
          }
         } 
         else
         ifvare TARGETSPECIES COMMANDER
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 9
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ASSAULT COMMANDER
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 GULTASIAMO [SOLDIER]
           }
           else
           ifvare TARGETPAL 24
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 BAALO THE COLLOSUS
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 BAALO THE COLLOSUS
           }
           else
           ifvare TARGETPAL 25
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ASSAULT LEADER
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 GULTASIAMO [LEADER]
           }
           else
           ifvare TARGETPAL 14
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ASSAULT GENERAL
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 GULTASIAMO [GRUNT]
           }
           else
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ASSAULT COMMANDER
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 GULTASIAMO [SOLDIER]
           }
           state pal10
          }
         }
         else
         ifvare TARGETSPECIES NEWBEAST
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 9
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 PROTECTOR DRONE
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 NAFERLING DRONE [LESSEST]
           }
           else
           ifvare TARGETPAL 17
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 LESSER NAFERIAITE
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 NAFERLING DRONE [MODERATE]
           }
           else
           ifvare TARGETPAL 20
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 GREATER NAFERIAITE
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 NAFERLING DRONE [GREATEST]
           }
           else
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 PROTECTOR DRONE
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 NAFERLING DRONE [LESSEST]
           }
           state pal10
          }
         }
         else
         ifvare TARGETSPECIES TANK
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 17 redefinequote 142 PIGCOP RIOT TANK [BLUE]
           else ifvare TARGETPAL 19 redefinequote 142 PIGCOP RIOT TANK [RED]
           else redefinequote 142 PIGCOP RIOT TANK [GREEN]
           state pal10
          }
         }
         else
         ifvare TARGETSPECIES SCORPIONTANK
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           redefinequote 142 PIGCOP SCORPION TANK
           state pal10
          }
         }
         else
         ifvare TARGETSPECIES EMPTYTANK
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 17 redefinequote 142 EMPTY BLUE RIOT TANK [DRIVABLE]
           else ifvare TARGETPAL 19 redefinequote 142 EMPTY RED RIOT TANK [DRIVABLE]
           else redefinequote 142 EMPTY GREEN RIOT TANK [DRIVABLE]
           state pal22
          }
         }
         else
         ifvare TARGETSPECIES BOSS1
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 9
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 BATTLELORD
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 MEDATARION [FULL GROWN]
           }
           else
           ifvare TARGETPAL 10
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 BATTLELORD JR.
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 MEDATARION [ADOLESCENT]
           }
           else
           ifvare TARGETPAL 24
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ELIMINATION SQUAD SOLDIER
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 MEDATARION [ELIMINATION SQUAD]
           }
           else
           ifvare TARGETPAL 0
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 BATTLELORD
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 MEDATARION [FULL GROWN]
           }
           else
           ifvare TARGETPAL 3
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 BATTLELORD
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 MEDATARION [FULL GROWN]
           }
           else
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 BATTLELORD JR.
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 MEDATARION [ADOLESCENT]
           }
           state pal10
          }
         }
         else
         ifvare TARGETSPECIES BOSS2
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 24
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 CYCLOID VOID-ANNHILATOR
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 CYCLOIDIAN [ELIMINATION SQUAD]
           }
           else
           ifvare TARGETPAL 0
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 CYCLOID EMPEROR
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 CYCLOIDIAN [FULL GROWN]
           }

           else
           ifvare TARGETPAL 3
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 CYCLOID EMPEROR
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 CYCLOIDIAN [FULL GROWN]
           }
           else
           ifvare TARGETPAL 9 // Special Prolouge Boss
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 D.C. INVASION'S ALIEN LEADER
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 CYCLOIDIAN [FULL GROWN]
           }
           else
           ifvare TARGETPAL 10
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 CYCLOID PRINCE
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 CYCLOIDIAN [ADOLESCENT]
           }
           else
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 CYCLOID PRINCE
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 CYCLOIDIAN [ADOLESCENT]
           }
           state pal10
          }
         }
         else
         ifvare TARGETSPECIES BOSS3
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 9
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 OVERLORD
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 KERIONAR [FULL GROWN]
           }
           else
           ifvare TARGETPAL 10
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 OVERLORD JR.
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 KERIONAR [ADOLESCENT]
           }
           else
           ifvare TARGETPAL 24
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 MEGATON OVERLORD
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 KERIONAR [ELIMINATION SQUAD]
           }
           else
           ifvare TARGETPAL 0
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 OVERLORD
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 KERIONAR [FULL GROWN]
           }
           else
           ifvare TARGETPAL 3
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 OVERLORD
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 KERIONAR [FULL GROWN]
           }
           else
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 OVERLORD JR.
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 KERIONAR [ADOLESCENT]
           }
           state pal10
          }
         }
         else
         ifvare TARGETSPECIES BOSS4
         {
          state enemyhitscanchecker
          ifvarn TEMPVAR5 1
          {
           ifvare TARGETPAL 9
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ALIEN QUEEN
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 NAFERLING [FULL GROWN]
           }
           else
           ifvare TARGETPAL 24
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 NAFERIA?!
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 NAFERIA?!
           }
           else
           ifvare TARGETPAL 0
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ALIEN QUEEN
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 NAFERLING [FULL GROWN]
           }
           else
           ifvare TARGETPAL 3
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ALIEN QUEEN
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 NAFERLING [FULL GROWN]
           }
           else
           {
            ifvare HITSCANNINGNAMES 0 redefinequote 142 ALIEN PRINCESS
            else ifvare HITSCANNINGNAMES 1 redefinequote 142 NAFERLING [ADOLESCENT]
           }
           state pal10
          }
         }
         else
         {
          getactorvar[hitsprite].ISMEMORBILIA? TEMP
          ifvare TEMP 1
          {
           state checktip_memorbilia
           redefinequote 142 [MEMORBILIA ITEM]
           state paletteflasher // state pal23
          }
          else
          {
           redefinequote 142 ? 
           state checkactorpickupamounts
           state pal4
          }
         }
 
         ifvarn TEMPVAR5 1
         {
          state digx320 // 128 (100%), ? (75%)
          setvar digy 85
          setvar tilenum 2822
          setvar temp 142
          setvar textscale 43008 // 57344
          state orientation27 // 1+2+8+16+32
          state gtz
         }
        }
       }
      }
     }
    }
   }

//************************************
//************************************
//**Fix/Hack/ATM/Heal-Station Checks**
//************************************
//************************************

   ifvarn hitwall -1
   {
       // ATM Use Notices [867]
       ifvare hitwallpicnum 867
       {
        ifvarn hitwalllotag 16384
        {
         ifvare oldskoolmode 0
         {
          ifvarg wallxdist -845
          {
           ifvarl wallxdist 845
           {
            ifvarg wallydist -845
            {
             ifvarl wallydist 845
             {
              ifvarg CURRENTHITPOINTS 0 // ifp palive
              {
               setvar temp 332
               setvarvar digx 320
               setvarvar digy 98
               state pal20
               redefinequote 332 PRESS THE ^16"
               getkeyname 888 6 0
               redefinequote 889 "^20 KEY TO USE THIS ATM...
               qstrcat 332 888
               qstrcat 332 889
               setvar textscale 40960
               state settilealphanum
               state orientation27
               state gtz
              }
             }
            }
           }
          }
         }
        }
       }


       // ATM Fix Notices
       ifvare hitwallpicnum 888
       {
        ifvarn hitwalllotag 16384
        {
         ifvare oldskoolmode 0
         {
          ifvarg wallxdist -845
          {
           ifvarl wallxdist 845
           {
            ifvarg wallydist -845
            {
             ifvarl wallydist 845
             {
              ifvarg CURRENTHITPOINTS 0 // ifp palive
              {
               ifvare CHARACTERSELECTED? 8
               {
                setvar temp 332
                setvarvar digx 230 // digx_test
                setvarvar digy 94 // digy_test
                redefinequote 332 CAN BE FIXED FOR:
                setvar textscale 49152
                state pal16
                state settilealphanum
                state orientation27
                state gtz

                setvar temp 332
                setvarvar digx 214
                setvarvar digy 102
                state pal16
                ifvarg DOLLARS 10499 redefinequote 332 ^20$10500.00 
                else redefinequote 332 ^10$10500.00 
                ifvarg CURRENTENERGYPOINTS 39 redefinequote 888 ^0AND ^2040 EP
                else redefinequote 888 ^0AND ^1040 EP
                qstrcat 332 888
                setvar textscale 49152
                state pal16
                state settilealphanum
                state orientation27
                state gtz
               }
              }
             }
            }
           }
          }
         }
        }
       }

       // Snack Machine Use Notices [1212]
       ifvare hitwallpicnum 1212
       {
        ifvarn hitwalllotag 16384
        {
         ifvare oldskoolmode 0
         {
          ifvarg wallxdist -845
          {
           ifvarl wallxdist 845
           {
            ifvarg wallydist -845
            {
             ifvarl wallydist 845
             {
              ifvarg CURRENTHITPOINTS 0 // ifp palive
              {
               setvar temp 332
               setvarvar digx 320
               setvarvar digy 98
               state pal20
               redefinequote 332 PRESS THE ^16"
               getkeyname 888 6 0
               redefinequote 889 "^20 KEY TO USE THIS SNACK MACHINE...
               qstrcat 332 888
               qstrcat 332 889
               setvar textscale 40960
               state settilealphanum
               state orientation27
               state gtz
              }
             }
            }
           }
          }
         }
        }
       }

       // Snack Machine Fix Notices
       ifvare hitwallpicnum 1214
       {
        ifvare hitwallextra -1
        {
         ifvare oldskoolmode 0
         {
          ifvarg wallxdist -845
          {
           ifvarl wallxdist 845
           {
            ifvarg wallydist -845
            {
             ifvarl wallydist 845
             {
              ifvarg CURRENTHITPOINTS 0 // ifp palive
              {
               ifvare CHARACTERSELECTED? 8
               {
                setvar temp 332
                setvarvar digx 230 // digx_test
                setvarvar digy 94 // digy_test
                redefinequote 332 CAN BE FIXED FOR:
                setvar textscale 49152
                state pal16
                state settilealphanum
                state orientation27
                state gtz

                setvar temp 332
                setvarvar digx 228
                setvarvar digy 102
                state pal16
                ifvarg DOLLARS 499 redefinequote 332 ^20$500.00 
                else redefinequote 332 ^10$500.00 
                ifvarg CURRENTENERGYPOINTS 9 redefinequote 888 ^0AND ^2010 EP
                else redefinequote 888 ^0AND ^1010 EP
                qstrcat 332 888
                setvar textscale 49152
                state pal16
                state settilealphanum
                state orientation27
                state gtz
               }
              }
             }
            }
           }
          }
         }
        }
       }

       // Cola Machine Use Notices [1215]
       ifvare hitwallpicnum 1215
       {
        ifvarn hitwalllotag 16384
        {
         ifvare oldskoolmode 0
         {
          ifvarg wallxdist -845
          {
           ifvarl wallxdist 845
           {
            ifvarg wallydist -845
            {
             ifvarl wallydist 845
             {
              ifvarg CURRENTHITPOINTS 0 // ifp palive
              {
               setvar temp 332
               setvarvar digx 320
               setvarvar digy 98
               state pal20
               redefinequote 332 PRESS THE ^16"
               getkeyname 888 6 0
               redefinequote 889 "^20 KEY TO USE THIS COLA MACHINE...
               qstrcat 332 888
               qstrcat 332 889
               setvar textscale 40960
               state settilealphanum
               state orientation27
               state gtz
              }
             }
            }
           }
          }
         }
        }
       }

       // Cola Machine Fix Notices
       ifvare hitwallpicnum 1217
       {
        ifvare hitwallextra -1
        {
         ifvare oldskoolmode 0
         {
          ifvarg wallxdist -845
          {
           ifvarl wallxdist 845
           {
            ifvarg wallydist -845
            {
             ifvarl wallydist 845
             {
              ifvarg CURRENTHITPOINTS 0 // ifp palive
              {
               ifvare CHARACTERSELECTED? 8
               {
                setvar temp 332
                setvarvar digx 230 // digx_test
                setvarvar digy 94 // digy_test
                redefinequote 332 CAN BE FIXED FOR:
                setvar textscale 49152
                state pal16
                state settilealphanum
                state orientation27
                state gtz

                setvar temp 332
                setvarvar digx 228
                setvarvar digy 102
                state pal16
                ifvarg DOLLARS 499 redefinequote 332 ^20$500.00 
                else redefinequote 332 ^10$500.00 
                ifvarg CURRENTENERGYPOINTS 9 redefinequote 888 ^0AND ^2010 EP
                else redefinequote 888 ^0AND ^1010 EP
                qstrcat 332 888
                setvar textscale 49152
                state pal16
                state settilealphanum
                state orientation27
                state gtz
               }
              }
             }
            }
           }
          }
         }
        }
       }

       // Cola Machine Use Notices [1215]
       ifvarg hitwallpicnum 7635 ifvarl hitwallpicnum 7677
       {
        ifvarn hitwalllotag 16384
        {
         ifvare oldskoolmode 0
         {
          ifvarg wallxdist -845
          {
           ifvarl wallxdist 845
           {
            ifvarg wallydist -845
            {
             ifvarl wallydist 845
             {
              ifvarg CURRENTHITPOINTS 0 // ifp palive
              {
               setvar temp 332
               setvarvar digx 320
               setvarvar digy 98
               state pal20
               redefinequote 332 PRESS THE ^16"
               getkeyname 888 6 0
               redefinequote 889 "^20 KEY TO USE THIS COLA MACHINE...
               qstrcat 332 888
               qstrcat 332 889
               setvar textscale 40960
               state settilealphanum
               state orientation27
               state gtz
              }
             }
            }
           }
          }
         }
        }
       }

       // Snack Machine Use Notices
       ifvarg hitwallpicnum 7676 ifvarl hitwallpicnum 7679
       {
        ifvarn hitwalllotag 16384
        {
         ifvare oldskoolmode 0
         {
          ifvarg wallxdist -845
          {
           ifvarl wallxdist 845
           {
            ifvarg wallydist -845
            {
             ifvarl wallydist 845
             {
              ifvarg CURRENTHITPOINTS 0 // ifp palive
              {
               setvar temp 332
               setvarvar digx 320
               setvarvar digy 98
               state pal20
               redefinequote 332 PRESS THE ^16"
               getkeyname 888 6 0
               redefinequote 889 "^20 KEY TO USE THIS SNACK MACHINE...
               qstrcat 332 888
               qstrcat 332 889
               setvar textscale 40960
               state settilealphanum
               state orientation27
               state gtz
              }
             }
            }
           }
          }
         }
        }
       }

       // Cola Machine Use Notices
       ifvare hitwallpicnum 7679
       {
        ifvarn hitwalllotag 16384
        {
         ifvare oldskoolmode 0
         {
          ifvarg wallxdist -845
          {
           ifvarl wallxdist 845
           {
            ifvarg wallydist -845
            {
             ifvarl wallydist 845
             {
              ifvarg CURRENTHITPOINTS 0 // ifp palive
              {
               setvar temp 332
               setvarvar digx 320
               setvarvar digy 98
               state pal20
               redefinequote 332 PRESS THE ^16"
               getkeyname 888 6 0
               redefinequote 889 "^20 KEY TO USE THIS COLA MACHINE...
               qstrcat 332 888
               qstrcat 332 889
               setvar textscale 40960
               state settilealphanum
               state orientation27
               state gtz
              }
             }
            }
           }
          }
         }
        }
       }
   }

} // ifvarl AUTOMAPMODE 2

// END OF SPECIES DISPLAY CODE
} // ifvare mainmenu 0

// The Following Crap is for the Air Meter feature

// If the player has submerged, show air bar
			ifvarn statusdisplaytoggle 0
			{

ifvare SECTORLOTAG 2

  {
   state displayair

   // Shows the Air Meter itself
   setvar digx 166 // 160
   setvar digy 12
   state digz65536
   setvar diga 0
   state orientation10 // 2+8=26
   state rs

   ifvarl AIRTIME 1 state pal10
   else state pal0

   // Shows the word "Air"
   setvar digx 110 // 104
   setvar digy 12 // 184
   state digz65536
   setvar diga 0
   setvar tilenum 5000
   addvar tilenum 31
   state orientation10 // 2+8=26
   state rs

   // Shows amount of seconds
   ifvarg AIRTIME 0
   {
    state orientation26
    state settile2837
    setvar textscale 49152
    setvar digx 165
    setvar digy 9
    setvarvar varname AIRTIME
    divvar varname 26
    ifvarg AIRFACTOR 9999 state pal0
    else ifvarl AIRFACTOR 10000 ifvarg AIRFACTOR 6666 state pal0
    else ifvarl AIRFACTOR 6667 ifvarg AIRFACTOR 3333 state pal23
    else ifvarl AIRFACTOR 3334 state pal10
    state dnz
   }

   // Debug
   ifvare debugtoggle 1
   {
    // varname DEBUGAIRTIME
    getplayervar[THISACTOR].AIRTIME varname
    setvar digx 146 // 164
    setvar digy 18 // 18
    state orientation17
    state settile3010
    ifvarl varname 1 state pal10
    else state pal0
    state dn

    setvar digx 146 // 164
    setvar digy 24
    divvar varname 26
    state dn

    getplayervar[THISACTOR].MAXAIRTIME varname
    setvar digx 182 // 164
    setvar digy 18 // 18
    state orientation17
    state settile3010
    ifvarl varname 1 state pal10
    else state pal0
    state dn

    setvar digx 182 // 164
    setvar digy 24
    divvar varname 26
    state dn

    setvar digy 30
    setvarvar varname AIRFACTOR
    state dn

    getplayervar[THISACTOR].AIRTIMEEXTRA varname
    setvar digx 164 // 164
    setvar digy 36 // 18
    state orientation17
    state settile3010
    ifvarl varname 1 state pal10
    else state pal0
    state dn

   }
  }

// If the player has resurfaced and does not have maximum air, make the airbar transperant until air fills back up

 ifvarn SECTORLOTAG 2
 {
  ifvarvarl AIRTIME MAXAIRTIME
  {
   state displayair

   // Shows the Air Meter itself
   setvar digx 166 // 160
   setvar digy 12
   state digz65536
   setvar diga 0
   state orientation11 // 2+8=26
   state rs

   ifvarl AIRTIME 1 state pal10
   else state pal0

   // Shows the word "Air"
   setvar digx 110 // 104
   setvar digy 12
   state digz65536
   setvar diga 0
   setvar tilenum 5000
   addvar tilenum 31
   state pal0
   state orientation11 // 2+8=26
   state rs

   // Shows amount of seconds
   ifvarg AIRTIME 0
   {
    state orientation27
    state settile2837
    setvar textscale 49152
    setvar digx 165
    setvar digy 9
    setvarvar varname AIRTIME
    divvar varname 26
    ifvarg AIRFACTOR 9999 state pal0
    else ifvarl AIRFACTOR 10000 ifvarg AIRFACTOR 6666 state pal0
    else ifvarl AIRFACTOR 6667 ifvarg AIRFACTOR 3333 state pal23
    else ifvarl AIRFACTOR 3334 state pal10
    state dnz
   }

   // Debug
   ifvare debugtoggle 1
   {
    // varname DEBUGAIRTIME
    getplayervar[THISACTOR].AIRTIME varname
    setvar digx 146 // 164
    setvar digy 18 // 18
    state orientation49
    state settile3010
    ifvarl varname 1 state pal10
    else state pal0
    state dn

    setvar digx 146 // 164
    setvar digy 24
    divvar varname 26
    state dn

    getplayervar[THISACTOR].MAXAIRTIME varname
    setvar digx 182 // 164
    setvar digy 18 // 18
    state orientation49
    state settile3010
    ifvarl varname 1 state pal10
    else state pal0
    state dn

    setvar digx 182 // 164
    setvar digy 24
    divvar varname 26
    state dn

    setvar digy 30
    setvarvar varname AIRFACTOR
    state dn

   }
  }
 }

 setvar shade 0
 ifvare mainmenu 0
 {
  setvar shade 0
  // Winter Clothes Counter
  setvarvar MANTLINGFACTOR winterclothes
  mulvar MANTLINGFACTOR 10000
  divvarvar MANTLINGFACTOR 100

  ifvarg MANTLINGFACTOR 5000 state pal20
  else ifvarl MANTLINGFACTOR 5001 state pal13

  ifvarg MANTLINGFACTOR 9676 setvar tilenum 5001
  ifvarl MANTLINGFACTOR 9677 ifvarg MANTLINGFACTOR 9354 setvar tilenum 5002
  ifvarl MANTLINGFACTOR 9355 ifvarg MANTLINGFACTOR 9031 setvar tilenum 5003
  ifvarl MANTLINGFACTOR 9032 ifvarg MANTLINGFACTOR 8709 setvar tilenum 5004
  ifvarl MANTLINGFACTOR 8710 ifvarg MANTLINGFACTOR 8386 setvar tilenum 5005
  ifvarl MANTLINGFACTOR 8387 ifvarg MANTLINGFACTOR 8064 setvar tilenum 5006
  ifvarl MANTLINGFACTOR 8065 ifvarg MANTLINGFACTOR 7741 setvar tilenum 5007
  ifvarl MANTLINGFACTOR 7742 ifvarg MANTLINGFACTOR 7418 setvar tilenum 5008
  ifvarl MANTLINGFACTOR 7419 ifvarg MANTLINGFACTOR 7096 setvar tilenum 5009
  ifvarl MANTLINGFACTOR 7097 ifvarg MANTLINGFACTOR 6673 setvar tilenum 5010
  ifvarl MANTLINGFACTOR 6674 ifvarg MANTLINGFACTOR 6451 setvar tilenum 5011
  ifvarl MANTLINGFACTOR 6452 ifvarg MANTLINGFACTOR 6128 setvar tilenum 5012
  ifvarl MANTLINGFACTOR 6129 ifvarg MANTLINGFACTOR 5805 setvar tilenum 5013
  ifvarl MANTLINGFACTOR 5806 ifvarg MANTLINGFACTOR 5483 setvar tilenum 5014
  ifvarl MANTLINGFACTOR 5484 ifvarg MANTLINGFACTOR 5160 setvar tilenum 5015
  ifvarl MANTLINGFACTOR 5161 ifvarg MANTLINGFACTOR 4838 setvar tilenum 5016
  ifvarl MANTLINGFACTOR 4839 ifvarg MANTLINGFACTOR 4515 setvar tilenum 5017
  ifvarl MANTLINGFACTOR 4516 ifvarg MANTLINGFACTOR 4193 setvar tilenum 5018
  ifvarl MANTLINGFACTOR 4194 ifvarg MANTLINGFACTOR 3870 setvar tilenum 5019
  ifvarl MANTLINGFACTOR 3871 ifvarg MANTLINGFACTOR 3547 setvar tilenum 5020
  ifvarl MANTLINGFACTOR 3548 ifvarg MANTLINGFACTOR 3225 setvar tilenum 5021
  ifvarl MANTLINGFACTOR 3226 ifvarg MANTLINGFACTOR 2902 setvar tilenum 5022
  ifvarl MANTLINGFACTOR 2903 ifvarg MANTLINGFACTOR 2580 setvar tilenum 5023
  ifvarl MANTLINGFACTOR 2581 ifvarg MANTLINGFACTOR 2257 setvar tilenum 5024
  ifvarl MANTLINGFACTOR 2258 ifvarg MANTLINGFACTOR 1934 setvar tilenum 5025
  ifvarl MANTLINGFACTOR 1935 ifvarg MANTLINGFACTOR 1612 setvar tilenum 5026
  ifvarl MANTLINGFACTOR 1613 ifvarg MANTLINGFACTOR 1289 setvar tilenum 5027
  ifvarl MANTLINGFACTOR 1290 ifvarg MANTLINGFACTOR 967 setvar tilenum 5028
  ifvarl MANTLINGFACTOR 968 ifvarg MANTLINGFACTOR 644 setvar tilenum 5029
  ifvarl MANTLINGFACTOR 645 ifvarg MANTLINGFACTOR 322 setvar tilenum 5030
  ifvarl MANTLINGFACTOR 323 setvar tilenum 5031
  addvar tilenum 31
  ifvarg winterclothes 0
  {

   setvar TEMPVAR5 0
   ifvarg PLAYERSTATUS? 0 addvar TEMPVAR5 1
   ifvarg QUADTIME 0 addvar TEMPVAR5 1
   ifvarg INVULNTIME 0 addvar TEMPVAR5 1
   ifvarg REGENTIME 0 addvar TEMPVAR5 1
   ifvarg APREGENTIME 0 addvar TEMPVAR5 1
   ifvarg VAMPIRETIME 0 addvar TEMPVAR5 1

   // Shows the Mantling Meter itself
   setvarvar digx 67 // 166
   setvarvar digy 124 // 157 // 12
   ifvarg TEMPVAR5 0 nullop else addvar digy 11 // ifvarg PLAYERSTATUS? 0 nullop else addvar digy 11
   ifvarg freezetimer 0 nullop else addvar digy 6
   ifvarg PARTYSIZE 1 nullop else addvar digy 6
   ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
   ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
   setvarvar digz 49152 // 65536
   setvar diga 0
   state orientation10
   state rs

   // Shows 'COZY'
   state orientation26
   setvar tilenum 2822 // state settile2837
   setvar textscale 40960 // 44237
   setvar digx 19 // 57 // 160
   setvar digy 122 // 155 // 21
   ifvarg TEMPVAR5 0 nullop else addvar digy 11 // ifvarg PLAYERSTATUS? 0 nullop else addvar digy 11
   ifvarg freezetimer 0 nullop else addvar digy 6
   ifvarg PARTYSIZE 1 nullop else addvar digy 6
   ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
   ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
   ifvarg MANTLINGFACTOR 9999 state pal20
   else ifvarl MANTLINGFACTOR 10000 ifvarg MANTLINGFACTOR 5000 state pal20
   else ifvarl MANTLINGFACTOR 5001 state pal13
   state setquote332
   redefinequote 332 COZY
   state gtz

   // Shows amount of seconds
   state orientation26
   setvar tilenum 2822 // state settile2837
   setvar textscale 40960 // 44237
   setvar digx 120 // 57 // 160
   setvar digy 122 // 155 // 21
   ifvarg TEMPVAR5 0 nullop else addvar digy 11 // ifvarg PLAYERSTATUS? 0 nullop else addvar digy 11
   ifvarg freezetimer 0 nullop else addvar digy 6
   ifvarg PARTYSIZE 1 nullop else addvar digy 6
   ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
   ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
   setvarvar varname winterclothes
   ifvarg MANTLINGFACTOR 9999 state pal20
   else ifvarl MANTLINGFACTOR 10000 ifvarg MANTLINGFACTOR 5000 state pal20
   else ifvarl MANTLINGFACTOR 5001 state pal13
   state setquote332
   redefinequote 332 %ld%
   qsprintf 332 332 varname
   state gtz
  }

  setvar shade 0
  // Freeze Counter
  setvarvar MANTLINGFACTOR freezetimermax
  subvarvar MANTLINGFACTOR freezetimer
  mulvar MANTLINGFACTOR 10000
  ifvarn freezetimermax 0 { divvarvar MANTLINGFACTOR freezetimermax }

  ifvarg MANTLINGFACTOR 5000 state pal0
  else ifvarl MANTLINGFACTOR 5001 state pal16

  ifvarg MANTLINGFACTOR 9676 setvar tilenum 5001
  ifvarl MANTLINGFACTOR 9677 ifvarg MANTLINGFACTOR 9354 setvar tilenum 5002
  ifvarl MANTLINGFACTOR 9355 ifvarg MANTLINGFACTOR 9031 setvar tilenum 5003
  ifvarl MANTLINGFACTOR 9032 ifvarg MANTLINGFACTOR 8709 setvar tilenum 5004
  ifvarl MANTLINGFACTOR 8710 ifvarg MANTLINGFACTOR 8386 setvar tilenum 5005
  ifvarl MANTLINGFACTOR 8387 ifvarg MANTLINGFACTOR 8064 setvar tilenum 5006
  ifvarl MANTLINGFACTOR 8065 ifvarg MANTLINGFACTOR 7741 setvar tilenum 5007
  ifvarl MANTLINGFACTOR 7742 ifvarg MANTLINGFACTOR 7418 setvar tilenum 5008
  ifvarl MANTLINGFACTOR 7419 ifvarg MANTLINGFACTOR 7096 setvar tilenum 5009
  ifvarl MANTLINGFACTOR 7097 ifvarg MANTLINGFACTOR 6673 setvar tilenum 5010
  ifvarl MANTLINGFACTOR 6674 ifvarg MANTLINGFACTOR 6451 setvar tilenum 5011
  ifvarl MANTLINGFACTOR 6452 ifvarg MANTLINGFACTOR 6128 setvar tilenum 5012
  ifvarl MANTLINGFACTOR 6129 ifvarg MANTLINGFACTOR 5805 setvar tilenum 5013
  ifvarl MANTLINGFACTOR 5806 ifvarg MANTLINGFACTOR 5483 setvar tilenum 5014
  ifvarl MANTLINGFACTOR 5484 ifvarg MANTLINGFACTOR 5160 setvar tilenum 5015
  ifvarl MANTLINGFACTOR 5161 ifvarg MANTLINGFACTOR 4838 setvar tilenum 5016
  ifvarl MANTLINGFACTOR 4839 ifvarg MANTLINGFACTOR 4515 setvar tilenum 5017
  ifvarl MANTLINGFACTOR 4516 ifvarg MANTLINGFACTOR 4193 setvar tilenum 5018
  ifvarl MANTLINGFACTOR 4194 ifvarg MANTLINGFACTOR 3870 setvar tilenum 5019
  ifvarl MANTLINGFACTOR 3871 ifvarg MANTLINGFACTOR 3547 setvar tilenum 5020
  ifvarl MANTLINGFACTOR 3548 ifvarg MANTLINGFACTOR 3225 setvar tilenum 5021
  ifvarl MANTLINGFACTOR 3226 ifvarg MANTLINGFACTOR 2902 setvar tilenum 5022
  ifvarl MANTLINGFACTOR 2903 ifvarg MANTLINGFACTOR 2580 setvar tilenum 5023
  ifvarl MANTLINGFACTOR 2581 ifvarg MANTLINGFACTOR 2257 setvar tilenum 5024
  ifvarl MANTLINGFACTOR 2258 ifvarg MANTLINGFACTOR 1934 setvar tilenum 5025
  ifvarl MANTLINGFACTOR 1935 ifvarg MANTLINGFACTOR 1612 setvar tilenum 5026
  ifvarl MANTLINGFACTOR 1613 ifvarg MANTLINGFACTOR 1289 setvar tilenum 5027
  ifvarl MANTLINGFACTOR 1290 ifvarg MANTLINGFACTOR 967 setvar tilenum 5028
  ifvarl MANTLINGFACTOR 968 ifvarg MANTLINGFACTOR 644 setvar tilenum 5029
  ifvarl MANTLINGFACTOR 645 ifvarg MANTLINGFACTOR 322 setvar tilenum 5030
  ifvarl MANTLINGFACTOR 323 setvar tilenum 5031
  addvar tilenum 31
  ifvarg freezetimer 0
  {
   setvar TEMPVAR5 0
   ifvarg PLAYERSTATUS? 0 addvar TEMPVAR5 1
   ifvarg QUADTIME 0 addvar TEMPVAR5 1
   ifvarg INVULNTIME 0 addvar TEMPVAR5 1
   ifvarg REGENTIME 0 addvar TEMPVAR5 1
   ifvarg APREGENTIME 0 addvar TEMPVAR5 1
   ifvarg VAMPIRETIME 0 addvar TEMPVAR5 1

   // Shows the Mantling Meter itself
   setvarvar digx 67 // 166
   setvarvar digy 130 // 164 // 12
   ifvarg TEMPVAR5 0 nullop else addvar digy 11 // ifvarg PLAYERSTATUS? 0 nullop else addvar digy 11
   ifvarg PARTYSIZE 1 nullop else addvar digy 6
   ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
   ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
   setvarvar digz 49152 // 65536
   setvar diga 0
   state orientation10
   state rs

   // Shows 'WARM'
   state orientation26
   setvar tilenum 2822 // state settile2837
   setvar textscale 40960 // 44237
   setvar digx 19 // 57 // 160
   setvar digy 128 // 162 // 21
   ifvarg TEMPVAR5 0 nullop else addvar digy 11 // ifvarg PLAYERSTATUS? 0 nullop else addvar digy 11
   ifvarg PARTYSIZE 1 nullop else addvar digy 6
   ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
   ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
   ifvarg MANTLINGFACTOR 9999 state pal0
   else ifvarl MANTLINGFACTOR 10000 ifvarg MANTLINGFACTOR 5000 state pal0
   else ifvarl MANTLINGFACTOR 5001 state pal16
   state setquote332
   redefinequote 332 WARM
   state gtz
   // state dnz

   // Shows amount of seconds
   state orientation26
   setvar tilenum 2822 // state settile2837
   setvar textscale 40960 // 44237
   setvar digx 120 // 57 // 160
   setvar digy 128 // 162 // 21
   ifvarg TEMPVAR5 0 nullop else addvar digy 11 // ifvarg PLAYERSTATUS? 0 nullop else addvar digy 11
   ifvarg PARTYSIZE 1 nullop else addvar digy 6
   ifvarg CURRENTARMORPOINTS 0 nullop else addvar digy 6
   ifvare CHARACTERSELECTED? 8 ifvare HAVEENERGYSHIELD? 1 nullop else addvar digy 6
   setvarvar varname MANTLINGFACTOR
   divvar varname 100
   ifvarg MANTLINGFACTOR 9999 state pal0
   else ifvarl MANTLINGFACTOR 10000 ifvarg MANTLINGFACTOR 5000 state pal0
   else ifvarl MANTLINGFACTOR 5001 state pal16
   state setquote332
   redefinequote 332 %ld%
   qsprintf 332 332 varname
   state gtz
   // state dnz
  }
 }

  setvar shade 0
  setvar tilenum 0
  ifvarvarl MANTLINGTIMER MANTLINGTIMERMAX
  {
    setvarvar MANTLINGFACTOR MANTLINGTIMER
    mulvar MANTLINGFACTOR 10000
    ifvarn MANTLINGTIMERMAX 0 { divvarvar MANTLINGFACTOR MANTLINGTIMERMAX }

    ifvarg MANTLINGFACTOR 9999 state pal22
    else ifvarl MANTLINGFACTOR 10000 ifvarg MANTLINGFACTOR 5000 state pal22
    else ifvarl MANTLINGFACTOR 5001 state pal14

    ifvarg MANTLINGFACTOR 9676 setvar tilenum 5001
    ifvarl MANTLINGFACTOR 9677 ifvarg MANTLINGFACTOR 9354 setvar tilenum 5002
    ifvarl MANTLINGFACTOR 9355 ifvarg MANTLINGFACTOR 9031 setvar tilenum 5003
    ifvarl MANTLINGFACTOR 9032 ifvarg MANTLINGFACTOR 8709 setvar tilenum 5004
    ifvarl MANTLINGFACTOR 8710 ifvarg MANTLINGFACTOR 8386 setvar tilenum 5005
    ifvarl MANTLINGFACTOR 8387 ifvarg MANTLINGFACTOR 8064 setvar tilenum 5006
    ifvarl MANTLINGFACTOR 8065 ifvarg MANTLINGFACTOR 7741 setvar tilenum 5007
    ifvarl MANTLINGFACTOR 7742 ifvarg MANTLINGFACTOR 7418 setvar tilenum 5008
    ifvarl MANTLINGFACTOR 7419 ifvarg MANTLINGFACTOR 7096 setvar tilenum 5009
    ifvarl MANTLINGFACTOR 7097 ifvarg MANTLINGFACTOR 6673 setvar tilenum 5010
    ifvarl MANTLINGFACTOR 6674 ifvarg MANTLINGFACTOR 6451 setvar tilenum 5011
    ifvarl MANTLINGFACTOR 6452 ifvarg MANTLINGFACTOR 6128 setvar tilenum 5012
    ifvarl MANTLINGFACTOR 6129 ifvarg MANTLINGFACTOR 5805 setvar tilenum 5013
    ifvarl MANTLINGFACTOR 5806 ifvarg MANTLINGFACTOR 5483 setvar tilenum 5014
    ifvarl MANTLINGFACTOR 5484 ifvarg MANTLINGFACTOR 5160 setvar tilenum 5015
    ifvarl MANTLINGFACTOR 5161 ifvarg MANTLINGFACTOR 4838 setvar tilenum 5016
    ifvarl MANTLINGFACTOR 4839 ifvarg MANTLINGFACTOR 4515 setvar tilenum 5017
    ifvarl MANTLINGFACTOR 4516 ifvarg MANTLINGFACTOR 4193 setvar tilenum 5018
    ifvarl MANTLINGFACTOR 4194 ifvarg MANTLINGFACTOR 3870 setvar tilenum 5019
    ifvarl MANTLINGFACTOR 3871 ifvarg MANTLINGFACTOR 3547 setvar tilenum 5020
    ifvarl MANTLINGFACTOR 3548 ifvarg MANTLINGFACTOR 3225 setvar tilenum 5021
    ifvarl MANTLINGFACTOR 3226 ifvarg MANTLINGFACTOR 2902 setvar tilenum 5022
    ifvarl MANTLINGFACTOR 2903 ifvarg MANTLINGFACTOR 2580 setvar tilenum 5023
    ifvarl MANTLINGFACTOR 2581 ifvarg MANTLINGFACTOR 2257 setvar tilenum 5024
    ifvarl MANTLINGFACTOR 2258 ifvarg MANTLINGFACTOR 1934 setvar tilenum 5025
    ifvarl MANTLINGFACTOR 1935 ifvarg MANTLINGFACTOR 1612 setvar tilenum 5026
    ifvarl MANTLINGFACTOR 1613 ifvarg MANTLINGFACTOR 1289 setvar tilenum 5027
    ifvarl MANTLINGFACTOR 1290 ifvarg MANTLINGFACTOR 967 setvar tilenum 5028
    ifvarl MANTLINGFACTOR 968 ifvarg MANTLINGFACTOR 644 setvar tilenum 5029
    ifvarl MANTLINGFACTOR 645 ifvarg MANTLINGFACTOR 322 setvar tilenum 5030
    ifvarl MANTLINGFACTOR 323 setvar tilenum 5031
    addvar tilenum 31

   // Shows the Mantling Meter itself
   state digx160 // 166
   setvar digy 24 // 12
   setvar digz 58982 // 65536
   setvar diga 0
   ifvare EDGEGRAPPLING 1 state orientation10 else { ifvarn SPRITEID-HOLDING -1 state orientation10 else { ifvarn PLAYERPUSHINGTIMER 0 state orientation10 else state orientation11 } }
   state rs

   // Shows amount of seconds
   ifvarn CHARACTERSELECTED? 9 ifvarg MANTLINGTIMER 0
   {
    ifvare EDGEGRAPPLING 1 state orientation26 else { ifvarn SPRITEID-HOLDING -1 state orientation26 else { ifvarn PLAYERPUSHINGTIMER 0 state orientation26 else state orientation27 } }
    state settile2837
    setvar textscale 44237
    setvar digx 160
    setvar digy 21
    setvarvar varname MANTLINGTIMER
    divvar varname 26
    ifvarg MANTLINGFACTOR 9999 state pal22
    else ifvarl MANTLINGFACTOR 10000 ifvarg MANTLINGFACTOR 5000 state pal22
    else ifvarl MANTLINGFACTOR 5001 state pal14
    state dnz
   }
  }

// The Following Is for BOSS Lifemeters

  // First Boss
  ifvarn BOSSMETERID1 -1
  {
    getactorvar[BOSSMETERID1].ENEMYHP TEMPVAR4
    getactorvar[BOSSMETERID1].ENEMYMAXHP TEMPVAR5
    mulvar TEMPVAR4 1000
    ifvarn TEMPVAR5 0 divvarvar TEMPVAR4 TEMPVAR5
    setvarvar BOSSMETERFACTOR TEMPVAR4
    mulvar BOSSMETERFACTOR 10

    ifvarg BOSSMETERFACTOR 2500 setvar shade 0 else state shadepulse3
    // "BOSS" Graphic
    setvar digx 174 // 104
    setvar digy 177 // 12
    setvar digz 61440 // 81920
    setvar diga 0
    setvar tilenum 4999
    addvar tilenum 31
    state pal10
    state orientation11 // 2+8=26
    state rs

    state displaybossmeter

   // Shows the Boss LifeMeter itself
   setvar digx 230 // 166
   setvar digy 177 // 12
   setvar digz 61440 // 81920
   setvar diga 0
   state orientation11 // 2+8=26
   state rs   

   state pal11
   setvar tilenum 2822
   setvar digz 40960
   setvar textscale 40960
   state orientation11 // 2+8=26
   setvarvar varname BOSSMETERFACTOR
   divvar varname 10
   setvar digx 450
   ifvarg varname -1 ifvarl varname 100 subvarvar digx 0 // 300
   else ifvarg varname 99 ifvarl varname 1000 subvarvar digx 5 // 295
   else ifvarg varname 999 ifvarl varname 10000 subvarvar digx 10 // 290
   setvarvar digy 178 // 165

   setvarvar TEMPVAR2 varname
   divvar TEMPVAR2 10
   setvarvar TEMPVAR3 varname
   modvar TEMPVAR3 10
   redefinequote 332 %d.%d%
   qsprintf 332 332 TEMPVAR2 TEMPVAR3
   setvar temp 332
   state gtz

   getactorvar[BOSSMETERID1].ENEMYHP TEMPVAR3
   ifvarl TEMPVAR3 1 
   {
    getactorvar[BOSSMETERID1].FROZEN? TEMPVAR3
    ifvare TEMPVAR3 0 setvar BOSSMETERID1 -1
   }
  }

  // Second Boss
  ifvarn BOSSMETERID2 -1
  {
    getactorvar[BOSSMETERID2].ENEMYHP TEMPVAR4
    getactorvar[BOSSMETERID2].ENEMYMAXHP TEMPVAR5
    mulvar TEMPVAR4 1000
    ifvarn TEMPVAR5 0 divvarvar TEMPVAR4 TEMPVAR5
    setvarvar BOSSMETERFACTOR TEMPVAR4
    mulvar BOSSMETERFACTOR 10

    ifvarg BOSSMETERFACTOR 2500 setvar shade 0 else state shadepulse3
    // "BOSS" Graphic
    setvar digx 174 // 104
    setvar digy 170 // 12
    setvar digz 61440 // 81920
    setvar diga 0
    setvar tilenum 4999
    addvar tilenum 31
    state pal0
    state orientation11 // 2+8=26
    state rs

    state displaybossmeter

   // Shows the Boss LifeMeter itself
   setvar digx 230 // 166
   setvar digy 170 // 12
   setvar digz 61440 // 81920
   setvar diga 0
   state orientation11 // 2+8=26
   state rs

   state pal11
   setvar tilenum 2822
   setvar digz 40960
   setvar textscale 40960
   setvarvar varname BOSSMETERFACTOR
   divvar varname 10
   setvar digx 450
   ifvarg varname -1 ifvarl varname 100 subvarvar digx 0 // 300
   else ifvarg varname 99 ifvarl varname 1000 subvarvar digx 5 // 295
   else ifvarg varname 999 ifvarl varname 10000 subvarvar digx 10 // 290
   setvarvar digy 171 // 165

   setvarvar TEMPVAR2 varname
   divvar TEMPVAR2 10
   setvarvar TEMPVAR3 varname
   modvar TEMPVAR3 10
   redefinequote 332 %d.%d%
   qsprintf 332 332 TEMPVAR2 TEMPVAR3
   setvar temp 332
   state gtz

   getactorvar[BOSSMETERID2].ENEMYHP TEMPVAR3
   ifvarl TEMPVAR3 1 
   {
    getactorvar[BOSSMETERID2].FROZEN? TEMPVAR3
    ifvare TEMPVAR3 0 setvar BOSSMETERID2 -1
   }
  }

  // Third Boss
  ifvarn BOSSMETERID3 -1
  {
    getactorvar[BOSSMETERID3].ENEMYHP TEMPVAR4
    getactorvar[BOSSMETERID3].ENEMYMAXHP TEMPVAR5
    mulvar TEMPVAR4 1000
    ifvarn TEMPVAR5 0 divvarvar TEMPVAR4 TEMPVAR5
    setvarvar BOSSMETERFACTOR TEMPVAR4
    mulvar BOSSMETERFACTOR 10

    ifvarg BOSSMETERFACTOR 2500 setvar shade 0 else state shadepulse3
    // "BOSS" Graphic
    setvar digx 174 // 104
    setvar digy 163 // 12
    setvar digz 61440 // 81920
    setvar diga 0
    setvar tilenum 4999
    addvar tilenum 31
    state pal0
    state orientation11 // 2+8=26
    state rs

    state displaybossmeter

   // Shows the Boss LifeMeter itself
   setvar digx 230 // 166
   setvar digy 163 // 12
   setvar digz 61440 // 81920
   setvar diga 0
   state orientation11 // 2+8=26
   state rs   

   state pal11
   setvar tilenum 2822
   setvar digz 40960
   setvar textscale 40960
   setvarvar varname BOSSMETERFACTOR
   divvar varname 10
   setvar digx 450
   ifvarg varname -1 ifvarl varname 100 subvarvar digx 0 // 300
   else ifvarg varname 99 ifvarl varname 1000 subvarvar digx 5 // 295
   else ifvarg varname 999 ifvarl varname 10000 subvarvar digx 10 // 290
   setvarvar digy 164 // 165

   setvarvar TEMPVAR2 varname
   divvar TEMPVAR2 10
   setvarvar TEMPVAR3 varname
   modvar TEMPVAR3 10
   redefinequote 332 %d.%d%
   qsprintf 332 332 TEMPVAR2 TEMPVAR3
   setvar temp 332
   state gtz

   getactorvar[BOSSMETERID3].ENEMYHP TEMPVAR3
   ifvarl TEMPVAR3 1 
   {
    getactorvar[BOSSMETERID3].FROZEN? TEMPVAR3
    ifvare TEMPVAR3 0 setvar BOSSMETERID3 -1
   }
  }

// End of BOSS Lifemeters Display Code

  setvar shade 0
  // display keycards - coded originally by DeeperThought >.>
  ifvarn ACCESSCARDS? 0
  {
     state digz16384
     mulvar digz 750 divvar digz 1000

     setvar diga 0
     state orientation17 // 16
     // first bit is blue card, second bit is red card, third bit is yellow card
     ifvarand ACCESSCARDS? 1
     {
	state pal0
	setvar digx 297 // 294
	setvar digy 9 // 4
	setvar tilenum 60
	state rs
     }
     ifvarand ACCESSCARDS? 2
     {
	state pal21
	setvar digx 297 // 294
	setvar digy 15
	setvar tilenum 60
	state rs
     }
     ifvarand ACCESSCARDS? 4
     {
	state pal23
	setvar digx 297 // 294
	setvar digy 21 // 20
	setvar tilenum 60
	state rs
     }
     ifvarand ACCESSCARDS? 8
     {
	state pal22
	setvar digx 308 // 307
	setvar digy 12 // 8
	setvar tilenum 60
	state rs
     }
     ifvarand ACCESSCARDS? 16
     {
	state pal12
	setvar digx 308 // 307
	setvar digy 18 // 8
	setvar tilenum 60
	state rs
     }
     ifvarand ACCESSCARDS? 32
     {
	state pal15
	setvar digx 286 // 281
	setvar digy 12 // 8
	setvar tilenum 60
	state rs
     }
     ifvarand ACCESSCARDS? 64
     {
	state pal24
	setvar digx 286 // 281
	setvar digy 18 // 16
	setvar tilenum 60
	state rs
     }
  }

ifvare mainmenu 0

{ // ifvare mainmenu 0


		setvar diga 0

// display continues - based off DeeperThought's display coding $.$
      state checkcontinues
	ifvarg ITEMARRAYID_AMOUNTTEMP 0
	{
		setvar digx 311
             addvarvar digx 0
		setvar digy 38
             addvarvar digy 3
		setvar digz 32768
             mulvar digz 750 divvar digz 1000
	      	state pal0
		state orientation1
		setvar tilenum 5279
		state rs

		addvarvar digy -3
  	       setvar tilenum 3087 // Blue Digital Text
	       setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
		state settile3010
	      	state pal2
		state orientation17
             state checkcontinues
             setvarvar varname ITEMARRAYID_AMOUNTTEMP
		state dnz
	}

  // display steroids / vitamin x - coded originally by DeeperThought <.<
  setvarvar varname STEROIDSTIME
  ifvarg varname 0
  {
   getplayer[THISACTOR].steroids_amount TEMPVAR
   ifvarl TEMPVAR 400 { ifvarg TEMPVAR 0 state shadepulse }
   // Show Icon
   setvar digx 311
   setvar digy 50
   state digz24576
   mulvar digz 750 divvar digz 1000
   state pal0
   state orientation1
   setvar tilenum 5424 // 55
   state rs

   // Show VitaminX Duration Amount
   setvar digy 60
   addvarvar digy -3 // digx_test
   setvar tilenum 3087 // Blue Digital Text
   setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
   state settile3010
   ifvarn debugtoggle 1 divvar varname 4 // 4
   state orientation17
   state dnz

   // Show [Use Vitamin X] Key
   state orientation1
   state pal17
   setvar digx 606 // 300
   setvar digy 50
   addvarvar digy 1
   getkeyname 315 48 0
   setvar temp 315
   qstrlen TEMPVAR 315
   ifvarg TEMPVAR 0
   {
    subvar TEMPVAR 1
    mulvar TEMPVAR 4
    subvarvar digx TEMPVAR
   }
   setvarvar tilenum 3072 // Blue Digital Text
   setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
   state gtz // state mt
  }
  else // Show a Ghostly image of VitaminX and the number of them in the main inventory for the new Inventory Reimbursement System
  {
   state checkvitaminxs
   ifvarg ITEMARRAYID_AMOUNTTEMP 0
   {
    // Show Icon
    setvar digx 311
    setvar digy 50
    state digz24576
    state pulsingdn3ditem // mulvar digz 750 divvar digz 1000
    state pal0
    state orientation33
    setvar tilenum 5424 // 55
    state rs

    // Show # of VitaminXs in Main Inventory
    setvar digy 60
    addvarvar digy -10 // -3 // digx_test
    setvar tilenum 3087 // Blue Digital Text
    setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
    state settile3010
    setvarvar varname ITEMARRAYID_AMOUNTTEMP
    state orientation17
    state dnz

    // Show [Use Vitamin X] Key
    state orientation1 	
    state pal17
    setvar digx 606 // 300
    setvar digy 50
    addvarvar digy 1
    getkeyname 315 48 0
    setvar temp 315
    qstrlen TEMPVAR 315
    ifvarg TEMPVAR 0
    {
     subvar TEMPVAR 1
     mulvar TEMPVAR 4
     subvarvar digx TEMPVAR
    }
    setvarvar tilenum 3072 // Blue Digital Text
    setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
    state gtz // state mt
    state pal0
   }
  }
   state shade0

    // display goggles - coded originally by DeeperThought -.-
	getplayer[THISACTOR].heat_on TEMPVAR
	getplayer[THISACTOR].heat_amount varname
	ifvarg varname 0
	{              
     ifvare TEMPVAR 1 state shadepulse

     // Item Picture
	 setvar digx 311 // 8
	 state pal0
 	 state orientation1
	 setvar digy 70
     addvarvar digy -3
	 ifvarn CHARACTERSELECTED? 4 // Show NV Goggles ICON
     {
      setvar tilenum 59 // NV Goggles
	  state digz24576
      mulvar digz 750 divvar digz 1000
	 }
     else // Show VR Visor Icon
	 {
	  ifvarl CURRENTENERGYPOINTS 1 state pal2 else state pal0
 	  addvar digy 0
      setvar tilenum 5474 // VR Visor Icon
	  setvar digz 18432 // state digz24576
      mulvar digz 750 divvar digz 1000
	 }
     state rs
     // Hacker-Vision Node [Lisa Only]
     ifvare CHARACTERSELECTED? 8
     {
      ifvare HAVEHACKERVISION? 1
      {
       addvarvar digy -1
	   setvar digx 318 // 8
       setvar tilenum 5289
	   state digz24576
       state rs
       mulvar digz 750 divvar digz 1000
      }
     }

     // Item Juice/Infinity Logo
	 setvar digy 78
     ifvare CHARACTERSELECTED? 4
     {
      addvarvar digy -5
	  setvar digx 310
	  state digz98304
      mulvar digz 750 divvar digz 1000
	  ifvarl CURRENTENERGYPOINTS 1 state pal2 else state pal17
	  setvar tilenum 8182
	  state rs
     }
     else
     ifvare CHARACTERSELECTED? 8
     {
      ifvare HAVEHACKERVISION? 1
      {
       addvarvar digy -5
	   setvar digx 310
	   state digz98304
       mulvar digz 750 divvar digz 1000
	   state pal17
	   setvar tilenum 8182
	   state rs
      }
      else
      {
       addvarvar digy -6
	   setvar digx 311
	   state settile3010
	   ifvarn debugtoggle 1 divvar varname 12 // 12
	   state orientation17
       setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
	   state dnz
      }
     }
     else
     {
      addvarvar digy -6
	  setvar digx 311
      state settile3010
	  ifvarn debugtoggle 1 divvar varname 12 // 12
	  state orientation17
      setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
	  state dnz
     }

 	 state orientation1
     // Letter
	 setvar digx 606 // 300
	 setvar digy 70
     addvarvar digy -3
     ifvare CHARACTERSELECTED? 4
     {
      ifvarl CURRENTENERGYPOINTS 1 state pal2 else state pal17
     } 
     else state pal17
	 getkeyname 315 34 0
     setvar temp 315
     qstrlen TEMPVAR 315
     ifvarg TEMPVAR 0
     {
      subvar TEMPVAR 1
      mulvar TEMPVAR 4
      subvarvar digx TEMPVAR
     }
     setvarvar tilenum 3072 // Blue Digital Text
     setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
     state gtz
	}
	else // Show a Ghostly image of NVG Goggles and the number of them in the main inventory for the new Inventory Reimbursement System 
	{
     state checkheatsensors
     ifvarg ITEMARRAYID_AMOUNTTEMP 0
     {
      // Item Picture
 	  setvar digx 311 // 8
 	  state pal0
  	  state orientation33
	  setvar digy 70
      addvarvar digy -3
	  ifvarn CHARACTERSELECTED? 4 // Show NV Goggles ICON
      {
       setvar tilenum 59 // NV Goggles
	   state digz24576
       state pulsingdn3ditem // mulvar digz 750 divvar digz 1000
	  }
      else // Show VR Visor Icon
	  {
	   ifvarl CURRENTENERGYPOINTS 1 state pal2 else state pal0
 	   addvar digy 0
       setvar tilenum 5474 // VR Visor Icon
	   setvar digz 18432 // state digz24576
       state pulsingdn3ditem // mulvar digz 750 divvar digz 1000
	  }
      state rs
      // Hacker-Vision Node [Lisa Only]
      ifvare CHARACTERSELECTED? 8
      {
       ifvare HAVEHACKERVISION? 1
       {
        addvarvar digy -1
	    setvar digx 318 // 8
        setvar tilenum 5289
	    state digz24576
        state rs
        state pulsingdn3ditem // mulvar digz 750 divvar digz 1000
       }
      }

      // Show # of NVGoggles in Main Inventory
	  setvar digy 78
      addvarvar digy -12
	  setvar digx 311
      state settile3010
      setvarvar varname ITEMARRAYID_AMOUNTTEMP
	  state orientation17
      setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
	  state dnz

 	  state orientation1
      // Show [Use NVGoggles] Key
	  setvar digx 606 // 300
	  setvar digy 70
      addvarvar digy -3
      ifvare CHARACTERSELECTED? 4
      {
       ifvarl CURRENTENERGYPOINTS 1 state pal2 else state pal17
      } 
      else state pal17
	  getkeyname 315 34 0
      setvar temp 315
      qstrlen TEMPVAR 315
      ifvarg TEMPVAR 0
      {
       subvar TEMPVAR 1
       mulvar TEMPVAR 4
       subvarvar digx TEMPVAR
      }
      setvarvar tilenum 3072 // Blue Digital Text
      setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
      state gtz
     }
	}
   state shade0

 // display jetpack - coded originally by DeeperThought o.o
	getplayer[THISACTOR].jetpack_on TEMPVAR
	getplayer[THISACTOR].jetpack_amount varname
	ifvarg varname 0
	{
     ifvarg TEMPVAR 2 state shadepulse

     // Item Picture
	 setvar digx 311
     addvarvar digx 1
	 setvar digy 90
     addvarvar digy -8
	 state digz24576
     mulvar digz 750 divvar digz 1000
	 ifvarn VEHICLEID -1 state pal2 else state pal0
	 state orientation1
	 setvar tilenum 57
	 state rs

     // Item Juice
	 setvar digx 311
	 setvar digy 100
     addvarvar digy -10
	 ifvarn VEHICLEID -1 state pal2 else state pal0
	 state settile3010
	 ifvarn debugtoggle 1 divvar varname 16 // 16
	 state orientation17
     setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
	 state dnz

     // Letter
	 state orientation1
	 setvar digx 606 // 300
	 setvar digy 90
     addvarvar digy -7
	 ifvarn VEHICLEID -1 state pal2 else state pal17
	 getkeyname 315 33 0
	 setvar temp 315
     qstrlen TEMPVAR 315
     ifvarg TEMPVAR 0
     {
      subvar TEMPVAR 1
      mulvar TEMPVAR 4
      subvarvar digx TEMPVAR
     }
     setvarvar tilenum 3072 // Blue Digital Text
     setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
     state gtz
    }
	else
	{
     state checkjetpacks
     ifvarg ITEMARRAYID_AMOUNTTEMP 0
     {
      // Item Picture
	  setvar digx 311
      addvarvar digx 1
	  setvar digy 90
      addvarvar digy -8
	  state digz24576
      state pulsingdn3ditem // mulvar digz 750 divvar digz 1000
	  state pal0
	  state orientation33
	  setvar tilenum 57
 	  state rs

      // Show # of Jetpacks in Main Inventory
	  setvar digx 311
	  setvar digy 100
      addvarvar digy -18
	  state pal0
	  state settile3010
      setvarvar varname ITEMARRAYID_AMOUNTTEMP
	  state orientation17
      setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
	  state dnz
	  	  
      // Show [Use Jetpack] Key
	  state orientation1
	  setvar digx 606 // 300
	  setvar digy 90
      addvarvar digy -7
	  state pal17
	  getkeyname 315 33 0
	  setvar temp 315
      qstrlen TEMPVAR 315
      ifvarg TEMPVAR 0
      {
       subvar TEMPVAR 1
       mulvar TEMPVAR 4
       subvarvar digx TEMPVAR
      }
      setvarvar tilenum 3072 // Blue Digital Text
      setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
      state gtz

	 }
	}
   state shade0

// display holoform - coded originally by DeeperThought o.O
	getplayer[THISACTOR].holoduke_on TEMPVAR
	getplayer[THISACTOR].holoduke_amount varname
	ifvarg varname 0
	{
 	 ifvarn TEMPVAR -1 state shadepulse

	 // Item Picture
	 setvar digx 311
     addvarvar digx 1
	 setvar digy 113
     addvarvar digy -11
	 state digz16384
     mulvar digz 750 divvar digz 1000
	 state pal0
	 state orientation1
	 setvar tilenum 1348
	 state rs

     // Item Juice
	 setvar digx 311
     addvarvar digx 0
	 setvar digy 123
     addvarvar digy -14
	 state settile3010
	 ifvarn debugtoggle 1 divvar varname 24 // 24
	 state orientation17
     setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
	 state dnz

	 // Letter
	 state orientation1
	 setvar digx 606
     addvarvar digx 0
	 setvar digy 113
     addvarvar digy -12
	 state pal17
	 getkeyname 315 32 0
	 setvar temp 315
     qstrlen TEMPVAR 315
     ifvarg TEMPVAR 0
     {
      subvar TEMPVAR 1
      mulvar TEMPVAR 4
      subvarvar digx TEMPVAR
     }
     setvarvar tilenum 3072 // Blue Digital Text
     setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
     state gtz
	}
	else
	{
     state checkholoforms
     ifvarg ITEMARRAYID_AMOUNTTEMP 0
     {
	  // Item Picture
	  setvar digx 311
      addvarvar digx 1
	  setvar digy 113
      addvarvar digy -11
	  state digz16384
      state pulsingdn3ditem // mulvar digz 750 divvar digz 1000
	  state pal0
	  state orientation33
	  setvar tilenum 1348
	  state rs

      // Item Juice
	  setvar digx 311
      addvarvar digx 0
	  setvar digy 123
      addvarvar digy -23
	  
	  state settile3010
      setvarvar varname ITEMARRAYID_AMOUNTTEMP
	  state orientation17
      setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
  	  state dnz
	  	  
 	  // Show [Use Holoform] Key
	  state orientation1 
	  setvar digx 606
      addvarvar digx 0
 	  setvar digy 113
      addvarvar digy -12
	  state pal17
	  getkeyname 315 32 0
	  setvar temp 315
      qstrlen TEMPVAR 315
      ifvarg TEMPVAR 0
      {
       subvar TEMPVAR 1
       mulvar TEMPVAR 4
       subvarvar digx TEMPVAR
      }
      setvarvar tilenum 3072 // Blue Digital Text
      setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
      state gtz
	 
	 }
	}
   state shade0

// display scuba - coded originally by DeeperThought O.o
	setvarvar varname SCUBATIME // getplayer[THISACTOR].scuba_amount varname
	ifvarg varname 0
	{
     ifvarl INVULNTIME 1
     {
      ifvare SECTORLOTAG 2
      {
       ifvarn VEHICLEID -1
       {
        ifvarg VEHICLETYPE -1 ifvarl VEHICLETYPE 3 
        {
         ifvarvarl AIRTIME MAXAIRTIME state shadepulse
        }
       }
       else state shadepulse 
      } 
     }

     // Item Picture
	 setvar digx 311
     addvarvar digx 1
	 setvar digy 135
     addvarvar digy -16
	 state digz16384
     mulvar digz 750 divvar digz 1000
	 state pal0
	 state orientation1
	 setvar tilenum 56
	 state rs

     // Item Juice
	 setvar digx 311
     addvarvar digx 0
	 setvar digy 144
     addvarvar digy -18
	 state settile3010
	 ifvarn debugtoggle 1 divvar varname 64 // 64
	 state pal17
	 state orientation17
     setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
	 state dnz
	}
/*
	else
	{
     state checkscubatanks
     ifvarg ITEMARRAYID_AMOUNTTEMP 0
     {
	 }
	}
*/
	state shade0

// display boots - coded originally by DeeperThought O.O
	getplayer[THISACTOR].on_ground TEMPVAR
	getplayer[THISACTOR].boot_amount varname
	ifvarg varname 0
	{
     ifvarl INVULNTIME 1
     {
      ifvare VEHICLEID -1
      { 
       ifvarg FLOORDAMAGETYPE? 4 { ifvare TEMPVAR 1 state shadepulse } // If on any non-Purplelava damagesector
       else ifvare FLOORDAMAGETYPE? 4 state shadepulse // If on PurpleLava damagesector
       else ifvarg FLOORDAMAGETYPE? 0 { ifvarl FLOORDAMAGETYPE? 4 { ifvare TEMPVAR 1 state shadepulse } } // If on any non-Purplelava damagesector
      }
      ifvare VEHICLEID -1
      { 
       ifvarg CEILINGDAMAGETYPE? 4 state shadepulse // If on any non-Purplelava damagesector
       else ifvare CEILINGDAMAGETYPE? 4 state shadepulse // If on PurpleLava damagesector
       else ifvarg CEILINGDAMAGETYPE? 0 { ifvarl CEILINGDAMAGETYPE? 4 state shadepulse } // If on any non-Purplelava damagesector
      }
      ifvare VEHICLEID -1
      { 
       ifvarg EMUFLOORDAMAGETYPE? 4 { ifvare TEMPVAR 1 state shadepulse } // If on any non-Purplelava damagesector
       else ifvare EMUFLOORDAMAGETYPE? 4 state shadepulse // If on PurpleLava damagesector
       else ifvarg EMUFLOORDAMAGETYPE? 0 { ifvarl EMUFLOORDAMAGETYPE? 4 { ifvare TEMPVAR 1 state shadepulse } } // If on any non-Purplelava damagesector
      }
      ifvare VEHICLEID -1
      { 
       ifvarg EMUCEILINGDAMAGETYPE? 4 state shadepulse // If on any non-Purplelava damagesector
       else ifvare EMUCEILINGDAMAGETYPE? 4 state shadepulse // If on PurpleLava damagesector
       else ifvarg EMUCEILINGDAMAGETYPE? 0 { ifvarl EMUCEILINGDAMAGETYPE? 4 state shadepulse } // If on any non-Purplelava damagesector
      }
      ifvare VEHICLEID -1
      { 
       ifvarg SPRITEDAMAGETYPE? 0 state shadepulse // for standing on stuff like special 'bloodpools'
      }
     }

     // Item Picture
	 setvar digx 311
     addvarvar digx 0
	 setvar digy 156
     addvarvar digy -20
	 state digz32768
     mulvar digz 750 divvar digz 1000
	 state pal0
	 state orientation1
	 setvar tilenum 61
	 state rs

     // Item Juice
	 setvar digx 311
     addvarvar digx 0
	 setvar digy 165
     addvarvar digy -23
	 state settile3010
	 ifvarn debugtoggle 1 divvar varname 2 // 2
	 state pal17
	 state orientation17
     setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
	 state dnz
	}
   state shade0

// display Bubsy's extra lives - based off DeeperThought's display coding *.*
     state checkbubsylives
     ifvare CHARACTERSELECTED? 3
	ifvarg ITEMARRAYID_AMOUNTTEMP 0
	{
		setvar digx 311
             addvarvar digx 0
		setvar digy 179
             addvarvar digy -25
	      	state pal0
		state orientation1
		setvar digz 28000
             mulvar digz 750 divvar digz 1000
		setvar tilenum 5179
		state rs

		setvar digx 311
             addvarvar digx 0
		setvar digy 187
             addvarvar digy -25
		state settile3010
	      	state pal2
		state orientation17
             state checkbubsylives
             setvarvar varname ITEMARRAYID_AMOUNTTEMP
             setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
		state dnz
	}

// display bioshield
     ifvare CHARACTERSELECTED? 8
	ifvare HAVEENERGYSHIELD? 1
	{
             state shade0
             ifvare ENERGYSHIELDMODE 1 state shadepulse
		setvar digx 310
		addvarvar digx 0
		setvar digy 179
		addvarvar digy -25
             ifvare CURRENTCELLS 0
             {
              setvarvar TEMP2 DAMAGEINCELL
              mulvar TEMP2 100
              divvarvar TEMP2 ESHIELDDMGFACTOR
              ifvarl TEMP2 4 setvar TEMP 25
              ifvarg TEMP2 3 ifvarl TEMP2 8 setvar TEMP 24
              ifvarg TEMP2 7 ifvarl TEMP2 12 setvar TEMP 23
              ifvarg TEMP2 11 ifvarl TEMP2 16 setvar TEMP 22
              ifvarg TEMP2 15 ifvarl TEMP2 20 setvar TEMP 21
              ifvarg TEMP2 19 ifvarl TEMP2 24 setvar TEMP 20
              ifvarg TEMP2 23 ifvarl TEMP2 28 setvar TEMP 19
              ifvarg TEMP2 27 ifvarl TEMP2 32 setvar TEMP 18
              ifvarg TEMP2 31 ifvarl TEMP2 36 setvar TEMP 17
              ifvarg TEMP2 35 ifvarl TEMP2 40 setvar TEMP 16
              ifvarg TEMP2 39 ifvarl TEMP2 44 setvar TEMP 15
              ifvarg TEMP2 43 ifvarl TEMP2 48 setvar TEMP 14
              ifvarg TEMP2 47 ifvarl TEMP2 52 setvar TEMP 13
              ifvarg TEMP2 51 ifvarl TEMP2 56 setvar TEMP 12
              ifvarg TEMP2 55 ifvarl TEMP2 60 setvar TEMP 11
              ifvarg TEMP2 59 ifvarl TEMP2 64 setvar TEMP 10
              ifvarg TEMP2 63 ifvarl TEMP2 68 setvar TEMP 9
              ifvarg TEMP2 67 ifvarl TEMP2 72 setvar TEMP 8
              ifvarg TEMP2 71 ifvarl TEMP2 76 setvar TEMP 7
              ifvarg TEMP2 75 ifvarl TEMP2 80 setvar TEMP 6
              ifvarg TEMP2 79 ifvarl TEMP2 84 setvar TEMP 5
              ifvarg TEMP2 83 ifvarl TEMP2 88 setvar TEMP 4
              ifvarg TEMP2 87 ifvarl TEMP2 92 setvar TEMP 3
              ifvarg TEMP2 91 ifvarl TEMP2 96 setvar TEMP 2
              ifvarg TEMP2 95 ifvarl TEMP2 100 setvar TEMP 1
              ifvarg TEMP2 99 setvar TEMP 0
             }
             else setvar TEMP 0
             addvarvar shade TEMP
             setvarvar TEMPVAR5 CURRENTBIOSHIELDPOWER
             divvarvar TEMPVAR5 MAXHITPOINTS
             ifvarl TEMPVAR5 16 { state pal0 setvar digz 8000 }
             else ifvarg TEMPVAR5 15 ifvarl TEMPVAR5 64 { state pal17 setvar digz 8200 }
             else ifvarg TEMPVAR5 63 ifvarl TEMPVAR5 256 { state pal23 setvar digz 8400 }
             else ifvarg TEMPVAR5 255 ifvarl TEMPVAR5 1024 { state pal21 setvar digz 8600 }
             else ifvarg TEMPVAR5 1023 { state pal20 setvar digz 8800 }
             mulvar digz 750 divvar digz 1000
		state orientation1		
		ifvare ESHIELDADVANCEMENT 0 setvar tilenum 5217 else setvar tilenum 5554
		state rs

             subvarvar shade TEMP
		setvar digx 311
		addvarvar digx 0
 		setvar digy 187
		addvarvar digy -26
 		state settile3010
  	       state pal2
		state orientation17
             setvarvar varname CURRENTCELLS
             setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
		state dnz

             ifvare debugtoggle 1
             {
 		 setvar digx 311
 		 setvar digy 181
		 addvarvar digy -26
 	        state pal21
              setvarvar varname DAMAGEINCELL
              setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
		 state dnz
             }

 		setvar digx 311
		setvar digy 171
		addvarvar digy -21
             state pal0
             setvarvar varname ESHIELDDMGFACTOR
             setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
		state dnz

		setvar digx 606
		addvarvar digx 0
		setvar digy 181
		addvarvar digy -28
		state pal17
		getkeyname 315 31 0
		setvar temp 315
             qstrlen TEMPVAR 315
             ifvarg TEMPVAR 0
             {
              subvar TEMPVAR 1
              mulvar TEMPVAR 4
              subvarvar digx TEMPVAR
             }
             setvarvar tilenum 3072 // Blue Digital Text
             setvar textscale 65536 mulvar textscale 750 divvar textscale 1000
           	state gtz

             state shade0
	}

// display mercury computer
     ifvare CHARACTERSELECTED? 4
	ifvare HAVEMERCURYCOMPUTER? 1
	{
		setvar digx 311
             addvarvar digx 0
		setvar digy 178 // 179
             addvarvar digy -25
	      	state pal0
		state orientation1
		setvar digz 20480 // state digz24576
             mulvar digz 750 divvar digz 1000
		setvar tilenum 5478 // 5285
		state rs

		setvar digx 310
             addvarvar digx 0
		setvar digy 187
             addvarvar digy -26
		state digz98304
             mulvar digz 750 divvar digz 1000
		state pal17
		setvar tilenum 8182
		state rs
	}

// ******************************************************************************
// ******************************************************************************
// **************************** BEGIN TIPS SECTION ******************************
// ******************************************************************************
// ******************************************************************************

 ifvarn tipdisplayid -1
 { // ifvarn tipdisplayid -1
  //*******************
  //**Main Background**
  //*******************
  setvarvar digx 158 // digx_test
  setvarvar digy 144 // digy_test
  setvarvar digz 49152 // digz_test
  state pal1
  setvar shade 8
  setvarvar orientation 0
  setvar tilenum 8174 // 8174
  state rs

  setvar shade 0
  state pal0
  //****************
  //**Tip Displays**
  //****************
  ifvare tipdisplayid 0 // Welcome Screen
  {
   // Pictures, etc here

   // Main Symbol
   setvarvar orientation 0
   setvarvar digx 159 // digx_test
   setvarvar digy 114 // digy_test
   setvarvar digz 25600 // digz_test
   state pal0
   setvar tilenum 7815
   state rs

   // Left Decor [ESS Soldier 1]
   setvarvar orientation 0
   setvarvar digx 119 // digx_test
   setvarvar digy 114 // digy_test
   setvarvar digz 14336 // digz_test
   state pal24
   setvar tilenum 2646
   state rs

   // Right Decor [ESS Soldier 2]
   setvarvar orientation 4
   setvarvar digx 199 // digx_test
   setvarvar digy 114 // digy_test
   setvarvar digz 14336 // digz_test
   setvarvar diga 1024 // digz_test
   state pal24
   setvar tilenum 2666
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 INTRODUCTION
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
   redefinequote 1032  
   redefinequote 1033  
   redefinequote 1034 WELCOME TO ^0"NAFERIA'S REIGN: INVASION^23
   redefinequote 1035 ^0OF THE DARK MISTRESS"^23!
   redefinequote 1036  
   redefinequote 1037 GET PREPARED FOR A LONG AND PERILOUS,
   redefinequote 1038 YET FUN ROAD AHEAD!
   redefinequote 1039  
   redefinequote 1040 PAY ATTENTION TO ALL THE TIPS YOU SEE
   redefinequote 1041 POP UP IN THIS WINDOW. USE THE ^22"LOOK^23
   redefinequote 1042 ^22LEFT"^23 AND ^22"LOOK RIGHT"^23 KEYS TO LOOK OVER
   redefinequote 1043 PAST TIPS!
   redefinequote 1044  
   redefinequote 1045 ENJOY YOUR GAME! :]
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 1 // Difficulty (current)
  {
   // Pictures, etc here

   // DIFFICULTY #
   setvarvar orientation 0
   setvarvar digx 159 // digx_test
   setvarvar digy 114 // digy_test
   setvarvar digz 98304 // digz_test
   state pal0
   ifvare SKILLLEVEL 0 state pal20
   ifvare SKILLLEVEL 1 state pal13
   ifvare SKILLLEVEL 2 state pal0
   ifvare SKILLLEVEL 3 state pal16
   ifvare SKILLLEVEL 4 state pal21
   ifvare SKILLLEVEL 5 state pal10
   ifvare SKILLLEVEL 6 state pal7
   ifvare SKILLLEVEL 7 state pal11
   ifvare SKILLLEVEL 8 state pal14
   ifvare SKILLLEVEL 9 state pal6
   setvar tilenum 6385
   addvarvar tilenum SKILLLEVEL
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 CURRENT DIFFICULTY
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   ifvare SKILLLEVEL 0
   {
    // Tip Description - 15 Lines, ~32 Characters per line.
    redefinequote 1032 ^21SKILL 0: ^20EAT IT BOY EAT IT!^23
    redefinequote 1033  
    redefinequote 1034 ^20"EASIER THAN EASY"^23 DIFFICULTY.
    redefinequote 1035  
    redefinequote 1036 FOR EXPEDITION PLAYS OR EXTREMELY NEW
    redefinequote 1037 PLAYERS TO THE GAME... OR FOR JUST FOR
    redefinequote 1038 THOSE WHO SUCK? :O
    redefinequote 1039  
    redefinequote 1040 JUST KIDDING GUYS. ;)
    redefinequote 1041  
    redefinequote 1042 POINT BEING, THERE'S NO REAL CHALLENGE
    redefinequote 1043 HERE TO SPEAK OF. :P
    redefinequote 1044  
    redefinequote 1045  
    redefinequote 1046  
   }
   ifvare SKILLLEVEL 1
   {
    // Tip Description - 15 Lines, ~32 Characters per line.
    redefinequote 1032 ^21SKILL 1: ^13MANY PIECES OF CAKE!^23 
    redefinequote 1033  
    redefinequote 1034 ^20"EASY"^23 DIFFICULTY.
    redefinequote 1035  
    redefinequote 1036 ENEMIES WILL DO MINOR AMOUNTS OF DAMAGE
    redefinequote 1037 FOR THEIR CURRENT LEVEL, WHILE THE PLAY-
    redefinequote 1038 ER TENDS TO HAVE A TON OF GOOD LUCK AND
    redefinequote 1039 HIGHER THAN USUAL STAT GAINS FOR EACH
    redefinequote 1040 LEVEL UP A CHARACTER RECEIVES.
    redefinequote 1041  
    redefinequote 1042 NOT MUCH OF A CHALLENGE, BUT NOT QUITE
    redefinequote 1043 THE EASIEST DIFFICULTY.
    redefinequote 1044  
    redefinequote 1045  
    redefinequote 1046  
   }
   ifvare SKILLLEVEL 2
   {
    // Tip Description - 15 Lines, ~32 Characters per line.
    redefinequote 1032 ^21SKILL 2: ^0LET'S ROCK THE HOUSE!^23   
    redefinequote 1033  
    redefinequote 1034 ^20"EASY-MEDIUM"^23 DIFFICULTY. 
    redefinequote 1035  
    redefinequote 1036 ENEMIES DO A DECENT AMOUNT OF DAMAGE  
    redefinequote 1037 FOR THEIR CURRENT LEVEL, BUT THE PLAYER 
    redefinequote 1038 STILL HAS PRETTY GOOD LUCK GOING FOR 
    redefinequote 1039 THEM WITH SOME GOOD STAT GAINS AT LEVEL 
    redefinequote 1040 UPS FOR CHARACTERS.
    redefinequote 1041  
    redefinequote 1042 THE CHALLENGE IS SLIGHLTY MORE PRESENT
    redefinequote 1043 THAN ^13"MANY PIECES OF CAKE"^23.
    redefinequote 1044  
    redefinequote 1045  
    redefinequote 1046  
   }
   ifvare SKILLLEVEL 3
   {
    // Tip Description - 15 Lines, ~32 Characters per line.
    redefinequote 1032 ^21SKILL 3: ^16COME GET SOME MORE!^23   
    redefinequote 1033  
    redefinequote 1034 ^20"MEDIUM"^23 DIFFICULTY. 
    redefinequote 1035  
    redefinequote 1036 ENEMIES ARE STILL SOMEWHAT MEDIOCRE TO 
    redefinequote 1037 DEAL WITH FOR THEIR CURRENT LEVELS, BUT
    redefinequote 1038 THE PLAYER BEGINS TO LOSE THE BONUS
    redefinequote 1039 GAINS TO STATS WHEN CHARACTERS UNDERGO
    redefinequote 1040 A LEVEL UP.
    redefinequote 1041  
    redefinequote 1042 A FAIR BIT MORE CHALLENGING THAN ^0"LET'S^23
    redefinequote 1043 ^0ROCK THE HOUSE!"^23
    redefinequote 1044  
    redefinequote 1045  
    redefinequote 1046  
   }
   ifvare SKILLLEVEL 4
   {
    // Tip Description - 15 Lines, ~32 Characters per line.
    redefinequote 1032 ^21SKILL 4: ^21DAMN I'M VERY GOOD!^23   
    redefinequote 1033  
    redefinequote 1034 ^20"MEDIUM-HARD"^23 DIFFICULTY.
    redefinequote 1035  
    redefinequote 1036 FROM HERE ON OUT, THINGS START TO GET
    redefinequote 1037 TOUGHER, AS ENEMIES BECOME MORE EVEN
    redefinequote 1038 WITH YOUR CHARACTERS FOR THEIR CURRENT
    redefinequote 1039 LEVELS, AND CHARACTERS GET ROUGHLY AN
    redefinequote 1040 EVEN GAIN OF STATS INSTEAD OF BONUSES
    redefinequote 1041 NOW.
    redefinequote 1042  
    redefinequote 1043 HAVE FUN, AND GOOD LUCK! :P 
    redefinequote 1044  
    redefinequote 1045  
    redefinequote 1046  
   }
   ifvare SKILLLEVEL 5
   {
    // Tip Description - 15 Lines, ~32 Characters per line.
    redefinequote 1032 ^21SKILL 5: ^10YOU A BAD ENOUGH DUDE?!^23   
    redefinequote 1033  
    redefinequote 1034 ^20"HARD"^23 DIFFICULTY.
    redefinequote 1035  
    redefinequote 1036 ENEMIES ARE A LITTLE ABOVE AVERAGE FOR 
    redefinequote 1037 THEIR CURRENT LEVEL, AND ALSO TEND TO
    redefinequote 1038 OCCASIONALLY HAVE OTHER MINOR BONUSES
    redefinequote 1039 TO MAKE THINGS HARDER ON YOU AND YOUR
    redefinequote 1040 CHARACTERS. YOUR LEVEL UPS ALSO HAVE
    redefinequote 1041 SLIGHTLY BELOW AVERAGE STAT GAINS NOW
    redefinequote 1042 AS WELL.
    redefinequote 1043  
    redefinequote 1044 NOW THINGS BEGIN TO PICK UP IN TOUGH-
    redefinequote 1045 NESS.
    redefinequote 1046  
   }
   ifvare SKILLLEVEL 6
   {
    // Tip Description - 15 Lines, ~32 Characters per line.
    redefinequote 1032 ^21SKILL 6: ^7Y0U R MASOCHIST INCARNATE!^23   
    redefinequote 1033  
    redefinequote 1034 ^20"VERY HARD"^23 DIFFICULTY.
    redefinequote 1035  
    redefinequote 1036 ENEMIES ARE A LOT HARDER THAN ^10"YOU A^23
    redefinequote 1037 ^10BAD ENOUGH DUDE?!"^23, AND ARE MORE LI-
    redefinequote 1038 KELY TO HAVE VARIOUS POWERUPS AND
    redefinequote 1039 SPECIAL ITEMS TO ASSIST THEM. YOUR
    redefinequote 1040 CHARACTER ALSO GAIN LESSER THAN AVER-
    redefinequote 1041 AGE STAT GAINS FROM LEVEL UPS AS WELL.
    redefinequote 1042  
    redefinequote 1043 HAVE FAITH IN YOURSELF, YOUNG PLAYER,
    redefinequote 1044 AND PRESS FORWARD! XD
    redefinequote 1045  
    redefinequote 1046  
   }
   ifvare SKILLLEVEL 7
   {
    // Tip Description - 15 Lines, ~32 Characters per line.
    redefinequote 1032 ^21SKILL 7: ^11I WILL EAT YOUR SOUL!^23   
    redefinequote 1033  
    redefinequote 1034 ^20"EXTREMELY HARD"^23 DIFFICULTY.
    redefinequote 1035  
    redefinequote 1036 ENEMIES HAVE ENOUGH OF AN ADVANTAGE
    redefinequote 1037 OVER YOU THAT YOU'LL LIKELY END UP 
    redefinequote 1038 CURSING THEM OUT ON MULTIPLE OCCASIONS. 
    redefinequote 1039 YOUR CHARACTERS' LEVEL UP STAT GAINS
    redefinequote 1040 ARE ALSO EVEN LESS FAIR TO YOU THAN
    redefinequote 1041 BEFORE.
    redefinequote 1042  
    redefinequote 1043 TREAD VERY CAREFULLY, PLAYER OF THE
    redefinequote 1044 GAME, FOR YOU'LL NEED ALL THE LUCK YOU
    redefinequote 1045 CAN MUSTER. :O
    redefinequote 1046  
   }
   ifvare SKILLLEVEL 8
   {
    // Tip Description - 15 Lines, ~32 Characters per line.
    redefinequote 1032 ^21SKILL 8: ^14YOU ARE DEATH'S BITCH!!^23   
    redefinequote 1033  
    redefinequote 1034 ^20"NIGHTMARISHLY HARD"^23 DIFFICULTY.
    redefinequote 1035  
    redefinequote 1036 ENEMIES HAVE A VERY ENTRENCHED ADVANT-
    redefinequote 1037 AGE OVER YOU ON THIS DIFFICULTY LEVEL.
    redefinequote 1038 PREPARE TO DIE ON A FEW OCCASIONS AND
    redefinequote 1039 SUFFER OTHER UNFAIR SITUATIONS. YOUR
    redefinequote 1040 CHARACTERS' LEVEL UPS ARE EVEN MORE
    redefinequote 1041 ABYSMAL THAN ON PREVIOUS SKILL LEVELS
    redefinequote 1042 TOO.
    redefinequote 1043  
    redefinequote 1044 DEATH WON'T BE KIND TO YOU TODAY, DEAR
    redefinequote 1045 PLAYER. X_X
    redefinequote 1046  
   }
   ifvare SKILLLEVEL 9
   {
    // Tip Description - 15 Lines, ~32 Characters per line.
    redefinequote 1032 ^21SKILL 9: ^6THE END OF YOUR DESTINY!!!^23   
    redefinequote 1033  
    redefinequote 1034 ^20"'SAY YOUR PRAYERS' HARD"^23 DIFFICULTY.
    redefinequote 1035  
    redefinequote 1036 ALL THE OTHER DIFFICULTY LEVELS WERE
    redefinequote 1037 LESS THAN A CAKEWALK COMPARED TO THIS
    redefinequote 1038 ONE. ENEMIES HAVE AN IMMENSE ADVANTAGE
    redefinequote 1039 OVER YOU, WHILE YOUR CHARACTERS GAIN THE
    redefinequote 1040 LOWEST STAT BOOSTS FROM LEVEL UPS OF
    redefinequote 1041 ALL. YOU MIGHT EVEN BE COMPELLED TO
    redefinequote 1042 "RAGE QUIT" MANY TIMES ON THIS DIFFI-
    redefinequote 1043 CULTY LEVEL. C'EST LA VIE, PLAYER.
    redefinequote 1044  
    redefinequote 1045 IF YOU CAN BEAT THE ENTIRE GAME ON THIS
    redefinequote 1046 DIFFICULTY, THEN YOU'RE A GAMING GOD. :O
   }
  }
  else
  ifvare tipdisplayid 2 // Character: Duke Nukem
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7911
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 DUKE NUKEM
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20DUKE NUKEM^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 3 // Character: Jack Walker
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7912
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 JACK WALKER
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20JACK WALKER^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 4 // Character: Bubsy Bobcat
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7913
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 BUBSY BOBCAT
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20BUBSY BOBCAT^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 5 // Character: Ami Mizuno
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7927
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 AMI MIZUNO
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20AMI MIZUNO^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 6 // Character: Higa "Lo Wang" Hakaisha
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7915
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 HIGA "LO WANG" HAKAISHA
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20HIGA HAKAISHA^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 7 // Character: ESSence Margalan
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7916
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 ESSENCE MARGALAN
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20ESSENCE MARGALAN^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 8 // Character: Ted Maldoras
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7917
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 TED MALDORAS
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20TED MALDORAS^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 9 // Character: Lisa Bates
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7918
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 LISA BATES
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20LISA BATES^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 10 // Character: Cybanis Morgandos
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7919
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 CYBANIS MORGANDOS
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20CYBANIS MORGANDOS^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 11 // Character: Christina Mitchell
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7920
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 CHRISTINA MITCHELL
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20CHRISTINA MITCHELL^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 12 // Character: Nethra Maboroshi
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7926
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 NETHRA MABOROSHI
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20NETHRA MABOROSHI^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 13 // Character: Paula Polestar
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7921
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 PAULA POLESTAR
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20PAULA POLESTAR^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 14 // Character: Lori Stephens
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7922
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 LORI STEPHENS
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20LORI STEPHENS^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 15 // Character: Minako Aino
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7928
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 MINAKO AINO
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20MINAKO AINO^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 16 // Character: ??????? ?????????
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7924
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 ??????? ?????????
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20??????? ?????????^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 17 // Character: Maken Shinkara
  {
   // Pictures, etc here

   // Center Picture
   setvarvar orientation 1
   setvarvar digx 158 // 139 // digx_test
   setvarvar digy 145 // 114 // digy_test
   setvarvar digz 40960 // 12800 // digz_test
   state pal0
   setvar tilenum 7925
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 MAKEN SHINKARA
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032 PLAYABLE CHARACTER: ^20MAKEN SHINKARA^23
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035  
   redefinequote 1036  
   redefinequote 1037  
   redefinequote 1038  
   redefinequote 1039  
   redefinequote 1040  
   redefinequote 1041  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 18 // In-Game Menu Access
  {
  }
  else
  ifvare tipdisplayid 19 // "Characters" Submenu
  {
  }
  else
  ifvare tipdisplayid 20 // "Items" Submenu
  {
  }
  else
  ifvare tipdisplayid 21 // "System" Submenu
  {
  }
  else
  ifvare tipdisplayid 22 // "Status" Submenu
  {
  }
  else
  ifvare tipdisplayid 23 // "Skills" Submenu
  {
  }
  else
  ifvare tipdisplayid 24 // "Support" Submenu
  {
  }
  else
  ifvare tipdisplayid 25 // "Equipment" Submenu
  {
  }
  else
  ifvare tipdisplayid 26 // "Worldtile" Submenu
  {
  }
  else
  ifvare tipdisplayid 27 // Using Shops/Dealers
  {
  }
  else
  ifvare tipdisplayid 28 // Rescuing Innocent Civilians
  {
  }
  else
  ifvare tipdisplayid 29 // Memorbilia
  {
   // Pictures, etc here

   // Magazine #1
   setvarvar orientation 0
   setvarvar digx 120 // digx_test
   setvarvar digy 114 // digy_test
   setvarvar digz 25600 // digz_test
   state pal0
   setvar tilenum 5464
   state rs

   // Poster #1
   setvarvar orientation 0
   setvarvar digx 160 // digx_test
   setvarvar digy 114 // digy_test
   setvarvar digz 3800 // digz_test
   state pal0
   setvar tilenum 6400
   state rs

   // Figurine #1
   setvarvar orientation 0
   setvarvar digx 200 // digx_test
   setvarvar digy 114 // digy_test
   setvarvar digz 4500 // digz_test
   state pal0
   setvar tilenum 7242
   state rs

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 MEMORBILIA ITEMS
   setvarvar digx 320
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
                   // AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIII
   redefinequote 1032  
   redefinequote 1033  
   redefinequote 1034  
   redefinequote 1035 LOOK FOR MAGAZINES, FIGURINES, AND
   redefinequote 1036 POSTERS LYING ABOUT IN ORDER TO INCR-
   redefinequote 1037 EASE YOUR ^22RANK^23 POINTS. THESE TYPES
   redefinequote 1038 OF ITEMS ARE CALLLED "MEMORBILIA"
   redefinequote 1039 ITEMS, AND THE MAIN IN-GAME MENU IN-
   redefinequote 1040 CLUDES A TALLY OF THESE KINDS OF 
   redefinequote 1041 ITEMS MUCH LIKE ^22KILLS^23 AND ^22SECRETS^23.  
   redefinequote 1042  
   redefinequote 1043  
   redefinequote 1044  
   redefinequote 1045  
   redefinequote 1046  
  }
  else
  ifvare tipdisplayid 30 // Using Vending Machines
  {
  }
  else
  ifvare tipdisplayid 31 // Using ATMs
  {
  }
  else
  {
   // Pictures, etc here

   // Title Bar Text
   state pal21
   setvar tilenum 2822
   setvar temp 1031
   setvarvar orientation 0
   setvarvar textscale 49152 // digz_test
   setvarvar digz 49152 // digz_test
   redefinequote 1031 "?"
   setvarvar digx 312 // digx_test
   setvarvar digy 95
   state gtz

   // Tip Description - 15 Lines, ~32 Characters per line.
   redefinequote 1032 LINE 1
   redefinequote 1033 LINE 2
   redefinequote 1034 LINE 3
   redefinequote 1035 LINE 4
   redefinequote 1036 LINE 5
   redefinequote 1037 LINE 6
   redefinequote 1038 LINE 7
   redefinequote 1039 LINE 8
   redefinequote 1040 LINE 9
   redefinequote 1041 LINE 10
   redefinequote 1042 LINE 11
   redefinequote 1043 LINE 12
   redefinequote 1044 LINE 13
   redefinequote 1045 LINE 14
   redefinequote 1046 LINE 15
  }

  state pal23
  setvar tilenum 2822
  setvarvar orientation 0
  setvarvar textscale 32768 // digz_test
  setvarvar digz 32768 // digz_test
  // Tip Description - Line 1 of 15
  setvar temp 1032                     
  setvar digx 320 // setvarvar digx 182 addvarvar digx TEMPVAR
  setvarvar digy 132
  state gtz
  // Tip Description - Line 2 of 15
  setvar temp 1033
  setvar digx 320 // setvarvar digx 182 addvarvar digx TEMPVAR2
  addvar digy 4
  state gtz
  // Tip Description - Line 3 of 15
  setvar temp 1034
  setvar digx 320 // setvarvar digx 182 addvarvar digx TEMPVAR3
  addvar digy 4
  state gtz
  // Tip Description - Line 4 of 15
  setvar temp 1035
  setvar digx 320 // setvarvar digx 182 addvarvar digx TEMPVAR4
  addvar digy 4
  state gtz
  // Tip Description - Line 5 of 15
  setvar temp 1036
  setvar digx 320 // setvarvar digx 182 addvarvar digx TEMPVAR5
  addvar digy 4
  state gtz
  // Tip Description - Line 6 of 15
  setvar temp 1037
  setvar digx 320 // setvarvar digx 182 addvarvar digx TEMPVAR6
  addvar digy 4
  state gtz
  // Tip Description - Line 7 of 15
  setvar temp 1038
  setvar digx 320 // setvarvar digx 182 addvarvar digx TEMPVAR7
  addvar digy 4
  state gtz
  // Tip Description - Line 8 of 15
  setvar temp 1039
  setvar digx 320 // setvarvar digx 182 addvarvar digx TEMPVAR8
  addvar digy 4
  state gtz
  // Tip Description - Line 9 of 15
  setvar temp 1040
  setvar digx 320 // setvarvar digx 182 addvarvar digx CALCVAR1
  addvar digy 4
  state gtz
  // Tip Description - Line 10 of 15
  setvar temp 1041
  setvar digx 320 // setvarvar digx 182 addvarvar digx CALCVAR2
  addvar digy 4
  state gtz
  // Tip Description - Line 11 of 15
  setvar temp 1042
  setvar digx 320 // setvarvar digx 182 addvarvar digx CALCVAR3
  addvar digy 4
  state gtz
  // Tip Description - Line 12 of 15
  setvar temp 1043
  setvar digx 320 // setvarvar digx 182 addvarvar digx CALCVAR4
  addvar digy 4
  state gtz
  // Tip Description - Line 13 of 15
  setvar temp 1044
  setvar digx 320 // setvarvar digx 182 addvarvar digx CALCVAR4
  addvar digy 4
  state gtz
  // Tip Description - Line 14 of 15
  setvar temp 1045
  setvar digx 320 // setvarvar digx 182 addvarvar digx CALCVAR4
  addvar digy 4
  state gtz
  // Tip Description - Line 15 of 15
  setvar temp 1046
  setvar digx 320 // setvarvar digx 182 addvarvar digx CALCVAR4
  addvar digy 4
  state gtz


  setvarvar diga 0 // IMPORTANT NOTE TO MISFIT FROM MISFIT: "YOU DUM-DUM, ALWAYS REMEMBER TO REVERSE YOUR DISPLAY-ANGLE CHANGES, ELSE YOUR RIOT TANK DISPLAYS AND ETC WILL ALSO BE FLIPPED UPSIDE DOWN. XD"
 } // ifvarn tipdisplayid -1

} // ifvare mainmenu 0
			} // ifvare statusdisplaytoggle 0

//*************************************************************************************************************************************
//*************************************************************************************************************************************
//*************************************************************************************************************************************
//*************************************************************************************************************************************
//********Debugging Menu (Toggle Debugging Vars on and off for now, also a test of my own version of a DNWMD-style menu-system)********
//*************************************************************************************************************************************
//*************************************************************************************************************************************
//*************************************************************************************************************************************
//*************************************************************************************************************************************
//*************************************************************************************************************************************

ifvare debugtoggle 1
{
	state settile3087 
	state orientation27
	setvar digx 200


    setvar tilenum 2822 // 3072 
    setvar digz 32768 // 54613 // 57344
    setvar textscale 32768 // 54613 // 57344
    ifvare hitsprite -1
    {
     ifvarn hitsector -1
     {
      getsector[hitsector].floorpicnum temp
      ifvare temp NEWFLOORPLASMA setvar tempb 1
      else ifvare temp NEWFLOORPLASMAFROZE setvar tempb 1
      else ifvare temp HOTLAVA setvar tempb 1
      else ifvare temp HOTLAVAFROZE setvar tempb 1
      else ifvare temp MEGALAVA setvar tempb 1
      else ifvare temp MEGALAVAFROZE setvar tempb 1
      else ifvare temp ULTRALAVA setvar tempb 1
      else ifvare temp ULTRALAVAFROZE setvar tempb 1
      else ifvare temp HYPERMAGMA setvar tempb 1
      else ifvare temp HYPERMAGMAFROZE setvar tempb 1
      else setvar tempb 0
     }
     else setvar tempb 0
     ifvare tempb 0
     {
      state pal15
      setvar digx 352
      setvar digy 28
      setvarvar varname PLAYERLIFTSTRENGTH
      redefinequote 332 BASE LIFT STR: %d LBS
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      setvarvar varname PLAYERLIFTSTRENGTHTEMP
      redefinequote 332 TRUE LIFT STR: %d LBS
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      state pal11
      addvar digy 4
      setvarvar varname PLAYERJUMPSTRENGTH
      redefinequote 332 BASE JUMP STR: %d TICS
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      setvarvar varname PLAYERJUMPSTRENGTHTEMP2
      redefinequote 332 TRUE JUMP STR: %d TICS
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      setvar shade 3
      addvar digy 4
      setvarvar varname PLAYERJUMPTICS
      redefinequote 332 PLAYER JUMP TIMER: %d TICS
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      setvar shade 0

      state pal12
      addvar digy 4
      setvarvar varname PLAYERFALLRESIST
      redefinequote 332 BASE MAX FALL RES: %d TICS
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      setvarvar varname PLAYERFALLRESISTTEMP
      redefinequote 332 TRUE MAX FALL RES: %d TICS
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      setvar shade 6
      addvar digy 4
      setvarvar varname fallingresistance
      ifvarvare varname PLAYERFALLRESISTTEMP state pal21 else { ifvarl varname 0 state pal21 else state pal20 }
      redefinequote 332 FALL RESISTANCE: %d TICS
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      setvarvar varname fallcounter
      ifvarg varname 63 state pal10 else { ifvarg varname 7 state pal21 else state pal20 }
      redefinequote 332 FALL COUNTER: %d TICS
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      setvar shade 0

	state pal22
      addvar digy 4
      setvarvar varname MANTLINGTIMER
      redefinequote 332 MANTLE TIME: %d TICS
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      setvarvar varname MANTLINGTIMERMAX
      redefinequote 332 MAX MANTLE TIME: %d TICS
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      setvarvar varname MANTLINGTIMEREXTRA
      redefinequote 332 MANTLE TIME DECIMAL: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz

	state pal20
      addvar digy 4
      getuserdef[THISACTOR].const_visibility varname
      redefinequote 332 VISIBILITY: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	state pal21
      addvar digy 4
      setvarvar varname jumpcounter
      redefinequote 332 JUMP TIMER: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz

	state pal0
      addvar digy 4
      setvarvar varname freezingbase
      redefinequote 332 BASE FREEZE INTENSITY: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      setvarvar varname freezing
      redefinequote 332 TRUE FREEZE INTENSITY: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactorvar[PLAYERID].freezetimer varname
      redefinequote 332 FREEZE-TIMER: %d TICS
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz

      state pal0
      addvar digy 4
      setvarvar varname ACCELFACTOR
      redefinequote 332 ACCEL FACTOR: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getplayer[THISACTOR].posxv varname
      ifvarvarg varname PLAYERMOVEPLUSVEL state pal21
      else ifvarvare varname PLAYERMOVEPLUSVEL state pal21
      else ifvarvarl varname PLAYERMOVEPLUSVEL ifvarvarg varname PLAYERMOVEMINUSVEL state pal22
      else ifvarvare varname PLAYERMOVEMINUSVEL state pal21
      else ifvarvarl varname PLAYERMOVEMINUSVEL state pal21
      redefinequote 332 .POSXV: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getplayer[THISACTOR].posyv varname
      ifvarvarg varname PLAYERMOVEPLUSVEL state pal21
      else ifvarvare varname PLAYERMOVEPLUSVEL state pal21
      else ifvarvarl varname PLAYERMOVEPLUSVEL ifvarvarg varname PLAYERMOVEMINUSVEL state pal22
      else ifvarvare varname PLAYERMOVEMINUSVEL state pal21
      else ifvarvarl varname PLAYERMOVEMINUSVEL state pal21
      redefinequote 332 .POSYV: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getplayer[THISACTOR].poszv varname
      ifvarl varname 0 state pal20
      else ifvare varname 0 state pal22
      else ifvarg varname -1 ifvarl varname 2561 state pal23
      ifvarg varname 2399 state pal21
      redefinequote 332 .POSZV: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      state pal14
      addvar digy 4
      getinput[THISACTOR].fvel varname
      redefinequote 332 .FVEL: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getinput[THISACTOR].svel varname
      redefinequote 332 .SVEL: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getinput[THISACTOR].avel varname
      redefinequote 332 .AVEL: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      state pal21
      addvar digy 4
      setvarvar varname PLAYERMOVEPLUSVEL
      redefinequote 332 MAX FORWARD VELS [X/Y]: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      setvarvar varname PLAYERMOVEMINUSVEL
      redefinequote 332 MAX BACKWARD VELS [X/Y]: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      state pal20
      addvar digy 4
      getactor[PLAYERID].xvel varname
      redefinequote 332 .XVEL: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
	state pal21
      setvarvar varname HITPOINTREGENTICS
      redefinequote 332 HP AUTO-REGEN TIMER: %d/%d TICS
      qsprintf 332 332 varname HITPOINTREGENINTERVAL
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
	state pal0
      setvarvar varname ENERGYPOINTREGENTICS
      redefinequote 332 EP AUTO-REGEN TIMER: %d/%d TICS
      qsprintf 332 332 varname ENERGYPOINTREGENINTERVAL
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
	state pal23
      setvarvar varname CRITICALHITCHANCE
      subvar varname 1
      setvarvar TEMPVAR2 varname
      divvar TEMPVAR2 100
      setvarvar TEMPVAR3 varname
      modvar TEMPVAR3 100
      ifvarg TEMPVAR3 -1 ifvarl TEMPVAR3 10 redefinequote 332 BASE CRITICAL RATE: %d.0%d%
      else redefinequote 332 BASE CRITICAL RATE: %d.%d%      
      qsprintf 332 332 TEMPVAR2 TEMPVAR3
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
	state pal23
      setvarvar varname CRITICALHITCHANCE2
      subvar varname 1
      setvarvar TEMPVAR2 varname
      divvar TEMPVAR2 100
      setvarvar TEMPVAR3 varname
      modvar TEMPVAR3 100
      ifvarg TEMPVAR3 -1 ifvarl TEMPVAR3 10 redefinequote 332 TRUE CRITICAL RATE: %d.0%d%
      else redefinequote 332 TRUE CRITICAL RATE: %d.%d%      
      qsprintf 332 332 TEMPVAR2 TEMPVAR3
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
	state pal22
      setvarvar varname SURVIVALVALUE
      subvar varname 1
      setvarvar TEMPVAR2 varname
      divvar TEMPVAR2 100
      setvarvar TEMPVAR3 varname
      modvar TEMPVAR3 100
      ifvarg TEMPVAR3 -1 ifvarl TEMPVAR3 10 redefinequote 332 SURVIVAL CHANCE: %d.0%d%
      else redefinequote 332 SURVIVAL CHANCE: %d.%d%      
      qsprintf 332 332 TEMPVAR2 TEMPVAR3
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
	state pal10
      setvarvar varname VAMPIREMAXDMGFACTOR
      ifvarl varname 1001 setvar varname 0
      setvarvar TEMPVAR2 varname
      divvar TEMPVAR2 10
      setvarvar TEMPVAR3 varname
      modvar TEMPVAR3 10
      redefinequote 332 VAMPIRE FACTOR: %d.%d%
      qsprintf 332 332 TEMPVAR2 TEMPVAR3
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
	state pal11
      setvar varname 1000
      ifvare PLAYEREQUIPSLOTITEM1 6 divvar varname 2
      ifvare PLAYEREQUIPSLOTITEM2 6 divvar varname 2
      ifvare PLAYEREQUIPSLOTITEM3 6 divvar varname 2
      ifvare PLAYEREQUIPSLOTITEM4 6 divvar varname 2
      ifvare PLAYEREQUIPSLOTITEM5 6 divvar varname 2
      ifvare PLAYEREQUIPSLOTITEM6 6 divvar varname 2
      ifvare PLAYEREQUIPSLOTITEM7 6 divvar varname 2
      ifvare PLAYEREQUIPSLOTITEM8 6 divvar varname 2
      ifvarand PLAYERSTATUS? 32 divvar varname 2
      subvar varname 1000 mulvar varname -1
      setvarvar TEMPVAR2 varname
      divvar TEMPVAR2 10
      setvarvar TEMPVAR3 varname
      modvar TEMPVAR3 10
      redefinequote 332 DAMAGE REFLECTION%: %d.%d%
      qsprintf 332 332 TEMPVAR2 TEMPVAR3
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
	state pal21
      setvarvar varname TIMERRAWFORMAT
      redefinequote 332 TIMER [RAW FORMAT]: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
	state pal21
      setvarvar varname NEXTAUTOSAVEINTERVAL
      redefinequote 332 NEXT AUTOSAVE TIME [RAW FORMAT]: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
	state pal22
      setvarvar varname RANKPAYMENTTIMER
      redefinequote 332 RANK-PAYMENT TIMER: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
	  state pal22
      setvarvar varname RANKPAYMENTINTERVAL
      redefinequote 332 RANK-PAYMENT INTERVAL: %d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4 // 53     
	  state pal21
      setvarvar varname weaponcount
      redefinequote 332 WEAPONCOUNT: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      addvar digy 4 // 53     
	  state pal21
      getplayer[THISACTOR].random_club_frame varname
      redefinequote 332 RANDOM_CLUB_FRAME: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      addvar digy 4 // 53     
	  state pal21
      setvarvar varname currentweapon
      redefinequote 332 CURRENTWEAPON: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      addvar digy 4
      setvarvar varname totalclock
      redefinequote 332 TOTALCLOCK: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
/*
      addvar digy 4
      getplayer[THISACTOR].autostep varname
      redefinequote 332 AUTOSTEP: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getplayer[THISACTOR].autostep_sbw varname
      redefinequote 332 AUTOSTEP_SBW: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
*/
	 }
    }

     ifvarn hitsprite -1 state orientation27 else state orientation59
     state pal23
     setvar digx 192 // 270
     setvar digy 2
     setvarvar varname hitsprite
     redefinequote 332 SPRITE ID: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dnz
     ifvarn hitsprite -1
     {
      addvar digx 4
	// state pal20
      addvar digy 4
      getactor[hitsprite].extra varname
      redefinequote 332 .EXTRA: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactor[hitsprite].picnum varname
      redefinequote 332 .PICNUM: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4 // 53
      getactor[hitsprite].pal varname
      redefinequote 332 .PAL: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
	// state pal0
      addvar digy 4
      getactorvar[hitsprite].ACTORFLAGS varname
      redefinequote 332 ACTORFLAGS: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal20
      addvar digy 4
      getactorvar[hitsprite].ENEMYLEVEL varname
      redefinequote 332 LEVEL: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal21
      addvar digy 4
      getactorvar[hitsprite].ENEMYHP varname
      redefinequote 332 HP: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal21
      addvar digy 4
      getactorvar[hitsprite].ENEMYMAXHP varname
      redefinequote 332 MAX HP: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal22
      addvar digy 4
      getactorvar[hitsprite].ENEMYAP varname
      redefinequote 332 AP: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal22
      addvar digy 4
      getactorvar[hitsprite].ENEMYMAXAP varname
      redefinequote 332 MAX AP: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal10
      addvar digy 4
      getactorvar[hitsprite].ACTORATTACK varname
      redefinequote 332 ATTACK: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal14
      addvar digy 4
      getactorvar[hitsprite].ACTORDEFENSE varname
      redefinequote 332 DEFENSE: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal0
      addvar digy 4
      getactorvar[hitsprite].ENEMYAIRTIME varname
      redefinequote 332 AIRTIME: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal0
      addvar digy 4
      getactorvar[hitsprite].ENEMYMAXAIRTIME varname
      redefinequote 332 MAX AIRTIME: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal15
      addvar digy 4
      getactorvar[hitsprite].ACTORFALLRESIST varname
      redefinequote 332 FALLRESIST: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal15
      addvar digy 4
      getactorvar[hitsprite].ACTORMAXFALLRESIST varname
      redefinequote 332 MAX FALLRESIST: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal20
      addvar digy 4
      getactorvar[hitsprite].ENEMYFIRSTAID varname
      redefinequote 332 FIRSTAID: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal22
      addvar digy 4
      getactorvar[hitsprite].ENEMYARMORPERCENT varname
      setvarvar TEMPVAR2 varname
      divvar TEMPVAR2 10
      setvarvar TEMPVAR3 varname
      modvar TEMPVAR3 10
      redefinequote 332 ARMOR AB%: ^21%d.%d%
      qsprintf 332 332 TEMPVAR2 TEMPVAR3
      setvar temp 332
      state gtz // state dnz
	// state pal0
      addvar digy 4
      getactorvar[hitsprite].ENEMYQUADTIME varname
      redefinequote 332 QUAD: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal23
      addvar digy 4
      getactorvar[hitsprite].ENEMYINVULNTIME varname
      redefinequote 332 INVULN: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal21
      addvar digy 4
      getactorvar[hitsprite].ENEMYREGENTIME varname
      redefinequote 332 REGEN: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal22
      addvar digy 4
      getactorvar[hitsprite].ENEMYAPREGENTIME varname
      redefinequote 332 APREGEN: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal10
      addvar digy 4
      getactorvar[hitsprite].ENEMYVAMPIRETIME varname
      redefinequote 332 VAMPIRE: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal4
      addvar digy 4
      getactorvar[hitsprite].ENEMYBOOTSAMOUNT varname
      redefinequote 332 AIRTANK: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal21
      addvar digy 4
      getactorvar[hitsprite].ENEMYAIRTANKAMOUNT varname
      redefinequote 332 BOOTS: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal21
      addvar digy 4
      getactorvar[hitsprite].ACTORCRITICALHITCHANCE2 varname
      ifvarg varname 0 subvar varname 1
      setvarvar TEMPVAR2 varname
      divvar TEMPVAR2 100
      setvarvar TEMPVAR3 varname
      modvar TEMPVAR3 100
      ifvarg TEMPVAR3 -1 ifvarl TEMPVAR3 10 redefinequote 332 CRIT-CHANCE: ^21%d.0%d%
      else redefinequote 332 CRIT-CHANCE: ^21%d.%d%
      qsprintf 332 332 TEMPVAR2 TEMPVAR3
      setvar temp 332
      state gtz // state dnz
	// state pal21
      addvar digy 4
      getactorvar[hitsprite].ACTORSURVIVALVALUE_TEMP varname
      ifvarg varname 0 subvar varname 1
      setvarvar TEMPVAR2 varname
      divvar TEMPVAR2 100
      setvarvar TEMPVAR3 varname
      modvar TEMPVAR3 100
      ifvarg TEMPVAR3 -1 ifvarl TEMPVAR3 10 redefinequote 332 SURV-CHANCE: ^21%d.0%d%
      else redefinequote 332 SURV-CHANCE: ^21%d.%d%
      qsprintf 332 332 TEMPVAR2 TEMPVAR3
      setvar temp 332
      state gtz // state dnz
	// state pal22
      addvar digy 4
      getactorvar[hitsprite].STARCHILD varname
      redefinequote 332 RANK-STAR ID: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal22
      addvar digy 4
      getactorvar[hitsprite].HPBARCHILD varname
      redefinequote 332 HP-BAR ID: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal22
      addvar digy 4
      getactorvar[hitsprite].APBARCHILD varname
      redefinequote 332 AP-BAR ID: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal22
      addvar digy 4
      getactorvar[hitsprite].POWERUPSTRIPCHILD varname
      redefinequote 332 POWERUPSTRIP ID: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal22
      addvar digy 4
      getactorvar[hitsprite].POINTERICONCHILD varname
      redefinequote 332 POINTER ID: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal22
      addvar digy 4
      getactorvar[hitsprite].MULTIICONCHILD varname
      redefinequote 332 MULTIICON ID: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactorvar[hitsprite].ENEMYHASSHIKON? varname
      redefinequote 332 HASJEWEL?: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      // state pal20
      addvar digy 4
      getactorvar[hitsprite].ACTORSTATUS? varname
      redefinequote 332 STATUS BITS: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      // state pal21
      addvar digy 4
      getactorvar[hitsprite].ACTORHASTETIMER varname
      redefinequote 332 HASTE TIMER: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      // state pal20
      addvar digy 4
      getactorvar[hitsprite].ACTORSLOWTIMER varname
      redefinequote 332 SLOW TIMER: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      // state pal22
      addvar digy 4
      getactorvar[hitsprite].ACTORPOISONTIMER varname
      redefinequote 332 POISON TIMER: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      // state pal20
      // setvar shade 10
      addvar digy 4
      getactorvar[hitsprite].ACTORDIMNESSTIMER varname
      redefinequote 332 DIMNESS TIMER: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      // setvar shade 0
      // state pal23
      addvar digy 4
      getactorvar[hitsprite].ACTORCONFUSIONTIMER varname
      redefinequote 332 CONFUSION TIMER: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      // state pal15
      addvar digy 4
      getactorvar[hitsprite].ACTORSHELLTIMER varname
      redefinequote 332 SHELL TIMER: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      // state pal21
      // setvar shade 10
      addvar digy 4
      getactorvar[hitsprite].ACTORPSISHIELDTIMER varname
      redefinequote 332 PSI-SHIELD HITS: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      // setvar shade 0
      // state pal0
      addvar digy 4
      getactorvar[hitsprite].freezetimer varname
      redefinequote 332 FREEZE-TIMER: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      // setvar shade 0
      // state pal21
      addvar digy 4
      getactorvar[hitsprite].enemywinterclothes varname
      redefinequote 332 WINTER CLOTHES: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      // setvar shade 0
      // state pal16
      addvar digy 4
      getactorvar[hitsprite].ENEMYSPEED varname
      redefinequote 332 MOVE SPEED: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      // setvar shade 0
      // state pal23
      // state shadepulse
      addvar digy 4
      getactorvar[hitsprite].SKILLSET? varname
      redefinequote 332 SKILLSET?: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      // setvar shade 0
	// state pal23
      addvar digy 4
      getactorvar[hitsprite].ACTORAIACTIONFLAG varname
      redefinequote 332 AI ACTION FLAG: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal0

	setvar digx 356 // 294
	setvar digy 2
      addvar digy 4
      getactor[hitsprite].xrepeat varname
      redefinequote 332 .XREPEAT: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal20
      addvar digy 4
      getactor[hitsprite].yrepeat varname
      redefinequote 332 .YREPEAT: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal20
      addvar digy 4
      getactor[hitsprite].cstat varname
      redefinequote 332 .CSTAT: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
	// state pal15
      addvar digy 4
      getactor[hitsprite].statnum varname
      redefinequote 332 .STATNUM: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactor[hitsprite].httimetosleep varname
      redefinequote 332 .HTTIMETOSLEEP: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactor[hitsprite].lotag varname
      redefinequote 332 .LOTAG: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactor[hitsprite].hitag varname
      redefinequote 332 .HITAG: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactor[hitsprite].htpicnum varname
      redefinequote 332 .HTPICNUM: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactor[hitsprite].htowner varname
      redefinequote 332 .HTOWNER: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactor[hitsprite].owner varname
      redefinequote 332 .OWNER: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactorvar[hitsprite].ACTORABSORBFLAGS varname
      redefinequote 332 ABSORB BITS: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactorvar[hitsprite].ACTORIMMUNEFLAGS varname
      redefinequote 332 IMMUNITY BITS: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactorvar[hitsprite].ACTORSTRONGFLAGS varname
      redefinequote 332 RESISTANCE BITS: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactorvar[hitsprite].ACTORWEAKNESSFLAGS varname
      redefinequote 332 WEAKNESS BITS: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactorvar[hitsprite].POWERUPBENEFIT varname
      redefinequote 332 POWERUP BENEFIT: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactorvar[hitsprite].itemtimer varname
      redefinequote 332 ITEM TIMER: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactorvar[hitsprite].ITEMDROPPEDTIME varname
      redefinequote 332 ITEM DROPPED TIME: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactorvar[hitsprite].ITEMWASDROPPED? varname
      redefinequote 332 ITEM WAS DROPPED?: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactorvar[hitsprite].ITEMDROPTIMER varname
      redefinequote 332 DROPPED ITEM LIFESPAN: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactorvar[hitsprite].FROZEN? varname
      redefinequote 332 FROZEN?: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactorvar[hitsprite].FROZENTIMER varname
      redefinequote 332 FROZEN-TIMER: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz
      addvar digy 4
      getactorvar[hitsprite].ENEMYIDLOCAL varname
      redefinequote 332 ENEMY ID#: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz      
      addvar digy 4
      getactorvar[hitsprite].ACTORSHEIGHT varname
      redefinequote 332 ACTOR'S PIXEL HEIGHT: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz      
      addvar digy 4
      getactorvar[hitsprite].ACTORSWIDTH varname
      redefinequote 332 ACTOR'S PIXEL WIDTH: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dnz      
     }

     ifvarn hitwall -1 state orientation27 else state orientation59
     setvar digx 2
     setvar digy 16
     state pal20
     setvarvar varname hitwall
     redefinequote 332 WALL ID: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     ifvarn hitwall -1
     {
      addvar digx 4
      getwall[hitwall].extra varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .EXTRA: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getwall[hitwall].lotag varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .LOTAG: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getwall[hitwall].hitag varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .HITAG: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getwall[hitwall].picnum varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .PICNUM: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getwall[hitwall].overpicnum varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .OVERPICNUM: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getwall[hitwall].pal varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .PAL: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getactorvar[hitwall].VENDINGQUANITY varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 VENDINGQUANITY: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
     }

     ifvarn hitsector -1 state orientation27 else state orientation59
     state pal22
     setvar digx 2 // 110
     addvar digy 6 // 53
     setvarvar varname hitsector
     redefinequote 332 SECTOR ID: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     ifvarn hitsector -1
     {
      addvar digx 4
      getsector[hitsector].lotag varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .LOTAG: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getsector[hitsector].hitag varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .HITAG: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getsector[hitsector].extra varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .EXTRA: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getsector[hitsector].ceilingpicnum varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .CEILINGPICNUM: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getsector[hitsector].ceilingpal varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .CEILINGPAL: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getsector[hitsector].ceilingz varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .CEILINGZ: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getsector[hitsector].ceilingslope varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .CEILINGSLOPE: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getsector[hitsector].floorpicnum varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .FLOORPICNUM: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getsector[hitsector].floorpal varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .FLOORPAL: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getsector[hitsector].floorz varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .FLOORZ: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getsector[hitsector].floorslope varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .FLOORSLOPE: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getsector[hitsector].wallptr varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .WALLPTR: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getsector[hitsector].wallnum varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 .WALLNUM: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getactorvar[hitsector].SPACESECTOR? varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 SPACESECTOR?: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      getactorvar[hitsector].freezingmod varname
      addvar digx 0
      addvar digy 4
      redefinequote 332 FREEZINGMOD: ^21%d
      qsprintf 332 332 varname
      setvar temp 332
      state gtz // state dn
      

      getsector[hitsector].floorpicnum temp
      ifvare temp NEWFLOORPLASMA setvar tempb 1
      else ifvare temp NEWFLOORPLASMAFROZE setvar tempb 1
      else ifvare temp HOTLAVA setvar tempb 1
      else ifvare temp HOTLAVAFROZE setvar tempb 1
      else ifvare temp MEGALAVA setvar tempb 1
      else ifvare temp MEGALAVAFROZE setvar tempb 1
      else ifvare temp ULTRALAVA setvar tempb 1
      else ifvare temp ULTRALAVAFROZE setvar tempb 1
      else ifvare temp HYPERMAGMA setvar tempb 1
      else ifvare temp HYPERMAGMAFROZE setvar tempb 1
      else ifvare temp 336 setvar tempb 1
      else ifvare temp 4068 setvar tempb 1
      else ifvare temp 3784 setvar tempb 1
      else ifvare temp 4069 setvar tempb 1
      else ifvare temp 3800 setvar tempb 1
      else ifvare temp 4070 setvar tempb 1
      else ifvare temp 3815 setvar tempb 1
      else ifvare temp 4071 setvar tempb 1
      else setvar tempb 0
      ifvare tempb 1
      {
       // state pal23
       addvar digx 0
       addvar digy 4
       setvarvar varname tempb
       redefinequote 332 FREEZABLE?: ^21%d
       qsprintf 332 332 varname
       setvar temp 332
       state gtz // state dn
       // state pal23
       addvar digx 0
       addvar digy 4
       getactorvar[hitsector].FLOORTEMPFREEZESTATE varname
       redefinequote 332 FREEZE STATE?: ^21%d
       qsprintf 332 332 varname
       setvar temp 332
       state gtz // state dn
       // state pal20
       addvar digx 0
       addvar digy 4
       getactorvar[hitsector].FLOORTEMPLOTAGA varname
       redefinequote 332 LOTAG A: ^21%d
       qsprintf 332 332 varname
       setvar temp 332
       state gtz // state dn
       // state pal20
       addvar digx 0
       addvar digy 4
       getactorvar[hitsector].FLOORTEMPLOTAGB varname
       redefinequote 332 LOTAG B: ^21%d
       qsprintf 332 332 varname
       setvar temp 332
       state gtz // state dn
       // state pal21
       addvar digx 0
       addvar digy 4
       getactorvar[hitsector].FLOORHEALTH varname
       redefinequote 332 FLOOR HP: ^21%d
       qsprintf 332 332 varname
       setvar temp 332
       state gtz // state dn
       // state pal21
       addvar digx 0
       addvar digy 4
       getactorvar[hitsector].FLOORMAXHEALTH varname
       redefinequote 332 FLOOR MAX HP: ^21%d
       qsprintf 332 332 varname
       setvar temp 332
       state gtz // state dn
       // state pal20
       addvar digx 0
       addvar digy 4
       getactorvar[hitsector].FLOORTEMPFREEZENUMBERA varname
       redefinequote 332 FREEZE #A: ^21%d
       qsprintf 332 332 varname
       setvar temp 332
       state gtz // state dn
       // state pal20
       addvar digx 0
       addvar digy 4
       getactorvar[hitsector].FLOORTEMPFREEZENUMBERB varname
       redefinequote 332 FREEZE #B: ^21%d
       qsprintf 332 332 varname
       setvar temp 332
       state gtz // state dn
       // state pal0
       addvar digx 0
       addvar digy 4
       getactorvar[hitsector].FLOORFREEZETIME varname
       redefinequote 332 FREEZE TIMER: ^21%d
       qsprintf 332 332 varname
       setvar temp 332
       state gtz // state dn
       // state pal10
       addvar digx 0
       addvar digy 4
       getactorvar[hitsector].SUBMERGABLESECTOR? varname
       redefinequote 332 SUBMERGABLE SECTOR?: ^21%d
       qsprintf 332 332 varname
       setvar temp 332
       state gtz // state dn
       // state pal10
       addvar digx 0
       addvar digy 4
       getactorvar[hitsector].FLOORHEATRATIO varname
       redefinequote 332 FLOOR HEAT %: ^21%d
       qsprintf 332 332 varname
       setvar temp 332
       state gtz // state dn
      }
     }

     state orientation27
     state pal0
     setvar digx 2 // 110
     addvar digy 6 // 53
     getplayer[THISACTOR].i varname
     redefinequote 332 PLAYER ID: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn

     addvar digx 4 // 110
     addvar digy 4 // 53
     getactor[PLAYERID].extra varname
     redefinequote 332 .EXTRA: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getactor[PLAYERID].pal varname
     redefinequote 332 .PAL: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getplayer[THISACTOR].posx varname
     redefinequote 332 .POSX: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getplayer[THISACTOR].posy varname
     redefinequote 332 .POSY: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getplayer[THISACTOR].posz varname
     redefinequote 332 .POSZ: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getplayer[THISACTOR].ang varname
     redefinequote 332 .ANG: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getplayer[THISACTOR].horiz varname
     redefinequote 332 .HORIZ: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getplayer[THISACTOR].look_ang varname
     redefinequote 332 .LOOK_ANG: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn

     addvar digx 0 // 110
     addvar digy 4 // 53
     getplayer[THISACTOR].pals 0 varname
     redefinequote 332 .PALS 0: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getplayer[THISACTOR].pals 1 varname
     redefinequote 332 .PALS 1: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getplayer[THISACTOR].pals 2 varname
     redefinequote 332 .PALS 2: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getplayer[THISACTOR].pals_time varname
     redefinequote 332 .PALS_TIME: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
	
     addvar digx 0 // 110
     addvar digy 4
     getplayer[THISACTOR].knuckle_incs varname
     redefinequote 332 .KNUCKLE_INCS: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dnz

     addvar digx 0 // 110
     addvar digy 4
     getplayer[THISACTOR].jumping_counter varname
     redefinequote 332 .JUMPING_COUNTER: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dnz
     addvar digy 4 // 53
     getplayer[THISACTOR].on_ground varname
     redefinequote 332 .ON_GROUND: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getactor[PLAYERID].sectnum varname
     redefinequote 332 .SECTNUM: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getplayer[THISACTOR].transporter_hold varname
     redefinequote 332 .TRANSPORTER_HOLD: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getplayer[THISACTOR].hurt_delay varname
     redefinequote 332 .HURT_DELAY: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getplayer[THISACTOR].cheat_phase varname
     redefinequote 332 .CHEAT_PHASE: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getplayer[THISACTOR].dummyplayersprite varname
     redefinequote 332 .DUMMYPLAYERSPRITE: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     getplayer[THISACTOR].gm varname
     redefinequote 332 .GM: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     setvarvar varname randomseed
     redefinequote 332 RANDOMSEED: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     setvarvar varname ftq
     redefinequote 332 FTQ: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53
     setvarvar varname fta
     redefinequote 332 FTA: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn
     addvar digx 0 // 110
     addvar digy 4 // 53     
     getactorvar[PLAYERID].FROZENTIMER varname
     redefinequote 332 FREEZE-TIMER: ^21%d
     qsprintf 332 332 varname
     setvar temp 332
     state gtz // state dn

     state orientation27
     state settile3087 

// END OF VERY IMPORTANT TESTING VARIABLES

}

// END OF DEBUGGING MENU

// ******************************************************************************
// ******************************************************************************
// **************************** BEGIN SHOP MENUS ********************************
// ******************************************************************************
// ******************************************************************************

ifvare mainmenu 0 state shop_display

// ******************************************************************************
// ******************************************************************************
// **************************** BEGIN ATM MENUS *********************************
// ******************************************************************************
// ******************************************************************************

ifvare mainmenu 0 state atm_display

// ******************************************************************************
// ******************************************************************************
// **************************** BEGIN MAIN MENU *********************************
// ******************************************************************************
// ******************************************************************************

state ingamemenus

} // ifvarl gameover? 1																						
																						} // ifvare oldskoolmode 0




//*********************************************
//*********************************************
//***Old-Skool Status Bar [for the prolouge]***
//*********************************************
//*********************************************

ifvare oldskoolmode 1 ifvarg TIMERRAWFORMAT 0
{ // ifvare oldskoolmode 1

  ifvare debugtoggle 1
  {
      state settile3087
      state pal21
      setvar digx 181
      setvar digy 52
      getplayer[THISACTOR].bobcounter varname
	state dn
      setvar digy 58

      getplayer[THISACTOR].look_ang varname
	state dn
      setvar digy 64
      getplayer[THISACTOR].zoom varname
	state dn
      setvar digy 70
      getplayer[THISACTOR].weapon_sway varname
	state dn
      setvar digy 76
      getplayer[THISACTOR].kickback_pic varname
	state dn
      setvar digy 82
      getplayer[THISACTOR].knee_incs varname
	state dn
      setvar digy 88
      getplayer[THISACTOR].knuckle_incs varname
	state dn
      setvar digy 94
      getplayer[THISACTOR].weapon_pos varname
	state dn
      setvar digy 100
      getplayer[THISACTOR].curr_weapon varname
	state dn
      setvar digy 106
      getplayer[THISACTOR].access_incs varname
	state dn
      setvar digy 112
      getplayer[THISACTOR].last_weapon varname
	state dn
  }

  // Weapon Display Readjustments

 ifvare CURRENTHITPOINTS 0 ifvare FROZEN? 0 nullop
 else
 {
  getplayer[THISACTOR].access_incs varname
  ifvarg varname 0 // Using a Keycard on a Keyscanner
  { // Using a Keycard on a Keyscanner

   getactor[PLAYERID].sectnum temp
   getsector[temp].floorpal tempe
   getsector[temp].floorshade tempf

   getplayer[THISACTOR].access_spritenum tempd
   ifvarn tempd -1 getactor[tempd].pal tempd

   getuserdef[THISACTOR].overhead_on TEMPVAR4
   ifvarn TEMPVAR4 2
   {
    getplayer[THISACTOR].over_shoulder_on TEMPVAR4
    ifvare TEMPVAR4 0
    {
     // 1-10 - Holding Key (2568) [Flipped]
     // 11-15 - Withdrawing Hand 1 (2564)
     // 16-20 - Withdrawing Hand 2 (2565)
     setvarvar pal tempd

     // Frames
     ifvarg varname 0 ifvarl varname 11 { state orientation20 setvar diga 1024 setvar tilenum 2568 }
     ifvarg varname 10 ifvarl varname 16 { state orientation16 setvar diga 0 setvar tilenum 2564 }
     ifvarg varname 15 ifvarl varname 21 { state orientation16 setvar diga 0 setvar tilenum 2565 }

     ifvare varname 1 { setvarvar digx 247 setvarvar digy 196 }
     ifvare varname 2 { setvarvar digx 249 setvarvar digy 189 }
     ifvare varname 3 { setvarvar digx 245 setvarvar digy 173 }
     ifvare varname 4 { setvarvar digx 237 setvarvar digy 141 }
     ifvare varname 5 { setvarvar digx 232 setvarvar digy 121 }
     ifvarg varname 5 ifvarl varname 11 { setvarvar digx 226 setvarvar digy 97 }
     ifvarg varname 10 ifvarl varname 16 { setvarvar digx -13 setvarvar digy 88 }
     ifvare varname 16 { setvarvar digx -5 setvarvar digy 107 }
     ifvare varname 17 { setvarvar digx 1 setvarvar digy 131 }
     ifvare varname 18 { setvarvar digx 3 setvarvar digy 139 }
     ifvare varname 19 { setvarvar digx 11 setvarvar digy 171 }
     ifvare varname 20 { setvarvar digx 15 setvarvar digy 187 }
     subvar digy 18 // repositions the display above the status bar
     state oldskoolturningpositions
     state digz65536
     state rs
    }
   }

  } // Using a Keycard on a Keyscanner
  else // Not Using a Keycard on a Keyscanner
  { // Not Using a Keycard on a Keyscanner
   getplayer[THISACTOR].knuckle_incs varname
   ifvarg varname 0 // Cracking Knuckles
   { // Cracking Knuckles

    getactor[PLAYERID].sectnum temp
    getsector[temp].floorpal tempe
    getsector[temp].floorshade tempf
 
    getuserdef[THISACTOR].overhead_on TEMPVAR4
    ifvarn TEMPVAR4 2
    {
     getplayer[THISACTOR].over_shoulder_on TEMPVAR4
     ifvare TEMPVAR4 0
     {
      // 1 - Frame 1 (2324) [Flipped]
      // 2-3 - Frame 2 (2325) [Flipped]
      // 4-7 - Frame 3 (2326) [Flipped]
      // 8-13 - Frame 4 (2327) [Flipped]
      // 14-17 - Frame 3 (2326) [Flipped]
      // 18-19 - Frame 2 (2325) [Flipped]
      // 20-21 - Frame 1 (2324) [Flipped]
      setvarvar pal tempd

      ifvare varname 1 { setvar digx 309 setvar digy 129 state orientation20 setvar diga 1024 setvar tilenum 2324 }
      ifvarg varname 1 ifvarl varname 4 { setvar digx 318 setvar digy 125 state orientation20 setvar diga 1024 setvar tilenum 2325 }
      ifvarg varname 3 ifvarl varname 8 { setvar digx 307 setvar digy 125 state orientation20 setvar diga 1024 setvar tilenum 2326 }
      ifvarg varname 7 ifvarl varname 14 { setvar digx 309 setvar digy 125 state orientation20 setvar diga 1024 setvar tilenum 2327 }
      ifvarg varname 13 ifvarl varname 18 { setvar digx 307 setvar digy 125 state orientation20 setvar diga 1024 setvar tilenum 2326 }
      ifvarg varname 17 ifvarl varname 20 { setvar digx 318 setvar digy 125 state orientation20 setvar diga 1024 setvar tilenum 2325 }
      ifvarg varname 19 ifvarl varname 22 { setvar digx 309 setvar digy 129 state orientation20 setvar diga 1024 setvar tilenum 2324 }
      subvar digy 18 // repositions the display above the status bar
      state oldskoolturningpositions
      state digz65536
      state rs
     }
    }
   } // Cracking Knuckles
   else // Not cracking Knuckles
   { // Not cracking Knuckles

    getactor[PLAYERID].sectnum temp
    getsector[temp].floorpal tempe
    getsector[temp].floorshade tempf
 
    getplayer[THISACTOR].weapon_pos TEMPVAR3 // [negatives are "going down" [last_weapon], positives are "coming up" [curr_weapon]]
    ifvarg TEMPVAR3 -11 ifvarl TEMPVAR3 0 getplayer[THISACTOR].last_weapon TEMPVAR
     else ifvarg TEMPVAR3 -1 ifvarl TEMPVAR3 11 getplayer[THISACTOR].curr_weapon TEMPVAR

    getplayer[THISACTOR].look_ang TEMPVAR5
    setvarvar TEMP2 TEMPVAR5
    mulvar TEMP2 100
    divvar TEMP2 608

    // Look/Left-Right Alterations - X Plane
    setvar TEMP3 310
    mulvarvar TEMP3 TEMP2
    divvar TEMP3 100

    // Look/Left-Right Alterations - Y Plane
    setvar TEMP4 70
    mulvarvar TEMP4 TEMP2
    divvar TEMP4 100
    ifvarl TEMP4 0 mulvar TEMP4 -1

    getuserdef[THISACTOR].overhead_on TEMPVAR4
    ifvarn TEMPVAR4 2
    {
     getplayer[THISACTOR].over_shoulder_on TEMPVAR4
     ifvare TEMPVAR4 0
     {
      // Kick
      ifvare TEMPVAR 0
      {
       ifvarn tempe 0 setvarvar pal tempe else { ifvare FROZEN? 1 setvar pal 1 else setvar pal 0 }
       ifvarn tempf 0 setvarvar shade tempf else setvar shade 0
  
       getplayer[THISACTOR].kickback_pic TEMPVAR2 
       setvar tilenum 5372
       ifvarg TEMPVAR2 0 ifvarl TEMPVAR2 5 // Frames 2-5
       {
        setvarvar digx 155 // 155 is normal x position for kick in non-oldskool mode
        setvarvar digy 152 // 152 is normal y position for kick in non-oldskool mode
        setvar tilenum 2521
       }
       ifvarg TEMPVAR2 4 ifvarl TEMPVAR2 10
       {
        setvarvar digx 128 // 128 is normal x position for kick in non-oldskool mode
        setvarvar digy 81 // 81 is normal y position for kick in non-oldskool mode
        setvar tilenum 2522
       }
       ifvarg TEMPVAR2 9 ifvarl TEMPVAR2 14
       {
        setvarvar digx 155 // 155 is normal x position for kick in non-oldskool mode
        setvarvar digy 152 // 152 is normal y position for kick in non-oldskool mode
        setvar tilenum 2521
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       state digz65536
       state orientation16
       state rs
      }

      // Pistol
      ifvare TEMPVAR 1
      {
       ifvarn tempe 0 setvarvar pal tempe else { ifvare FROZEN? 1 setvar pal 1 else setvar pal 0 }
       ifvarn tempf 0 setvarvar shade tempf else setvar shade 0
       getplayer[THISACTOR].kickback_pic TEMPVAR2 
  
       // Ammo Clip & Hand
       setvar tilenum 5372
       ifvare TEMPVAR2 10 // Frame 11 [Empty Clip]
       {
        setvarvar digx 142 // 142 is normal x position for pistol in non-oldskool mode
        setvarvar digy 196 // 196 is normal y position for pistol in non-oldskool mode
        setvar tilenum 2530
       }
       ifvare TEMPVAR2 18 // Frame 19 [Hand w/ Clip]
       {
        setvarvar digx 113 // 113 is normal x position for pistol in non-oldskool mode
        setvarvar digy 190 // 190 is normal y position for pistol in non-oldskool mode
        setvar tilenum 2531
       }
       ifvare TEMPVAR2 19 // Frame 20 [Hand w/ Clip]
       {
        setvarvar digx 113 // 113 is normal x position for pistol in non-oldskool mode
        setvarvar digy 185 // 185 is normal y position for pistol in non-oldskool mode
        setvar tilenum 2531
       }
       ifvarg TEMPVAR2 19 ifvarl TEMPVAR2 23 // Frame 21-23 [Hand w/o Clip]
       {
        setvarvar digx 167 // 167 is normal x position for pistol in non-oldskool mode
        setvarvar digy 131 // 131 is normal y position for pistol in non-oldskool mode
        setvar tilenum 2532
       }
       ifvarg TEMPVAR2 22 ifvarl TEMPVAR2 25 // Frame 24-25 [Hand w/o Clip]
       {
        setvarvar digx 147 // 147 is normal x position for pistol in non-oldskool mode
        setvarvar digy 141 // 141 is normal y position for pistol in non-oldskool mode
        setvar tilenum 2532
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       ifvarl TEMPVAR2 6 state oldskoolweaponbob
       state oldskoolturningpositions
       state digz65536
       state orientation16
       state rs
  
       // Main Gun
       ifvare TEMPVAR2 0 // Frame 1
       {
        setvar digx 171 // 171 is normal x position for pistol in non-oldskool mode
        setvar digy 142 // 142 is normal y position for pistol in non-oldskool mode
        setvar tilenum 2524
       }
       ifvare TEMPVAR2 1 // Frame 2
       {
        setvar digx 161 // 166 is normal x position for pistol in non-oldskool mode
        setvar digy 123 // 123 is normal y position for pistol in non-oldskool mode
        setvar tilenum 2525
       }
       ifvare TEMPVAR2 2 // Frame 3
       {
        setvar digx 173 // 173 is normal x position for pistol in non-oldskool mode
        setvar digy 128 // 128 is normal y position for pistol in non-oldskool mode
        setvar tilenum 2526
       }
       ifvarg TEMPVAR2 2 ifvarl TEMPVAR2 7 // Frames 4-7
       {
        setvar digx 171 // 171 is normal x position for pistol in non-oldskool mode
        setvar digy 142 // 142 is normal y position for pistol in non-oldskool mode
        setvar tilenum 2524
       }
       ifvarg TEMPVAR2 6 ifvarl TEMPVAR2 10 // Frames 8-11
       {
        setvar digx 139 // 139 is normal x position for pistol in non-oldskool mode
        setvar digy 102 // 102 is normal y position for pistol in non-oldskool mode
        setvar tilenum 2528
       }
       ifvarg TEMPVAR2 9 ifvarl TEMPVAR2 20 // Frames 12-20
       {
        setvar digx 183 // 183 is normal x position for pistol in non-oldskool mode
        setvar digy 74 // 74 is normal y position for pistol in non-oldskool mode
        setvar tilenum 2529
       }
       ifvarg TEMPVAR2 19 ifvarl TEMPVAR2 23 // Frames 21-23
       {
        setvar digx 183 // 183 is normal x position for pistol in non-oldskool mode
        setvar digy 64 // 64 is normal y position for pistol in non-oldskool mode
        setvar tilenum 2529
       }
       ifvarg TEMPVAR2 22 ifvarl TEMPVAR2 25 // Frames 24-25
       {
        setvar digx 183 // 183 is normal x position for pistol in non-oldskool mode
        setvar digy 74 // 74 is normal y position for pistol in non-oldskool mode
        setvar tilenum 2529
       }
       ifvarg TEMPVAR2 24 ifvarl TEMPVAR2 27 // Frames 26-27
       {
        setvar digx 153 // 153 is normal x position for pistol in non-oldskool mode
        setvar digy 89 // 89 is normal y position for pistol in non-oldskool mode
        setvar tilenum 2529
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       ifvarl TEMPVAR2 6 state oldskoolweaponbob
       state oldskoolturningpositions
       state digz65536
       state orientation16
       state rs
      }

      // Shotgun
      ifvare TEMPVAR 2
      {
       // 0-2 - Idle (Gun) [2613]
       // 3-4 - Cocking 1 (Gun) [2616]
       // 5 - Cocking 1 (Gun) [2616]
       // 6-8 - Idle (Gun) [2613]
       // 9-12 - Cocking 1 (Gun) [2616]
       // 13-15 - Cocking 2 (Gun) [2617]
       // 16-19 - Cocking 3 (Gun) [2618]
       // 20 - Cocking 4 (Gun) [2619]
 
       // 1-2 - Muzzle Flash 2 [2615]
       // 3-4 - Muzzle Flash 2 [2615]
       getplayer[THISACTOR].kickback_pic TEMPVAR2 
       ifvarn tempe 0 setvarvar pal tempe else { ifvare FROZEN? 1 setvar pal 1 else setvar pal 0 }
       ifvarn tempf 0 setvarvar shade tempf else setvar shade 0
 
       setvar tilenum 5372
       ifvarg TEMPVAR2 -1 ifvarl TEMPVAR2 3
       {
        setvarvar digx 155 // 155 is normal x position for gun in non-oldskool mode
        setvarvar digy 141 // 141 is normal y position for gun in non-oldskool mode
        setvar tilenum 2613
       }
       ifvarg TEMPVAR2 2 ifvarl TEMPVAR2 5
       {
        setvarvar digx 173 // 173 is normal x position for gun in non-oldskool mode
        setvarvar digy 171 // 171 is normal y position for gun in non-oldskool mode
        setvar tilenum 2616
       }
       ifvare TEMPVAR2 5
       {
        setvarvar digx 153 // 153 is normal x position for gun in non-oldskool mode
        setvarvar digy 131 // 131 is normal y position for gun in non-oldskool mode
        setvar tilenum 2616
       }
       ifvarg TEMPVAR2 5 ifvarl TEMPVAR2 9
       {
        setvarvar digx 155 // 155 is normal x position for gun in non-oldskool mode
        setvarvar digy 141 // 141 is normal y position for gun in non-oldskool mode
        setvar tilenum 2613
       }
       ifvarg TEMPVAR2 8 ifvarl TEMPVAR2 13
       {
        setvarvar digx 153 // 153 is normal x position for gun in non-oldskool mode
        setvarvar digy 131 // 131 is normal y position for gun in non-oldskool mode
        setvar tilenum 2616
       }
       ifvarg TEMPVAR2 12 ifvarl TEMPVAR2 16
       {
        setvarvar digx 143 // 143 is normal x position for gun in non-oldskool mode
        setvarvar digy 94 // 94 is normal y position for gun in non-oldskool mode
        setvar tilenum 2617
       }
       ifvarg TEMPVAR2 15 ifvarl TEMPVAR2 20
       {
        setvarvar digx 158 // 158 is normal x position for gun in non-oldskool mode
        setvarvar digy 45 // 45 is normal y position for gun in non-oldskool mode
        setvar tilenum 2618
       }
       ifvare TEMPVAR2 20
       {
        setvarvar digx 177 // 177 is normal x position for gun in non-oldskool mode
        setvarvar digy 46 // 46 is normal y position for gun in non-oldskool mode
        setvar tilenum 2619
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       state digz65536
       state orientation16
       state rs
  
              ifvarn tempe 0 setvarvar pal tempe else { ifvare FROZEN? 1 setvar pal 1 else setvar pal 0 }
       ifvarn tempf 0 setvarvar shade tempf else setvar shade 0
       setvar tilenum 5372
       ifvarg TEMPVAR2 0 ifvarl TEMPVAR2 3
       {
        setvarvar digx 160 // 160 is normal x position for gun in non-oldskool mode
        setvarvar digy 125 // 125 is normal y position for gun in non-oldskool mode
        setvar tilenum 2615
       }
       ifvarg TEMPVAR2 2 ifvarl TEMPVAR2 5
       {
        setvarvar digx 190 // 190 is normal x position for gun in non-oldskool mode
        setvarvar digy 158 // 158 is normal y position for gun in non-oldskool mode
        setvar tilenum 2615
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       state digz65536
       state orientation16
       state rs
      }

      // Chaingun
      ifvare TEMPVAR 3
      {
       // 0-9 - Bottom Part [2536]
  
       // 0-1 - Top Part Frame 1 [2537]
       // 2-3 - Top Part Frame 2 [2538]
       // 4-5 - Top Part Frame 3 [2539]
       // 6-7 - Top Part Frame 4 [2540]
       // 8-9 - Top Part Frame 1 [2537] 
 
       // 1-5 - Firing Middle Barrel [2541] 
 
       // 5-8 - Left/Right Firing 1 [2541] (x2)
       // 9 - Left/Right Firing 2 [2542] (x2)
       getplayer[THISACTOR].kickback_pic TEMPVAR2 
       ifvarn tempe 0 setvarvar pal tempe else { ifvare FROZEN? 1 setvar pal 1 else setvar pal 0 }
       ifvarn tempf 0 setvarvar shade tempf else setvar shade 0
  
       state oldskoolgetshake
 
       // Middle Firing Barrel
       setvar tilenum 5372
       ifvarg TEMPVAR2 0 ifvarl TEMPVAR2 6
       {
        setvarvar digx 161 // 161 is normal x position for bottom part in non-oldskool mode
        setvarvar digy 130 // 130 is normal y position for bottom part in non-oldskool mode
        setvar tilenum 2541
       }
       ifvare TEMPVAR2 6
       {
        setvarvar digx 158 // 158 is normal x position for bottom part in non-oldskool mode
        setvarvar digy 127 // 127 is normal y position for bottom part in non-oldskool mode
        setvar tilenum 2542
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       addvarvar digx tempb
       addvarvar digy tempc
       state digz65536
       state orientation16
       state rs
  
       // Left Firing Barrel
       setvar tilenum 5372
       ifvarg TEMPVAR2 4 ifvarl TEMPVAR2 9
       {
        setvarvar digx 141 // 141 is normal x position for bottom part in non-oldskool mode
        setvarvar digy 130 // 130 is normal y position for bottom part in non-oldskool mode
        setvar tilenum 2541
       }
       ifvare TEMPVAR2 9
       {
        setvarvar digx 138 // 138 is normal x position for bottom part in non-oldskool mode
        setvarvar digy 127 // 127 is normal y position for bottom part in non-oldskool mode
        setvar tilenum 2542
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       addvarvar digx tempb
       addvarvar digy tempc
       state digz65536
       state orientation16
       state rs 

       // Right Firing Barrel
       setvar tilenum 5372
       ifvarg TEMPVAR2 4 ifvarl TEMPVAR2 9
       {
        setvarvar digx 181 // 161 is normal x position for bottom part in non-oldskool mode
        setvarvar digy 130 // 130 is normal y position for bottom part in non-oldskool mode
        setvar tilenum 2541
       }
       ifvare TEMPVAR2 9
       {
        setvarvar digx 178 // 158 is normal x position for bottom part in non-oldskool mode
        setvarvar digy 127 // 127 is normal y position for bottom part in non-oldskool mode
        setvar tilenum 2542
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       addvarvar digx tempb
       addvarvar digy tempc
       state digz65536
       state orientation16
       state rs

       // Bottom Part
       setvar tilenum 5372
       ifvarg TEMPVAR2 -1 ifvarl TEMPVAR2 10
       {
        setvarvar digx 75 // 75 is normal x position for bottom part in non-oldskool mode
        setvarvar digy 168 // 168 is normal y position for bottom part in non-oldskool mode
        setvar tilenum 2536
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       addvarvar digx tempb
       addvarvar digy tempc
       state digz65536
       state orientation16
       state rs

       // Top Part
       setvar tilenum 5372
       ifvarg TEMPVAR2 -1 ifvarl TEMPVAR2 2
       {
        setvarvar digx 147 // 147 is normal x position for bottom part in non-oldskool mode
        setvarvar digy 145 // 145 is normal y position for bottom part in non-oldskool mode
        setvar tilenum 2537
       }
       ifvarg TEMPVAR2 1 ifvarl TEMPVAR2 4
       {
        setvarvar digx 147 // 147 is normal x position for bottom part in non-oldskool mode
        setvarvar digy 145 // 145 is normal y position for bottom part in non-oldskool mode
        setvar tilenum 2538
       }
       ifvarg TEMPVAR2 3 ifvarl TEMPVAR2 6
       {
        setvarvar digx 147 // 147 is normal x position for bottom part in non-oldskool mode
        setvarvar digy 145 // 145 is normal y position for bottom part in non-oldskool mode
        setvar tilenum 2539
       }
       ifvarg TEMPVAR2 5 ifvarl TEMPVAR2 8
       {
        setvarvar digx 147 // 147 is normal x position for bottom part in non-oldskool mode
        setvarvar digy 145 // 145 is normal y position for bottom part in non-oldskool mode
        setvar tilenum 2540
       }
       ifvarg TEMPVAR2 7 ifvarl TEMPVAR2 10
       {
        setvarvar digx 147 // 147 is normal x position for bottom part in non-oldskool mode
        setvarvar digy 145 // 145 is normal y position for bottom part in non-oldskool mode
        setvar tilenum 2537
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       addvarvar digx tempb
       addvarvar digy tempc
       state digz65536
       state orientation16
       state rs
      }

      // RPG
      ifvare TEMPVAR 4
      {
       // 0-19 - Gun [2544]
       // 2-3 - Flash 1 [2545]
       // 4-5 - Flash 2 [2546]

       ifvarn tempe 0 setvarvar pal tempe else { ifvare FROZEN? 1 setvar pal 1 else setvar pal 0 }
       ifvarn tempf 0 setvarvar shade tempf else setvar shade 0
       getplayer[THISACTOR].kickback_pic TEMPVAR2 
 
       // Main Gun
       setvar tilenum 5372
       ifvare TEMPVAR2 0
       {
        setvarvar digx 106 // 106 is normal x position for gun in non-oldskool mode
        setvarvar digy 126 // 126 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 1
       {
        setvarvar digx 106 // 106 is normal x position for gun in non-oldskool mode
        setvarvar digy 126 // 126 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 2
       {
        setvarvar digx 111 // 111 is normal x position for gun in non-oldskool mode
        setvarvar digy 131 // 131 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 3
       {
        setvarvar digx 115 // 115 is normal x position for gun in non-oldskool mode
        setvarvar digy 135 // 135 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 4
       {
        setvarvar digx 117 // 117 is normal x position for gun in non-oldskool mode
        setvarvar digy 137 // 137 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 5
       {
        setvarvar digx 119 // 119 is normal x position for gun in non-oldskool mode
        setvarvar digy 139 // 139 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 6
       {
        setvarvar digx 119 // 119 is normal x position for gun in non-oldskool mode
        setvarvar digy 139 // 139 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 7
       {
        setvarvar digx 119 // 119 is normal x position for gun in non-oldskool mode
        setvarvar digy 139 // 139 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 8
       {
        setvarvar digx 117 // 117 is normal x position for gun in non-oldskool mode
        setvarvar digy 137 // 137 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 9
       {
        setvarvar digx 115 // 115 is normal x position for gun in non-oldskool mode
        setvarvar digy 135 // 135 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 10
       {
        setvarvar digx 111 // 111 is normal x position for gun in non-oldskool mode
        setvarvar digy 131 // 131 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 11
       {
        setvarvar digx 108 // 108 is normal x position for gun in non-oldskool mode
        setvarvar digy 128 // 128 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 12
       {
        setvarvar digx 106 // 106 is normal x position for gun in non-oldskool mode
        setvarvar digy 126 // 126 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 13
       {
        setvarvar digx 104 // 104 is normal x position for gun in non-oldskool mode
        setvarvar digy 124 // 124 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 14
       {
        setvarvar digx 102 // 102 is normal x position for gun in non-oldskool mode
        setvarvar digy 122 // 122 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 15
       {
        setvarvar digx 104 // 104 is normal x position for gun in non-oldskool mode
        setvarvar digy 124 // 124 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 16
       {
        setvarvar digx 106 // 106 is normal x position for gun in non-oldskool mode
        setvarvar digy 126 // 126 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 17
       {
        setvarvar digx 108 // 108 is normal x position for gun in non-oldskool mode
        setvarvar digy 128 // 128 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 18
       {
        setvarvar digx 111 // 111 is normal x position for gun in non-oldskool mode
        setvarvar digy 131 // 131 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       ifvare TEMPVAR2 19
       {
        setvarvar digx 115 // 115 is normal x position for gun in non-oldskool mode
        setvarvar digy 135 // 135 is normal y position for gun in non-oldskool mode
        setvar tilenum 2544
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       state digz65536
       state orientation16
       state rs

       // Muzzle Flash
       ifvarn tempe 0 setvarvar pal tempe else { ifvare FROZEN? 1 setvar pal 1 else setvar pal 0 }
       ifvarn tempf 0 setvarvar shade tempf else setvar shade 0
       setvar tilenum 5372
       ifvare TEMPVAR2 2
       {
        setvarvar digx 199 // 199 is normal x position for gun in non-oldskool mode
        setvarvar digy 121 // 121 is normal y position for gun in non-oldskool mode
        setvar tilenum 2545
       }
       ifvare TEMPVAR2 3
       {
        setvarvar digx 203 // 203 is normal x position for gun in non-oldskool mode
        setvarvar digy 125 // 125 is normal y position for gun in non-oldskool mode
        setvar tilenum 2545
       }
       ifvare TEMPVAR2 4
       {
        setvarvar digx 189 // 189 is normal x position for gun in non-oldskool mode
        setvarvar digy 113 // 113 is normal y position for gun in non-oldskool mode
        setvar tilenum 2546
       }
       ifvare TEMPVAR2 5
       {
        setvarvar digx 191 // 191 is normal x position for gun in non-oldskool mode
        setvarvar digy 115 // 115 is normal y position for gun in non-oldskool mode
        setvar tilenum 2546
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       state digz65536
       state orientation16
       state rs
      }

      // Pipebomb
      ifvare TEMPVAR 5
      {
       // 0-4 - Holding Pipebomb
       // 5-11 - Throwing Pipebomb
       // 12-19 - Empty Hand
       ifvarn tempe 0 setvarvar pal tempe else { ifvare FROZEN? 1 setvar pal 1 else setvar pal 0 }
       ifvarn tempf 0 setvarvar shade tempf else setvar shade 0
       getplayer[THISACTOR].kickback_pic TEMPVAR2 

       setvar tilenum 5372
       ifvare TEMPVAR2 0
       {
        setvarvar digx 180 // 180 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 118 // 118 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2573
       }
       ifvare TEMPVAR2 1
       {
        setvarvar digx 180 // 180 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 118 // 118 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2573
       }
       ifvare TEMPVAR2 2
       {
        setvarvar digx 180 // 180 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 128 // 128 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2573
       }
       ifvare TEMPVAR2 3
       {
        setvarvar digx 180 // 180 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 138 // 138 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2573
       }
       ifvare TEMPVAR2 4
       {
        setvarvar digx 180 // 180 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 148 // 148 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2573
       }
       ifvare TEMPVAR2 5
       {
        setvarvar digx 112 // 112 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 189 // 189 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2574
       }
       // 6 = Empty
       // 7 = Empty
       ifvare TEMPVAR2 8
       {
        setvarvar digx 109 // 109 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 168 // 168 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2574
       }
       ifvare TEMPVAR2 9
       {
        setvarvar digx 112 // 112 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 159 // 159 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2574
       }
       ifvare TEMPVAR2 10
       {
        setvarvar digx 112 // 112 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 139 // 139 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2574
       }
       ifvare TEMPVAR2 11
       {
        setvarvar digx 112 // 112 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 119 // 119 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2574
       }
       ifvare TEMPVAR2 12
       {
        setvarvar digx 153 // 153 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 134 // 134 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2575
       }
       ifvare TEMPVAR2 13
       {
        setvarvar digx 153 // 153 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 143 // 143 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2575
       }
       ifvare TEMPVAR2 14
       {
        setvarvar digx 153 // 153 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 152 // 152 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2575
       }
       ifvare TEMPVAR2 15
       {
        setvarvar digx 153 // 153 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 161 // 161 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2575
       }
       ifvare TEMPVAR2 16
       {
        setvarvar digx 153 // 153 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 170 // 170 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2575
       }
       ifvare TEMPVAR2 17
       {
        setvarvar digx 153 // 153 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 179 // 179 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2575
       }
       ifvare TEMPVAR2 18
       {
        setvarvar digx 153 // 153 is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 188 // 188 is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2575
       }
       ifvare TEMPVAR2 19
       {
        setvarvar digx 153 // ? is normal x position for pipebomb in non-oldskool mode
        setvarvar digy 197 // ? is normal y position for pipebomb in non-oldskool mode
        setvar tilenum 2575
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       state digz65536
       state orientation16
       state rs
      }

      // Hand Remote
      ifvare TEMPVAR 10
      {
       // 0 - Idle
       // 1-2 - About To Press
       // 3 - Pressing
       // 4-5 - About to Press
       // 6-9 - Idle
       ifvarn tempe 0 setvarvar pal tempe else { ifvare FROZEN? 1 setvar pal 1 else setvar pal 0 }
       ifvarn tempf 0 setvarvar shade tempf else setvar shade 0
       getplayer[THISACTOR].kickback_pic TEMPVAR2  
 
       setvar tilenum 5372
       ifvare TEMPVAR2 0
       {
        setvarvar digx -22 // -22 is normal x position for remote in non-oldskool mode
        setvarvar digy 137 // 137 is normal y position for remote in non-oldskool mode
        setvar tilenum 2570
       }
       ifvare TEMPVAR2 1
       {
        setvarvar digx 6 // 6 is normal x position for remote in non-oldskool mode
        setvarvar digy 142 // 142 is normal y position for remote in non-oldskool mode
        setvar tilenum 2571
       }
       ifvare TEMPVAR2 2
       {
        setvarvar digx 6 // 6 is normal x position for remote in non-oldskool mode
        setvarvar digy 142 // 142 is normal y position for remote in non-oldskool mode
        setvar tilenum 2571
       }
       ifvare TEMPVAR2 3
       {
        setvarvar digx -23 // -23 is normal x position for remote in non-oldskool mode
        setvarvar digy 139 // 139 is normal y position for remote in non-oldskool mode
        setvar tilenum 2572
       }
       ifvare TEMPVAR2 4
       {
        setvarvar digx 6 // ? is normal x position for remote in non-oldskool mode
        setvarvar digy 142 // ? is normal y position for remote in non-oldskool mode
        setvar tilenum 2571
       }
       ifvare TEMPVAR2 5
       {
        setvarvar digx 6 // ? is normal x position for remote in non-oldskool mode
        setvarvar digy 142 // ? is normal y position for remote in non-oldskool mode
        setvar tilenum 2571
       }
       ifvare TEMPVAR2 6
       {
        setvarvar digx -22 // ? is normal x position for remote in non-oldskool mode
        setvarvar digy 137 // ? is normal y position for remote in non-oldskool mode
        setvar tilenum 2570
       }
       ifvare TEMPVAR2 7
       {
        setvarvar digx -22 // ? is normal x position for remote in non-oldskool mode
        setvarvar digy 137 // ? is normal y position for remote in non-oldskool mode
        setvar tilenum 2570
       }
       ifvare TEMPVAR2 8
       {
        setvarvar digx -22 // ? is normal x position for remote in non-oldskool mode
        setvarvar digy 137 // ? is normal y position for remote in non-oldskool mode
        setvar tilenum 2570
       }
       ifvare TEMPVAR2 9
       {
        setvarvar digx -22 // ? is normal x position for remote in non-oldskool mode
        setvarvar digy 137 // ? is normal y position for remote in non-oldskool mode
        setvar tilenum 2570
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       state digz65536
       state orientation16
       state rs
      }

      // Shrinker
      ifvare TEMPVAR 6
      {
       // 0 - 2558 [Crystal]
       // 1 - 2560 [Crystal]
       // 2 - 2561 [Crystal]
       // 3 - ? [Crystal] (2560/2562)
       // 4 - 2559 [Crystal]
       // 5 - 2560 [Crystal]
       // 6 - 2561 [Crystal]
       // 7 - ? [Crystal] (2560/2562)
       // 8 - 2559 [Crystal]
       // 9 - 2560 [Crystal]
       // 10 - 2561 [Crystal]
       // 11 - ? [Crystal] (2560/2562)
       getplayer[THISACTOR].kickback_pic TEMPVAR2
       ifvarn tempe 0 setvarvar pal tempe else { ifvare FROZEN? 1 setvar pal 1 else setvar pal 0 }
       ifvarn tempf 0 setvarvar shade tempf else setvar shade 0
 
       state oldskoolgetshake
  
       // Crystal Part
       setvar tilenum 5372
       ifvare TEMPVAR2 0
       {
        state shadepulse3
        setvarvar digx 183 // 183 is normal x position for crystal in non-oldskool mode
        setvarvar digy 160 // 160 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2558
       }
       ifvare TEMPVAR2 1
       {
        setvar shade -31
        setvarvar digx 181 // 181 is normal x position for crystal in non-oldskool mode
        setvarvar digy 157 // 157 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2560
       }
       ifvare TEMPVAR2 2
       {
        setvar shade -31
        setvarvar digx 183 // 183 is normal x position for crystal in non-oldskool mode
        setvarvar digy 155 // 155 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2561
       }
       ifvare TEMPVAR2 3
       {
        setvar shade -31
        setvarvar digx 181 // 181 is normal x position for crystal in non-oldskool mode
        setvarvar digy 157 // 157 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2560
       }
       ifvare TEMPVAR2 4
       {
        setvar shade -31
        setvarvar digx 181 // 181 is normal x position for crystal in non-oldskool mode
        setvarvar digy 153 // 153 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2559
       }
       ifvare TEMPVAR2 5
       {
        setvar shade -31
        setvarvar digx 181 // 181 is normal x position for crystal in non-oldskool mode
        setvarvar digy 157 // 157 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2560
       }
       ifvare TEMPVAR2 6
       {
        setvar shade -31
        setvarvar digx 183 // 183 is normal x position for crystal in non-oldskool mode
        setvarvar digy 155 // 155 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2561
       }
       ifvare TEMPVAR2 7
       {
        setvar shade -31
        setvarvar digx 181 // 181 is normal x position for crystal in non-oldskool mode
        setvarvar digy 157 // 157 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2560
       }
       ifvare TEMPVAR2 8
       {
        setvar shade -31
        setvarvar digx 181 // 181 is normal x position for crystal in non-oldskool mode
        setvarvar digy 153 // 153 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2559
       }
       ifvare TEMPVAR2 9
       {
        setvar shade -31
        setvarvar digx 181 // 181 is normal x position for crystal in non-oldskool mode
        setvarvar digy 157 // 157 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2560
       }
       ifvare TEMPVAR2 10
       {
        setvar shade -31
        setvarvar digx 183 // 183 is normal x position for crystal in non-oldskool mode
        setvarvar digy 155 // 155 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2561
       }
       ifvare TEMPVAR2 11
       {
        setvar shade -31
        setvarvar digx 181 // 181 is normal x position for crystal in non-oldskool mode
        setvarvar digy 157 // 157 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2560
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       addvarvar digx tempb
       addvarvar digy tempc
       state digz65536
       state orientation16
       state rs
       setvar shade 0

       // Gun Part
       setvar tilenum 5372
       ifvare TEMPVAR2 0
       {
        setvarvar digx 151 // 151 is normal x position for gun in non-oldskool mode
        setvarvar digy 151 // 151 is normal y position for gun in non-oldskool mode
        setvar tilenum 2556
       }
       ifvarg TEMPVAR2 0 ifvarl TEMPVAR2 12
       {
        setvarvar digx 151 // 151 is normal x position for gun in non-oldskool mode
        setvarvar digy 151 // 151 is normal y position for gun in non-oldskool mode
        setvar tilenum 2557
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       addvarvar digx tempb
       addvarvar digy tempc
       state digz65536
       state orientation16
       state rs
      }

      // Expander
      ifvare TEMPVAR 11
      {
       // 0 - 2558 [Crystal] (Pal 2)
       // 1 - 2560 [Crystal] (Pal 2)
       // 2 - 2561 [Crystal] (Pal 2)
       // 3 - ? [Crystal] (2560/2562) (Pal 2)
       // 4 - 2559 [Crystal] (Pal 2)
       getplayer[THISACTOR].kickback_pic TEMPVAR2
       ifvarn tempe 0 setvarvar pal tempe else setvar pal 2 

       state oldskoolgetshake
 
       // Crystal Part
       setvar tilenum 5372
       ifvare TEMPVAR2 0
       {
        state shadepulse3
        setvarvar digx 183 // 183 is normal x position for crystal in non-oldskool mode
        setvarvar digy 160 // 160 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2558
       }
       ifvare TEMPVAR2 1
       {
        setvar shade -31
        setvarvar digx 181 // 181 is normal x position for crystal in non-oldskool mode
        setvarvar digy 157 // 157 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2560
       }
       ifvare TEMPVAR2 2
       {
        setvar shade -31
        setvarvar digx 183 // 183 is normal x position for crystal in non-oldskool mode
        setvarvar digy 155 // 155 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2561
       }
       ifvare TEMPVAR2 3
       {
        setvar shade -31
        setvarvar digx 181 // 181 is normal x position for crystal in non-oldskool mode
        setvarvar digy 157 // 157 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2560
       }
       ifvare TEMPVAR2 4
       {
        setvar shade -31
        setvarvar digx 181 // 181 is normal x position for crystal in non-oldskool mode
        setvarvar digy 153 // 153 is normal y position for crystal in non-oldskool mode
        setvar tilenum 2559
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       addvarvar digx tempb
       addvarvar digy tempc
       state digz65536
       state orientation16
       state rs
       setvar shade 0
       ifvarn tempe 0 setvarvar pal tempe else { ifvare FROZEN? 1 setvar pal 1 else setvar pal 0 } // 2
       ifvarn tempf 0 setvarvar shade tempf else setvar shade 0
 
       // Gun Part
       setvar tilenum 5372
       ifvare TEMPVAR2 0
       {
        setvarvar digx 154 // 154 is normal x position for gun in non-oldskool mode
        setvarvar digy 146 // 146 is normal y position for remote in non-oldskool mode
        setvar tilenum 2554
       }
       ifvarg TEMPVAR2 0 ifvarl TEMPVAR2 5
       {
        setvarvar digx 154 // 154 is normal x position for gun in non-oldskool mode
        setvarvar digy 146 // 146 is normal y position for gun in non-oldskool mode
        setvar tilenum 2555
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       addvarvar digx tempb
       addvarvar digy tempc
       state digz65536
       state orientation16
       state rs
      }
    
      // Devastator
      ifvare TEMPVAR 7
      {
       getplayer[THISACTOR].kickback_pic TEMPVAR2
       ifvarn tempe 0 setvarvar pal tempe else { ifvare FROZEN? 1 setvar pal 1 else setvar pal 0 }
       ifvarn tempf 0 setvarvar shade tempf else setvar shade 0
 
       // 0-3 - Normal
       // 4 - Firing
       // [Starts off firing Right, then alternates to Left on next counter, then back]
  
       // Left Barrel
       ifvare TEMPVAR2 0 
       {
        setvarvar digx 127 // 127 is normal x position for left barrel in non-oldskool mode
        setvarvar digy 132 // 132 is normal y position for left barrel in non-oldskool mode
        state orientation20
        setvar diga 1024
        setvar tilenum 2510
       }
       ifvare DEVASTATORBARRELDISPLAY 0
       {
        ifvare TEMPVAR2 1
        {
         setvarvar digx 125 // 125 is normal x position for left barrel in non-oldskool mode
         setvarvar digy 136 // 136 is normal y position for left barrel in non-oldskool mode
         state orientation20
         setvar diga 1024
         setvar tilenum 2510
        }
        ifvare TEMPVAR2 2
        {
         setvarvar digx 121 // 121 is normal x position for left barrel in non-oldskool mode
         setvarvar digy 144 // 144 is normal y position for left barrel in non-oldskool mode
         state orientation20
         setvar diga 1024
         setvar tilenum 2510
        }
        ifvare TEMPVAR2 3
        {
         setvarvar digx 115 // 115 is normal x position for left barrel in non-oldskool mode
         setvarvar digy 156 // 156 is normal y position for left barrel in non-oldskool mode
         state orientation20
         setvar diga 1024
         setvar tilenum 2510
        }
        ifvare TEMPVAR2 4
        {
         setvarvar digx 119 // 119 is normal x position for left barrel in non-oldskool mode
         setvarvar digy 147 // 147 is normal y position for left barrel in non-oldskool mode
         state orientation20
         setvar diga 1024
         setvar tilenum 2511
        }
       }
       else
       {
        setvarvar digx 127 // 127 is normal x position for left barrel in non-oldskool mode
        setvarvar digy 132 // 132 is normal y position for left barrel in non-oldskool mode
        state orientation20
        setvar diga 1024
        setvar tilenum 2510
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       state digz65536
       state rs
  
       // Right Barrel
        ifvare TEMPVAR2 0
       {
        setvarvar digx 195 // 195 is normal x position for left barrel in non-oldskool mode
        setvarvar digy 130 // 130 is normal y position for left barrel in non-oldskool mode
        state orientation16
        setvar diga 0
        setvar tilenum 2510
       }
       ifvare DEVASTATORBARRELDISPLAY 1
       {
        ifvare TEMPVAR2 1
        {
         setvarvar digx 197 // 197 is normal x position for left barrel in non-oldskool mode
         setvarvar digy 134 // 134 is normal y position for left barrel in non-oldskool mode
         state orientation16
         setvar diga 0
         setvar tilenum 2510
        }
        ifvare TEMPVAR2 2
        {
         setvarvar digx 201 // 201 is normal x position for left barrel in non-oldskool mode
         setvarvar digy 142 // 142 is normal y position for left barrel in non-oldskool mode
         state orientation16
         setvar diga 0
         setvar tilenum 2510
        }
        ifvare TEMPVAR2 3
        {
         setvarvar digx 207 // 207 is normal x position for left barrel in non-oldskool mode
         setvarvar digy 154 // 154 is normal y position for left barrel in non-oldskool mode
         state orientation16
         setvar diga 0
         setvar tilenum 2510
        }
        ifvare TEMPVAR2 4
        {
         setvarvar digx 203 // 203 is normal x position for left barrel in non-oldskool mode
         setvarvar digy 145 // 145 is normal y position for left barrel in non-oldskool mode
         state orientation16
         setvar diga 0
         setvar tilenum 2511
        }
       }
       else
       {
        setvarvar digx 195 // 195 is normal x position for left barrel in non-oldskool mode
        setvarvar digy 130 // 130 is normal y position for left barrel in non-oldskool mode
        state orientation16
        setvar diga 0
        setvar tilenum 2510
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       state digz65536
       state orientation16
       state rs
      }

      // Tripbombs
      ifvare TEMPVAR 8
      {
       getplayer[THISACTOR].kickback_pic TEMPVAR2 
       ifvarn tempe 0 setvarvar pal tempe else { ifvare FROZEN? 1 setvar pal 1 else setvar pal 0 }
       ifvarn tempf 0 setvarvar shade tempf else setvar shade 0
 
       // Bomb
       // 0-3 - Holding Bomb
       // 4-6 - Raised Open Hands
       // 7-8 - Lowered Open Hands
       // 9-39 - Empty
       setvar tilenum 5372
       ifvarg TEMPVAR2 -1 ifvarl TEMPVAR2 4
       {
        setvarvar digx 90 // 90 is normal x position for tripbomb in non-oldskool mode
        setvarvar digy 156 // 156 is normal y position for tripbomb in non-oldskool mode
        setvar diga 0
        state orientation16
        setvar tilenum 2566
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       state digz65536
       state rs

       // Left Hand
       setvar tilenum 5372
       setvar diga 0
       state orientation16
       ifvarg TEMPVAR2 -1 ifvarl TEMPVAR2 4
       {
        setvarvar digx -10 // -10 is normal x position for left hand in non-oldskool mode
        setvarvar digy 138 // 138 is normal y position for left hand in non-oldskool mode
        setvar diga 0
        state orientation16
        setvar tilenum 2563
       }
       ifvarg TEMPVAR2 3 ifvarl TEMPVAR2 7
       {
        setvarvar digx -6 // -6 is normal x position for left hand in non-oldskool mode
        setvarvar digy 131 // 131 is normal y position for left hand in non-oldskool mode
        setvar diga 0
        state orientation16
        setvar tilenum 2564
       }
       ifvare TEMPVAR2 7
       {
        setvarvar digx -6 // 3 is normal x position for left hand in non-oldskool mode
        setvarvar digy 187 // 187 is normal y position for left hand in non-oldskool mode
        setvar diga 0
        state orientation16
        setvar tilenum 2564
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       state digz65536
       state rs

       // Right Hand
       setvar tilenum 5372
       setvar diga 1024
       state orientation20
       ifvarg TEMPVAR2 -1 ifvarl TEMPVAR2 4
       {
        setvarvar digx 332 // 153 is normal x position for right hand in non-oldskool mode
        setvarvar digy 138 // 138 is normal y position for right hand in non-oldskool mode
        setvar diga 1024
        state orientation20
        setvar tilenum 2563
       }
       ifvarg TEMPVAR2 3 ifvarl TEMPVAR2 7
       {
        setvarvar digx 328 // 328 is normal x position for right hand in non-oldskool mode
        setvarvar digy 131 // 131 is normal y position for right hand in non-oldskool mode
        setvar diga 1024
        state orientation20
        setvar tilenum 2564
       }
       ifvare TEMPVAR2 7
       {
        setvarvar digx 328 // 328 is normal x position for right hand in non-oldskool mode
        setvarvar digy 187 // 187 is normal y position for right hand in non-oldskool mode
        setvar diga 1024
        state orientation20
        setvar tilenum 2564
       }
       subvar digy 18 // repositions the display above the status bar
       state oldskoolweaponposchange
       state oldskoolweaponbob
       state oldskoolturningpositions
       state digz65536
       state rs
      }

      // Freezethrower
      ifvare TEMPVAR 9
      {
       getplayer[THISACTOR].kickback_pic TEMPVAR2 
       ifvarn tempe 0 setvarvar pal tempe else { ifvare FROZEN? 1 setvar pal 1 else setvar pal 0 }
       ifvarn tempf 0 setvarvar shade tempf else setvar shade 0
  
       state oldskoolgetshake
 
       // 0 - Idle ([2548])
       // 1 - Shooting 1 (2551 [Top], 2550 [Bottom])
       // 2-3 - Shooting 2 (2552 [Top], 2550 [Bottom])
       // 4-5 - Shooting 3 (2553 [Top], 2550 [Bottom])
       // 6-7 - Shooting 1 (2551 [Top], 2550 [Bottom])
 
       // Bottom Part [1-7]
       setvar tilenum 5372
       ifvarg TEMPVAR2 0
       {
        setvarvar digx 58 // ~58 is normal x position for freezethrower [bottom] in non-oldskool mode
        setvarvar digy 155 // ~155 is normal y position for freezethrower [bottom] in non-oldskool mode
        setvar tilenum 2550
        subvar digy 18 // repositions the display above the status bar
        state oldskoolweaponposchange
        state oldskoolweaponbob
        state oldskoolturningpositions
        addvarvar digx tempb
        addvarvar digy tempc
        state orientation16
        state digz65536
        state rs
       }
  
       // Top Parts [1-7]
       ifvarg TEMPVAR2 0
       {
        setvar tilenum 5372
        ifvare TEMPVAR2 1
        {
         setvarvar digx 127 // ~127 is normal x position for freezethrower [top] in non-oldskool mode
         setvarvar digy 137 // ~137 is normal y position for freezethrower [top] in non-oldskool mode
         setvar tilenum 2551
        }
        ifvarg TEMPVAR2 1 ifvarl TEMPVAR2 4
        {
         setvarvar digx 127 // ~127 is normal x position for freezethrower [top] in non-oldskool mode
         setvarvar digy 144 // ~144 is normal y position for freezethrower [top] in non-oldskool mode
         setvar tilenum 2552
        }
        ifvarg TEMPVAR2 3 ifvarl TEMPVAR2 6
        {
         setvarvar digx 127 // ~127 is normal x position for freezethrower [top] in non-oldskool mode
         setvarvar digy 140 // ~140 is normal y position for freezethrower [top] in non-oldskool mode
         setvar tilenum 2553
        }
        ifvarg TEMPVAR2 5 ifvarl TEMPVAR2 8
        {
         setvarvar digx 127 // ~127 is normal x position for freezethrower [top] in non-oldskool mode
         setvarvar digy 137 // ~144 is normal y position for freezethrower [top] in non-oldskool mode
         setvar tilenum 2551
        }
        subvar digy 18 // repositions the display above the status bar
        state oldskoolweaponposchange
        state oldskoolweaponbob
        state oldskoolturningpositions
        addvarvar digx tempb
        addvarvar digy tempc
        state orientation16
        state digz65536
        state rs
       }
 
       // Idle Frame [0]
       ifvare TEMPVAR2 0
       {
        setvarvar digx 151 // 151 is normal x position for freezethrower [full] in non-oldskool mode
        setvarvar digy 143 // 143 is normal y position for freezethrower [full] in non-oldskool mode
        setvar tilenum 2548
        subvar digy 18 // repositions the display above the status bar
        state oldskoolweaponposchange
        state oldskoolweaponbob
        state oldskoolturningpositions
        state orientation16
        state digz65536
        state rs
       }
      }
     }
    }

   } // Not cracking Knuckles

  } // Not Using a Keycard on a Keyscanner
 } // Not Alive

  state pal0
  setvar shade 0
  setvar diga 0
  // The Main Status Bar
  setvar digx 0
  setvar digy 166
  state digz65536
  setvar tilenum 2462
  state orientation16
  state rs

  // Health Display [in % format akin to classic Duke3D]
  state calchppercentage
  setvar digx 32
  setvar digy 183
  setvar tilenum 2472
  setvarvar varname HPPERCENTAGE
  state dn

  // Armor Display [in % format akin to classic Duke3D]
  state calcappercentage
  setvar digx 64
  setvar digy 183
  setvar tilenum 2472
  setvarvar varname APPERCENTAGE
  state dn

  // Weapons/Ammo Display
  state pal7
  state setquote332
  setvar digx 89
  setvar digy 178
  ifvare CURRENTWEAPON 1 state shade-31 else state shade0
  redefinequote 332 2
  state mt
  setvar digy 184
  ifvare CURRENTWEAPON 2 state shade-31 else state shade0
  redefinequote 332 3
  state mt
  setvar digy 190
  ifvare CURRENTWEAPON 3 state shade-31 else state shade0
  redefinequote 332 4
  state mt
  setvar digx 128
  setvar digy 178
  ifvare CURRENTWEAPON 4 state shade-31 else state shade0
  redefinequote 332 5
  state mt
  setvar digy 184
  ifvare CURRENTWEAPON 5 state shade-31 else state shade0
  redefinequote 332 6
  state mt
  setvar digy 190
  ifvare CURRENTWEAPON 6 state shade-31 else { ifvare CURRENTWEAPON 11 state shade-31 else state shade0 }
  redefinequote 332 7
  state mt
  setvar digx 159
  setvar digy 178
  ifvare CURRENTWEAPON 7 state shade-31 else state shade0
  redefinequote 332 8
  state mt
  setvar digy 184
  ifvare CURRENTWEAPON 8 state shade-31 else state shade0
  redefinequote 332 9
  state mt
  setvar digy 190
  ifvare CURRENTWEAPON 9 state shade-31 else state shade0
  redefinequote 332 0
  state mt
  state pal6
  state shade15
  redefinequote 332 :
  setvar digx 93
  setvar digy 178
  ifvare CURRENTWEAPON 1 state shade-31 else state shade15
  state mt
  setvar digy 184
  ifvare CURRENTWEAPON 2 state shade-31 else state shade15
  state mt
  setvar digy 190
  ifvare CURRENTWEAPON 3 state shade-31 else state shade15
  state mt
  setvar digx 132
  setvar digy 178
  ifvare CURRENTWEAPON 4 state shade-31 else state shade15
  state mt
  setvar digy 184
  ifvare CURRENTWEAPON 5 state shade-31 else { ifvare CURRENTWEAPON 10 state shade-31 else state shade15 }
  state mt
  setvar digy 190
  ifvare CURRENTWEAPON 6 state shade-31 else { ifvare CURRENTWEAPON 11 state shade-31 else state shade15 }
  state mt
  setvar digx 163
  setvar digy 178
  ifvare CURRENTWEAPON 7 state shade-31 else state shade15
  state mt
  setvar digy 184
  ifvare CURRENTWEAPON 8 state shade-31 else state shade15
  state mt
  setvar digy 190
  ifvare CURRENTWEAPON 9 state shade-31 else state shade15
  state mt
  redefinequote 332 /
  setvar digx 108
  setvar digy 178
  ifvare CURRENTWEAPON 1 state shade-31 else state shade15
  state mt
  setvar digy 184
  ifvare CURRENTWEAPON 2 state shade-31 else state shade15
  state mt
  setvar digy 190
  ifvare CURRENTWEAPON 3 state shade-31 else state shade15
  state mt
  setvar digx 143
  setvar digy 178
  ifvare CURRENTWEAPON 4 state shade-31 else state shade15
  state mt
  setvar digy 184
  ifvare CURRENTWEAPON 5 state shade-31 else { ifvare CURRENTWEAPON 10 state shade-31 else state shade15 }
  state mt
  setvar digy 190
  ifvare CURRENTWEAPON 6 state shade-31 else { ifvare CURRENTWEAPON 11 state shade-31 else state shade15 }
  state mt
  setvar digx 174
  setvar digy 178
  ifvare CURRENTWEAPON 7 state shade-31 else state shade15
  state mt
  setvar digy 184
  ifvare CURRENTWEAPON 8 state shade-31 else state shade15
  state mt
  setvar digy 190
  ifvare CURRENTWEAPON 9 state shade-31 else state shade15
  state mt

  setvar tilenum 3087

  setvar digy 178
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERAMMO2 TEMPVAR
  ifvarg TEMPVAR 999 setvar TEMPVAR 999 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 99 setvar digx 102 else ifvarg TEMPVAR 9 ifvarl TEMPVAR 100 setvar digx 104 else setvar digx 106
  ifvare CURRENTWEAPON 1 state shade-31 else state shade15
  setvarvar varname TEMPVAR
  state dn

  setvar digy 184
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERAMMO3 TEMPVAR
  ifvarg TEMPVAR 999 setvar TEMPVAR 999 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 99 setvar digx 102 else ifvarg TEMPVAR 9 ifvarl TEMPVAR 100 setvar digx 104 else setvar digx 106
  ifvare CURRENTWEAPON 2 state shade-31 else state shade15
  setvarvar varname TEMPVAR
  state dn

  setvar digy 190
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERAMMO4 TEMPVAR
  ifvarg TEMPVAR 999 setvar TEMPVAR 999 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 99 setvar digx 102 else ifvarg TEMPVAR 9 ifvarl TEMPVAR 100 setvar digx 104 else setvar digx 106
  ifvare CURRENTWEAPON 3 state shade-31 else state shade15
  setvarvar varname TEMPVAR
  state dn

  setvar digy 178
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERAMMO5 TEMPVAR
  ifvarg TEMPVAR 99 setvar TEMPVAR 99 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 9 setvar digx 139 else setvar digx 141
  ifvare CURRENTWEAPON 4 state shade-31 else state shade15
  setvarvar varname TEMPVAR
  state dn

  setvar digy 184
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERAMMO6 TEMPVAR
  ifvarg TEMPVAR 99 setvar TEMPVAR 99 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 9 setvar digx 139 else setvar digx 141
  ifvare CURRENTWEAPON 5 state shade-31 else { ifvare CURRENTWEAPON 10 state shade-31 else state shade15 }
  setvarvar varname TEMPVAR
  state dn

  setvar digy 190
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERAMMO7 TEMPVAR
  ifvarg TEMPVAR 99 setvar TEMPVAR 99 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 9 setvar digx 139 else setvar digx 141
  ifvare CURRENTWEAPON 6 state shade-31 else { ifvare CURRENTWEAPON 11 state shade-31 else state shade15 }
  setvarvar varname TEMPVAR
  state dn

  setvar digy 178
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERAMMO8 TEMPVAR
  ifvarg TEMPVAR 99 setvar TEMPVAR 99 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 9 setvar digx 170 else setvar digx 172
  ifvare CURRENTWEAPON 7 state shade-31 else state shade15
  setvarvar varname TEMPVAR
  state dn

  setvar digy 184
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERAMMO9 TEMPVAR
  ifvarg TEMPVAR 99 setvar TEMPVAR 99 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 9 setvar digx 170 else setvar digx 172
  ifvare CURRENTWEAPON 8 state shade-31 else state shade15
  setvarvar varname TEMPVAR
  state dn

  setvar digy 190
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERAMMO10 TEMPVAR
  ifvarg TEMPVAR 99 setvar TEMPVAR 99 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 9 setvar digx 170 else setvar digx 172
  ifvare CURRENTWEAPON 9 state shade-31 else state shade15
  setvarvar varname TEMPVAR
  state dn


  setvar digy 178
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERMAXAMMO2 TEMPVAR
  ifvarg TEMPVAR 999 setvar TEMPVAR 999 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 99 setvar digx 118 else ifvarg TEMPVAR 9 ifvarl TEMPVAR 100 setvar digx 116 else setvar digx 114
  ifvare CURRENTWEAPON 1 state shade-31 else state shade15
  setvarvar varname TEMPVAR
  state dn

  setvar digy 184
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERMAXAMMO3 TEMPVAR
  ifvarg TEMPVAR 999 setvar TEMPVAR 999 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 99 setvar digx 118 else ifvarg TEMPVAR 9 ifvarl TEMPVAR 100 setvar digx 116 else setvar digx 114
  ifvare CURRENTWEAPON 2 state shade-31 else state shade15
  setvarvar varname TEMPVAR
  state dn

  setvar digy 190
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERMAXAMMO4 TEMPVAR
  ifvarg TEMPVAR 999 setvar TEMPVAR 999 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 99 setvar digx 118 else ifvarg TEMPVAR 9 ifvarl TEMPVAR 100 setvar digx 116 else setvar digx 114
  ifvare CURRENTWEAPON 3 state shade-31 else state shade15
  setvarvar varname TEMPVAR
  state dn

  setvar digy 178
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERMAXAMMO5 TEMPVAR
  ifvarg TEMPVAR 99 setvar TEMPVAR 99 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 9 setvar digx 151 else setvar digx 149
  ifvare CURRENTWEAPON 4 state shade-31 else state shade15
  setvarvar varname TEMPVAR
  state dn

  setvar digy 184
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERMAXAMMO6 TEMPVAR
  ifvarg TEMPVAR 99 setvar TEMPVAR 99 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 9 setvar digx 151 else setvar digx 149
  ifvare CURRENTWEAPON 5 state shade-31 else { ifvare CURRENTWEAPON 10 state shade-31 else state shade15 }
  setvarvar varname TEMPVAR
  state dn

  setvar digy 190
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERMAXAMMO7 TEMPVAR
  ifvarg TEMPVAR 99 setvar TEMPVAR 99 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 9 setvar digx 151 else setvar digx 149
  ifvare CURRENTWEAPON 6 state shade-31 else { ifvare CURRENTWEAPON 11 state shade-31 else state shade15 }
  setvarvar varname TEMPVAR
  state dn

  setvar digy 178
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERMAXAMMO8 TEMPVAR
  ifvarg TEMPVAR 99 setvar TEMPVAR 99 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 9 setvar digx 182 else setvar digx 180
  ifvare CURRENTWEAPON 7 state shade-31 else state shade15
  setvarvar varname TEMPVAR
  state dn

  setvar digy 184
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERMAXAMMO9 TEMPVAR
  ifvarg TEMPVAR 99 setvar TEMPVAR 99 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 9 setvar digx 182 else setvar digx 180
  ifvare CURRENTWEAPON 8 state shade-31 else state shade15
  setvarvar varname TEMPVAR
  state dn

  setvar digy 190
  setvarvar CHARACTERARRAY CHARACTERSELECTED?
  getactorvar[CHARACTERARRAY].CHARACTERMAXAMMO10 TEMPVAR
  ifvarg TEMPVAR 99 setvar TEMPVAR 99 else setvarvar TEMPVAR TEMPVAR
  ifvarg TEMPVAR 9 setvar digx 182 else setvar digx 180
  ifvare CURRENTWEAPON 9 state shade-31 else state shade15
  setvarvar varname TEMPVAR
  state dn
  

  // Ammo Display
  state pal0
  state shade0
  setvar digx 208
  setvar digy 183
  setvar tilenum 2472
  setvarvar varname CURRENTAMMOA
  state dn

  getplayer[THISACTOR].inven_icon TEMPVAR2
  // Inventory Display
  ifvare TEMPVAR2 0 // N/A
  {
   setvar TEMPVAR3 2 // none
   setvar digx 0
   setvar digy 0
   setvar tilenum 2459
   state rs
  }
  ifvare TEMPVAR2 1 // Medkit
  {
   setvar TEMPVAR3 2 // none
   setvar digx 231
   setvar digy 179
   setvar tilenum 2460
   state rs
   setvar TEMPVAR4 0
   setvarvar varname FIRSTAIDCURRENT
   mulvar varname 100
   ifvarn MAXHITPOINTS 0 divvarvar varname MAXHITPOINTS
  }
  ifvare TEMPVAR2 2 // Steroids
  {
   setvar TEMPVAR3 2 // none
   setvar digx 232
   setvar digy 179
   setvar tilenum 2469
   state rs
   setvar TEMPVAR4 0
   setvarvar varname STEROIDSTIME
   divvar varname 4
  }
  ifvare TEMPVAR2 3 // Holoform
  {
   setvar TEMPVAR3 0 // On/Off
   setvar digx 232
   setvar digy 179
   setvar tilenum 2470
   state rs
   getplayer[THISACTOR].holoduke_on TEMPVAR4
   getplayer[THISACTOR].holoduke_amount varname
   divvar varname 24
  }
  ifvare TEMPVAR2 4 // Jetpack
  {
   setvar TEMPVAR3 0 // On/Off
   setvar digx 231
   setvar digy 179
   setvar tilenum 2467
   state rs
   getplayer[THISACTOR].jetpack_on TEMPVAR4
   getplayer[THISACTOR].jetpack_amount varname
   divvar varname 16
  }
  ifvare TEMPVAR2 5 // NV Goggles
  {
   setvar TEMPVAR3 0 // On/Off
   setvar digx 232
   setvar digy 180
   setvar tilenum 2461
   state rs
   getplayer[THISACTOR].heat_on TEMPVAR4
   getplayer[THISACTOR].heat_amount varname
   divvar varname 12
  }
  ifvare TEMPVAR2 6 // Scuba Gear
  {
   setvar TEMPVAR3 1 // Auto
   setvar digx 232
   setvar digy 178
   setvar tilenum 2468
   state rs
   setvar TEMPVAR4 0
   setvarvar varname SCUBATIME // getplayer[THISACTOR].scuba_amount varname
   divvar varname 64
  }
  ifvare TEMPVAR2 7 // Boots
  {
   setvar TEMPVAR3 1 // Auto
   setvar digx 232
   setvar digy 179
   setvar tilenum 2463
   state rs
   setvar TEMPVAR4 0
   getplayer[THISACTOR].boot_amount varname
   divvar varname 2
  }

   setvar tilenum 3087
   state pal6
   state orientation0
   // Percentage
   setvar shade -15
   ifvarg varname 99 setvar digx 257 else ifvarg varname 9 ifvarl varname 100 setvar digx 259 else setvar digx 261 
   ifvare TEMPVAR2 0
   {
    setvar digx 640
    setvar digy 400
   }
   else
   {
    setvar digy 192
   }
    state dn
    // % Sign
   state orientation16
   state shade-31
   redefinequote 332 %
   ifvare TEMPVAR2 0
   {
    setvar digx 640
    setvar digy 400
   }
   else
   {
    setvar digx 262
    setvar digy 190
   }
   state mt
   // Type
   ifvare TEMPVAR3 0 // ON/OFF
   { 
    ifvare TEMPVAR4 -1 // off
    {
     state pal21
     setvar digx 254
     setvar digy 180
     redefinequote 332 OFF
    }
    else // ON
    ifvare TEMPVAR4 0 // off
    {
     state pal21
     setvar digx 254
     setvar digy 180
     redefinequote 332 OFF
    }
    else // ON
    {
     state pal0
     setvar digx 258
     setvar digy 180
     redefinequote 332 ON
    }
   }
   ifvare TEMPVAR3 1 // AUTO
   { 
    state pal21
    setvar digx 250
    setvar digy 180
    redefinequote 332 AUTO
   }
   ifvare TEMPVAR3 2 // (none)
   {
    setvar digx 640
    setvar digy 400
   }
   state mt

  // Keys Display
  setvar tilenum 2471
  ifvarand ACCESSCARDS? 1
  {
   state pal0
   setvar digx 281
   setvar digy 189
   state rs
  }
  ifvarand ACCESSCARDS? 2
  {
   state pal21
   setvar digx 288
   setvar digy 182
   state rs
  }
  ifvarand ACCESSCARDS? 4
  {
   state pal23
   setvar digx 275
   setvar digy 182
   state rs
  }

} // ifvare oldskoolmode 1

//********************************
//*Dialouge/Conversation Displays*
//********************************
state shade0
state dialouge-mainsystem

//********************
//*Game Over Displays*
//********************
state shade0

ifvarg gameover? -1
{
 ifvarg gameovertransitiontimer 13
 {
  ifvare gameovertransitiontimer 14 setvar digz 4096
  ifvare gameovertransitiontimer 15 setvar digz 8192
  ifvare gameovertransitiontimer 16 setvar digz 12288
  ifvare gameovertransitiontimer 17 setvar digz 16384
  ifvare gameovertransitiontimer 18 setvar digz 20480
  ifvare gameovertransitiontimer 19 setvar digz 24576
  ifvare gameovertransitiontimer 19 setvar digz 28672
  ifvare gameovertransitiontimer 20 setvar digz 32768
  ifvare gameovertransitiontimer 21 setvar digz 36884
  ifvare gameovertransitiontimer 22 setvar digz 40960
  ifvare gameovertransitiontimer 23 setvar digz 45056
  ifvare gameovertransitiontimer 24 setvar digz 49152
  ifvare gameovertransitiontimer 25 setvar digz 53248
  ifvare gameovertransitiontimer 26 setvar digz 57344
  ifvare gameovertransitiontimer 27 setvar digz 61440
  ifvarg gameovertransitiontimer 27 setvar digz 65536

  state pal0
  state digx160
  setvar digy 100
  state orientation35
  ifvare gameoverscreen 0 setvar tilenum 1848
  else ifvare gameoverscreen 1 setvar tilenum 2081
  else setvar tilenum 3379 // 8191 // For the background >.> (2456 or 8191)
  state rs
 }
}
									}

  state show_secondaryquotemethod
endevent