ACTOR HellforgeCannon : Weapon
{	
	Inventory.PickupMessage "HELLFORGE CANNON"
	Obituary "%k ripped %o apart with a hellforge Cannon."
	Weapon.AmmoType1 "Mana1"
	Weapon.AmmoGive1 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType2 "Mana2"
	Weapon.SelectionOrder 5
	Weapon.AmmoUse1 6
	Weapon.AmmoUse2 6
	+PRIMARY_USES_BOTH
	+ALT_AMMO_OPTIONAL
	Weapon.KickBack 100
	+UNDROPPABLE
	Tag "Hellforge Cannon"
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 2.1
	Weapon.BobRangeY 0.4
	Weapon.BobRangeX 0.5
	States
	{
	Spawn:
		WHFC A -1 Bright
		Loop
	Ready:
		HFCA A 0 A_JumpIfInventory("IsMarksman",1,"ReadyZoom")
		HFCA A 1 A_WeaponReady
		Loop
	ReadyZoom:
		HFCA A 1 A_WeaponReady(WRF_ALLOWZOOM)
		loop
	Deselect:
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_TakeInventory("PowerZoomLevel2")
		TNT1 A 0 A_TakeInventory("PowerZoomLevel1")
		HFCA A 1 A_Lower
		TNT1 A 0 A_Lower
		Loop
	Select:
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_TakeInventory("PowerZoomLevel2")
		TNT1 A 0 A_TakeInventory("PowerZoomLevel1")
		HFCA A 1 A_Raise
		TNT1 A 0 A_Raise
		Loop
	Fire:
		HFCA B 2 Offset(0, 34) A_GiveInventory("MarksmanFocusCheck", 1)
		HFCA B 1 Offset(0, 38)
		HFCA D 2 Offset(0, 40)
		HFCA D 1 Offset(0, 44)
		HFCA D 0 A_GunFlash
		HFCA D 1 Bright Offset(0, 49) A_FireCustomMissile("Ripper1",0,1,0,0)
		HFCA D 1 Bright Offset(0, 49) A_SetPitch(Pitch-1.5)
		HFCA EE 1 Bright Offset(0, 47) A_SetPitch(Pitch+.75)
		HFCA FG 2 BRIGHT Offset(0, 47)
		HFCA C 1 Offset(0, 44) A_Refire
		HFCA C 1 Offset(0, 42)
		HFCA C 1 Offset(0, 40)
		HFCA B 1 Offset(0, 38)
		HFCA B 1 Offset(0, 36)
		HFCA B 1 Offset(0, 34)
		Goto Ready
	HOLD:
		HFCA D 0 Bright A_GiveInventory("MarksmanFocusCheck", 1)
		HFCA D 1 Bright Offset(0, 49) A_FireCustomMissile("Ripper1",0,1,0,0)
		HFCA D 1 Bright Offset(0, 49) A_SetPitch(Pitch-1.5)
		HFCA EE 1 Bright Offset(0, 47) A_SetPitch(Pitch+.75)
		HFCA FG 2 BRIGHT Offset(0, 47)
		HFCA C 1 Offset(0, 44) A_Refire
		HFCA C 1 Offset(0, 42)
		HFCA C 1 Offset(0, 40)
		HFCA B 1 Offset(0, 38)
		HFCA B 1 Offset(0, 36)
		HFCA B 1 Offset(0, 34)
		Goto Ready
	AltFire:
		HFCA B 0 A_JumpIfInventory("Mana1", 3, 1)
		Goto Ready
		HFCA B 0 A_JumpIfInventory("Mana2", 3, 1)
		Goto Ready
		HFCA B 2 Offset(0, 34) A_GiveInventory("MarksmanFocusCheck", 1)
		HFCA B 1 Offset(0, 38)
		HFCA D 2 Offset(0, 40)
		HFCA D 1 Offset(0, 44)
		HFCA D 0 A_GunFlash
		HFCA B 0 A_TakeInventory("Mana1", 3, TIF_NOTAKEINFINITE)
		HFCA B 0 A_TakeInventory("Mana2", 3, TIF_NOTAKEINFINITE)
		HFCA D 2 Bright Offset(0, 46)
		HFCA E 1 Bright Offset(0, 48) A_FireCustomMissile("Ripper3",frandom(-4,4),0,0,0)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch-0.25)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch+0.25)
		HFCA E 1 Bright Offset(0, 48) A_FireCustomMissile("Ripper3",frandom(-4,4),0,0,0)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch-0.25)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch+0.25)
		HFCA E 1 Bright Offset(0, 48) A_FireCustomMissile("Ripper3",frandom(-4,4),0,0,0)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch-0.25)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch+0.25)
		HFCA E 1 Bright Offset(0, 48) A_FireCustomMissile("Ripper3",frandom(-4,4),0,0,0)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch-0.25)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch+0.25)
		HFCA D 0 Bright A_Refire
		HFCA FG 2 BRIGHT Offset(0, 46)
		HFCA C 1 Offset(0, 44) 
		HFCA C 1 Offset(0, 42)
		HFCA C 1 Offset(0, 40)
		HFCA B 1 Offset(0, 38)
		HFCA B 1 Offset(0, 36)
		HFCA B 1 Offset(0, 34)
		Goto Ready
	AltHOLD:
		HFCA B 0 A_JumpIfInventory("Mana1", 3, 1)
		Goto Ready
		HFCA B 0 A_JumpIfInventory("Mana2", 3, 1)
		Goto Ready
		HFCA D 0 A_GiveInventory("MarksmanFocusCheck", 1)
		HFCA D 0 A_GunFlash
		HFCA B 0 A_TakeInventory("Mana1", 3, TIF_NOTAKEINFINITE)
		HFCA B 0 A_TakeInventory("Mana2", 3, TIF_NOTAKEINFINITE)
		HFCA D 2 Bright Offset(0, 46)
		HFCA E 1 Bright Offset(0, 48) A_FireCustomMissile("Ripper3",frandom(-4,4),0,0,0)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch-0.25)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch+0.25)
		HFCA E 1 Bright Offset(0, 48) A_FireCustomMissile("Ripper3",frandom(-4,4),0,0,0)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch-0.25)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch+0.25)
		HFCA E 1 Bright Offset(0, 48) A_FireCustomMissile("Ripper3",frandom(-4,4),0,0,0)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch-0.25)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch+0.25)
		HFCA E 1 Bright Offset(0, 48) A_FireCustomMissile("Ripper3",frandom(-4,4),0,0,0)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch-0.25)
		HFCA D 1 Bright Offset(0, 46) A_SetPitch(pitch+0.25)
		HFCA D 0 Bright A_Refire
		HFCA FG 2 BRIGHT Offset(0, 46)
		HFCA C 1 Offset(0, 44) 
		HFCA C 1 Offset(0, 42)
		HFCA C 1 Offset(0, 40)
		HFCA B 1 Offset(0, 38)
		HFCA B 1 Offset(0, 36)
		HFCA B 1 Offset(0, 34)
		Goto Ready
	Zoom:
		TNT1 A 0 A_JumpIfInventory("PowerIsZoom",1,"ReadyZoom")
		TNT1 A 0 A_JumpIfInventory("PowerZoomLevel2",1,"UnZoom")
		TNT1 A 0 A_JumpIfInventory("PowerZoomLevel1",1,"Zoom2")
		TNT1 A 0 A_ZoomFactor(2.0)
		TNT1 A 0 A_TakeInventory("PowerZoomLevel2",1)
		TNT1 A 0 A_GiveInventory("PowerZoomLevel1",1)
		TNT1 A 0 A_GiveInventory("PowerIsZoom",1)
		Goto Ready
	Zoom2:
		TNT1 A 0 A_ZoomFactor(4.0)
		TNT1 A 0 A_TakeInventory("PowerZoomLevel1",1)
		TNT1 A 0 A_GiveInventory("PowerZoomLevel2",1)
		TNT1 A 0 A_GiveInventory("PowerIsZoom",1)
		Goto Ready
	UnZoom:
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_GiveInventory("PowerIsZoom",1)
		TNT1 A 0 A_TakeInventory("PowerZoomLevel1",1)
		TNT1 A 0 A_TakeInventory("PowerZoomLevel2",1)
		Goto Ready
	}
}

ACTOR Ripper3
{
	Radius 5
	Height 5
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(15,30), AGILITY, ABIL_RANGEDMASTERY, WOCTARGET))
	PROJECTILE
	RENDERSTYLE Normal
	+FORCEXYBILLBOARD
	+DOOMBOUNCE
	-NOGRAVITY
	+THRUGHOST
	+WINDTHRUST
	+MTHRUSPECIES /*+NODAMAGETHRUST*/ +DONTBLAST
	Gravity 0.25
	BounceFactor 0.7
	Speed 24
	SeeSound "HunterHellforgeCannonTink"
	DeathSound "HunterHellforgeCannonAltExplode"
	Damagetype "Physical"
	//BounceSound "weapons/hellforgecannon/bounce"
	States
	{
	Spawn:
		RIP2 AAA 1 Bright A_SpawnItemEx("Ripper3Trail")
		RIP2 BBB 1 Bright A_SpawnItemEx("Ripper3Trail")
		loop
	Death:
		RIP2 CDEFG 3 Bright
		stop
	}
}

ACTOR Ripper3Trail
{
	Radius 5
	Height 5
	PROJECTILE
	Damagetype normal
	+FORCEXYBILLBOARD
	+EXTREMEDEATH
	+DOOMBOUNCE
	+NOINTERACTION
	+CLIENTSIDEONLY +DONTBLAST
	RenderStyle Add
	Alpha 0.5
	DeathSound "weapons/firex2"
	States
	{
	Spawn:
		RIP2 AB 2 Bright A_Fadeout(0.07)
		loop
	}
}

ACTOR Ripper1
{
	Radius 8
	Height 8
	Speed 30
	RENDERSTYLE Normal
	Damagetype fire
	PROJECTILE
	+FORCEXYBILLBOARD
	+EXTREMEDEATH
	+THRUGHOST
	+WINDTHRUST
	+MTHRUSPECIES /*+NODAMAGETHRUST*/ +DONTBLAST
	+FORCERADIUSDMG
	Seesound "HunterHellforgeCannonFire"
	DeathSound "HunterHellforgeCannonExplode"
	States
	{
	Spawn:
		RIPP AAABBBCCC 1 Bright A_SpawnItemEx("RedPuff",0,0,0,0,0,0,0,8)
		loop
	Death:
		RIP1 D 0 Bright A_SetTranslucent (0.75,1)
		RIP1 D 0 Radius_Quake(2,12,0,2,0)
		RIP1 D 1 Bright A_Explode(ACS_NamedExecuteWithResult("WOC Player Scale", 48, AGILITY, ABIL_RANGEDMASTERY, WOCTARGET),64,0)
		RIP1 D 0 Bright A_SpawnItemEx("Ripper2",0,0,0,40,0,0,0,0,0)
		RIP1 D 0 Bright A_SpawnItemEx("Ripper2",0,0,0,40,0,0,60,0,0)
		RIP1 D 0 Bright A_SpawnItemEx("Ripper2",0,0,0,40,0,0,120,0,0)
		RIP1 D 0 Bright A_SpawnItemEx("Ripper2",0,0,0,40,0,0,180,0,0)
		RIP1 D 0 Bright A_SpawnItemEx("Ripper2",0,0,0,40,0,0,240,0,0)
		RIP1 D 0 Bright A_SpawnItemEx("Ripper2",0,0,0,40,0,0,300,0,0)
		RIP1 EFGH 3 Bright
		stop
	}
}

ACTOR Ripper2
{
	Radius 5
	Height 5
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(8,28), AGILITY, ABIL_RANGEDMASTERY, WOCTARGET))
	PROJECTILE
	Damagetype "Physical"
	RENDERSTYLE Normal
	+FORCEXYBILLBOARD
	+EXTREMEDEATH
	+HEXENBOUNCE
	+THRUGHOST
	+WINDTHRUST
	+MTHRUSPECIES /*+NODAMAGETHRUST*/ +DONTBLAST
	BounceCount 2
	BounceFactor 1.0
	DeathSound "weapons/firex2"
	States
	{
	Spawn:
		RIP2 A 3 Bright
		RIP2 B 3 Bright
		loop
	Death:
		RIP2 C 0 Bright A_SetTranslucent (0.67,1)
		RIP2 CDEFG 3 Bright
		stop
	}
}

ACTOR RedPuff
{   
	Radius 0
	Height 1
	+NOGRAVITY
	+NOBLOCKMAP
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY +DONTBLAST
	RENDERSTYLE ADD
	ALPHA 0.85
	States
	{
	Spawn:
		TNT1 A 3 Bright
		RPUF BCDE 3 Bright
		Stop 
	}
}