/*
BDP PP CON Files version 4.8 (2/27/97)
-----------------------------------------------------------------
This CON file is created for the BDP and may not be distributed
without any of the other files that are part of the BDP.
-----------------------------------------------------------------
Written by Shane Paluski & Joris Weimar
*/

/* *********************************************************************** */
/* Start of BDP Code Area */
/* ---------------------- */

/* New Actor Defines */

define BIGEYE          3508
define ENDOFGAMESPRITE 106
define SPRITEELEVATOR  1107
define PREDATOR        4818
define PREDSTAYPUT     4819
define HEAVYTANK       1870
// define HEATSEEKER      2610

/* User Actor Declarations */

state dukehurt
        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

/* Start Of Missle Code   */
/* ---------------------- */
//
// States:
// missleexplode:
// - causes the missle to kill itself (explosion + hitradius + sound)

define MISSLESTRENGTH 25
action AMISSLEDOWN   -5 1 6 1 7
action AMISSLEUP     -5 1 6 1 7
action AMISSLE       -5 1 6 1 7

move   MISSLEUPSPEED   300 -140
move   MISSLEDOWNSPEED 300 -38
move   MISSLESPEED     300 -140
move   MISSLEGOSPEED   300
move   MISSLEFLY       75  -200
move   MISSLEUP        0   -500

ai     AIMISSLE   AMISSLEUP MISSLEUPSPEED faceplayerslow
ai     AIMISSLE2  AMISSLE   MISSLESPEED
ai     AIMISSLEGO AMISSLE   MISSLEGOSPEED geth getv
ai     INIT AMISSLE MISSLEUP geth getv


state missleexplode
sound     PIPEBOMB_EXPLODE
hitradius 2048 10 20 30 40
spawn     EXPLOSION2
killit
ends

useractor enemy HEATSEEKER MISSLESTRENGTH AMISSLEUP
fall

ifrnd 128 spawn SMALLSMOKE

ifcansee
  {
//  ifnotmoving ifrnd 128 state missleexplode
  ifai AIMISSLEGO
    ai AIMISSLE
  }
  else
  {
  ifnotmoving state missleexplode
  ifai AIMISSLEGO
    nullop
    else
    ai AIMISSLEGO
  break
  }

ifhitweapon
  {
  ifdead
    {
    state missleexplode
    }
  }

ifai NO
   {
   cstat 32768
   ai INIT
   break
   }

ifai INIT
  {
  ifcount 2
    {
    sizeat 40 40
    cstat 257
    ai AIMISSLE
    }
  break
  }


ifai NO
  ai AIMISSLE
  else
  ifcount 150
    {
    state missleexplode
    }
    else
        ifpdistl 1024
          {
          state missleexplode
          }
          else
          ifcansee
            {
            ifai AIMISSLE
              {
              }
              else
              {
              ai AIMISSLE
              }
  }
  else
  {
  ifai AIMISSLE2
    {
    }
    else
    {
    ai AIMISSLE2
    }
  }

ifai AIMISSLE2
  {
  break
  }
  else
  ifaction AMISSLEDOWN
    {
    iffloordistl 35
      ai AIMISSLE
    ifp phigher
      ai AIMISSLE
    }
    else
    {
    ifcount 4
      {
      ifcansee
        {
        action AMISSLEDOWN
        move MISSLEDOWNSPEED faceplayerslow
        }
      }
    }


enda

/* End Of Missle Code     */
/* ---------------------- */

/* Start Of Predator Code */
/* ---------------------- */

/* Spritepal Info
0       = Firelaser
9       = Heatseeker
10      = Railgun
11      = Expander
12      = Super Railgun
13      = Shotgun
14      = Morter
15      = RPG
16      = Shrinker
-------------- */

define PRED1STRENGTH 100
define PRED2STRENGTH 200
define PRED3STRENGTH 250
define PRED4STRENGTH 400
define PRED5STRENGTH 250
define PRED6STRENGTH 400
define PRED7STRENGTH 350
define PRED8STRENGTH 200
define PRED9STRENGTH 600

action APREDWALK     0  4 5 1 20 // 1 -\
action APREDRUN      0  4 5 1 8  // 1  |
action APREDRUN2     -6 1 5 1 5  // 1  |
action APREDSTAND    -12 1 5 1 1
action APREDSHOOT    21 1 1 1 30 // 2  |
action APREDPAIN     25 1 1 1 6  // 3  |
action APREDFROZEN   0  1 5 1 1  // 1  |
action APREDDYING    25 5 1 1 16 // 3  |
action APREDDEAD     30 1 1 1 1  // 3 -/
action APREDGROW     0

move   PREDWALKVELS  170
move   PREDRUNVELS   400
move   PREDMACH1     900
move   PREDSLOWVELS  150
move   PREDJUMPVELS  600
move   PREDSTOPPED

ai     AIPREDSEEK    APREDWALK  PREDWALKVELS seekplayer
ai     AIPREDHUNT    APREDRUN   PREDRUNVELS  faceplayerslow
ai     AIPREDSHOOT   APREDSHOOT PREDSTOPPED  faceplayersmart
ai     AIPREDHIDE    APREDWALK  PREDWALKVELS seekplayer
ai     AIPREDHIDDEN  APREDWALK  PREDMACH1    faceplayerslow
ai     AIPREDSHOW    APREDWALK  PREDWALKVELS seekplayer
ai     AIPREDSTOMP   APREDWALK  PREDWALKVELS faceplayer
ai     AIPREDFLEE    APREDRUN   PREDRUNVELS  fleeenemy
ai     AIPREDHIT     APREDPAIN  PREDSTOPPED  faceplayer
ai     AIPREDGROW    APREDGROW  PREDSTOPPED  faceplayer
ai     AIPREDSHRUNK  APREDWALK  PREDSLOWVELS fleeenemy
ai     AIPREDDODGE   APREDRUN2  PREDJUMPVELS dodgebullet
ai     AIPREDFALL    APREDWALK  PREDSTOPPED  faceplayer // NEW!!!

state predstompstate
cstat 257

ifcansee nullop

ifp pshrunk
  {
  ifpdistl 1280
    {
    sound SQUISHED
    state standard_jibs
    state standard_jibs
    addphealth -1000
    break
    }
  }
  else
  ai AIPREDSEEK

ends

state predpalshootstate
ifspritepal 16
{
shoot SHRINKER
sound SHRINKER_FIRE
}
else
ifspritepal 15
{
shoot RPG
sound RPG_SHOOT
}
else
ifspritepal 14
{
shoot MORTER
sound BOS1_ATTACK2
}
else
ifspritepal 13
{
shoot SHOTGUN
shoot SHOTGUN
shoot SHOTGUN
sound SHOTGUN_FIRE
}
else
ifspritepal 12
{
shoot SHOTGUN
shoot SHOTGUN
shoot SHOTGUN
shoot SHOTGUN
shoot SHOTGUN
shoot SHOTGUN
sound SHOTGUN_FIRE
}
else
ifspritepal 10
nullop
else
ifspritepal 11
{
shoot GROWSPARK
shoot GROWSPARK
shoot GROWSPARK
sound EXPANDERSHOOT
}
else
ifspritepal 9
{
spawn HEATSEEKER
sound RPG_SHOOT
}
else
{
shoot FIRELASER
shoot FIRELASER
sound RECO_ATTACK
}

ends

state doshoot
ifcansee
  ifpdistl 2096
    {
    ai AIPREDSHOOT
    }
    else
    {
    ifcanshoottarget
      ai AIPREDSHOOT
    }

ends

state predseekstate
cstat 257

ifrnd 1
  {
  ifrnd 128
    sound PREDA_ROAM
  }

ifrnd 1
  {
  ifrnd 128
    {
    ai AIPREDHIDE
    break
    }
  }

ifpdistl 1024
  {
  ifrnd 1
    ai AIPREDHIDE
    else
    ifrnd 32
      ai AIPREDFLEE
  }
  else
ifpdistl 6000
  {
  ifrnd 16
    {
    state doshoot
    break
    }
  }
  else
  ifpdistl 12000
    {
    ifrnd 4
      state doshoot
      else
    ifai AIPREDHUNT nullop else ifcansee ai AIPREDHUNT
    }
    else
    {
    ifrnd 2
      state doshoot
      else
    ifai AIPREDSEEK nullop else ai AIPREDSEEK
    }

ifcansee nullop

ends

state predshootstate
cstat 257

ifcansee
  nullop

ifspritepal 10
  {
  ifcanshoottarget
    {
    ifcount 3
      {
      ifcansee
        {
        shoot CHAINGUN
        sound CHAINGUN_FIRE
        resetcount
        }
      }
    }
  ifrnd 2
    {
    ai AIPREDHUNT
    resetcount
    break
    }
  ifactioncount 4
    {
    ifrnd 200
      ai AIPREDHUNT
    resetactioncount
    break
    }
  }
  else

ifactioncount 3
  {
  ifcansee
    {
    ifcanshoottarget
      {
      state predpalshootstate
      resetactioncount
      ifrnd 196
        ai AIPREDSEEK
      }
      else
      ai AIPREDSEEK
    }
  }

ends

state predhidestate
spawn FRAMEEFFECT1

ifai AIPREDHIDDEN
  {
  ifcount 64
    {
    ai AIPREDSHOW
    resetcount
    }
  ifcansee nullop
  break
  }
  else
  {

ifcount 10
  nullop
  else
  ifcount 9
    {
    cstat 2
    }
ifcount 20
  nullop
  else
  ifcount 19
    {
    cstat 514
    }
ifcount 30
  nullop
  else
  ifcount 29
    {
    resetcount
    cstat 32768
    ai AIPREDHIDDEN
    }
   }


ends

state predammostate

ifrnd 128
  {
  ifspritepal 16 { ifrnd 128 spawn SHRINKERSPRITE else spawn CRYSTALAMMO }
  else
  ifspritepal 15 { ifrnd 128 spawn RPGSPRITE else spawn RPGAMMO }
  else
  ifspritepal 14 { spawn MORTER }
  else
  ifspritepal 13 { ifrnd 128 spawn SHOTGUNSPRITE else spawn SHOTGUNAMMO }
  else
  ifspritepal 12 { ifrnd 128 spawn SHOTGUNSPRITE else spawn SHOTGUNAMMO }
  else
  ifspritepal 11 { ifrnd 128 spawn GROWAMMO }
  else
  ifspritepal 10 { ifrnd 128 spawn CHAINGUNSPRITE else spawn BATTERYAMMO }
  }

ends

state predshowstate
spawn FRAMEEFFECT1

ifcount 10
  nullop
  else
  ifcount 9
    {
    cstat 514
    }
ifcount 20
  nullop
  else
  ifcount 19
    {
    cstat 2
    }
ifcount 30
  nullop
  else
  ifcount 29
    {
    resetcount
    cstat 257
    ifrnd 192
      state doshoot
      else
      ai AIPREDSEEK
    }

ends

state predfleestate
cstat 257

ifcansee nullop else ai AIPREDSEEK

ifpdistg 3000
  {
  ai AIPREDSEEK
  }
  else
  ifrnd 2
    ai AIPREDHIDE

ifcount 5
  ai AIPREDSEEK

ifrnd 1
  state doshoot

ends

state predhitstate
cstat 257

ifdead
  {
  spawn BLOODPOOL
  ifwasweapon FREEZEBLAST
    {
    state genericcdcode
    break
    }


  state random_wall_jibs
  shoot BLOODSPLAT1
  shoot BLOODSPLAT3
  shoot BLOODSPLAT2

  ifwasweapon GROWSPARK
    {
    cstat 0
    sound ACTOR_GROWING
    ai AIPREDGROW
    break
    }
    else state predammostate

  addkills 1

  ifwasweapon RPG
    {
    sound SQUISHED
    state standard_jibs
    state standard_jibs
    state standard_jibs
    state standard_jibs
    state random_wall_jibs
    shoot BLOODSPLAT2
    shoot BLOODSPLAT3
    killit
    }
    else
  ifwasweapon RADIUSEXPLOSION
    {
    sound SQUISHED
    state standard_jibs
    state standard_jibs
    state standard_jibs
    state standard_jibs
    shoot BLOODSPLAT1
    shoot BLOODSPLAT2
    state random_wall_jibs
    killit
    }
    else
    {
    sound PREDA_DYING
    action APREDDYING
    break
    }

  }
  else
  {
  state random_wall_jibs
  shoot BLOODSPLAT1
  shoot BLOODSPLAT2
  shoot BLOODSPLAT1
  sound PREDA_PAIN

  ifwasweapon SHRINKSPARK
    {
    sound ACTOR_SHRINKING
    ai AIPREDSHRUNK
    break
    }
    else
    ifwasweapon GROWSPARK
      sound EXPANDERHIT

    ifrnd 24
      state predpalshootstate
      else
      ifrnd 12
        ai AIPREDHIDE

  }

ifactioncount 2
  {
  resetactioncount
  ai AIPREDSEEK
  }

ends

state preddodgestate
cstat 257

ifcansee nullop else ai AIPREDSEEK

ifcount 5
  {
  resetcount
  ifbulletnear
    nullop
    else
    ai AIPREDSEEK
  }

ends


state predshrunkstate
cstat 257
ifcount SHRUNKDONECOUNT
  ai AIPREDSEEK
  else
  ifcount SHRUNKCOUNT
  sizeto 46 38
  else
  state genericshrunkcode
ends

state predsetstrength

ifspritepal 0 strength PRED1STRENGTH
else
ifspritepal 9 strength PRED9STRENGTH
else
ifspritepal 10 strength PRED2STRENGTH
else
ifspritepal 11 strength PRED3STRENGTH
else
ifspritepal 12 strength PRED4STRENGTH
else
ifspritepal 13 strength PRED5STRENGTH
else
ifspritepal 14 strength PRED6STRENGTH
else
ifspritepal 15 strength PRED7STRENGTH
else
ifspritepal 16 strength PRED8STRENGTH

ends

useractor enemystayput PREDSTAYPUT PRED1STRENGTH
  ai AIPREDSEEK
  cactor PREDATOR
enda
useractor enemy PREDATOR PRED1STRENGTH APREDSTAND
fall

ifaction APREDDYING
  {
  ifactioncount 5
    {
    action APREDDEAD
    }
  break
  }
  else
  {
  ifaction APREDDEAD
    {
    }
    else
    {
    ifdead
      {
      action APREDDYING
      break
      }
    }
  }

ifaction APREDDEAD
  {
  cstat 0
  strength 0
  ifrespawn
    ifcount RESPAWNACTORTIME
      {
      spawn TRANSPORTERSTAR
      cstat 257
      state predsetstrength
      ai AIPREDSEEK
      }
  ifhitweapon
    {
    ifwasweapon RADIUSEXPLOSION
      {
      sound SQUISHED
      state standard_jibs
      state standard_jibs
      state standard_jibs
      shoot BLOODSPLAT2
      shoot BLOODSPLAT3
      state random_wall_jibs
      killit
      }
    break
    }
    else
      state checksquished
  break
  }

/*
iffloordistl 20
  {
  ifai AIPREDFALL
    {
    ai AIPREDSEEK
    }
  }
  else
  {
  ifai AIPREDFALL
    {
    break
    }
    else
    ai AIPREDFALL
  }
*/

state checksquished

ifai NO
{
sizeat 42 36
state predsetstrength
sound PREDA_RECO
ifrnd 150
  {
  ai AIPREDHUNT
  state doshoot
  }
  else
  {
  ifrnd 128
    {
    ai AIPREDSEEK
    }
    else
    {
    ai AIPREDHIDE
    }
  }

}



ifrnd 2
  operate

ifai AIPREDSHRUNK
  {
  state predshrunkstate
  break
  }

ifp pdead
  {
  ifcansee nullop
  break
  }
  else
  ifp pshrunk
  {
  ifai AIPREDSTOMP nullop else { ai AIPREDSTOMP break }
  }


ifhitweapon
  {
  ai AIPREDHIT
  }
  else
  {
  ifbulletnear
    {
    ifai AIPREDHIDE nullop
    else ifai AIPREDHIDDEN nullop
    else ifai AIPREDSHOW nullop
    else
    ifrnd 256
      {
      ai AIPREDDODGE
      }
    }
  }

ifai AIPREDSEEK state predseekstate
else
ifai AIPREDHUNT state predseekstate
else
ifai AIPREDSHOOT state predshootstate
else
ifai AIPREDHIDE state predhidestate
else
ifai AIPREDHIDDEN state predhidestate
else
ifai AIPREDSHOW state predshowstate
else
ifai AIPREDSTOMP state predstompstate
else
ifai AIPREDFLEE state predfleestate
else
ifai AIPREDHIT state predhitstate
else
ifai AIPREDGROW state genericgrowcode
else
ifai AIPREDDODGE state preddodgestate
enda

/* End Of Predator Code   */
/* ---------------------- */


/* LilBot Code    */
define LILBOT 3687
define LILBOT_NORMAL_STRENGTH 100

action LILBOT_ANIMATIONS  0 2 1 1 10
move LILBOT_SPEEDS 64

ai AILILBOT_FLY LILBOT_ANIMATIONS LILBOT_SPEEDS geth randomangle

useractor notenemy LILBOT

   ifai NO
   {
      strength LILBOT_NORMAL_STRENGTH
      sizeat 12 12
      cstat 257
      ai AILILBOT_FLY
   }

   ifrnd 2
   {
      sound BEEPY1
   }

   ifhitweapon
   {
      debris SCRAP1 2

      ifdead
      {
         spawn EXPLOSION2
         sound PIPEBOMB_EXPLODE
         sound DRON_PAIN
         hitradius 2048 WEAKEST WEAK MEDIUMSTRENGTH TOUGH
         ifcount 15
         {
            sound YIPPEE1
         }
         killit
      }

      sound DRON_PAIN
   }
   ifcount 48
     ai AILILBOT_FLY
enda
/* End of LilBot Code */
/* -------------------- */

/* Impaled Code */
/* -------------------- */
define DOOGUY1 3784
useractor notenemy DOOGUY1 TOUGH
  ifhitweapon
  {
       shoot BLOODSPLAT2
       ifdead
       {
          guts JIBS2 1
          guts JIBS3 2
          guts JIBS6 3
          sound SQUISHED
          shoot BLOODSPLAT1
          spawn BLOODPOOL
          killit
       }
    }
enda

define DOOGUY2 3780
useractor notenemy DOOGUY2 TOUGH
  ifhitweapon
  {
       shoot BLOODSPLAT1
       ifdead
       {
          guts JIBS2 1
          guts JIBS4 2
          guts JIBS5 3
          sound SQUISHED
          shoot BLOODSPLAT1
          killit
       }
  }
enda

define JEFFGUY 3829
useractor notenemy JEFFGUY TOUGH
   ifhitweapon
   {
      shoot BLOODSPLAT1
      ifdead
      {
         guts JIBS2 3
         guts JIBS5 4
         sound SQUISHED
         shoot BLOODSPLAT2
         sound BOS1_PAIN
         killit
      }
   }
enda

/* End of Impaled Code    */
/* ---------------------- */

/* Lamps Code             */
/* ---------------------- */
define LAMPS1  4056
define LAMPS2  4057
define LAMPS3  4058
define LAMPS4  4061
define LAMPS5  4026
define LAMPS6  4067
define LAMPS7  4069
define LAMPS8  4070
define LAMPS9  4032
define LAMPS10 4033
define LAMPS11 4034
define LAMPS12 4049
define LAMPS13 4050
define LAMPS14 4051
define LAMPS15 4053
define LAMPS16 4060
define LAMPS17 4064
define LAMPS18 4068
define LAMPS19 5126
define LAMPS20 5141

state jibbme
    debris SCRAP3 3
    debris SCRAP4 2
    lotsofglass 10
    sound GLASS_BREAKING
    killit
ends

state lampsbreak
   ifhitweapon
   {
      ifdead
      {
         state jibbme
      }
   }
ends

useractor notenemy LAMPS1  TOUGH state lampsbreak enda
useractor notenemy LAMPS2  TOUGH state lampsbreak enda
useractor notenemy LAMPS3  TOUGH state lampsbreak enda
useractor notenemy LAMPS4  TOUGH state lampsbreak enda
useractor notenemy LAMPS5  TOUGH state lampsbreak enda
useractor notenemy LAMPS6  TOUGH state lampsbreak enda
useractor notenemy LAMPS7  TOUGH state lampsbreak enda
useractor notenemy LAMPS8  TOUGH state lampsbreak enda
useractor notenemy LAMPS9  TOUGH state lampsbreak enda
useractor notenemy LAMPS10 TOUGH state lampsbreak enda
useractor notenemy LAMPS11 TOUGH state lampsbreak enda
useractor notenemy LAMPS12 TOUGH state lampsbreak enda
useractor notenemy LAMPS13 TOUGH state lampsbreak enda
useractor notenemy LAMPS14 TOUGH state lampsbreak enda
useractor notenemy LAMPS15 TOUGH state lampsbreak enda
useractor notenemy LAMPS16 TOUGH state lampsbreak enda
useractor notenemy LAMPS17 TOUGH state lampsbreak enda
useractor notenemy LAMPS18 TOUGH state lampsbreak enda
useractor notenemy LAMPS19 TOUGH state lampsbreak enda
useractor notenemy LAMPS20 TOUGH state lampsbreak enda


/* End of Lamps Code      */
/* ---------------------- */


/* Trashbag code */
/* ------------- */
define TBAG1 4072
define TBAG2 4073
define TBAG3 4074
define TBAG4 4075

state tabust
   debris SCRAP1 5
   debris SCRAP2 5
   debris SCRAP3 5
   spawn RAT
   spawn RAT
   mail 10
   sound GLASS_HEAVYBREAK
   ifrnd 20
      spawn SIXPAK
   killit
ends

state trashhit
   ifhitweapon
   {
      ifwasweapon RADIUSEXPLOSION
        {
        spawn BURNING
        state tabust
        }
      else
      ifwasweapon RPG
        {
        spawn BURNING
        state tabust
        }
      ifdead
      {
         ifwasweapon RADIUSEXPLOSION { spawn BURNING }
         state tabust
      }
   }
ends

useractor notenemy TBAG1 TOUGH state trashhit enda
useractor notenemy TBAG2 TOUGH state trashhit enda
useractor notenemy TBAG3 TOUGH state trashhit enda
useractor notenemy TBAG4 TOUGH state trashhit enda

/* End of Trashbag Code */
/* -------------------- */

/* Mummy code */
/* ---------- */
define MYMUMMY 5130
state mummybust
  debris SCRAP4 3
  debris SCRAP1 4
  sound COLDBREZ
  spawn RAT
  killit
ends
state mummhit
  ifhitweapon
  {
    ifdead
    {
    state mummybust
    }
  }
ends
useractor notenemy MYMUMMY TOUGH state mummhit enda
/* End of Mummy Code */
/* ----------------- */

/* Start of HeavyTank code */
/* --------------------    */

define HEAVYTANKSTRENGTH   400

action ATANK3D             0 1 7 1 1

move TANKSPEED             150
move TANKSHOOTSPEED        45
move TANKFLEESPEED         -150
move TANKSTOPPED

ai AITANKSEE   ATANK3D     TANKSPEED      faceplayerslow
ai AITANKSEEK  ATANK3D     TANKSPEED      seekplayer
ai AITANKSHOOT ATANK3D     TANKSHOOTSPEED faceplayerslow
ai AITANKFLEE  ATANK3D     TANKFLEESPEED  faceplayer
ai AITANKSTAND ATANK3D     TANKSTOPPED    geth getv

state tankseestate
soundonce TANK_ROAM

ifpdistl 1000
  ai AITANKFLEE

ifcansee
  {
ifpdistl 6000
  {
  ifcanshoottarget
    ifcount 10
      ifrnd 40
        {
        count 0
        ai AITANKSHOOT
        break
        }
  }
  else
  {
ifpdistl 12000
    ifcount 10
      ifrnd 12
        {
        count 0
        ai AITANKSHOOT
        break
        }
  }
  }
  else
  {
  ai AITANKSEEK
  break
  }



ends

state tankseekstate
soundonce TANK_ROAM

ifcansee
  {
  ai AITANKSEE
  break
  }

ends

state tankshootstate

ifcansee
  {
  ifactioncount 2
    {
    resetactioncount
    shoot CHAINGUN
    sound PISTOL_FIRE
   }
  }
  else
  {
  ai AITANKSEEK
  }

ifcount 50 ai AITANKSEEK

ifrnd 6
  ai AITANKSEEK

ends

state tankhitstate

ifdead
  {
  sound LASERTRIP_EXPLODE
  spawn EXPLOSION2
  spawn EXPLOSION2
  hitradius 6144 TOUGH TOUGH TOUGH TOUGH
  debris SCRAP1 15
  addkills 1
  ifrnd 128 spawn PIGCOP
  killit
  }
  else
  {
  debris SCRAP1 3
  ifrnd 192
    ai AITANKSHOOT
  }


ends

state tankfleestate
soundonce TANK_ROAM

ifcansee nullop

ifpdistg 5000 ai AITANKSHOOT

ends

useractor enemy HEAVYTANK HEAVYTANKSTRENGTH ATANK3D AITANKSTAND
fall

ifai NO
  {
  ai AITANKSEEK
  }

ifhitweapon
  {
  state tankhitstate
  }
  else
ifai AITANKSEE
  state tankseestate
    else
ifai AITANKSEEK
  state tankseekstate
    else
ifai AITANKSHOOT
  state tankshootstate
    else
ifai AITANKFLEE
  state tankfleestate

enda
/* End of HeavyTank Code */
/* --------------------- */

/* Charger Code */
/* ------------ */
define JPCHARGER 3617
action JETCHARGE 1 1 1 1 1

useractor notenemy JPCHARGER
   sizeat 17 17
   ifaction JETCHARGE
     {
     ifactioncount 200
       {
       sound SWITCH_ON
       action ANULLACTION
       break
       }
     }
     else
       ifhitspace
         ifp palive
           ifpdistl RETRIEVEDISTANCE
             ifcount 6
               ifcanseetarget
     {
     ifpinventory GET_JETPACK 30
       {
       addinventory GET_JETPACK JETPACK_AMOUNT
       sound SWITCH_ON
       sound DUKE_JETPACK_ON
       action JETCHARGE
       quote 125
       }
     else
       sound SWITCH_ON
       action JETCHARGE
     }
enda

define SCUBARECH 3722
action SCUBAFILL 0 1 0 1 5

useractor notenemy SCUBARECH
  sizeat 15 15
  ifaction SCUBAFILL
    {
    ifactioncount 200
      {
      sound TEKSWTCH
      action ANULLACTION
      break
      }
    }
    else
      ifhitspace
        ifp palive
          ifpdistl RETRIEVEDISTANCE
            ifcount 6
              ifcanseetarget
    {
    ifpinventory GET_SCUBA 30
      {
      addinventory GET_SCUBA SCUBA_AMOUNT
      sound TEKSWTCH
      action SCUBAFILL
      quote 126
      }
    else
      sound TEKSWTCH
      action SCUBAFILL
    }
enda

/* End of Charger Code */
/* ------------------- */

/* Watermaker Code */
/* --------------- */

define WATERMAKER 555

state watstart
  debris SCRAP3 3
  debris SCRAP4 3
  debris SCRAP2 2
  sound GLASS_HEAVYBREAK
  spawn TOILETWATER
ends

state watbreak
  sizeat 10 10
  ifhitweapon
  {
  ifdead
    {
    state watstart
    }
  }
ends

useractor notenemy WATERMAKER TOUGH state watbreak enda
/* End of Watermaker Code */
/* ---------------------- */

/* Breakable Screens Code */
/* ---------------------- */
define JEFFSCR1 4991
define JEFFSCR2 4995

state jeffscrbreak
  lotsofglass 20
  sound GLASS_HEAVYBREAK
  cactor JEFFSCR2
ends

state jeffscrhit
  ifhitweapon
  {
    ifdead
    {
    state jeffscrbreak
    }
  }
ends

useractor notenemy JEFFSCR1 TOUGH state jeffscrhit enda

/* End of Breakable Screens Code */
/* ----------------------------- */


//
//
//    TROOP/LIZTROOP CODE
//
//

action ATROOPSTAND     0  1  5  1  1
action ATROOPGROW    0  1  5  1  1
action ATROOPSTAYSTAND  -2  1  5  1  1
action ATROOPWALKING   0  4  5  1   12
action ATROOPWALKINGBACK 15   4  5   -1   12
action ATROOPRUNNING   0  4  5  1  8
action ATROOPSHOOT    35  1  5  1   30
action ATROOPJETPACK  40  1  5  1  1
action ATROOPJETPACKILL 40  2  5  1   50
action ATROOPFLINTCH  50  1  1  1  6
action ATROOPDYING    50  5  1  1   16
action ATROOPDEAD     54
action ATROOPPLAYDEAD   54
action ATROOPSUFFERDEAD 58  2  1   -4   24
action ATROOPSUFFERING  59  2  1  1   21
action ATROOPDUCK     64  1  5  1  3
action ATROOPDUCKSHOOT  64  2  5  1   25
action ATROOPABOUTHIDE  74  1  1  1   25
action ATROOPHIDE     79  1  1  1   25
action ATROOPREAPPEAR   74  1  1  1   25
action ATROOPFROZEN    0  1  5

move TROOPWALKVELS 72
move TROOPWALKVELSBACK -72
move TROOPJETPACKVELS 64 -84
move TROOPJETPACKILLVELS 192 -38
move TROOPRUNVELS 108
move TROOPSTOPPED
move DONTGETUP

ai AITROOPSEEKENEMY  ATROOPWALKING   TROOPWALKVELS seekplayer
ai AITROOPSEEKPLAYER ATROOPWALKING   TROOPWALKVELS seekplayer
ai AITROOPFLEEING  ATROOPWALKING   TROOPWALKVELS fleeenemy
ai AITROOPFLEEINGBACK ATROOPWALKINGBACK   TROOPWALKVELSBACK faceplayer
ai AITROOPDODGE    ATROOPWALKING   TROOPRUNVELS  dodgebullet
ai AITROOPSHOOTING   ATROOPSHOOT   TROOPSTOPPED  faceplayer
ai AITROOPDUCKING  ATROOPDUCK    TROOPSTOPPED  faceplayer
ai AITROOPJETPACK  ATROOPJETPACK   TROOPJETPACKVELS seekplayer
ai AITROOPSHRUNK   ATROOPWALKING   SHRUNKVELS fleeenemy
ai AITROOPHIDE     ATROOPABOUTHIDE TROOPSTOPPED faceplayer
ai AITROOPGROW     ATROOPGROW    DONTGETUP faceplayerslow
ai AITROOPMORPH    ATROOPSTAND   TROOPSTOPPED geth getv

state troophidestate
  ifaction ATROOPREAPPEAR
  {
    ifactioncount 2
    {
      sound TELEPORTER
      ai AITROOPSHOOTING
      cstat 257
    }
    else
    {
      sizeto 41 40
      sizeto 41 40
      sizeto 41 40
      sizeto 41 40
      spawn FRAMEEFFECT1
    }
  }
  else
    ifaction ATROOPWALKING
  {
    ifpdistl 2448
      ifpdistg 1024
    {
      ifceilingdistl 48
        break
      ifp pfacing
        break

      ifgapzl 64 nullop
      else
        ifawayfromwall
      {
        spawn TRANSPORTERSTAR
        action ATROOPREAPPEAR
        move 0
        break
      }
    }
  }
  else
    ifaction ATROOPHIDE
  {
    ifactioncount 2
    {
      spawn TRANSPORTERSTAR
      sound TELEPORTER
      action ATROOPWALKING
      move TROOPWALKVELS faceplayer
      cstat 32768
    }
    else
    {
      sizeto 4 40
      sizeto 4 40
      sizeto 4 40
      sizeto 4 40
      spawn FRAMEEFFECT1
    }
  }
  else
    ifaction ATROOPABOUTHIDE
      ifactioncount 2
    {
      action ATROOPHIDE
      cstat 0
    }
ends


state troopgunnashoot
  ifp palive
  {
    ifpdistl 1024
      ai AITROOPSHOOTING
    else
      ifactornotstayput
    {
      ifactioncount 12
        ifrnd 16
          ifcanshoottarget
      {
        ifspritepal 21
          ifrnd 4
            ifpdistg 4096
              ai AITROOPHIDE
        else
        {
          ifpdistl 1100
            ai AITROOPFLEEING
          else
          {
            ifpdistl 4096
              ifcansee
                ifcanshoottarget
                  ai AITROOPSHOOTING
            else
            {
              move TROOPRUNVELS seekplayer
              action ATROOPRUNNING
            }
          }
        }
      }
    }
    else
      ifcount 26
        ifrnd 32
          ai AITROOPSHOOTING
  }
ends

state troopseekstate
  state troopgunnashoot

    ifcansee
      {
      ifrnd 3
        {
        ifspritepal 5
          ai AITROOPMORPH
        ifspritepal 3
          ai AITROOPMORPH
        ifspritepal 9
          ai AITROOPMORPH
        }
      }

  ifinwater
  {
    ai AITROOPJETPACK
    break
  }
  ifcansee
  {
    ifmove TROOPRUNVELS
      ifpdistl 1596
        ai AITROOPDUCKING
    ifp phigher
    {
      ifceilingdistl 128 nullop
      else
        ifactornotstayput
          ai AITROOPJETPACK
      break
    }
    else
      ifrnd 2
    {
      ifspritepal 21
        ifpdistg 1596
      {
        ai AITROOPHIDE
        break
      }
      ifbulletnear
      {
        ifrnd 128
          ai AITROOPDODGE
        else
          ai AITROOPDUCKING
        break
      }
    }
  }
  ifnotmoving
  {
    ifrnd 32
      operate
    else
      ifcount 32
        ifp palive
          ifcansee
            ifcanshoottarget
              ai AITROOPSHOOTING
  }
  ifrnd 1
  {
    ifrnd 128
      soundonce PRED_ROAM
    else
      soundonce PRED_ROAM2
  }
ends

state troopduckstate
  ifaction ATROOPDUCK
  {
    ifactioncount 8
    {
      ifp palive
      {
        ifrnd 128
          action ATROOPDUCKSHOOT
      }
      else
        ifmove DONTGETUP
          break
        else
          ai AITROOPSEEKPLAYER
    }
  }
  else
    ifaction ATROOPDUCKSHOOT
  {
    ifcount 64
    {
      ifmove DONTGETUP
        resetcount
      else
      {
        ifpdistl 1100
          ai AITROOPFLEEING
        else
          ai AITROOPSEEKPLAYER
      }
    }
    else
      ifactioncount 2
      {
        ifcanshoottarget
        {
          sound RECO_ATTACK
          resetactioncount
          shoot FIRELASER
        }
        else ai AITROOPSEEKPLAYER
      }
  }
ends

state troopshootstate
  ifactioncount 2
  {
    ifcanshoottarget
    {
      shoot FIRELASER
      sound RECO_ATTACK
      resetactioncount
      ifrnd 128
        ai AITROOPSEEKPLAYER
      ifcount 24
      {
        ifrnd 96
          ifpdistg 2048
            ai AITROOPSEEKPLAYER
          else
          {
            ifpdistg 1596
              ai AITROOPFLEEING
            else
              ai AITROOPFLEEINGBACK
          }
      }
    }
    else
      ai AITROOPSEEKPLAYER
  }
ends

state troopfleestate
  ifactioncount 7
  {
    ifpdistg 3084
    {
      ai AITROOPSEEKPLAYER
      break
    }
    else
      ifrnd 32
        ifp palive
          ifcansee
            ifcanshoottarget
      {
        ifrnd 128
          ai AITROOPDUCKING
        else
          ai AITROOPSHOOTING
          break
      }
  }
  ifnotmoving
  {
    ifrnd 32
      operate
    else
      ifcount 32
        ifp palive
          ifcansee
            ifcanshoottarget
      {
        ifrnd 128
          ai AITROOPSHOOTING
        else
          ai AITROOPDUCKING
      }
  }
ends

state troopdying
  iffloordistl 32
  {
    ifactioncount 5
    {
      cstat 0
      iffloordistl 8
      sound THUD
      ifrnd 64
        spawn BLOODPOOL
      state rf
      strength 0
      move TROOPSTOPPED
      action ATROOPDEAD
    }
    break
  }
  else
  {
    state rf
    move 0
    action ATROOPDYING
  }
ends

state checktroophit
  ifaction ATROOPSUFFERING
  {
    stopsound LIZARD_BEG
    sound CAPT_DYING
    cstat 0
    strength 0
    action ATROOPSUFFERDEAD
    break
  }
  ifdead
  {
    ifwasweapon FREEZEBLAST
    {
      state genericcdcode
      break
    }

    state drop_ammo
    state random_wall_jibs

    ifwasweapon GROWSPARK
    {
      cstat 0
      sound ACTOR_GROWING
      ai AITROOPGROW
      break
    }

    addkills 1

    ifwasweapon RPG
    {
      sound SQUISHED
      state troop_body_jibs
      state standard_jibs
      killit
    }
    else
      ifwasweapon RADIUSEXPLOSION
    {
      sound SQUISHED
      state troop_body_jibs
      state standard_jibs
      killit
    }
    else
    {
      sound PRED_DYING
      ifrnd 32
        iffloordistl 32
      {
        sound LIZARD_BEG
        spawn BLOODPOOL
        strength 0
        move 0
        action ATROOPSUFFERING
        break
      }
      action ATROOPDYING
      break
    }
  }
  else
  {
    state random_wall_jibs
    sound PRED_PAIN

    ifwasweapon SHRINKSPARK
    {
      sound ACTOR_SHRINKING
      ai AITROOPSHRUNK
    }
    else
      ifwasweapon GROWSPARK
        sound EXPANDERHIT
    else
      iffloordistl 32
        ifrnd 96
          action ATROOPFLINTCH
  }
ends

state troopjetpackstate
  ifaction ATROOPJETPACKILL
  {
    ifcansee
      ifactioncount 2
    {
      resetactioncount
      sound RECO_ATTACK
      shoot FIRELASER
    }

    ifp phigher
      ai AITROOPJETPACK
    else
      ifinwater
        ai AITROOPJETPACK
    else
      ifcount 26
        iffloordistl 32
          ai AITROOPSEEKPLAYER
  }
  else
    ifcount 48
      ifcansee
  {
    action ATROOPJETPACKILL
    move TROOPJETPACKILLVELS
    seekplayer
  }
ends

state checksquished
  ifsquished
  {
    addkills 1
    sound SQUISHED
    state standard_jibs
    state random_ooz
    killit
  }
ends

state troopsufferingstate
  ifactioncount 2
  {
    ifrnd 16
      spawn WATERDRIP
    ifactioncount 14
    {
      stopsound LIZARD_BEG
      cstat 0
      strength 0
      action ATROOPSUFFERDEAD
      break
    }
  }
ends

state troopshrunkstate
  ifcount SHRUNKDONECOUNT
    ai AITROOPSEEKENEMY
  else
    ifcount SHRUNKCOUNT
      sizeto 48 40
  else
    state genericshrunkcode
ends


state troopcode fall

  ifai AITROOPMORPH
    {
    ifcount 2 nullop else
       {
       soundonce MORPHING
       ifspritepal 5
         {
         spawn PIGCOPMORPH
         }
         else
         {
       ifspritepal 3
         {
         spawn LIZMANMORPH
         }
         else
         {
         spawn OCTAMORPH
         }
         }
       }

    ifcount 16 nullop else ifcount 15 { cstat 2 }
    ifcount 31 nullop else ifcount 30 { cstat 514 }
    ifcount 45 { killit }
    break
    }

  ifinwater
    ifrnd 1
      spawn WATERBUBBLE
  ifaction ATROOPSTAND
  {
    ifrnd 192
      ai AITROOPSHOOTING
    else
      ai AITROOPSEEKPLAYER
  }
  else ifaction ATROOPPLAYDEAD
  {
  cstat 0
    ifhitweapon
    {

      ifwasweapon RADIUSEXPLOSION
      {
        sound SQUISHED
        state troop_body_jibs
        state standard_jibs
        killit
      }
      break
    }
    else
      state checksquished

    ifcount PLAYDEADTIME
    {
      addkills -1
      soundonce CAPT_ROAM
      cstat 257
      strength 1
      ai AITROOPSHOOTING
    }
    else
      ifp pfacing
        resetcount

    break
  }
  else
    ifaction ATROOPDEAD
  {
    strength 0
    ifrespawn
      ifcount RESPAWNACTORTIME
    {
      spawn TRANSPORTERSTAR
      cstat 257
      strength TROOPSTRENGTH
      ai AITROOPSEEKENEMY
    }
    ifhitweapon
    {
      ifwasweapon RADIUSEXPLOSION
      {
        sound SQUISHED
        state troop_body_jibs
        state standard_jibs
        killit
      }
      break
    }
    else
      state checksquished
    break
  }
  else
    ifaction ATROOPSUFFERDEAD
  {
    ifactioncount 2
    {
      ifrnd 64
      {
        resetcount
        action ATROOPPLAYDEAD
      }
      else
      {
        soundonce CAPT_DYING
        action ATROOPDEAD
      }
    }
  }
  else
    ifaction ATROOPDYING
  {
    state troopdying
    break
  }
  else
    ifaction ATROOPSUFFERING
  {
    state troopsufferingstate
    ifhitweapon
      state checktroophit
    break
  }
  else
    ifaction ATROOPFLINTCH
  {
    ifactioncount 4
      ai AITROOPSEEKENEMY
  }
  else
  {
    ifai AITROOPSEEKPLAYER
      state troopseekstate
    else
      ifai AITROOPJETPACK
    {
      state troopjetpackstate
      ifinwater nullop
      else
        soundonce DUKE_JETPACK_IDLE
    }
    else
      ifai AITROOPSEEKENEMY
        state troopseekstate
    else
      ifai AITROOPSHOOTING
        state troopshootstate
    else
      ifai AITROOPFLEEING
        state troopfleestate
    else
      ifai AITROOPFLEEINGBACK
        state troopfleestate
    else
      ifai AITROOPDODGE
        state troopseekstate
    else
      ifai AITROOPDUCKING
        state troopduckstate
    else
      ifai AITROOPSHRUNK
        state troopshrunkstate
    else
      ifai AITROOPGROW
        state genericgrowcode
    else
      ifai AITROOPHIDE
    {
      state troophidestate
      break
    }
  }

  ifhitweapon
    state checktroophit
  else
    state checksquished
ends

state checktrooppalette
  ifai 0
  {
    ifspritepal 0
        nullop
    else
        ifspritepal 21
          addstrength TROOPSTRENGTH // Double the hitpoint vals
  }
ends


actor LIZTROOPJETPACK TROOPSTRENGTH
  state checktrooppalette
  ai AITROOPJETPACK
  cactor LIZTROOP
enda

actor LIZTROOPDUCKING TROOPSTRENGTH
  state checktrooppalette
  ai AITROOPDUCKING
  cactor LIZTROOP
  ifgapzl 48
    move DONTGETUP
enda

actor LIZTROOPSHOOT TROOPSTRENGTH ATROOPSTAND
  state checktrooppalette
  ai AITROOPSHOOTING
  cactor LIZTROOP
enda
actor LIZTROOPSTAYPUT TROOPSTRENGTH ATROOPSTAYSTAND
  state checktrooppalette
  ai AITROOPSEEKPLAYER
  cactor LIZTROOP
enda
actor LIZTROOPRUNNING TROOPSTRENGTH ATROOPSTAND
  state checktrooppalette
  ai AITROOPSEEKPLAYER
  cactor LIZTROOP
enda
actor LIZTROOPONTOILET TROOPSTRENGTH
  ifcount 24
  {
    sound FLUSH_TOILET
    operate
    ai AITROOPSEEKPLAYER
    cactor LIZTROOP
  }
  else
    ifcount 2
      nullop
  else
    state checktrooppalette
enda

actor LIZTROOPJUSTSIT TROOPSTRENGTH
  ifcount 30
  {
    operate
    ai AITROOPSEEKPLAYER
    cactor LIZTROOP
  }
  else
    ifcount 2
      nullop
  else
    state checktrooppalette
enda


actor LIZTROOP TROOPSTRENGTH ATROOPSTAND
  state checktrooppalette
  state troopcode
enda
/* End of Liz Troop Code */
/* --------------------- */

/* Start of Sprite Elevator Code */
/* ----------------------------- */

/*
spritepal 0 = space for up, auto down
spritepal 1 = space for up, space for down
spritepal 2 = auto up, auto down
spritepal 3 = auto up, space for down
*/

action ELEVATOR 0
move elevupspeed 0 -100
move elevdownspeed 0 100
move elevstopped 0

ai AIELEVUP ELEVATOR elevupspeed geth getv
ai AIELEVDOWN ELEVATOR elevdownspeed geth getv
ai AIELEVWAITDOWN ELEVATOR elevstopped geth getv
ai AIELEVWAITUP ELEVATOR elevstopped geth getv

define ELEVSTR 100

useractor notenemy SPRITEELEVATOR ELEVSTR ELEVATOR
strength ELEVSTR

  ifhitweapon
    {
    ifwasweapon SHOTSPARK1
      {
      ifai AIELEVWAITUP
        {
        sound ELEVATOR_ON
        ai AIELEVDOWN
        break
        }
        else
      ifai AIELEVWAITDOWN
        {
        sound ELEVATOR_ON
        ai AIELEVUP
        break
        }
      }
    }

ifai NO
  {
  clipdist 64
  ifspritepal 0 { ai AIELEVWAITDOWN }
  else
  ifspritepal 5 { spritepal 0 ai AIELEVWAITUP }
  else
  ifspritepal 9 { spritepal 5 ai AIELEVWAITDOWN }
  else
  ifspritepal 25 { spritepal 5 ai AIELEVWAITUP }
  else
  ifspritepal 3 { spritepal 9 ai AIELEVWAITDOWN }
  else
  ifspritepal 11 { spritepal 9 ai AIELEVWAITUP }
  }

ifai AIELEVWAITDOWN
  {
    ifpdistl 1024
      {
      ifcansee
        {
       ifspritepal 2
         {
         sound ELEVATOR_ON
         ai AIELEVUP
         }
         else
         {
         ifspritepal 3
           {
           sound ELEVATOR_ON
           ai AIELEVUP
           }
           else
           {
           ifhitspace
             {
             sound ELEVATOR_ON
             ai AIELEVUP
             }
           }
         }
       }
      }
  }
  else
ifai AIELEVUP
  {
  ifspritepal 0
    {
  iffloordistl 300
    {
    }
    else
    {
    sound ELEVATOR_OFF
    ai AIELEVWAITUP
    }
    }
    else
    ifspritepal 5
    {
    ifceilingdistl 70
      {
      sound ELEVATOR_OFF
      ai AIELEVWAITUP
      }
    }
    else
    ifspritepal 9
    {
  iffloordistl 150
    {
    }
    else
    {
    sound ELEVATOR_OFF
    ai AIELEVWAITUP
    }
    }
  }
  else
ifai AIELEVWAITUP
  {

    ifpdistl 1024
      ifcansee
        ifhitspace
          {
          ai AIELEVDOWN
          sound ELEVATOR_ON
          }
  }
  else
ifai AIELEVDOWN
  {
  iffloordistl 15
    {
    sound ELEVATOR_OFF
    ai AIELEVWAITDOWN
    }
  }

enda

/* End of Sprite Elevator Code */
/* --------------------------- */

/* Start of MINIROCKETSHOOTER Code */
/* ------------------------------- */

define MINIROCKETSHOOTER     216
define THEMINIROCKET         2607
define MINIROCKETSHOOTERSTRENGTH 100
action AMINIROCKETSHOOTER 0
move minirocketshootstop 0
ai AIMINIROCKETACTIVE AMINIROCKETSHOOTER minirocketshootstop geth getv
ai AIMINIROCKETINACTIVE AMINIROCKETSHOOTER minirocketshootstop geth getv
useractor notenemy MINIROCKETSHOOTER MINIROCKETSHOOTERSTRENGTH AMINIROCKETSHOOTER
ifai NO
  {
  ai AIMINIROCKETINACTIVE
  cstat 32768
  }
ifai AIMINIROCKETACTIVE
  {
  ifcount 2 { } else ifcount 1
    {
    sound RPG_SHOOT
    spawn THEMINIROCKET
    }
  ifcount 32
    {
    ifrnd 128
      {
      ifpdistg 4096
        {
        ai AIMINIROCKETINACTIVE
        }
      }
    resetcount
    }
  }
  else
  {
  ifai AIMINIROCKETINACTIVE
    {
    ifpdistl 8192
      {
      ai AIMINIROCKETACTIVE
      }
    }
  }
enda

define REXPLOSION2 1891
action REXPLOSION_FRAMES -1 20 1 1  4
actor REXPLOSION2 1 REXPLOSION_FRAMES
  ifai NO
    {
    sizeat 10 10
    }
  ifactioncount 20
    killit
enda

action AMINIROCKET     -2   1 7 1 1
move   minirocketspeed  300 0
ai     AIMINIROCKET     AMINIROCKET minirocketspeed geth getv
ai     AIROCKETDEAD
useractor notenemy THEMINIROCKET 0
ifai AIROCKETDEAD
  {
  cstat 32768
  ifcount 32
   killit
  }
ifai NO
  {
  sizeat 8 8
  clipdist 1
//  cstat 32768
  ai AIMINIROCKET
  }
ifai AIMINIROCKET
  ifnotmoving
    {
    sound PIPEBOMB_EXPLODE
    spawn REXPLOSION2
    ifpdistl 1024
      ifcansee
        {
          state dukehurt
          palfrom 48 52
          addphealth -18
        }
    ai AIROCKETDEAD
    }
enda

/* End   of MINIROCKETSHOOTER Code */
/* ------------------------------- */

/* Start of ENDOFGAME sprite */
/* ------------------------- */

useractor notenemy ENDOFGAMESPRITE 0
ifai NO
  {
  cstat 32768 // make him invisible and non-blockable
  }
ifspritepal 0
  {
  ifcansee
    {
    endofgame 52
    killit
    }

  }
ifspritepal 21
  {
  ifcansee
    {
    ifpdistl 1024
      {
      endofgame 52
      killit
      }
    }
  }
enda


/* End of ENDOFGAME sprite */
/* ----------------------- */

/* misc actor's   */
/* -------------- */

define POPCORN 5196
define BEERMUG 5197
define VOODUKE 5222

ai POPDONE

useractor notenemy POPCORN
ifai NO
  {
  cstat 257
  sizeat 17 22
  }

ifai POPDONE
  {
  }
  else
  {
  ifphealthl MAXPLAYERHEALTH
  ifhitspace
    ifpdistl 1280
      ifp pfacing
        {
        quote 127
        addphealth 25
        sound DUKE_USEMEDKIT
        ai POPDONE
        }
  }

ifhitweapon
  {
  debris SCRAP3 12
  killit
  }
enda

action ABEERMUG 0 1 1 1 1
useractor notenemy BEERMUG 0 ABEERMUG

    ifp palive
      ifpdistl RETRIEVEDISTANCE
        ifp pfacing
          ifactioncount 32
            ifphealthl MAXPLAYERHEALTH
              ifhitspace
                ifcansee
    {
      addphealth 1
      globalsound DUKE_DRINKING
      resetactioncount
    }

ifai NO
  {
  cstat 257
  sizeat 50 60
  }
ifhitweapon
  {
  lotsofglass 10
  sound GLASS_BREAKING
  killit
  }

enda

/* bdp bitches:)  */
/* -------------- */

action BDPFEM       0 1 1 1 1
action BDPFEMANIM   0 4 1 1 1
action BDPFEMGROW   0 1 1 1 1
action BDPFEMSHRUNK 0 1 1 1 1
action BDPFEMFROZEN 0 1 1 1 1

define BDPFEM1     3460
define BDPFEM2     3462
define BDPFEM3     3463
define BDPFEM4     3464
define BDPFEM5     3491
define BDPFEM6     5378
define BDPFEM7     5379
define BDPFEM8     5380
define BDPFEMANIMA 5382
define BDPFEM9     5387
define BDPFEM10    5388
define BDPFEM11    5389
define BDPFEM12    5390

define OOZTANK 1080
action AOOZTANK -1 3 1 1 10

useractor notenemy OOZTANK TOUGH
ifhitweapon
  {
  ifdead
    {
    hitradius 1024 WEAKEST WEAK MEDIUMSTRENGTH TOUGH
    spawn EXPLOSION2
    debris SCRAP2 2
    sound PIPEBOMB_EXPLODE
    killit
    }
  }

enda

state feminit
// sizeat 40 40
clipdist 32
ends





state femjibs
  guts JIBS2 1
  guts JIBS3 2
  guts JIBS4 3
  guts JIBS5 2
  guts JIBS6 3
  ifrnd 6
  {
    guts JIBS1 1
    spawn BLOODPOOL
  }         // a badly drawn spine
  ifrnd 128
        sound DUKE_HIT_STRIPPER1
      else
        sound DUKE_HIT_STRIPPER2

ends


state bdpfemcode

ifaction BDPFEMSHRUNK
  {
  ifcount SHRUNKDONECOUNT
    {
    ifactor BDPFEMANIMA action BDPFEMANIM else action BDPFEM
    cstat 257
    }
    else
    ifcount SHRUNKCOUNT
      sizeto 40 40
    else
      state genericshrunkcode
  }

ifaction BDPFEMGROW
  {
    ifcount 32
    {
      respawnhitag
      guts JIBS4 20
      guts JIBS6 20
      spritepal 6
      soundonce LADY_SCREAM
      spawn EXPLOSION2
      sound PIPEBOMB_EXPLODE
      hitradius 2048 TOUGH TOUGH TOUGH TOUGH
      sound SQUISHED
      killit
    }
    else
      sizeto MAXXSTRETCH MAXYSTRETCH
  }

/*
ifaction BDPFEMFROZEN
  {
    ifcount THAWTIME
    {
      ifactor BDPFEMANIMA { action BDPFEMANIM } else { action BDPFEM }
      getlastpal
    }
    else
      ifcount FROZENDRIPTIME
    {
      ifactioncount 26
      {
        spawn WATERDRIP
        resetactioncount
      }
    }

    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }
      ifactor BDPFEM10
        {
        hitradius 2048 TOUGH TOUGH TOUGH TOUGH
        sound PIPEBOMB_EXPLODE
        spawn EXPLOSION2
        }
      lotsofglass 30
      sound GLASS_BREAKING
      respawnhitag
      ifrnd 84
        spawn BLOODPOOL
      killit
    }
    else
      ifp pfacing
        ifpdistl FROZENQUICKKICKDIST
          pkick
    break
  }

*/

  ifhitweapon
  {
    ifdead
    {
      ifwasweapon GROWSPARK
      {
        cstat 0
        move 0
        sound ACTOR_GROWING
        action BDPFEMGROW
        break
      }
      else ifwasweapon FREEZEBLAST
      {
      ifaction BDPFEMSHRUNK
        break
      state genericcdcode
      break
      }

      ifactor BDPFEM10
        {
      ifwasweapon RPG
        {
        hitradius 2048 TOUGH TOUGH TOUGH TOUGH
        sound PIPEBOMB_EXPLODE
        spawn EXPLOSION2
        }
        else
        ifwasweapon RADIUSEXPLOSION
          {
          hitradius 2048 TOUGH TOUGH TOUGH TOUGH
          sound PIPEBOMB_EXPLODE
          spawn EXPLOSION2
          }
          else
          ifwasweapon HEAVYHBOMB
            {
            hitradius 2048 TOUGH TOUGH TOUGH TOUGH
            sound PIPEBOMB_EXPLODE
            spawn EXPLOSION2
            }
            else
            {
            hitradius 2048 TOUGH TOUGH TOUGH TOUGH
            sound PIPEBOMB_EXPLODE
            spawn EXPLOSION2
            }
        }
        else
        ifactor BDPFEMANIMA
          {
          sound GLASS_BREAKING
          lotsofglass 30
          }
          else
          ifactor BDPFEM6
            {
            sound GLASS_BREAKING
            lotsofglass 30
            }



      respawnhitag
      sound LADY_SCREAM
      state femjibs
      state random_wall_jibs
      spawn BLOODPOOL
      killit

    }
    else
    {
      ifwasweapon SHRINKSPARK
      {
        sound ACTOR_SHRINKING
        move 0
        action BDPFEMSHRUNK
        cstat 0
        break
      }
      else
        ifwasweapon GROWSPARK
          sound EXPANDERHIT

      sound SQUISHED

      guts JIBS6 1
    }
  }

ends

useractor notenemy BDPFEM1 TOUGH state killme state feminit state bdpfemcode enda
useractor notenemy BDPFEM2 TOUGH state killme state feminit state bdpfemcode enda
useractor notenemy BDPFEM3 TOUGH state killme state feminit state bdpfemcode enda
useractor notenemy BDPFEM4 TOUGH state killme state feminit state bdpfemcode enda
useractor notenemy BDPFEM5 TOUGH state feminit state bdpfemcode enda
useractor notenemy BDPFEM6 TOUGH state feminit state bdpfemcode enda
useractor notenemy BDPFEM7 TOUGH state killme state feminit state bdpfemcode enda
useractor notenemy BDPFEM8 TOUGH state killme state feminit state bdpfemcode enda
useractor notenemy BDPFEM9 TOUGH state killme state feminit state bdpfemcode enda
useractor notenemy BDPFEM10 TOUGH state feminit state bdpfemcode enda
useractor notenemy BDPFEM11 TOUGH state feminit state bdpfemcode enda
useractor notenemy BDPFEM12 TOUGH state feminit state bdpfemcode enda
useractor notenemy BDPFEMANIMA TOUGH state feminit state bdpfemcode enda

/* New FIREVASE CODE */

action AFIRE 0 4 1 1 15
useractor notenemy FIREVASE TOUGH AFIRE
    ifp palive
      ifpdistl 844
        ifrnd 32
          ifcansee
    {
      soundonce DUKE_LONGTERM_PAIN
      addphealth -1
      palfrom 24 16
    }
ifspritepal 3 { ifpdistl 4096 { soundonce FIRE_CRACKLE } }
ifspritepal 9
  {
  ifpdistl 4096 { soundonce FIRE_CRACKLE }
  ifhitweapon
    {
    ifdead
      {
      sound GLASS_BREAKING
      lotsofglass 20
      spawn BURNING
      killit
      }
    }
  }

enda

/* End of FIREVASE CODE */

action CDFLOOR 1 1 1 1 1

ai INVIS

useractor notenemy CDHIT 0
fall

ifai NO
  {
  ifrnd 256
    {
    lotsofglass 5
    sound GLASS_BREAKING
    killit
    }
  cstat 32
  ai INVIS
  }

ifai INVIS
  {
  killit
  ifpdistl 1024
    {
    }
  }

enda

/* START OF BRAIN CODE */

define BRAIN 5674

define      BRAINSTRENGTH 75

move brainstopped

action      MONSTER1 0 2 1 1 18
ai          INACT    MONSTER1
ai          SHOOT    MONSTER1 brainstopped faceplayersmart

useractor notenemy BRAIN BRAINSTRENGTH MONSTER1

ifai NO
  {
//  sizeat 50 50
  cstat 257
  clipdist 32
  ai SHOOT
  }


ifai INACT
  {
  ifpinventory GET_BOOTS 350
    {
    addinventory GET_BOOTS 350
    killit
    }
  }

ifcansee
  {
  ifcount 10
    {
    resetcount
    }
  }

ifhitweapon
  {
  ifdead
    {
    state standard_jibs
    state standard_jibs
    state standard_jibs
    state standard_jibs
    sound SQUISHED
    ai INACT
    }
    else
    sound SQUISHED
  }

enda

/* END OF BRAIN CODE */

/* BIGEYE */

define BIGEYESTRENGTH 500

move bigeyemove 30

action BIGEYENORMAL 0 1 1 1 1
action BIGEYEHURT   1 1 1 1 1
ai     AIBIGEYE     BIGEYENORMAL bigeyemove randomangle

useractor notenemy BIGEYE BIGEYESTRENGTH BIGEYENORMAL

ifaction BIGEYEHURT
  {
  ifactioncount 10
    action BIGEYENORMAL
  break
  }

ifai NO
  {
  ai AIBIGEYE
  cstat 257
  }

ifcansee
  {
  }

ifhitweapon
  {
  action BIGEYEHURT
  spawn BLOOD
  spawn BLOOD
  ifdead
    {
    spawn BLOOD
    spawn BLOOD
    state standard_jibs
    state standard_jibs
    state standard_jibs
    state standard_jibs
    debris SCRAP2 20
    spawn EXPLOSION2
    sound PIPEBOMB_EXPLODE
    sound SQUISHED
    killit
    }
  }

ifcansee
  {
  ifcount 10
    {
    shoot COOLEXPLOSION1
    shoot COOLEXPLOSION1
    resetcount
    }
  }

enda

action AFORCE 0 4 1 1 1

useractor notenemy BOSSFORCEFIELD 0

ifaction 0
  {
  cstat 514
  action AFORCE
  sizeat 20 20
  globalsound SOMETHINGHITFORCE
  }

ifactioncount 4
  {
  killit
  }

enda


/* ---------------------- */
/* End of BDP Code Area   */
/* *********************************************************************** */
