actor Tomahawkman_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_6F"
dropitem "SilverTomahawkWep"
Weapon.AmmoUse 0
Weapon.AmmoGive 28
Obituary "$OB_SILVERTOMAHAWK"
Inventory.Pickupmessage "Lay off cheetos, man."
weapon.ammotype "GeronimoooAmmo"
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_06 F 1
loop

Deselect:
6H_F A 0
goto DeselectSwap
Select:
6H_F A 0
goto SelectSwap

Ready:
6H_F A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_TOMAHAWKMAN)
Ready1:
6H_F A 0 A_JumpIfInventory("GeronimoooAmmo",4,"Ready3")
6H_F A 3 A_WeaponReady(12)
6H_F A 0 A_GiveInventory("GeronimoooAmmo",1)
loop
Ready2:
6H_F A 0 A_JumpIfInventory("GeronimoooAmmo",4,"Ready3")
6H_F A 3 A_WeaponReady(8)
6H_F A 0 A_GiveInventory("GeronimoooAmmo",1)
loop
Ready3:
6H_F A 3 A_WeaponReady
6H_F A 0 A_GiveInventory("GeronimoooAmmo",1)
loop

Fire:
6H_F A 0 A_JumpIfInventory("IsBot",1,"BotFire")
6H_F A 2 Offset(-12,22)
6H_F B 2 Offset(-17,22)
6H_F B 3 Offset(-26,19)
6H_F C 1 Offset(-2,19)
6H_F A 0 A_GiveInventory("Tomahawkman_Fire_P")
6H_F C 2 Offset(-2,19)
TNT1 A 2 Offset(8,38)
6H_F A 2 Offset(25,105)
6H_F A 2 Offset(14,73)
6H_F A 2 Offset(6,49)
Goto Ready+1

AltFire:
6H_F A 0 A_GiveInventory("VivifyDelay7",1)
6H_F A 0 A_Refire(1)
6H_F A 1 Offset(-24,47)
6H_F A 2 Offset(-59,68)
6H_F A 8 A_GiveInventory("Tomahawkman_Alt_P")
6H_F A 2 Offset(-44,60)
6H_F A 2 Offset(-30,52)
6H_F A 2 Offset(-19,45)
6H_F A 2 Offset(-10,39)
6H_F A 2 Offset(-4,35)
Goto Ready+1

BotFire:
6H_F A 0 A_Jump(128,"AltFire")
goto Fire+1
}
}

actor GeronimoooAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}


actor Tomahawkman_Fire_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_FireCustomMissile("BrownTomahawkUp",0,0,-8,0)
TNT1 A 0 A_FireCustomMissile("BrownTomahawkDown",0,0,-8,0)
End:
TNT1 A 0 A_TakeInventory("GeronimoooAmmo",4,1)
TNT1 A 0 A_PlaySound("weapons/mm6/silvertomahawkfire",1)
stop
}
}

actor Tomahawkman_Alt_P : Tomahawkman_Fire_P
{
States
{
Pickup:
TNT1 A 0 A_FireCustomMissile("TomahawkFeatherSpawn",0,0,0,24)
TNT1 A 0 A_FireCustomMissile("TomahawkFeatherSpawnR1",0,0,0,24)
TNT1 A 0 A_FireCustomMissile("TomahawkFeatherSpawnR2",0,0,0,24)
TNT1 A 0 A_FireCustomMissile("TomahawkFeatherSpawnL1",0,0,0,24)
TNT1 A 0 A_FireCustomMissile("TomahawkFeatherSpawnL2",0,0,0,24)
goto End
}
}

actor BrownTomahawk : ProjSpawnFuncActor
{
PROJECTILE
Radius 16
Height 7
scale 2.5
damagetype "TomahawkM_Shot"
Obituary "$OB_SILVERTOMAHAWK"


var int user_POWER;
var int user_SPEEDX;
var int user_SPEEDY;
damage (110 + user_POWER*80)
speed 55
+SKYEXPLODE
+EXPLODEONWATER
States
{
XDeath:
TNT1 A 0
stop
}
}

actor TomahawkRangeGleam : BasicGraphicEffect
{
+BRIGHT
Renderstyle "Normal"
Alpha 1.0
States
{
SpawnFrame:
FLAS CBABC 2
stop
}
}

actor BrownTomahawkUp : BrownTomahawk
{
States
{
Spawn:
6H_F N 0
6H_F N 0 A_SetUserVar("user_SPEEDX",momx)
6H_F N 0 A_SetUserVar("user_SPEEDY",momy)
6H_F N 1
6H_F ONONO 1 ThrustThingZ(0,4,0,1)
Spawn2:
6H_F N 0 A_SpawnItemEx("TomahawkRangeGleam")
6H_F N 0 A_SetUserVar("user_POWER",1)
Spawn3:
6H_F NO 1 ThrustThingZ(0,4,0,1)
loop
Death:
TNT1 A 0 A_JumpIf(z-floorz==0,"Continue")
stop
Continue:
TNT1 A 0 A_SpawnItemEx("BrownTomahawkUp2",0,0,0,user_SPEEDX,user_SPEEDY,0,0,9,0)
stop
}
}


actor BrownTomahawkDown : BrownTomahawk
{
States
{
Spawn:
6H_F N 0
6H_F N 0 A_SetUserVar("user_SPEEDX",momx)
6H_F N 0 A_SetUserVar("user_SPEEDY",momy)
6H_F N 1
6H_F ONONO 1 ThrustThingZ(0,4,1,1)
Spawn2:
6H_F N 0 A_SpawnItemEx("TomahawkRangeGleam")
6H_F N 0 A_SetUserVar("user_POWER",1)
Spawn3:
6H_F NO 1 ThrustThingZ(0,4,1,1)
loop
Death:
TNT1 A 0 A_JumpIf(z-ceilingz==0-7, "Continue")
stop
Continue:
TNT1 A 0 A_SpawnItemEx("BrownTomahawkDown2",0,0,0,user_SPEEDX,user_SPEEDY,0,0,9,0)
stop
ContinueX:
TNT1 A 0 A_SpawnItemEx("BrownTomahawkUp2",0,0,0,20,0,0,0,9,0)
stop
}
}


actor BrownTomahawkUp2 : BrownTomahawkUp
{
States
{
Spawn:
6H_F N 0
goto Spawn2
Death:
goto XDeath
}
}

actor BrownTomahawkDown2 : BrownTomahawkDown
{
States
{
Spawn:
6H_F N 0
goto Spawn2
Death:
goto XDeath
}
}

actor TomahawkFeatherSpawn : ProjSpawnFuncActor
{
PROJECTILE
+RIPPER
+NOEXPLODEFLOOR
//damagetype "SilverTomahawk"
Damagetype "TomahawkM_Feather"
Obituary "$OB_TOMAHAWKFEATHER"
Radius 7
Height 7
scale 2.5
damage (0)
speed 25
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Changevelocity(18,0,0,1)
TNT1 A 1
TNT1 A 0 A_SpawnItemEx("TomahawkFeather",0,0,0,0,0,0,0,1)
stop
Death:
TNT1 A 0
stop
}
}


actor TomahawkFeatherSpawnR1 : TomahawkFeatherSpawn
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Changevelocity(9,25,0,1)
TNT1 A 1
TNT1 A 0 A_SpawnItemEx("TomahawkFeatherR1",0,0,0,0,0,0,0,1)
stop
}
}

actor TomahawkFeatherSpawnR2 : TomahawkFeatherSpawn
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Changevelocity(0,50,0,1)
TNT1 A 1
TNT1 A 0 A_SpawnItemEx("TomahawkFeatherR2",0,0,0,0,0,0,0,1)
stop
}
}

actor TomahawkFeatherSpawnL1 : TomahawkFeatherSpawn
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Changevelocity(9,-25,0,1)
TNT1 A 1
TNT1 A 0 A_SpawnItemEx("TomahawkFeatherL1",0,0,0,0,0,0,0,1)
stop
}
}

actor TomahawkFeatherSpawnL2 : TomahawkFeatherSpawn
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Changevelocity(0,-50,0,1)
TNT1 A 1
TNT1 A 0 A_SpawnItemEx("TomahawkFeatherL2",0,0,0,0,0,0,0,1)
stop
}
}

actor TomahawkFeather : TomahawkFeatherSpawn
{
-NOEXPLODEFLOOR
-DONTBLAST
damage (60)
States
{
Spawn:
6H_F M 0
6H_F M 0 A_Changevelocity(40,0,0,3)
Spawn2:
6H_F M 1
loop
}
}

actor TomahawkFeatherR1 : TomahawkFeather
{
Args 5
States
{
Spawn:
6H_F M 0
6H_F M 2 A_Changevelocity(40,0,0,3)
6H_F M 0 A_SetAngle(angle+Args[0])
6H_F M 2 A_Changevelocity(40,0,0,3)
6H_F M 0 A_SetAngle(angle+Args[0])
6H_F M 2 A_Changevelocity(40,0,0,3)
6H_F M 0 A_SetAngle(angle+Args[0])
6H_F M 2 A_Changevelocity(40,0,0,3)
6H_F M 0 A_SetAngle(angle+Args[0])
6H_F M 2 A_Changevelocity(40,0,0,3)
6H_F M 0 A_SetAngle(angle+Args[0])
6H_F M 2 A_Changevelocity(40,0,0,3)
6H_F M 0 A_SetAngle(angle+Args[0])
6H_F M 2 A_Changevelocity(40,0,0,3)
6H_F M 0 A_SetAngle(angle+Args[0])
6H_F M 2 A_Changevelocity(40,0,0,3)
6H_F M 0 A_SetAngle(angle+Args[0])
6H_F M 2 A_Changevelocity(40,0,0,3)
6H_F M 0 A_SetAngle(angle+Args[0])
6H_F M 2 A_Changevelocity(40,0,0,3)
goto Spawn2
}
}

actor TomahawkFeatherR2 : TomahawkFeatherR1
{
Args 10
}

actor TomahawkFeatherL1 : TomahawkFeatherR1
{
Args -5
}

actor TomahawkFeatherL2 : TomahawkFeatherR1
{
Args -10
}


actor Tomahawkman_W_NormalBar : NormalBar {Args 52,220}