include GAME.CON
include DEFS.CON
include USER.CON
include SG_Defs.con

// include Weapon.con

// Music for title and end
music 0 Stargate/Stargate_data/Music/theme.ogg BRIEFING.MID

// Music for the individual levels
music 1 stalker.mid dethtoll.mid streets.mid watrwld1.mid snake1.mid
        thecall.mid ahgeez.mid dethtoll.mid streets.mid watrwld1.mid snake1.mid

music 2 futurmil.mid storm.mid gutwrnch.mid robocrep.mid stalag.mid 
       pizzed.mid alienz.mid xplasma.mid alfredh.mid gloomy.mid intents.mid

music 3 inhiding.mid FATCMDR.mid NAMES.MID subway.mid invader.mid gotham.mid
        233c.mid lordofla.mid urban.mid spook.mid whomp.mid

music 4 missimp.mid prepd.mid bakedgds.mid cf.mid lemchill.mid
       pob.mid warehaus.mid layers.mid floghorn.mid depart.mid restrict.mid
       
// LOAD SCREEN
onevent EVENT_GETLOADTILE
 setvar RETURN 10536
endevent 

action CROW_ANIMATIONS  0  0  0  0  0
move CROW_SPEEDS 50
ai CROW_WALK CROW_ANIMATIONS CROW_SPEEDS spin faceplayerslow
useractor notenemy CROW 1
   angoff 512
   ifcansee
{
   sizeat 64 64
   cstator 257
   ifspritepal 0
   strength 1
   ai CROW_WALK
}
   ifhitweapon
{
   debris SCRAP1 999
   ifdead             
{
      sound SQUISHED
      // state standard_jibs
      killit
}
sound PISTOL_RICOCHET
}
enda

action A10_ANIMATIONS  0  0  0  0  0
move A10_SPEEDS 1000
ai A10_FLYING A10_ANIMATIONS A10_SPEEDS // spin faceplayerslow
ai A10_FLYING2 A10_ANIMATIONS A10_SPEEDS // geth getv
useractor notenemy A10_FLY 1
angoff 1024
   ifcansee
{
   sizeat 64 64
   cstator 257
   ifspritepal 0
   strength 1
   ai A10_FLYING
   soundonce RECO_ROAM
}
   ifcount 48
   ifrnd 16   
   ai A10_FLYING2
   ifhitweapon
{
   debris SCRAP1 2
   ifdead          
{       
      spawn EXPLOSION2      
      sound RPG_EXPLODE    
      hitradius 2048 WEAKEST WEAK MEDIUMSTRENGTH TOUGH
      killit
}
sound PISTOL_RICOCHET
}
enda

// Replicator
define REPLICATOR_HEALTH 50
action REPLICATOR_ANI 0 0 0 0 0
move REPI_SPEED 100
ai REPI_SEEK REPLICATOR_ANI REPI_SPEED geth faceplayersmart seekplayer
ai REPI_JUMP REPLICATOR_ANI REPI_SPEED getv jumptoplayer
useractor enemy REPLICATOR
spriteflags 1

   fall
   ifai NO
{
   sizeat 32 32
   cstator 257
   ifspritepal 0
   strength REPLICATOR_HEALTH
   ai REPI_SEEK
   sound REPMOVE1
}
    ifcount 48   // if after about a second and a half and...
    ifrnd 16   // if a random value between 0-255 is less than 16...
    ai REPI_SEEK // reset everything, including all counters

    ifpdistl  1024
    ifrnd     16
{
    sound REPATTACK1
    sound DUKE_GRUNT
    palfrom 24 24
    addphealth -20
    wackplayer
}
    ifhitweapon
{
    debris SCRAP1 30
    ifdead         
{
    addkills 1
    debris SCRAP1 50
    ifrnd 128
    sound REPDIE1
    else
    sound REPDIE2
    killit
}
    ifrnd 128
    sound REPHURT1
    else
    ifrnd 128
    sound REPHURT2
}
enda