actor SniperBossWeapon : MegaBuster
{
tag "Tribesman's Shiv / Arrow Bazooka"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 1
Obituary "$OB_SHIV"
+INVENTORY.UNDROPPABLE
weapon.ammotype "BossJumpCharge"
weapon.ammotype2 "BossRageCharge"
+WEAPON.AMMO_OPTIONAL
Scale 2.0
States
{
Spawn:
TNT1 A 0
stop

Ready:
SXH1 S 0 ACS_NamedExecuteAlways("GiveExecution",0)
SXH1 A 0 ACS_ExecuteAlways(991,0,503)
SXH1 S 1 A_WeaponReady(WRF_NOSWITCH)
SXH1 S 0 A_GunFlash
SXH1 S 1 A_WeaponReady(WRF_NOSWITCH)
Goto Ready2
Ready2:
SXH1 A 0 ACS_ExecuteAlways(991,0,503)
SXH1 S 1 A_WeaponReady(WRF_NOSWITCH)
loop

Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
SXH1 S 1 A_Lower
loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
SXH1 S 1 A_Raise
Loop

Fire:
SXH1 S 0 A_JumpIfInventory("CBSHuntsmanMode",1,"RageFireCheck")
SXH1 TU 1
SXH1 U 0 A_PlaySoundEx("weapon/chargekick","Weapon")
SXH1 U 0 A_FireCustomMissile("SniperShiv",0,1,0,0)
SXH1 V 2
SXH1 W 1 Offset(0,32)
SXH1 W 1 Offset(0,46)
SXH1 W 1 Offset(0,58)
SXH1 W 1 Offset(0,70)
SXH1 W 1 Offset(0,82)
SXH1 W 1 Offset(0,94)
SXH1 W 1 Offset(0,108)
TNT1 A 23
SXH1 S 1 Offset(60, 200)
SXH1 S 1 Offset(40, 125)
SXH1 S 1 Offset(20, 50)
SXH1 A 0 A_Refire
Goto Ready2
RageFireCheck:
SXH1 E 0 A_JumpIfInventory("CBSHuntsman",1,"RageFire")
SXH1 E 0 A_PlaySoundEx("item/ItemUseMM9","Weapon")
goto BackToSlashing
RageFire:
SXH1 E 0 A_TakeInventory("CBSHuntsman", 1)
SXH1 E 0 A_PlaySoundEx("weapon/thunderbolt","Weapon")
SXH1 E 0 A_FireCustomMissile("TheHuntsman",0,1,8,0)
SXH2 FG 10
SXH2 A 24
SXH2 BCDE 3
goto HasArrowReady

AltFire:
SXH1 S 0 A_JumpIfInventory("BossRageCharge",500,"Rage")
SXH1 E 0 A_JumpIfInventory("CBSHuntsman",1,1)
Goto Ready2
SXH1 S 1 Offset(0,40) 
SXH1 S 1 Offset(0,80) 
SXH1 S 1 Offset(0,120) 
SXH1 S 1 Offset(0,160) 
TNT1 A 1 ACS_NamedExecute("StateChange",0,3) //CustomState 1
ABHU D 1 Offset(0,160) ACS_NamedExecute("StateChange",0,3) //CustomState 1
ABHU C 1 Offset(0,120) ACS_NamedExecute("StateChange",0,3) //CustomState 1
ABHU B 1 Offset(0,80) ACS_NamedExecute("StateChange",0,3) //CustomState 1
ABHU A 1 Offset(0,40) ACS_NamedExecute("StateChange",0,3) //CustomState 1
BazookaFire:
SXH1 E 0 A_JumpIfInventory("CBSHuntsman",1,1)
goto BazookaEnd
ABHU AAAAAAAAAAAAAA 1 ACS_NamedExecute("StateChange",0,3) //CustomState 1
ABHU A 1 A_WeaponReady(14)
ABHU A 0 ACS_NamedExecute("StateChange",0,4) //CustomState 2
ABHU A 0 A_PlaySoundEx("weapon/AutoFirework","Weapon")
SXH1 E 0 A_TakeInventory("CBSHuntsman", 1)
SXH1 E 0 A_FireCustomMissile("BazookaArrow",random(-3,3),1,8,0,0,random(-1,3))
SXH1 E 0 A_JumpIfInventory("CBSHuntsman",1,2)
SXH1 E 0 A_Jump(256,3)
SXH1 E 0 A_TakeInventory("CBSHuntsman", 1)
SXH1 E 0 A_FireCustomMissile("BazookaArrow",random(-3,3),1,8,0,0,random(-1,3))
SXH1 E 0 A_JumpIfInventory("CBSHuntsman",1,2)
SXH1 E 0 A_Jump(256,3)
SXH1 E 0 A_TakeInventory("CBSHuntsman", 1)
SXH1 E 0 A_FireCustomMissile("BazookaArrow",random(-3,3),1,8,0,0,random(-1,3))
SXH1 E 0 A_JumpIfInventory("CBSHuntsman",1,2)
SXH1 E 0 A_Jump(256,3)
SXH1 E 0 A_TakeInventory("CBSHuntsman", 1)
SXH1 E 0 A_FireCustomMissile("BazookaArrow",random(-3,3),1,8,0,0,random(-1,3))
ABHU BDDCBAAA 2
ABHU A 0 A_Refire("BazookaFire")
BazookaEnd:
ABHU D 1 Offset(0,40)
ABHU C 1 Offset(0,80)
ABHU B 1 Offset(0,120)
ABHU A 1 Offset(0,160)
TNT1 A 1
SXH1 S 1 Offset(0,160)
SXH1 S 1 Offset(0,120)
SXH1 S 1 Offset(0,80)
SXH1 S 1 Offset(0,40)
goto Ready2
//SXH1 S 0 A_PlaySoundEx("item/ItemUseMM9","Weapon")
//SXH1 S 0 A_JumpIfInventory("CBSHuntsmanMode",1,"BackToSlashing")
//SXH1 S 0 A_GiveInventory("CBSHuntsmanMode", 1)
//SXH1 S 0 A_JumpIfInventory("CBSHuntsman",1,"HasArrow")
//goto UselessArrow //Good night sweet Huntsman, you lived well.
UselessArrow:
SXH1 S 1 Offset(0,32)
SXH1 S 1 Offset(0,58)
SXH1 S 1 Offset(0,82)
SXH1 S 1 Offset(0,108)
SXH2 F 1 Offset(0,82)
SXH2 F 1 Offset(0,58)
SXH2 F 1 Offset(0,32)
UselessArrowReady:
SXH2 D 0 A_JumpIfInventory("CBSHuntsman",1,"HasArrowMid")
SXH2 F 0 //A_Jumpif(ACS_ExecuteWithResult(812)==1,"BeginRage")
SXH2 F 1 A_WeaponReady(WRF_NOSWITCH)
goto UselessArrowReady
HasArrow:
SXH2 A 1 Offset(0,108)
SXH2 A 1 Offset(0,82)
SXH2 A 1 Offset(0,58)
SXH2 A 1 Offset(0,32)
HasArrowMid:
SXH2 BC 1
SXH2 D 1
HasArrowReady:
SXH2 D 0 A_JumpIfInventory("CBSHuntsman",1,1)
goto UselessArrowReady
SXH2 D 0 //A_Jumpif(ACS_ExecuteWithResult(812)==1,"BeginRage")
SXH2 D 1 A_WeaponReady(WRF_NOSWITCH)
goto HasArrowReady
BackToSlashing:
SXH1 S 0 A_TakeInventory("CBSHuntsmanMode",999)
SXH2 F 1 Offset(0,32)
SXH2 F 1 Offset(0,58)
SXH2 F 1 Offset(0,82)
SXH2 F 1 Offset(0,108)
SXH1 S 1 Offset(0,82)
SXH1 S 1 Offset(0,58)
SXH1 S 1 Offset(0,32)
Goto Ready2
/*
Rage:
SXH1 S 0 A_JumpIfInventory("CBSHuntsman",20,"NoAmmo")
SXH1 S 0 A_PlaySoundEx("Sniper/Rage","Voice")
//SXH1 S 0 A_GiveInventory("CBSHuntsmanMode",1)
SXH1 S 0 A_TakeInventory("BossRageCharge",700)
SXH1 SSSSS 7 A_GiveInventory("ChristianBrutalSniperSurprise",1)
goto Ready2
Rage2:
SXH1 S 0 A_PlaySoundEx("Sniper/Rage","Voice")
SXH1 S 0 A_TakeInventory("BossRageCharge",700)
SXH2 DDDDD 7 A_GiveInventory("ChristianBrutalSniperSurprise",1)
goto HasArrowReady*/

Rage:
SXH1 S 0 A_PlaySoundEx("Sniper/Rage","Voice")
SXH1 S 1 Offset(0,40)
SXH1 S 1 Offset(0,80)
SXH1 S 1 Offset(0,120)
SXH1 S 1 Offset(0,160)
SXH1 S 0 A_GiveInventory("CBSRageAmmo",100)
TNT1 A 1 A_TakeInventory("BossRageCharge",500)
TNT1 A 0 A_WeaponReady(14)
Rage2:
TNT1 AAA 0 A_SpawnItemEx("BloodBathStorm", random(0,256)+momx, 0+momy, random(128,256)+momz, 0, 0, -16, random(0,359))

TNT1 AAAA 1 A_TakeInventory("CBSRageAmmo",1)
TNT1 A 0 A_JumpIfInventory("CBSRageAmmo",1,"Rage2")
TNT1 A 35
SXH1 S 1 Offset(0,160)
SXH1 S 1 Offset(0,120)
SXH1 S 1 Offset(0,80)
SXH1 S 1 Offset(0,40)
goto Ready2
NoAmmo:
SXH1 S 0 A_JumpIfInventory("CBSHuntsmanMode",1,"NoAmmo2")
SXH1 S 1 ACS_Execute(979,0)
SXH1 S 0 A_Refire
Goto Ready2
NoAmmo2:
SXH1 S 0 A_JumpIfInventory("CBSHuntsman",1,"NoAmmo3")
SXH2 F 1 ACS_Execute(979,0)
SXH2 F 0 A_Refire
goto UselessArrowReady
NoAmmo3:
SXH2 D 1 ACS_Execute(979,0)
SXH2 D 0 A_Refire
goto HasArrowReady

Flash:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("CBSArrowRegen",175,"GiveArrow") 
TNT1 A 0 A_GiveInventory("CBSArrowRegen",1)
TNT1 A 1 
loop
GiveArrow:
TNT1 A 0 A_GiveInventory("CBSHuntsman",1)
TNT1 A 0 A_PlaySound("weapon/AutoReload3",1,0.85)
TNT1 A 1 A_TakeInventory("CBSArrowRegen",175)
goto Flash
}
}

actor CBSHuntsman : Inventory
{
inventory.amount 1
inventory.maxamount 20
}

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

actor CBSArrowRegen : Inventory
{
inventory.amount 1
inventory.maxamount 175
}

actor CBSRageAmmo : Inventory
{
inventory.amount 1
inventory.maxamount 100
}

actor SniperShiv : SaxtonFist 
{
Damagetype "BrutalSniperShiv"
translation "192:192=232:232", "198:198=234:234"
Obituary "$OB_SHIV"
Damage (35)
States
{
Death:
F_PR B 0 A_Explode(35,20,0,0,20)
goto XDeath
XDeath:
F_PR B 0 A_Stop
F_PR B 2
F_PR A 2
F_PR BC 2
stop
}
}

actor BazookaArrow
{
PROJECTILE
Radius 16
Height 16
scale 2.5
damage (25)
damagetype "BossInstagib" //Not making that mistake.
speed 50
Obituary "$OB_ARROWBAZOOKA"
States
{
Spawn:
TNT1 A 0
HMSH A 5
HMSH A 0 A_Changeflag("NOGRAVITY",0)
loop
Crash:
XDeath:
Death:
TNT1 A 0 A_SpawnItemEx("HardKnuckleFX")
stop
}
}

actor TheHuntsman
{
PROJECTILE
Radius 16
Height 16
scale 2.5
damage (100)
damagetype "BossInstagib"
speed 100
Obituary "$OB_HUNTSMAN"
States
{
Spawn:
TNT1 A 0
HMSH A 1
loop
Crash:
XDeath:
Death:
TNT1 A 0 A_SpawnItemEx("HardKnuckleFX")
stop
}
}

actor BloodBathStorm
{
PROJECTILE
Radius 16
Height 16
scale 2.5
damage (10)
damagetype "BrutalSniper"
speed 25
-NOGRAVITY
Obituary "$OB_BLOODSTORM"
States
{
Spawn:
TNT1 A 0
JARB ABCD 3
loop
Crash:
XDeath:
Death:
TNT1 A 0 A_Explode(15,160,0,0,80)
TNT1 A 0 A_PlaySoundEx("weapon/centaurflash","Weapon")
TNT1 A 0 A_SpawnItemEx("BloodDropX", 48, 0, 64, random(1,3), random(0,10), 2, random(-5,5))
TNT1 A 0 A_SpawnItemEx("BloodDropX", 48, 0, 64, random(1,3), random(0,10), 2, random(40,50))
TNT1 A 0 A_SpawnItemEx("BloodDropX", 48, 0, 64, random(1,3), random(0,10), 2, random(85,95))
TNT1 A 0 A_SpawnItemEx("BloodDropX", 48, 0, 64, random(1,3), random(0,10), 2, random(130,140))
TNT1 A 0 A_SpawnItemEx("BloodDropX", 48, 0, 64, random(1,3), random(0,10), 2, random(175,185))
TNT1 A 0 A_SpawnItemEx("BloodDropX", 48, 0, 64, random(1,3), random(0,10), 2, random(220,230))
TNT1 A 0 A_SpawnItemEx("BloodDropX", 48, 0, 64, random(1,3), random(0,10), 2, random(265,275))
TNT1 A 0 A_SpawnItemEx("BloodDropX", 48, 0, 64, random(1,3), random(0,10), 2, random(310,320))
NAPA EEFFGGHHIIJJKKLLMMNNOOPPQQRRSS 1 A_Stop
stop
}
}

//Blood Splatter + Blood Flush
actor BrutalHit_P : CustomInventory
{
states
{
Pickup:
//TNT1 A 0 A_SpawnItemEx("BloodFlush",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
TNT1 A 0 A_SpawnItemEx("BloodSplatterer")
stop
}
}

actor BrutalKill_P : CustomInventory
{
states
{
Pickup:
//TNT1 A 0 A_SpawnItemEx("BloodFlush",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
TNT1 A 0 A_SpawnItemEx("BloodFlush")
stop
}
}

actor BloodFlush : RainFlush
{
Obituary "$OB_BRUTALBLOODX"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_TransferPointer(AAPTR_TARGET,AAPTR_DEFAULT,AAPTR_TARGET,AAPTR_TARGET) //this things target is target's target
TNT1 A 0 A_PlaySoundEx("weapon/rainflush","Voice")
TNT1 A 0 A_Explode(10,512,0)
TNT1 AAAAAAA 1 A_SpawnItemEx("BloodSprinkleSpawn",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
TNT1 A 0 A_Explode(5,512,0)
TNT1 AAAAAAA 1 A_SpawnItemEx("BloodSprinkleSpawn",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
TNT1 A 0 A_Explode(5,512,0)
TNT1 AAAAAAA 1 A_SpawnItemEx("BloodSprinkleSpawn",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
TNT1 A 0 A_Explode(5,512,0)
TNT1 AAAAAAA 1 A_SpawnItemEx("BloodSprinkleSpawn",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
stop
}
}

actor BloodSprinkleSpawn
{
Height 0
Radius 0
+NOINTERACTION
+NOCLIP
PROJECTILE
+CLIENTSIDEONLY
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("BloodSprinkle", random(-256,256), random(-256,256), 256, -30, 0, -30, random(0,359), SXF_CLIENTSIDE)
TNT1 A 1 A_SpawnItemEx("BloodSprinkle", random(-256,256), random(-256,256), 256, -30, 0, -30, random(0,359), SXF_CLIENTSIDE)
stop
}
}

actor BloodSprinkle : RainSprinkle
{
translation "0:255=42:42"
}

actor BloodSplatterer
{
Height 0
Radius 0
+NOINTERACTION
PROJECTILE
states
{
Spawn:
TNT1 A 0
//TNT1 AAAAAAAA 0 A_SpawnItemEx("BloodDrop", 48, 0, 64, 2, random(0,15), 2, random(0,360), SXF_CLIENTSIDE)
TNT1 AAA 0 A_SpawnItemEx("BloodDrop", 48, 0, 64, random(1,3), random(0,10), 3, random(-5,5))
TNT1 AAA 0 A_SpawnItemEx("BloodDrop", 48, 0, 64, random(1,3), random(0,10), 3, random(40,50))
TNT1 AAA 0 A_SpawnItemEx("BloodDrop", 48, 0, 64, random(1,3), random(0,10), 3, random(85,95))
TNT1 AAA 0 A_SpawnItemEx("BloodDrop", 48, 0, 64, random(1,3), random(0,10), 3, random(130,140))
TNT1 AAA 0 A_SpawnItemEx("BloodDrop", 48, 0, 64, random(1,3), random(0,10), 3, random(175,185))
TNT1 AAA 0 A_SpawnItemEx("BloodDrop", 48, 0, 64, random(1,3), random(0,10), 3, random(220,230))
TNT1 AAA 0 A_SpawnItemEx("BloodDrop", 48, 0, 64, random(1,3), random(0,10), 3, random(265,275))
TNT1 AAA 0 A_SpawnItemEx("BloodDrop", 48, 0, 64, random(1,3), random(0,10), 3, random(310,320))
stop
}
}

actor BloodDrop
{
Obituary "$OB_BRUTALBLOOD"
translation "0:255=42:42"
PROJECTILE
Height 16
Radius 16
scale 2.5
damagetype "SniperBlood"
+BOUNCEONWALLS
+SLIDESONWALLS
+HEXENBOUNCE
-BOUNCEONFLOORS
bouncefactor 1.0
wallbouncefactor 1.0
+THRUSPECIES
+DONTHURTSPECIES
+DONTHARMSPECIES
Speed 9
Damage (10)
-NOGRAVITY
States
{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_TransferPointer(AAPTR_TARGET,AAPTR_DEFAULT,AAPTR_TARGET,AAPTR_TARGET) //this things target is target's target
	TNT1 A 1 A_ChangeVelocity(0,0,6)
	RAIN D -1
	wait
	Death:
	MMFX F 0 A_PlaySound("misc/splash","Weapon",0.7)
	MMFX F 0 A_ChangeFlag("NOGRAVITY",1)
	MMFX F 0 A_Explode(10,32,0,0,32)
	TDRN ABCD 3 A_Stop
	stop
}
}

actor BloodDropX
{
Obituary "$OB_BLOODSTORM"
translation "0:255=42:42"
PROJECTILE
Height 16
Radius 16
scale 2.5
damagetype "BossInstagib"
+BOUNCEONWALLS
+SLIDESONWALLS
+HEXENBOUNCE
-BOUNCEONFLOORS
bouncefactor 1.0
wallbouncefactor 1.0
+THRUSPECIES
+DONTHURTSPECIES
+DONTHARMSPECIES
Speed 9
Damage (4)
-NOGRAVITY
States
{
	Spawn:
	TNT1 A 0
	TNT1 A 1 A_ChangeVelocity(0,0,4)
	RAIN D -1
	wait
	Death:
	MMFX F 0 A_PlaySound("misc/splash","Weapon",0.7)
	MMFX F 0 A_ChangeFlag("NOGRAVITY",1)
	MMFX F 0 A_Explode(4,32,0,0,32)
	TDRN ABCD 3 A_Stop
	stop
}
}

actor BloodDropProtect : PowerProtection
{
Powerup.Duration 24
DamageFactor "SniperBlood", 0.0
}
//

actor SniperPowerUp : PowerupGiver
{
+COUNTITEM
+INVENTORY.AUTOACTIVATE
+INVENTORY.ALWAYSPICKUP
Inventory.MaxAmount 0
Powerup.Type "SniperCheck"
Powerup.Color BlueMap
Powerup.Duration -15
States
{
Spawn:
TNT1 A 1
Loop
}
}

actor PowerSniperCheck : PowerDamage
{
damagefactor "normal", 1
}

actor ChristianBrutalSniperHuntsman : Inventory
{
inventory.amount 1
inventory.maxamount 20
}

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

actor ChristianBrutalSniperRageControl
{
PROJECTILE
+NOINTERACTION
states
{
Spawn:
TNT1 A 0
WaitingForRage:
TNT1 A 5
TNT1 A 0 A_JumpIfInTargetInventory("BossRageCharge", 500, "WhatACinema")
goto WaitingForRage
WhatACinema:
TNT1 A 0 A_GiveToTarget("ChristianBrutalSniperRoar", 1)
TNT1 AAAAA 7 A_GiveToTarget("ChristianBrutalSniperSurprise", 1)
goto WaitingForRage
}
}

actor ChristianBrutalSniperRoar : CustomInventory
{
states
{
Pickup:
SXH1 S 0 A_PlaySoundEx("Sniper/Rage","Item")
stop
}
}

actor ChristianBrutalSniperSurprise : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_TakeInventory("BossRageCharge", 100)
TNT1 A 0 A_GiveInventory("CBSHuntsman", 1)
TNT1 A 0 A_PlaySoundEx("item/energyup", "Auto")
TNT1 A 0 A_SetBlend("0 0 0", 0.95, 2)
stop
}
}