define ELFUZI         3800
define ELFGUN         4000
define ELFUZISTAYPUT  3801
define ELFGUNSTAYPUT  4001
define SNOWBALL       3882
define XMASPRESENT    3782

define ELFUZISTRENGTH 50
define ELFUZIALTSTR   25
define ELFGUNSTRENGTH 75
define SNOWMANSTRENGTH 75
define SOBBOTSTRENGTH 2500
define MINIBOSSSTRENGTH 100

move SNOWBALLSPEED1 750 100
move SNOWBALLUP 0 -2000

action SNOWBALL1 0 1 1 1 1

ai AISNOWBALL1 SNOWBALL1 SNOWBALLSPEED1 geth getv
ai AISNOWBALLUP SNOWBALL1 SNOWBALLUP geth getv

useractor notenemy SNOWBALL 0 SNOWBALL1
state checksquished

ifai NO { sizeat 1 1 cstat 32768 clipdist 0 ai AISNOWBALLUP }
ifai AISNOWBALLUP { ifcount 1 { ai AISNOWBALL1 cstat 257 clipdist 32 sizeat 30 30 } else break }

ifai AISNOWBALL1
  {
  ifpdistl 1024
    {
    addphealth -10
    debris SCRAP3 5
    sound DUKE_GRUNT
    wackplayer
    palfrom 15 15 15
    killit
    }
  iffloordistl 10
    {
    debris SCRAP3 5
    killit
    }
  }

ifcount 30 killit

enda

action ASNOWMANIDLE 26 3 5 1 20
action ASNOWMANATTACK 11 3 5 1 30
action ASNOWMANDIE 5 5 1 1 10
action ASNOWMANDEAD 10 1 1
action ASNOWMANFROZEN 0 1 5 1 1

move SNOWMANSPEED

ai AISNOWFOLLOW ASNOWMANIDLE SNOWMANSPEED faceplayerslow
ai AISNOWATTACK ASNOWMANATTACK SNOWMANSPEED faceplayer
ai AISNOWMANSHRINK ASNOWMANIDLE SNOWMANSPEED geth getv
ai AISNOWMANGROW ASNOWMANIDLE SNOWMANSPEED geth getv
ai AISNOWMANDYING ASNOWMANDIE SNOWMANSPEED geth getv

state snowmanidlestate

ifcansee
  {
  ifpdistl 8192
    {
    ai AISNOWATTACK
    break
    }
   }

ends

state snowmandyingstate
ifactioncount 5
  {
  action ASNOWMANDEAD
  }
ends

state snowmanattackstate

ifcount 15  { } else ifcount 14 { spawn SNOWBALL }
ifactioncount 3
  {
  resetcount
  ifpdistl 8192
    {
    resetactioncount
    }
    else
    {
    ai AISNOWFOLLOW
    }
  }

ends

state snowmanshrinkstate
  ifcount SHRUNKDONECOUNT
    ai AISNOWFOLLOW
  else
    ifcount SHRUNKCOUNT
      sizeto 48 40
  else
    state genericshrunkcode
ends

state snowmanhitstate

  ifdead
  {
    debris SCRAP3 40
    debris SCRAP3 40
    debris SCRAP3 20

    ifwasweapon GROWSPARK
    {
      sound ACTOR_GROWING
      ai AISNOWMANGROW
      break
    }

    addkills 1

    ifwasweapon FREEZEBLAST
    {
    sound SOMETHINGFROZE
    spritepal 1
    move 0
    action ASNOWMANFROZEN
    strength 0
    break
    }
    ifwasweapon RADIUSEXPLOSION
    {
      debris SCRAP3 40
      killit
    }
    else
      ifwasweapon RPG
    {
      debris SCRAP3 20
      killit
    }
    else
      {
      cstat 0
      ai AISNOWMANDYING
      }

  }
  else
  {
   debris SCRAP3 20
   ifwasweapon SHRINKSPARK
    {
      sound ACTOR_SHRINKING
      ai AISNOWMANSHRINK
    }
    else
      ifwasweapon GROWSPARK
        sound EXPANDERHIT
  }
ends


useractor enemy SNOWMAN SNOWMANSTRENGTH ASNOWMANIDLE
fall

ifaction ASNOWMANDEAD
  {
  ifrespawn
    {
    ifcount RESPAWNACTORTIME
      {
      spawn TRANSPORTERSTAR
      cstat 257
      strength SNOWMANSTRENGTH
      ai AISNOWFOLLOW
      }
    }
    else
    {
    strength 0
    ifhitweapon
      {
      ifwasweapon RADIUSEXPLOSION
        {
       debris SCRAP3 40
       debris SCRAP3 40
        debris SCRAP3 20
        killit
        }
      }
    }
  break
  }
  else
ifaction ASNOWMANFROZEN
  {
  ifcount THAWTIME
    {
    ai AISNOWFOLLOW
    getlastpal
    }
    else
    ifcount FROZENDRIPTIME
      ifrnd 8
       spawn WATERDRIP

  ifhitweapon
    {
    ifwasweapon FREEZEBLAST
      {
      strength 0
      break
      }
  addkills 1
  lotsofglass 30
  ifrnd 84 debris SCRAP3 10
  sound GLASS_BREAKING
  killit
  }
  ifp pfacing
    ifpdistl FROZENQUICKKICKDIST
      pkick
  break
  }

ifai AISNOWMANSHRINK
  {
  state snowmanshrinkstate
  break
  }


ifhitweapon state snowmanhitstate

ifp pdead { break }

ifai NO
  {
  ai AISNOWFOLLOW
  sizeat 42 36
  clipdist 32
  cstat 257
  }

ifai AISNOWMANDYING
  {
  state snowmandyingstate
  }
  else
ifai AISNOWMANGROW
  state genericgrowcode
  else
ifai AISNOWFOLLOW
  {
  state snowmanidlestate
  }
  else
ifai AISNOWATTACK
  {
  state snowmanattackstate
  }

enda

move botshrunkspeed   50
move botsteroidspeed  400
move botstopped
move botfall          0 -38
move bothardfall      0
move botflyupspeed    200 -140
move botflydownspeed  200 -38
move botflyspeed      200 // -38
move botdodgespeedfly 250 -140
move botdodgespeeddownfly 250 140

action ABOTFLY        1860  1 5 1 13
action ABOTFLYDYING   1925 5 1 1 18
action ABOTFLYDIEBACK 1929 5 1 -1 18
action ABOTFLYDEAD    1925 1 1 1 1
action ABOTFLYFROZEN  1860 1 5 1 1

ai AIBOTFLYUP ABOTFLY botflyupspeed faceplayer
ai AIBOTFLYDOWN ABOTFLY botflydownspeed faceplayer
ai AIBOTFLYSEEKUP ABOTFLY botflyupspeed geth seekplayer randomangle
ai AIBOTFLYSEEKDOWN ABOTFLY botflydownspeed geth seekplayer randomangle
ai AIBOTFLYDODGEUP ABOTFLY botdodgespeedfly fleeenemy randomangle
ai AIBOTFLYDODGEDOWN ABOTFLY botdodgespeeddownfly fleeenemy randomangle
ai AIBOTFLYNOTMOVING
ai AIBOTFLYCAMPING ABOTFLY botstopped faceplayer
ai AIBOTFLYDYING ABOTFLYDYING botstopped faceplayer
ai AIFLYWAIT ABOTFLY botstopped faceplayer
ai AIFLYUPMOMENT ABOTFLY botflyupspeed faceplayer
ai AIFLYUPHOLD ABOTFLY botflyupspeed faceplayer
ai AIBOTFLYSTRAIGHT ABOTFLY botflyspeed geth getv
ai AIBOTFLYGROW ABOTFLY botstopped geth getv
ai AIBOTFLYSHRINK ABOTFLY botshrunkspeed fleeenemy
ai AIBOTFLYSTEROIDS ABOTFLY botsteroidspeed randomangle
ai AIBOTFLYFLEE ABOTFLY botflyspeed randomangle

action ABOTWALK   1905 4 5 1 13
action ABOTWALK1  1905 1 5 1 13
action ABOTWALKGO 1905 4 5 1 13
action ABOTKICK   1905 2 5 1 25
action ABOTCRAWL  -2096 3 5 1 13
action ABOTJUMPUP 1940 2 5 1 13
action ABOTFALL   1950 1 5 1 1
action ABOTWDYING 1970 5 1 1 18
action ABOTWDEAD  1975 1 1 1 1
action ABOTWALKDIEBACK 1974 5 1 -1 18
action ABOTWALKFROZEN  1905 1 5 1 1

move   botwalkspeed  250
move   botjumpspeed  250 -115
move   botjumpdspeed 250 150
move   botcrawlspeed 0
move   botfallspeed  250 100

ai AIBOTWALKKICK ABOTKICK botstopped faceplayer
ai AIBOTWALKHUNT ABOTWALK botwalkspeed faceplayer
ai AIBOTWALKSEEK ABOTWALK botwalkspeed seekplayer
ai AIBOTWALKSEEK2
ai AIBOTWALKCAMPING ABOTWALK botstopped faceplayersmart
ai AIBOTWALKSTRJUMP1 ABOTJUMPUP botjumpspeed geth getv
ai AIBOTWALKSTRJUMP2 ABOTFALL   botjumpdspeed geth getv
ai AIBOTWALKSTRJUMP1S ABOTJUMPUP botjumpspeed faceplayer
ai AIBOTWALKSTRJUMP2S ABOTFALL   botjumpdspeed faceplayer
ai AIBOTWALKJUMP1 ABOTJUMPUP botjumpspeed faceplayer
ai AIBOTWALKJUMP2 ABOTFALL   botjumpdspeed faceplayer
ai AIBOTWALKDYING ABOTWDYING botstopped faceplayer
ai AIWALKFALL     ABOTFALL   botstopped faceplayer
ai AIWALKFALLHARD ABOTFALL   botstopped faceplayer
ai AIBOTWALKSTRAIGHT ABOTWALK botwalkspeed geth getv
ai AIBOTWALKGROW ABOTWALK1 botstopped geth getv
ai AIBOTWALKSHRINK ABOTWALK botshrunkspeed fleeenemy
ai AIBOTWALKSTEROIDS ABOTWALK botsteroidspeed randomangle
ai AIBOTWALKFLEE ABOTWALK botwalkspeed randomangle
ai AIBOTLETFALL ABOTFALL botfallspeed getv geth
ai AIBOTWALKNOTMOVING
ai AIWALKWAIT ABOTWALK botstopped faceplayer

state miniboss

sound SANTA_TRASH1

spawn EXPLOSION2
spawn EXPLOSION2
spawn PIGCOP
spawn PIGCOP
killit

ends



state stomphisfreakingass

ifp pdead
  {
  }
  else
  {
  ifpdistl SQUISHABLEDISTANCE
    {
    addphealth -1000
    sound SQUISH2
    state standard_pjibs
    state standard_pjibs
    sound SANTA_TRASH9
    }
  }

ends


state botchangeweaponstate

ifspritepal 21 break

resetcount

ifspritepal 0
  {
  ifpdistl 4096
    {
    ifrnd 128
      spritepal 3
      else
      spritepal 9
    }
    else
    {
    ifrnd 128
      spritepal 3
    }
  }
  else
ifspritepal 3
  {
  ifpdistg 4096
    {
    ifrnd 128
      spritepal 0
      else
      spritepal 9
    }
    else
    {
    ifrnd 128
      spritepal 9
    }
  }
  else
ifspritepal 9
  {
  ifpdistg 4096
    {
    ifrnd 128
      spritepal 0
      else
      spritepal 3
    }
    else
    {
    ifrnd 128
      spritepal 9
    }
  }

sound SELECT_WEAPON

ends

state botquickshootstate

ifspritepal 21 break

ifp pshrunk break
ifp pdead break

ifspritepal 0
  {
  shoot RPG sound RPG_SHOOT
  }
  else
ifspritepal 3
  {
  shoot CHAINGUN sound CHAINGUN_FIRE
  }
  else
ifspritepal 9
  {
//  shoot SHRINKER sound SHRINKER_FIRE
  shoot SHOTGUN sound SHOTGUN_FIRE
  }

ends


state botshootstate

ifspritepal 21 break // ifcanshoottarget { } // ifcanseetarget { }

ifp pdead break
ifp pshrunk break

ifspritepal 0
  {
  ifcount 5
    {
    ifactioncount 5
      {
      resetactioncount
      shoot RPG
      sound RPG_SHOOT
      }

    ifpdistl 4096
      {
      ifrnd 5
        state botchangeweaponstate
      }
    }
  }
  else
ifspritepal 3
  {
  ifcount 5
    {
    ifactioncount 1
      {
      resetactioncount
      shoot SHOTSPARK1 shoot CHAINGUN shoot CHAINGUN shoot CHAINGUN
      sound CHAINGUN_FIRE
      }
    ifrnd 1 state botchangeweaponstate
    }
  }
  else
ifspritepal 9
  {
  ifcount 5
    {
    ifactioncount 5
      {
      resetactioncount
//      shoot SHRINKER
//      sound SHRINKER_FIRE
      shoot SHOTGUN
      sound SHOTGUN_FIRE
      }
    ifp ponsteroids
      {
      ifrnd 64
        state botchangeweaponstate
      }
    ifrnd 1 state botchangeweaponstate
    }
  }



ends

state dudehurt

/*
        ifstrength YELLHURTSOUNDSTRENGTHMP
        {
          ifrnd 64
            sound SANTA_GOTHIT
          else
            ifrnd 64
              sound SANTA_DEAD
          else
            ifrnd 64
              sound SANTA_TRASH6
          else
            sound SANTA_TRASH8
        }
        else
        {
          ifrnd 64
            sound SANTA_GOTHIT
          else ifrnd 64
            sound SANTA_DEAD
          else ifrnd 64
            sound SANTA_TRASH6
          else
            sound SANTA_TRASH8
        }
*/

        ifrnd 80
          sound SANTA_GOTHIT
ends

state dukehurt

        ifrnd 80
          sound SANTA_GOTHIT
/*

        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
        }
*/
ends


// WALK STATES

state botwalkhitstate

state botshootstate

spawn BLOOD

ifdead
  {


  ifspritepal 21
    {
    state miniboss
    }
  else
    soundonce SANTA_DEAD

  ifwasweapon FREEZEBLAST
    {
    spritepal 1
    strength 0
    move 0
    action ABOTWALKFROZEN
    sound SOMETHINGFROZE
    break
    }
    else
  ifwasweapon GROWSPARK
    {
    cstat 0
    sound ACTOR_GROWING
    ai AIBOTWALKGROW
    break
    }
    else
  ifwasweapon RADIUSEXPLOSION
    {
    state standard_pjibs
    state standard_pjibs
    state standard_pjibs
    state standard_pjibs
    sound SQUISH2
    addkills 1
    endofgame 52
    killit
    }
    else
  ifwasweapon RPG
    {
    state standard_pjibs
    state standard_pjibs
    state standard_pjibs
    state standard_pjibs
    sound SQUISH2
    addkills 1
    endofgame 52
    killit
    }
    else
    {
    ai AIBOTWALKDYING
    break
    }

  }
  else
  {
  state dudehurt

  ifwasweapon SHRINKSPARK
    {
    ifai AIBOTWALKSTEROIDS
       {
       }
       else
       {
       ai AIBOTWALKSHRINK
       break
       }
    }
  }

ends

state botwalkdyingstate
fall
strength 0

ifactioncount 5
  {
  action ABOTWDEAD
  endofgame 52
  killit
  }

ends

state botwalkseekstate

ifcansee
  {
  ai AIBOTWALKHUNT
  break
  }
  else
  {
  }

ifgapzl 100
  {
  }
  else
  {
  ifnotmoving
    {
    ifrnd 4 operate
    ifpdistl 8000
      {
      ai AIFLYUPMOMENT
      cactor SOBBOTFLY
      break
      }
      else
      ai AIBOTWALKJUMP1
    break
    }
  }

ends

state botwalkjumpstate

ifrnd 4
  ifpdistl 6000
    state botquickshootstate

ifai AIBOTWALKJUMP1
  {
  ifactioncount 2
    {
    ai AIBOTWALKJUMP2
    break
    }
  }

ifai AIBOTWALKJUMP2
  {
  ifactioncount 1
    {
    state botshootstate
    iffloordistl 16
      {
      sound DUKE_LAND
      operate
      ai AIBOTWALKHUNT
      }
    }
  }

ends

state botwalkhuntstate

state botshootstate

ifrnd 3
  {
  ai AIBOTWALKSTRJUMP1S
  count 10
  }

ifcansee
  {
  ifpdistl 1024
    {
    ifrnd 24
      {
      ifp pdead
        nullop
        else
        ai AIBOTWALKKICK
      break
      }
    }
  }
  else
  {
  ifphealthl 50
    ifrnd 64
      ifpdistl 8000
        {
          ifrnd 80
            sound SANTA_TRASH1
        }

  ifrnd 128
    {
    ifp phigher
      {
      ai AIFLYUPMOMENT
      cactor SOBBOTFLY
      break
      }
      else
      {
      ai AIBOTWALKSTRAIGHT
      break
      }
    }
    else
    {
    ai AIBOTWALKSTRAIGHT
    break
    }
  ai AIBOTWALKSEEK
  break
  }

ifrnd 128
  ifnotmoving
    {
    ifrnd 8
      operate
    ai AIBOTWALKJUMP1
    break
    }

ends

state botwalkkickstate

ifactioncount 2
  {
  resetactioncount
  ifpdistl 1024
    {
    ifp pdead
      {
      ai AIBOTWALKHUNT
      break
      }
    ifp pfacing
      ifrnd 16
        {
          globalsound SANTA_TRASH8
        }
    sound KICK_HIT
    ifspritepal 21
      {
      addphealth -1
      }
      else
      {
      addphealth -6
      }
    state dukehurt
    }
    else
    {
    ai AIBOTWALKHUNT
    break
    }

  ifrnd 50
    {
    ai AIBOTWALKHUNT
    break
    }
  }

ends

state botwalkstraightjumpstate

ifai AIBOTWALKSTRJUMP1
  {
  ifcount 20
    {
    ai AIBOTWALKSTRJUMP2
    break
    }
  }
  else
ifai AIBOTWALKSTRJUMP2
  {
  ifcount 18
    {
    iffloordistl 16
      {
      operate
      ifrnd 128
      sound DUKE_LAND
      ifrnd 200
        ai AIBOTWALKSTRAIGHT
        else
        ai AIBOTWALKSEEK
      }
    }
  }

ends

state botjumpshootstate

ifai AIBOTWALKSTRJUMP1S
  {
  state botshootstate

  ifcount 20
    {
    ai AIBOTWALKSTRJUMP2S
    resetactioncount
    count 10
    break
    }

  }
  else
ifai AIBOTWALKSTRJUMP2S
  {
  ifcount 18
    {
    iffloordistl 16
      {
      operate
      sound DUKE_LAND
      ai AIBOTWALKHUNT
      count 10
      }
    }
  }


ends


state botwalkstraightstate

ifpdistg 20000
  ai AIBOTWALKSEEK

ifcansee
  {
  ifnotmoving
    {
    ai AIBOTWALKSTRJUMP1
    break
    }
  ifrnd 64
    ai AIBOTWALKHUNT
  }
  else
  {
  ifrnd 128
    ifnotmoving
      ai AIBOTWALKSTRJUMP1
  }

ends

state steroidswalk

soundonce DUKE_HARTBEAT
spawn FRAMEEFFECT1

ifhitweapon
  {
  state botwalkhitstate
  break
  }

ifcount 150
  {
  ai AIBOTWALKHUNT
  }

ifcount 34
  {
  }
  else
  {
  sizeto 42 36
  }

ends

state botletfallstate

ifactioncount 5
  {
  }
  else
  ifactioncount 6
    {
    soundonce SANTA_TRASH7
    }

ifcansee
  {
  ai AIFLYWAIT
  cactor SOBBOTFLY
  break
  }
  else
  {
  iffloordistl 50
    {
    ai AIFLYWAIT
    cactor SOBBOTFLY
    break
    }
  }

ends

actor SOBBOTWALK SOBBOTSTRENGTH ABOTWALK
state checksquished

ifai NO
  {

  ifspawnedby RECON
    {
    spawn PIGCOP
    killit
    }

  ifcansee { } else { break }
  
  sizeat 42 36
  cstat 257

  ai AIBOTWALKSEEK

  ifspritepal 21
    {
    strength MINIBOSSSTRENGTH
    else ifrnd 64 soundonce SANTA_TRASH9
    }
    else
    {
    spritepal 0
    }
  sound INSERT_CLIP
  break
  }


fall
sleeptime 300

ifaction ABOTWDEAD
  {
  break
  }
  else
ifaction ABOTWALKFROZEN
  {

  ifcount THAWTIME
    {
    ai AIBOTWALKHUNT
    getlastpal
    }
    else
    ifcount FROZENDRIPTIME
      {
      ifactioncount 26
        {
        spawn WATERDRIP
        resetactioncount
        }
      }
  ifhitweapon
    {
    ifwasweapon FREEZEBLAST
      {
      strength 0
      break
      }
    addkills 1

    ifrnd 84
      spawn BLOODPOOL
    lotsofglass 30
    spawn ATOMICHEALTH
    sound GLASS_BREAKING
    ifspritepal 21
      state miniboss
    endofgame 52
    killit
    }
  ifp pfacing
    ifpdistl FROZENQUICKKICKDIST
      pkick
  break
  }
  else
ifai AIBOTWALKSTEROIDS
  {
  state steroidswalk
  break
  }
  else
ifai AIBOTWALKGROW
  {
  ifcount 32
    {
    guts JIBS4 24
    guts JIBS6 28
    addkills 1
    sound SQUISH2
    sound PIPEBOMB_EXPLODE
    hitradius 2048 60 70 80 90
    spawn BLOODPOOL
    spawn EXPLOSION2
    ifspritepal 21
      state miniboss
    endofgame 52
    killit
    }
    else
    {
    sizeto MAXXSTRETCH MAXYSTRETCH
    break
    }
  break
  }
  else
ifai AIBOTWALKSHRINK
  {

  ifcount SHRUNKDONECOUNT
    ai AIBOTWALKHUNT
    else
    ifcount SHRUNKCOUNT
      {
      spawn FRAMEEFFECT1
      sizeto 42 36
      }
      else
      {
      ifcount 31
        nullop
        else
        {
        ifcount 30
          {
          ifrnd 255
            {
            sound DUKE_TAKEPILLS
            ai AIBOTWALKSTEROIDS
            break
            }
          }
        }
      ifcount 32
        {
        ifpdistl SQUISHABLEDISTANCE
          {
          ifspritepal 0
          {
          ifrnd 128
              sound SANTA_DEAD
              else
              sound SANTA_TRASH9
          }
          state standard_pjibs
          sound SQUISH2
          spawn BLOODPOOL
          pkick
          wackplayer
          wackplayer
          wackplayer
          wackplayer
          ifspritepal 21
            {
            state miniboss
            }
          endofgame 52
          killit
          }
        }
        else
        {
        sizeto MINXSTRETCH MINYSTRETCH
        spawn FRAMEEFFECT1
        }
      }

  break
  }
  else
ifai AIBOTWALKDYING
  {
  state botwalkdyingstate
  break
  }
  else
  ifrnd 1
    operate

ifhitweapon
  {
  state botwalkhitstate
  break
  }
  else
ifai AIWALKFALLHARD
  {
  iffloordistl 16
    {
    ai AIBOTWALKHUNT
    }
    else
    {
    break
    }
  }
  else
  {
  ifai AIWALKFALL
    {
    state botshootstate
    iffloordistl 16
      {
      ai AIBOTWALKHUNT
      }
      else
      {
      break
      }
    }
  }

ifp pshrunk
  state stomphisfreakingass

iffloordistl 550
  nullop
  else
  {
  ai AIFLYWAIT
  cactor SOBBOTFLY
  }

ifonwater
  {
  }
  else
  {
  ifp pjetpack
    ifp phigher
      ifcansee
        {
        ai AIFLYWAIT
        cactor SOBBOTFLY
        }
  }

ifp phigher
  {
  ifrnd 1
    {
    ifrnd 196
      {
      ai AIFLYWAIT
      cactor SOBBOTFLY
      }
    }
  }

ifai AIWALKWAIT
  {
  ai AIBOTWALKSEEK
  break
  }
  else
ifai AIBOTWALKSEEK
  state botwalkseekstate
    else
ifai AIBOTWALKHUNT
  state botwalkhuntstate
    else
ifai AIBOTWALKJUMP1
  state botwalkjumpstate
    else
ifai AIBOTWALKJUMP2
  state botwalkjumpstate
    else
ifai AIBOTWALKKICK
  state botwalkkickstate
    else
ifai AIBOTWALKSTRAIGHT
  state botwalkstraightstate
    else
ifai AIBOTWALKSTRJUMP1
  state botwalkstraightjumpstate
    else
ifai AIBOTWALKSTRJUMP2
  state botwalkstraightjumpstate
    else
ifai AIBOTLETFALL
  state botletfallstate
    else
ifai AIBOTWALKSTRJUMP1S
  state botjumpshootstate
    else
ifai AIBOTWALKSTRJUMP2S
  state botjumpshootstate


enda

state botflydyingstate

fall

strength 0
cstat 0

ifactioncount 5
  {
  action ABOTFLYDEAD
  ifspritepal 21
    state miniboss
  endofgame 52
  }

ends

state choosedodgefly

ifceilingdistl 100
  {
  ifai AIBOTFLYDODGEDOWN
    nullop
    else
    ai AIBOTFLYDODGEDOWN
  }
  else
  {
  ifai AIBOTFLYDODGEUP
    nullop
    else
    ai AIBOTFLYDODGEUP
  }

ends


state botflydodgestate

ifcanshoottarget
  state botshootstate

ifcansee
  {
  ifrnd 2
    {
    ifceilingdistl 100
      ai AIBOTFLYDODGEDOWN
      else
      ai AIBOTFLYDODGEUP
    }
  }
  else
  {
  ai AIBOTFLYSEEKUP
  }

ifcount 10
  ai AIBOTFLYDOWN

ends

state botflyhitstate

state botshootstate

spawn BLOOD

ifdead
  {
  ifspritepal 21
    state miniboss
  else
    sound SANTA_DEAD

  ifwasweapon FREEZEBLAST
    {
    spritepal 1
    strength 0
    move 0
    action ABOTFLYFROZEN
    sound SOMETHINGFROZE
    break
    }
    else
  ifwasweapon GROWSPARK
    {
    cstat 0
    sound ACTOR_GROWING
    ai AIBOTFLYGROW
    break
    }
    else
  ifwasweapon RADIUSEXPLOSION
    {
    state standard_pjibs
    state standard_pjibs
    state standard_pjibs
    state standard_pjibs
    sound SQUISH2
    addkills 1
    endofgame 52
    killit
    }
    else
  ifwasweapon RPG
    {
    state standard_pjibs
    state standard_pjibs
    state standard_pjibs
    state standard_pjibs
    sound SQUISH2
    addkills 1
    endofgame 52
    killit
    }
    else
    {
    ai AIBOTFLYDYING
    }

  }
  else
  {
  state dudehurt

  ifwasweapon SHRINKSPARK
    {
    ifai AIBOTFLYSTEROIDS
       {
       }
       else
       {
       ai AIBOTFLYSHRINK
       break
       }
    }
  }

ends

state botflyseekupstate

ifcansee
  {
  ai AIBOTFLYUP
  break
  }

ifp phigher
  {
  }
  else
  {
  ai AIBOTFLYSEEKDOWN
  break
  }

ends

state botflyseekdownstate

ifcansee
  {
  ai AIBOTFLYDOWN
  break
  }
  else
  {
  ifp phigher
    {
    }
    else
    {
    ai AIBOTLETFALL
    cactor SOBBOTWALK
    }
  }

ifp phigher
  {
  ai AIBOTFLYSEEKUP
  break
  }

ends

state botflydownstate

state botshootstate

ifrnd 16
  {
  ifp phigher
    {
    ai AIBOTFLYUP
    break
    }
  }

ifcansee
  {
  }
  else
  {
  ai AIBOTFLYSTRAIGHT
  break
  }

ends

state botflyupstate

state botshootstate

ifrnd 16
  {
  ifp phigher
    nullop
    else
    {
    ai AIBOTFLYDOWN
    break
    }
  }

ifcansee
  {
  }
  else
  {
  ai AIBOTFLYSTRAIGHT
  }

ends

state botflyupmomentstate

ifcansee
  {
  ifcount 10 ai AIBOTFLYUP
  break
  }
  else
  {
  ifcount 50
    {
    ai AIBOTLETFALL
    cactor SOBBOTWALK
    }
  }

ends

state botflyholdstate

state botshootstate

ifcount 50
  {
  ai AIBOTFLYUP
  }

ends

state botflystraightstate

ifpdistg 20000
  ai AIBOTFLYSEEKDOWN

ifcansee
  {
  ai AIBOTFLYDOWN
  }
  else
  {
  ifrnd 128
    ifnotmoving
      ai AIFLYUPMOMENT
  }

ends

state steroidsfly

soundonce DUKE_HARTBEAT
spawn FRAMEEFFECT1

ifcount 100
  {
  ai AIBOTFLYUP
  }

ifcount 34
  {
  }
  else
  {
  sizeto 42 36
  }

ifhitweapon
  {
  state botflyhitstate
  break
  }

ends

// FLY ACTOR

actor SOBBOTFLY SOBBOTSTRENGTH ABOTFLY
state checksquished

ifai NO
  {
  ifcansee { } else { break }
  ifspritepal 21
    {
    strength MINIBOSSSTRENGTH
    }
  sizeat 42 36
  cstat 257
  sound INSERT_CLIP
  ai AIBOTFLYSEEKDOWN
  spritepal 0
  break
  }


fall

sleeptime 300

ifaction ABOTFLYDEAD
  break
  else
ifaction ABOTFLYFROZEN
  {
  ifcount THAWTIME
    {
    ai AIBOTFLYUP
    getlastpal
    }
    else
    ifcount FROZENDRIPTIME
      {
      ifactioncount 26
        {
        spawn WATERDRIP
        resetactioncount
        }
      }
  ifhitweapon
    {
    ifwasweapon FREEZEBLAST
      {
      strength 0
      break
      }
    addkills 1

    ifrnd 84
      spawn BLOODPOOL

    lotsofglass 30
    spawn ATOMICHEALTH
    sound GLASS_BREAKING
    ifspritepal 21 state miniboss
    endofgame 52
    killit
    }

  ifp pfacing
    ifpdistl FROZENQUICKKICKDIST
      pkick
  break
  }
  else
ifai AIBOTFLYSTEROIDS
  {
  soundonce DUKE_JETPACK_IDLE
  state steroidsfly
  break
  }
  else
ifai AIBOTFLYGROW
  {
  ifcount 32
    {
    guts JIBS4 24
    guts JIBS6 28
    addkills 1
    sound SQUISH2
    sound PIPEBOMB_EXPLODE
    hitradius 2048 60 70 80 90
    spawn BLOODPOOL
    spawn EXPLOSION2
    ifspritepal 21 state miniboss
    endofgame 52
    killit
    }
    else
    {
    sizeto MAXXSTRETCH MAXYSTRETCH
    break
    }
  break
  }
  else
ifai AIBOTFLYSHRINK
  {
  ifcount SHRUNKDONECOUNT
    ai AIBOTFLYUP
    else
    ifcount SHRUNKCOUNT
      {
      spawn FRAMEEFFECT1
      sizeto 42 36
      }
      else
      {
      ifcount 31
        nullop
        else
        {
        ifcount 30
          {
          ifrnd 255
            {
            sound DUKE_TAKEPILLS
            ai AIBOTFLYSTEROIDS
            break
            }
          }
        }
      ifcount 32
        {

        ifpdistl SQUISHABLEDISTANCE
          {
          ifspritepal 0
          {
            ifrnd 128
              sound SANTA_DEAD
              else
              sound SANTA_DEAD
          }
          state standard_pjibs
          state standard_pjibs
          state standard_pjibs
          state standard_pjibs
          sound SQUISH2
          spawn BLOODPOOL
          pkick
          wackplayer
          wackplayer
          wackplayer
          wackplayer
          ifspritepal 21
            state miniboss
          endofgame 52
          killit
          }
        }
        else
        {
        sizeto MINXSTRETCH MINYSTRETCH
        spawn FRAMEEFFECT1
        }
      }
  break
  }

soundonce DUKE_JETPACK_IDLE

ifai AIBOTFLYDYING
  {
  state botflydyingstate
  break
  }

ifhitweapon
  state botflyhitstate

ifrnd 2 operate

ifp pshrunk
  {
  state stomphisfreakingass
  }

ifrnd 25
  {
  ifp phigher
    {
    }
    else
    {
    ifp ponground
      {
      iffloordistl 200
        {
        sound DUKE_JETPACK_OFF
        iffloordistl 100 ai AIWALKFALL else ai AIWALKFALLHARD
        cactor SOBBOTWALK
        }
      }
    }
  }

ifai AIFLYWAIT
  {
  move 0
  sound DUKE_JETPACK_ON
  ai AIBOTFLYSEEKDOWN
  }

ifai AIBOTFLYSEEKUP
  state botflyseekupstate
    else
ifai AIBOTFLYSEEKDOWN
  state botflyseekdownstate
    else
ifai AIBOTFLYDOWN
  state botflydownstate
    else
ifai AIBOTFLYUP
  state botflyupstate
    else
ifai AIBOTFLYDODGEUP
  state botflydodgestate
    else
ifai AIBOTFLYDODGEDOWN
  state botflydodgestate
    else
ifai AIFLYUPMOMENT
  state botflyupmomentstate
    else
ifai AIFLYUPHOLD
  state botflyholdstate
    else
ifai AIBOTFLYSTRAIGHT
  state botflystraightstate

break
enda



action  AELFUZIWALK    0 4 5 1 30
action  AELFUZIRUN     0 4 5 1 15
action  AELFUZIFROZEN  0 1 5 1
action  AELFUZIGROW    0 1 5 1
action  AELFUZIJUMP  266 2 5 1 15
action  AELFUZIFALL  276 1 5 1 1
action  AELFUZIDYING 260 5 1 1 25
action  AELFUZIDEAD  265 1 1 1 1
action  AELFUZISHOOT 281 2 5 1

move    elfuziwalkspeed 100
move    elfuzirunspeed  200
move    elfuzijumpspeed 150 -200
move    elfuzifallspeed 150 150
move    elfuzistopped
move    elfuzishrink1    80

ai      AIELFUZISHRINKING AELFUZIWALK   elfuzishrink1  fleeenemy
ai      AIELFUZIDYING     AELFUZIDYING  elfuzistopped faceplayer
ai      AIELFUZISEEKING   AELFUZIWALK   elfuziwalkspeed seekplayer
ai      AIELFUZIHUNTING   AELFUZIRUN    elfuzirunspeed faceplayer
ai      AIELFUZIJUMPING   AELFUZIJUMP   elfuzijumpspeed geth getv
ai      AIELFUZIFALLING   AELFUZIFALL   elfuzifallspeed geth getv
ai      AIELFUZISHOOTING  AELFUZISHOOT  elfuzistopped faceplayer
ai      AIELFUZIIQ        AELFUZIRUN    elfuzirunspeed geth getv
ai      AIELFUZIGROW      AELFUZIGROW   elfuzistopped geth getv

state elfuziseekstate

ifcansee
  {
  ifp pdead break

  ifpdistl 15000
    {
    ifrnd 16
      {
      ai AIELFUZIHUNTING
      }
    }
  }

ends

state elfuzihuntstate

ifp pdead ai AIELFUZISEEKING


ifcansee
  {
  ifpdistl 2000
    {
    ai AIELFUZISHOOTING
    break
    }
  ifrnd 64 ifnotmoving
    {
    ai AIELFUZIJUMPING
    break
    }

  ifrnd 7
    ifpdistl 8192
      {
      ai AIELFUZISHOOTING
      }
  }
  else
  {
  ifrnd 64 ai AIELFUZIIQ
  }

ends

state elfuziiqstate

ifcansee
  {
  ai AIELFUZIHUNTING
  }
  else
  {
  ifrnd 16
    ifnotmoving
      {
      ai AIELFUZISEEKING
      }
  }

ends

state elfuzishootstate

ifcansee
  {
  ifp pdead ai AIELFUZISEEKING

  ifactioncount 3
    {
    ifspritepal 21
    {
    ifrnd 80
      {
      sound SHRINKER_FIRE
      shoot SHRINKER
      }

    }
    else
    {
    sound CHAINGUN_FIRE
    shoot SHOTSPARK1
    }
    resetactioncount
    }
  ifrnd 4
    ai AIELFUZIHUNTING
  }
  else
  {
  ai AIELFUZIIQ
  }

ends

state elfuzijumpingstate

ifactioncount 2
  ai AIELFUZIFALLING

ends

state elfuzifallingstate

iffloordistl 5
  ai AIELFUZIHUNTING

ends

action NONEACTION 0 1 1 1 1

define SPECBLOOD 105
move forwardspeed 1500
ai AIMOVEFORWARD NONEACTION forwardspeed faceplayer

useractor SPECBLOOD 0
cstat 32768
// sizeat 42 36
sizeat 32 27
ifai NO ai AIMOVEFORWARD
ifcount 1
  {
  spawn BLOOD
  spawn BLOOD
  spawn BLOOD
  spawn BLOOD
  }
enda



state elfuzihitstate
spawn SPECBLOOD
state random_wall_jibs

ifdead
  {
  state random_wall_jibs
  ifrnd 128
    {
    spawn XMASPRESENT
    }
  ifwasweapon GROWSPARK
    {
    sound ACTOR_GROWING
    ai AIELFUZIGROW
    break
    }

  addkills 1

  ifwasweapon FREEZEBLAST
    {
    sound SOMETHINGFROZE
    spritepal 1
    move 0
    action AELFUZIFROZEN
    strength 0
    break
    }
  ifwasweapon RADIUSEXPLOSION
    {
    sound SQUISH2
    state standard_jibs
    state standard_jibs
    state standard_jibs
    killit
    }
    else
  ifwasweapon RPG
    {
    sound SQUISH2
    state standard_jibs
    state standard_jibs
    state standard_jibs
    killit
    }
    else
    ai AIELFUZIDYING

  }
  else
  {
  state random_wall_jibs
  ifwasweapon SHRINKSPARK
    {
    sound ACTOR_SHRINKING
    ai AIELFUZISHRINKING
    }
    else
    ifwasweapon GROWSPARK
      sound EXPANDERHIT
      else
      ifrnd 32
        ai AIELFUZISHOOTING
  }
ends

state elfuzishrinkstate

ifcount SHRUNKDONECOUNT
  ai AIELFUZISEEKING
  else
  ifcount SHRUNKCOUNT
//    sizeto 48 40
      sizeto 36 30
    else
    state genericshrunkcode

ends

state elfuzidyingstate

ifactioncount 5
  {
  ifrnd 64
    spawn BLOODPOOL
  state rf
  iffloordistl 8
    sound THUD
  action AELFUZIDEAD
  move elfuzistopped
  break
  }

ends

useractor enemy ELFUZI ELFUZISTRENGTH
fall

state checksquished

ifaction AELFUZIDEAD
  {
  ifrespawn
    ifcount RESPAWNACTORTIME
      {
      spawn TRANSPORTERSTAR
      cstat 257
      strength ELFUZISTRENGTH
      ai AIELFUZISEEKING
      }
      else
      {
      strength 0
      ifhitweapon
        ifwasweapon RADIUSEXPLOSION
          {
          sound SQUISH2
          state standard_jibs
          state standard_jibs
          state standard_jibs
          killit
          }
      break
      }
  break
  }
  else
ifaction AELFUZIFROZEN
  {
  ifcount THAWTIME
    {
    ai AIELFUZISEEKING
    getlastpal
    }
    else
    ifcount FROZENDRIPTIME
      ifrnd 8
        spawn WATERDRIP

  ifhitweapon
    {
    ifwasweapon FREEZEBLAST
      {
      strength 0
      break
      }
    addkills 1
    lotsofglass 30
    ifrnd 84 spawn BLOODPOOL
    sound GLASS_BREAKING
    killit
    }
  ifp pfacing
    ifpdistl FROZENQUICKKICKDIST
      pkick
  break
  }
  else
  ifai AIELFUZIDYING
    state elfuzidyingstate

ifai AIELFUZISHRINKING nullop else { ifai AIELFUZIGROW nullop else { ifhitweapon state elfuzihitstate } }

ifai NO
  {
  ai AIELFUZISEEKING
  cstat 257
  clipdist 32
//  sizeat 42 36
  sizeat 32 27
  ifspritepal 21
    strength ELFUZIALTSTR
  else
    strength ELFUZISTRENGTH
  }
  else
ifai AIELFUZISEEKING
  {
  state elfuziseekstate
  }
  else
ifai AIELFUZIHUNTING
  {
  state elfuzihuntstate
  }
  else
ifai AIELFUZIIQ
  {
  state elfuziiqstate
  }
  else
ifai AIELFUZISHOOTING
  {
  state elfuzishootstate
  }
  else
ifai AIELFUZIJUMPING
  {
  state elfuzijumpingstate
  }
  else
ifai AIELFUZIFALLING
  {
  state elfuzifallingstate
  }
  else
ifai AIELFUZIGROW
  {
  state genericgrowcode
  }
ifai AIELFUZISHRINKING
  {
  state elfuzishrinkstate
  }





enda

useractor enemystayput ELFUZISTAYPUT ELFUZISTRENGTH
ai     AIELFUZISEEKING
cstat  257
clipdist 32
cactor ELFUZI
enda

action  AELFGUNWALK    0 4 5 1 20
action  AELFGUNRUN     0 4 5 1 10
action  AELFGUNFROZEN  0 1 5 1
action  AELFGUNGROW    0 1 5 1
action  AELFGUNDYING  35 4 1 1 25
action  AELFGUNDEAD   39 1 1 1 1
action  AELFGUNSHOOT  20 3 5 1 40

move    elfgunwalkspeed 70
move    elfgunrunspeed  110
move    elfgunstopped
move    elfgunshrink1    80

ai      AIELFGUNSHRINKING AELFGUNWALK   elfgunshrink1  fleeenemy
ai      AIELFGUNDYING     AELFGUNDYING  elfgunstopped faceplayer
ai      AIELFGUNSEEKING   AELFGUNWALK   elfgunwalkspeed seekplayer
ai      AIELFGUNHUNTING   AELFGUNRUN    elfgunrunspeed faceplayer
ai      AIELFGUNSHOOTING  AELFGUNSHOOT  elfgunstopped faceplayer
ai      AIELFGUNIQ        AELFGUNRUN    elfgunrunspeed geth getv
ai      AIELFGUNGROW      AELFGUNGROW   elfgunstopped geth getv

state elfgunseekstate

ifcansee
  {
  ifp pdead break

  ifpdistl 15000
    {
    ifrnd 16
      {
      ai AIELFGUNHUNTING
      }
    }
  }

ends

state elfgunhuntstate

ifp pdead ai AIELFGUNSEEKING

ifcansee
  {
  ifpdistl 2000
    {
    ai AIELFGUNSHOOTING
    break
    }

  ifrnd 7
    ifpdistl 8192
      {
      ai AIELFGUNSHOOTING
      }
  }
  else
  {
  ifrnd 48 ai AIELFGUNIQ
  }

ends

state elfguniqstate

ifcansee
  {
  ai AIELFGUNHUNTING
  }
  else
  {
  ifrnd 16
    ifnotmoving
      {
      ai AIELFGUNSEEKING
      }
  }

ends

state elfgunshootstate

ifcansee
  {
  ifp pdead ai AIELFGUNSEEKING

  ifcount 20
    {
    ifcount 29
      nullop
      else
      {
      ifcount 28
        {
        sound SHOTGUN_COCK
        }
      }
    }
    else
    {
    ifcount 19
      {
      sound SHOTGUN_FIRE
      shoot SHOTSPARK1
      shoot SHOTSPARK1
      shoot SHOTSPARK1
      shoot SHOTSPARK1
      shoot SHOTSPARK1
      shoot SHOTSPARK1
      }
    }

  ifactioncount 3
    {
    resetcount
    resetactioncount
    ifrnd 64
      ai AIELFGUNHUNTING
    }
  }
  else
  {
  ai AIELFGUNIQ
  }

ends

state elfgunhitstate
spawn BLOOD
spawn BLOOD
spawn BLOOD
spawn BLOOD
spawn BLOOD

state random_wall_jibs

ifdead
  {
  state random_wall_jibs
  ifrnd 128
    {
    spawn XMASPRESENT
    }
  ifwasweapon GROWSPARK
    {
    sound ACTOR_GROWING
    ai AIELFGUNGROW
    break
    }

  addkills 1

  ifwasweapon FREEZEBLAST
    {
    sound SOMETHINGFROZE
    spritepal 1
    move 0
    action AELFGUNFROZEN
    strength 0
    break
    }
  ifwasweapon RADIUSEXPLOSION
    {
    sound SQUISH2
    state standard_jibs
    state standard_jibs
    state standard_jibs
    killit
    }
    else
  ifwasweapon RPG
    {
    sound SQUISH2
    state standard_jibs
    state standard_jibs
    state standard_jibs
    killit
    }
    else
    ai AIELFGUNDYING

  }
  else
  {
  state random_wall_jibs
  ifwasweapon SHRINKSPARK
    {
    sound ACTOR_SHRINKING
    ai AIELFGUNSHRINKING
    }
    else
    ifwasweapon GROWSPARK
      sound EXPANDERHIT
      else
      ifrnd 32
        ai AIELFGUNSHOOTING
  }
ends

state elfgunshrinkstate

ifcount SHRUNKDONECOUNT
  ai AIELFGUNSEEKING
  else
  ifcount SHRUNKCOUNT
//    sizeto 48 40
    sizeto 36 30
    else
    state genericshrunkcode

ends

state elfgundyingstate

ifactioncount 4
  {
  ifrnd 64
    spawn BLOODPOOL
  state rf
  iffloordistl 8
    sound THUD
  action AELFGUNDEAD
  move elfgunstopped
  break
  }

ends

useractor enemy ELFGUN ELFGUNSTRENGTH
fall
state checksquished

ifaction AELFGUNDEAD
  {
  ifrespawn
    ifcount RESPAWNACTORTIME
      {
      spawn TRANSPORTERSTAR
      cstat 257
      strength ELFGUNSTRENGTH
      ai AIELFGUNSEEKING
      }
      else
      {
      strength 0
      ifhitweapon
        ifwasweapon RADIUSEXPLOSION
          {
          sound SQUISH2
          state standard_jibs
          state standard_jibs
          state standard_jibs
          killit
          }
      break
      }
  break
  }
  else
ifaction AELFGUNFROZEN
  {
  ifcount THAWTIME
    {
    ai AIELFGUNSEEKING
    getlastpal
    }
    else
    ifcount FROZENDRIPTIME
      ifrnd 8
        spawn WATERDRIP

  ifhitweapon
    {
    ifwasweapon FREEZEBLAST
      {
      strength 0
      break
      }
    addkills 1
    lotsofglass 30
    ifrnd 84 spawn BLOODPOOL
    sound GLASS_BREAKING
    killit
    }
  ifp pfacing
    ifpdistl FROZENQUICKKICKDIST
      pkick
  break
  }
  else
  ifai AIELFGUNDYING
    state elfgundyingstate

ifai AIELFGUNSHRINKING nullop else { ifai AIELFGUNGROW nullop else { ifhitweapon state elfgunhitstate } }

ifai NO
  {
  ai AIELFGUNSEEKING
  cstat 257
  clipdist 32
//  sizeat 42 36
  sizeat 32 27
  strength ELFGUNSTRENGTH
  }
  else
ifai AIELFGUNSEEKING
  {
  state elfgunseekstate
  }
  else
ifai AIELFGUNHUNTING
  {
  state elfgunhuntstate
  }
  else
ifai AIELFGUNIQ
  {
  state elfguniqstate
  }
  else
ifai AIELFGUNSHOOTING
  {
  state elfgunshootstate
  }
  else
ifai AIELFGUNGROW
  {
  state genericgrowcode
  }
ifai AIELFGUNSHRINKING
  {
  state elfgunshrinkstate
  }

break
enda

useractor enemystayput ELFGUNSTAYPUT ELFGUNSTRENGTH
ai     AIELFGUNSEEKING
cstat  257
clipdist 32
cactor ELFGUN
break
enda


state bluepresent
fall

ifp pshrunk
  nullop
  else
  ifp palive
    ifcount 6
      ifpdistl RETRIEVEDISTANCE
        ifcanseetarget
          {
          sound RIP_PAPER
          ifrnd 128
            spawn SHIELD
            else
            spawn SIXPAK
          killit
          }

ends

state greenpresent
fall

ifp pshrunk
  nullop
  else
  ifp palive
    ifcount 6
      ifpdistl RETRIEVEDISTANCE
        ifcanseetarget
          {

          sound RIP_PAPER

          ifrnd 128
            spawn CHAINGUNSPRITE
            else
            spawn SHOTGUNSPRITE
          killit
          }
ends

action GREENPRESENT 0 1 1 1 1
action REDPRESENT   4 1 1 1 1

useractor notenemy XMASPRESENT 0

ifspawnedby ELFGUN
  {
  ifaction 0 { sizeat 20 20 action REDPRESENT }
  state bluepresent
  }
  else
ifspawnedby ELFGUNSTAYPUT
  {
  ifaction 0 { sizeat 20 20 action REDPRESENT }
  state bluepresent
  }
  else
ifspawnedby ELFUZI
  {
  ifaction 0 { sizeat 20 20 action GREENPRESENT }
  state greenpresent
  }
  else
ifspawnedby ELFUZISTAYPUT
  {
  ifaction 0 { sizeat 20 20 action GREENPRESENT }
  state greenpresent
  }

enda


define NOISEMAKER 3883
action VOIDACTION
move NULLSPEED

ai MAKENOISE VOIDACTION NULLSPEED geth getv

useractor notenemy NOISEMAKER 999

sizeto 48 40
cstat 17

ifai NO { ai MAKENOISE }

ifspritepal 21
{

  ifhitweapon
  {
    ifcount 24
    {
      strength 999
      ifrnd 128
      {
        sound MOVIE2
      }
      else
      {
        sound MOVIE3
      }
      resetcount
    }
  }
}
else
{
  hitradius 4096 1 1 1 1
}

enda


define MALEGEEK 3761
useractor notenemy MALEGEEK 20


 ifhitweapon
 {
   stopsound MALECAROL
   guts JIBS6 2
   guts JIBS6 3
   guts JIBS6 4
   sound MALECAROL_DEAD
   sound MOUSEANNOY
   killit
 }
 ifdead
 {
   stopsound MALECAROL
   guts JIBS6 2
   guts JIBS6 3
   guts JIBS6 4
   sound MALECAROL_DEAD
   sound MOUSEANNOY
   killit
 }
 ifcount 225
 {
  ifcansee
  {
    sound MALECAROL
  }
  resetcount

 }

enda

define FEMALEGEEK 3823
useractor notenemy FEMALEGEEK 20


 ifhitweapon
 {
   stopsound FEMALECAROL
   guts JIBS6 2
   guts JIBS6 3
   guts JIBS6 4
   sound FEMALECAROL_DEAD
   killit
 }
 ifdead
 {
   stopsound FEMALECAROL
   guts JIBS6 2
   guts JIBS6 3
   guts JIBS6 4
   sound FEMALECAROL_DEAD
   killit
 }
 ifcount 225
 {
  ifcansee
  {
    sound FEMALECAROL
  }
  resetcount

 }

enda
