actor PharaohShotBoss : MegaBuster 
{
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 5
Obituary "%o was sacrificed by %k's Pharaoh Shot."
Inventory.Pickupmessage "Power up! Pharaoh Shot!"
//weapon.ammotype "PharaohShotClassAmmo"
weapon.ammotype "PharaohChargeC"
inventory.pickupsound "weapon/weaponup"
+WEAPON.AMMO_OPTIONAL
+WEAPON.ALT_AMMO_OPTIONAL
//inventory.icon "PHASSI"
Scale 2.0
States
{
Spawn:
WEA2 L 1
loop
Ready:
PHAA A 0 ACS_ExecuteAlways(998,0,242)
PHAA A 1 A_WeaponReady
TNT1 A 0 A_TakeInventory("PharaohHover",100)
Goto Ready+1
Deselect:
ICEB A 0 A_TakeInventory("PharaohShotBoss")
ICEB A 0 A_GiveInventory("PharaohShotBoss")
PHAA A 1 A_SelectWeapon("PharaohShotBoss")
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
PHAA A 1 A_Raise
Loop
Fire:
PHAA A 0 //A_JumpIfNoAmmo("NoAmmo")
TNT1 A 0 A_TakeInventory("PharaohHover",100)
PHAA A 0
Goto Hold
Hold:
PHAA A 0 //A_JumpIfNoAmmo("NoAmmo")
PHAA A 0 A_JumpIfInventory("PharaohChargeC",1,"Hold2")
PHAA A 2 A_GiveInventory("PharaohChargeC",1)
//PHAA A 0 A_GiveInventory("PharaohShotClassAmmo",2)
PHAA A 0 ACS_ExecuteAlways(994,0)
PHAA A 0 A_Refire
Goto Throw1
Hold2:
PHAA A 0 A_JumpIfInventory("PharaohChargeC",2,"BotCheck")
PHAA A 0 A_GiveInventory("PharaohChargeC",1)
//PHAA A 0 A_GiveInventory("PharaohShotClassAmmo",2)
PHAA BCDE 2 
PHAA E 0 A_SpawnItemEx("PharaohFXB")
PHAA A 0 A_Refire
Goto Throw1
BotCheck:
PHAA A 0 ACS_ExecuteAlways(974,0)
Goto Hold3
Hold3:
//TNT1 A 0 A_GiveInventory("PharaohShotClassAmmo",2)
TNT1 A 1 A_GiveInventory("PharaohChargeC",1)
TNT1 A 0 A_Refire
TNT1 A 0 A_JumpIfInventory("PharaohChargeC",78,"Throw3")
TNT1 A 0 A_JumpIfInventory("PharaohChargeC",33,"Throw2")
Goto Throw1
Throw1:
TNT1 A 0 A_TakeInventory("PharaohChargeC",100)
PHAA A 0 A_PlaySoundEx("weapon/pharaoh1","Weapon")
PHAA A 0 A_FireCustomMissile("PharaohShot1B",0,0,8,0)
//TNT1 A 0 A_TakeInventory("PharaohShotClassAmmo",100)
PHAA FGHIJK 1
TNT1 A 2 A_ClearRefire
PHAA LMA 2
Goto Ready+1
Throw2:
TNT1 A 0 A_TakeInventory("PharaohChargeC",100)
PHAA A 0 A_PlaySoundEx("weapon/pharaoh1","Weapon")
//TNT1 A 0 A_TakeInventory("PharaohShotClassAmmo",100)
PHAA A 0 A_FireCustomMissile("PharaohShot2B",0,0,8,0)
PHAA FGHIJK 2
TNT1 A 4 A_ClearRefire
PHAA LMA 2
Goto Ready+1
Throw3:
TNT1 A 0 A_TakeInventory("PharaohChargeC",100)
//TNT1 A 0 A_TakeInventory("PharaohShotClassAmmo",100)
PHAA A 0 A_PlaySoundEx("weapon/pharaoh2","Weapon")
PHAA A 0 A_FireCustomMissile("PharaohShot3B",0,0,8,0)
PHAA FGHIJK 2
TNT1 A 4 A_ClearRefire
PHAA LMA 2
Goto Ready+1

AltFire:
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,"NoAmmo")
TNT1 A 0 A_JumpIfInventory("PharaohHover",28,"NoAmmo")
TNT1 A 0 A_JumpIfInventory("PharaohHoverFlag",1,7)
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 1 
TNT1 A 0 A_PlaySoundEx("classes/float","Weapon")
TNT1 A 6 A_Recoil(-15)
TNT1 A 0 A_GiveInventory("PharaohHover",1)
TNT1 A 0 A_SpawnItem("PharaohAfterImage",0,0,0,1)
TNT1 A 0 A_SpawnItem("PharaohAura",0,8,0,0)
TNT1 A 6 
TNT1 A 0 A_SpawnItem("PharaohAura",0,8,0,0)
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",1)
PHAA NA 4
Goto Ready+1
goto NoAmmo
NoAmmo:
PHAA A 1 ACS_Execute(979,0)
TNT1 A 0 A_ChangeFlag("NOGRAVITY",0)
TNT1 A 0 SetPlayerProperty(0,0,0)
TNT1 A 0 A_TakeInventory("PharaohHoverFlag",1)
Goto Ready+1
}
}

/*
actor PharaohShotClassAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 78
}
*/

actor PharaohChargeC : Ammo
{
+INVENTORY.IGNORESKILL 
inventory.amount 1
inventory.maxamount 78
}

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

actor PharaohHoverFlag : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor PharaohAfterImage
{
+NOINTERACTION
radius 1
height 1
Scale 2.5
renderstyle Translucent
alpha 0.75
States
{
Spawn:
PHAH ABC 5
stop
}
}

actor PharaohAura
{
-SOLID
+NOGRAVITY
PROJECTILE
damage 0
radius 1
height 1
damagetype "Pharoah"
Obituary "%o was cursed by %k's aura."
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(10, 80,0)
stop
}
}

actor PharaohShot1B : PharaohShot1
{
Translation "25:75=4:4", "150:200=215:215"
}
actor PharaohShot2B : PharaohShot2
{
Translation "25:75=4:4", "150:200=215:215"
}
actor PharaohShot3B : PharaohShot3
{
Translation "25:75=4:4", "150:200=215:215"
}

actor PharaohFXB : PharaohFX
{
States
{
Spawn:
PLAY A 0
PLAY A 0 A_JumpIfInTargetInventory("PharaohChargeC",78,"Give2")
PLAY A 0 A_JumpIfInTargetInventory("PharaohChargeC",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("PharaohChargeC",78,"Give3")
stop
Give3:
PLAY AAA 1 A_GiveToTarget("PharaohFXGive3B",1)
PLAY A 0 A_JumpIfInTargetInventory("PharaohChargeC",78,"Give2")
stop
}
}

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

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

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


actor PharaohFX1B : PharaohFX1
{
Translation "25:75=4:4", "150:200=215:215"
}
actor PharaohFX2B : PharaohFX2
{
Translation "25:75=4:4", "150:200=215:215"
}
actor PharaohFX3B : PharaohFX3
{
Translation "25:75=4:4", "150:200=215:215"
}
actor PharaohFX4B : PharaohFX4
{
Translation "25:75=4:4", "150:200=215:215"
}
actor PharaohFX5B : PharaohFX5
{
Translation "25:75=4:4", "150:200=215:215"
}
actor PharaohFX6B : PharaohFX6
{
Translation "25:75=4:4", "150:200=215:215"
}
actor PharaohFX7B : PharaohFX7
{
Translation "25:75=4:4", "150:200=215:215"
}
actor PharaohFX8B : PharaohFX8
{
Translation "25:75=4:4", "150:200=215:215"
}
actor PharaohFX9B : PharaohFX9
{
Translation "25:75=4:4", "150:200=215:215"
}
actor PharaohFX10B : PharaohFX10
{
Translation "25:75=4:4", "150:200=215:215"
}