actor ThunderBoltBoss : BaseMM8BDMWep_CBM 
{
dropitem "ThunderBoltWepCDropped"
Weapon.AmmoUse 1
Weapon.AmmoGive 28
Weapon.SlotNumber 1
Obituary "$OB_THUNDERBOLT"
weapon.ammotype "RainAmmo"
States
{
Spawn:
C_07 D 1
loop
Ready:
CLOH A 0 ACS_ExecuteAlways(998,0,843)
CLOH A 0 A_Gunflash
CLOH A 1 A_WeaponReady
Goto Ready+2
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
CLOH A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
CLOH A 1 A_Raise
Loop
Fire:
CLOH A 0 A_JumpIfNoAmmo("NoAmmoFire")
CLOH A 0 A_PlaySoundEx("weapon/TSTRIKE","Weapon")
CLOH A 0 A_GiveInventory("CloudmanMain_CI",1)
CLOH A 0 A_JumpIfInventory("IBeFlyin",1,2)
CLOH A 0 A_TakeInventory("RainAmmo",1)
CLOH A 0 A_TakeInventory("RainAmmo",3)
CLOH FGHIJK 2
TNT1 A 12
CLOH L 2
CLOH A 0 A_Refire
Goto Ready+2
NoAmmoFire:
CLOH A 0 ACS_ExecuteAlways(191,0,6)
CLOH A 0 A_GiveInventory("CloudFireHold")
CLOH BCDE 3
CLOH EEE 3
CLOH E 3 A_TakeInventory("CloudFireHold",999)
CLOH A 0 
CLOH A 0 A_PlaySoundEx("weapon/thunderbolt","Weapon")
CLOH A 0 A_GiveInventory("CloudmanMain2_CI",1)
CLOH FGH 2
CLOH I 0 ACS_ExecuteAlways(191,0,0)
CLOH IJK 2
TNT1 A 6
CLOH L 2
CLOH A 0 A_Refire
goto Ready+2
Altfire:
CLOH A 0 A_JumpIfInventory("IBeFlyin",1,"FlyFire")
CLOH A 0 A_JumpIf(z-floorz==0,"Recharge")
CLOH A 0 A_JumpIf(momz==0,"momzverify")
goto Ready+2
momzverify:
CLOH A 1 A_JumpIf(z-floorz==0,"Recharge")
CLOH A 0 A_JumpIf(momz==0,"Recharge")
goto Ready+2
Recharge:
CLOH A 0 SetPlayerProperty(0,1,0)
CLOH A 0 A_GiveInventory("CloudFireHold")
CLOH A 0 A_GiveInventory("NoItem")

CLOH A 0 A_PlaySoundEx("weapon/CloudAlt","Weapon")
CLOH B 1 A_SpawnItemEx("CloudDownerA",0,0,276,0,0,0,0,1)
CLOH B 1 A_SpawnItemEx("CloudDownerB",0,0,256,0,0,0,0,1)
CLOH B 1 A_SpawnItemEx("CloudDownerC",0,0,236,0,0,0,0,1)
CLOH C 1 A_SpawnItemEx("CloudDownerD",0,0,216,0,0,0,0,1)
CLOH C 1 A_SpawnItemEx("CloudDownerE",0,0,196,0,0,0,0,1)
CLOH C 1 A_SpawnItemEx("CloudDownerF",0,0,176,0,0,0,0,1)
CLOH D 1 A_SpawnItemEx("CloudDownerA",0,0,156,0,0,0,0,1)
CLOH D 1 A_SpawnItemEx("CloudDownerB",0,0,136,0,0,0,0,1)
CLOH D 1 A_SpawnItemEx("CloudDownerC",0,0,116,0,0,0,0,1)
CLOH E 1 A_SpawnItemEx("CloudDownerD",0,0,96,0,0,0,0,1)
CLOH E 1 A_SpawnItemEx("CloudDownerE",0,0,76,0,0,0,0,1)
CLOH E 1 A_SpawnItemEx("CloudDownerF",0,0,56,0,0,0,0,1)
CLOH EEEEEE 3 //A_PlaySoundEx("weapon/TSTRIKE","Weapon")
CLOH D 3 A_TakeInventory("CloudFireHold",999)
CLOH CB 3
CLOH B 3 SetPlayerProperty(0,0,0)
CLOH A 0 A_GiveInventory("RainAmmo",14)
CLOH A 0 A_TakeInventory("NoItem",999)
goto Ready+2
FlyFire:
CLOH A 0 A_JumpIfInventory("RainAmmo",3,"RealAltFire")
goto Ready+2
RealAltFire:
CLOH AL 5
TNT1 A 0 A_PlaySoundEx("weapon/TSTRIKE","Weapon")
CLOH A 0 A_GiveInventory("CloudmanAlt_CI",1)
//CLOH A 0 A_TakeInventory("RainAmmo",1)
CLOH A 0 A_TakeInventory("RainAmmo",3)
CLOH LA 5
CLOH A 10
goto Ready+2
NoAmmo:
CLOH A 0
//CLOH A 1 ACS_Execute(979,0)
Goto Ready+2
Flash:
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_JumpIfInventory("IBeFlyin",1,"FlyFlash1")
TNT1 A 0 SetPlayerProperty(0,0,3)
TNT1 A 0
TNT1 A 1
loop
FlyFlash1:
TNT1 A 0 A_JumpIfInventory("RainAmmo",1,"FlyFlash2")
TNT1 A 0 A_TakeInventory("IBeFlyin",1)
goto Flash+1
FlyFlash2:
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,2)
TNT1 A 0 SetPlayerProperty(0,1,3)
TNT1 A 0 A_TakeInventory("RainAmmo",1)
TNT1 AAAAAAAAAAAAAA 1 A_JumpIfInventory("HatinFlyin",1,"Flash")
goto Flash
}
}

actor RainAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

actor CloudFireHold : OnceC{}

actor IBeFlyin : OnceC{}

actor HatinFlyin : OnceC{}

actor NoItem : OnceC{}


actor FlightItem : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "ClouIcon"
scale 2.0
inventory.pickupmessage "This just in, a high chance of thunder storms today."
+INVBAR
states
{
Spawn:
CLOH M 1
loop
Use:
TNT1 A 0 A_JumpIfInventory("NoItem",1,"No")
TNT1 A 0 A_JumpIfInventory("IBeFlyin",1,"Use3")
TNT1 A 0 A_JumpIfInventory("RainAmmo",1,"Use2")
fail
Use2:
TNT1 A 0 A_TakeInventory("HatinFlyin",1)
TNT1 A 0 A_GiveInventory("IBeFlyin",1)
fail
Use3:
TNT1 A 0 A_GiveInventory("HatinFlyin",1)
TNT1 A 0 A_TakeInventory("IBeFlyin",1)
fail
No:
TNT1 A 0
fail
}
}

actor CloudBolt : ThunderBoltC
{
Translation "198:198=218:218", "202:202=212:212"
States
{
Spawn:
CLOF A 1 A_SpawnItemEx("CloudFX_A",0,0,0,0,0,0,0,1)
CLOF B 1 A_SpawnItemEx("CloudFX_B",0,0,0,0,0,0,0,1)
CLOF C 1 A_SpawnItemEx("CloudFX_C",0,0,0,0,0,0,0,1)
CLOF D 1 A_SpawnItemEx("CloudFX_D",0,0,0,0,0,0,0,1)
CLOF E 1 A_SpawnItemEx("CloudFX_E",0,0,0,0,0,0,0,1)
CLOF F 1 A_SpawnItemEx("CloudFX_F",0,0,0,0,0,0,0,1)
loop
Death:
TNT1 A 0 A_PlaySound("weapon/CloudSplit",1,0.75)
TNT1 A 0 A_SpawnItemEx("CloudBoltSplit",0,0,0,30,0,0,90,1)
TNT1 A 0 A_SpawnItemEx("CloudBoltSplit",0,0,0,30,0,0,-90,1)
TNT1 A 1
stop
}
}

actor CloudBoltB : CloudBolt{translation "202:202=205:205", "198:198=74:74"}
actor CloudBoltR : CloudBolt{translation "202:202=171:171", "198:198=41:41"}
actor CloudBoltO : CloudBolt{translation "202:202=104:104", "198:198=128:128"}
actor CloudBoltP : CloudBolt{translation "202:202=229:229", "198:198=232:62"}

actor CloudFX_A : BasicClientSide
{
States
{
Spawn:
CLOF FBCDEF 1
stop
}
}

actor CloudFX_B : BasicClientSide{States{Spawn:CLOF BCDEFA 1
stop}}
actor CloudFX_C : BasicClientSide{States{Spawn:CLOF CDEFAB 1
stop}}
actor CloudFX_D : BasicClientSide{States{Spawn:CLOF DEFABC 1
stop}}
actor CloudFX_E : BasicClientSide{States{Spawn:CLOF EFABCD 1
stop}}
actor CloudFX_F : BasicClientSide{States{Spawn:CLOF FABCDE 1
stop}}

actor CloudFX : BasicClientSide
{
States
{
Spawn:
CLOF ABCDEF 1
stop
}
}

actor CloudBoltSplit : ThunderBoltSplitC
{
reactiontime 90
States
{
Spawn:
CLOF A 0
CLOF A 1 A_SpawnItemEx("CloudFX_A",0,0,0,0,0,0,0,1)
CLOF B 1 A_SpawnItemEx("CloudFX_B",0,0,0,0,0,0,0,1)
CLOF AB 1 A_SpawnItemEx("CloudFX",0,0,0,0,0,0,0,1)
CLOF C 0 A_ChangeFlag("THRUACTORS",0)
CLOF B 1 A_SpawnItemEx("CloudFX_B",0,0,0,0,0,0,0,1)
CLOF C 1 A_SpawnItemEx("CloudFX_C",0,0,0,0,0,0,0,1)
CLOF E 0 A_GiveInventory("CutterFlag",1)
goto Spawn3
Spawn3:
CLOF E 1 A_SpawnItemEx("CloudFX_E",0,0,0,0,0,0,0,1)
CLOF F 1 A_SpawnItemEx("CloudFX_F",0,0,0,0,0,0,0,1)
CLOF A 1 A_SpawnItemEx("CloudFX_A",0,0,0,0,0,0,0,1)
CLOF B 1 A_SpawnItemEx("CloudFX_B",0,0,0,0,0,0,0,1)
CLOF C 1 A_SpawnItemEx("CloudFX_C",0,0,0,0,0,0,0,1)
CLOF D 1 A_SpawnItemEx("CloudFX_D",0,0,0,0,0,0,0,1)
CLOF E 0 A_CountDown
loop
Split:
TNT1 A 0 A_PlaySound("weapon/CloudSplit",1,0.75)
TNT1 A 0 A_SpawnItemEx("CloudBoltSplit",0,0,0,30,0,0,90,1)
TNT1 A 0 A_SpawnItemEx("CloudBoltSplit",0,0,0,30,0,0,-90,1)
TNT1 A 1
stop
}
}

actor CloudBoltNoAmmo : CloudBolt
{
States
{
Death:
TNT1 A 1
stop
}
}

actor CloudBoltNoAmmoB : CloudBoltNoAmmo{translation "202:202=205:205", "198:198=74:74"}
actor CloudBoltNoAmmoR : CloudBoltNoAmmo{translation "202:202=171:171", "198:198=41:41"}
actor CloudBoltNoAmmoO : CloudBoltNoAmmo{translation "202:202=104:104", "198:198=128:128"}
actor CloudBoltNoAmmoP : CloudBoltNoAmmo{translation "202:202=229:229", "198:198=232:232"}

actor CloudDown
{
Translation "198:198=218:218", "202:202=212:212"
PROJECTILE
Obituary "$OB_THUNDERBOLT"
damagetype "ThunderBolt"
+RIPPER
//+PIERCEARMOR
Damage (17)
Radius 25
Height 16
Speed 0
scale 2.5
States
{
Spawn:
CLOD A 0 ThrustThingZ(0,-45,0,1)
CLOD A 1 A_SpawnItemEx("CloudDownerFX_A",0,0,0,0,0,0,0,1)
CLOD B 1 A_SpawnItemEx("CloudDownerFX_B",0,0,0,0,0,0,0,1)
CLOD C 1 A_SpawnItemEx("CloudDownerFX_C",0,0,0,0,0,0,0,1)
CLOD D 1 A_SpawnItemEx("CloudDownerFX_D",0,0,0,0,0,0,0,1)
CLOD E 1 A_SpawnItemEx("CloudDownerFX_E",0,0,0,0,0,0,0,1)
CLOD F 1 A_SpawnItemEx("CloudDownerFX_F",0,0,0,0,0,0,0,1)
loop
Death:
TNT1 A 0 A_PlaySound("weapon/CloudSplit",1,0.75)
TNT1 A 0 A_SpawnItemEx("CloudSpark",45,0,0,30,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("CloudSpark",45,0,0,30,0,0,45,1)
TNT1 A 0 A_SpawnItemEx("CloudSpark",45,0,0,30,0,0,90,1)
TNT1 A 0 A_SpawnItemEx("CloudSpark",45,0,0,30,0,0,135,1)
TNT1 A 0 A_SpawnItemEx("CloudSpark",45,0,0,30,0,0,180,1)
TNT1 A 0 A_SpawnItemEx("CloudSpark",45,0,0,30,0,0,-45,1)
TNT1 A 0 A_SpawnItemEx("CloudSpark",45,0,0,30,0,0,-90,1)
TNT1 A 0 A_SpawnItemEx("CloudSpark",45,0,0,30,0,0,-135,1)
TNT1 A 1
stop
}
}

actor CloudDownB : CloudDown{translation "202:202=205:205", "198:198=74:74"}
actor CloudDownR : CloudDown{translation "202:202=171:171", "198:198=41:41"}
actor CloudDownO : CloudDown{translation "202:202=104:104", "198:198=128:128"}
actor CloudDownP : CloudDown{translation "202:202=229:229", "198:198=232:232"}

actor CloudSpark
{
PROJECTILE
+FLOORHUGGER
Obituary "$OB_THUNDERBOLT"
damagetype "ThunderBolt"
scale 2.5
Speed 30
Radius 25
Height 16
Damage (20)
//+PIERCEARMOR
States
{
Spawn:
CLOS ABCDEF 1
loop
Death:
TNT1 A 0
stop
}
}



actor CloudDownerA : BasicExplosion
{
Obituary "$OB_THUNDERBOLT"
damagetype "ThunderBolt"
//+PIERCEARMOR
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(10,120,0,0,8)
CLOD A 1 A_SpawnItemEx("CloudDownerFX_A",0,0,0,0,0,0,0,1)
stop
}
}

actor CloudDownerB : CloudDownerA
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(10,120,0,0,8)
CLOD B 1 A_SpawnItemEx("CloudDownerFX_B",0,0,0,0,0,0,0,1)
stop
}
}

actor CloudDownerC : CloudDownerA
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(10,120,0,0,8)
CLOD C 1 A_SpawnItemEx("CloudDownerFX_C",0,0,0,0,0,0,0,1)
stop
}
}

actor CloudDownerD : CloudDownerA
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(10,120,0,0,8)
CLOD D 1 A_SpawnItemEx("CloudDownerFX_D",0,0,0,0,0,0,0,1)
stop
}
}

actor CloudDownerE : CloudDownerA
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(10,120,0,0,8)
CLOD E 1 A_SpawnItemEx("CloudDownerFX_E",0,0,0,0,0,0,0,1)
stop
}
}

actor CloudDownerF : CloudDownerA
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(10,120,0,0,8)
CLOD F 1 A_SpawnItemEx("CloudDownerFX_F",0,0,0,0,0,0,0,1)
stop
}
}

actor CloudDownerFX//CloudFXDown
{
scale 2.5
-SOLID
+NOGRAVITY
+CLIENTSIDEONLY
height 0
radius 0
}

actor CloudDownerFX_A : CloudDownerFX
{
States
{
Spawn:
CLOD ABCDEF 1
stop
}
}

actor CloudDownerFX_B : CloudDownerFX{States{Spawn:CLOD BCDEFA 1
stop}}
actor CloudDownerFX_C : CloudDownerFX{States{Spawn:CLOD CDEFAB 1
stop}}
actor CloudDownerFX_D : CloudDownerFX{States{Spawn:CLOD DEFABC 1
stop}}
actor CloudDownerFX_E : CloudDownerFX{States{Spawn:CLOD EFABCD 1
stop}}
actor CloudDownerFX_F : CloudDownerFX{States{Spawn:CLOD FABCDE 1
stop}}

actor CloudmanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("CloudBolt",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("CloudBoltB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("CloudBoltR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("CloudBoltO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("CloudBoltP",0,0,8,0)
goto Done
}
}



actor CloudmanMain2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("CloudBoltNoAmmo",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("CloudBoltNoAmmoB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("CloudBoltNoAmmoR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("CloudBoltNoAmmoO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("CloudBoltNoAmmoP",0,0,8,0)
goto Done
}
}

actor CloudmanAlt_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("CloudDown",0,1,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("CloudDownB",0,1,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("CloudDownR",0,1,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("CloudDownO",0,1,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("CloudDownP",0,1,0,0)
goto Done
}
}