
//==============================================================================
//=========================== Corvette's Phoenix Rod ===========================
//==============================================================================


ACTOR ClassicPhoenixRod : PhoenixRod
{
	-WEAPON.NOAUTOFIRE
	Inventory.RestrictedTo "Corvette"
	Inventory.ForbiddenTo "BrutalCorvus"
	Weapon.SelectionOrder 9
	Weapon.AmmoUse1 1
	Weapon.AmmoUse2 1
	Weapon.AmmoGive1 0
	Weapon.AmmoType1 "ClassicPhoenixRodAmmo"
	Weapon.AmmoType2 "ClassicPhoenixRodAmmo"
	Weapon.SisterWeapon "None"
	ConversationID 192
	Inventory.PickupMessage "Picked up the Phoenix Rod, purify them with fire, that they may be reborn!"
	Weapon.SlotNumber 6
	Speed 4
  
	States
	{
		Spawn:
			TNT1 A 0 A_SpawnItemEx("YellowFlareSmall",0,0,40)
			WPHX AA 1 Bright A_SetAngle(angle+speed)
			Goto Spawn
		Ready:
			TNT1 A 0 A_StopSound(CHAN_7)
			TNT1 A 0 A_SetCrosshair (12)
			TNT1 A 0 A_JumpIfInventory("Action1",1,"Kicking")
			PHNX A 1 A_WeaponReady
			Loop
		Deselect:
			TNT1 A 0 A_StopSound(CHAN_7)
			PHNX A 0 A_Lower
			PHNX A 1 A_Lower
			Loop
		Select:
			PHNX A 0 A_Raise
			PHNX A 1 A_Raise
			Loop
		Fire:
			TNT1 A 0 A_StopSound(CHAN_7)
			TNT1 A 0 A_JumpIfInventory("PowerClassicLevel2",1,"PoweredFire")
			TNT1 A 0 A_PlayWeaponSound("PHNXFIR3Q")
			PHNX B 3 Bright
			{
				A_Recoil(3 * GetCVAR("SteadyHand"));
				A_SetPitch(pitch-(0.8 * GetCVAR("SteadyHand")));
				
				If (GetCVAR("NoScalingPlz") == 1)
				{
					A_FireProjectile("WimpyBrutalPhoenixMissile",0,true,0,-3,0,-1);
				}
				Else
				{
					A_FireProjectile("BrutalPhoenixMissile",0,true,0,-3,0,-1);
				}
			}
			PHNX C 3 Bright A_SetPitch(pitch-(0.3 * GetCVAR("SteadyHand")))
			PHNX C 3 Bright A_SetPitch(pitch+(0.4 * GetCVAR("SteadyHand")))
			PHNX D 3 Bright A_SetPitch(pitch+(0.3 * GetCVAR("SteadyHand")))
			PHNX B 3 Bright A_SetPitch(pitch+(0.2 * GetCVAR("SteadyHand")))
			PHNX AA 1 Bright A_Refire
			Goto Ready
		AltFire:
			TNT1 A 0 A_StopSound(CHAN_7)
			TNT1 A 0 A_JumpIfInventory("PowerClassicLevel2",1,"PoweredAltFireCheck")
			TNT1 A 0 A_JumpIf(CallACS("ExpressSkills")==1, "SuperAttack")
			TNT1 A 0 A_JumpIfInventory("Level",7,"SuperAttack")
			TNT1 A 0 ACS_NamedExecuteAlways("NeedLevelAttack",0,7)
			Goto Ready
		SuperAttack:
			TNT1 A 0 A_JumpIfInventory("ClassicPhoenixRodAmmo",2,"AltHold")
			Goto Ready
		AltHold:
			PHNX AB 3 Bright A_WeaponReady(WRF_NOFIRE)
			TNT1 A 0 A_Light(-3)
			TNT1 A 0 A_PlayWeaponSound("GNTPOW")
			PHNX A 1 A_Refire("Charge1")
			goto Level1
		Charge1:
			PHNX AB 3 Bright
			PHNX A 1 A_Refire("Charge1A")
			goto Level1
		Charge1A:
			PHNX AB 3 Bright
			PHNX A 1 A_Refire("Charge1B")
			goto Level1
		Charge1B:
			PHNX AB 3 Bright
			PHNX A 1 A_Refire("Charge1C")
			goto Level1
		Charge1C:
			PHNX AB 3 Bright
			TNT1 A 0 A_JumpIfInventory("ClassicPhoenixRodAmmo",3,1)
			goto Level1
			PHNX A 1 A_Refire("Charge2")	
			goto Level1
		Charge2:
			TNT1 A 0 A_WeaponOffset(0,35)
			TNT1 A 0 A_QuakeEx (1,1,1,5,0,64,"world/quake",QF_SCALEDOWN,0,0,0,64)
			PHNX AB 2 Bright A_WeaponReady(WRF_NOFIRE)
			TNT1 A 0 A_Light(-6)
			TNT1 A 0 A_PlayWeaponSound("GNTHIT")
			PHNX A 1 A_Refire("Charge2A")
			goto Level2
		Charge2A:
			TNT1 A 0 A_WeaponOffset(0,33)
			TNT1 A 0 A_QuakeEx (1,1,1,5,0,64,"world/quake",QF_SCALEDOWN,0,0,0,64)
			PHNX AB 2 Bright
			PHNX A 1 A_Refire("Charge2B")
			goto Level2
		Charge2B:
			TNT1 A 0 A_WeaponOffset(0,35)
			TNT1 A 0 A_QuakeEx (1,1,1,5,0,64,"world/quake",QF_SCALEDOWN,0,0,0,64)
			PHNX AB 2 Bright
			PHNX A 1 A_Refire("Charge2C")
			goto Level2
		Charge2C:
			TNT1 A 0 A_WeaponOffset(0,33)
			TNT1 A 0 A_QuakeEx (1,1,1,5,0,64,"world/quake",QF_SCALEDOWN,0,0,0,64)
			PHNX AB 2 Bright
			PHNX A 1 A_Refire("Charge2D")
			goto Level2
		Charge2D:
			TNT1 A 0 A_WeaponOffset(0,35)
			TNT1 A 0 A_QuakeEx (1,1,1,5,0,64,"world/quake",QF_SCALEDOWN,0,0,0,64)
			PHNX AB 2 Bright
			PHNX A 1 A_Refire("Charge2E")
			goto Level2 
		Charge2E:
			TNT1 A 0 A_WeaponOffset(0,33)
			TNT1 A 0 A_QuakeEx (1,1,1,5,0,64,"world/quake",QF_SCALEDOWN,0,0,0,64)
			PHNX AB 2 Bright
			TNT1 A 0 A_JumpIfInventory("ClassicPhoenixRodAmmo",5,1)
			goto Level2	
			PHNX A 1 A_Refire("Charge3")
			goto Level2
		Charge3:
			TNT1 A 0 A_WeaponOffset(0,35)
			TNT1 A 0 A_QuakeEx (2,2,2,5,0,64,"world/quake",QF_SCALEDOWN,0,0,0,64)
			//PHNX B 1 A_PlaySound("FLAMER",CHAN_7,1,True)
			PHNX B 1 A_StartSound("FLAMER",7,CHANF_NOPAUSE|CHANF_LOOPING)
			TNT1 A 0 A_Light(-9)
			PHNX A 1 A_Refire("ChargeLoop")
		ChargeLoop:
			TNT1 A 0 A_WeaponOffset(0,35)
			TNT1 A 0 A_QuakeEx (2,2,2,5,0,64,"world/quake",QF_SCALEDOWN,0,0,0,64)
			PHNX AB 1 Bright A_WeaponReady(WRF_NOFIRE)
			TNT1 A 0 A_WeaponOffset(0,37)
			PHNX A 1 A_Refire("ChargeLoop")
			goto Level3
		Level1:
			TNT1 A 0 A_Recoil(3 * GetCVAR("SteadyHand"))
			PHNX B 2 Bright
			{
				A_PlayWeaponSound("PHNXFIR2");
				A_SetPitch(pitch-(0.9 * GetCVAR("SteadyHand")));
				A_TakeInventory("ClassicPhoenixRodAmmo",1);
				
				If (GetCVAR("NoScalingPlz") == 1)
				{
					A_FireProjectile("WimpyBrutalPhoenixMissile1",0,true,0,-3,0,-1);
				}
				Else
				{
					A_FireProjectile("BrutalPhoenixMissile1",0,true,0,-3,0,-1);
				}
			}
			goto ChargeEnd
		Level2:
			TNT1 A 0 A_Recoil(3 * GetCVAR("SteadyHand"))
			PHNX B 2 Bright A_PlayWeaponSound("SPIRTS1")
			TNT1 A 0 A_FireCustomMissile("BrutalPhoenixMissile2",0,true,0,-3)
			TNT1 A 0 A_TakeInventory("ClassicPhoenixRodAmmo",2)
			goto ChargeEnd
			
		Level3:
			TNT1 A 0 A_Recoil(5 * GetCVAR("SteadyHand"))
			TNT1 A 0 A_StopSound(CHAN_7)
			PHNX B 2 Bright
			{
				A_PlayWeaponSound("SPIRT7");
				A_SetPitch(pitch-(1 * GetCVAR("SteadyHand")));
				A_TakeInventory("ClassicPhoenixRodAmmo",4);
				
				If (GetCVAR("NoScalingPlz") == 1)
				{
					A_FireProjectile("WimpyBrutalPhoenixMissile3",0,true,0,-3);
				}
				Else
				{
					A_FireProjectile("BrutalPhoenixMissile3",0,true,0,-3);
				}
			}
			goto ChargeEnd
		ChargeEnd:
			TNT1 A 0 A_WeaponOffset(0,37)
			TNT1 A 0 A_Recoil(3 * GetCVAR("SteadyHand"))
			TNT1 A 0 A_Light(0)
			TNT1 A 0 A_SetPitch(pitch-(0.8 * GetCVAR("SteadyHand")))
			PHNX C 2 Bright A_SetPitch(pitch-(0.3 * GetCVAR("SteadyHand")))
			PHNX C 2 Bright A_SetPitch(pitch+(0.4 * GetCVAR("SteadyHand")))
			PHNX D 2 Bright A_SetPitch(pitch+(0.3 * GetCVAR("SteadyHand")))
			PHNX B 2 Bright A_SetPitch(pitch+(0.2 * GetCVAR("SteadyHand")))
		   Goto Ready
		PoweredFire:
			TNT1 A 0 A_PlaySound("FLAMER",CHAN_7,1.0,true)
		PoweredFireHold:
			TNT1 A 0 A_Recoil(1 * GetCVAR("SteadyHand"))
			PHNX C 1 Bright A_QuakeEx (1,1,1,9,0,64,"world/quake",QF_SCALEDOWN,0,0,0,64)
			TNT1 A 0 A_FireCustomMissile("BrutalPhoenixPoweredMissile",0,True,0,-3)
			TNT1 A 0 A_JumpIfNoAmmo("FlameStop")
			TNT1 A 0 A_Recoil(-1 * GetCVAR("SteadyHand"))
			TNT1 A 0 A_JumpIfInventory("PowerClassicLevel2",1,1)
			Goto FlameStop
			TNT1 A 0 A_JumpIf((GetPlayerInput (INPUT_BUTTONS) & BT_ATTACK),1)
			Goto FlameStop
			PHNX CCFFFCCCFFFCCCFFF 1 Bright 
			{
				If (GetPlayerInput(INPUT_BUTTONS) & BT_ATTACK)
				{
					A_QuakeEx (1,1,1,9,0,64,"world/quake",QF_SCALEDOWN,0,0,0,64);
					A_FireCustomMissile("BrutalPhoenixPoweredMissile",0,false,0,-3);
					A_JumpIfNoAmmo("FlameStop");
					A_JumpIfInventory("PowerClassicLevel2",1,1);
					return state (0);
				}
				Else
				{
					return state("FlameStop");
				}
			}
			TNT1 A 0 A_JumpIf((GetPlayerInput (INPUT_BUTTONS) & BT_ATTACK),"PoweredFireHold")
		FlameStop:
			TNT1 A 0 A_StopSound(CHAN_7)
			TNT1 A 0 A_PlaySound("FLAMSTOP",CHAN_7)
			PHNX EDB 3 Bright
			Goto Ready
		PoweredAltFireCheck:
			TNT1 A 0 A_JumpIf(CallACS("ExpressSkills")==1, "PoweredAltFire")
			TNT1 A 0 A_JumpIfInventory("Level",15,"PoweredAltFire")
			TNT1 A 0 ACS_NamedExecuteAlways("NeedLevelAttack",0,15)
			Goto Ready
		PoweredAltFire:
			TNT1 A 0 A_StopSound(CHAN_7)
			TNT1 A 0 A_JumpIfInventory("ClassicPhoenixRodAmmo",15,2)
			PHNX A 1
			Goto Ready
			TNT1 A 0 A_PlayWeaponSound("PLRBURN")
			PHNX B 3 Bright
			TNT1 A 0 A_Recoil(3 * GetCVAR("SteadyHand"))
			TNT1 A 0 A_FireCustomMissile("ScorchedEarth",23,False,-23,-3)
			TNT1 A 0 A_FireCustomMissile("ScorchedEarth",15,False,-15,-3)
			TNT1 A 0 A_FireCustomMissile("ScorchedEarth",7,False,-7,-3)
			TNT1 A 0 A_FireCustomMissile("ScorchedEarth",0,False,0,-3)
			TNT1 A 0 A_FireCustomMissile("ScorchedEarth",-7,False,7,-3)
			TNT1 A 0 A_FireCustomMissile("ScorchedEarth",-15,False,15,-3)
			TNT1 A 0 A_FireCustomMissile("ScorchedEarth",-23,False,23,-3)
			TNT1 A 0 A_TakeInventory("ClassicPhoenixRodAmmo",15)
			TNT1 A 0 A_SetPitch(pitch-(0.8 * GetCVAR("SteadyHand")))
			PHNX C 3 Bright A_SetPitch(pitch-(0.3 * GetCVAR("SteadyHand")))
			PHNX C 3 Bright A_SetPitch(pitch+(0.4 * GetCVAR("SteadyHand")))
			PHNX D 3 Bright A_SetPitch(pitch+(0.3 * GetCVAR("SteadyHand")))
			PHNX B 3 Bright A_SetPitch(pitch+(0.2 * GetCVAR("SteadyHand")))
			Goto Ready
		Kicking:
			TNT1 A 0 A_StopSound(CHAN_7)
			PHNX A 1 Offset(0,42)
			PHNX A 1 Offset(0,52)
			PHNX A 1 Offset(0,62)
			PHNX A 1 Offset(0,72)
			PHNX A 1 Offset(0,82)
			TNT1 A 0 A_StopSound(CHAN_7)
			TNT1 A 0 A_PlaySound("WHOP")
			CKCK ABCD 1 Offset(0,32)
			//TNT1 A 0 A_CustomPunch(random(20,40)+(CallACS("StrengthCalculator")/4),1,0,"BrutalKickPuff", 104)
			TNT1 A 0 A_FireCustomMissile("BootOfFury",0,0,0,0)
			TNT1 A 0 A_Recoil(-6)
			CKCK E 3
			TNT1 A 0 A_Recoil(3)
			CKCK DCB 1
			CKCK AA 1 A_WeaponReady(WRF_NOSECONDARY)
			TNT1 AAA 1 A_WeaponReady(WRF_NOSECONDARY)
			PHNX A 1 Offset(0,82)
			PHNX A 1 Offset(0,72)
			PHNX A 1 Offset(0,62)
			PHNX A 1 Offset(0,52)
			PHNX A 1 Offset(0,42)
			PHNX A 0 Offset(0,32)
			TNT1 A 0 A_JumpIfInventory("Action1",1,"Kicking")
			Goto Ready
	}
}