


include DEFS.CON
include OLDCODE.CON
include USER.CON


setgamename Mask Reveals Disgusting Face

definecheat 0 bb
definecheat 1 dd
definecheat 2 cc
definecheat 4 dhtyuuioeo;kljs
definecheat 6 hdfyuyqpppcbb,skju
definecheat 8 srigskjhfgeyiiiii
definecheat 10 bnvsarewq446tf7]
definecheat 13 leugddq;dkjhv
definecheat 17 p]gskfjrytw76ewju
definecheat 18 t55kfghtgghd
definecheat 19 hguq4wwjgydoi
definecheat 20 ]aldjueysjjhfgftr
definecheat 21 aa
definecheat 22 nm,.lkahg][[0
definecheat 23 bn,jfspqt,nshm 
definecheat 7 dkshfl;agfnyu


definegamefuncname 6 action
definegamefuncname 34 quit

/*
definegamefuncname 49 -
definegamefuncname 32 -
definegamefuncname 5 -
definegamefuncname 7 -
definegamefuncname 11 -
definegamefuncname 12 -
definegamefuncname 13 -
definegamefuncname 14 -
definegamefuncname 19 1
definegamefuncname 20 2
definegamefuncname 21 3
definegamefuncname 22 4
definegamefuncname 23 5
definegamefuncname 24 6
definegamefuncname 25 7
definegamefuncname 26 8
definegamefuncname 27 9
definegamefuncname 28 0
definegamefuncname 29 -
definegamefuncname 30 -
definegamefuncname 31 -
definegamefuncname 33 -
definegamefuncname 35 -
definegamefuncname 37 -
definegamefuncname 38 -
definegamefuncname 39 -
definegamefuncname 40 -
definegamefuncname 41 -
definegamefuncname 42 -
definegamefuncname 43 -
definegamefuncname 44 -
definegamefuncname 45 -
definegamefuncname 46 -
definegamefuncname 47 -
definegamefuncname 48 -
definegamefuncname 50 -
definegamefuncname 51 -
definegamefuncname 53 -
*/


state stepstate
ifvarg RUNNING 0 { ifactioncount 13  { ifrnd 64 sound STEPSOUND1 else ifrnd 128 sound STEPSOUND2 else ifrnd 192 sound STEPSOUND3 else sound STEPSOUND4 resetactioncount } }
else
{ ifactioncount 16 { ifrnd 64 sound STEPSOUND1 else ifrnd 128 sound STEPSOUND2 else ifrnd 192 sound STEPSOUND3 else sound STEPSOUND4 resetactioncount } }
ends

action PGROWING   0
action PSTAND     0  0  0  0  0
action PEXPLODE    0  0  0  0  0
action PEXPLODEAD    0  0  0  0  0
action PJPHOUVER   0  0  0  0  0
action PWALK     0  0  0  0  0
action PRUN     0  0  0  0  0
action PWALKBACK   0  0  0  0  0
action PRUNBACK    0  0  0  0  0
action PJUMPING    0  0  0  0  0
action PFALLING    0  0  0  0  0
action PDUCKING    0  0  0  0  0
action PCRAWLING   0  0  0  0  0
action PAKICKING   0  0  0  0  0
action PFLINTCHING   0  0  0  0  0
action PTHROWNBACK   0  0  0  0  0
action PFROZEN      0  0  0  0  0
action PLYINGDEAD    0  0  0  0  0

action PSWIMMINGGO    0  0  0  0  0
action PSWIMMING    0  0  0  0  0
action PSWIMMINGWAIT  0  0  0  0  0
action PTREDWATER   0  0  0  0  0

move PSTOPED
move PSHRINKING

state check_pstandard
  ifp pwalking
    action PWALK
  else
    ifp pkicking
      action PAKICKING
  else
    ifp pwalkingback
      action PWALKBACK
  else
    ifp prunning
      action PRUN
  else
    ifp prunningback
      action PRUNBACK
  else
    ifp pjumping
      action PJUMPING
  else
    ifp pducking
      action PDUCKING
ends




move PGROWINGPOP       

actor APLAYER MAXPLAYERHEALTH PSTAND 0 0
//ifhitspace setplayer[THISACTOR].jetpack_on 1 else
//setplayer[THISACTOR].jetpack_on 0 

ifvarg CUTSCENESHADE1_VAR 0 subvar CUTSCENESHADE1_VAR 1
ifvarg CUTSCENESHADE2_VAR 0 subvar CUTSCENESHADE2_VAR 1

ifvare SHOOT_VAR 1 { shoot SHOTSPARK1 setvar SHOOT_VAR 0 }

ifvare MOVEME_VAR 1 {
espawn MOVEME2
getactor[THISACTOR].z z
subvar z 6000
setactor[RETURN].z z
}

ifvare STOPPLAYER 1 setplayer[THISACTOR].movement_lock 15 else setplayer[THISACTOR].movement_lock 0

//ifvare SPAWN_MENU 1 { spawn GAME_SPRITE setvar SPAWN_MENU 0 }

ifvarg SPAWN_MENU 0 subvar SPAWN_MENU 1

getuserdef[THISACTOR].esc_key ESC_VAR
ifvare SPAWN_MENU 0 ifvare MENU_ON 0 ifvare NOMENU_VAR 0 ifvare STOPPLAYER 0 ifvare ESC_VAR 1 { spawn GAME_SPRITE globalsound FLASHLIGHTSOUND setvar SPAWN_MENU 1 setvar STOPPLAYER 1 } 

ifvare NOMENU_VAR 1 { setvar MENU_ON 0 setvar MENU_SCREEN 0 }



ifvarg RUNNING 0 { 
setplayer[THISACTOR].runspeed 42000
subvar RUNNING 1 }
else setplayer[THISACTOR].runspeed 37000

ifvarg knockback 0
{
subvar knockback 1
cos XVELVAR knockbackang
sin YVELVAR knockbackang
mulvar XVELVAR 352
mulvar YVELVAR 352
setplayer[THISACTOR].poszv 1536
setplayer[THISACTOR].posxv XVELVAR
setplayer[THISACTOR].posyv YVELVAR
}

//ifhitspace { ifrnd 128 setgamepalette 4 else setgamepalette 0 }



ifvare PRESS_VAR 1 ifhitspace { } else setvar PRESS_VAR 0

ifonwater { } else {
getplayer[THISACTOR].jumping_counter jump_temp
ifvare jump_temp 721 
{
	setplayer[THISACTOR].jumping_counter 0 
}
}



//setplayer[THISACTOR].horiz 100
//setplayer[THISACTOR].movement_lock 15
//tip

setplayer[THISACTOR].falling_counter 0
setuserdef[THISACTOR].clipping 0
setplayer[THISACTOR].knuckle_incs 0
setplayer[THISACTOR].over_shoulder_on 0



  ifaction 0
    action PSTAND

  ifaction PFROZEN
  {
    cstat 257

    fall

    palfrom 16 0 0 24

    ifmove 0
    {
      ifhitweapon
      {
        ifwasweapon FREEZEBLAST
          break
        lotsofglass 60
        ifrnd 84
          spawn BLOODPOOL

        sound GLASS_BREAKING
        spawn ATOMICHEALTH

        getlastpal

        move 1
        break
      }
    }
    else
    {
      cstat 32768
      quote 13
      ifhitspace
      {
        action PSTAND
        resetplayer
      }
      break
    }

    ifactioncount THAWTIME
    {
      getlastpal
      strength 1
      move 0
      action PSTAND
    }
    else
      ifactioncount FROZENDRIPTIME
    {
      ifrnd 32
      spawn WATERDRIP
    }

    ifp pfacing   // assumes another other player  (multiplayer)
      ifpdistl FROZENQUICKKICKDIST
        pkick

    break
  }

  ifdead
  {
    ifaction PGROWING
    {
      ifmove PGROWINGPOP
      {
        quote 13
        ifhitspace
        {
          action 0
          resetplayer
        }
        break
      }
      else
      {
        ifcount 32
        {
          sound SQUISHED
          palfrom 48 64

          state standard_pjibs

          guts JIBS4 20
          guts JIBS6 20
          move PGROWINGPOP
          cstat 32768
          tossweapon

          hitradius 2048 60 70 80 90

        }
        else
          sizeto MAXXSTRETCH MAXYSTRETCH
      }
      break
    }

    ifsquished
      palfrom 32 63 63 63
    else
      fall

    ifactioncount 7
      move 0
    else
      ifactioncount 6
    {
      ifmultiplayer nullop
      else
      {
        ifrnd 32
          sound DUKE_KILLED5
        else
          ifrnd 32
            sound DUKE_KILLED3
        else
          ifrnd 32
            sound DUKE_KILLED1
        else
          ifrnd 32
            sound DUKE_KILLED2
      }
    }

    ifaction PLYINGDEAD
    {
      ifactioncount 3
        move PSTOPED
      quote 13
      ifhitspace
      {
        action PSTAND
        spawn DUKELYINGDEAD
        resetplayer
      }
      break
    }

    ifaction PTHROWNBACK
    {
      ifactioncount 5
      {
        spawn BLOODPOOL
        action PLYINGDEAD
      }
      else
        ifactioncount 1
          move 0
      break
    }

    ifaction PEXPLODEAD
    {
      quote 13
      ifhitspace
      {
        resetplayer
        action PSTAND
      }
      break
    }
    ifaction PEXPLODE
    {
      ifactioncount 5
      {
        action PEXPLODEAD
        spawn BLOODPOOL
      }
      break
    }

    ifp pshrunk
    {
      state standard_pjibs
      spawn BLOODPOOL

      sound SQUISHED
      sound DUKE_DEAD

      cstat 32768         // Hide the sprite

      action PLYINGDEAD
    }
    else
    {
      ifinwater
      {
        action PLYINGDEAD
        spawn WATERBUBBLE
        spawn WATERBUBBLE
      }
      else
      {
        action PEXPLODE
        state standard_pjibs
        cstat 32768
        sound SQUISHED
        sound DUKE_DEAD
      }
    }

    tossweapon

    break
  }

  ifsquished
  {
    strength -1
    sound SQUISHED
    state random_ooz
    break
  }

  ifp ponsteroids
  {
    ifp pstanding nullop
    else
      spawn FRAMEEFFECT1
  }

  ifmove PSHRINKING
  {
    ifcount 32
    {
      ifcount SHRUNKDONECOUNT
      {
        move 0
        cstat 257
      }
      else
        ifcount SHRUNKCOUNT
      {
        sizeto 42 36
        ifgapzl 24
        {
          strength 0
          sound SQUISHED
          palfrom 48 64
          break
        }
      }
      else
        ifp ponsteroids
          count SHRUNKCOUNT
    }
    else
    {
      ifp ponsteroids
        count SHRUNKCOUNT
      else
      {
        sizeto 8 9
        spawn FRAMEEFFECT1
      }
    }
  }
  else ifhitweapon
  {
    ifdead
    {
      ifmultiplayer
        sound DUKE_KILLED4

      ifwasweapon GROWSPARK
      {
        palfrom 48 48
        action PGROWING
        count 0
        move 0
        sound ACTOR_GROWING
        cstat 0
        break
      }
    }
    else
    {
      ifmultiplayer
      {
        ifphealthl YELLHURTSOUNDSTRENGTHMP
        {
          ifrnd 64
            sound DUKE_LONGTERM_PAIN2
          else
            ifrnd 64
              sound DUKE_LONGTERM_PAIN3
          else
            ifrnd 64
              sound DUKE_LONGTERM_PAIN4
          else
            sound DUKE_DEAD
        }
        else
        {
          ifrnd 64
            sound DUKE_LONGTERM_PAIN5
          else ifrnd 64
            sound DUKE_LONGTERM_PAIN6
          else ifrnd 64
            sound DUKE_LONGTERM_PAIN7
          else
            sound DUKE_LONGTERM_PAIN8
        }
      }
      else
      {
        ifphealthl YELLHURTSOUNDSTRENGTH
        {
          ifrnd 74
            sound DUKE_LONGTERM_PAIN2
          else
            ifrnd 8
              sound DUKE_LONGTERM_PAIN3
          else
            sound DUKE_LONGTERM_PAIN4
        }
        ifrnd 128
          sound DUKE_LONGTERM_PAIN
      }
    }
    ifstrength TOUGH
    {
      state headhitstate
      sound DUKE_GRUNT
      ifp pstanding
        action PFLINTCHING
    }

    ifwasweapon RPG
    {
      ifrnd 32
        spawn BLOOD
      ifdead
        state standard_pjibs
      palfrom 48 52
      break
    }
    ifwasweapon RADIUSEXPLOSION
    {
      ifrnd 32
        spawn BLOOD
      ifdead
        state standard_pjibs
      palfrom 48 52
      break
    }
    ifwasweapon FIREEXT
    {
      ifrnd 32
        spawn BLOOD
      ifdead
        state standard_pjibs
      palfrom 48 52
      break
    }
    ifwasweapon GROWSPARK
    {
      palfrom 48 52
      sound EXPANDERHIT
      break
    }
    ifwasweapon SHRINKSPARK
    {
      palfrom 48 0 48
      move PSHRINKING // used as a var only.
      sound ACTOR_SHRINKING
      cstat 0
      break
    }
    ifwasweapon SHOTSPARK1
      palfrom 24 48
    ifwasweapon FREEZEBLAST
    {
      palfrom 48 0 0 48
      ifdead
      {
        sound SOMETHINGFROZE
        spritepal 1
        move 0
        action PFROZEN
        break
      }
    }
    ifwasweapon COOLEXPLOSION1
      palfrom 48 48 0 48
    ifwasweapon KNEE
      palfrom 16 32
    ifwasweapon FIRELASER
      palfrom 32 32

    ifdead
    {
      action PTHROWNBACK
      tossweapon
    }

    state random_wall_jibs

    break
  }

  ifaction PFLINTCHING
  {
    ifactioncount 2
      action PSTAND
    break
  }

  ifinwater
  {
    ifaction PTREDWATER
    {
      ifp pwalking prunning
        action PSWIMMINGGO
    }
    else
      ifp pstanding pwalkingback prunningback
        action PTREDWATER
    else
    {
      ifaction PSWIMMING
      {
        ifrnd 4
          spawn WATERBUBBLE
        ifactioncount 4
          action PSWIMMINGWAIT
      }
      else
        ifaction PSWIMMINGWAIT
      {
        ifactioncount 2
          action PSWIMMINGGO
      }
      else
        ifaction PSWIMMINGGO
      {
        ifactioncount 2
          action PSWIMMING
      }
      else
        action PTREDWATER
    }

    ifrnd 4
      spawn WATERBUBBLE // For effect

    break
  }
  else ifp pjetpack
  {
    ifaction PJPHOUVER
    {
      ifactioncount 4
        resetactioncount
    }
    else
      action PJPHOUVER
    break
  }
  else
  {
    ifaction PTREDWATER
      action PSTAND
    ifaction PSWIMMING
      action PSTAND
    ifaction PSWIMMINGWAIT
      action PSTAND
    ifaction PSWIMMINGGO
      action PSTAND
    ifaction PJPHOUVER
      action PFALLING
  }

  ifaction PFALLING
  {
    ifp ponground
      action PSTAND
    else
    {
      ifp pfalling
        break
      else
        state check_pstandard
    }
  }

  ifaction PDUCKING
  {
    ifgapzl 48
    {
      ifp pwalking pwalkingback prunning prunningback
        action PCRAWLING
    }
    else ifp pducking
    {
      ifp pwalking pwalkingback prunning prunningback
        action PCRAWLING
    }
    else
    {
      ifp pstanding
        action PSTAND
      else
        state check_pstandard
    }
  }

  else ifaction PCRAWLING
  {
    ifgapzl 48
    {
      ifp pstanding
        action PCRAWLING
    }
    else
      ifp pducking
    {
      ifp pstanding
        action PDUCKING
    }
    else
    {
      ifp pstanding
        action PSTAND
      else
        state check_pstandard
    }
  }
  else
    ifgapzl 48
      action PDUCKING

  else
    ifaction PJUMPING
  {
    ifp ponground
      action PSTAND
    else
      ifactioncount 4
        ifp pfalling
          action PFALLING
  }

  ifp pfalling
    action PFALLING
  else
    ifaction PSTAND
      state check_pstandard
  else
    ifaction PAKICKING
  {
    ifactioncount 2
      action PSTAND
    break
  }
  else
    ifaction PWALK
  {

state stepstate

    ifp pfalling
      action PFALLING
    else
      ifp pstanding
        action PSTAND
    else
      ifp prunning
        action PRUN
    else
      ifp pwalkingback
        action PWALKBACK
    else
      ifp prunningback
        action PRUNBACK
    else
      ifp pjumping
        action PJUMPING
    else
      ifp pducking
        action PDUCKING
  }

  else
    ifaction PRUN
  {

state stepstate

    ifp pstanding
      action PSTAND
    else
      ifp pwalking
        action PWALK
    else
      ifp pwalkingback
        action PWALKBACK
    else
      ifp prunningback
        action PRUNBACK
    else
      ifp pjumping
        action PJUMPING
    else
      ifp pducking
        action PDUCKING
  }

  else
    ifaction PWALKBACK
  {

state stepstate

    ifp pstanding
      action PSTAND
    else
      ifp pwalking
        action PWALK
    else
      ifp prunning
        action PRUN
    else
      ifp prunningback
        action PRUNBACK
    else
      ifp pjumping
        action PJUMPING
    else
      ifp pducking
        action PDUCKING
  }

  else
    ifaction PRUNBACK
  {

state stepstate

    ifp pstanding
      action PSTAND
    else
      ifp pwalking
        action PWALK
    else
      ifp prunning
        action PRUN
    else
      ifp pwalkingback
        action PWALKBACK
    else
      ifp pjumping
        action PJUMPING
    else
      ifp pducking
        action PDUCKING
  }
enda


include EXTRA.CON
include EVENTS.CON
