actor Gutsman_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_1B"
dropitem "SuperArmWep"
Weapon.AmmoUse 0
Weapon.AmmoGive 28
Obituary "$OB_GUTSPUNCH"//Obituary "$OB_SUPERARM"
weapon.ammotype "GutsArmAmmo"
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_01 B 1
loop

Deselect:
GUTP A 0 A_JumpIfInventory("SuperArmTemp",1,1)
goto DeselectSwap
GUTP A 0 A_FireCustomMissile("GutsmanBlockToss",0,1,0,56)
GUTP A 0 A_TakeInventory("SuperArmTemp",1)
GUTP C 2 Offset(1,33)A_PlaySound("weapon/GutThrow",4,0.7)
GUTP C 2 Offset(-70,74)
GUTP C 2 Offset(-121,114)
GUTP D 2 Offset(1,33)
GUTP D 2 Offset(-21,56)
GUTP D 2 Offset(-37,84)
GUTP A 0 Offset(1,32)
Goto DeselectSwap
Select:
GUTP A 0
goto SelectSwap

Ready:
GUTP A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_GUTSMAN)
GUTP A 0 A_GiveInventory("SpawningMisfire",1)
goto Ready0
Ready0:
GUTP A 2 A_WeaponReady
GUTP A 0 A_TakeInventory("SpawningMisfire",1)
Goto Ready1
Ready1:
GUTP A 1 A_WeaponReady
wait

SpawnProtect:
GUTP A 1
Goto Ready0

Fire:
TNT1 A 0 A_JumpIfInventory("SpawningMisfire",1,"SpawnProtect")
TNT1 A 0 A_JumpIfInventory("SuperArmTemp",1,"Throw")
TNT1 A 0 A_JumpIfInventory("IsBot",1,"BotFire")

GUTP A 0 //A_Stop
GUTP A 0 A_GiveInventory("SuperArmTemp",1)
GUTP A 0 ACS_NamedExecuteWithResult("cbm_HalfHitStunplayer",0,false)
GUTP A 0 A_PlaySoundEx("misc/hugequake2","Weapon")

GUTP A 0 A_JumpIfInventory("PlayerPropertyRage",1,"Fire_R")
GUTP A 1 Offset(0,80)A_SpawnItemEx("TempGutsmanBlock",18,0,346,0,0,0,0,32)
GUTP A 1 Offset(0,80)A_SpawnItemEx("TempGutsmanBlock",16,0,316,0,0,0,0,32)
GUTP B 1 Offset(-20,131)A_SpawnItemEx("TempGutsmanBlock",14,0,286,0,0,0,0,32)
GUTP B 1 Offset(-20,131)A_SpawnItemEx("TempGutsmanBlock",12,0,256,0,0,0,0,32)
GUTP B 1 Offset(-10,83)A_SpawnItemEx("TempGutsmanBlock",10,0,226,0,0,0,0,32)
GUTP B 1 Offset(-10,83)A_SpawnItemEx("TempGutsmanBlock",8,0,196,0,0,0,0,32)
GUTP B 0 A_WeaponReady(14)
GUTP B 1 A_SpawnItemEx("TempGutsmanBlock",6,0,166,0,0,0,0,32)
GUTP B 1 A_SpawnItemEx("TempGutsmanBlock",4,0,136,0,0,0,0,32)
GUTP B 1 A_SpawnItemEx("TempGutsmanBlock",2,0,106,0,0,0,0,32)
GUTP BBBB 1 A_SpawnItemEx("TempGutsmanBlock",0,0,76,momx,momy,momz,0,9,0)
Goto Holding
Fire_R:
GUTP A 1 Offset(0,80)A_SpawnItemEx("TempGutsmanBlock",18,0,346,0,0,0,0,32)
GUTP B 1 Offset(-20,131)A_SpawnItemEx("TempGutsmanBlock",14,0,286,0,0,0,0,32)
GUTP B 1 Offset(-10,83)A_SpawnItemEx("TempGutsmanBlock",10,0,226,0,0,0,0,32)
GUTP B 0 A_WeaponReady(14)
GUTP B 1 A_SpawnItemEx("TempGutsmanBlock",6,0,166,0,0,0,0,32)
GUTP B 1 A_SpawnItemEx("TempGutsmanBlock",2,0,106,0,0,0,0,32)
GUTP BB 1 A_SpawnItemEx("TempGutsmanBlock",0,0,76,momx,momy,momz,0,8)
Goto Holding
Holding:
GUTP B 0 A_SpawnItemEx("TempGutsmanBlock",0,0,76,momx,momy,momz,0,8)
GUTP B 1 A_WeaponReady
loop
Throw:
GUTP A 0 A_FireCustomMissile("GutsmanBlockToss",0,1,0,56)//A_SpawnItemEx("GutRock",0,0,56,20,0,-4,0,0,0)
GUTP A 0 A_TakeInventory("SuperArmTemp",1)
GUTP A 0 ACS_NamedExecuteWithResult("cbm_HalfHitStunplayer",0,true)
GUTP C 2 Offset(1,33)A_PlaySound("weapon/GutThrow",4,0.7)
GUTP C 2 Offset(-70,74)
GUTP C 2 Offset(-121,114)
GUTP D 2 Offset(1,33)
GUTP D 2 Offset(-21,56)
GUTP D 2 Offset(-37,84)
TNT1 A 6
GUTP A 2 Offset(6,92)
GUTP A 2 Offset(4,72)
GUTP A 2 Offset(2,52)
Goto Ready1
Hold:
GUTP A 1
Goto Ready1
Altfire:
TNT1 A 0 A_JumpIfInventory("SuperArmTemp",1,"Altfire2")
TNT1 A 0 A_JumpIfInventory("GutsmanFlag",1,2)
GUTP A 0 A_FireCustomMissile("GutPunch",0,0,8,0)
GUTP A 0 A_PlaySoundEx("Weapon/GutMelee","Weapon")
GUTP A 0 A_GiveInventory("GutsDestroyFlag",1)

GUTP F 2 Offset(-28,8)
GUTP EEEE 2 Offset(-56,-16)
GUTP E 2 Offset(-56,-16)A_TakeInventory("GutsDestroyFlag",99)
GUTP E 2 Offset(-56,-16)A_TakeInventory("GutsmanFlag",99)
GUTP E 2 Offset(-32,2)
GUTP E 2 Offset(-12,20)
GUTP E 2 A_WeaponReady(14)
/*
GUTP F 2 Offset(-16,18)
GUTP E 2 Offset(-36,1)
GUTP EEE 2 Offset(-56,-16)
GUTP F 2 Offset(-40,-3)A_TakeInventory("GutsDestroyFlag",99)
GUTP F 2 Offset(-32,4)A_TakeInventory("GutsmanFlag",99)
GUTP F 2 Offset(-24,11)
GUTP F 2 Offset(-16,18)
GUTP F 2 Offset(-8,25)
*/
Goto Ready1

Altfire2:
GUTP B 0 A_TakeInventory("SuperArmTemp",1)
GUTP B 0 A_GiveInventory("GutsmanFlag",1)
GUTP B 0 ACS_NamedExecuteWithResult("cbm_HalfHitStunplayer",0,true)
GUTP B 0 A_JumpIfInventory("PlayerPropertyRage",1,"Altfire2_R")
GUTP B 1 A_SpawnItemEx("TempGutsmanBlock",10,0,72,momx,momy,momz,0,8+32)
GUTP B 1 A_SpawnItemEx("TempGutsmanBlock",25,0,63,momx,momy,momz,0,8+32)
GUTP B 1 Offset(-12,83)A_SpawnItemEx("TempGutsmanBlock",40,0,54,momx,momy,momz,0,8+32)
GUTP B 1 Offset(-12,83)A_SpawnItemEx("TempGutsmanBlock",55,0,45,momx,momy,momz,0,8+32)
GUTP B 1 Offset(-24,131)A_SpawnItemEx("TempGutsmanBlock",60,0,36,momx,momy,momz,0,8+32)
GUTP B 1 Offset(-24,131)A_SpawnItemEx("TempGutsmanBlock",65,0,18,momx,momy,momz,0,8+32)
TNT1 A 1 A_GiveInventory("GutsM_BlockPlace_P")
Altfire2End:
TNT1 A 2 A_WeaponReady(4)
TNT1 A 2 A_TakeInventory("GutsmanFlag",99)
GUTP A 2 Offset(6,92)
GUTP A 2 Offset(4,72)
GUTP A 2 Offset(2,52)
Goto Ready1
Altfire2_R:
GUTP B 1 A_SpawnItemEx("TempGutsmanBlock",10,0,72,momx,momy,momz,0,41)
GUTP B 1 Offset(-12,83)A_SpawnItemEx("TempGutsmanBlock",40,0,54,momx,momy,momz,0,8+32)
GUTP B 1 Offset(-24,131)A_SpawnItemEx("TempGutsmanBlock",60,0,36,momx,momy,momz,0,8+32)
TNT1 A 1 A_GiveInventory("GutsM_BlockPlace_P")
Goto Altfire2End

BotFire:
TNT1 A 0 A_JumpIfCloser(200,"BotAltFire")
goto Fire+3
BotAltFire:
GUTP A 0 A_GiveInventory("BotHugFlag",1)
GUTP A 0 A_FireCustomMissile("GutPunch",0,0,8,0)
//GUTP A 0 A_PlaySoundEx("Weapon/napalm","Weapon")
GUTP A 0 A_PlaySoundEx("Weapon/GutMelee","Weapon")
GUTP EF 5
GUTP F 10
GUTP A 0 A_TakeInventory("BotHugFlag",999)
Goto Ready1
}
}

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

actor GutsmanFlag : OnceC{}
actor GutsDestroyFlag : OnceC{}

actor TempGutsmanBlock : BasicGraphicEffect
{
Translation "1:1=1:1"
+NOTIMEFREEZE
RenderStyle Normal
States
{
SpawnFrame:
GUTP P 1
stop
}
}

actor GutsM_BlockPlace_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_SpawnItemEx("TempGutsmanBlock",70,0,0,momx,momy,momz,0,8+32)
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("GutsmanSolidBlock",70,0,0,momx,momy,momz,0,8+32)
TNT1 A 0 A_JumpIfInventory("PlayerPropertySpread",1,1)
stop
TNT1 A 0 A_SpawnItemEx("GutsmanSolidBlock",0,70,0,momx,momy,momz,0,8+32)
TNT1 A 0 A_SpawnItemEx("GutsmanSolidBlock",0,-70,0,momx,momy,momz,0,8+32)
stop
}
}

actor GutsmanSolidBlockFall : ProjSpawnFuncActor
{
Translation "1:1=1:1"
PROJECTILE
damagetype "GutsM_Rock"
Obituary "$OB_SUPERARM"
+NOINTERACTION
Radius 30
Height 64
Speed 0
Scale 2.5
States
{
Spawn:
GUTP O 9
GUTP OO 1 A_JumpIfCloser(64,"SpawnGive")
GUTP O 0 A_SpawnItemEx("GutsmanSolidBlock",0,0,0,momx,momy,momz,0,1+8)
stop
SpawnGive:
TNT1 O 1 A_GiveToTarget("SuperArmTemp",1)
stop
}
}

actor GutsmanSolidBlock : CBM_ShootableActor//ProjSpawnFuncActor
{
Translation "1:1=1:1"
PROJECTILE
damagetype "GutsM_Rock"
Obituary "$OB_SUPERARM"
+DONTBLAST
+DONTREFLECT
+DONTSPLASH
+NOEXPLODEFLOOR
-NOGRAVITY

-NOBLOCKMAP
+SHOOTABLE
+NOTAUTOAIMED
+DONTDRAIN
+NOBLOOD
+NOTARGETSWITCH
+NOPAIN
+SOLID
+DONTRIP

+CANPASS

+BOUNCEONCEILINGS
+EXPLODEONWATER
BounceFactor 0.0//1.0
WallBounceFactor 0.0

ReactionTime 1

mass 99999
Health 850
damagefactor "SuperArm", 0.0
damagefactor "GutsM_Rock", 0.0
damagefactor "GutsM_RockBit", 0.0
damagefactor "GutsM_Punch", 0.0

Species "GutsmanRock"

Damage (300)//500
Radius 30
Height 80//64
Speed 0
Scale 2.5

States
{
Spawn:
GUTP P 0 nodelay A_SetAngle(0)
GUTP P 0 A_SetArg(3,500)
GUTP P 1
GUTP P 0
goto Spawn1
Spawn1:
GUTP P 0 A_JumpIfInTargetInventory("GutsDestroyFlag",1,"PunchCheck")
GUTP P 1 A_CountDownArg(3)//220
GUTP P 0 A_JumpIf(momz==0, "MOMZCheck")
GUTP P 0 A_JumpIf(z-floorz<1,"PitCheck")
loop

MOMZCheck:
GUTP P 1 A_CountDownArg(3)//A_GiveInventory("WeaponCharge",1)
GUTP P 0 A_JumpIf(momz==0,"PitCheck")
GUTP P 0
goto Spawn1
PitCheck:
GUTP P 0 A_ChangeVelocity(0,0,momz,CVF_REPLACE)
GUTP P 0 A_GiveInventory("ResyncPickup",1)
GUTP P 0 A_JumpIf(CallACS("core_checkPit"),"DeathTime")
GUTP P 0 A_SetArg(3,Args[3]/5)
goto Spawn2

Spawn2:
GUTP P 0 A_CountDownArg(3)
GUTP P 1 A_JumpIfInTargetInventory("GutsDestroyFlag",1,5)
GUTP P 1 A_JumpIfInTargetInventory("GutsDestroyFlag",1,5)
GUTP P 1 A_JumpIfInTargetInventory("GutsDestroyFlag",1,5)
GUTP P 1 A_JumpIfInTargetInventory("GutsDestroyFlag",1,5)
GUTP P 1 A_JumpIfInTargetInventory("GutsDestroyFlag",1,5)
//GUTP P 0 A_JumpIf(momx>=1 || momy>=1 || momx<=-1 || momy<=-1, "Spawn1")
loop
GUTP P 1 A_JumpIfCloser(96,"RockScatter")
goto Spawn2+2
GUTP P 1 A_JumpIfCloser(96,"RockScatter")
goto Spawn2+3
GUTP P 1 A_JumpIfCloser(96,"RockScatter")
goto Spawn2+4
GUTP P 1 A_JumpIfCloser(96,"RockScatter")
goto Spawn2+5
GUTP P 1 A_JumpIfCloser(96,"RockScatter")
goto Spawn2
PunchCheck:
GUTP P 0 A_JumpIfCloser(96,"RockScatter")//108
goto Spawn1+1


DeathTime:
GUTP P 1 A_CountDown
wait
RockScatter:
GUTP P 0 A_GiveInventory("GutsDestroyFlag",1)
goto DeathTime

DeathScatter:
GUTP P 0 A_ChangeFlag("NOGRAVITY",1)
GUTP P 0 A_Stop
GUTP P 0 ACS_NamedExecuteWithResult("cbm_CopyPointerAnglePitch",2,1)//Turns Rock
GUTP P 0 A_SpawnItemEx("GutsmanSolidBlockDebris",0,-32,32,cos(-pitch)*30,0,sin(-pitch)*30,0)
GUTP P 0 A_SpawnItemEx("GutsmanSolidBlockDebris",0,32,32,cos(-pitch)*30,0,sin(-pitch)*30,0)
GUTP P 0 A_SpawnItemEx("GutsmanSolidBlockDebris",0,0,32,cos(-pitch)*30,0,sin(-pitch)*30,0)
GUTP P 0 A_SpawnItemEx("GutsmanSolidBlockDebris",0,0,64,cos(-pitch)*30,0,sin(-pitch)*30,0)
GUTP P 0 A_SpawnItemEx("GutsmanSolidBlockDebris",0,0,0,cos(-pitch)*30,0,sin(-pitch)*30,0)
goto Death2

Death2:
GUTP P 0 A_ChangeFlag("DONTRIP",0)
GUTP PPPP 0 A_SpawnItemEx("GutsmanBlockTossFX",0,0,8,random(-10,10),random(-10,10),random(8,12),random(0,359),1)
TNT1 A 1 A_PlaySoundEx("weapon/GutRock", "Voice")
stop
Death:
GUTP P 0 A_ChangeFlag("SHOOTABLE",0)
GUTP P 0 A_JumpIfInventory("GutsDestroyFlag",1,"DeathScatter")
GUTP P 0 A_JumpIf(Args[3]<1,"Death2")//A_JumpIfInventory("WeaponCharge",500,"Death2")
GUTP PPPPPPPP 0 A_SpawnItemEx("GutsmanBlockTossFX",0,0,8,random(-10,10),random(-10,10),random(5,10),random(0,359),1)
TNT1 A 1 A_PlaySoundEx("weapon/GutRock", "Voice")
stop
}
}

actor GutsmanBlockToss : ProjSpawnFuncActor
{
Translation "1:1=1:1"
PROJECTILE
damagetype "GutsM_Rock"
Obituary "$OB_SUPERARM"
-NOGRAVITY
+SKYEXPLODE
+EXPLODEONWATER
Damage (330)//550
Radius 30
Height 30
Speed 35//30
scale 2.5
States
{
Spawn:
GUTP P 0
GUTP P 0 A_ChangeVelocity(0,0,5)
GUTP P 1
wait
Crash:
GUTP PPPP 0 A_SpawnItemEx("GutsmanBlockTossFX",0,0,0,random(-10,10),random(-10,10),random(5,10),random(0,359),1)
TNT1 A 2 A_PlaySoundEx("weapon/GutRock", "Voice")
stop
Death:
GUTP P 0 A_SpawnItemEx("GutsmanBlockDebris",-16,-16,16,20,0,0)
GUTP P 0 A_SpawnItemEx("GutsmanBlockDebris",-16,16,16,30,0,0)
GUTP P 0 A_SpawnItemEx("GutsmanBlockDebris",16,-16,16,30,0,6)
GUTP P 0 A_SpawnItemEx("GutsmanBlockDebris",16,16,16,20,0,3)
TNT1 A 2 A_PlaySoundEx("weapon/GutRock", "Voice")
stop
}
}


actor GutsmanBlockTossFX : BasicGraphicEffectM
{
-NOGRAVITY
+THRUACTORS
+BOUNCEONWALLS
+BOUNCEONFLOORS
+BOUNCEONCEILINGS
+CANBOUNCEWATER
+THRUSPECIES
Species "GutsmanRock"
States
{
SpawnFrame:
GUTP Q 2
TNT1 A 2
GUTP Q 2
TNT1 A 2
GUTP Q 2
TNT1 A 2
GUTP Q 2
TNT1 A 2
GUTP Q 2
TNT1 A 2
stop
}
}

actor GutsmanBlockDebris : ProjSpawnFuncActor
{
PROJECTILE
damagetype "GutsM_RockBit"
Obituary "$OB_SUPERARM"
Damage (90)//150
Radius 12
Height 12
Speed 20
scale 2.5
States
{
Spawn:
TNT1 AA 0
GUTP Q 1
wait
}
}
actor GutsmanSolidBlockDebris : GutsmanBlockDebris
{
+THRUSPECIES
Species "GutsmanRock"
Damage (80)//120
Radius 10
Height 10
Speed 25
scale 2.0
}

actor GutPunch : ProjSpawnFuncActor
{
PROJECTILE
damagetype "GutsM_Punch"
Obituary "$OB_GUTSPUNCH"
+DONTBLAST
+DONTREFLECT
reactiontime 1
damage (550)
Radius 20
Height 20
speed 60
scale 2.5
States
{
Spawn:
OMFX B 0
OMFX B 1 A_CountDown
wait
Death:
OMFX B 0 A_Explode(550,40,0)
goto XDeath
XDeath:
OMFX B 0 A_Stop
OMFX BOBC 2
stop
}
}

//actor Gutsman_W_NormalBar : NormalBar {Args 216,41}
actor Gutsman_W_MugshotColor : MugshotColor {Args 216,41}