actor PharaohShotBoss : BaseMM8BDMWep_CBM 
{
dropitem "PharaohShotWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 5
Obituary "$OB_PHARAOHSHOT"
Inventory.Pickupmessage "Power up! Pharaoh Shot!"
weapon.ammotype "ManInGauseAmmo"
States
{
Spawn:
C_04 D 1
loop
Ready:
PHAA A 0 ACS_ExecuteAlways(998,0,783)
PHAA A 1 A_WeaponReady
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
PHAA A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
PHAA A 1 A_Raise
Loop
Fire:
TNT1 A 0 A_TakeInventory("ManInGauseAmmo",999)
TNT1 A 0 A_TakeInventory("WeaponCharge",999)
//TNT1 A 0 A_TakeInventory("PharaohHover",100)
PHAA A 0
Goto Hold
Hold:
PHAA A 0 A_JumpIfInventory("WeaponCharge",1,"Hold2")
PHAA A 0 //A_GiveInventory("ManInGauseAmmo",1)
PHAA A 1 A_GiveInventory("WeaponCharge",1)
PHAA A 0 A_Refire
Goto Throw1

Hold2:
PHAA A 0 A_JumpIfInventory("PharaohSpamFlag",1,"MainSpam")
PHAA A 0 A_JumpIfInventory("WeaponCharge",2,"Hold3")

PHAA A 0 A_GiveInventory("WeaponCharge",1)
PHAA A 0 //A_GiveInventory("ManInGauseAmmo",1)
PHAA A 0 A_GiveInventory("PharaohSpamFlag",1)
PHAA A 1
PHAA A 0 A_ReFire
Goto Throw1
MainSpam:
PHAA B 0 A_GiveInventory("PharaohSpamFlag",1)
PHAA B 0 A_JumpIfInventory("PharaohSpamFlag",9,"Hold2ee")
PHAA B 0 A_JumpIfInventory("PharaohSpamFlag",8,"Hold2e")
PHAA B 0 A_JumpIfInventory("PharaohSpamFlag",7,"Hold2dd")
PHAA B 0 A_JumpIfInventory("PharaohSpamFlag",6,"Hold2d")
PHAA B 0 A_JumpIfInventory("PharaohSpamFlag",5,"Hold2cc")
PHAA B 0 A_JumpIfInventory("PharaohSpamFlag",4,"Hold2c")
PHAA B 0 A_JumpIfInventory("PharaohSpamFlag",3,"Hold2bb")
PHAA B 0 A_JumpIfInventory("PharaohSpamFlag",2,"Hold2b")
//No loop here to prevent an infinite loop!
Hold2b:
PHAA B 1
PHAA B 0 A_Refire
Goto Throw1
Hold2bb:
PHAA B 1
PHAA B 0 A_Refire
Goto Throw1
Hold2c:
PHAA C 1
PHAA C 0 A_Refire
Goto Throw1
Hold2cc:
PHAA C 1
PHAA C 0 A_Refire
Goto Throw1
Hold2d:
PHAA D 1
PHAA D 0 A_Refire
Goto Throw1
Hold2dd:
PHAA D 1
PHAA D 0 A_Refire
Goto Throw1
Hold2e:
PHAA E 1
PHAA E 0 A_Refire
Goto Throw1
Hold2ee:
PHAA E 1
PHAA E 0 A_SpawnItemEx("PharaohFXB")
PHAA E 0 A_TakeInventory("PharaohSpamFlag",999)
PHAA E 0 A_Refire
Goto Throw1

Hold3:
TNT1 A 0 A_JumpIfInventory("WeaponCharge",78,"Hold4")
TNT1 A 0 A_GiveInventory("ManInGauseAmmo",1)
TNT1 A 1 A_GiveInventory("WeaponCharge",1)
TNT1 A 0 A_Refire
TNT1 A 0 A_JumpIfInventory("WeaponCharge",78,"Throw3")
TNT1 A 0 A_JumpIfInventory("WeaponCharge",33,"Throw2")
Goto Throw1
Hold4:
TNT1 A 0 A_GiveInventory("ManInGauseAmmo",1)
TNT1 A 1 A_WeaponReady(6)
TNT1 A 0 A_JumpIfInventory("IsBot",1,"Botfire")
TNT1 A 0 A_Refire
TNT1 A 0 A_JumpIfInventory("WeaponCharge",78,"Throw3")
TNT1 A 0 A_JumpIfInventory("WeaponCharge",33,"Throw2")
Goto Throw1
Botfire:
TNT1 A 0 A_Jump(16, "Throw3", "ThrowW")
TNT1 A 0 A_Refire
Goto Throw3

Throw1:
PHAA F 0 A_TakeInventory("WeaponCharge",9999)
PHAA F 0 A_TakeInventory("ManInGauseAmmo",999)
PHAA F 0 A_TakeInventory("PharaohSpamFlag",999)
PHAA F 0 A_PlaySoundEx("weapon/pharaoh1","Weapon")
PHAA F 0 A_GiveInventory("PharaohmanMain1_CI",1)
PHAA FGHIJK 1
PHAA L 1 A_ClearRefire
PHAA M 1
Goto Ready+1
Throw2:
PHAA F 0 A_TakeInventory("WeaponCharge",9999)
PHAA F 0 A_TakeInventory("ManInGauseAmmo",999)
PHAA F 0 A_TakeInventory("PharaohSpamFlag",999)
PHAA F 0 A_PlaySoundEx("weapon/pharaoh1","Weapon")
PHAA F 0 A_GiveInventory("PharaohmanMain2_CI",1)
PHAA FGHIJK 1
TNT1 A 6 A_ClearRefire
PHAA LMA 2
Goto Ready+1
Throw3:
PHAA F 0 A_TakeInventory("WeaponCharge",9999)
PHAA F 0 A_TakeInventory("ManInGauseAmmo",999)
PHAA F 0 A_TakeInventory("PharaohSpamFlag",999)
PHAA F 0 A_PlaySoundEx("weapon/pharaoh2","Weapon")
PHAA F 0 A_GiveInventory("PharaohmanMain3_CI",1)
PHAA FGHIJK 2
TNT1 A 4 A_ClearRefire
PHAA LMA 2
Goto Ready+1
ThrowW:
PHAA F 0 A_TakeInventory("WeaponCharge",9999)
PHAA F 0 A_TakeInventory("ManInGauseAmmo",999)
PHAA F 0 A_TakeInventory("PharaohSpamFlag",999)
PHAA F 0 A_PlaySoundEx("weapon/pharaoh2","Body")
PHAA F 0 A_PlaySoundEx("weapon/pharaoh1","Weapon")
PHAA F 0 A_SpawnItemEx("PharaohShotWaveB",8,0,32,35,0,0,0,1)
PHAA F 0 A_SpawnItemEx("PharaohShotWaveB",8,0,32,35,0,0,45,1)
PHAA F 0 A_SpawnItemEx("PharaohShotWaveB",8,0,32,35,0,0,-45,1)
PHAA F 0 A_SpawnItemEx("PharaohShotWaveB",8,0,32,35,0,0,90,1)
PHAA F 0 A_SpawnItemEx("PharaohShotWaveB",8,0,32,35,0,0,-90,1)
PHAA F 0 A_SpawnItemEx("PharaohShotWaveB",8,0,32,35,0,0,135,1)
PHAA F 0 A_SpawnItemEx("PharaohShotWaveB",8,0,32,35,0,0,-135,1)
PHAA F 0 A_SpawnItemEx("PharaohShotWaveB",8,0,32,35,0,0,180,1)
//PHAA FGHIJK 2
PHAA EDCB 2
PHAA A 8 A_ClearRefire
PHAA A 6
//TNT1 A 4 A_ClearRefire
//PHAA LMA 2
Goto Ready+1


AltFire:
TNT1 A 0 A_JumpIfInventory("WeaponCharge",78,"ThrowW")
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,"HoverFinish")
TNT1 A 0 A_JumpIfInventory("PharaohHover",14,"HoverFinish")
TNT1 A 0 A_JumpIfInventory("PharaohHoverFlag",1,8)
PHAA A 2 A_GiveInventory("PharaohHoverFlag",1)
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,3)
TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
TNT1 A 0 SetPlayerProperty(0,1,0)
PHAA NO 4
TNT1 A 0 ThrustThingZ(0,1,0,1)

TNT1 A 1
TNT1 A 0 A_PlaySoundEx("classes/float","Weapon")
TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
TNT1 A 2 A_Recoil(-12)
TNT1 A 2
TNT1 A 0 A_GiveInventory("PharaohHover",1)
TNT1 A 0 A_SpawnItem("PharaohAfterImage",0,0,0,1)
TNT1 A 5 A_SpawnItem("PharaohAura",0,0,16)
TNT1 A 0 A_SpawnItem("PharaohAura",0,0,16)
TNT1 A 0 A_ReFire
Goto HoverFinish
HoverFinish:
PHAA O 2// A_Stop
TNT1 A 0 A_ChangeFlag("NOGRAVITY",0)
TNT1 A 0 SetPlayerProperty(0,0,0)
TNT1 A 0 A_TakeInventory("PharaohHoverFlag",99)
TNT1 A 0 A_TakeInventory("PharaohHover",99)
PHAA NA 4
TNT1 A 0 A_ReFire("AltFireEnd")
Goto Ready+1
AltFireEnd:
PHAA A 1 A_RailWait
PHAA A 0 A_ReFire("AltFireEnd")
Goto Ready+1
goto NoAmmo
NoAmmo:
PHAA A 1 ACS_Execute(979,0)
Goto Ready+1
}
}


actor ManInGauseAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 38//78
+INVENTORY.IGNORESKILL 
}

actor PharaohSpamFlag : Inventory
{
inventory.amount 1
inventory.maxamount 10
}

actor PharaohHover : Inventory
{
inventory.amount 1
inventory.maxamount 28
}

actor PharaohHoverFlag : OnceC {}

actor PharaohAfterImage
{
+NOINTERACTION
radius 1
height 1
Scale 2.5
renderstyle Translucent
alpha 0.75
States
{
Spawn:
PHAH AB 5
PHAH CCCCC 1 A_FadeOut(0.12)
stop
}
}

actor PharaohAura : BasicExplosion
{
damagetype "ClassPainLess"
Obituary "$OB_PHARAOHAURA"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(10, 80,0)
stop
}
}


actor PharaohShot1B : PharaohShot1
{
Translation "192:192=4:4", "198:198=216:216"
//Radius 10
//Height 10
//damage (12)
//speed 35
States
{
Spawn:
PHA5 A 4
loop
}
}

actor PharaohShot1BB : PharaohShot1B{translation "192:192=205:205", "198:198=74:74"}
actor PharaohShot1BR : PharaohShot1B{translation "192:192=171:171", "198:198=41:41"}
actor PharaohShot1BO : PharaohShot1B{translation "192:192=104:104", "198:198=128:128"}
actor PharaohShot1BP : PharaohShot1B{translation "192:192=229:229", "198:198=232:232"}

actor PharaohShot2B : PharaohShot2
{
Translation "192:192=4:4", "198:198=216:216"
Radius 14//10
Height 14//10
damage(25)//damage (40)
//speed 35
States
{
Spawn:
PHA5 H 4
loop
}
}

actor PharaohShot2BB : PharaohShot2B{translation "192:192=205:205", "198:198=74:74"}
actor PharaohShot2BR : PharaohShot2B{translation "192:192=171:171", "198:198=41:41"}
actor PharaohShot2BO : PharaohShot2B{translation "192:192=104:104", "198:198=128:128"}
actor PharaohShot2BP : PharaohShot2B{translation "192:192=229:229", "198:198=232:232"}

actor PharaohShot3B : PharaohShot3
{
Translation "192:192=4:4", "198:198=216:216"
Radius 16//10
Height 16//10
States
{
Spawn:
PHA5 JK 4
loop
Death:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("OilPitIgnite",0,0,8)
TNT1 A 0 A_Explode(45,128,0,0,16)//A_Explode(65,128,0)
//PHA6 LMNOPQRSTU 1
PHA5 LMNO 2
stop
}
}

actor PharaohShot3BB : PharaohShot3B{translation "192:192=205:205", "198:198=74:74"}
actor PharaohShot3BR : PharaohShot3B{translation "192:192=171:171", "198:198=41:41"}
actor PharaohShot3BO : PharaohShot3B{translation "192:192=104:104", "198:198=128:128"}
actor PharaohShot3BP : PharaohShot3B{translation "192:192=229:229", "198:198=232:232"}

actor PharaohShotWaveB : PharaohShot2
{
var int user_P;
Radius 10
Height 32//10
+RIPPER
//scale 2.5
Damage(9+user_P)
damagetype "PharaohShot3"
Obituary "$OB_PHARAOHWAVE"
//speed 35
States
{
Spawn:
PHA5 Z 2
PHA5 Z 2 A_SetUserVar("user_P",9)
PHA5 Z 2
goto Spawn+2
Death:
PHA5 Z 0
PHA5 Z 0 A_SpawnItemEx("OilPitIgnite",0,0,8)
PHA5 Z 0 A_Recoil(1)
PHA5 Z 1 A_FadeOut
Goto Death+3
}
}

actor PharaohFXB : BasicHelper
{
States
{
Spawn:
PLAY A 0
PLAY A 0 A_JumpIfInTargetInventory("WeaponCharge",78,"Give2")
PLAY A 0 A_JumpIfInTargetInventory("WeaponCharge",1,"Give")
stop
Give:
PLAY A 1 A_GiveToTarget("PharaohFXGiveB",1)
Goto Spawn
Give2:
PLAY AAA 1 A_GiveToTarget("PharaohFXGive2B",1)
PLAY A 0 A_JumpIfInTargetInventory("WeaponCharge",78,"Give3")
stop
Give3:
PLAY AAA 1 A_GiveToTarget("PharaohFXGive3B",1)
PLAY A 0 A_JumpIfInTargetInventory("WeaponCharge",78,"Give2")
stop
}
}

actor PharaohFXGiveB : PharaohFXGive
{
states
{
Use:
TNT1 A 0 A_GiveInventory("WeaponCharge",1)
TNT1 A 0 A_JumpIfInventory("WeaponCharge", 69, "FX8")
TNT1 A 0 A_JumpIfInventory("WeaponCharge", 60, "FX7")
TNT1 A 0 A_JumpIfInventory("WeaponCharge", 51, "FX6")
TNT1 A 0 A_JumpIfInventory("WeaponCharge", 43, "FX5")
TNT1 A 0 A_JumpIfInventory("WeaponCharge", 33, "FX4")
TNT1 A 0 A_JumpIfInventory("WeaponCharge", 24, "FX3")
TNT1 A 0 A_JumpIfInventory("WeaponCharge", 15, "FX2")
TNT1 A 0 A_JumpIfInventory("WeaponCharge", 6, "FX1")
stop
FX1:
TNT1 A 0 A_SpawnItemEx("PharaohFX1B",0,0,80,0,0,0,0,1)
stop
FX2:
TNT1 A 0 A_SpawnItemEx("PharaohFX2B",0,0,80,0,0,0,0,1)
stop
FX3:
TNT1 A 0 A_SpawnItemEx("PharaohFX3B",0,0,80,0,0,0,0,1)
stop
FX4:
TNT1 A 0 A_SpawnItemEx("PharaohFX4B",0,0,80,0,0,0,0,1)
stop
FX5:
TNT1 A 0 A_SpawnItemEx("PharaohFX5B",0,0,80,0,0,0,0,1)
stop
FX6:
TNT1 A 0 A_SpawnItemEx("PharaohFX6B",0,0,80,0,0,0,0,1)
stop
FX7:
TNT1 A 0 A_SpawnItemEx("PharaohFX7B",0,0,80,0,0,0,0,1)
stop
FX8:
TNT1 A 0 A_SpawnItemEx("PharaohFX8B",0,0,80,0,0,0,0,1)
stop
}
}

actor PharaohFXGive2B : PharaohFXGive2
{
states
{
Use:
TNT1 A 0 A_SpawnItemEx("PharaohFX9B",0,0,80,0,0,0,0,1)
stop
}
}

actor PharaohFXGive3B : PharaohFXGive3
{
states
{
Use:
TNT1 A 0 A_SpawnItemEx("PharaohFX10B",0,0,80,0,0,0,0,1)
stop
}
}

actor PharaohFX1B
{
-SOLID
+DONTBLAST
+NOGRAVITY
Scale 2.5
States
{
Spawn:
PHA5 B 2
stop
}
}

actor PharaohFX2B : PharaohFX1B{States{Spawn:PHA5 C 2
stop}}
actor PharaohFX3B : PharaohFX1B{States{Spawn:PHA5 D 2
stop}}
actor PharaohFX4B : PharaohFX1B{States{Spawn:PHA5 E 2
stop}}
actor PharaohFX5B : PharaohFX1B{States{Spawn:PHA5 F 2
stop}}
actor PharaohFX6B : PharaohFX1B{States{Spawn:PHA5 G 2
stop}}
actor PharaohFX7B : PharaohFX1B{States{Spawn:PHA5 H 2
stop}}
actor PharaohFX8B : PharaohFX1B{States{Spawn:PHA5 I 2
stop}}
actor PharaohFX9B : PharaohFX1B{States{Spawn:PHA5 J 2
stop}}

actor PharaohFX10B : PharaohFX1B
{
damagetype "PharaohHold"
Obituary "$OB_PHARAOHSHOT"
States
{
Spawn:
PHA5 K 0
PHA5 K 2 A_Explode(5,64,0)
stop
}
}


actor PharaohmanMain1_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("PharaohShot1B",0,1,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("PharaohShot1BB",0,1,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("PharaohShot1BR",0,1,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("PharaohShot1BO",0,1,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("PharaohShot1BP",0,1,8,0)
goto Done
}
}

actor PharaohmanMain2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("PharaohShot2B",0,1,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("PharaohShot2BB",0,1,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("PharaohShot2BR",0,1,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("PharaohShot2BO",0,1,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("PharaohShot2BP",0,1,8,0)
goto Done
}
}

actor PharaohmanMain3_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("PharaohShot3B",0,1,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("PharaohShot3BB",0,1,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("PharaohShot3BR",0,1,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("PharaohShot3BO",0,1,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("PharaohShot3BP",0,1,8,0)
goto Done
}
}


