// Civi Code

define LOCATOR 6
eventloadactor LOCATOR
setvarvar FINDIT THISACTOR
enda

move CIVIEWALK2 72
action ACIVIWALK2 0 4 5 1 12

ai AICIVIEWALKING2 ACIVIWALK2 CIVIEWALK2 getv geth

state gib_sounds
 ifrnd 96
 { ifrnd 128
 { ifrnd 128
 { ifrnd 128
 { ifrnd 128
 { ifrnd 128 globalsound 269 else globalsound 222 } else 
 { ifrnd 128 globalsound 266 else globalsound 390 } } else 
 { ifrnd 128 globalsound 376 else globalsound 223 } } else 
 { ifrnd 128 globalsound 377 else globalsound 226 } } else 
 { ifrnd 128 { ifrnd 128 { ifrnd 128 globalsound 268 else globalsound 263 } else 
 { ifrnd 128 globalsound 224 else globalsound 265 } } else 
 { ifrnd 128 { ifrnd 128 globalsound 227 else globalsound 225 } else 
 { ifrnd 128 { ifrnd 128 globalsound 267 else globalsound 391 } else globalsound 228 } } } } ends
 
state standard_gibs ifrnd 80 spawn 2080 ifrnd 80 spawn 2084 ifrnd 80 spawn 2084 ifrnd 80 spawn 2088 ifrnd 80 spawn 2092 ifrnd 80 spawn 2092 ifrnd 80 spawn 2096 ifrnd 80 spawn 2096 spawn 1226 state gib_sounds ends
state human_gibs ifrnd 112 spawn 2112 ifrnd 112 spawn 2116 ifrnd 112 spawn 2130 state standard_gibs ends
state random_wall_gibs ifrnd 96 shoot 2296 ifrnd 96 shoot 2298 ifrnd 96 shoot 2297 ifrnd 96 shoot 2299 ifrnd 96 shoot 2296 ends
state checksquished ifsquished { addkills 1 sound 69 killit } ends
state rf ifrnd 128 cstat 4 else cstat 0 ends

action ACIVIESTAND 0 1 5 1 1 
action ACIVIEWALKING 0 4 5 1 12 
action ACIVIEFLINCH 20 1 1 1 4 
action ACIVIEDYING 20 4 1 1 10 
action ACIVIEDEAD 24 1 1 
action ACIVIEFROZEN 0 1 5 
move CIVIEWALKVELS 72 
move CIVIESTOPPED 
ai AICIVIESTAND ACIVIESTAND CIVIESTOPPED 8 
ai AICIVIEWALK ACIVIEWALKING CIVIEWALKVELS getv geth state civiestand 
ifai AICIVIESTAND { ifcount 30 ifrnd 4 { ai AICIVIEWALK break } } ends

state civiewalk ifai AICIVIEWALK { ifnotmoving ai AICIVIEWALK ifrnd 1 ai AICIVIESTAND } ends
state civiedying ifrnd 32 spawn 1620 iffloordistl 32 { ifactioncount 4 { cstat 0 iffloordistl 8 sound CIVIKILLED spawn 1226 state rf strength 0 move CIVIESTOPPED spawn 5286 action ACIVIEDEAD break } } else { state rf move 0 ifrnd 48 spawn 1620 action ACIVIEDYING } ends
state checkciviehit spawn 1620 ifdead { state random_wall_gibs addkills 1 ifwasweapon 2605 { sound 69 state human_gibs killit } else ifwasweapon 1670 { sound 69 state human_gibs killit } else ifwasweapon 1641 { sound 303 ai 0 move 0 action ACIVIEFROZEN strength 0 cstat 0 break } else { action ACIVIEDYING ifactor 3590 { ifrnd 128 sound 414 else sound 415 } else ifactor 3620 { ifrnd 128 sound 416 else sound 417 } break } } else { state random_wall_gibs ifactor 3590 { ifrnd 128 sound 414 else sound 415 } else ifactor 3620 { ifrnd 128 sound 416 else sound 417 } ifwasweapon 1646 { sound 69 state human_gibs addkills 1 killit } else iffloordistl 32 ifrnd 96 action ACIVIEFLINCH } ends

state checktexture
 getsector[THISACTOR].floorpicnum FLOOR

 switch FLOOR
 case 10884

 ai AICIVIESTAND

 ifaction ACIVIEFLINCH
 {
 ifactioncount 4 ai AICIVIESTAND state civiestand
 }

 ifhitweapon state checkciviehit
 break
 case 10885

 ai AICIVIESTAND


 ifaction ACIVIEFLINCH
 {
 ifactioncount 4 ai AICIVIESTAND state civiestand
 }

 ifhitweapon state checkciviehit
 break
 case 10886

 ai AICIVIESTAND


 ifaction ACIVIEFLINCH
 {
 ifactioncount 4 ai AICIVIESTAND state civiestand
 }

 ifhitweapon state checkciviehit
 break
 case 10887

 ai AICIVIESTAND


 ifaction ACIVIEFLINCH
 {
 ifactioncount 4 ai AICIVIESTAND state civiestand
 }

 ifhitweapon state checkciviehit
 break
 case 10888

 ai AICIVIESTAND


 ifaction ACIVIEFLINCH
 {
 ifactioncount 4 ai AICIVIESTAND state civiestand
 }

 ifhitweapon state checkciviehit
 break
 case 10889

 ai AICIVIESTAND


 ifaction ACIVIEFLINCH
 {
 ifactioncount 4 ai AICIVIESTAND state civiestand
 }

 ifhitweapon state checkciviehit
 break
 case 10890

 ai AICIVIESTAND


 ifaction ACIVIEFLINCH
 {
 ifactioncount 4 ai AICIVIESTAND state civiestand
 }

 ifhitweapon state checkciviehit
 break
 case 10891

 ai AICIVIESTAND


 ifaction ACIVIEFLINCH
 {
 ifactioncount 4 ai AICIVIESTAND state civiestand
 }

 ifhitweapon state checkciviehit
 break
 case 10892

 ai AICIVIESTAND


 ifaction ACIVIEFLINCH
 {
 ifactioncount 4 ai AICIVIESTAND state civiestand
 }

 ifhitweapon state checkciviehit
 break
 case 10893

 ai AICIVIESTAND


 ifaction ACIVIEFLINCH
 {
 ifactioncount 4 ai AICIVIESTAND state civiestand
 }

 ifhitweapon state checkciviehit
 break
 case 10894

 ai AICIVIESTAND


 ifaction ACIVIEFLINCH
 {
 ifactioncount 4 ai AICIVIESTAND state civiestand
 }

 ifhitweapon state checkciviehit
 break
 case 10895

 ai AICIVIESTAND


 ifaction ACIVIEFLINCH
 {
 ifactioncount 4 ai AICIVIESTAND state civiestand
 }

 ifhitweapon state checkciviehit
 break
 case 10896

 ai AICIVIESTAND


 ifaction ACIVIEFLINCH
 {
 ifactioncount 4 ai AICIVIESTAND state civiestand
 }

 ifhitweapon state checkciviehit
 break
 endswitch
ends

useractor notenemy 3590 75
 sizeat 22 23
 fall
 state checksquished
 
 ifai AICIVIEWALK
 { 
 state civiewalk
 state checktexture
 }

 ifaction 0 
 {
 ifrnd 160 ai AICIVIESTAND else ai AICIVIEWALK
 }

 ifaction ACIVIEDEAD
 {
 cstat 0
 strength 0
 }
 else
 ifaction ACIVIEDYING
 {
 state civiedying
 break
 }
 else
 ifaction ACIVIEFLINCH
 {
 ifactioncount 4 ai AICIVIESTAND state civiestand
 }
 
 ifai AICIVIESTAND
 {
 state civiestand
 state checktexture
 }
 else
 state checksquished

 ifhitweapon
 state checkciviehit

enda

useractor notenemy 3620 75
 sizeat 22 23
 fall
 state checksquished
 
  ifai AICIVIEWALK
 { 
 state civiewalk
 state checktexture
 }

 ifaction 0 
 {
 ifrnd 160 ai AICIVIESTAND else ai AICIVIEWALK
 }

 ifaction ACIVIEDEAD
 {
 cstat 0
 strength 0
 }
 else
 ifaction ACIVIEDYING
 {
 state civiedying
 break
 }
 else
 ifaction ACIVIEFLINCH
 {
 ifactioncount 4 ai AICIVIESTAND state civiestand
 }
 
 ifai AICIVIESTAND
 {
 state civiestand
 state checktexture
 }
 else
 state checksquished

enda