Actor ResPistol1 : Weapon {
	Weapon.SelectionOrder 1000
	Weapon.SlotNumber 2
    Inventory.PickupSound "weapons/pickup"
    Inventory.PickupMessage "You got the assault rifle!"	
    Obituary "%o was gunned down by %k's assault rifle"
	Weapon.AmmoType1 "Clip"
	Weapon.AmmoType2 "MGClip5"
	Weapon.AmmoUse2 0
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Decal "BulletChip"
	+WEAPON.NOALERT
	AttackSound ""
	+INVENTORY.UNDROPPABLE
	Tag "Assault Rifle"
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 2.0
	Weapon.BobRangeY 0.45
	Weapon.BobRangeX 0.75
	States {
		Spawn:
			4AFL A -1
		Stop
		Ready:
			TNT1 A 0 A_JumpIfInventory("WeaponZoom", 1, "ReadyZoom")
			4AFG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		Loop
		ReadyZoom:
			4A2G A 1 A_WeaponReady(WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
		Goto Ready
		Deselect:
		    TNT1 A 0 A_TakeInventory("WeaponZoom", 1)
			TNT1 A 0 A_ZoomFactor(1.0, ZOOM_NOSCALETURNING)
			TNT1 A 0 A_TakeInventory("H_WeaponSlot2", 1)
			4AFG A 1 A_Lower
			TNT1 A 0 A_Lower
		Loop
		Select:
			TNT1 A 0 A_GiveInventory("H_WeaponSlot2", 1)
			TNT1 A 0 A_TakeInventory("DnD_WeaponID", 0x7FFFFFFF)
			TNT1 A 0 A_GiveInventory("DnD_WeaponID", DND_WEAPON_ASSAULTRIFLE)
			TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_0, 30)
	    SelectLoop:
			4AFG A 1 A_Raise
			TNT1 A 0 A_Raise
		Loop
		Fire:
			TNT1 A 0 A_GiveInventory("DnD_UsedNonSpecial", 1)
			TNT1 A 0 A_JumpIfInventory("ArtemisCheck", 1, "FireContinue")
			TNT1 A 0 A_JumpIfInventory("MGClip5", 1, "FireContinue")
		Goto Reload
		FireContinue:
			TNT1 A 0 A_JumpIfInventory("WeaponZoom", 1, "FireZoom")
			4AFF A 1 Bright A_AlertMonsters
			TNT1 A 0 A_PlayWeaponSound("AssaultRifle/fire")
			TNT1 A 0 A_GiveInventory("AssaultRifleShooter", 1)
			4AFF A 1 Bright
			TNT1 A 0 A_SetPitch(pitch - (frandom(0.5, 1.2)), SPF_INTERPOLATE)
			TNT1 A 0 A_SpawnItemEx ("bulletcasing",cos(pitch)*20,6,32+(sin(-pitch)*16),0,8,random(4,8),0,0,0)
			4AFF B 1
			TNT1 A 0 A_SetPitch(pitch + 0.25, SPF_INTERPOLATE)
			4AFF C 1
			TNT1 A 0 A_SetPitch(pitch + 0.25, SPF_INTERPOLATE)
			4AFG A 1 A_Refire
		Goto Ready
		FireZoom:
			4A2F A 1 Bright A_AlertMonsters
			TNT1 A 0 A_PlayWeaponSound("AssaultRifle/fire")
			TNT1 A 0 A_GiveInventory("AssaultRifleShooter", 1)
			4A2F B 1 Offset(0, 33)
			TNT1 A 0 A_SetPitch(pitch - (frandom(0.5, 1.2)), SPF_INTERPOLATE)
			4A2F B 1 Offset(0, 34)
			TNT1 A 0 A_SetPitch(pitch + 0.25, SPF_INTERPOLATE)
			TNT1 A 0 A_SpawnItemEx ("bulletcasing",cos(pitch)*20,6,32+(sin(-pitch)*16),0,8,random(4,8),0,0,0)
			4A2G A 1 Offset(0, 33)
			TNT1 A 0 A_SetPitch(pitch + 0.25, SPF_INTERPOLATE)
			4A2G A 1 Offset(0, 32)
		Goto Ready
		AltFire:
			TNT1 A 0 A_GiveInventory("DnD_UsedNonSpecial", 1)
			TNT1 A 0 A_JumpIfInventory("WeaponZoomCooldown", 1, "Failed")
			TNT1 A 0 A_JumpIfInventory("WeaponZoom", 1, "RevertZoom")
		ForceZoom:
		    TNT1 A 0 A_GiveInventory("WeaponZoom", 1)
			TNT1 A 0 A_PlaySound("Weapons/Scope")
			4AFZ A 1 Offset(0,35) A_ZoomFactor(2.0, ZOOM_NOSCALETURNING)
			4AFZ B 1 Offset(0,32)
			4AFZ C 1 A_GiveInventory("WeaponZoomCooldown", 1)
			4AFZ D 1 Offset(0,35)
			4AFZ A 1 Offset(0,33)
		Goto Ready
		RevertZoom:
		    TNT1 A 0 A_TakeInventory("WeaponZoom", 1)
			TNT1 A 0 A_PlaySound("Weapons/Scope")
			4AFZ D 1 A_ZoomFactor(1.0, ZOOM_NOSCALETURNING)
			4AFZ C 1 Offset(0,35)
			4AFZ B 1 Offset(0,32)
			TNT1 A 0 A_GiveInventory("WeaponZoomCooldown", 1)
			4AFZ A 1 Offset(0,35)
			4AFG A 1 Offset(0,32)
		Goto Ready
		Reload:
			TNT1 A 0 A_JumpIfInventory("Clip", 1, "ContinueReload")
			4AFG A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
		Goto Ready
		ContinueReload:
			TNT1 A 0 A_JumpIfInventory("MGClip5", 0, "Failed")
			TNT1 A 0 A_ZoomFactor(1.0, ZOOM_NOSCALETURNING)
			TNT1 A 0 A_JumpIfInventory("Ability_Reloader", 1, "ReloadFaster")
			4AFR ABCDE 1
			TNT1 A 0 A_FireCustomMissile("MGClip2Drop", frandom(-12.0, 12.0), 0, 0, 0)
			TNT1 A 0 A_PlayWeaponSound("AssaultRifle/Out")
			4AFR F 2
			4AFR G 10
			4AFR HIJ 2
			TNT1 A 0 ACS_ExecuteAlways(998, 0, 4)
			4AFR K 3 A_PlayWeaponSound("AssaultRifle/In")
			4AFR LMNOPQRS 1
			4AFG A 1
			4AFG A 1 A_JumpIfInventory("WeaponZoom", 1, "ForceZoom")
		Goto Ready
		Failed:
			TNT1 A 0 A_JumpIfInventory("WeaponZoom", 1, "ZoomedFailed")
			4AFG A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
		Goto Ready
		ZoomedFailed:
			4A2G A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
		Goto Ready
		
		ReloadFaster:
			4AFR ACE 1
			TNT1 A 0 A_FireCustomMissile("MGClip2Drop", frandom(-12.0, 12.0), 0, 0, 0)
			TNT1 A 0 A_PlayWeaponSound("AssaultRifle/Out")
			4AFR F 1
			4AFR G 5
			4AFR HIJ 1
			TNT1 A 0 ACS_ExecuteAlways(998, 0, 4)
			4AFR K 1 A_PlayWeaponSound("AssaultRifle/In")
			4AFR LMOQS 1
			4AFG A 1 A_JumpIfInventory("WeaponZoom", 1, "ForceZoom")
		Goto Ready
		Flash:
		  TNT1 A 4 A_Light1
		  TNT1 A 3 A_Light2
		  TNT1 A 0 A_Light0
		  stop
	}
}

Actor AssaultRifleShooter : DND_Activator {
	states {
		Use:
			TNT1 A 0 A_SpawnItemEx("GunSmokeSmaller", 18 * cos(-pitch), 0, 32 * (1 + sin(-pitch)), 0, 0, 1)
			TNT1 A 0 A_SpawnItemEx ("chaingunsmoke",cos(-pitch)*20,2,36+(sin(-pitch)*20),cos(-pitch)*0,0,0,0,0,0)
			TNT1 A 0 A_JumpIfInventory("ArtemisCheck", 1, "NoTake")
			TNT1 A 0 A_TakeInventory("MGClip5", 1)
		NoTake:
			TNT1 A 0 A_JumpIfInventory("WeaponZoom", 1, "ZoomFire")
			TNT1 A 0 A_FireCustomMissile("Tracer", frandom(-2, 2), 0, 0, frandom(-2, 2))
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireBullets(3.6, 2.4, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC, DND_ISPISTOL), "NewBulletPuff", FBF_NORANDOM | FBF_USEAMMO)
			Stop
		Full:
			TNT1 A 0 A_FireBullets(3.6, 2.4, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC, DND_ISPISTOL), "NewBulletPuff_FullDMG", FBF_NORANDOM | FBF_USEAMMO)
			Stop
		ZoomFire:
			TNT1 A 0 A_FireCustomMissile("Tracer", 0, 0, 0, 0)
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "FullZoom")
			TNT1 A 0 A_FireBullets(0.1, 0.1, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC, DND_ISPISTOL), "NewBulletPuff", FBF_NORANDOM | FBF_USEAMMO)
			Stop
		FullZoom:
			TNT1 A 0 A_FireBullets(0.1, 0.1, -1, ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_BALLISTIC, DND_ISPISTOL), "NewBulletPuff_FullDMG", FBF_NORANDOM | FBF_USEAMMO)
			Stop
	}
}

Actor ResPistol2 : Weapon {
	Weapon.SelectionOrder 1000
	Weapon.SlotNumber 2
    Inventory.PickupSound "weapons/pickup"
    Inventory.PickupMessage "You got the Viper Staff!"	
    Obituary "%o was afraid of %k's snakes!"
	Weapon.AmmoType "ViperAmmo"
	Weapon.AmmoUse 0
	Weapon.AmmoGive 0
	AttackSound ""
	+INVENTORY.UNDROPPABLE
	Tag "Viper Staff"
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 1.5
	Weapon.BobRangeY 0.35
	Weapon.BobRangeX 0.55
	States {
		Spawn:
			VIPA Z -1
		Stop
		Deselect:
			TNT1 A 0 A_TakeInventory("P_GreenFire", 1)
			TNT1 A 0 A_TakeInventory("H_WeaponSlot2", 1)
		DeselectLoop:
			C_H_ U 1 A_Lower
			TNT1 A 0 A_Lower
		Loop
		Select:
			TNT1 A 0 A_GiveInventory("P_GreenFire", 1)
			TNT1 A 0 A_GiveInventory("H_WeaponSlot2", 1)
			TNT1 A 0 A_TakeInventory("DnD_WeaponID", 0x7FFFFFFF)
			TNT1 A 0 A_GiveInventory("DnD_WeaponID", DND_WEAPON_VIPERSTAFF)
			TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_0, 20, 3 | (5 << 16))
			TNT1 A 0 ACS_NamedExecuteAlways("DND Weapon Damage Cache", 0, DND_DMGID_1, 6, 15 | (25 << 16))
		SelectLoop:
			C_H_ Z 1 A_Raise
			TNT1 A 0 A_Raise
		Loop
		Ready:
			C_H_ Z 3 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
			C_H_ L 1 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
			TNT1 A 0 A_Playsound("ViperStaff/Scream", CHAN_WEAPON)
			C_H_ L 2 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE) 
			C_H_ M 1 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
			C_H_ M 2 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)	
			C_H_ N 1 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
			C_H_ N 2 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)	
			C_H_ OYXW 4 A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
		Goto LoopReady
		LoopReady:
			C_H_ V 1 A_WeaponReady
		Loop
		Fire:
			TNT1 A 0 A_JumpIfInventory("ArtemisCheck", 1, "ContinueFire")
			TNT1 A 0 A_JumpIfInventory("ViperAmmo", 1, "ContinueFire")
		Goto Finish
		ContinueFire:
			C_H_ U 1 Offset(-4, 32)
			C_H_ U 1 Offset(-8, 36)
			C_H_ U 1 Offset(-12, 38)
			C_H_ U 1 Offset(-16, 40)
		Hold:	
			TNT1 A 0 A_JumpIfInventory("ArtemisCheck", 1, "ContinueHold")
			TNT1 A 0 A_JumpIfInventory("ViperAmmo", 1, "ContinueHold")
		Goto Finish
		ContinueHold:
			C_H_ A 1 Offset(0, 32) Bright
			C_H_ B 4 Offset(0, 32) Bright A_PlaySound("ViperStaff/Charge", CHAN_BODY)
			C_H_ C 4 Offset(0, 32) Bright
			C_H_ D 3 Offset(0, 32) Bright
			TNT1 A 0 A_PlaySound("ViperStaff/Fire", CHAN_WEAPON)	
			C_H_ E 2 Offset(0, 32) BRIGHT
			C_H_ F 1 Offset(0, 32) BRIGHT A_GiveInventory("ViperShooter1", 1)
			TNT1 A 0 A_Recoil(5)
			TNT1 A 0 A_SpawnItemEx("GreenSmallFlash", 55, 0, 40, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
			C_H_ F 1 offset(0, 38) Bright
			C_H_ F 1 offset(0, 39) Bright
			C_H_ G 3 offset(0, 37) Bright
			C_H_ G 2 offset(0, 40) Bright
			C_H_ G 1 offset(0, 38) Bright
			C_H_ G 1 offset(0, 36) Bright
			C_H_ G 1 offset(0, 30) Bright
			C_H_ G 1 offset(0, 26) Bright A_Refire
			C_H_ U 1  Offset(-16, 40)
			C_H_ U 1  Offset(-12, 38)
			C_H_ U 1 Offset(-8, 36)
			C_H_ U 1 Offset(-4, 32)
		Goto LoopReady
		Finish:
			C_H_ V 2 A_WeaponReady(WRF_NOFIRE)
		Goto LoopReady
		AltFire:
			TNT1 A 0 A_JumpIfInventory("ArtemisCheck", 1, "ContinueAlt")
			TNT1 A 0 A_JumpIfInventory("ViperAmmo", 1, "ContinueAlt")
		Goto Finish
		ContinueAlt:
			C_H_ U 1 Offset(-4, 32)
			C_H_ U 1 Offset(-8, 36)
			C_H_ U 1 Offset(-12, 38)
			C_H_ U 1 Offset(-16, 40)
			C_H_ A 1 Offset(0, 32) Bright
			C_H_ B 4 Offset(0, 32) Bright A_PlaySound("ViperStaff/Charge", CHAN_BODY)
			C_H_ C 4 Offset(0, 32) Bright
			C_H_ D 3 Offset(0, 32) Bright
			TNT1 A 0 A_PlaySound("ViperStaff/Fire", CHAN_WEAPON)	
			C_H_ E 2 Offset(0, 32) BRIGHT
			C_H_ F 1 Offset(0, 32) BRIGHT A_GiveInventory("ViperShooter2", 1)
			TNT1 A 0 A_Recoil(5)
			TNT1 A 0 A_SpawnItemEx("GreenSmallFlash", 55, 0, 40, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
			C_H_ F 1 offset(0, 38) Bright
			C_H_ F 1 offset(0, 39) Bright
			C_H_ G 3 offset(0, 37) Bright
			C_H_ G 2 offset(0, 40) Bright
			C_H_ G 1 offset(0, 38) Bright
			C_H_ G 1 offset(0, 36) Bright
			C_H_ G 1 offset(0, 30) Bright
			C_H_ G 1 offset(0, 26) Bright A_Refire
			C_H_ U 1  Offset(-16, 40)
			C_H_ U 1  Offset(-12, 38)
			C_H_ U 1 Offset(-8, 36)
			C_H_ U 1 Offset(-4, 32)
		Goto LoopReady
	}
}

Actor ViperShooter1 : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("ArtemisCheck", 1, "NoTake")
			TNT1 A 0 A_TakeInventory("ViperAmmo", 1)
		NoTake:
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_SpawnItemEx("ViperCrawler", 24, 0, 12, 0, 0, 0, 0, SXF_SETMASTER)
		Stop
		Full:
			TNT1 A 0 A_SpawnItemEx("ViperCrawler_FullDMG", 24, 0, 12, 0, 0, 0, 0, SXF_SETMASTER)
		Stop
	}
}

Actor ViperShooter2 : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("ArtemisCheck", 1, "NoTake")
			TNT1 A 0 A_TakeInventory("ViperAmmo", 1)
		NoTake:
			TNT1 A 0 A_JumpIfInventory("NetherCheck", 1, "Full")
			TNT1 A 0 A_FireCustomMissile("ViperMissile")
		Stop
		Full:
			TNT1 A 0 A_FireCustomMissile("ViperMissile_FullDMG")
		Stop
	}
}

Actor ViperTrail1 {
	Scale 0.875
	+NOINTERACTION
	+CLIENTSIDEONLY
	States {
		Spawn:
			C_H2 B 2
		Stop
	}
}

Actor ViperTrail2 : ViperTrail1 {
	Scale 0.8
}

Actor ViperTrail3 : ViperTrail1 {
	Scale 0.725
}

Actor ViperTrail4 : ViperTrail1 {
	Scale 0.65
}

Actor ViperTrail5 : ViperTrail1 {
	Scale 0.525
}

Actor ViperTrail6 : ViperTrail1 {
	Scale 0.45
}

Actor ViperTrail7 : ViperTrail1 {
	Scale 0.325
}

Actor ViperTrail8 : ViperTrail1 {
	Scale 0.25
}

Actor ViperCrawler {
	MONSTER
	DamageType "AcidRifle"
	Species "Player"
	+DONTHARMSPECIES
	-COUNTKILL
	+FRIENDLY
	+LOOKALLAROUND
	-SHOOTABLE
	-SOLID
	-TELESTOMP
	+NOTELEPORT
	+NOTARGET
	Gravity 1.5
	MaxStepHeight 32
	Speed 12
	Height 16
	Radius 8
	MeleeRange 52
	MaxTargetRange 104
	Scale 0.725
	var int user_count;
	var int user_jumpcd;
	const int jumpcd = 9;
	States {
		Spawn:
			C_H2 A 1 NoDelay A_SetUserVar("user_count", 0)
			TNT1 A 0 A_PlaySound("ViperStaff/Viper")
			TNT1 A 0 ThrustThing(angle * 256 / 360, 18, 0, 0)
			TNT1 A 0 ThrustThingZ(0, 30, 0, 0)
			TNT1 A 0 ACS_NamedExecuteAlways("DnD Timed Monster", 0, 10)
		Idle:
			C_H2 A 1 A_Wander
			TNT1 A 0 A_Look
			TNT1 A 0 A_Weave(1.5, 0, 6.0, 0)
			TNT1 A 0 A_SpawnItemEx("ViperTrail1", -4, 6 * sin(user_count * 9), 5)
			TNT1 A 0 A_SpawnItemEx("ViperTrail2", -11, 7 * sin(user_count * 12), 3)
			TNT1 A 0 A_SpawnItemEx("ViperTrail3", -18, 8 * sin(user_count * 15), 2)
			TNT1 A 0 A_SpawnItemEx("ViperTrail4", -23, 9 * sin(user_count * 18), 1)
			TNT1 A 0 A_SpawnItemEx("ViperTrail5", -27, 10 * sin(user_count * 21))
			TNT1 A 0 A_SpawnItemEx("ViperTrail6", -31, 11 * sin(user_count * 24))
			TNT1 A 0 A_SpawnItemEx("ViperTrail7", -32, 12 * sin(user_count * 27))
			TNT1 A 0 A_SpawnItemEx("ViperTrail8", -33, 13 * sin(user_count * 30))
			TNT1 A 0 A_SetUserVar("user_count", (user_count + 1) % 40)
		Loop
		See:
			C_H2 A 1 A_Chase("Melee", "Missile", CHF_NOPLAYACTIVE)
			TNT1 A 0 A_Weave(1.5, 0, 6.0, 0)
			TNT1 A 0 A_SpawnItemEx("ViperTrail1", -4, 6 * sin(user_count * 9), 5)
			TNT1 A 0 A_SpawnItemEx("ViperTrail2", -11, 7 * sin(user_count * 12), 3)
			TNT1 A 0 A_SpawnItemEx("ViperTrail3", -18, 8 * sin(user_count * 15), 2)
			TNT1 A 0 A_SpawnItemEx("ViperTrail4", -23, 9 * sin(user_count * 18), 1)
			TNT1 A 0 A_SpawnItemEx("ViperTrail5", -27, 10 * sin(user_count * 21))
			TNT1 A 0 A_SpawnItemEx("ViperTrail6", -31, 11 * sin(user_count * 24))
			TNT1 A 0 A_SpawnItemEx("ViperTrail7", -32, 12 * sin(user_count * 27))
			TNT1 A 0 A_SpawnItemEx("ViperTrail8", -33, 13 * sin(user_count * 30))
			TNT1 A 0 A_SetUserVar("user_count", (user_count + 1) % 40)
		Goto See
		SeeNoChase:
			TNT1 A 0 A_JumpIf(user_jumpcd == jumpcd, "See")
			C_H2 A 1 A_Chase("Melee", "", CHF_NOPLAYACTIVE)
			TNT1 A 0 A_Weave(1.5, 0, 6.0, 0)
			TNT1 A 0 A_SpawnItemEx("ViperTrail1", -4, 6 * sin(user_count * 9), 5)
			TNT1 A 0 A_SpawnItemEx("ViperTrail2", -11, 7 * sin(user_count * 12), 3)
			TNT1 A 0 A_SpawnItemEx("ViperTrail3", -18, 8 * sin(user_count * 15), 2)
			TNT1 A 0 A_SpawnItemEx("ViperTrail4", -23, 9 * sin(user_count * 18), 1)
			TNT1 A 0 A_SpawnItemEx("ViperTrail5", -27, 10 * sin(user_count * 21))
			TNT1 A 0 A_SpawnItemEx("ViperTrail6", -31, 11 * sin(user_count * 24))
			TNT1 A 0 A_SpawnItemEx("ViperTrail7", -32, 12 * sin(user_count * 27))
			TNT1 A 0 A_SpawnItemEx("ViperTrail8", -33, 13 * sin(user_count * 30))
			TNT1 A 0 A_SetUserVar("user_count", (user_count + 1) % 40)
			TNT1 A 0 A_SetUserVar("user_jumpcd", user_jumpcd + 1)
		Loop
		Missile:
			TNT1 A 0 A_FaceTarget
			TNT1 A 0 A_PlaySound("ViperStaff/ViperAttack")
			TNT1 A 0 ThrustThingZ(0, 32, 0, 0)
			TNT1 A 0 ThrustThing(angle * 256 / 360, 24, 0, 0)
			TNT1 A 0 A_SetUserVar("user_jumpcd", 0)
		Goto SeeNoChase
		Melee:
			TNT1 A 0 A_Stop
			TNT1 A 0 A_PlaySound("Weapons/ViperExp", CHAN_BODY)
			TNT1 A 0 A_PlaySound("Weapons/ViperExp2", CHAN_VOICE)
			TNT1 AAAAA 0 A_SpawnItemEx("ExplosionFXMagicGreen", 0, 0, 0, frandom(-2.5, 2.5), frandom(-2.5, 2.5), frandom(-2.5, 2.5))
			TNT1 A 0 A_ClearTarget
			TNT1 A 5 A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_ELEMENTAL, DND_USEMASTER | DND_SETMASTER | DND_ISPISTOL), 128, 0, 0, 128)
		Stop
		Remove:
			TNT1 A 0 A_Stop
			TNT1 A 0 A_PlaySound("Weapons/ViperExp", CHAN_AUTO)
			TNT1 AAAAA 0 A_SpawnItemEx("ExplosionFXMagicGreen", 0, 0, 0, frandom(-2.5, 2.5), frandom(-2.5, 2.5), frandom(-2.5, 2.5))
			TNT1 A 0 A_ClearTarget
			TNT1 A 5 A_Explode(ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_0, TALENT_ELEMENTAL, DND_USEMASTER | DND_SETMASTER | DND_ISPISTOL), 128, 0, 0, 128)
		Stop
	}
}

Actor ViperCrawler_FullDMG : ViperCrawler {
	DamageType "AcidRifleFull"
	+FORCERADIUSDMG
}

Actor ViperMissile {
	PROJECTILE
	Height 10
	Radius 5
	Damage (ACS_NamedExecuteWithResult("DND Weapon Damage Retrieve", DND_DMGID_1, TALENT_ELEMENTAL, DND_USETARGET | DND_ISPISTOL))
	DamageType "AcidRifle"
	Speed 30
	Scale 0.725
	var int user_count;
	SeeSound "ViperStaff/Viper"
	DeathSound "Weapons/ViperExp"
	+FOILINVUL
	+THRUGHOST
	States {
		Spawn:
			TNT1 A 0 NoDelay A_SetUserVar("user_count", 0)
		SpawnLoop:
			C_H2 A 1 A_Weave(1.5, 0, 4.5, 0)
			TNT1 A 0 A_SpawnItemEx("ViperTrail1", -4, 6 * sin(user_count * 9), 5)
			TNT1 A 0 A_SpawnItemEx("ViperTrail2", -11, 7 * sin(user_count * 12), 3)
			TNT1 A 0 A_SpawnItemEx("ViperTrail3", -18, 8 * sin(user_count * 15), 2)
			TNT1 A 0 A_SpawnItemEx("ViperTrail4", -23, 9 * sin(user_count * 18), 1)
			TNT1 A 0 A_SpawnItemEx("ViperTrail5", -27, 10 * sin(user_count * 21))
			TNT1 A 0 A_SpawnItemEx("ViperTrail6", -31, 11 * sin(user_count * 24))
			TNT1 A 0 A_SpawnItemEx("ViperTrail7", -32, 12 * sin(user_count * 27))
			TNT1 A 0 A_SpawnItemEx("ViperTrail8", -33, 13 * sin(user_count * 30))
			TNT1 A 0 A_SetUserVar("user_count", (user_count + 1) % 40)
		Loop
		Death:
			TNT1 AAAAA 0 A_SpawnItemEx("ExplosionFXMagicGreen", 0, 0, 0, frandom(-2.5, 2.5), frandom(-2.5, 2.5), frandom(-2.5, 2.5))
			TNT1 A 1
		Stop
	}
}

Actor ViperMissile_FullDMG : ViperMissile {
	DamageType "AcidRifleFull"
	-THRUGHOST
}