ACTOR DemonTechSpecRailgunner
{
//Creator: High Councilor
//Origin: Nexus Infinity
//Sprite: DTRZ
//Title: "Demon Tech Railgunner"
Health 300
Radius 20
Height 56
Speed 4
Mass 100
PainChance 96
PainChance "ZombieDemonTech", 0
BloodColor "Green"
DropItem "DemonAmmo" 256 60
DropItem "Demon Tech Railgun" 100 1
DropItem "StimKit" 150
DropItem "ArmorBooster" 150
DropItem "HandGrenadeAmmo" 150 1
DropItem "MineAmmo" 100 1
DropItem "AmmoPack" 80
DropItem "BackPack" 25 1
Species "EliteZombies"
Damagefactor 0.75
Damagefactor "RedZombieDemonTech", 0
Damagefactor "ZombieRocket", 0
Damagefactor "ZombieDemonTech", 0
DamageFactor "RedZDemonTechProjectile", 0.0
Damagefactor "GeneralTracer", 0
DamageFactor "EMGEx", 0
DamageFactor "RST", 0.0
DamageFactor "SoulToxic", 0.0
DamageFactor "BeheComet", 0.0
DamageFactor "FatFlamer", 0.0
Damagefactor "HTZombie", 0.0
DamageFactor "MiniRocket", 0.0
DamageFactor "ZombieCannon", 0.0
Damagefactor "ZExplosiveBullets", 0.0
Damagefactor "ZGrenade", 0.0
MONSTER
+FLOORCLIP
//+MISSILEMORE
//+MISSILEEVENMORE
+AVOIDMELEE
+NODROPOFF
+DONTHARMSPECIES
SeeSound "SpecOpsZombie/Sight"
ActiveSound "SpecOpsZombie/Active"
AttackSound "Null"
PainSound "SpecOpsZombie/Pain"
DeathSound "SpecOpsZombie/Death"
Tag "\cqDemon Tech \cuSpec \crOps \csRailgunner\c-"
Obituary "%o was seared by a Demon Tech Railgunner."
var int user_rage;
var int user_cooldown;
States
{
  Spawn:
    DTRZ A 10 A_Look
    Loop
  See:
	TNT1 A 0 A_JumpIfCloser(130,"Dodge")
	DTRZ AAAA 1 A_Chase
	TNT1 A 0 A_JumpIfCloser(130,"Dodge")
	DTRZ BBBB 1 A_Chase
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_JumpIfCloser(130,"Dodge")
	DTRZ CCCC 1 A_Chase
	TNT1 A 0 A_JumpIfCloser(130,"Dodge")
	DTRZ DDDD 1 A_Chase
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    Loop
  Idle:
 	TNT1 A 0 A_Look
	DTRZ AAAABBBB 1 A_Wander
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Look
	DTRZ CCCCDDDD 1 A_Wander
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  Dodge:
	TNT1 A 0
	DTRZ A 1 A_FaceTarget
	TNT1 A 0 ThrustThingZ(0,20,0,0)
	TNT1 A 0 A_Jump(256,"DodgeRight","DodgeLeft")
  DodgeLeft:
	TNT1 A 0 ThrustThing(angle*256/360+192,10,0,0)
	Goto See
  DodgeRight:
	TNT1 A 0 ThrustThing(angle*256/360+64,10,0,0)
	Goto See
  Missile:
	TNT1 A 0 A_PlaySound("weapons/rgcharge")
	DTRZ EEEEE 2 A_FaceTarget(45)
	DTRZ EEEEE 2 A_FaceTarget(45)
	DTRZ EEEEE 2 A_FaceTarget(45)
	TNT1 A 0 A_PlaySound("weapons/dtrailf")
	TNT1 A 0 A_CustomMissile("DTRailCore",32)
    DTRZ F 8 Bright A_CustomMissile("ZombieDTRail",32)
    DTRZ E 10
	TNT1 A 0 A_Jump(50,"Dodge")
    Goto See
  Pain:
    TNT1 A 0 A_JumpIf(user_cooldown > 0,3)
	TNT1 A 0 A_JumpIf(user_rage == 1,2)
	TNT1 A 0 A_Jump(50,"TriggerRage")
	DTRZ G 4
	DTRZ G 4 A_Pain
	Goto See
  TriggerRage:
	TNT1 A 0 A_Changeflag(NOPAIN,1)
	DTRZ G 1 A_Pain
	TNT1 A 0 A_PlaySound("efgzombie/protection",CHAN_BODY,1,0,0.5)
	DTRZ G 6 ACS_NamedExecuteAlways("LunaticRage",0)
	TNT1 A 0 A_Changeflag(NOPAIN,0)
	Goto See
  Death:
    DTRZ H 5
    DTRZ I 5 A_Scream
    DTRZ J 5
    DTRZ K 5 A_NoBlocking
    DTRZ L -1
	Stop
  XDeath:
	DTRZ O 5
	TNT1 A 0 A_SpawnItemEx("GreenGibbedGenerator",0,0,0,0,0,0,0,128,0) 
	DTRZ P 5 A_XScream
	DTRZ Q 5
	DTRZ R 3 A_Fall
	DTRZ STUV 5
	DTRZ W -1
	Stop
  Raise:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("VileHealEffect",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
    DTRZ LKJIH 5
    Goto See
	}
}

ACTOR ZombieDTRail : DarkAnnihilatorRail
{
DamageType "ZombieDemonTech"
Species "EliteZombies"
}