actor HeroicDuoFistBoss : BaseMM8BDMWep_CBM
{
tag "$TAGC_8I"
dropitem "DuoFistUpgrade2GiverDropped"
Weapon.AmmoUse 1
Weapon.AmmoGive 3
Weapon.SlotNumber 1
Obituary "$OB_DUOFIST"
Inventory.Pickupmessage "You got the Duo Fist?"
weapon.ammotype "BusterAmmo"
weapon.ammotype2 "DuoMeteorAmmo"
States
{
Spawn:
C_08 I 1
loop
Ready:
DUOF C 0 A_JumpIfInventory("Once",1,"Ready2")
DUOF C 0 ACS_ExecuteAlways(981,0,0)
DUOF C 0 A_GiveInventory("Once",1)
Goto Ready2
Ready2:
DUOF C 0 ACS_ExecuteAlways(998,0,DYE_DUOC)
DUOF C 0 ACS_ExecuteAlways(998,0,DYE_DUOC,1)
DUOF C 0 A_TakeInventory("WeaponCharge",999)
TNT1 A 0 A_TakeInventory("DuoFistCleaserFlag",500)
DUOF C 1 A_WeaponReady(WRF_ALLOWRELOAD)
TNT1 A 0 A_GiveInventory("DuoMeteorAmmo",2)
Goto Ready2+3
Ready3:
TNT1 A 0 A_GiveInventory("DuoMeteorBusy")
goto Ready2+3
Ready4:
TNT1 A 0 A_ChangeFlag("INVULNERABLE",0)
TNT1 A 0 A_TakeInventory("BasicArmor",9999)
TNT1 A 0 A_TakeInventory("IsInvunFlag",999)
TNT1 A 0 A_ChangeFlag("NOGRAVITY",0)
DUOF C 1
TNT1 A 0 A_ChangeFlag("INVULNERABLE",0)
TNT1 A 0 A_TakeInventory("BasicArmor",9999)
TNT1 A 0 A_TakeInventory("IsInvunFlag",999)
TNT1 A 0 A_ChangeFlag("NOGRAVITY",0)
DUOF C 1
TNT1 A 0 A_ChangeFlag("INVULNERABLE",0)
TNT1 A 0 A_TakeInventory("BasicArmor",9999)
TNT1 A 0 A_TakeInventory("IsInvunFlag",999)
TNT1 A 0 A_ChangeFlag("NOGRAVITY",0)
goto Ready2+2
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
DUOF C 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
DUOF C 1 A_Raise
Loop
Fire:
Hold:
DUOF C 0 A_JumpIfInventory("WeaponCharge",4,"Hold1")
DUOF D 1 A_GiveInventory("WeaponChargeRageCheck",1)
DUOF C 0 A_Refire
Goto User1fire
Hold1:
DUOF D 0 A_JumpIfInventory("WeaponCharge",10,"Hold2")
DUOF B 1 A_GiveInventory("WeaponChargeRageCheck",1)
DUOF D 0 A_Refire("Hold1")
Goto User1fire
Hold2:
DUOF H 0 A_JumpIfInventory("WeaponCharge",24,"Charge")
DUOF H 1 A_GiveInventory("WeaponChargeRageCheck",1)
DUOF H 0 A_Refire("Hold2.b")
Goto Fire2
Hold2.b:
DUOF B 0 A_JumpIfInventory("WeaponCharge",24,"Charge")
DUOF B 1 A_GiveInventory("WeaponChargeRageCheck",1)
DUOF B 0 A_Refire("Hold2.c")
Goto Fire2
Hold2.c:
DUOF B 0 A_JumpIfInventory("WeaponCharge",24,"Charge")
DUOF B 1 A_GiveInventory("WeaponChargeRageCheck",1)
DUOF B 0 A_Refire("Hold2.d")
Goto Fire2
Hold2.d:
DUOF B 0 A_JumpIfInventory("WeaponCharge",24,"Charge")
DUOF B 1 A_GiveInventory("WeaponChargeRageCheck",1)
DUOF B 0 A_Refire("Hold2")
Goto Fire2
Charge:
DUOF B 0 A_PlaySoundEx("weapon/DuoShotCharge","Weapon")
Goto Charge1
Charge1:
TNT1 A 0// A_GiveInventory("DuoMeteorAmmo",2)
DUOF B 0 A_JumpIfInventory("WeaponCharge",44,"Charge2Start")
DUOF H 1 ACS_ExecuteAlways(998,0,102,5)
DUOF B 0 A_Refire("Charge1.a")
Goto Fire2
Charge1.a:
TNT1 A 0// A_GiveInventory("DuoMeteorAmmo",2)
DUOF B 0 A_GiveInventory("WeaponChargeRageCheck",1)
DUOF B 1 ACS_ExecuteAlways(998,0,DYE_DUOC,1)
DUOF H 0 A_Refire("Charge1")
Goto Fire2

Charge2Start:
DUOF K 0 A_GiveInventory("WeaponCharge",1)
DUOF K 0 A_GunFlash
goto Charge2

Charge2:
DUOF K 0 ACS_ExecuteAlways(998,0,103,6)
TNT1 A 0// A_GiveInventory("DuoMeteorAmmo",2)
DUOF K 0 A_GiveInventory("DuoFistCleaserP",1)
DUOF K 1 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSWITCH)
DUOF K 0 A_Refire("Charge2.a")
Goto Fire3
Charge2.a:
DUOF I 0 ACS_ExecuteAlways(998,0,104,7)
TNT1 A 0// A_GiveInventory("DuoMeteorAmmo",2)
DUOF I 0 A_GiveInventory("DuoFistCleaserP",1)
DUOF I 1 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSWITCH)
DUOF I 0 A_Refire("Charge2.b")
Goto Fire3
Charge2.b:
TNT1 A 0 A_GiveInventory("DuoMeteorAmmo",2)
DUOF J 0 A_GiveInventory("DuoFistCleaserP",3)
DUOF J 0 ACS_ExecuteAlways(998,0,DYE_DUOC,1)
DUOF J 1 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSWITCH)
DUOF J 0 A_JumpIfInventory("IsBot",1,"BotFire")
DUOF J 0 A_Refire("Charge2")
Goto Fire3
Fire2:
DUOF B 0 A_TakeInventory("WeaponCharge",999)
DUOF B 0 ACS_ExecuteAlways(998,0,DYE_DUOC,1)
DUOF B 0 A_PlaySoundEx("weapon/DuoShot2","Weapon")
DUOF B 0 A_GiveInventory("DuoMain2_CI",1)
DUOF BLG 1
DUOF V 1 Offset(-32,64)
DUOF X 1 Offset(-42,74)
DUOF W 1 Offset(-52,84)
DUOF Y 1 Offset(-62,94)
DUOF V 1 Offset(-72,100)
DUOF C 1 Offset(-62,94)
DUOF C 1 Offset(-52,84)
DUOF C 1 Offset(-32,74)
DUOF C 1 Offset(-22,64)
DUOF C 1 Offset(-12,54)
DUOF C 1 Offset(-2,44)
DUOF D 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
DUOF C 18
DUOF B 0 A_Refire
goto Ready2+2
Fire3:
DUOF B 0 A_TakeInventory("WeaponCharge",999)
DUOF LLEEF 1
DUOF B 0
DUOF B 0 ACS_ExecuteAlways(998,0,DYE_DUOC,1)
DUOF B 0 A_PlaySoundEx("weapon/DuoShot3","Weapon")
DUOF B 0 A_GiveInventory("DuoMain3_CI",1)
DUOF G 1 offset(-3,35)
DUOF X 1 offset(-8,40)
DUOF Y 1 offset(-13,45)
DUOF W 1 offset(-18,50)
DUOF XVWYXVYWYWV 1
//DUOF DC 4 Offset(32,64)
DUOF G 1 Offset(-32,64)
DUOF G 1 Offset(-52,84)
DUOF G 1 Offset(-62,94)
DUOF G 1 Offset(-72,104)
DUOF G 1 Offset(-100,120)
DUOF C 1 Offset(-72,104)
DUOF C 1 Offset(-52,84)
DUOF C 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
DUOF B 0 A_Refire
goto Ready2+2

BotFire:
DUOF K 0 A_Jump(16,"Fire3")
DUOF K 0 A_Refire("Charge2")
Goto Fire3


Flash:
TNT1 A 5 A_PlaySoundEx("weapon/MM4Charge","Body")
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_JumpIfInventory("WeaponCharge",1,"Flash")
stop

User1Fire:
DUOF C 0 A_JumpIfNoAmmo("Hold")
DUOF C 0 A_PlaySoundEx("weapon/DuoShot1","Weapon")
DUOF C 0 A_GiveInventory("DuoMain1_CI",1)
DUOF C 0 A_TakeInventory("WeaponCharge",999)
DUOF G 1 A_TakeInventory("FistFlag",1)
Goto User1FireWait
User1FireWait:
DUOF G 1
DUOF G 0 A_GiveInventory("AdapterWaitCount",1)
DUOF G 0 A_JumpIfInventory("AdapterWaitCount",35,"User1FireFinish")
DUOF G 0 A_JumpIfInventory("FistFlag",1,"User1FireFinish")
loop
User1FireFinish:
DUOF G 0 A_PlayWeaponSound("weapon/adapterreturn")
DUOF G 0 A_TakeInventory("FistFlag",1)
DUOF G 0 A_JumpIfInventory("AdapterWaitCount",8,2)
DUOF D 4
DUOF G 0 A_TakeInventory("AdapterWaitCount",999)
DUOF DC 4
Goto Ready2+2

BotFire:
DUOF K 0 A_Jump(16,"Fire3")
DUOF K 0 A_Refire("Charge2")
Goto Fire3


Flash:
TNT1 A 5 A_PlaySoundEx("weapon/MM4Charge","Body")
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_JumpIfInventory("WeaponCharge",1,"Flash")
stop

User1Fire:
DUOF C 0 //A_JumpIfNoAmmo("Hold")
DUOF C 0 A_PlaySoundEx("weapon/DuoShot1","Weapon")
DUOF C 0 A_GiveInventory("DuoMain1_CI",1)
DUOF C 0 A_TakeInventory("WeaponCharge",999)
DUOF G 1 A_TakeInventory("FistFlag",1)
Goto User1FireWait
User1FireWait:
DUOF G 1
DUOF G 0 A_GiveInventory("AdapterWaitCount",1)
DUOF G 0 A_JumpIfInventory("AdapterWaitCount",35,"User1FireFinish")
DUOF G 0 A_JumpIfInventory("FistFlag",1,"User1FireFinish")
loop
User1FireFinish:
DUOF G 0 A_PlayWeaponSound("weapon/adapterreturn")
DUOF G 0 A_TakeInventory("FistFlag",1)
DUOF G 0 A_JumpIfInventory("AdapterWaitCount",8,2)
DUOF D 4
DUOF G 0 A_TakeInventory("AdapterWaitCount",999)
DUOF DC 4
Goto Ready2+2

Altfire:
DUOF C 0 A_JumpIfInventory("CopySlideUseDelay",1,"NoAmmo")
TNT1 A 0 ACS_ExecuteAlways(998,0,DYE_DUOC,1)
TNT1 A 0 ACS_ExecuteAlways(991,0,DYE_DUOC,1)
DUOF M 0 A_JumpIfInventory("DuoFistCleaserFlag",100,"DuoSlamming")
DUOF M 0 A_JumpIf(ACS_NamedExecuteWithResult("cbm_user1_check")==1, "User1Fire")
goto SlideSlide
SlideSlide:
TNT1 A 0 A_TakeInventory("WeaponCharge",9000)
DUOL N 0 A_GiveInventory("DuoBash",1)
DUOL N 0 A_PlaySoundEx("weapon/chargekick","Weapon")
DUOL N 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_JumpZ,0,1)
DUOL N 0 SetPlayerProperty(0,1,0)
DUOL N 0 A_FireCustomMissile("DuoRam2",0,0,0,0)
DUOL N 0 ThrustThingZ(0,0,1,0)
DUOF C 1 A_GiveInventory("CopySlidePickup",1)
DUOL N 0 ThrustThingZ(0,0,1,0)
DUOF C 1 Offset(-15,41)
DUOF C 1 Offset(-78,98)
TNT1 A 1 Offset(-78,200)
TNT1 A 1 A_GiveInventory("CautiousDuoSlideDesync_P",1)
DUOL N 1 Offset(120,39)
DUOL N 1 Offset(60,35)
DUOL N 1 Offset(-20,33)
DUOL N 1 Offset(-22,35)
DUOL N 1 Offset(-24,36)
DUOL N 1 Offset(-26,37)
DUOL N 1 Offset(-26,38)
DUOL N 1 Offset(-26,39)
DUOL N 1 Offset(-26,40)
DUOL N 1 Offset(-26,41)
DUOL N 1 Offset(-26,42)
DUOL N 1 Offset(-24,43)
DUOL N 1 Offset(-22,44)
DUOL N 1 Offset(-20,45)
DUOL N 1 Offset(-15,46)
DUOL N 1 Offset(-10,47)
DUOL N 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_JumpZ,10,1)
DUOL N 0 SetPlayerProperty(0,0,0)
//DUOL N 6
DUOL M 1 Offset(15,49)
DUOL M 1 Offset(39,51)
DUOL M 1 Offset(78,53)
TNT1 A 1 Offset(78,200)
TNT1 A 1
DUOF C 1 Offset(-78,98)
DUOF C 1 Offset(-39,62)
DUOF C 1 Offset(-15,41)
DUOF C 1 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSWITCH)
DUOL M 0 A_TakeInventory("DuoBash",1)
DUOF C 1 A_Refire
DUOF C 0 ACS_ExecuteAlways(998,0,DYE_DUOC,1)
goto Ready2+2

DuoGrab:
TNT1 A 0 ACS_NamedExecuteAlways("BULL_SetState",0,2)
TNT1 A 0 A_TakeInventory("WeaponCharge",999)
TNT1 A 0 ACS_ExecuteAlways(998,0,DYE_DUOC,1)
TNT1 A 0 A_PlaySoundEx("weapon/chargekick","Weapon")
TNT1 A 0 A_JumpIfInventory("ImpairmentStack",1,"DuoGrabI")
TNT1 A 0 A_Recoil(-50)
TNT1 A 0 A_StopSoundEx("Body")
DUOF C 1 A_SpawnItemEx("DuoCleanserGrabber",8,0,-8,momx,momy,momz,0,8)
DUOF C 0 A_StopSoundEx("Body")
DUOF D 1 A_SpawnItemEx("DuoCleanserGrabber",8,0,-8,momx,momy,momz,0,8)
DUOF D 0 A_StopSoundEx("Body")
goto DuoGrabLoop
DuoGrabI:
TNT1 A 0 A_Recoil(-50*ACS_NamedExecuteWithResult("ImpairmentACS")/100)
TNT1 A 0 A_StopSoundEx("Body")
DUOF C 1 A_SpawnItemEx("DuoCleanserGrabber",8,0,-8,momx,momy,momz,0,8)
DUOF C 0 A_StopSoundEx("Body")
DUOF D 1 A_SpawnItemEx("DuoCleanserGrabber",8,0,-8,momx,momy,momz,0,8)
DUOF D 0 A_StopSoundEx("Body")
goto DuoGrabLoop

DuoGrabLoop:
DUOF E 1 A_SpawnItemEx("DuoCleanserGrabber",8,0,-8,momx,momy,momz,0,8)
DUOF E 0 A_StopSoundEx("Body")
DUOF E 0 A_GiveInventory("WeaponChargeDuo",1)
TNT1 A 0 A_JumpIfInventory("SuplexID",1,"GrabWait")
TNT1 A 0 A_JumpIfInventory("WeaponChargeDuo",18,"DuoGrabFail")
goto DuoGrabLoop

DuoGrabFail:
DUOF EDC 1 A_TakeInventory("WeaponChargeDuo",999)
DUOF C 0 A_TakeInventory("DuoFistCleaserFlag",500)
goto Ready4

GrabWait:
DUOF F 0 A_GiveInventory("IsPerformingSuplex",1)
DUOF F 0 A_GiveInventory("ThorIsGrabbingF",1)
DUOF F 0 A_TakeInventory("ThorIsLungingF",999)
DUOF F 0 A_PlaySoundEx("weapon/crashland", "Weapon")
DUOF F 0 A_Stop
DUOF F 0 A_GiveInventory("DuoArmorUp",1)
DUOF F 0 ACS_NamedExecuteAlways("BULL_SetState",0,3)
DUOF F 1 ACS_NamedExecuteAlways("cbm_ZangiefStartGrab",0,CallACS("cbm_ZangiefCountInv",2)+999)
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")
DUOF F 1 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"GrabTrueWait")

GrabTrueWait:
TNT1 A 0 A_JumpIfInventory("DuoFistCleaserFlag",500,"GrabExplode5")
TNT1 A 0 A_JumpIfInventory("DuoFistCleaserFlag",400,"GrabExplode4")
TNT1 A 0 A_JumpIfInventory("DuoFistCleaserFlag",300,"GrabExplode3")
TNT1 A 0 A_JumpIfInventory("DuoFistCleaserFlag",200,"GrabExplode2")
goto GrabExplode1

GrabExplode5:
TNT1 A 0 A_SpawnItemEx("DuoGrabExplosion5",20,0,0,0,0,0,0,1)
goto GrabExplodeEnd

GrabExplode4:
TNT1 A 0 A_SpawnItemEx("DuoGrabExplosion4",20,0,0,0,0,0,0,1)
goto GrabExplodeEnd

GrabExplode3:
TNT1 A 0 A_SpawnItemEx("DuoGrabExplosion3",20,0,0,0,0,0,0,1)
goto GrabExplodeEnd

GrabExplode2:
TNT1 A 0 A_SpawnItemEx("DuoGrabExplosion2",20,0,0,0,0,0,0,1)
goto GrabExplodeEnd

GrabExplode1:
TNT1 A 0 A_SpawnItemEx("DuoGrabExplosion1",20,0,0,0,0,0,0,1)
goto GrabExplodeEnd

GrabExplodeEnd:
DUOF XVWYXVY 1
TNT1 A 0 A_TakeInventory("DuoFistCleaserFlag",500)
DUOF X 1 Offset(-32,64)
DUOF W 1 Offset(-52,84)
DUOF V 1 Offset(-62,94)
DUOF Y 1 Offset(-72,104)
DUOF W 1 Offset(-100,120) A_TakeInventory("BasicArmor",9999)
DUOF C 1 Offset(-72,104) A_TakeInventory("BasicArmor",9999)
DUOF C 1 Offset(-52,84) A_TakeInventory("BasicArmor",9999)
DUOF C 1 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSWITCH)
TNT1 A 0 A_TakeInventory("IsPerformingSuplex",999)
TNT1 A 0 A_TakeInventory("ThorIsGrabbingF",999)
TNT1 A 0 A_TakeInventory("WeaponChargeDuo",999)
TNT1 A 0 A_GiveInventory("RaThorSuplexReset_P",1)

TNT1 A 0 A_TakeInventory("BasicArmor",9999)
TNT1 A 0 A_ChangeFlag("NOGRAVITY",0)
TNT1 A 0 A_GiveInventory("DuoMeteorBusy",1)
goto Ready4

DuoSlamming:
TNT1 A 0 ACS_NamedExecuteAlways("BULL_SetState",0,2)
TNT1 A 0 A_TakeInventory("WeaponCharge",999)
TNT1 A 0 ACS_ExecuteAlways(998,0,DYE_DUOC,1)
TNT1 A 0 ACS_ExecuteAlways(991,0,DYE_DUOC,1)
DUOF F 0 A_PlaySoundEx("weapon/crashland", "Body")
TNT1 A 0 A_JumpIfInventory("DuoFistCleaserFlag",500,"DuoSlamThrust5")
TNT1 A 0 A_JumpIfInventory("DuoFistCleaserFlag",400,"DuoSlamThrust4")
TNT1 A 0 A_JumpIfInventory("DuoFistCleaserFlag",300,"DuoSlamThrust3")
TNT1 A 0 A_JumpIfInventory("DuoFistCleaserFlag",200,"DuoSlamThrust2")
TNT1 A 0 A_JumpIfInventory("ImpairmentStack",1,"DuoSlamThrust1I")
DUPH E 1 A_ChangeVelocity(30*cos(pitch),0,30*-sin(pitch),3)
goto DuoSlammingLoop
DuoSlamThrust1I:
DUPH E 1 A_ChangeVelocity((30*ACS_NamedExecuteWithResult("ImpairmentACS")/100)*cos(pitch),0,(30*ACS_NamedExecuteWithResult("ImpairmentACS")/100)*-sin(pitch),3)
goto DuoSlammingLoop
DuoSlamThrust5:
TNT1 A 0 A_JumpIfInventory("ImpairmentStack",1,"DuoSlamThrust5I")
DUPH E 1 A_ChangeVelocity(50*cos(pitch),0,50*-sin(pitch),3)
goto DuoSlammingLoop
DuoSlamThrust5I:
DUPH E 1 A_ChangeVelocity((50*ACS_NamedExecuteWithResult("ImpairmentACS")/100)*cos(pitch),0,(50*ACS_NamedExecuteWithResult("ImpairmentACS")/100)*-sin(pitch),3)
goto DuoSlammingLoop
DuoSlamThrust4:
TNT1 A 0 A_JumpIfInventory("Impairmentstack",1,"DuoSlamThrust4I")
DUPH E 1 A_ChangeVelocity(45*cos(pitch),0,45*-sin(pitch),3)
goto DuoSlammingLoop
DuoSlamThrust4I:
DUPH E 1 A_ChangeVelocity((45*ACS_NamedExecuteWithResult("ImpairmentACS")/100)*cos(pitch),0,(45*ACS_NamedExecuteWithResult("ImpairmentACS")/100)*-sin(pitch),3)
goto DuoSlammingLoop
DuoSlamThrust3:
TNT1 A 0 A_JumpIfInventory("ImpairmentStack",1,"DuoSlamThrust3I")
DUPH E 1 A_ChangeVelocity(40*cos(pitch),0,40*-sin(pitch),3)
goto DuoSlammingLoop
DuoSlamThrust3I:
DUPH E 1 A_ChangeVelocity((40*ACS_NamedExecuteWithResult("ImpairmentACS")/100)*cos(pitch),0,(40*ACS_NamedExecuteWithResult("ImpairmentACS")/100)*-sin(pitch),3)
goto DuoSlammingLoop
DuoSlamThrust2:
TNT1 A 0 A_JumpIfInventory("ImpairmentStack",1,"DuoSlamThrust2I")
DUPH E 1 A_ChangeVelocity(35*cos(pitch),0,35*-sin(pitch),3)
goto DuoSlammingLoop
DuoSlamThrust2I:
DUPH E 1 A_ChangeVelocity((35*ACS_NamedExecuteWithResult("ImpairmentACS")/100)*cos(pitch),0,(35*ACS_NamedExecuteWithResult("ImpairmentACS")/100)*-sin(pitch),3)
goto DuoSlammingLoop

DuoSlammingLoop:
TNT1 A 0 A_SpawnItemEx("DuoCleanserGrabber",8,0,-8,momx,momy,momz,0,8)
DUPH D 1 ThrustThingZ(0,1,1,1)
TNT1 A 0 A_JumpIf(z-floorz == 0,"DuoSlammingLoopEnd")
TNT1 A 0 A_JumpIfInventory("SuplexID",1,"DuoSlammingLoopWaitS")
loop
DuoSlammingLoopWaitS:
DUOF F 0 A_GiveInventory("IsPerformingSuplex",1)
DUOF F 0 A_GiveInventory("ThorIsGrabbingF",1)
DUOF F 0 A_TakeInventory("ThorIsLungingF",999)
DUOF F 0 ACS_NamedExecuteAlways("cbm_ZangiefStartGrab",0,CallACS("cbm_ZangiefCountInv",2)+999)
DuoSlammingLoopWait:
DUOF E 0 A_GiveInventory("WeaponChargeDuo",1)
TNT1 A 0 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"DuoSlammingLoopEnd")
DUPH D 1 ThrustThingZ(0,1,1,1)
TNT1 A 0 A_JumpIf(z-floorz == 0,"DuoSlammingLoopEnd")
TNT1 A 0 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"DuoSlammingLoopEnd")
DUPH D 1 ThrustThingZ(0,1,1,1)
TNT1 A 0 A_JumpIf(z-floorz == 0,"DuoSlammingLoopEnd")
TNT1 A 0 A_Jumpif(CallACS("cbm_ZangiefGrab",350,angle*256/360,70)==0,"DuoSlammingLoopEnd")
DUPH D 1 ThrustThingZ(0,1,1,1)
TNT1 A 0 A_JumpIf(z-floorz == 0,"DuoSlammingLoopEnd")
loop
DuoSlammingLoopEnd:
TNT1 A 0 A_TakeInventory("IsPerformingSuplex",999)
TNT1 A 0 A_TakeInventory("ThorIsGrabbingF",999)
TNT1 A 0 A_GiveInventory("RaThorSuplexReset_P",1)
TNT1 A 0 A_Stop
DUPH H 1
TNT1 A 0 A_PlaySoundEx("classes/drillexplode","Weapon")
TNT1 A 0 A_PlaySound("weapon/DuoShot3","Weapon")
TNT1 A 0 A_JumpIfInventory("DuoFistCleaserFlag",500,"SlamExplode5")
TNT1 A 0 A_JumpIfInventory("DuoFistCleaserFlag",400,"SlamExplode4")
TNT1 A 0 A_JumpIfInventory("DuoFistCleaserFlag",300,"SlamExplode3")
TNT1 A 0 A_JumpIfInventory("DuoFistCleaserFlag",200,"SlamExplode2")
goto SlamExplode1

SlamExplode5:
TNT1 A 0 A_SpawnItemEx("DuoShockWave5",20,0,0,30,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("DuoShockWave5",20,0,0,30.5,0,0,7,1)
TNT1 A 0 A_SpawnItemEx("DuoShockWave5",20,0,0,30.5,0,0,-7,1)
goto SlamExplodeEnd

SlamExplode4:
TNT1 A 0 A_SpawnItemEx("DuoShockWave4",20,0,0,30,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("DuoShockWave4",20,0,0,30.5,0,0,7,1)
TNT1 A 0 A_SpawnItemEx("DuoShockWave4",20,0,0,30.5,0,0,-7,1)
goto SlamExplodeEnd

SlamExplode3:
TNT1 A 0 A_SpawnItemEx("DuoShockWave3",20,0,0,30,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("DuoShockWave3",20,0,0,30.5,0,0,7,1)
TNT1 A 0 A_SpawnItemEx("DuoShockWave3",20,0,0,30.5,0,0,-7,1)
goto SlamExplodeEnd

SlamExplode2:
TNT1 A 0 A_SpawnItemEx("DuoShockWave2",20,0,0,30,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("DuoShockWave2",20,0,0,30.5,0,0,7,1)
TNT1 A 0 A_SpawnItemEx("DuoShockWave2",20,0,0,30.5,0,0,-7,1)
goto SlamExplodeEnd

SlamExplode1:
TNT1 A 0 A_SpawnItemEx("DuoShockWave1",20,0,0,30,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("DuoShockWave1",20,0,0,30.5,0,0,7,1)
TNT1 A 0 A_SpawnItemEx("DuoShockWave1",20,0,0,30.5,0,0,-7,1)
goto SlamExplodeEnd

SlamExplodeEndGrab:
TNT1 A 0 A_SpawnItemEx("DuoSlamGrabExplosion",20,0,10,0,0,0,0,1)
goto SlamExplodeEnd+1
SlamExplodeEnd:
TNT1 A 0 A_JumpIfInventory("WeaponChargeDuo",1,"SlamExplodeEndGrab")
DUPH HIIIIII 1
TNT1 A 0 A_TakeInventory("DuoFistCleaserFlag",999)
DUOF C 1 Offset(0,50)
DUOF C 1 Offset(0,40)
DUOF C 1 Offset(0,30)
DUOF C 1 Offset(0,20)
DUOF C 1 Offset(0,10)
TNT1 A 0 A_TakeInventory("WeaponChargeDuo",999)
DUOF C 1 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSWITCH)
goto Ready4

NoAmmo:
DUOF C 1 //ACS_Execute(979,0)
Goto Ready2+2

Reload:
DUOF C 1
DUOF C 0 A_JumpIfInventory("DuoMeteorBusy",1,"ReloadNo")
DUOF C 0 A_JumpIfInventory("DuoFistCleaserFlag",1,"ReloadNo")
DUOF C 0 A_JumpIfInventory("DuoMeteorAmmo",0,"Reload2")
goto ReloadNo
Reload2:
TNT1 A 0 A_TakeInventory("DuoMeteorAmmo",1)
TNT1 A 0 A_PlaySoundEx("item/refill","Voice")
TNT1 A 0 A_GiveInventory("DuoMeteorItemDelay",1)
TNT1 A 0 A_SpawnItemEx("DuoMeteorItemHelper")//A_GiveInventory("DuoMeteorActivate",1)
goto Ready2+2
ReloadNo:
DUOF C 0 A_GiveInventory("DuoMeteorAmmo",4)
DUOF C 1
goto Ready2+2
}
}


actor WeaponChargeDuo : Inventory
{
inventory.amount 1
inventory.maxamount 18
}

actor DuoMeteorBusy : Powerup
{
powerup.duration 35
+INVENTORY.ADDITIVETIME
}

actor DuoMeteorAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 280
+INVENTORY.IGNORESKILL
}

actor DuoArmorUp : BasicArmorPickup
{
Armor.Savepercent 30.001
Armor.Saveamount 50
//Armor.MaxSaveAmount 20
}

actor DuoSlamArmorUp : BasicArmorPickup
{
Armor.Savepercent 80.001
Armor.Saveamount 10
//Armor.MaxSaveAmount 20
}

actor DuoFistCleaserFlag : Once {inventory.maxamount 500}
actor DUOFoopFlag : DuoFistCleaserFlag {}
actor DuoHandMassage : Once {}
actor DuoFlag : Once {}
actor DuoSlamAnimFlag : PowerUp {powerup.duration 10}

actor DuoFistCleaserP : CustomInventory
{
	States
	{
		Pickup:
			TNT1 A 0 A_JumpIfInventory("DuoUpGradeFlag",1,"CleanserX2")
			TNT1 A 0 A_GiveInventory("DuoFistCleaserFlag",3)
			stop
			CleanserX2:
			TNT1 A 0 A_GiveInventory("DuoFistCleaserFlag",4)
			stop
	}
}

actor DuoRam2
{
PROJECTILE
var int user_POWER;
damagetype "Duo_Meteor"
Obituary "$OB_DUORAM"
+DONTBLAST
+DONTREFLECT
+THRUGHOST

Bouncetype Hexen
-ALLOWBOUNCEONACTORS
+CANBOUNCEWATER
+NOEXPLODEFLOOR
BounceFactor 1.0
WallBounceFactor 1.0//Desync fix?
BounceCount 0

ReactionTime 10
damage (24 - user_POWER)
Radius 18
Height 25
speed 10
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Warp(2,24,0,16,0,72)
TNT1 A 0 A_CountDown
TNT1 A 1 A_Warp(2,24,0,16,0,72)
TNT1 A 0 A_CountDown
SpawnLoop:
TNT1 A 1 A_Warp(2,24,0,16,0,72)
TNT1 A 0 A_SetUserVar("user_POWER",user_POWER + 10)
TNT1 A 0 A_CountDown
loop
Death:
TNT1 A 1
stop
}
}

actor CautiousDuoSlideDesync_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0
TNT1 A 0 A_GiveInventory("CopySlideUseDelay",1)
stop
}
}

actor DuoShockWave1
{
PROJECTILE
damagetype "DuoWave"
Obituary "$OB_ODUOWAVE"
+MISSILE
+STEPMISSILE
+THRUGHOST
+RIPPER
+NOEXPLODEFLOOR
Damage (0)
Radius 24
Height 24
Speed 30
Scale 2.0
ReactionTime 5
States
{
Spawn:
DUOR T 0
TNT1 A 1 A_SpawnItemEx("DuoShockWaveSpawned",0,0,0,0,0,0,0,1)
TNT1 A 0 ThrustThingZ(0,300,1,0)
TNT1 A 0 A_GiveInventory("CutterFlag",1)
DUOR T 0 A_Countdown
TNT1 A 0 A_JumpIfInventory("CutterFlag",5,"Spawn2")
loop
Spawn2:
TNT1 A 1 A_SpawnItemEx("DuoShockWaveSpawned2",0,0,0,0,0,0,0,1)
TNT1 A 0 ThrustThingZ(0,300,1,0)
TNT1 A 0 A_GiveInventory("CutterFlag",1)
DUOR T 0 A_Countdown
TNT1 A 0 A_JumpIfInventory("CutterFlag",10,"Spawn3")
loop
Spawn3:
TNT1 A 1 A_SpawnItemEx("DuoShockWaveSpawned3",0,0,0,0,0,0,0,1)
TNT1 A 0 ThrustThingZ(0,300,1,0)
TNT1 A 0 A_GiveInventory("CutterFlag",1)
DUOR T 0 A_Countdown
TNT1 A 0 A_JumpIfInventory("CutterFlag",15,"Spawn4")
loop
Spawn4:
TNT1 A 1 A_SpawnItemEx("DuoShockWaveSpawned4",0,0,0,0,0,0,0,1)
TNT1 A 0 ThrustThingZ(0,300,1,0)
TNT1 A 0 A_GiveInventory("CutterFlag",1)
DUOR T 0 A_Countdown
TNT1 A 0 A_JumpIfInventory("CutterFlag",20,"Spawn5")
loop
Spawn5:
TNT1 A 1 A_SpawnItemEx("DuoShockWaveSpawned5",0,0,0,0,0,0,0,1)
TNT1 A 0 ThrustThingZ(0,300,1,0)
DUOR T 0 A_Countdown
loop
XDeath:
TNT1 A 1 //A_Log("I HIT A PLAYER")
stop
Death:
TNT1 A 1
stop
}
}

actor DuoShockWave2 : DuoShockWave1 {ReactionTime 10}
actor DuoShockWave3 : DuoShockWave1 {ReactionTime 15}
actor DuoShockWave4 : DuoShockWave1 {ReactionTime 20}
actor DuoShockWave5 : DuoShockWave1 {ReactionTime 25}

actor DuoShockWaveSpawned
{
PROJECTILE
Translation "192:192=192:192"
damagetype "DuoWave"
Obituary "$OB_DUOWAVE"
+STEPMISSILE
-NOGRAVITY
gravity 100
Damage (20)
Radius 24
Height 24
Speed 30
YScale 2.0
XScale 1.8
ReactionTime 6
States
{
Spawn:
DUOR T 0
DUOR T 1
DUOR T 0 A_Countdown
goto Spawn2
Spawn2:
DUOR T 1 A_FadeOut(0.10)
DUOR T 0 A_Countdown
loop
XDeath:
TNT1 A 1 //A_Log("I HIT A PLAYER")
stop
Death:
DUOR T 1 A_FadeOut(0.10)
loop
}
}

actor DuoShockWaveSpawned2 : DuoShockWaveSpawned {DamageType "DuoWave2" Height 20 YScale 1.6}
actor DuoShockWaveSpawned3 : DuoShockWaveSpawned {DamageType "DuoWave3" Height 16 YScale 1.2}
actor DuoShockWaveSpawned4 : DuoShockWaveSpawned {DamageType "DuoWave4" Height 12 YScale 0.8}
actor DuoShockWaveSpawned5 : DuoShockWaveSpawned {DamageType "DuoWave5" Height 8 YScale 0.4}

actor DuoWaveProtect : PowerProtection
{
Powerup.Duration 6
DamageFactor "DuoWave", 0.0
DamageFactor "DuoWave2", 0.0
DamageFactor "DuoWave3", 0.0
DamageFactor "DuoWave4", 0.0
DamageFactor "DuoWave5", 0.0
}

actor DuoWaveThrustSpeed1 : PowerSpeed
{
Powerup.Duration 11
Speed 0.1
}

actor DuoWaveThrustSpeed2 : PowerSpeed
{
Powerup.Duration 12
Speed 0.1
}

actor DuoWaveThrustSpeed3 : PowerSpeed
{
Powerup.Duration 13
Speed 0.1
}

actor DuoWaveThrustSpeed4 : PowerSpeed
{
Powerup.Duration 14
Speed 0.1
}

actor DuoWaveThrustSpeed5 : PowerSpeed
{
Powerup.Duration 15
Speed 0.1
}

actor DuoSlamGrabExplosion : BasicExplosion
{
RenderStyle Translucent
Alpha 0.75
Scale 5
Damagetype "DMGNoHitstun"
Obituary "$OB_DUOCSLAM"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Quake(1,350,0,100,0)
TNT1 A 0 A_PlaySound("classes/drillexplode",CHAN_WEAPON,0.5)
TNT1 A 0 A_Explode(2+CallACS("DuoSlamCounter")*10,96,0,0,48)
TA_C ABCDEF 1
stop
}
}

actor DuoWaveThrustFX1 : BasicHelper
{
ReactionTime 11
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_GiveToTarget("DuoWaveThrustFX_P")
TNT1 A 0 A_CountDown
loop
}
}

actor DuoWaveThrustFX2 : DuoWaveThrustFX1 {ReactionTime 12}
actor DuoWaveThrustFX3 : DuoWaveThrustFX1 {ReactionTime 13}
actor DuoWaveThrustFX4 : DuoWaveThrustFX1 {ReactionTime 14}
actor DuoWaveThrustFX5 : DuoWaveThrustFX1 {ReactionTime 15}

actor DuoWaveThrustFX_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("DuoWaveThrustFX",Random(-20,20),Random(-20,20),Random(0,60),0,0,0,0,1)
stop
}
}

actor DuoWaveThrustFX : BasicClientSide
{
Scale 2.5
States
{
Spawn:
TNT1 A 0
MXP1 B 1 
MXP1 B 1 A_SetScale(2.25)
MXP1 B 1 A_SetScale(2)
MXP1 B 1 A_SetScale(1.75)
MXP1 B 1 A_SetScale(1.50)
MXP1 B 1 A_SetScale(1.25)
MXP1 B 1 A_SetScale(1)
MXP1 B 1 A_SetScale(0.75)
MXP1 B 1 A_SetScale(0.50)
MXP1 B 1 A_SetScale(0.25)
stop
}
}