////////////////////////////////////
//      SUBEE (PAINELEMENTAL)     //
////////////////////////////////////

Actor SubeeMonster 30612
{
//$Category MM8BDM-Monsters (Doom)
//$Title Subee (PainElemental)
//$Sprite D020B8B2
Tag "Subee"
Translation "0:0=0:0", "4:4=4:4", "192:192=215:215", "198:198=216:216", "215:215=215:215", "216:216=216:216"
MONSTER
Species "SubeeMonster"
BloodType "MonsterRipperProtect_Helper"
//+NOBLOOD
-NOINFIGHTING
+FLOAT
+NOGRAVITY
Health 400
Radius 31
Height 56
Speed 4 // 8
PainChance 128
PainChance "WindStorm", 128
PainChance "GravityHold", 128
PainChance "ConcreteShot", 128
PainChance "TornadoBlow", 128
PainChance "BlackHoleBomb", 128
PainChance "TimeStopper", 256
DamageFactor "Dummy", 0.0
SeeSound "item/rushdetect"
PainSound "monster/mm3pain"
DeathSound "monster/death"
ActiveSound "misc/repairing"
Mass 9999
Scale 2.5
States
{
Spawn:
SUBE A 0 NoDelay A_Stop
SUBE A 0 A_TakeInventory("CutterFlag",1)
SUBE A 0 ACS_NamedExecuteAlways("Monster_PassivePain",0)
SUBE A 0 A_SpawnItemEx("MonsterHitbox31_56")
SUBE A 0 A_Look
SUBE AB 5 
Goto Spawn+4

FirstSee:
SUBE A 0 A_TakeInventory("CutterFlag",1)
SUBE A 0 ACS_NamedExecuteAlways("Monster_PassivePain",0)
SUBE A 0 Thing_SetTranslation(0,30501) //ALLRED
SUBE A 2 Bright
SUBE A 0 Thing_SetTranslation(0,30612) //SUBEEMONSTER
SUBE A 0 A_GiveInventory("CutterFlag",1)
Goto See

See:
SUBE A 0 A_JumpIfInventory("CutterFlag",1,1)
Goto FirstSee
SUBE A 1 A_Chase
SUBE AA 1 A_ChangeVelocity(2,0,momz,3)
SUBE B 1 A_Chase
SUBE BB 1 A_ChangeVelocity(2,0,momz,3)
Loop

Missile:
SUBE A 0 A_Stop
SUBE A 0 A_FaceTarget
SUBE AAABB 1
SUBE B 0 A_FaceTarget
SUBE B 0 A_PlaySoundEx("weapon/topspin","Body")
SUBE BCDCD 1
SUBE B 0 A_FaceTarget
SUBE CD 1
SUBE D 0 Thing_SetTranslation(0,30504) //MISSILEFLASH
SUBE CD 1 Bright
SUBE D 0 Thing_SetTranslation(0,30612) //SUBEEMONSTER
SUBE D 0 A_PlaySoundEx("weapon/hornetchaser","Weapon")
SUBE C 1 A_PainAttack("ChibeeMonster_Pain")
Goto See

Pain:
SUBE H 0 A_Stop
Pain.WindStorm:
Pain.GravityHold:
Pain.ConcreteShot:
Pain.TornadoBlow:
Pain.BlackHoleBomb:
SUBE H 0 Thing_SetTranslation(0,30612) //SUBEEMONSTER
SUBE H 12 A_Pain
Goto See

Pain.TimeStopper:
SUBE H 0 A_Stop
SUBE H 0 Thing_SetTranslation(0,30612) //SUBEEMONSTER
SUBE H 0 A_ChangeFlag("NOPAIN",true)
SUBE "##############################################################################################################################################################################################################################################################################################################################################################" 1 A_SpawnItemEx("TimeStopGFX",random(8,56),0,random(0,80),0,0,0,random(0,359),0,80)
SUBE H 0 A_ChangeFlag("NOPAIN",false)
Goto See

Death.WindStorm:
Death.GravityHold:
Death.TornadoBlow:
BlowDeath:
SUBE H 0 A_Stop
SUBE H 0 Thing_SetTranslation(0,30612) //SUBEEMONSTER
SUBE H 0 A_ChangeFlag("SHOOTABLE",false)
SUBE H 0 A_ChangeFlag("NODAMAGE",false)
SUBE H 0 A_ChangeFlag("SOLID",false)
SUBE H 1 ThrustThingZ(0,10,0,1)
SUBE H 0 A_JumpIf(ceilingz-z<64,"Death")
SUBE H 0 A_GiveInventory("BlowDeathTimer",1)
SUBE H 0 A_JumpIfInventory("BlowDeathTimer",35,"Death")
Goto BlowDeath+5

Death:
XDeath:
SUBE H 0 A_Stop
SUBE H 0 A_FaceTarget
SUBE H 0 Thing_SetTranslation(0,30612) //SUBEEMONSTER
SUBE H 2 
SUBE H 0 A_Scream
SUBE H 0 A_SpawnItemEx("ExplosionEffect1",0,0,32)
SUBE H 0 A_SpawnItemEx("MonsterFakeDeathFX",0,0,32,0,0,0,0,1)
SUBE I 24
SUBE I 0 Thing_SetTranslation(0,30502) //ALLYELLOW
SUBE I 2 Bright
SUBE I 0 Thing_SetTranslation(0,30612) //SUBEEMONSTER
SUBE I 2 Bright
SUBE I 0 Thing_SetTranslation(0,30502) //ALLYELLOW
SUBE I 2 Bright
SUBE I 0 Thing_SetTranslation(0,30612) //SUBEEMONSTER
SUBE I 2 Bright
SUBE I 0 A_PlaySoundEx("misc/mm3explosion","Body")
SUBE I 0 A_SpawnItemEx("ExplosionEffect2",0,0,32)
SUBE I 0 A_PainDie("ChibeeMonster_Pain")
SUBE I 0 A_NoBlocking
TNT1 A 4
Stop
}
}

Actor SubeeMonster_Replaced : SubeeMonster replaces PainElemental {}