actor DuoFistBoss : 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 "HereComesAGiantFistAmmo"
States
{
Spawn:
C_08 I 1
loop
Ready:
DUOL C 0 A_JumpIfInventory("Once",1,"Ready2")
DUOL C 0 ACS_ExecuteAlways(981,0,0)
DUOL C 0 A_GiveInventory("Once",1)
Goto Ready2
Ready2:
DUOL C 0 ACS_ExecuteAlways(998,0,DYE_DUOC)
DUOL C 0 ACS_ExecuteAlways(998,0,DYE_DUOC,1)
DUOL C 0 A_TakeInventory("WeaponCharge",999)
DUOL C 1 A_WeaponReady
Goto Ready2+3
Deselect:
DUOL CCCCCCCCCCCCCCCCCCCCCC 0 A_Lower
DUOL C 1 A_Lower
Loop
Select:
DUOL CCCCCCCCCCCCCCCCCCCCCC 0 A_Raise
DUOL C 1 A_Raise
Loop
Fire:
DUOL C 0 A_JumpIfNoAmmo("Hold")
DUOL C 0 A_PlaySoundEx("weapon/DuoShot1","Weapon")
DUOL C 0 A_GiveInventory("DuoMain1_CI",1)
DUOL C 0 A_TakeInventory("WeaponCharge",999)
DUOL G 1 A_TakeInventory("FistFlag",1)
Goto FistWait
FistWait:
DUOL G 1
DUOL G 0 A_GiveInventory("AdapterWaitCount",1)
DUOL G 0 A_JumpIfInventory("AdapterWaitCount",35,"FistFinish")
DUOL G 0 A_JumpIfInventory("FistFlag",1,"FistFinish")
loop
FistFinish:
DUOL G 0 A_PlaySound("weapon/adapterreturn",1)
DUOL G 0 A_TakeInventory("FistFlag",1)
DUOL G 0 A_JumpIfInventory("AdapterWaitCount",8,2)
DUOL D 4
DUOL G 0 A_TakeInventory("AdapterWaitCount",999)
DUOL DC 4
DUOL B 0 A_Refire
Goto Ready2+2
Fire2:
DUOL B 0 A_TakeInventory("WeaponCharge",999)
DUOL B 0 ACS_ExecuteAlways(998,0,DYE_DUOC,1)
DUOL B 0 A_PlaySoundEx("weapon/DuoShot2","Weapon")
DUOL B 0 A_GiveInventory("DuoMain2_CI",1)
DUOL CD 1
DUOL G 16
DUOL DC 4
DUOL B 0 A_Refire
goto Ready2+2
Fire3:
DUOL B 0 A_TakeInventory("WeaponCharge",999)
DUOL B 0
DUOL B 0 ACS_ExecuteAlways(998,0,DYE_DUOC,1)
DUOL B 0 A_PlaySoundEx("weapon/DuoShot3","Weapon")
DUOL B 0 A_GiveInventory("DuoMain3_CI",1)
DUOL EF 2
DUOL G 16
DUOL DC 4
DUOL B 0 A_Refire
goto Ready2+2

Hold:
DUOL C 0 A_JumpIfInventory("WeaponCharge",4,"Hold1")
DUOL C 1 A_GiveInventory("WeaponCharge_RC",1)
DUOL C 0 A_Refire
Goto Ready2+2
Hold1:
DUOL D 0 A_JumpIfInventory("WeaponCharge",10,"Hold2")
DUOL D 1 A_GiveInventory("WeaponCharge_RC",1)
DUOL D 0 A_Refire("Hold1")
Goto Ready2+2
Hold2:
DUOL B 0 A_JumpIfInventory("WeaponCharge",24,"Charge")
DUOL B 1 A_GiveInventory("WeaponCharge_RC",1)
DUOL B 0 A_Refire("Hold2")
Goto Fire2
Charge:
DUOL B 0 A_PlaySoundEx("weapon/DuoShotCharge","Weapon")
Goto Charge1
Charge1:
DUOL B 0 A_JumpIfInventory("WeaponCharge",44,"Charge2Start")
DUOL H 1 ACS_ExecuteAlways(998,0,102,5)
DUOL B 0 A_Refire("Charge1.a")
Goto Fire2
Charge1.a:
DUOL B 0 A_GiveInventory("WeaponCharge_RC",1)
DUOL B 1 ACS_ExecuteAlways(998,0,DYE_DUOC,1)
DUOL H 0 A_Refire("Charge1")
Goto Fire2
Charge2Start:
DUOL K 0 A_GiveInventory("WeaponCharge",1)
DUOL K 0 A_GunFlash
goto Charge2
Charge2:
DUOL K 1 ACS_ExecuteAlways(998,0,103,6)
DUOL I 0 A_Refire("Charge2.a")
Goto Fire3
Charge2.a:
DUOL I 1 ACS_ExecuteAlways(998,0,104,7)
DUOL J 0 A_Refire("Charge2.b")
Goto Fire3
Charge2.b:
DUOL J 1 ACS_ExecuteAlways(998,0,DYE_DUOC,1)
DUOL K 0 A_JumpIfInventory("IsBot",1,"BotFire")
DUOL K 0 A_Refire("Charge2")
Goto Fire3
BotFire:
DUOL K 0 A_Jump(16,"Fire3")
DUOL K 0 A_Refire("Charge2")
Goto Fire3


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

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

Altfire:
DUOL M 0 A_JumpIf(ACS_NamedExecuteWithResult("cbm_user1_check")==1, "User1Fire")
DUOL M 0 A_JumpIf(z-floorz==0,"SlideSlide")
goto Ready2+2
SlideSlide:
DUOL N 0 A_GiveInventory("SlideVivifyFlag",1)
DUOL N 0 A_Refire(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("DuoRam",0,0,0,0)
DUOL N 0 ThrustThingZ(0,0,1,0)
DUOL N 1 A_GiveInventory("CopySlideThrust_P",1)
DUOL N 0 ThrustThingZ(0,0,1,0)
DUOL NNNN 2
DUOL N 1
DUOL N 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_JumpZ,10,1)
DUOL N 0 SetPlayerProperty(0,0,0)
DUOL M 5
DUOL M 14
DUOL M 0 A_TakeInventory("SlideVivifyFlag",1)
DUOL M 1 A_Refire
goto Ready2+2

}
}

actor HereComesAGiantFistAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 3
+INVENTORY.IGNORESKILL
}


actor DuoPunchLefty
{
Translation "199:199=95:95", "202:202=89:89"
PROJECTILE
damagetype "Duo_Fist1"
Obituary "$OB_DUOFIST"
+SKYEXPLODE
+EXPLODEONWATER
ReactionTime 1
Damage (190)//250
Radius 10
Height 10
Speed 32
scale 2.5
States
{
Spawn:
GIGL A 0
GIGL A 0
Spawn2: 
GIGL A 0
GIGL AAAAAAAAAA 1 A_SpawnItemEx("DuoPunchWireLefty",0,0,0,0,0,0,0,1)

GIGL A 0
Goto Spawn3
Spawn3:
GIGL A 1
GIGL A 1 A_CountDown
wait
Return:
TNT1 A 0 A_GiveToTarget("FistFlag",1)
stop
Death2:
TNT1 A 0 A_GiveToTarget("FistFlag",1)
stop
Death:
TNT1 A 0 A_SpawnItemEx("DuoPunchLeftyReturn",0,0,0,0,0,0,0,1)
stop
}
}

actor DuoPunchLeftyB : DuoPunchLefty{translation "202:202=205:205", "199:199=74:74"}
actor DuoPunchLeftyR : DuoPunchLefty{translation "202:202=171:171", "199:199=41:41"}
actor DuoPunchLeftyO : DuoPunchLefty{translation "202:202=104:104", "199:199=128:128"}
actor DuoPunchLeftyP : DuoPunchLefty{translation "202:202=229:229", "199:199=232:232"}

actor DuoPunchLeftyReturn : DuoPunchLefty
{
+NOINTERACTION
+SEEKERMISSILE
ReactionTime 35
damage (0)
Speed 60
States
{
Spawn:
GIGL J 0
GIGL J 0 A_RearrangePointers(AAPTR_DEFAULT,AAPTR_DEFAULT,AAPTR_TARGET)//Target >> Tracer
GIGL J 0 A_FaceTarget
goto Spawn2
Spawn2:
GIGL J 0 A_JumpIfCloser(60,"Return")
GIGL JJ 0 A_SeekerMissile(90,90,SMF_PRECISE)
GIGL JJJJ 1 A_JumpIfCloser(60,"Return")
GIGL J 0 A_CountDown
GIGL J 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death2")
loop
}
}

Actor DuoPunchWireLefty : DuoPunchLeftyReturn
{
Translation "199:199=95:95", "202:202=89:89"
+NOCLIP
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_RearrangePointers(0,0,2)
TNT1 A 0 A_FaceTarget
goto Spawn2
Spawn2:
TNT1 A 0 A_JumpIfCloser(64,"Death")
TNT1 AA 0 A_SeekerMissile(90,90,SMF_PRECISE)
TNT1 A 1 A_SpawnItemEx("DuoPunchWireLeftyFX",0,0,0,0,0,0,0,1)
TNT1 A 0 A_CountDown
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
loop
Return:
Death2:
Death:
TNT1 A 0 
stop
}
}

Actor DuoPunchWireLeftyFX : BasicClientSide
{
+NOINTERACTION
Scale 2.5
States
{
Spawn:
TNT1 A 1
TNT1 A 0 A_JumpIfCloser(32,"Death")
GIGL B 2 
stop
Death:
TNT1 A 0
stop
}
}

//Translation "195:195=194:194", "204:204=192:192", "199:199=95:95", "202:202=89:89"
actor MidFistLefty
{
Translation "195:195=194:194", "204:204=192:192"
PROJECTILE
damagetype "Duo_Fist2"
Obituary "$OB_DUOFIST"
+SKYEXPLODE
+EXPLODEONWATER
+BRIGHT
Damage (300)//350
Radius 16
Height 16//10
Speed 26
Scale 2.5
States
{
Spawn:
GIGL CD 1
Loop
Death:
GIGL F 0 
GIGL F 0 A_Recoil(5)
GIGL CD 1 A_FadeOut
Goto Death+2
}
}

actor MidFistLeftyB : MidFistLefty{translation "204:204=205:205", "195:195=74:74"}
actor MidFistLeftyR : MidFistLefty{translation "204:204=171:171", "195:195=41:41"}
actor MidFistLeftyO : MidFistLefty{translation "204:204=104:104", "195:195=128:128"}
actor MidFistLeftyP : MidFistLefty{translation "204:204=229:229", "195:195=232:232"}


actor GigaFistLefty
{
Translation "195:195=194:194", "204:204=192:192"
PROJECTILE
damagetype "Duo_Fist3"
Obituary "$OB_DUOFIST"
+SKYEXPLODE
+EXPLODEONWATER
+BRIGHT
RenderStyle "Translucent"
Alpha 0.98
Damage (550)//700
Radius 24//20
Height 20//10
Speed 26
scale 2.5
States
{
Spawn:
GIGL F 2
GIGL F 1 A_SpawnItemEx("GigaFistFXLefty",64,0,0,momx/7,momy/7,momz/7,0,9)
GIGL G 2
loop
Death:
GIGL F 0 
GIGL F 0 A_Recoil(5)
GIGL F 1 A_FadeOut
Goto Death+2
}
}

actor GigaFistLeftyB : GigaFistLefty{translation "204:204=205:205", "195:195=74:74"}
actor GigaFistLeftyR : GigaFistLefty{translation "204:204=171:171", "195:195=41:41"}
actor GigaFistLeftyO : GigaFistLefty{translation "204:204=104:104", "195:195=128:128"}
actor GigaFistLeftyP : GigaFistLefty{translation "204:204=229:229", "195:195=232:232"}

Actor GigaFistFXLefty : BasicClientSide
{
+BRIGHT
States
{
Spawn:
TNT1 A 1
GIGL H 3
GIGL I 5
GIGL I 1 A_FadeOut(0.5)
wait
}
}

actor DuoRam
{
PROJECTILE
damagetype "Duo_Ram"
Obituary "$OB_DUORAM"
+DONTBLAST
+DONTREFLECT
+DONTSPLASH
+THRUGHOST

//+BOUNCEONFLOORS
+BOUNCEONWALLS
+BOUNCEONCEILINGS
+CANBOUNCEWATER
+NOEXPLODEFLOOR
BounceFactor 1.0
WallBounceFactor 1.0
BounceCount 0

ReactionTime 10
damage (240)
Radius 16
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
loop
Death:
TNT1 A 1
stop
}
}



actor DuoMain1_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("DuoPunchLefty",0,0,-8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("DuoPunchLeftyB",0,0,-8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("DuoPunchLeftyR",0,0,-8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("DuoPunchLeftyO",0,0,-8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("DuoPunchLeftyP",0,0,-8,0)
goto Done
}
}

actor DuoMain2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MidFistLefty",0,0,-8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MidFistLeftyB",0,0,-8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MidFistLeftyR",0,0,-8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MidFistLeftyO",0,0,-8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MidFistLeftyP",0,0,-8,0)
goto Done
}
}

actor DuoMain3_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("GigaFistLefty",0,0,-8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("GigaFistLeftyB",0,0,-8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("GigaFistLeftyR",0,0,-8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("GigaFistLeftyO",0,0,-8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("GigaFistLeftyP",0,0,-8,0)
goto Done
}
}