// MISC CODES (Trees/Objects)

define TREES10 3613
define TREES11 3614
define TREES12 3615
define TREES1 3826
define TREES2 3827
define TREES3 3828
define TREES4 3833
define TREES5 3834
define TREES6 3835
define TREES7 3836
define TREES8 3837
define TREES9 3838
define TREES13 3839


action TREESHRINK 0 1 1

state treecode
ifhitweapon
   {
   ifwasweapon RPG
      {
      spawn BURNING
      action TREESHRINK
      }
   else
     ifwasweapon RADIUSEXPLOSION
      {
      spawn BURNING
      action TREESHRINK
      }
   else
     {
     addstrength WEAK
     }
   }

ifaction TREESHRINK
   {
   sizeto 0 0
   ifcount 80
     {
     killit
     }
   }
ends

useractor notenemy TREES1 WEAK state treecode enda
useractor notenemy TREES2 WEAK state treecode enda
useractor notenemy TREES3 WEAK state treecode enda
useractor notenemy TREES4 WEAK state treecode enda
useractor notenemy TREES5 WEAK state treecode enda
useractor notenemy TREES6 WEAK state treecode enda
useractor notenemy TREES7 WEAK state treecode enda
useractor notenemy TREES8 WEAK state treecode enda
useractor notenemy TREES9 WEAK state treecode enda
useractor notenemy TREES10 WEAK state treecode enda
useractor notenemy TREES11 WEAK state treecode enda
useractor notenemy TREES12 WEAK state treecode enda
useractor notenemy TREES13 WEAK state treecode enda

state objcode
cstat 257
fall

ifhitweapon
  {
  debris SCRAP1 5
  debris SCRAP2 5
  sound GLASS_BREAKING
  killit
  }
ends

state trash
cstat 257
fall

ifhitweapon
  {
  debris SCRAP1 5
  debris SCRAP2 5
  debris SCRAP3 25
  sound SQUISHED
  killit
  }
ends

useractor notenemy 3584 WEAK state objcode enda
useractor notenemy 3595 WEAK state objcode enda
useractor notenemy 3600 WEAK state objcode enda
useractor notenemy 3616 WEAK state objcode enda
useractor notenemy 3635 WEAK state objcode enda
useractor notenemy 3639 WEAK state objcode enda
useractor notenemy 3669 WEAK state trash enda
useractor notenemy 3679 WEAK state trash enda
useractor notenemy 3689 WEAK state trash enda
useractor notenemy 3693 WEAK state objcode enda
useractor notenemy 3715 WEAK state objcode enda
useractor notenemy 3716 WEAK state objcode enda
useractor notenemy 3740 WEAK state objcode enda
useractor notenemy 3842 WEAK state objcode enda
useractor notenemy 3859 WEAK state objcode enda
useractor notenemy 3860 WEAK state objcode enda
useractor notenemy 3863 WEAK state objcode enda

useractor notenemy 4080 WEAK
cstat 257
fall

ifhitweapon
  {
  sound SQUISHED
  guts JIBS2 1
  guts JIBS3 2
  guts JIBS4 3
  guts JIBS5 2
  guts JIBS6 3
   {
   ifcount 32
     {
     globalsound MOUSEANNOY
     killit
     }
   break
   }
  }
enda

state explosive
cstat 257
fall

ifhitweapon
  {
  ifdead
    {
    spawn EXPLOSION2
    hitradius 2048 60 70 80 90
    sound PIPEBOMB_EXPLODE
    debris SCRAP1 5
    debris SCRAP2 5
    killit
    }
  }
ends

useractor notenemy 4083 MEDIUMSTRENGTH state explosive enda
useractor notenemy 4092 MEDIUMSTRENGTH state explosive enda


// SCORPION TANK with Pigcop inside

define SCORPION 4070
define SCORSTRENGTH  500

action ASCORSPIN   0 1 5 1 4
action ASCORSHOOTING 0 2 5 1 5 
action ASCORWAIT 0 1 5 1 1
action ASCORDESTRUCT 0 1 5 1 1
action ASCORDEAD 0 1 5 1 1

move SCORFORWARD 100
move SCORSTOP

useractor enemy SCORPION SCORSTRENGTH fall

  ifaction 0
  {
    sizeat 60 60
    action ASCORWAIT
    cstat 257
  }
  else
    ifaction ASCORSPIN
  {
    soundonce TANK_ROAM
    ifactioncount 20
    {
      ifrnd 16
        ifcansee
          ifcanshoottarget
      {
        move SCORSTOP geth
        action ASCORSHOOTING
        stopsound TANK_ROAM
      }
    }

    ifrnd 16
      move SCORFORWARD seekplayer
  }
  else
    ifaction ASCORSHOOTING
  {
    ifactioncount 22
    {
      ifpdistg 8192
      {
        sound BOS1_ATTACK2
        shoot RPG
      }
      resetcount
      move 0 action ASCORWAIT
    }
    else
      ifactioncount 2
    {
      ifcansee
      {
        ifpdistl 16384
        {
          ifrnd 128
          {
            sound PRED_ATTACK
            shoot FIRELASER
          }
        }
        else
          ifrnd 128
        {
          sound PRED_ATTACK
          shoot SHOTSPARK1 
        }
      }
      else
      {
        move SCORFORWARD seekplayer
        action ASCORSPIN
      }
    }

    ifrnd 16
    {
      stopsound TANK_ROAM
      move SCORSTOP faceplayerslow
    }
  }
  else
    ifaction ASCORWAIT
  {
    ifactioncount 32
    {
      move SCORFORWARD seekplayer
      action ASCORSPIN
    }
  }
  else
    ifaction ASCORDESTRUCT
  {
    ifactioncount 64
      action ASCORDEAD
    else
      ifactioncount 56
       sound LASERTRIP_ARMING
     else
       ifactioncount 48
         sound LASERTRIP_ARMING
     else
       ifactioncount 32
         sound LASERTRIP_ARMING
     else
       ifactioncount 16
         sound LASERTRIP_ARMING
     break
  }
  else
    ifaction ASCORDEAD
  {
    addkills 1
    hitradius 6144 TOUGH TOUGH TOUGH TOUGH
    sound LASERTRIP_EXPLODE
    debris SCRAP1 15
    spawn EXPLOSION2
    ifrnd 128 spawn PIGCOP
    killit
  }

  ifhitweapon
  {
    ifdead
      action ASCORDEAD
    else
    {
      debris SCRAP1 1
      debris SCRAP2 1
      ifaction ASCORSHOOTING break

      ifrnd 192
      {
        stopsound TANK_ROAM
      }
    }
  }
enda

state killitnow
killit
ends

define SPIDER 4020
define ORGA 3300
define MALECITIZEN 3790
define FEMALECITIZEN 3745
define BEAST 3890
define ARCH 3940
define CLONE 3980

useractor notenemy SPIDER WEAK state killitnow enda
useractor notenemy ORGA WEAK state killitnow enda
useractor notenemy ARCH WEAK state killitnow enda
useractor notenemy CLONE WEAK state killitnow enda
useractor notenemy MALECITIZEN WEAK state killitnow enda
useractor notenemy FEMALECITIZEN WEAK state killitnow enda
useractor notenemy BEAST WEAK state killitnow enda
