
define NORMALGRUNT 5380
define NORMALGRUNT2 5381
define READYGRUNT 5385
define DUCKGRUNT  5430
define DEADGRUNT  5445
define GRUNTPRINT  5447

action GRUNTDEFAULT 0 1 1 1 1
action GRUNTSTAND1 0 1 5 1 1
action GRUNTSTAND2 5 1 5 1 1
action GRUNTRUN 10 4 5 1 7
action GRUNTTHROW 30 4 1 1 4
action GRUNTSHOOT1 40 2 5 1 1
action GRUNTSHOOT2 50 2 5 1 1
action GRUNTDYING 60 6 1 1 3
action GRUNTHIT 60 1 1 1 1
action GRUNTDEAD 66 1 1 1 1

move GRUNTRUNMOVE 100 0
move GRUNTDODGEMOVE 100 0

state getpskill
getactor[THISACTOR].hitag MHITAG
ifvarvarl MHITAG SKILL { break }
else ifvarvare SKILL MHITAG { break }
else ifvare MHITAG 0 { break }
else { killit }
ends

useractor notenemy GRUNTPRINT
ifaction 0 { ifrnd 193 { killit } addvar FOOTPRINTCOUNT 1 action GRUNTDEFAULT }
move 0 fall
sizeat 32 32
cstat 34
ifvarg FOOTPRINTCOUNT 200 ifrnd 32 { subvar FOOTPRINTCOUNT 1 killit }
enda

useractor notenemy READYGRUNT 100
state getpskill
// ifaction 0 { action GRUNTDEFAULT }
setvar TEMP 0
ifvarg STARTDELAY 15 { setvar STARTDELAY 0 }
ifvare STARTDELAY 15 { action GRUNTSTAND2 cactor NORMALGRUNT }
ifvarg STARTDELAY 0 { addvar STARTDELAY 1 }
ifcanseetarget
{
ifvarl STARTDELAY 1 { setvar STARTDELAY 1 }
}
enda

useractor notenemy NORMALGRUNT2 100
state getpskill
// ifaction 0 { action GRUNTDEFAULT }
setvar TEMP 0
ifvarg STARTDELAY 15 { setvar STARTDELAY 0 }
ifvare STARTDELAY 15 { action GRUNTSTAND1 cactor NORMALGRUNT }
ifvarg STARTDELAY 0 { addvar STARTDELAY 1 }
ifcanseetarget
{
ifvarl STARTDELAY 1 { setvar STARTDELAY 1 }
}
enda

useractor notenemy DUCKGRUNT 100
state getpskill
// ifaction 0 { action GRUNTDEFAULT }
setvar TEMP 0
ifvarg STARTDELAY 15 { setvar STARTDELAY 0 }
ifvare STARTDELAY 15 { action GRUNTSHOOT2 cactor NORMALGRUNT }
ifvarg STARTDELAY 0 { addvar STARTDELAY 1 }
ifcanseetarget
{
ifvarl STARTDELAY 1 { setvar STARTDELAY 1 }
}
enda

useractor notenemy DEADGRUNT 1
setvar TEMP 0
move 0 fall
sizeat 24 24
ifaction GRUNTDEFAULT { }
else { cstat 256 spawn BLOODPOOL action GRUNTDEFAULT }
ifhitweapon
 {
   ifwasweapon RADIUSEXPLOSION
      { guts JIBS1 2 guts JIBS2 2 guts JIBS3 2 guts JIBS4 2 guts JIBS5 2 guts JIBS6 16 killit }
   else ifwasweapon RPG
      { guts JIBS1 2 guts JIBS2 2 guts JIBS3 2 guts JIBS4 2 guts JIBS5 2 guts JIBS6 16 killit }
   strength 1
 }
enda


state gruntshoot
ifvare TEMP 0 { fall sound GRUNTFIRESOUND shoot KNEE spawn SHELL setvar TEMP 6 }
ends



// ------------
// ------------

useractor notenemy NORMALGRUNT 100
ifvarg TEMP 0 { subvar TEMP 1 }
ifvarl TEMP 0 { setvar TEMP 0 }
sizeat 24 24
ifaction 0
{
setvar TEMP 0
state getpskill
ifvarg STARTDELAY 15 { setvar STARTDELAY 0 }
ifvare STARTDELAY 15 { action GRUNTSTAND1 }
ifvarg STARTDELAY 0 { addvar STARTDELAY 1 }
ifcanseetarget
{
ifvare STARTDELAY 0 { setvar STARTDELAY 1 }
}
cstat 257 break }

ifdead
{
 ifhitweapon
  {
    ifwasweapon RADIUSEXPLOSION
     { guts JIBS1 2 guts JIBS2 2 guts JIBS3 2 guts JIBS4 2 guts JIBS5 2 guts JIBS6 16 killit }
    else ifwasweapon RPG
     { guts JIBS1 2 guts JIBS2 2 guts JIBS3 2 guts JIBS4 2 guts JIBS5 2 guts JIBS6 16 killit }
  }
 ifaction GRUNTDEAD { }
 else ifaction GRUNTDYING { ifactioncount 6 { action GRUNTDEAD cactor DEADGRUNT } }
 else { soundonce GRUNTDIESOUND action GRUNTDYING }
break
}

ifaction GRUNTTHROW { move 0 fall ifactioncount 2 { soundonce GRUNTTHROWSOUND } ifactioncount 4 { spawn SHOTGUNSHELL shoot MORTER action GRUNTSTAND1 } break }
ifaction GRUNTSHOOT1 { state gruntshoot ifactioncount 12 { action GRUNTSTAND2 } break }
else ifaction GRUNTSHOOT2 { state gruntshoot ifactioncount 12 { action GRUNTSTAND2 } break }

ifrnd 2 { action GRUNTSTAND1 move 0 fall }
else ifrnd 2 { action GRUNTSTAND2 move 0 fall }
else ifrnd 96
{
 ifcanseetarget
 {
   ifaction GRUNTRUN { }
   else { action GRUNTRUN } move GRUNTRUNMOVE geth faceplayerslow fall
 }
 else
 { 
   ifaction GRUNTRUN { }
   else { action GRUNTRUN } move GRUNTRUNMOVE geth getv seekplayer faceplayerslow fall 
 }
}
else ifrnd 12 ifbulletnear { ifaction GRUNTRUN { } else { action GRUNTRUN move GRUNTDODGEMOVE geth dodgebullet fall } }
else ifrnd 8 ifcanseetarget ifcanshoottarget { ifpdistl 6024 { } else { ifaction GRUNTTHROW { } else { action GRUNTTHROW } move 0 faceplayer fall } }
else ifrnd 32 ifcanseetarget ifcanshoottarget
{

ifaction GRUNTSHOOT1 { move 0 faceplayerslow fall }
else ifaction GRUNTSHOOT2 { move 0 faceplayerslow fall }
else { ifrnd 96 { action GRUNTSHOOT1 } else { action GRUNTSHOOT2 } move 0 faceplayer fall }


}
else ifrnd 32
{
  else
  {
  }
}

ifnotmoving { ifrnd 32 { operate } else ifrnd 24 { move GRUNTRUNMOVE geth randomangle fall } }
ifpdistl 1024 { move 0 faceplayerslow fall }
ifhitweapon { soundonce GRUNTHITSOUND action GRUNTHIT guts JIBS6 2 }
ifaction GRUNTRUN
{
}


enda






