actor Cutman_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_1A"
dropitem "RollingCutterWep"
Weapon.AmmoUse 0
Weapon.AmmoGive 28
Obituary "$OB_ROLLINGCUTTER"
weapon.ammotype "KFCAmmo"
+WEAPON.ALT_AMMO_OPTIONAL
States
{
Spawn:
C_01 A 1
loop

Deselect:
CUTA A 0
goto DeselectSwap
Select:
CUTA A 0 A_GiveInventory("CutterReturned")
goto SelectSwap

Ready:
CUTA A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_CUTMAN)
goto Ready2
Ready1:
CUTA A 10 A_WeaponReady
goto Ready2
Ready2:
CUTA A 2 A_WeaponReady
CUTA A 0 A_GiveInventory("KFCAmmo",1)
loop

Fire:
CUTA A 0 A_JumpIfInventory("IsBot",1,"BotFire")
CUTA A 0 A_FireCustomMissile("CutM_Cutter",0,1,8,0)
CUTA B 2 A_GiveInventory("CutmanNoCutterF",1)
CUTA B 2 Offset(-70,42)A_TakeInventory("CutterReturned",99)
CUTA B 2 Offset(-121,114)
CUTA C 2 Offset(1,32)
CUTA C 2 Offset(-21,56)
CUTA C 2 Offset(-33,84)
TNT1 A 4
TNT1 A 0 A_JumpIfInventory("IsBot",1,"BotFire3")
TNT1 A 12 Offset(1,32)
Goto FireWait
FireWait:
TNT1 A 0 A_JumpIfInventory("RollingCutterFlag",1,"FireEnd")
TNT1 A 1 A_GiveInventory("CutterFlag",1)
TNT1 A 0 A_JumpIfInventory("CutterFlag",35,"FireEnd")
loop
FireEnd:
TNT1 A 0 A_PlaySoundEx("weapon/CutterCatch","Weapon")
CUTA D 2 Offset(-26,146)A_GunFlash
CUTA D 2 Offset(-4,95)A_GiveInventory("CutterReturned",1)
CUTA D 2 Offset(1,32)A_TakeInventory("CutmanNoCutterF",99)
TNT1 A 2
TNT1 A 2 A_TakeInventory("CutterFlag",999)
TNT1 A 8
TNT1 A 2 A_TakeInventory("RollingCutterFlag")
CUTA A 2 Offset(28,80)
CUTA A 2 Offset(16,60)
Goto Ready1

Flash:
TNT1 A 1
stop

Altfire:
CUTA A 0 A_PlaySoundEx("weapon/CutMelee","weapon")
CUTA D 1 //A_FireCustomMissile("CutM_SliceDice",-40,0,16,16,0,10)
CUTA D 1 offset(-9,59)A_JumpIfInventory("PlayerPropertyRage",1,1)
CUTA D 1 offset(-20,96) A_FireCustomMissile("CutM_SliceDice1",-25,0,8,10,0,5)
CUTA D 1 offset(-33,119)A_JumpIfInventory("PlayerPropertyRage",1,1)
CUTA D 1 offset(-48,147) A_FireCustomMissile("CutM_SliceDice2",-10,0,0,4,0,0)
CUTA D 1 offset(-65,180)A_JumpIfInventory("PlayerPropertyRage",1,1)
CUTA D 1 offset(-83,220) A_FireCustomMissile("CutM_SliceDice3",5,0,-2,-2,0,-5)
CUTA D 1 offset(-102,241)A_JumpIfInventory("PlayerPropertyRage",1,1)
CUTA D 1 offset(-122,276) A_FireCustomMissile("CutM_SliceDice4",15,0,-8,-6,0,-10)
CUTA D 1 offset(-143,291)A_JumpIfInventory("PlayerPropertyRage",1,1)

CUTA A 1 offset(-64,89)//A_GiveInventory("KFCAmmo",1)
CUTA A 1 offset(-50,77)A_JumpIfInventory("PlayerPropertyRage",1,1)
CUTA A 1 offset(-36,66)//A_GiveInventory("KFCAmmo",1)
CUTA A 1 offset(-24,56)A_JumpIfInventory("PlayerPropertyRage",1,1)
CUTA A 1 offset(-14,47)//A_GiveInventory("KFCAmmo",1)
CUTA A 1 offset(-6,39)A_JumpIfInventory("PlayerPropertyRage",1,1)
CUTA A 0
CUTA A 0 A_JumpIfInventory("IsBot",1,"BotAltFire2")
Goto Ready2

BotFire:
CUTA A 0 A_JumpIfCloser(500,"BotFire2")
CUTA A 1 //A_GiveInventory("BotRevert",1)
goto Ready2
BotFire2:
CUTA A 0 A_JumpIfCloser(200,"BotAltFire")
goto Fire+1
BotFire3:
TNT1 A 0 A_Jump(128,"BotFireCheckJump")
Goto BotFireCheck
BotFireCheck:
TNT1 A 0 A_JumpIfCloser(1200,"BotFireCheckFlee")
TNT1 A 0 A_TakeInventory("BotRetreatFlag",999)
TNT1 A 1 A_GiveInventory("CutterFlag",1)
TNT1 A 0 A_JumpIfInventory("CutterFlag",40,"BotFireCheckEnd")
TNT1 A 0 A_JumpIfInventory("RollingCutterFlag",1,"BotFireCheckEnd")
loop
BotFireCheckFlee:
TNT1 A 0 A_GiveInventory("BotRetreatFlag",1)
goto BotFireCheck+2
BotFireCheckJump:
TNT1 A 0 A_Jump(200,2)
TNT1 A 0 A_GiveInventory("BotFloorJump")
TNT1 A 1 A_GiveInventory("CutterFlag",1)
TNT1 A 0 A_JumpIfInventory("CutterFlag",40,"BotFireCheckEnd")
TNT1 A 0 A_JumpIfInventory("RollingCutterFlag",1,"BotFireCheckEnd")
loop
BotFireCheckEnd:
TNT1 A 0 A_TakeInventory("BotRetreatFlag",1)
Goto FireEnd
BotAltFire:
CUTA A 0 A_GiveInventory("BotHugFlag",1)
Goto Altfire
BotAltFire2:
CUTA A 0 A_TakeInventory("BotHugFlag",999)
Goto Ready2
}
}

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

actor CutterReturned : OnceC{}

actor CutmanNoCutterF : OnceC{}

actor PowerCutCutterExtend : Powerup
{
Powerup.Duration 1
}

actor CutM_SliceDice : ProjSpawnFuncActor
{
PROJECTILE
Obituary "$OB_CUTTERSLICE"
//damagetype "Cut"
Damagetype "CutM_Slice"
+THRUGHOST
+SKYEXPLODE
+DONTBLAST
+RIPPER
+DONTSPLASH
+BOUNCEONWALLS
+BOUNCEONCEILINGS
//-BOUNCEONFLOORS
+NOEXPLODEFLOOR
Bouncecount 2
BounceFactor 1.0
WallBounceFactor 0.01//1.0
Damage (0)
Radius 5
Height 5
speed 35
Scale 2.5
States
{
Spawn:
RCTC L 1
RCTC M 1 A_Explode(40,52,0,0,52)
RCTC N 1
RCTC O 1 A_Explode(30,52,0,0,52)
stop
}
}
actor CutM_SliceDice0 : CutM_SliceDice
{
States
{
Spawn:
Slice:
RCTC "#" 2 A_Explode(40,52,0,0,52)
RCTC "#" 1 A_Explode(30,52,0,0,52)
stop
}
}
actor CutM_SliceDice1 : CutM_SliceDice
{
States
{
Spawn:
RCTC L 0
goto Slice
}
}
actor CutM_SliceDice2 : CutM_SliceDice0
{
States
{
Spawn:
RCTC M 0
goto Slice
}
}
actor CutM_SliceDice3 : CutM_SliceDice0
{
States
{
Spawn:
RCTC N 0
goto Slice
}
}
actor CutM_SliceDice4 : CutM_SliceDice0
{
States
{
Spawn:
RCTC O 0
goto Slice
}
}

actor CutM_Cutter : ProjSpawnFuncActor
{
var int user_TranslateWhiteColors;
PROJECTILE
Obituary "$OB_ROLLINGCUTTER"
damagetype "CutM_Cutter"
+RIPPER
+NOTARGETSWITCH
+SKYEXPLODE
//+DONTSPLASH
+SEEKERMISSILE
+BOUNCEONFLOORS
+BOUNCEONWALLS
+BOUNCEONCEILINGS
+ALLOWBOUNCEONACTORS
+CANBOUNCEWATER
bouncefactor 1.0
wallbouncefactor 1.0
ReactionTime 87//about 30 seconds
damage (0)
Radius 8
Height 8
speed 33
scale 2.5
States
{
Spawn:
RCTC A 0
RCTC A 0 A_PlaySound("weapon/FastCutter",1)
RCTC AAABBB 1 A_GiveInventory("CutM_CutterCheck_P")
RCTC A 0 A_PlaySound("weapon/FastCutter",1)
RCTC CCCDDD 1 A_GiveInventory("CutM_CutterCheck_P")
RCTC A 0 A_TakeFromTarget("CutterFlag",999)
RCTC A 0 A_PlaySound("weapon/FastCutter",1)
RCTC AAABBB 1 A_GiveInventory("CutM_CutterCheck_P")
RCTC A 0 A_PlaySound("weapon/FastCutter",1)
RCTC CCCDDD 1 A_GiveInventory("CutM_CutterCheck_P")

RCTC D 1 A_GiveInventory("CutM_CutterExtend_P",1)
RCTC D 0 A_JumpIfInventory("CutmanNoCutterF",1,"SpawnR")
SpawnHold:
RCTC A 0 A_PlaySound("weapon/FastCutter",1)
RCTC A 1 A_GiveInventory("CutM_CutterExtend_P",1)
RCTC A 0 A_JumpIfInventory("CutmanNoCutterF",1,"SpawnR")
RCTC A 1 A_GiveInventory("CutM_CutterExtend_P",1)
RCTC A 0 A_JumpIfInventory("CutmanNoCutterF",1,"SpawnR")
RCTC A 1 A_GiveInventory("CutM_CutterExtend_P",1)
RCTC A 0 A_JumpIfInventory("CutmanNoCutterF",1,"SpawnR")

RCTC B 1 A_GiveInventory("CutM_CutterExtend_P",1)
RCTC B 0 A_JumpIfInventory("CutmanNoCutterF",1,"SpawnR")
RCTC B 1 A_GiveInventory("CutM_CutterExtend_P",1)
RCTC B 0 A_JumpIfInventory("CutmanNoCutterF",1,"SpawnR")
RCTC B 1 A_GiveInventory("CutM_CutterExtend_P",1)
RCTC B 0 A_JumpIfInventory("CutmanNoCutterF",1,"SpawnR")

RCTC C 0 A_TakeFromTarget("CutterFlag",999)
RCTC C 0 A_PlaySound("weapon/FastCutter",1)
RCTC C 1 A_GiveInventory("CutM_CutterExtend_P",1)
RCTC C 0 A_JumpIfInventory("CutmanNoCutterF",1,"SpawnR")
RCTC C 1 A_GiveInventory("CutM_CutterExtend_P",1)
RCTC C 0 A_JumpIfInventory("CutmanNoCutterF",1,"SpawnR")
RCTC C 1 A_GiveInventory("CutM_CutterExtend_P",1)
RCTC C 0 A_JumpIfInventory("CutmanNoCutterF",1,"SpawnR")

RCTC D 1 A_GiveInventory("CutM_CutterExtend_P",1)
RCTC D 0 A_JumpIfInventory("CutmanNoCutterF",1,"SpawnR")
RCTC D 1 A_GiveInventory("CutM_CutterExtend_P",1)
RCTC D 0 A_JumpIfInventory("CutmanNoCutterF",1,"SpawnR")
RCTC D 1 A_GiveInventory("CutM_CutterExtend_P",1)
RCTC D 0 A_JumpIfInventory("CutmanNoCutterF",1,"SpawnR")
loop


SpawnR:
RCTC A 0 A_ChangeFlag(NOINTERACTION,1)
RCTC A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
RCTC A 0 A_RearrangePointers(AAPTR_DEFAULT,AAPTR_DEFAULT,AAPTR_TARGET)//Target >> Tracer
RCTC A 0 A_FaceTarget
Spawn2:
RCTC A 0 A_TakeFromTarget("CutterFlag",999)
RCTC A 0 A_PlaySound("weapon/FastCutter",1)
RCTC AA 0 A_SeekerMissile(90,90,SMF_PRECISE)
RCTC AAA 1 A_GiveInventory("CutM_CutterCheck2_P")
RCTC BB 0 A_SeekerMissile(90,90,SMF_PRECISE)
RCTC BBB 1 A_GiveInventory("CutM_CutterCheck2_P")
RCTC C 0 A_PlaySound("weapon/FastCutter",1)
RCTC CC 0 A_SeekerMissile(90,90,SMF_PRECISE)
RCTC CCC 1 A_GiveInventory("CutM_CutterCheck2_P")
RCTC DD 0 A_SeekerMissile(90,90,SMF_PRECISE)
RCTC DDD 1 A_GiveInventory("CutM_CutterCheck2_P")
RCTC A 0 A_CountDown
RCTC A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
loop
Spawn3:
RCTC A 0 A_TakeFromTarget("CutterFlag",999)
RCTC A 0 A_PlaySound("weapon/FastCutter",1)
RCTC AA 0 A_SeekerMissile(90,90,SMF_PRECISE)
RCTC AAA 1 A_GiveInventory("CutM_CutterCheck3_P")
RCTC BB 0 A_SeekerMissile(90,90,SMF_PRECISE)
RCTC BBB 1 A_GiveInventory("CutM_CutterCheck3_P")
RCTC C 0 A_PlaySound("weapon/FastCutter",1)
RCTC CC 0 A_SeekerMissile(90,90,SMF_PRECISE)
RCTC CCC 1 A_GiveInventory("CutM_CutterCheck3_P")
RCTC DD 0 A_SeekerMissile(90,90,SMF_PRECISE)
RCTC DDD 1 A_GiveInventory("CutM_CutterCheck3_P")
RCTC A 0 A_CountDown
RCTC A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
loop



SpawnR2:
RCTC A 0 //A_SpawnItemEx("CutM_CutterRet",0,0,0,0,0,0,0,1+32)
stop

Death:
RCTC A 0 A_JumpIfInventory("RollingCutterFlag",1,2)
RCTC A 0 A_GiveToTarget("RollingCutterFlag",1)
RCTC A 0
stop
}
}


actor CutM_CutterCheck_P : CustomInventory
{
States
{
Pickup:
//TNT1 A 0 A_SpawnItemEx("CutM_CutterPrang",0,0,-6,0,0,0,0,32)
TNT1 A 0 A_SpawnItemEx("CutM_CutterPrang",0,0,0,momx,momy,momz,0,32+8)
stop
}
}
actor CutM_CutterCheck2_P : CustomInventory
{
States
{
Pickup:
//TNT1 A 0 A_SpawnItemEx("CutM_CutterPrang",0,0,-6,0,0,0,0,32)
TNT1 A 0 A_JumpIfInTargetInventory("RollingCutterFlag",1,"Pickup1")
goto Pickup2
Pickup1:
TNT1 A 0 A_GiveInventory("RollingCutterFlag",1)
Pickup2:
TNT1 A 0 A_JumpIfCloser(58,2)
TNT1 A 0 A_SpawnItemEx("CutM_CutterPrang",0,0,0,momx,momy,momz,0,32+8)
stop
TNT1 A 0 A_CountDownArg(0)
stop
}
}
actor CutM_CutterCheck3_P : CutM_CutterCheck2_P{States{Pickup:goto Pickup2}}

actor CutM_CutterExtend_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("CutM_CutterCheck_P")
TNT1 A 0 A_JumpIfInTargetInventory("KFCAmmo",1,"Pickup1")
goto Pickup0
Pickup0:
TNT1 A 0 A_GiveInventory("CutmanNoCutterF",1)
stop
Pickup1:
TNT1 A 0 A_JumpIf(CallACS("cbm_GetPointerButtonInput",AAPTR_TARGET,true) & BT_ATTACK,"Pickup2")
goto Pickup0
Pickup2:
TNT1 A 0 A_JumpIfInTargetInventory("PlayerPropertySpread",1,"Spread")
TNT1 A 0 A_TakeFromTarget("KFCAmmo",1,1)
stop
Spread:
TNT1 A 0 A_JumpIfInTargetInventory("PowerCutCutterExtend",1,3)
TNT1 A 0 A_GiveToTarget("PowerCutCutterExtend",1)
TNT1 A 0 A_TakeFromTarget("KFCAmmo",1,1)
TNT1 A 0
stop
}
}

actor CutM_CutterPrang
{
PROJECTILE
damagetype "CutM_Cutter"
Obituary "$OB_ROLLINGCUTTER"
+RIPPER
+THRUGHOST
+DONTBLAST
+DONTSPLASH
Renderstyle None
damage (70+CallACS("core_checkrune",RUNE_RAGE,2)*35)//140
radius 16
height 16//28
States
{
Spawn:
TNT1 A 2//0
stop
}
}

actor CutM_CutterPrangR : CutM_CutterPrang
{
Obituary "$OB_ROLLINGCUTTER2"
}

actor Cutman_W_NormalBar : NormalBar {Args 4,94}