Actor Lightbringer : ClericWeapon// replaces CWeaponPiece2
{
	Inventory.PickupSound "Misc/W_PkUp"
	Inventory.PickupMessage "Lightbringer"
	Obituary "%o was seared by %k"
	Weapon.AmmoType1 "Mana2"
	weapon.ammogive1 0
	Weapon.AmmoUse1 5
	Weapon.AmmoType2 "Mana2"
	Weapon.AmmoUse2 2
	Weapon.KickBack 100
	Weapon.SelectionOrder 2
	+UNDROPPABLE
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 2.1
	Weapon.BobRangeY 0.4
	Weapon.BobRangeX 0.5
	States
	{
	Spawn:
		LTBR A -1
		Loop
	Select:
		LTBR M 1 A_Raise
		TNT1 M 0 A_Raise
		Loop
	Deselect:
		LTBR O 0 A_StopSoundEx("SoundSlot7")
		LTBR O 0 A_JumpIfInventory("Mana2", 5, 1)
		Goto Deselect2
		LTBR O 1 Bright A_Lower
		TNT1 M 0 A_Lower
		LTBR O 1 Bright A_Lower
		TNT1 M 0 A_Lower
		LTBR O 1 Bright A_Lower
		TNT1 M 0 A_Lower
		LTBR O 1 Bright A_Lower
		LTBR M 1 A_Lower
		TNT1 A 0 A_Lower
		Goto Deselect+7
	Ready:
		LTBR M 4 A_JumpIfInventory("Mana2", 5, 1)
		Goto Ready2
		LTBR N 0 A_PlaySoundEx("Weapons/Lightbringer/Recharge", "SoundSlot6", 0)
		LTBR NO 4 Bright
		LTBR B 0 Bright A_JumpIfInventory("Mana2", 5, 1)
		Goto Ready2
		LTBR B 0 Bright A_StopSoundEx("SoundSlot7")
		LTBR BBBBCCCCDDDDEEEE 1 Bright A_WeaponReady
		Goto Ready+4
	Fire:
		LTBR F 0 A_PlayWeaponSound("ClericLightBringerFire") 
		LTBR F 3 Bright
		LTBR G 1 Bright Offset (0,34) A_FireCustomMissile("SunProjectile", 0, 1, 0, 0)
		LTBR G 1 Bright Offset (0,40) A_SetPitch(Pitch-1.5)
		LTBR G 1 Bright Offset (0,46) A_SetPitch(Pitch+0.5)
		LTBR H 1 Bright Offset (0,52) A_SetPitch(Pitch+0.5)
		LTBR H 1 Bright Offset (0,48) A_SetPitch(Pitch+0.5)
		LTBR H 1 Bright Offset (0,44)
		LTBR I 1 Bright Offset (0,40)
		LTBR I 1 Bright Offset (0,36)
		LTBR I 1 Bright Offset (0,32)
		LTBR BCD 3 Bright
		LTBR A 0 A_Refire
		LTBR I 0 A_JumpIfInventory("Mana2", 5, 1)
		Goto NoAmmo
		LTBR I 0
		Goto Ready+4
	NoAmmo:
		LTBR ON 4 Bright
		Goto Ready2
	Deselect2:
		TNT1 M 0 A_Lower
		LTBR M 1 A_Lower
		Loop
	Ready2:
		LTBR M 0 A_StopSoundEx("SoundSlot7")
		LTBR M 0 A_JumpIfInventory("Mana2", 5, "Ready")
		LTBR M 1 A_WeaponReady
		Loop
	AltFire:
		LTBR F 0 A_PlayWeaponSound("ClericLightBringerFire") 
		LTBR G 1 Bright Offset (0,34) A_PlaySoundEx("Weapons/SunStaffhit", "SoundSlot7", 0)
		LTBR G 1 Bright Offset (0,37)
		LTBR H 1 Bright Offset (0,40) A_PlaySoundEx("Weapons/SunStaffhit", "SoundSlot7", 0)
		LTBR H 1 Bright Offset (0,43)
		LTBR I 1 Bright Offset (0,46) A_PlaySoundEx("Weapons/SunStaffhit", "SoundSlot7", 0)
		LTBR I 1 Bright Offset (0,49)
	AltHold:
		LTBR F 2 Bright Offset (0,52) A_FireCustomMissile("SunProjectile2", 0, 1, 0, 0)
		LTBR G 2 Bright Offset (0,52) A_FireCustomMissile("SunProjectile2", 0, 0, 0, 0)
		LTBR H 2 Bright Offset (0,52) A_FireCustomMissile("SunProjectile2", 0, 0, 0, 0)
		LTBR I 2 Bright Offset (0,52) A_FireCustomMissile("SunProjectile2", 0, 0, 0, 0)
		LTBR A 0 A_Refire
		LTBR B 1 Bright Offset (0,49) A_StopSoundEx("SoundSlot7")
		LTBR B 1 Bright Offset (0,46)
		LTBR C 1 Bright Offset (0,43)
		LTBR C 1 Bright Offset (0,40)
		LTBR D 1 Bright Offset (0,37)
		LTBR D 1 Bright Offset (0,34)
		LTBR I 0 A_JumpIfInventory("Mana2", 5, 1)
		Goto NoAmmo
		LTBR I 0
		Goto Ready+4
	}
}

Actor SunProjectile : FastProjectile
{
	Radius 16
	Height 8
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(150,180), INTELLECT, 0, WOCTARGET))
	Damagetype "Holy"
	Alpha 1.0
	Scale 1.25
	Renderstyle Add
	BounceFactor 1.0
	Projectile
	+CanBounceWater
	+ForceXYBillboard
	+MTHRUSPECIES /*+NODAMAGETHRUST*/
	+DONTBLAST
	speed 120
	//Reactiontime 100
	SeeSound "Weapons/Lightbringer/Bounce"
	States
	{
	Spawn:
		SUNP AB 1 Bright A_SpawnItemEx("SunProjectileTrail", -2/10, 0, 0, 0, 0, 0, 0, 138)
		Loop
	Death:
		SUNP A 0 A_StopSoundEx("SoundSlot7")
		SUNP A 0 A_Stop
		SUNP CDEFGH 2 Bright
		Stop
	}
}

Actor SunProjectileTrail
{
	Height 2
	Radius 6
	Damage 0
	Speed 0.2
	RenderStyle Add
	Alpha 0.9
	Scale 1.5
	+ForceXYBillBoard
	+NoGravity
	+ClientsideOnly
	+NoInteraction
	+DropOff
	States
	{
	Spawn:
		SUNP A 2 Bright A_FadeOut(0.2)
		Loop
	}
}

Actor SunProjectile2
{
	Radius 4
	Height 6
	Damage (ACS_NamedExecuteWithResult("WOC Player Scale", FRandom(10,25), INTELLECT, 0, WOCTARGET))
	Damagetype "Holy"
	Alpha 1.0
	Renderstyle Add
	Projectile
	+ForceXYBillboard
	+MTHRUSPECIES /*+NODAMAGETHRUST*/
	+DONTBLAST
	speed 55
	Scale 0.4
	//Reactiontime 100
	SeeSound "forcecube/fire"
	DeathSound "Weapons/Lightbringer/2HIT"
	States
	{
	Spawn:
		SUP2 A 0 Bright
		SUP2 AAAABBBBCCCCDDDDEEEEFFFF 1 Bright A_SpawnItemEx("SunProjectileTrail2",  -(MomX/1.2), -(MomY/1.2), (MomZ/1.2*-1), (MomX/1.2), (MomY/1.2), (MomZ/1.2), 0, 138)
		Loop
	Death:
		TNT1 A 0 A_StopSoundEx("SoundSlot7")
		SUP2 AAAABBBBCCCCDDDD 1 Bright A_FadeOut(0.05)
		Stop
	}
}

Actor SunProjectileTrail2
{
	Height 2
	Radius 6
	Damage 0
	RenderStyle Add
	Alpha 0.6
	Scale 0.4
	PROJECTILE
	+ForceXYBillBoard
	+NoGravity
	+ClientsideOnly
	+DropOff
	States
	{
	Spawn:
		SUP2 AAAABBBBCCCCDDDDEEEEFFFF 1 Bright A_FadeOut(0.1)
		Stop
	}
}