actor TomahawkTalbainBossWeapon : MegaBuster
{
tag "Werewolf Tomahawk"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 1
Obituary "$OB_TOMAHAWKWEREWOLF"
+INVENTORY.UNDROPPABLE
weapon.ammotype "BossJumpCharge"
weapon.ammotype2 "BossRageCharge"
+WEAPON.AMMO_OPTIONAL
-WEAPON.DONTBOB
//+WEAPON.AXEBLOOD
Scale 2.0
States
{
Spawn:
TNT1 A 0
stop
Ready:
TMTB I 0 ACS_NamedExecuteAlways("GiveExecution",0)
TMTB L 27
TMTB M 6 A_GiveInventory("TomahawkSwingRelic",1)
TMTB NOI 2
TMTB L 0 A_PlaySoundEx("TomahawkTalbain/Pewt", "Weapon")
ReadyToRock:
TMTB I 0 ACS_ExecuteAlways(991,0,524)
TMTB II 1 A_WeaponReady(WRF_NOSWITCH)
Goto ReadyToRock
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
REMA A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
REMA A 1 A_Raise
Loop
Fire:
WerewolfTomahawkTime:
TMTB TUU 2 A_GiveInventory("TomahawkTomahawkTomahawkTomahawkTomahawk", 1)
TMTB V 12 SetPlayerProperty(0,1,4)
TMTB P 0 SetPlayerProperty(0,0,4)
TMTB P 0 A_SpawnItemEx("WerewolfTomahawk", 120, 0, 0, 0, 0, 0, 0)
TMTB T 0 A_TakeInventory("TomahawkTomahawkTomahawkTomahawkTomahawk", 999)
TMTB P 3 A_PlaySoundEx("TomahawkTalbain/TomahawkWoosh", "Weapon")
TNT1 A 6
TMTB T 0 A_TakeInventory("TomahawkTomahawkTomahawkTomahawkTomahawk", 999)
TNT1 A 10
TNT1 A 12 SetPlayerProperty(0,0,4)
TMTB WXXYYY 2
TMTB I 11
Goto ReadyToRock

AltFire:
REMA A 0 A_JumpIfInventory("BossRageCharge",500,"Rage")
goto TomahawkSwing
AltHold:
TMTB V 1 
goto HoldingTheSwing

TomahawkSwing:
TMTB T 0 A_PlaySoundEx("weapon/pcharge","Weapon")
TMTB T 0 ACS_ExecuteAlways(191,0,APROP_Speed,5,100)//SetPlayerProperty(0,1,0)
TMTB A 0 //A_GiveInventory("DisableHopping", 1) //lord forgive me for my sins
TMTB TU 2 //A_GiveInventory("TomahawkTomahawkTomahawkTomahawkTomahawk", 1)
TMTB V 28
HoldingTheSwing:
TMTB V 1
//TMTB V 0 A_Refire("HoldingTheSwing")
TMTB T 0 A_TakeInventory("TomahawkTomahawkTomahawkTomahawkTomahawk", 999)
TMTB P 2 //A_PlaySoundEx("TomahawkTalbain/TomahawkWoosh", "Weapon") // The projectiles does the sound
TNT1 A 0 A_SpawnItemEx("TomahawkSwingMaster", 75, 0, 0, 0, 0, 0, 0)
TMTB V 0 //A_TakeInventory("TomahawkSwingRelic", 999)
TMTB V 0 A_TakeInventory("TomahawkTomahawkTomahawkTomahawkTomahawk", 999)
TNT1 AAAA 4
TMTB A 0 //A_TakeInventory("DisableHopping", 999)
TMTB T 0 //SetPlayerProperty(0,0,0)
TMTB T 0 ACS_ExecuteAlways(191,0,APROP_Speed,100,100)
TNT1 A 11
TMTB WXY 2
TMTB I 8
goto ReadyToRock

Rage:
TMTB T 0 A_TakeInventory("BossRageCharge",500)
TMTB T 0 SetPlayerProperty(0,1,4)
TNT1 A 0 A_PlaySoundEx("TomahawkTalbain/WolfCry", "SoundSlot6")
TMTB TU 2 A_GiveInventory("TomahawkTomahawkTomahawkTomahawkTomahawk", 1)
TMTB V 3 
	TMTB V 0 A_PlaySoundEx("weapon/watershieldburst", "SoundSlot7", 0, 1)
	TMTB V 0 A_SpawnItemEx("MetDaddyJumpFog")
	TMTB V 0 ThrustThingZ(0,100,0,0)
	//TMTB V 0 A_FaceTarget
	TMTB V 0 A_Recoil(-35)
	TMTB VVVVVVVVVVV 1 A_SpawnItemEx("TomahawkAfterimage",-1)
	TMTB T 0 A_Setgravity(0.0)
	TMTB VVVVV 1 A_Stop
	//TNT1 A 0 A_SpawnItemEx("HyperStormHCrushingAssist", 0, 0, 0, 0, 0, 0)
	TMTB P 2 A_PlaySoundEx("TomahawkTalbain/TomahawkWoosh", "Weapon")
	TMTB P 0 A_TakeInventory("TomahawkTomahawkTomahawkTomahawkTomahawk",200)
	TNT1 A 0 ThrustThingZ(0, 300, 1, 1)
	TomahawkFall:
	TNT1 A 0 A_SetGravity(1.0)
	TNT1 A 0 A_SpawnItemEx("TomahawkAfterimage2",-1)
	TNT1 A 0 A_JumpIf(floorz==z, "TomahawkLand")
	TNT1 A 0 A_JumpIfInventory("HSHRageFlag",105,"TomahawkLand")
	TNT1 A 1 A_Checkfloor("TomahawkLand")
	TNT1 A 0 A_GiveInventory("HSHRageFlag",1)
	loop
	TomahawkLand:
	TMTB V 0 A_TakeInventory("HSHRageFlag",105)
	TNT1 A 0 A_GiveInventory("TomahawkEarthQuake")
	TNT1 AAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("WerewolfTomahawkDebris", 20, 0, 0, random(-12, 12), random(-10, 10), random(5, 25))
	TNT1 AAAAAA 2 A_SpawnItemEx("TomahawkRageRadius",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
	TNT1 A 15
	TNT1 A 4 SetPlayerProperty(0,0,4)
	TMTB WXY 2
	TMTB I 6
	Goto ReadyToRock


NoAmmo:
TMTB I 1 ACS_Execute(979,0)
Goto ReadyToRock
}
}

actor TomahawkRageRadius
{
Obituary "$OB_TOMAHAWKDOWN"
+DONTBLAST
PROJECTILE
+NOINTERACTION
+NOBLOCKMAP
damagetype "BossInstagib"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("TomahawkTalbain/TomahawkCrush", "Voice")
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,0)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,15)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,30)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,45)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,60)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,75)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,90)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,105)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,120)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,135)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,150)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,165)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,180)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,195)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,210)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,225)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,240)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,255)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,270)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,285)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,300)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,315)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,330)
TNT1 A 0 A_SpawnItemEx("TalbainShockWave",0,0,8,18,0,0,345)
TNT1 A 2 A_Explode(20, 512, 0,0,256)
stop
}
}


actor TalbainShockWave
{
Obituary "$OB_TOMAHAWKDOWN"
PROJECTILE
Scale 2.0
//+FLOORHUGGER
+DONTBLAST
//+NOEXPLODEFLOOR
+RIPPER
damagetype "BossInstagib"
//+NOINTERACTION
Speed 40
Damage (10)
Radius 32
Height 32
States
{
Spawn:
DUOR T 0
DUOR T 2
DUOR T 0 A_ChangeFlag("NOINTERACTION",0)
DUOR T 0 A_ChangeFlag("RIPPER",0)
loopit:
DUOR T 1 A_FadeOut(0.05)
loop
}
}


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

actor FastClawCheckPoint : TomahawkTalbainMirageBodyCombo
{
}

actor CrushTomahawk3rdCheckPoint : FastClawCheckPoint
{
}

actor EnoughKillingTomahawk : CrushTomahawk3rdCheckPoint
{
}

actor TomahawkAfterimage
{
+CLIENTSIDEONLY
+NOINTERACTION
-SOLID
scale 2.5
renderstyle stencil
stencilcolor "blue"
alpha 0.5
states
{
	Spawn:
	TMTB F 1 A_FadeOut(0.05)
	loop
}
}
actor TomahawkAfterimage2
{
+CLIENTSIDEONLY
+NOINTERACTION
-SOLID
scale 2.5
renderstyle stencil
stencilcolor "blue"
alpha 0.5
states
{
	Spawn:
	TMTB G 1 A_FadeOut(0.05)
	loop
}
}

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

actor TomahawkSwingMaster
{
PROJECTILE
+NOINTERACTION
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("TomahawkTalbain/TomahawkWoosh", "Body")
TNT1 A 0 A_SpawnItemEx("TomahawkSwing1", 15, 0, -10, 0, 0, 0)
TNT1 A 1 A_SpawnItemEx("TomahawkSwingHitbox", 15, 0, 0, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("TomahawkSwing1", 15, 0, -10, 0, 0, 0)
TNT1 A 1 A_SpawnItemEx("TomahawkSwingHitbox", 15, 0, 0, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("TomahawkSwing2", 15, 0, -10, 0, 0, 0)
TNT1 A 1 A_SpawnItemEx("TomahawkSwingHitbox", 15, 0, 0, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("TomahawkSwing2", 15, 0, -10, 0, 0, 0)
TNT1 A 1 A_SpawnItemEx("TomahawkSwingHitbox", 15, 0, 0, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("TomahawkSwing3", 15, 0, -10, 0, 0, 0)
TNT1 A 1 A_SpawnItemEx("TomahawkSwingHitbox", 15, 0, 0, 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("TomahawkSwing3", 15, 0, -10, 0, 0, 0)
TNT1 A 1 A_SpawnItemEx("TomahawkSwingHitbox", 0, 0, 0, 0, 0, 0)
stop
}
}

actor TomahawkSwingHitbox
{
PROJECTILE
radius 86
height 16
+ripper
damage (10) //6
Obituary "$OB_TOMAHAWKSWING" 
damagetype "BossInstagib"
states
{
Spawn:
TNT1 A 4 //A_Explode(6,64,0,0,64)
stop
}
}

actor TomahawkSwing1
{
PROJECTILE
+NOINTERACTION
+DONTBLAST
height 5
radius 5
scale 4.0
states
{
Spawn:
TTWX K 2
stop
}
}

actor TomahawkSwing2 : TomahawkSwing1
{
states
{
Spawn:
TTWX L 2
stop
}
}

actor TomahawkSwing3 : TomahawkSwing1
{
states
{
Spawn:
TTWX M 2
stop
}
}

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

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

actor NoFiringHale
{
PROJECTILE
+NOINTERACTION
states
{
Spawn:
TNT1 A 35
TNT1 A 0 A_GiveToTarget("WeaponObtained", 1)
TNT1 A 0 A_Jump(1, 1)
loop
Check:
TNT1 A 0
loop
}
}

actor WerewolfTomahawk
{
Obituary "$OB_TOMAHAWKWEREWOLF"
PROJECTILE
+NOINTERACTION
Radius 25
Height 50
scale 3.5
damage (0)
damagetype "BossInstagib"
speed 0
States
{
Spawn:
TMTB Q 0
TMTB QQRRSS 1 A_Explode(10, 100, 0,0,100)
Death:
TNT1 A 0 A_CheckFloor("CrushingDeath")
stop
CrushingDeath:
TNT1 A 0 A_PlaySoundEx("TomahawkTalbain/TomahawkCrush", "Voice")
TNT1 A 0 A_GiveToTarget("TomahawkEarthquake", 1)
//TNT1 A 0 A_SpawnItemEx("TomahawkWerewolfEarthDamaged", 0, 0, 0, 0, 0, 0)
TNT1 A 0 A_CustomMissile("WerewolfTomahawkDust",0,0,90,2,0)
TNT1 A 0 A_CustomMissile("WerewolfTomahawkDust",0,0,-90,2,0)
TNT1 A 0 A_Explode(4, 200, 0,0,200)
TNT1 AAAAAAAAA 0 A_SpawnItemEx("WerewolfTomahawkDebris", 20, 0, 0, random(-12, 12), random(-10, 10), random(5, 25))
stop
}
}

actor WerewolfTomahawkDust
{
PROJECTILE
+NOINTERACTION
+DONTBLAST
scale 1.5
speed 14
states
{
Spawn:
TTWW X 0
TTWW X 0 ThrustThingZ(0,15,0,1)
TTWW X 3 A_FadeOut(0.15)
TTWW X 0 ThrustThingZ(0,15,0,1)
TTWW Y 3 A_FadeOut(0.15)
TTWW X 0 ThrustThingZ(0,15,0,1)
TTWW Z 3 A_FadeOut(0.15)
TTWW X 0 ThrustThingZ(0,15,0,1)
TTWX A 3 A_FadeOut(0.15)
TTWW X 0 ThrustThingZ(0,15,0,1)
TTWX B 3 A_FadeOut(0.15)
TTWW X 0 ThrustThingZ(0,15,0,1)
TTWX C 3 A_FadeOut(0.15)
stop
}
}

actor TomahawkWerewolfEarthDamaged
{
+NOINTERACTION
scale 2.0
states
{
Spawn:
TMTB Z 50
TMTB ZZZZZ 1 A_FaDeOuT(0.2)
stop
}
}

actor WerewolfTomahawkDebris : PowerMoundRockLV2
{
scale 3.0
states
{
Spawn:
GHSH R 40
Bai:
GHSH R 3 A_FadeOut(0.2)
loop
}
}

actor TomahawkEarthquake : CustomInventory
{
states
{
Pickup:
TNT1 A 0 ACS_ExecuteAlways(400, 0, 232)
stop
}
}



actor PowerWerewolfVision : PowerupGiver
{
+INVENTORY.AUTOACTIVATE
Powerup.Type "Torch"
Powerup.Duration 0x7FFFFFFF
//Powerup.Color 117 157 197, 0.05
}