Actor ChasmScorpy
{
    Health 165
    Radius 20
    Height 36
    Speed 10
    PainChance 4
	PainChance "Laser", 64
	Scale 1
	Mass 150
    Monster
    +FLOORCLIP
	+DONTHARMSPECIES
	Species "Creature"
    SeeSound "Scorpy/See"
    PainSound "Scorpy/Pain"
    DeathSound "Scorpy/Death"
	ActiveSound "Scorpy/Active"
    Obituary "%o was killed by a Scorpion."
	BloodColor "Red"
	BloodType "RedBlood", "RedBlood"
	MaxTargetRange 256
	Tag "Scorpion"
    States
    {
    Spawn:
	    TNT1 A 0 NoDelay
        SCW1 AB 10 A_Look
        Loop
    See:
	    TNT1 A 0 A_PlaySound("Scorpy/Walk", 4)
        SCW1 ABCD 2 A_Chase
		TNT1 A 0 A_PlaySound("Scorpy/Walk", 4)
		SCW1 EFGH 2 A_Chase
        Loop
	Melee:
	    TNT1 A 0 A_PlaySound("Scorpy/Attack", 1)
		SCA1 ABCDE 1 A_FaceTarget
		SCA1 D 0 A_CustomBulletAttack(1, 1, 1, 6, "PiggyMeleePuff", 50, CBAF_AIMFACING)
		SCA1 F 5
		SCA1 GHIJK 2 A_FaceTarget
		Goto See
	Missile:
		SCJ1 AAA 4 A_FaceTarget
        SCJ1 B 0 A_SkullAttack
        SCJ1 B 10 ThrustThingZ(0, 3, 0, 1)
		SCJ1 CDEFGHI 3
        SCA1 A 20 A_Stop
		Goto Missile+9
  Pain:
    SCP1 A 2 A_Pain
    SCP1 BCDEF 2 
    Goto See
  Death.Explosive:
    TNT1 A 0
	Goto XDeath
  Death:
    TNT1 A 0
    SCD1 A 2 A_Scream
    SCD1 B 2
    SCD1 C 2 A_NoBlocking
	SCD1 D 3
    SCD1 EFGH 3
    SCD1 H -1
    Stop
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_PlaySound("Flesh/Gib", 4)
    TNT1 A 0 A_CustomMissile("GoreBloodSpawner", random(10,25), random(0,-20), random (0, 360), 2, random (0, 160))
	TNT1 A 0 A_CustomMissile("GoreBloodSpawner", random(10,25), random(0,20), random (0, 360), 2, random (0, 160))
	TNT1 AAA 0 A_CustomMissile("GoreSpawner", random(10,25), random(0,-20), random (0, 360), 2, random (0, 160))
	TNT1 AAA 0 A_CustomMissile("GoreSpawner", random(10,25), random(0,20), random (0, 360), 2, random (0, 160))
	TNT1 AA 0 A_CustomMissile("BloodGiblet", random(10,20), random(0, -20), random (0, 360), 2, random (0, 160))
	TNT1 AA 0 A_CustomMissile("BloodGiblet", random(10,20), random(0, 20), random (0, 360), 2, random (0, 160))
   	TNT1 AA 0 A_CustomMissile("ScorpGibSpawner", random(10,25), random(0,-20), random (0, 360), 2, random (0, 160))
	TNT1 AA 0 A_CustomMissile("ScorpGibSpawner", random(10,25), random(0,20), random (0, 360), 2, random (0, 160))
   Stop
  Raise:
    TNT1 A 0 A_CustomMissile("PhantomRezFX", 1, 5, random (0, 180), 2, random (0, 90))
	SCW1 A 1 A_SetTranslucent(0.10, 0)
	SCW1 AAAAAAAAAAAA 2 A_FadeIn(0.1)
  Goto See
    }
}

//
Actor ScorpGibSpawner : RandomSpawner
{
dropitem "ScorpionGib1",255, 10
}

ACTOR ScorpionGib1
{
    Radius 4
    Height 4
    Speed 15
	Mass 5
	+MISSILE
	+BOUNCEONWALLS
	+THRUGHOST
	+ROLLSPRITE
	+THRUACTORS
	+MOVEWITHSECTOR
    BounceType "Hexen"
    BounceFactor 0.3
	WallBounceFactor 0.3
    BounceCount 3
    DeathSound "Flesh/Splat"
	BounceSound "Gib/Bounce"
    States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
        GIB4 A 3 {A_SpawnItemEx("GoreTrail",0,0,0,0,0,0,0,2);A_SetRoll(roll+random(500.0,5000.0), SPF_INTERPOLATE);}
        Loop
	Death:
	    TNT1 A 0 A_Scream
	    TNT1 A 0
		Goto Splat
    Splat:
	   TNT1 A 0 A_ChangeFlag("ROLLSPRITE", FALSE)
       GIB4 AAAAA 5
       TNT1 A 0 A_Jump(28, "Vanish")
		Loop
   Vanish:
       GIB4 A 5 A_SetTranslucent(0.8)
       GIB4 A 5 A_SetTranslucent(0.6)
       GIB4 A 5 A_SetTranslucent(0.4)
       GIB4 A 5 A_SetTranslucent(0.2)
       GIB4 A 5 A_SetTranslucent(0.2)
       Stop	
     Splash:
        TNT1 A 0
        Stop
    }
}