// RA THOR/DEVIL

actor RaDevilBoss
{
Scale 2.5
Obituary "%o was sacrificed by \cmRa Devil\c-."

MONSTER
floatspeed 0
-COUNTKILL
-SOLID
-SHOOTABLE
-CANPASS
+NOBLOOD
+LOOKALLAROUND
+SLIDESONWALLS
+NOTARGETSWITCH
+NOPAIN
-DROPOFF
+BRIGHT
painchance 256
gravity 2.2
radius 64

var int user_eye;

states
{
Spawn:
RAT2 A 0 A_Jump(256, "Look")
Goto Intro
Intro:
TNT1 A 0 A_GiveInventory("NoRemoteMineLatch", 1)
RAT2 HGFEEEE 6
RAT2 IJK 12
RAT2 A 0 A_playSoundEx("misc/radevilroar", "SoundSlot7", 0, 1)
RAT2 L 80 A_Quake(5, 80, 0, 1000, "")
RAT2 M -1
Look:
RAT2 A 1 A_LookEx(0, 0, 0, 0, 360, "See")
loop
See:
RAT2 A 0 A_JumpIfInventory("SkullBarrierAmmo", 1, "Death")
RAT2 A 0 A_JumpIfInventory("AstroCrushAmmo", 1, "Roar")
RAT2 A 0 A_SetUserVar("user_eye", 128)
RAT2 A 0 A_JumpIfCloser(80, "Melee")
RAT2 QQQQQQQQ 1 A_ChangeVelocity(8.0, 0, 0, CVF_RELATIVE|CVF_REPLACE)
RAT2 Q 0 A_PlaySoundEx("misc/bigstomp", "Voice", 0, 1)
RAT2 Q 0 A_Quake(5, 5, 0, 800, 0)
RAT2 A 0 A_JumpIfCloser(80, "Melee")
RAT2 RRRRRRRR 1 A_ChangeVelocity(8.0, 0, 0, CVF_RELATIVE|CVF_REPLACE)
RAT2 A 0 A_JumpIfCloser(80, "Melee")
RAT2 A 0 A_JumpIfInventory("AstroCrushAmmo", 1, "Roar")
RAT2 SSSSSSSS 1 A_ChangeVelocity(8.0, 0, 0, CVF_RELATIVE|CVF_REPLACE)
RAT2 Q 0 A_PlaySoundEx("misc/bigstomp", "Voice", 0, 1)
RAT2 Q 0 A_Quake(5, 5, 0, 800, 0)
RAT2 A 0 A_JumpIfCloser(80, "Melee")
RAT2 TTTTTTTT 1 A_ChangeVelocity(8.0, 0, 0, CVF_RELATIVE|CVF_REPLACE)//A_FaceTarget
RAT2 A 0 A_GiveInventory("CutterFlag", 1)
RAT2 A 0 A_JumpIfInventory("CutterFlag", 3, "ChooseAttack")
loop
Melee:
RAT2 A 0 ACS_NamedExecuteAlways("RaDevilMelee", 0)
RAT2 B 5 A_Stop
TNT1 AAAAAAAAAAAA 0 A_SpawnITemEX("RaThorDebris", random(0, 200), 0, 0, 0, 0, random(5, 20), random(0,360)) 
RAT2 D 0 A_SpawnItemEx("RaDevilMelee")
RAT2 D 0 A_Quake(9, 15, 0, 800, 0)
RAT2 A 0 A_SetUserVar("user_eye", 64)
RAT2 "[" 15 A_PlaySoundEx("misc/hugequake", "SoundSlot6", 0, 1)
RAT2 A 0 A_SetUserVar("user_eye", 128)
RAT2 E 5
Goto Look
ChooseAttack:
RAT2 A 0 A_JumpIfInventory("AstroCrushAmmo", 1, "Roar")
RAT2 A 0 A_GiveInventory("ThunderBeamAmmo", 1)
RAT2 A 0 A_Stop
RAT2 A 0 A_TakeInventory("CutterFlag", 9999)
RAT2 A 0 A_JumpIfInventory("ThunderBeamAmmo", 2, "EyeLaser")
RAT2 A 0 A_Jump(256, "LeapSlam")
Goto Look
EyeLaser:
RAT2 A 0 A_TakeInventory("ThunderBeamAmmo", 999)
RAT2 JK 10 A_SetUserVar("user_eye", 0)
RAT2 A 0 A_SetUserVar("user_eye", 128)
RAT2 L 5 A_CustomMissile("RaDevilLaser", 140, 0, -15)
RAT2 L 5 A_CustomMissile("RaDevilLaser", 140, 0, 0)
RAT2 L 5 A_CustomMissile("RaDevilLaser", 140, 0, 15)
RAT2 L 25
RAT2 L 5 A_CustomMissile("RaDevilLaser", 140, 0, 15)
RAT2 L 5 A_CustomMissile("RaDevilLaser", 140, 0, 0)
RAT2 L 5 A_CustomMissile("RaDevilLaser", 140, 0, -15)
RAT2 M 25
RAT2 A 0 A_JumpIfInventory("AstroCrushAmmo", 1, "Roar")
Goto LeapSlam
LeapSlam:
RAT2 B 5
RAT2 C 18 A_ChangeVelocity(CallACS("RaDevilDistance")/16, random(-2, 2), 25, CVF_RELATIVE|CVF_REPLACE)
RAT2 A 0 A_SetUserVar("user_eye", 128)
Leaping:
RAT2 D 1 A_JumpIf(floorz-z==0, "Land")
loop
Land:
RAT2 D 0 A_Stop
RAT2 D 0 A_SpawnItemEx("RaDevilMelee")
RAT2 D 0 A_FaceTarget
RAT2 D 0 A_SpawnItemEx("RaDevilSlam", 0, 0, 0, 30)
RAT2 D 0 A_Quake(9, 15, 0, 800, 0)
RAT2 A 0 A_SetUserVar("user_eye", 64)
RAT2 "[" 35 A_PlaySoundEx("misc/hugequake", "SoundSlot6", 0, 1)
RAT2 E 10 A_SetUserVar("user_eye", 100)
Goto Look
Roar:
RAT2 A 0 A_playSoundEx("misc/radevilroar", "SoundSlot7", 0, 1)
RAT2 A 0 A_Stop
RAT2 A 0 A_SetUserVar("user_eye", 0)
RAT2 P 50 A_Quake(5, 80, 0, 1000, "")
RAT2 E 0 ACS_NamedExecute("radevilspecial", 0)
RAT2 EEEFFFFGG 1 A_SpawnItemEx("RaDevilDisappearGoop")
RAT2 GGGHHHHHHH 1 
TNT1 A -1
stop
Reform:
RAT2 A 0 A_TakeInventory("AstroCrushAmmo", 1)
RAT2 HGFEEEE 6
RAT2 EEE 6 A_SetUserVar("user_eye", 100)
Goto See
Death:
RAT3 N 0 A_SetUserVar("user_eye", 0)
RAT3 N 0 A_FaceTarget
RAT3 N 0 A_SpawnItemEx("RaDevilDeathExplode", 5, 0, 128) 
RAT3 N 40
RAT3 N 0 A_FaceTarget
RAT3 NNNN 25 A_SpawnItemEx("RaDevilDeathExplode", 5, random(-80,80), random(16, 180), 0, 0, 0, random(0,360)) 
RAT3 NNNNNNNNNNN 5 A_SpawnItemEx("RaDevilDeathExplode", 5, random(-80,80), random(16, 180), 0, 0, 0, random(0,360)) 
RAT3 NNNNNNNNNNNNNNNNNNNNNN 2 A_SpawnItemEx("RaDevilDeathExplode", 5, random(-80,80), random(16, 180), 0, 0, 0, random(0,360))
RAT3 N 0 A_FaceTarget
RAT3 N 0 A_PlaySOundEx("misc/devildeath", "Voice", 0, 1)
RAT3 N 0 A_SpawnItemEx("FakeDeathFX", 5, 0, 128)
stop
}
}

actor RaDevilDeathExplode
{
PROJECTILE
+NOINTERACTION
scale 1.5
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
RAT2 A 0 A_Quake(5, 5, 0, 1000, "")
TNT1 AAAAA 0 A_SpawnItemEx("RaDevilGoop", 0, 0, 0, frandom(2, 8), 0, frandom(10, 25), random(0, 360)) 
ASEX ABCDEFGH 2
stop
}
}

actor RaDevilCore
{
+DONTRIP
scale 2.5
+SHOOTABLE
+NOGRAVITY
+INVULNERABLE
-SOLID
radius 48
height 48
Health 400
states
{
Death:
RAT3 G 0 A_GiveInventory("IsDead", 1)
RAT3 G 1 A_JumpIf(floorz-z==0, "End")
wait
End:
TNT1 A 0 Thing_Destroy(1112)
TNT1 A 0 A_SpawnItemex("RaDevilGoopSplash", 0, 0, 0)
stop
}
}

actor RaDevilShotSpecial : RaDevilCore
{
states
{
Spawn:
RAT3 G 0
RAT3 G 1 A_SpawnItemex("RaDevilGoopSplash", 0, 0, 0)
RAT3 G 12 A_ChangeVelocity(0, 0, 3)
RAT3 G 1 A_JumpIf(z-floorz>100, "Prepare")
wait
Prepare:
RAT3 G 40 A_Stop
RAT3 GG 1 //A_LookEx(0, 0, 0, 0, 360, "FireI")
FireI:
RAT3 G 0 A_FaceTarget
RAT3 G 0 A_SpawnItemEx("RaDevilCharging", 10, 0, -18)
RAT3 G 0 A_PlaySoundEx("misc/radevilcharge", "Voice", 1, 1)
RAT3 LMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLM 2
RAT3 G 0 A_FaceTarget
RAT3 G 0 A_StopSoundEx("Voice")
RAT3 G 0 A_PlaySoundEx("misc/9thunder", "Voice", 0, 1)
RAT3 G 0 A_CustomMissile("RaDevilBigShot", -8)
RAT3 G 0 A_GiveInventory("AtomicFireAmmo", 1)
RAT2 G 0 A_JumpIfInventory("AtomicFireAmmo", 5, "BigRest")
RAT3 G 0 A_JumpIfInventory("CutterFlag", 1, "VRest")
goto Rest
Rest:
RAT3 G 55
goto FireI
VRest:
RAT3 E 55
goto FireI
BigRest:
RAT3 E 0 A_GiveInventory("CutterFlag", 1)
RAT3 E 0 ACS_NamedExecute("devilclearhpbar", 0)
RAT3 E 180 A_ChangeFlag("INVULNERABLE", 0)
Goto FireI
}
}

actor RaDevilCharging
{
+NOINTERACTION
renderstyle none
reactiontime 32
states
{
Spawn:
RAT3 G 1 A_CountDown
RAT3 GGG 0 A_SpawnItemEx("RaDevilCharge", 128, 0, random(-64, 128), 0, 0, 0, random(0,360))
loop
}
}

actor RaDevilCharge
{
-SOLID
+NOGRAVITY
+MISSILE
States
{
Spawn:
TNT1 A 0 
TNT1 A 0 A_FaceTarget
TNT1 A 1 A_CustomMissile("RaDevilChargeFX",0,0,0,0)
stop
}
}

actor RaDevilChargeFX
{
+THRUGHOST
PROJECTILE
scale 2.0
speed 10
translation "227:227=198:198", "208:226=192:192"
states
{
Spawn:
S_UN HIJIHIJI 2 A_ScaleVelocity(0.8)
stop
}
}

actor RaDevilBigShot
{
PROJECTILE
radius 12
height 8
+DONTBLAST
+DONTREFLECT
+THRUSPECIES
damagetype "Misc"
species "Enemy"
scale 2.5
speed 20
radius 16
height 16
damage (40)
+SEEKERMISSILE
states
{
Spawn:
RTBP A 0
RTBP A 0 Thing_ChangeTID(0, 8888)
RTBP ABC 2 A_SeekerMissile(90, 90, SMF_PRECISE)
Seek:
RTBP A 1 A_SeekerMissile(90, 90, SMF_PRECISE|SMF_CURSPEED)
RTBP A 0 A_ScaleVelocity(1.02)
RTBP A 1 A_SeekerMissile(90, 90, SMF_PRECISE|SMF_CURSPEED)
RTBP A 0 A_ScaleVelocity(1.02)
RTBP B 1 A_SeekerMissile(90, 90, SMF_PRECISE|SMF_CURSPEED)
RTBP B 0 A_ScaleVelocity(1.02)
RTBP B 1 A_SeekerMissile(90, 90, SMF_PRECISE|SMF_CURSPEED)
RTBP B 0 A_ScaleVelocity(1.02)
RTBP C 1 A_SeekerMissile(90, 90, SMF_PRECISE|SMF_CURSPEED)
RTBP C 0 A_ScaleVelocity(1.02)
RTBP C 1 A_SeekerMissile(90, 90, SMF_PRECISE|SMF_CURSPEED)
RTBP C 0 A_ScaleVelocity(1.02)
loop 
Death:
TNT1 A 0 A_Stop
TNT1 A 0 A_ChangeFlag("NOINTERACTION", 1)
TNT1 A 1 A_ClearTarget
TNT1 A 0 ACS_NamedExecute("devilshotimpact", 0)
TNT1 A 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
ASEX AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("RaDevilChargeFX", 0, 0, 0, 40, 0, random(-40, 40), random(0, 360))
ASEX A 0 A_Quake(5, 10, 0, 1000, "")
ASEX ABCDEF 3 
stop
}
}

actor RaDevilConcreteExtra : ConcreteBlock
{
	Renderstyle "None"
	states
	{
	Spawn:
	CONC D 0
	CONC D 0 A_ClearTarget
	CONC D 1
	CONC E 0 A_ChangeFlag(TOUCHY, false)
	CONC E 0 A_ChangeFlag(MISSILE, false)
	CONC E 0 A_ChangeFlag(SOLID, false)
	CONC EF 64
	Goto Death
	}
}

actor RaDevilFriendSpecial : RaDevilCore
{
Health 100
var int user_i;
damagefactor "TimeSlow", 8.0
damagefactor "CentaurFlash", 50.0
damagefactor "FlashStopper", 3.0
damagefactor "GravityHold", 1.5
states
{
Spawn:
RAT3 G 0
RAT3 G 0 A_SpawnItemex("RaDevilFriendSummoner", 0, 0, 0)
RAT3 G 1 A_SpawnItemex("RaDevilGoopSplash", 0, 0, 0)
RAT3 G 12 A_ChangeVelocity(0, 0, 6)
Rise:
RAT3 G 0 A_JumpIf(z-floorz>200, "Spin")
RAT3 G 0 A_SetUserVar("user_i", user_i + 12)
RAT3 G 3 A_ChangeVelocity(cos(user_i) * 15, sin(user_i) * 15, velz, CVF_RELATIVE|CVF_REPLACE)
loop
Spin:
RAT3 G 0 A_JumpIf(user_i>(35*5)*6, "Summon")
RAT3 G 0 A_SetUserVar("user_i", user_i + 12)
RAT3 G 3 A_ChangeVelocity(cos(user_i) * 15, sin(user_i) * 15, 0, CVF_RELATIVE|CVF_REPLACE)
loop
Summon:
RAT3 E 0 A_GiveInventory("CutterFlag", 1)
Summoned:
RAT3 G 0 A_JumpIf(user_i>(35*5)*12, "Vul")
RAT3 G 0 A_SetUserVar("user_i", user_i + 12)
RAT3 G 3 A_ChangeVelocity(cos(user_i) * 15, sin(user_i) * 15, 0, CVF_RELATIVE|CVF_REPLACE)
loop
Vul:
RAT3 E 0 ACS_NamedExecute("devilclearhpbar", 0)
RAT3 E 0 A_ChangeFlag("INVULNERABLE", 0)
Vulloop:
RAT3 G 0 A_SetUserVar("user_i", user_i + 12)
RAT3 E 3 A_ChangeVelocity(cos(user_i) * 15, sin(user_i) * 15, 0, CVF_RELATIVE|CVF_REPLACE)
loop
}
}

actor RaDevilFriendSummoner
{
height 0
radius 0
-SOLID
+NOINTERACTION
states
{
Spawn:
TNT1 A 0
TNT1 A 0 Thing_Move(0, 22, 1)
TNT1 A 0 Thing_ChangeTID(0, 1111)
Waiting:
TNT1 A 1 A_JumpIfInTargetInventory("CutterFlag", 1, "Summon")
wait
Summon:
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 2 A_SpawnItemex("RaDevilFriend", 432 - random(10, 0), 0, 0, 0, 0, 0, random(0,360))
TNT1 A 80
loop 
Death:
TNT1 A 0
stop
}
}

actor RaDevilFriend
{
+NOGRAVITY
+SHOOTABLE
-SOLID
+INVULNERABLE
Height 32
Radius 32
+FLOAT
floatspeed 0
xscale 2.5
yscale 0.01
var int user_y;
speed 0
painchance 0
Health 1
damagefactor "Enemy", 0.0
states
{
Spawn:
TNT1 A 0 A_Jump(256, "Death")
TNT1 A 0 Thing_ChangeTID(0, 1112)
TNT1 A 1 A_LookEx(0, 0, 0, 0, 360, "See")
wait
See:
RAT3 H 0 A_JumpIf(scaley >= 2.5, "Chase")
RAT3 H 1 A_SetScale(2.5, scaley + 0.1)
loop
Chase:
RAT3 # 0 A_JumpIf(user_y == 65*7, "Open3")
RAT3 # 0 A_JumpIf(user_y == 60*7, "Open2")
RAT3 # 0 A_JumpIf(user_y == 55*7, "Open1")
RAT3 # 0 A_SetUserVar("user_y", user_y+7)
RAT3 # 1 A_Chase
RAT3 # 0 A_FaceTarget
RAT3 # 0 A_ChangeVelocity(1.8, 0, 0, CVF_RELATIVE|CVF_REPLACE)
RAT3 # 1 A_SetScale(2.5, scaley - (sin(user_y) * 0.04))
RAT3 # 0 A_ChangeFlag("NOPAIN", 0)
loop
Melee:
RAT3 # 10 A_SpawnItemEx("RaDevilFriendDamager")
Goto Chase+3
Open1:
RAT3 I 0
goto Chase+3
Open2:
RAT3 J 0
goto Chase+3
Open3:
RAT3 K 0 A_ChangeFlag("INVULNERABLE", 0)
goto Chase+3
Pain.LightningBolt:
RAT3 I 0 Thing_Damage(1110, 5, 0)
Pain:
RAT3 I 1 A_PlaySoundEx("misc/devilpain", "Voice")
RAT3 IK 4 A_ChangeFlag("NOPAIN", 1)
Goto Chase+3
Death.LightningBolt:
RAT3 I 0 Thing_Damage(1110, 5, 0)
Death:
RAT3 III 0 A_SpawnITemEx("RaDevilGoopPuddle2", 0, 0, 0, random(10, 15), 0, random(10, 15), random(0,360)) 
RAT3 I 0 A_SpawnItemEx("SharkTorpedoDeath", 0, 0, 16)
stop
}
}

actor RaDevilFriendDamager
{
damagetype "Enemy"
PROJECTILE
+THRUACTORS
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(8, 64, 0, 0, 64)
stop
}
}

actor RaDevilThunderSpecial : RaDevilCore
{
states
{
Spawn:
RAT3 G 0
RAT3 G 1 A_SpawnItemex("RaDevilGoopSplash", 0, 0, 0)
RAT3 G 1 A_ChangeVelocity(0, 0, 4)
Rise:
RAT3 G 85 
RAT3 G 0 A_Stop
RAT3 G 30
RAT3 G 1 A_LookEx(0, 0, 0, 0, 360, "See")
wait
See:
RAT3 G 95 A_SpawnItemEx("RaDevilThunder")
RAT3 G 35
RAT3 E 0 ACS_NamedExecute("devilclearhpbar", 0)
RAT1 A 0 A_ChangeFlag("INVULNERABLE", 0)
Shocking:
RAT3 EFEFEFEFEFEFEFEFEFEF 2 A_FaceTarget
RAT3 EFEFEFEFEFEFEFEFEFEF 2 A_FaceTarget
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 0)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 1)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 2)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 3)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 4)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 5)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 6)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 7)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 8)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 9)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 10)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 11)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 12)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 13)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 14)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 15)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 16)
RAT1 X 0 A_CustomMissile("RaDevilSparkShot", 8, 0, 22.5 * 17)
loop
}
}

actor RaDevilSparkShot
{
scale 2.5
speed 8
damage (10)
PROJECTILE
height 8
radius 8
states
{
Spawn:
ESPA XWVW 2
loop
}
}
actor RaDevilThunder
{
+NOINTERACTION
PROJECTILE
scale 4.4
states
{
Spawn:
TNT1 A 0 
TNT1 A 0 A_PlaySoundEx("weapon/lightningbolt", "Voice", 0, 1)
TNT1 AAAAAAA 0 A_SpawnItemEx("LightningBoltFX", random(64, 80), 0, random(-80, 80), 0, 0, 0, random(0,360))
LBFX EFGHIJ 1 A_Warp(AAPTR_TARGET, -8, 0, 0, 0, 0)
TNT1 A 25

TNT1 A 0 A_PlaySoundEx("weapon/lightningbolt", "Voice", 0, 1)
TNT1 AAAAAAA 0 A_SpawnItemEx("LightningBoltFX", random(64, 80), 0, random(-80, 80), 0, 0, 0, random(0,360))
LBFX EFGHIJ 1 A_Warp(AAPTR_TARGET, -8, 0, 0, 0, 0)
TNT1 A 25

TNT1 A 0 A_PlaySoundEx("weapon/lightningbolt", "Voice", 0, 1)
TNT1 AAAAAA 0 A_SpawnItemEx("LightningBoltFX", random(64, 80), 0, random(-80, 80), 0, 0, 0, random(0,360))
LBFX EFGHIJ 1 A_Warp(AAPTR_TARGET, -8, 0, 0, 0, 0)
TNT1 A 45
Lightning:
TNT1 A 0 A_PlaySoundEx("weapon/lightningbolt", "Voice", 0, 1)
TNT1 AAA 0 A_SpawnItemEx("RaDevilLightningBolt", random(0, 6), random(0, 6), floorz-z, 0, 0, 0, 0, 0)
TNT1 AAAAAA 0 A_SpawnItemEx("LightningBoltFX", random(64, 80), 0, random(-80, 80), 0, 0, 0, random(0,360))
LBFX EFGHIJ 1 A_Warp(AAPTR_TARGET, -8, 0, 0, 0, 0)
TNT1 A 0 A_JumpIfInTargetInventory("IsDead", 1, "Death")
loop
Death:
TNT1 A 0
stop
}
}

actor RaDevilLightningBolt
{
scale 2.5
PROJECTILE
reactiontime 5
states
{
Spawn:
TNT1 A 0
LIBO I 0 A_SpawnItemEx("LightningBoltFX", Random(32, 96), Random(32, 96), 32)
LIBO I 0 A_SpawnItemEx("LightningBoltFX", Random(-32, -96), Random(-32, -96), 64)
LIBO I 0 A_SpawnItemEx("LightningBoltFX", Random(32, 96), Random(32, 96), 96)
LIBO I 0 A_SpawnItemEx("LightningBoltFX", Random(-32, -96), Random(-32, -96), 128)
LIBO I 0 A_SpawnItemEx("LightningBoltFX", Random(32, 96), Random(32, 96), 160)
LIBO I 0 A_SpawnItemEx("LightningBoltFX", Random(-32, -96), Random(-32, -96), 192)
LIBO HIJK 1
Floorshock:
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, 52 * 0, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, 52 * 1, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, 52 * 2, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, 52 * 3, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, 52 * 4, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, 52 * 5, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, 52 * 6, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, 52 * 7, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, 52 * 8, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, 52 * 9, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, 52 * 10, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)

TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, -52 * 1, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, -52 * 2, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, -52 * 3, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, -52 * 4, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, -52 * 5, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, -52 * 6, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, -52 * 7, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, -52 * 8, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, -52 * 9, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 0 A_SpawnITemEx("RaDevilLightningFloor", 0, -52 * 10, 350, 0, 0, 0, 0, SXF_ABSOLUTEANGLE)
TNT1 A 1 A_CountDown
loop
}
}

actor RaDevilLightningFloor
{
var int user_x;
+MISSILE
+NOGRAVITY
states
{
Spawn:
TNT1 A 0 A_SpawnItemEx("RaDevilLightningFloorSpark", -480 + (user_x * 32), 0, floorz-z, 0, 0, 0, 0, 0, 250)
TNT1 A 0 A_SetUserVar("user_x", user_x + 1)
TNT1 A 1 A_JumpIf(user_x==32, "Death")
loop
Death:
TNT1 A 0
stop
}
}

actor RaDevilLightningFloorSpark
{
PROJECTILE
+RIPPER
+RANDOMIZE
scale 2.5
//Damage (5)
Obituary "%o was sacrificed by \cmRa Devil\c-."
damagetype "Misc"
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(6, 48, 0, 0, 48)
RAT3 ABCD 1
stop
}
}

actor RaDevilGoopSplash
{
translation "48:235=6:6", "4:4=6:6"
scale 4.0
+NOINTERACTION
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("misc/piratebubble", 0, 0, 1)
TNT1 AAAAAAAAAAAAAAAA 0 A_SpawnItemEx("RaDevilGoop", 0, 0, 0, frandom(2, 8), 0, frandom(10, 25), random(0, 360))
OILS ABCDE 4
stop
}
}

actor RaDevilDisappearGoop
{
+NOINTERACTION
reactiontime 2
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,0)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,15)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,30)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,45)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,60)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,75)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,90)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,105)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,120)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,135)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,150)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,165)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,180)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,195)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,210)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,225)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,240)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,255)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,270)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,285)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,300)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,315)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,330)
TNT1 A 0 A_SpawnItemEx("RaDevilDrainPart",0,0,0,5,0,0,345)
TNT1 AAAAA 2 A_SpawnItemEx("RaDevilGoop", random(0, 48), 0, random(0, 128), frandom(0, 10), 0, frandom(0, 2), random(0, 360))
TNT1 A 0 A_Countdown
loop
}
}

actor RaDevilDrainPart : DuoShockwavePart
{
translation "0:255=6:6"
+NOINTERACTION
scale 1.0
xscale 2.0
states
{
Spawn:
DUOR T 35
stop
}
}

actor RaDevilGoop
{
PROJECTILE
+THRUACTORS
height 1
radius 1
xscale 0.5
yscale 0.5
-NOGRAVITY
states
{
Spawn:
RAT2 U 1 A_SetScale(scalex + frandom(0.01, 0.01), scaley + frandom(0.01, 0.01)) 
loop 
Death:
TNT1 A 0 A_PlaySoundEx("misc/piratebubble", 0, 0, 1)
RAT2 UU 0 A_SpawnITemEX("RaDevilGoopPuddle2", frandom(0, 3), 0, random(0, 48), random(1, 3), 0, random(2, 5), random(0,360))
stop
}
}

actor RaDevilIntroGoopSpawner
{
+NOGRAVITY
+NOINTERACTION
states
{
Spawn:
TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 4 A_SpawnITemEx("RaDevilIntroGoop", random(-28,52), random(-80, 80), 0, 0, 0, 0, 0)
stop
}
}

actor RaDevilIntroGoop
{
PROJECTILE
+THRUACTORS
height 1
radius 32
xscale 1.5
yscale 0.05
gravity 0.7
states
{
Spawn:
RAT2 YYYYYYYYYYYYYYYYYYYYYYYY 2 A_SetScale(scalex + frandom(0.05, 0.08), scaley + frandom(0.05, 0.08)) 
RAT2 YYYYYY 1 A_SetScale(scalex + frandom(0.01, 0.01), scaley + frandom(0.01, 0.01)) 
FallChance:
RAT2 U 0 A_SetScale(scalex + frandom(0.01, 0.01), scaley + frandom(0.01, 0.01)) 
RAT2 Y 1 A_Jump(64, "Fall")
loop
Fall:
RAT2 Y 0 A_SpawnItemEx("RaDevilIntroGoopYellow", 5, 0, 0, 0, 0, 0, random(0,360), 0, 200)
RAT2 Y 1 A_ChangeFlag("NOGRAVITY", 0)
RAT2 U 0 A_ChangeVelocity(0, 0, random(-2, 0))
RAT2 YYYYYYYYYYYYYYYYYYYYYY 1 A_SetScale(scalex - 0.06, scaley + 0.06) 
RAT2 Y -1
wait
Death:
TNT1 A 0 A_PlaySoundEx("misc/piratebubble", 0, 0, 1)
RAT2 UUUUU 0 A_SpawnITemEX("RaDevilGoopPuddle", frandom(0, 3), 0, random(0, 48), random(2, 6), 0, random(8, 12), random(0,360))
stop
}
}

actor RaDevilIntroGoopYellow : RaDevilIntroGoop
{
xscale 0.5
yscale 0.5
gravity 1.0
-NOGRAVITY
states
{
Spawn:
RAT2 ZZZZZZZZZZZZZZZZZZZZZZ 1 A_SetScale(scalex, scaley + 0.06) 
RAT2 Z -1
Death:
RAT2 UUU 0 A_SpawnITemEX("RaDevilGoopPuddleYellow", frandom(0, 3), 0, random(0, 0), random(2, 6), 0, random(8, 12), random(0,360))
stop
}
}


actor RaDevilGoopPuddle
{
PROJECTILE
+THRUACTORS
-NOGRAVITY
scale 1.0
states
{
Spawn:
RAT2 U 1 A_SetScale(scalex + random(-0.1, 0.1), scaley + random(-0.1, 0.1))
loop
Death:
RAT2 UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU 1 A_SetScale(scalex + 0.01, scaley - 0.01)
stop
}
}


actor RaDevilGoopPuddleYellow
{
PROJECTILE
+THRUACTORS
-NOGRAVITY
scale 0.5
states
{
Spawn:
RAT2 Z 1 A_SetScale(scalex + random(-0.1, 0.1), scaley + random(-0.1, 0.1))
loop
Death:
RAT2 ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 1 A_SetScale(scalex + 0.01, scaley - 0.01)
stop
}
}

actor RaDevilGoopPuddle2 : RaDevilGoopPuddle
{
scale 0.5
states
{
Spawn:
RAT2 U 1 A_SetScale(scalex + random(-0.1, 0.1), scaley + random(-0.1, 0.1))
loop
Death:
RAT2 UUUUUUUUUUUUUUUUUUUUUUUUUUUUUU 1 A_SetScale(scalex + 0.01, scaley - 0.01)
stop
}
}

actor RaDevilLaser
{
PROJECTILE
+THRUSPECIES
species "Enemy"
+SEEKERMISSILE
speed 50
scale 2.5
+DOOMBOUNCE
damage (15)
translation "210:248=176:176", "208:208=0:0"
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundex("misc/wilygolemblast", "Voice", 0, 1)
Flying:
MMFX C 0 A_SpawnItemEx("RaDevilLaserFX")
MMFX C 1 A_JumpIf(z<256, "Slow")
loop
Slow:
MMFX C 1 A_SpawnItemEx("RaDevilLaserFX")
MMFX C 0 A_ScaleVElocity(0.75)
MMFX C 0 A_GiveInventory("CutterFlag", 1)
MMFX C 0 A_JumpIfInventory("CutterFlag", 18, "Retarget")
loop
Retarget:
MMFX C 0 A_RearrangePointers(0, AAPTR_TARGET)
TNT1 A 0 A_TakeInventory("CutterFlag", 999)
MMFX CC 4 A_LookEx(0, 0, 0, 0, 360, "See")
stop
See:
MMFX C 0 A_ChangeFlag("DOOMBOUNCE", 0)
MMFX C 0 A_SpawnItemEx("RaDevilLaserFX")
MMFX C 1 A_RearrangePointers(AAPTR_MASTER, 0, AAPTR_TARGET)
MMFX C 0 A_FaceTracer
MMFX C 0 A_SpawnItemEx("RaDevilLaserFX")
MMFX C 1 A_ChangeVelocity(2.5, 0, 0, CVF_RELATIVE)
Chase:
PLAY C 0 A_SeekerMissile(90, 90, SMF_CURSPEED|SMF_PRECISE, 256)
MMFX C 0 A_SpawnItemEx("RaDevilLaserFX")
MMFX C 1 A_ScaleVelocity(1.1)
MMFX C 0 A_GiveInventory("CutterFlag", 1)
MMFX C 0 A_JumpIfInventory("CutterFlag", 12, "End")
loop
End:
MMFX C 0 A_SpawnItemEx("RaDevilLaserFX")
MMFX C 1 A_ScaleVelocity(1.1)
loop
}
}

actor RaDevilLaserFX
{
scale 2.5
+NOINTERACTION
translation "210:248=176:176", "208:208=0:0"
states
{
Spawn:
MMFX CD 8
MMFX E 4
stop
}
}

actor RaDevilSlam
{
PROJECTILE
+THRUACTORS
states
{
Spawn:
TNT1 A 3 A_SpawnItemEx("RaDevilSlamAOE")
loop
}
}

actor RaDevilSlamAOE
{
PROJECTILE
damagetype "Misc"
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(10, 80, 0, 0, 80)
TNT1 AAAAAAAAA 0 A_SpawnITemEX("RaThorDebris", random(0, 180), 0, 0, 0, 0, random(5, 20), random(0,360)) 
TNT1 A 1
stop
}
}

actor RaDevilMelee
{
PROJECTILE
damagetype "Misc"
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(20, 128, 0, 0, 128)
stop
}
}

actor RaDevilEye
{
renderstyle none
Height 32
Radius 32
+SHOOTABLE
+NOGRAVITY
species "Enemy"
+THRUSPECIES
Health 1000
scale 1.0
mass 99999999

damagefactor "Misc", 0.0
damagefactor "Buster", 1.0
damagefactor "ChargeBuster", 1.0
damagefactor "ArrowBuster", 1.0
damagefactor "BassBuster", 1.0
damagefactor "DuoFist1", 1.0
damagefactor "DuoFist2", 1.0
damagefactor "DuoFist3", 1.0
damagefactor "LaserBuster", 1.0
damagefactor "MegaArm", 5.0
damagefactor "Buster", 1.0
damagefactor "ProtoBuster", 1.0
damagefactor "ProtoBuster2", 1.0
damagefactor "ProtoBuster3", 1.0
damagefactor "SuperAdaptor", 1.0
damagefactor "TrebleBoost", 1.0

damagefactor "FireStorm", 1.0
damagefactor "FireSpin", 1.0
damagefactor "HyperBomb", 0.5
damagefactor "IceSlasher", 0.25
damagefactor "OilSlider", 1.0
damagefactor "OilFlame", 1.0
damagefactor "RollingCutter", 0.6
damagefactor "SuperArm", 1.0
damagefactor "ThunderBeam", 1.0
damagefactor "TimeSlow", 1.0

damagefactor "AirShooter", 1.0
damagefactor "AtomicFire1", 1.0
damagefactor "AtomicFire2", 1.0
damagefactor "AtomicFire3", 0.5
damagefactor "BubbleLead", 1.0
damagefactor "CrashBomb", 1.0
damagefactor "LeafShield", 1.0
damagefactor "MetalBlade", 0.8
damagefactor "Instagib", 1.0
damagefactor "QuickBoomerang", 0.8
damagefactor "TimeStopper", 1.0

damagefactor "GeminiLaser", 1.0
damagefactor "HardKnuckle", 1.0
damagefactor "MagnetMissile", 1.0
damagefactor "NeedleCannon", 1.0
damagefactor "SearchSnake", 1.0
damagefactor "ShadowBlade", 0.5
damagefactor "SparkShock", 1.0
damagefactor "TopSpin", 1.0

damagefactor "DiveMissile", 1.0
damagefactor "DrillBomb", 1.0
damagefactor "DustCrusher", 1.0
damagefactor "DustCrusherBit", 1.0
damagefactor "FlashStopper", 1.0
damagefactor "PharaohShot1", 1.0
damagefactor "PharaohShot2", 1.0
damagefactor "PharaohShot3", 1.0
damagefactor "PharaohShotHold", 1.0
damagefactor "RainFlush", 1.0
damagefactor "RingBoomerang", 1.0

damagefactor "ChargeKick", 1.0
damagefactor "CrystalEye", 1.0
damagefactor "CrystalEyeBit", 1.0
damagefactor "GravityHold", 1.0
damagefactor "GyroAttack", 1.0
damagefactor "NapalmBomb", 1.0
damagefactor "PowerStone", 1.0
damagefactor "StarCrash", 1.0
damagefactor "WaterWave", 1.0

damagefactor "BlizzardAttack", 1.0
damagefactor "CentaurFlash", 1.0
damagefactor "FlameBlast", 1.0
damagefactor "KnightCrush", 1.0
damagefactor "PlantBarrier", 1.0
damagefactor "SilverTomahawk", 1.0
damagefactor "WindStorm", 1.0
damagefactor "YamatoSpear", 0.5

damagefactor "DangerWrap", 1.0
damagefactor "FreezeCracker", 1.0
damagefactor "FreezeCrackerBit", 1.0
damagefactor "JunkShield", 1.0
damagefactor "NoiseCrush1", 1.0
damagefactor "NoiseCrush2", 1.0
damagefactor "ScorchWheel", 1.0
damagefactor "SlashClaw", 1.0
damagefactor "ThunderBolt", 1.0
damagefactor "WildCoil", 1.0
damagefactor "WildCoil2", 1.0

damagefactor "AstroCrush", 1.0
damagefactor "FlameSword", 1.0
damagefactor "FlameSwordSpark", 1.0
damagefactor "FlashBomb", 0.2
damagefactor "HomingSniper", 1.0
damagefactor "IceWave", 1.0
damagefactor "MegaBall", 1.0
damagefactor "ThunderClaw", 0.0
damagefactor "ThunderClawPegHelp", 0.0
damagefactor "TornadoHold", 1.0
damagefactor "WaterBalloon", 1.0

damagefactor "BlackHoleBomb", 1.0
damagefactor "ConcreteShot", 1.0
damagefactor "HornetChaser", 1.0
damagefactor "JewelSatellite", 1.0
damagefactor "LaserTrident", 1.0
damagefactor "MagmaBazooka1", 1.0
damagefactor "MagmaBazooka2", 1.0
damagefactor "PlugBall", 1.0
damagefactor "TornadoBlow", 1.0

damagefactor "CopyVision", 1.0
damagefactor "IceWall", 0.0
damagefactor "LightningBolt", 1.1
damagefactor "MagicCard", 1.0
damagefactor "RemoteMine", 0.4
damagefactor "SpreadDrill", 0.1
damagefactor "SpreadDrill2", 0.5
damagefactor "SpreadDrill3", 1.0
damagefactor "TenguBlade", 0.8
damagefactor "WaveBurner", 1.0

damagefactor "ChillShot", 1.0
damagefactor "ChillSpike", 1.0
damagefactor "CommandoBomb", 0.5
damagefactor "ReboundStriker", 1.0
damagefactor "SolarBlaze", 1.0
damagefactor "ThunderWool", 0.5
damagefactor "TripleBlade", 1.0
damagefactor "WaterShield", 1.0
damagefactor "WheelCutter", 1.0

damagefactor "BlackHole", 1.0
damagefactor "BreakDash", 1.0
damagefactor "BubbleBomb", 1.0
damagefactor "DeepDigger", 1.0
damagefactor "ElectricShock", 1.0
damagefactor "GrabBuster", 1.0
damagefactor "PhotonMissile", 1.0
damagefactor "SaltWater", 1.0
damagefactor "SparkChaser", 1.0

damagefactor "BalladeCracker", 1.0
damagefactor "MirrorBuster1", 1.0
damagefactor "MirrorBuster2", 1.0
damagefactor "MirrorBuster3", 1.0
damagefactor "Sakugarne", 1.0
damagefactor "ScrewCrusher", 1.0

damagefactor "WireAdaptor", 1.0
damagefactor "Beat", 1.0
damagefactor "EddieBomber", 1.0
damagefactor "Reggae", 1.0
damagefactor "Tango", 1.0

states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_GiveInventory("CanBeGrabBustered", 1)
TNT1 A -1 ACS_NamedExecute("devileye", 0)
loop
Death:
TNT1 A 1 ACS_NamedTerminate("devileye", 0)
stop
}
}

actor RaThorBoss
{
	//$Category MM8BDM-Bosses
	MONSTER
	-COUNTKILL
	+NOBLOOD
	+LOOKALLAROUND
    +SLIDESONWALLS
    +NOGRAVITY
	+DONTRIP
	+SEEKERMISSILE
	Radius 16
	Height 56
	Scale 2.5
	speed 22
	Obituary "%o was obliterated by \cuRa Thor\c-."
	Translation "192:192=248:248", "198:198=3:3"
	-SOLID
	Health 1000
	mass 99999999
	alpha 0.0
	damagefactor "Misc", 0.0
	damagefactor "Buster", 0.7
	painchance 256
	+NOPAIN
	
	var int user_t;

	States
	{
	Spawn:
	RAT1 A 0 A_Jump(256, "EndSpawn")
	Spawning:
	TNT1 A 1 A_FadeIn(0.05)
	RAT1 A 1 A_ChangeVelocity(0, 0, -2.1, CVF_REPLACE)
	loop
	EndSpawn:
	TNT1 A -1
	stop
	Awaken:
	RAT1 A 110
	Awaken_Skip:
	RAT1 A 0 A_ChangeFlag("NOGRAVITY", 0)
	RAT1 BCD 4
	RAT1 A 0 A_PlaySoundEx("misc/terraclick", "voice", false, 2)
    RAT1 EFG 2
	RAT1 G 0 A_SetUserVar("user_t", 100)
	RAT1 G -1 A_SpawnItemEx("RaThorSpecialHitbox")
	Goto Look
	Look:
	RAT1 G 45 A_GiveInventory("VBossFlags", 1)
	RATH A 1 A_LookEx(0, 0, 0, 0, 360, "See")
	goto Look+1
	
	TimeStopped:
	
	"####" "#" 0 A_TakeInventory("BreakDashAmmo", 999)
	"####" "#" 0 A_ChangeFlag("NOGRAVITY", 1)
	"####" "#" 0 A_ChangeFlag("NOPAIN", 1)
	"####" "#" 0 A_Stop
	TimeStopping:
	"####" "#" 0 A_JumpIfInventory("TimeStopperAmmo", 6, "TimeStopEnd")
	"####" "#" 35 A_GiveInventory("TimeStopperAmmo", 1)
	loop
	TimeStopEnd:
	"####" "#" 0 A_TakeInventory("TimeStopperAmmo", 999)
	goto EscapeTeleport
	
	SetupShield:
	RAT1 JIII 4
	RAT1 I 4 ACS_NamedExecute("rathorshield", 0)//A_SpawnITemEx("RaThorFireShield")
	RAT1 J 4
	RATH A 0 A_FaceTarget
	RATH A 20 A_TakeInventory("SkullBarrierAmmo", 999)
	Goto Seek
	
	See:
	TNT1 A 0
	Goto Seek
	
	Seek: 
	RATH A 1 A_LookEx(0, 0, 0, 0, 360, "ChooseAttack")
	loop
	
	ChooseAttack:
	"####" "#" 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	
	TNT1 A 0 A_GiveInventory("RollingCutterAmmo", 1)
	TNT1 A 0 A_JumpIfInventory("SkullBarrierAmmo", 1, "SetupShield")
	
	TNT1 A 0 A_JumpIfInventory("RollingCutterAmmo", 8, "Reset")
	TNT1 A 0 A_JumpIfInventory("RollingCutterAmmo", 7, "SpiritBombStart")
	TNT1 A 0 A_JumpIfInventory("RollingCutterAmmo", 6, "LeapDiscs")
	TNT1 A 0 A_JumpIfInventory("RollingCutterAmmo", 5, "DashStart")
	TNT1 A 0 A_JumpIfInventory("RollingCutterAmmo", 4, "LeapDiscs")
	TNT1 A 0 A_JumpIfInventory("RollingCutterAmmo", 3, "SpiritBombStart") // should be lightning but I dont like it
	TNT1 A 0 A_JumpIfInventory("RollingCutterAmmo", 2, "DashStart")
	TNT1 A 0 A_JumpIfInventory("RollingCutterAmmo", 1, "LeapDiscs")
	goto LeapDiscs
	
	Reset:
	TNT1 A 0 A_TakeInventory("RollingCutterAmmo", 999)
	goto Seek
	
	LeapDiscs:
	RAT1 A 0 A_FaceTarget
	RAT1 A 0 A_ChangeVelocity(15.0 * (user_t/100), (5.0 * random(-1, 1))  * (user_t/100), 12, CVF_RELATIVE|CVF_REPLACE)
	RAT1 K 12
	RAT1 L 2 A_FaceTarget
	RAT1 L 2 A_CustomMissile("RaThorDisc", 35, 0, 0)
	RAT1 L 0 A_CustomMissile("RaThorDisc", 35, 0, -20)
	RAT1 L 2 A_CustomMissile("RaThorDisc", 35, 0, 20)
	RAT1 L 0 A_CustomMissile("RaThorDisc", 35, 0, 40)
	RAT1 L 2 A_CustomMissile("RaThorDisc", 35, 0, -40)
	RAT1 L 5
	"####" "#" 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	RAT1 K 1 A_JumpIf(z-floorz==0, "LeapDisc2")
	wait
	LeapDisc2:
	RAT1 A 0 A_FaceTarget
	RAT1 A 0 A_ChangeVelocity(-10.0 * (user_t/100), (5.0 * random(-1, 1)) * (user_t/100), 20, CVF_RELATIVE|CVF_REPLACE)
	RAT1 K 12
	RAT1 L 2 A_FaceTarget
	RAT1 L 0 A_CustomMissile("RaThorDisc", 35, 0, 40)
	RAT1 L 2 A_CustomMissile("RaThorDisc", 35, 0, -40)
	RAT1 L 0 A_CustomMissile("RaThorDisc", 35, 0, -20)
	RAT1 L 2 A_CustomMissile("RaThorDisc", 35, 0, 20)
	RAT1 L 2 A_CustomMissile("RaThorDisc", 35, 0, 0)
	RAT1 L 5
	
	Falling:
	"####" "#" 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	RAT1 K 1 A_JumpIf(z-floorz==0, "Land")
	loop
	Land:
	RATH A 10 A_Stop
	RATH AAAAAAAAAA 5 A_FaceTarget
	"####" "#" 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	Goto Tele

	Idle: // moon dude lost his target
	TNT1 A 17
	TNT1 A 1 A_LookEx(0, 0, 0, 0, 360, "TeleContinue")
	wait
	TeleContinue:
	TNT1 A 0 A_JumpIfInventory("FireStormAmmo",1,"BombContinue")
	goto TeleNormContinue

	Tele:
	RATH A 0 A_FaceTarget
	TNT1 A 0 A_TakeInventory("CanBeGrabBustered", 9999)
	TNT1 A 0 A_GiveInventory("NoRemoteMineLatch", 1)
	RATH A 0 A_SpawnITemEx("RaThorTeleport1", 0, 0, 0, 0, 18)
	RATH A 0 A_SpawnITemEx("RaThorTeleport2", 0, 0, 0, 0, -18)
	TNT1 A 0 A_GiveInventory("PlantBarrierAmmo", 1)
	TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
	TNT1 A 0 A_ChangeFlag("INVULNERABLE", 1)
	TNT1 A 20
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_Chase
	TeleNormContinue:
	TNT1 A 1 A_ChangeVelocity(0, 0, random(100, 180), 0)
	TNT1 A 0 A_Stop
	TNT1 A 0 A_ChangeFlag("NOGRAVITY", 1)
	TNT1 A 0 A_FaceTarget
	RATH A 0 A_SpawnITemEx("RaThorTeleport1", 0, 210, 0, 0, -15)
	RATH A 0 A_SpawnITemEx("RaThorTeleport2", 0, -210, 0, 0, 15)
	TNT1 A 14 A_FaceTarget
	TNT1 A 0 A_GiveInventory("CanBeGrabBustered", 1)
	TNT1 A 0 A_TakeInventory("NoRemoteMineLatch", 1)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_TakeInventory("PlantBarrierAmmo", 999)
	TNT1 A 0 A_ChangeFlag("SHOOTABLE", 1)
	TNT1 A 0 A_ChangeFlag("INVULNERABLE", 0)
	RAT1 K 1 A_ChangeFlag("NOGRAVITY", 0)
	"####" "#" 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	RAT1 L 2 A_CustomMissile("RaThorDisc", 35, 0, 0)
	RAT1 L 0 A_CustomMissile("RaThorDisc", 35, 0, -20)
	RAT1 L 2 A_CustomMissile("RaThorDisc", 35, 0, 20)
	RAT1 L 0 A_CustomMissile("RaThorDisc", 35, 0, 40)
	RAT1 L 2 A_CustomMissile("RaThorDisc", 35, 0, -40)
	RAT1 K 1 A_JumpIf(z-floorz==0, "Seek")
	wait
	
	LightningStart:
	RATH AAAAAA 4 A_FaceTarget
	TNT1 A 0 A_ChangeFlag("NOGRAVITY", 1)
	RAT1 S 0 A_SpawnItemEx("HyperStormDust",0,0,0,-2,0,0)
	RAT1 K 1 A_ChangeVelocity(0, 0, 20, 0)
	RAT1 KKKKKKKKKKKKK 2 A_ScaleVelocity(0.8)
	RAT1 K 0 A_Stop
	SGOD F 0 A_GiveInventory("SunstarDamageProtector", 1)
	RAT1 V 10
	"####" "#" 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	RAT1 V 0 A_FaceTarget
	RAT1 V 0 A_SpawnItemEx("RaThorLightningBoltSpawner", 0, 0, -floorz, 20, 0, 0, 0)
	RAT1 V 0 A_SpawnItemEx("RaThorLightningBoltSpawner", 0, 0, -floorz, 20, 0, 0, -90)
	RAT1 V 0 A_SpawnItemEx("RaThorLightningBoltSpawner", 0, 0, -floorz, 20, 0, 0, 180)
	RAT1 V 35 A_SpawnItemEx("RaThorLightningBoltSpawner", 0, 0, -floorz, 20, 0, 0, 90)
	RAT1 V 0 A_FaceTarget
	RAT1 V 0 A_SpawnItemEx("RaThorLightningBoltSpawner", 0, 0, -floorz, 20, 0, 0, 0)
	RAT1 V 0 A_SpawnItemEx("RaThorLightningBoltSpawner", 0, 0, -floorz, 20, 0, 0, -90)
	RAT1 V 0 A_SpawnItemEx("RaThorLightningBoltSpawner", 0, 0, -floorz, 20, 0, 0, 180)
	RAT1 V 35 A_SpawnItemEx("RaThorLightningBoltSpawner", 0, 0, -floorz, 20, 0, 0, 90)
	RAT1 V 0 A_FaceTarget
	RAT1 V 0 A_SpawnItemEx("RaThorLightningBoltSpawner", 0, 0, -floorz, 20, 0, 0, 0)
	RAT1 V 0 A_SpawnItemEx("RaThorLightningBoltSpawner", 0, 0, -floorz, 20, 0, 0, -90)
	RAT1 V 0 A_SpawnItemEx("RaThorLightningBoltSpawner", 0, 0, -floorz, 20, 0, 0, 180)
	RAT1 V 35 A_SpawnItemEx("RaThorLightningBoltSpawner", 0, 0, -floorz, 20, 0, 0, 90)
	RAT1 V 35
	"####" "#" 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	SGOD F 0 A_TakeInventory("SunstarDamageProtector", 1)
	goto EscapeTeleport
	
	SpiritBombStart:
	RATH AAAAAA 4 A_FaceTarget
	"####" "#" 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	SpiritBomb:
	TNT1 A 0 A_ChangeFlag("THRUACTORS", 1)
	TNT1 A 0 A_ChangeFlag("NOGRAVITY", 1)
	RAT1 S 0 A_SpawnItemEx("HyperStormDust",0,0,0,-2,0,0)
	RAT1 K 1 A_ChangeVelocity(0, 0, 30, 0)
	RAT1 KKKKKKKKKKKKK 2 A_ScaleVelocity(0.8)
	TNT1 A 0 A_ChangeFlag("THRUACTORS", 0)
	RAT1 K 0 A_Stop
	"####" "#" 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	RAT1 K 0 A_SpawnITemEx("RaThorBomb", 0, 0, 200) 
	SGOD F 0 A_GiveInventory("SunstarDamageProtector", 1)
	RAT1 NMNMNMNMNMNMNMNMNM 3
	RAT1 K 0 A_GiveInventory("CutterFlag", 1)
	RAT1 NMNMNMNMNMNMNMN 3
	RAT1 K 0 A_FaceTarget
	RAT1 L 80 A_GiveInventory("CutterFlag", 1)
	RAT1 L 0 A_TakeInventory("SunstarDamageProtector", 1)
	RAT1 L 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	EscapeTeleport:
	RAT1 K 0 A_FaceTarget
	TNT1 A 0 A_GiveInventory("NoRemoteMineLatch", 1)
	RATH A 0 A_SpawnITemEx("RaThorTeleport1", 0, 0, 0, 0, 18)
	RATH A 0 A_SpawnITemEx("RaThorTeleport2", 0, 0, 0, 0, -18)
	TNT1 A 0 A_GiveInventory("PlantBarrierAmmo", 1)
	TNT1 A 0 A_GiveInventory("FireStormAmmo", 1)
	TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
	TNT1 A 0 A_ChangeFlag("INVULNERABLE", 1)
	RAT1 K 0 A_ChangeFlag("NOGRAVITY", 0)
	RAT1 A 0 A_TakeInventory("CutterFlag", 999)
	TNT1 A 1 A_JumpIf(z-floorz==0, "BombTeleport")
	wait
	
	BombTeleport:
	TNT1 A 34
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_Chase
	BombContinue:
	TNT1 A 0 A_FaceTarget
	RATH A 0 A_SpawnITemEx("RaThorTeleport1", 0, 210, 0, 0, -15)
	RATH A 0 A_SpawnITemEx("RaThorTeleport2", 0, -210, 0, 0, 15)
	TNT1 A 14 A_FaceTarget
	TNT1 A 0 A_TakeInventory("NoRemoteMineLatch", 1)
	TNT1 A 0 A_TakeInventory("PlantBarrierAmmo", 999)
	TNT1 A 0 A_TakeInventory("FireStormAmmo", 999)
	TNT1 A 0 A_ChangeFlag("INVULNERABLE", 0)
	TNT1 A 0 A_ChangeFlag("SHOOTABLE", 1)
	RATH A 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	RATH AAAA 5 A_FaceTarget
	Goto Seek
	
	DashStart:
	RAT1 S 0 A_GiveInventory("BreakDashAmmo", 1)
	RATH AAAA 3 A_FaceTarget
	"####" "#" 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	RAT1 JIHH 7
	//TNT1 A 0 A_GiveInventory("PlantBarrierAmmo", 1)
	RAT1 S 0 A_FaceTarget
	RAT1 S 0 A_RearrangePointers(AAPTR_TARGET, 0, AAPTR_TARGET)
	RAT1 S 0 //A_ChangeFlag("NOPAIN", 0)
	RAT1 S 0 A_SeekerMissile(90, 90, SMF_PRECISE)
	RAT1 S 0 A_SpawnItemEx("HyperStormDust",0,0,0,-8,0,0)
	RAT1 S 0 A_PlaySoundEx("weapon/tengudash", "Voice", 0, 1)
	Dashing:
	"####" "#" 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	RAT1 S 0 A_JumpIfInTargetInventory("IsDead", 1, "Tele")
	RAT1 S 0 A_JumpIfCloser(80, "Grabbed")
	RAT1 S 0 A_SpawnItemEx("RaThorDashFx", -2)
	RAT1 S 1 A_Recoil(-8)
	RAT1 S 0 A_JumpIfCloser(80, "Grabbed")
	RAT1 S 1 A_Recoil(-8)
	RAT1 S 0 A_JumpIfCloser(80, "Grabbed")
	RAT1 S 0 A_SpawnItemEx("RaThorDashFx", -2)
	RAT1 S 1 A_Recoil(-8)
	RAT1 S 0 A_JumpIfCloser(80, "Grabbed")
	RAT1 S 1 A_Recoil(-8)
	RAT1 S 0 A_JumpIfCloser(80, "Grabbed")
	RAT1 S 1 A_Recoil(-8)
	RAT1 S 0 A_SpawnItemEx("RaThorDashFx", -2)
	RAT1 S 0 A_JumpIfCloser(80, "Grabbed")
	RAT1 S 1 A_Recoil(-8)
	RAT1 S 0 A_JumpIfCloser(80, "Grabbed")
	RAT1 S 1 A_Recoil(-8)
	RAT1 S 0 A_SpawnItemEx("RaThorDashFx", -2)
	RAT1 S 0 A_JumpIfCloser(80, "Grabbed")
	RAT1 S 1 A_Recoil(-8)
	RAT1 S 0 A_JumpIfCloser(80, "Grabbed")
	RAT1 S 1 A_Recoil(-8)
	RAT1 S 0 A_SpawnItemEx("RaThorDashFx", -2)
	RAT1 S 0 A_JumpIfCloser(80, "Grabbed")
	RAT1 S 1 A_Recoil(-8)
	RAT1 S 0 A_JumpIfCloser(80, "Grabbed")
	RAT1 S 1 A_Recoil(-8)
	RAT1 S 0 A_SpawnItemEx("RaThorDashFx", -2)
	RAT1 S 0 A_JumpIfCloser(80, "Grabbed")
	RAT1 S 1 A_Recoil(-8)
	RAT1 S 0 A_JumpIfCloser(80, "Grabbed")
	RAT1 S 1 A_Recoil(-8)
	RAT1 S 0 A_SpawnItemEx("RaThorDashFx", -2)
	RAT1 S 0 A_JumpIfCloser(80, "Grabbed")
	RAT1 S 1 A_Recoil(-8)
	RAT1 S 0 A_JumpIfCloser(80, "Grabbed")
	RAT1 S 1 A_Recoil(-8)
	Goto DashNope
	Pain:
	"####" "#" 0 A_JumpIfInventory("TimeStopperAmmo", 1, "TimeStopped")
	RAT1 S 0 A_SpawnItemEx("PainFX", 5)
	RAT1 S 0 A_GiveInventory("BreakDashAmmo", 1)
	RAT1 S 0 A_JumpIFInventory("BreakDashAmmo", 5, "DashFailed")
	RAT1 S 0 A_ChangeFlag("NOPAIN", 1)
	RAT1 S 3 A_ScaleVelocity(0.1)
	//RAT1 S 1 A_SeekerMissile(90, 90, SMF_PRECISE)
	RAT1 S 0 A_ChangeFlag("NOPAIN", 0)
	Goto Dashing
	DashFailed:
	//RAT1 S 0 A_ChangeFlag("NOPAIN", 1)
	RAT1 S 0 A_TakeInventory("BreakDashAmmo", 999)
	RAT1 S 0 A_ChangeVElocity(-9.0, 0, 0, CVF_RELATIVE|CVF_REPLACE)
	RATH H 8
	//TNT1 A 0 A_TakeInventory("PlantBarrierAmmo", 999)
	RAT1 R 50
	DashNope:
	RATH A 20 A_Stop
	RATH A 10 A_FaceTarget
	Goto LeapDisc2
	Grabbed:
	//RAT1 T 0 A_ChangeFlag("SOLID", 0)
	RAT1 T 1 A_ChangeFlag("THRUACTORS", 1)
	RAT1 T 1 A_ChangeVelocity(0, 0, 20, CVF_REPLACE|CVF_RELATIVE)
	RAT1 T 0 ACS_NamedExecute("rathorgrab", 0)
	RAT1 T 10 //A_ChangeVelocity(0, 0, 20, CVF_REPLACE|CVF_RELATIVE)
	RAT1 T 1 A_ChangeVelocity(0, 0, -50, CVF_REPLACE|CVF_RELATIVE)
	RAT1 T 1 A_JumpIf(z-floorz==0, "Slam")
	wait
	Slam:
	RAT1 S 0 A_SpawnITemEX("RaThorSlamDamager", -32)
	RAT1 S 0 A_TakeInventory("BreakDashAmmo", 999)
	RAT1 T 0 A_ChangeFlag("THRUACTORS", 0)
	//RAT1 T 0 A_ChangeFlag("SOLID", 1)
	RAT1 U 5
	RATH A 35 A_FaceTarget
	TNT1 A 0 A_TakeInventory("PlantBarrierAmmo", 999)
	Goto EscapeTeleport
	
	Death:
	RAT3 N 0 A_TakeInventory("TimeSlowAmmo", 9999)
	RAT3 N 0 A_TakeInventory("TimeStopperAmmo", 9999)
	RATH A 0 A_FaceTarget
	RATH A 0 A_GiveInventory("IsDead", 1)
	RATH A 0 A_GiveInventory("PlantBarrierAmmo", 1)
	
	RATH H 0 A_ChangeVelocity(-5.0, 0, 0, CVF_REPLACE|CVF_RELATIVE)
	RATH H 1 A_JumpIf(z-floorz==0, "Dead")
	wait
	
	Dead:
	RAT1 R 30
	RAT1 R 0 A_Quake(9, 5, 0, 1000, 0)
	RAT1 R 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
	RAT1 R 40 A_SpawnItemEx("WilygolemExplosion", random(0, 48), 0, random(0, 60), 0, 0, 0, random(0,360))
	RAT1 R 0 A_Quake(9, 5, 0, 1000, 0)
	RAT1 R 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
	RAT1 R 40 A_SpawnItemEx("WilygolemExplosion", random(0, 48), 0, random(0, 60), 0, 0, 0, random(0,360))
	RAT1 R 0 A_Quake(9, 100, 0, 1000, 0)
	RAT1 R 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
	RAT1 RRR 2 A_SpawnItemEx("WilygolemExplosion", random(0, 128), 0, random(0, 60), 0, 0, 0, random(0,360))
	RAT1 R 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
	RAT1 RRR 2 A_SpawnItemEx("WilygolemExplosion", random(0, 128), 0, random(0, 60), 0, 0, 0, random(0,360))
	RAT1 R 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
	RAT1 RRR 2 A_SpawnItemEx("WilygolemExplosion", random(0, 128), 0, random(0, 60), 0, 0, 0, random(0,360))
	RAT1 R 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
	RAT1 RRR 2 A_SpawnItemEx("WilygolemExplosion", random(0, 128), 0, random(0, 60), 0, 0, 0, random(0,360))
	RAT1 R 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
	RAT1 RRR 2 A_SpawnItemEx("WilygolemExplosion", random(0, 128), 0, random(0, 60), 0, 0, 0, random(0,360))
	RAT1 R 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
	RAT1 RRR 2 A_SpawnItemEx("WilygolemExplosion", random(0, 128), 0, random(0, 60), 0, 0, 0, random(0,360))
	RAT1 R 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
	RAT1 RRR 2 A_SpawnItemEx("WilygolemExplosion", random(0, 128), 0, random(0, 60), 0, 0, 0, random(0,360))
	RAT1 R 0 A_FaceTarget
	RAt1 R 0 A_PlaySOundEx("misc/devildeath", "Voice", 0, 1)
	RAT1 R 0 A_spawnItemEx("FakeDeathFX", 0, 0, 32)
	TNT1 A -1
	stop
	}

damagefactor "ChargeBuster", 1.0
damagefactor "ArrowBuster", 1.0
damagefactor "BassBuster", 1.0
damagefactor "DuoFist1", 1.0
damagefactor "DuoFist2", 1.0
damagefactor "DuoFist3", 1.0
damagefactor "LaserBuster", 1.0
damagefactor "MegaArm", 2.0
damagefactor "Buster", 1.0
damagefactor "ProtoBuster", 1.0
damagefactor "ProtoBuster2", 1.0
damagefactor "ProtoBuster3", 1.0
damagefactor "SuperAdaptor", 1.0
damagefactor "TrebleBoost", 1.0

damagefactor "FireStorm", 1.0
damagefactor "FireSpin", 1.0
damagefactor "HyperBomb", 0.5
damagefactor "IceSlasher", 0.25
damagefactor "OilSlider", 1.0
damagefactor "OilFlame", 1.0
damagefactor "RollingCutter", 0.6
damagefactor "SuperArm", 1.0
damagefactor "ThunderBeam", 1.0
damagefactor "TimeSlow", 1.0

damagefactor "AirShooter", 1.0
damagefactor "AtomicFire1", 1.0
damagefactor "AtomicFire2", 1.0
damagefactor "AtomicFire3", 0.5
damagefactor "BubbleLead", 1.0
damagefactor "CrashBomb", 1.0
damagefactor "LeafShield", 1.0
damagefactor "MetalBlade", 0.8
damagefactor "Instagib", 1.0
damagefactor "QuickBoomerang", 0.8
damagefactor "TimeStopper", 1.0

damagefactor "GeminiLaser", 1.0
damagefactor "HardKnuckle", 1.0
damagefactor "MagnetMissile", 1.0
damagefactor "NeedleCannon", 1.0
damagefactor "SearchSnake", 1.0
damagefactor "ShadowBlade", 0.5
damagefactor "SparkShock", 1.0
damagefactor "TopSpin", 1.0

damagefactor "DiveMissile", 1.0
damagefactor "DrillBomb", 1.0
damagefactor "DustCrusher", 1.0
damagefactor "DustCrusherBit", 1.0
damagefactor "FlashStopper", 1.0
damagefactor "PharaohShot1", 1.0
damagefactor "PharaohShot2", 1.0
damagefactor "PharaohShot3", 1.0
damagefactor "PharaohShotHold", 1.0
damagefactor "RainFlush", 1.0
damagefactor "RingBoomerang", 1.0

damagefactor "ChargeKick", 1.0
damagefactor "CrystalEye", 1.0
damagefactor "CrystalEyeBit", 1.0
damagefactor "GravityHold", 1.0
damagefactor "GyroAttack", 1.0
damagefactor "NapalmBomb", 1.0
damagefactor "PowerStone", 1.0
damagefactor "StarCrash", 1.0
damagefactor "WaterWave", 1.0

damagefactor "BlizzardAttack", 1.0
damagefactor "CentaurFlash", 1.0
damagefactor "FlameBlast", 1.0
damagefactor "KnightCrush", 1.0
damagefactor "PlantBarrier", 1.0
damagefactor "SilverTomahawk", 1.0
damagefactor "WindStorm", 1.0
damagefactor "YamatoSpear", 0.5

damagefactor "DangerWrap", 1.0
damagefactor "FreezeCracker", 1.0
damagefactor "FreezeCrackerBit", 1.0
damagefactor "JunkShield", 1.0
damagefactor "NoiseCrush1", 1.0
damagefactor "NoiseCrush2", 1.0
damagefactor "ScorchWheel", 1.0
damagefactor "SlashClaw", 1.0
damagefactor "ThunderBolt", 1.0
damagefactor "WildCoil", 1.0
damagefactor "WildCoil2", 1.0

damagefactor "AstroCrush", 1.0
damagefactor "FlameSword", 1.0
damagefactor "FlameSwordSpark", 1.0
damagefactor "FlashBomb", 0.2
damagefactor "HomingSniper", 1.0
damagefactor "IceWave", 1.0
damagefactor "MegaBall", 1.0
damagefactor "ThunderClaw", 0.5
damagefactor "ThunderClawPegHelp", 0.0
damagefactor "TornadoHold", 1.0
damagefactor "WaterBalloon", 1.0

damagefactor "BlackHoleBomb", 1.0
damagefactor "ConcreteShot", 1.0
damagefactor "HornetChaser", 1.0
damagefactor "JewelSatellite", 1.0
damagefactor "LaserTrident", 1.0
damagefactor "MagmaBazooka1", 1.0
damagefactor "MagmaBazooka2", 1.0
damagefactor "PlugBall", 1.0
damagefactor "TornadoBlow", 1.0

damagefactor "CopyVision", 1.0
damagefactor "IceWall", 0.0
damagefactor "LightningBolt", 1.1
damagefactor "MagicCard", 1.0
damagefactor "RemoteMine", 0.4
damagefactor "SpreadDrill", 0.1
damagefactor "SpreadDrill2", 0.5
damagefactor "SpreadDrill3", 1.0
damagefactor "TenguBlade", 0.8
damagefactor "WaveBurner", 1.0

damagefactor "ChillShot", 1.0
damagefactor "ChillSpike", 1.0
damagefactor "CommandoBomb", 0.5
damagefactor "ReboundStriker", 1.0
damagefactor "SolarBlaze", 1.0
damagefactor "ThunderWool", 0.5
damagefactor "TripleBlade", 1.0
damagefactor "WaterShield", 1.0
damagefactor "WheelCutter", 1.0

damagefactor "BlackHole", 1.0
damagefactor "BreakDash", 1.0
damagefactor "BubbleBomb", 1.0
damagefactor "DeepDigger", 1.0
damagefactor "ElectricShock", 1.0
damagefactor "GrabBuster", 1.0
damagefactor "PhotonMissile", 1.0
damagefactor "SaltWater", 1.0
damagefactor "SparkChaser", 1.0

damagefactor "BalladeCracker", 1.0
damagefactor "MirrorBuster1", 1.0
damagefactor "MirrorBuster2", 1.0
damagefactor "MirrorBuster3", 1.0
damagefactor "Sakugarne", 1.0
damagefactor "ScrewCrusher", 1.0

damagefactor "WireAdaptor", 1.0
damagefactor "Beat", 1.0
damagefactor "EddieBomber", 1.0
damagefactor "Reggae", 1.0
damagefactor "Tango", 1.0
}

actor RaMoonDeath
{
+NOGRAVITY
-SOLID
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
TNT1 AAAAAAAAAAA 1 A_SpawnItemEx("WilygolemExplosion", random(-512, 512), random(-512, 512))
loop
}
}

actor RaThorSpecialHitbox
{
Health 100
+SHOOTABLE
radius 5
height 5
-SOLID
+NOGRAVITY
+MISSILE
painchance 256
+NOTARGETSWITCH
Damagefactor "Misc", 0.0
Damagefactor "Enemy", 0.0
renderstyle none
+NODAMAGE
+THRUACTORS
scale 10.0
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_ChangeFlag("MISSILE", 0)
Warp:
TNT1 A 1 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_COPYINTERPOLATION)
loop
Pain.TimeStopper:
TNT1 A 1 A_GiveToTarget("TimeStopperAmmo", 1)
Goto TimeStopped

Pain.TimeSlow:
TNT1 A 1 A_GiveToTarget("TimeSlowAmmo", 1)
TNT1 A 0 ACS_NamedExecute("rathortimeslow", 0)
TimeSlowed:
TNT1 A 0 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_COPYINTERPOLATION)
TNT1 A 3 A_SpawnItemEx("TimeSlowGFX", random(16, 48), 0, Random(16,48), 0, 0, 0, random(0, 359))
TNT1 A 0 A_JumpIfInTargetInventory("TimeSlowAmmo", 1, "TimeSlowed")
Goto Warp

TimeStopped:
PLAY H 1 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_COPYINTERPOLATION)
TNT1 A 0 A_SpawnItemEx("TimeStopGFX", random(8, 64), 0, random(0, 74), 0, 0, 0, random(0, 359))
TNT1 A 0 A_JumpIfInTargetInventory("TimeStopperAmmo", 1, "TimeStopped")
Goto Warp
}
}

actor RaThorLightningBoltSpawner
{
PROJECTILE
+THRUACTORS

translation "229:229=246:246", "210:210=250:250"
states
{
Spawn:
TNT1 A 3 A_SpawnItemEx("RaThorLightningBolt", 0, random(-80, 80))
loop
}
}

actor RaThorLightningBolt //unused
{
PROJECTILE
+THRUACTORS
+NOEXPLODEFLOOR
+FORCEYBILLBOARD
+FLOORHUGGER
+DONTBLAST
Damage (0)
DamageType "LightningBolt"
Obituary "$OB_LIGHTNINGBOLT"
height 32
radius 16
scale 2.5
translation "229:229=246:246", "210:210=250:250"
states
{
Spawn:
LIBO G 0
LIBO H 1 A_SpawnItemEx("RaThorLightningExtend", 0, 0, 355)
LIBO G 0 A_PlaySoundEx("weapon/lightningbolt","Weapon")
LIBO G 0 A_Explode(47, 100, 0)
LIBO H 1

LIBO I 0 A_SpawnItemEx("RaThorLightningBoltFX", Random(32, 96), Random(32, 96), 32)
LIBO I 0 A_SpawnItemEx("RaThorLightningBoltFX", Random(-32, -96), Random(-32, -96), 64)
LIBO I 0 A_SpawnItemEx("RaThorLightningBoltFX", Random(32, 96), Random(32, 96), 96)
LIBO I 0 A_SpawnItemEx("RaThorLightningBoltFX", Random(-32, -96), Random(-32, -96), 128)
LIBO I 0 A_SpawnItemEx("RaThorLightningBoltFX", Random(32, 96), Random(32, 96), 160)
LIBO I 0 A_SpawnItemEx("RaThorLightningBoltFX", Random(-32, -96), Random(-32, -96), 192)

LIBO IJK 1
Stop
}
}

Actor RaThorLightningExtend : LightningExtend
{
translation "229:229=246:246", "210:210=250:250"
}


actor RaThorLightningBoltFX : LightningStartFX1
{

translation "229:229=246:246", "210:210=250:250"
States
{
Spawn:
LBFX K 0
LBFX K 0 A_ChangeVelocity(Random(-2, 2), Random(-2, 2), Random(-2, 2), CVF_REPLACE)
LBFX KLM 1
stop
}
}

actor RaThorDashFx
{
+MISSILE
+NOINTERACTION
scale 2.5
Translation "192:192=248:248", "198:198=3:3"
renderstyle translucent
alpha 0.5
states
{
Spawn:
RAT1 S 9
stop
}
}

actor RaThorDebris 
{
PROJECTILE
-NOGRAVITY
+THRUACTORS
+THRUSPECIES
species "Enemy"
translation "198:198=194:194", "192:192=194:194"
scale 2.5
States
{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_Jump(256,"Debris1","Debris2","Debris3","Debris4")
	Debris1:
	QBOP A -1
	Debris2:
	QBOP B -1
	Debris3:
	QBOP C -1
	Debris4:
	QBOP E -1
	Death:
	//MMFX F 0 A_ChangeFlag("NOGRAVITY",1)
	//MMFX FGHI 3 A_Stop
	TNT1 A 0
	stop
}
}

actor RaThorSlamDamager
{
PROJECTILE
radius 32
damage (16)
+THRUSPECIES
+DONTREFLECT
species "Enemy"
states
{
Spawn:
TNT1 A 2
Death:
TNT1 AAAAAAAAAA 0 A_SpawnItemEx("RaThorDebris", 0, 0, 0, random(0, 8), 0, random(5, 15), random(0,360))
stop
}
}

actor RaThorBomb
{
Translation "192:192=250:250", "198:198=246:246"
PROJECTILE
+RIPPER
radius 12
height 8
+THRUGHOST
+THRUSPECIES
+DONTREFLECT
damagetype "Misc"
species "Enemy"
scale 0.1
speed 30
states
{
Spawn:
TNT1 A 0
RTBP A 0 A_JumpIfInTargeTInventory("CutterFlag", 1, "End")
RTBP A 0 A_playSoundEx("misc/rathorspirit", "Voice", 0, 1)
RTBP ABCABC 2 A_SetScale(scalex + 0.12, scaley + 0.12)
RTBP A 0 A_JumpIfInTargeTInventory("IsDead", 1, "Dead")
loop
End:
RTBP A 0 A_playSoundEx("misc/rathorspirit", "Voice", 0, 1)
RTBP ABCABC 2 A_JumpIfInTargeTInventory("CutterFlag", 2, "Throw")
RTBP A 0 A_JumpIfInTargeTInventory("IsDead", 1, "Dead")
loop
Throw:
RTBP A 0 ACS_NamedExecuteAlways("SpiritBomb", 0)
Seek:
RTBP A 0 A_playSoundEx("misc/rathorspirit", "SoundSlot6", 0, 1)
RTBP ABC 2 A_Explode(5, 128, 0, 0, 64)
loop
Death:
RTBP A 0 A_playSoundEx("misc/hugequake3", "SoundSlot7", 0, 1)
RTBP A 0 A_spawnItemEx("RaThorBombExplosion")
RTBP AABBCCAABBCCAABBCCAABBCCAABBCCAABBCCAABBCCAABBCCAABBCCAABBCCAABBCCAABBCC 1 A_SpawnITemEx("RaThorBombFX", random(-256, 256), 0, random(4, 64),0,0,0,random(0,360), SXF_NOCHECKPOSITION) 
Dead:
RTBP ABCABABCABCABCABCAB 2 A_FadeOut(0.1)
stop
}
}

actor RaThorBombExplosion
{
PROJECTILE
translation "229:229=246:246", "210:210=250:250"
+THRUACTORS
+THRUSPECIES
+DONTREFLECT
species "Enemy"
var int user_i;
reactiontime 75
radius 8
height 8
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetUserVar("user_i", 55)
TNT1 A 0 A_Quake(8, 18, 0, 1000, 0)
Explode:
TNT1 A 0 A_SetUserVar("user_i", user_i + 1)
TNT1 A 0 A_SpawnITemEx("RaThorBombShard", 0, 0, 16, 1 + (user_i * 0.25), 0, 0, (90 * 0) + user_i * 3)
TNT1 A 0 A_SpawnITemEx("RaThorBombShard", 0, 0, 16, 1 + (user_i * 0.25), 0, 0, (90 * 1) + user_i * 3)
TNT1 A 0 A_SpawnITemEx("RaThorBombShard", 0, 0, 16, 1 + (user_i * 0.25), 0, 0, (90 * 2) + user_i * 3)
TNT1 A 0 A_SpawnITemEx("RaThorBombShard", 0, 0, 16, 1 + (user_i * 0.25), 0, 0, (90 * 3) + user_i * 3)

TNT1 A 0 A_SpawnITemEx("RaThorBombShard", 0, 0, 16, 1 + (user_i * 0.25), 0, 0, (90 * 0) - user_i * 3)
TNT1 A 0 A_SpawnITemEx("RaThorBombShard", 0, 0, 16, 1 + (user_i * 0.25), 0, 0, (90 * 1) - user_i * 3)
TNT1 A 0 A_SpawnITemEx("RaThorBombShard", 0, 0, 16, 1 + (user_i * 0.25), 0, 0, (90 * 2) - user_i * 3)
TNT1 A 0 A_SpawnITemEx("RaThorBombShard", 0, 0, 16, 1 + (user_i * 0.25), 0, 0, (90 * 3) - user_i * 3)
TNT1 A 1 A_CountDown
loop
}
}

actor RaThorBombShard
{
scale 2.5
translation "229:229=246:246", "210:210=250:250"
PROJECTILE
+DONTREFLECT
+FORCEXYBILLBOARD
+THRUSPECIES
+DONTREFLECT
species "Enemy"
Damage (5)
radius 8
height 8
damagetype "Misc"
states
{
Spawn:
LBFX KLM 2
loop
}
}

actor RaThorBombFX
{
scale 2.5
translation "229:229=246:246", "210:210=250:250"
+NOINTERACTION
states
{
Spawn:
TNT1 A 0
RTBP A 0 A_playSoundEx("weapon/astrocrush", "Voice", 0, 1)
LBFX DEFGHIJ 2
stop
}
}

actor RaThorTeleport1
{
Translation "192:192=248:248", "198:198=3:3"
scale 2.5
+NOINTERACTION
-SOLID
states
{
Spawn:
RAT1 O 0
RAT1 O 0 A_PlaySoundEx("misc/darkthrow", "Voice", 0, 1)
RAT1 OOO 5 //A_ScaleVelocity(0.4)
stop
}
}

actor RaThorTeleport2 : RaThorTeleport1
{

states
{
Spawn:
RAT1 PPP 5 //A_ScaleVelocity(0.4)
stop
}
}


actor RaThorDisc
{
PROJECTILE
+SEEKERMISSILE
+DOOMBOUNCE
species "Enemy"
+THRUSPECIES
Translation "192:192=227:227", "198:198=246:246"
wallbouncefactor 1.0
bouncefactor 0
bouncecount 2
scale 2.5
speed 28
Damage (5)
damagetype "Enemy"
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySound("misc/rathorthrow")
Looping:
RTBP TTUUVVWW 1 A_JumpIf(z-floorz<10, "Flame")
loop
Death:
RTBP A 0 A_JumpIf(z-floorz<1, "Flame")
RTBP XYZ 4
stop
Flame:
RTBP A 0 A_SpawnItemEx("RaThorDiscPillar")
stop
}
}

actor RaThorDiscPillar
{
PROJECTILE
+FLOORHUGGER
+THRUACTORS
scale 2.5
species "Enemy"
+THRUSPECIES
damagetype "Enemy"
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_playSound("weapon/waveburner")
RTBP PPQQRRSS 2 A_Explode(3, 32, 0, 0, 32)
stop
}
}

actor RaThorFireShield
{
renderstyle none
+NOINTERACTION
+NOGRAVITY
+MISSILE
+DONTRIP
species "Enemy"
Obituary "%o was obliterated by \cuRa Thor\c-."
+THRUSPECIES
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_RearrangePointers(AAPTR_NULL, AAPTR_NULL, AAPTR_TARGET)
TNT1 A 0 A_SpawnITemEx("RaThorFire")
TNT1 A 0 A_SpawnITemEx("RaThorFire2")
TNT1 A 0 A_SpawnITemEx("RaThorFire3")
Looping:
TNT1 A 1 A_Warp(AAPTR_TRACER, 0, 0, 0, angle, WARPF_ABSOLUTEANGLE|WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
TNT1 A 0 A_SetAngle(angle + 4.0)
loop
}
}

actor RaThorFire
{
	+NOGRAVITY
	-MISSILE
	+NOINTERACTION
	+INVULNERABLE
	+RIPPER
	Obituary "%o was obliterated by \cuRa Thor\c-."
	translation "192:192=102:102", "198:198=240:240", "199:199=75:75"
	height 52
	radius 16
	Speed 0
	scale 2.5
	species "Enemy"
	damagetype "Misc"
	+THRUSPECIES
	var int user_radius;
	var int user_angle;
	States
	{
	Spawn:
		RTBP F 0
		TNT1 A 0 Thing_ChangeTID(0, 1102)
		TNT1 A 0 A_SetUserVar(user_radius, 100)
		TNT1 A 0 A_SetUserVar(user_angle, 0)
		TNT1 A 0 A_Jump(256, "Start")
	Reappear:
		TNT1 A 0 A_TakeInventory("CutterFlag", 999)
		Goto Start
	Start:
		TNT1 A 1 A_Warp(AAPTR_TARGET, user_radius, 0, 32 - ((floorz - 32) * 0.1), user_angle, WARPF_NOCHECKPOSITION)
		RTBP FFFFGGGG 1 A_Warp(AAPTR_TARGET, user_radius, 0, 32 - ((floorz - 32)* 0.1), user_angle, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
		RTBP G 0 A_SpawnItemEx("RaThorFireFX", 24, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
		RTBP G 0 A_SpawnItemEx("RaThorFireFX", 24, 0, 0, 0, 0, 0, 120, SXF_TRANSFERTRANSLATION)
		RTBP G 0 A_SpawnItemEx("RaThorFireFX", 24, 0, 0, 0, 0, 0, 240, SXF_TRANSFERTRANSLATION)
		RTBP G 0 A_SpawnItemEx("RaThorShieldBlocker", 0, 0, 0, 0, 0, 0, 0, 0)
		RTBP G 0 A_ChangeFlag(MISSILE, 0)
	SpawnRotate:
		RTBP A 0 A_Explode(4, 48, 0, 0, 48) 
		RTBP HIJK 2 A_Warp(AAPTR_TARGET, user_radius, 0, 32 - ((floorz - 32) * 0.1), user_angle, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
		loop
	Disappear:
		TNT1 A 0 A_GiveInventory("CutterFlag", 1)
		RTBP GGGGFFFF 1
		TNT1 A -1// A_ChangeVelocity(0, 0, 9000)
		stop
	}
}

actor RaThorFire2 : RaThorFire
{
states
{
	Spawn:
		RTBP F 0
		TNT1 A 0 Thing_ChangeTID(0, 1102)
		TNT1 A 0 A_SetUserVar(user_radius, 100)
		TNT1 A 0 A_SetUserVar(user_angle, 120)
		TNT1 A 0 A_Jump(256, "Start")
		stop
}
}


actor RaThorFire3 : RaThorFire
{
states
{
	Spawn:
		RTBP F 0
		TNT1 A 0 Thing_ChangeTID(0, 1102)
		TNT1 A 0 A_SetUserVar(user_radius, 100)
		TNT1 A 0 A_SetUserVar(user_angle, 240)
		TNT1 A 0 A_Jump(256, "Start")
		stop
}
}

actor RaThorShieldBlocker
{
+SHOOTABLE
+NODAMAGE
height 52
radius 30
+MISSILE
renderstyle none
scale 5.0
species "Enemy"
+THRUSPECIES
painchance 256
health 100
+NOTARGETSWITCH
Obituary "%o was obliterated by \cuRa Thor\c-."
damagefactor "Misc", 0.0
damagefactor "Enemy", 0.0
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_changeFlag("MISSILE", 0)
Looping:
RTBP L 0 A_JumpIfInTargetInventory("CutterFlag", 1, "End")
TNT1 A 1 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_NOCHECKPOSITION)
loop
End:
TNT1 A 0
stop
Pain:
TNT1 A 0 A_PlaySoundEx("misc/lava", "SoundSlot7", 0, 1) 
TNT1 AA 0 A_SpawnItemEx("RaThorShieldSplinter", 0, 0, 0, random(4,10), 0, random(5, 12), random(0,360))
goto Looping
}	
}

actor RaThorShieldSplinter
{
PROJECTILE
+DOOMBOUNCE
translation "192:192=102:102", "198:198=240:240", "199:199=75:75"
damagetype "Misc"
species "Enemy"
+THRUSPECIES
wallbouncefactor 1.0
bouncefactor 0.0
-NOGRAVITY
scale 2.5
damage (5)
states
{
Spawn:
RTBP LLMMNNOO 1 A_JumpIf(z<175, "Floor")
loop
Floor:
TNT1 A 0 A_Stop
TNT1 A 0 A_ChangeFlag("NOGRAVITY", 1)
RTBP LMNOLMNOLMNOLMNOLMNOLMNOLMNOLMNO 2
RTBP LMNOLMNOLMNOLMNO 2 A_SetScale(scalex, scaley - 0.1)
TNT1 A 0 A_ChangeFlag("NOINTERACTION", 1)
RTBP LMNOLMNO 2 A_SetScale(scalex, scaley - 0.1)
stop
}
}

actor RaThorFireFX
{
	PROJECTILE
	+NOINTERACTION
	+NOGRAVITY
	-SOLID
	scale 2.5
	height 0
	radius 0
	States
	{
	Spawn:
		RTBP LL 1 A_Warp(AAPTR_TARGET, 28, 0, 0, 0, WARPF_INTERPOLATE|WARPF_COPYINTERPOLATION|WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION)
		RTBP L 0 A_JumpIfInTargetInventory("CutterFlag", 1, "End")
		RTBP L 0 A_SetAngle(angle+10)
		RTBP MM 1 A_Warp(AAPTR_TARGET, 28, 0, 0, 0, WARPF_INTERPOLATE|WARPF_COPYINTERPOLATION|WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION)
		RTBP L 0 A_JumpIfInTargetInventory("CutterFlag", 1, "End")
		RTBP M 0 A_SetAngle(angle+10)
		RTBP NN 1 A_Warp(AAPTR_TARGET, 28, 0, 0, 0, WARPF_INTERPOLATE|WARPF_COPYINTERPOLATION|WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION)
		RTBP L 0 A_JumpIfInTargetInventory("CutterFlag", 1, "End")
		RTBP N 0 A_SetAngle(angle+10)
		RTBP OO 1 A_Warp(AAPTR_TARGET, 28, 0, 0, 0, WARPF_INTERPOLATE|WARPF_COPYINTERPOLATION|WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION)
		RTBP L 0 A_JumpIfInTargetInventory("CutterFlag", 1, "End")
		RTBP O 0 A_SetAngle(angle+10)
		loop
	End:
		RTBP O 0
		stop
	}
}

actor RaMoonGift : CustomInventory
{
	gravity 0.01
	inventory.pickupsound "weapon/weaponup"
	Inventory.Pickupmessage "Power up! Dawn Breaker!"
	Scale 2.0
	states
	{
	Spawn:
	DBR1 A 4 A_SpawnItemEx("SparkleFX", 32, 0, random(-20, 32), 0, 0, 0, random(0,360))
	loop
	Pickup:
	DBR1 A 0 ACS_NamedExecute("DawnBreakerGet", 0)
	stop
	}
}

actor RaMoonGiftAura
{
-SOLID
+THRUACTORS
gravity 0.01
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("RaMoonGiftWarper1")
TNT1 A 0 A_SpawnItemEx("RaMoonGiftWarper2")
TNT1 A 0 A_SpawnItemEx("RaMoonGiftWarper3")
TNT1 A 0 A_SpawnItemEx("RaMoonGiftWarper4")
Fall:
TNT1 A 1 A_SetAngle(angle + 0.4)
loop
}
}

actor RaMoonGiftWarper1
{
	scale 1.0
	translation "192:192=196:196", "198:198=70:70"
	+NOINTERACTION
	-SOLID
	+MISSILE
	renderstyle add
	states
	{
	Spawn:
	DBR1 C 1 A_Warp(AAPTR_TARGET, 64.0, 0, 10, 90 * 0, WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION)
	loop
	}
}

actor RaMoonGiftWarper2 : RaMoonGiftWarper1
{
	states
	{
	Spawn:
	DBR1 F 1 A_Warp(AAPTR_TARGET, 64.0, 0, 10, 90 * 1, WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION)
	loop
	}
}

actor RaMoonGiftWarper3 : RaMoonGiftWarper1
{
	states
	{
	Spawn:
	DBR1 I 1 A_Warp(AAPTR_TARGET, 64.0, 0, 10, 90 * 2, WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION)
	loop
	}
}

actor RaMoonGiftWarper4 : RaMoonGiftWarper1
{
	states
	{
	Spawn:
	DBR1 L 1 A_Warp(AAPTR_TARGET, 64.0, 0, 10, 90 * 3, WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION)
	loop
	}
}