actor DarkMan2_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_5J"
dropitem "DarkShieldWep"
Weapon.AmmoUse 0
Weapon.AmmoGive 28
Obituary "$OB_DARK2SHIELD"
Inventory.Pickupmessage "still no"
weapon.ammotype "Darkman2ShieldAmmo"
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_05 J 1
loop

Deselect:
DKC2 A 0 A_GiveInventory("StopShield",1)
DKC2 A 0 A_TakeInventory("ShieldCheck")
goto DeselectSwap
Select:
DKC2 A 0
goto SelectSwap

Ready:
DKC2 A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_DARKMAN2)
DKC2 A 0 A_GunFlash("Flash",1)
DKC2 A 1 A_WeaponReady
wait
Ready2:
DKC2 A 1 A_WeaponReady
loop

Fire:
DKC2 I 0 A_JumpIfInventory("ShieldCheck",1,"ShieldThrow")
DKC2 I 4
DKC2 J 4
DKC2 K 3
DKC2 K 10 A_GiveInventory("Darkman2_Fire_P")
DKC2 I 3
Goto Ready2
AltFire:
DKC2 B 0 A_JumpIfInventory("ShieldCheck",1,"ShieldThrow2")
DKC2 B 0 A_GiveInventory("ShieldCheck",1)
DKC2 B 0 A_TakeInventory("StopShield",9)
DKC2 B 0 A_SpawnItemEx("Darkman2ShieldBlocker",55,0,0,0,0,0,0)
DKC2 B 0 A_SpawnItemEx("Darkman2ShieldBlocker",55,0,0,0,0,0,180)
DKC2 BCDEF 2
DKC2 FE 2//GH
goto Ready2
ShieldThrow:
DKC2 I 0 A_GiveInventory("StopShield",1)
DKC2 I 0 A_TakeInventory("ShieldCheck",999)
DKC2 I 0 A_GiveInventory("Darkman2_Fire2_P")
DKC2 I 3
DKC2 J 3
DKC2 K 20
DKC2 I 3
Goto Ready2
ShieldThrow2:
DKC2 I 0 A_GiveInventory("StopShield",1)
DKC2 I 0 A_TakeInventory("ShieldCheck",999)
DKC2 I 0 A_FireCustomMissile("Darkman2ShieldSpinner_H",0,0,0,0)
DKC2 L 3
DKC2 M 3
DKC2 N 20
DKC2 L 3
Goto Ready2
Flash:
TNT1 A 1 A_GiveInventory("Darkman2ShieldFlash_P",1)
loop
}
}

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

actor Darkman2ShieldFlash_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 ACS_NamedExecuteWithResult("cbm_DynamicHealthBaseSpeed",17)//2
TNT1 A 0 A_JumpIfInventory("ShieldCheck",1,"PickupSnd")
stop
PickupSnd:
TNT1 A 0 A_JumpIfInventory("VivifyDelay10",1,"No")
TNT1 A 0 A_GiveInventory("VivifyDelay10",1)
TNT1 A 0 A_PlaySoundEX("weapon/shieldhum","Body")
stop
No:
TNT1 A 0
stop
}
}


actor Darkman2_Fire_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_PlaySoundEx("weapon/sparkshock","Weapon")
TNT1 A 0 A_FireCustomMissile("ElectromagneticNet",0,0,8,0)//,0,1.328125
TNT1 A 0 A_FireCustomMissile("ElectromagneticNet2",30,0,8,0)
TNT1 A 0 A_FireCustomMissile("ElectromagneticNet2",-30,0,8,0)
TNT1 A 0 A_FireCustomMissile("ElectromagneticNet3",0,1,8,0)
stop
}
}

actor Darkman2_Fire2_P : CustomInventory
{
states
{
Pickup:
//TNT1 A 0 A_FireCustomMissile("Darkman2ShieldTosser",0,0,0,-37)
//TNT1 A 0 A_FireCustomMissile("Darkman2ShieldTosser",180,0,0,-37)
TNT1 A 0 A_SpawnItemEx("Darkman2ShieldTosser",0,0,0,28,0,0,0)
TNT1 A 0 A_SpawnItemEx("Darkman2ShieldTosser",0,0,0,28,0,0,180)
TNT1 A 0 A_JumpIfInventory("PlayerPropertySpread",1,1)
stop
TNT1 A 0 A_SpawnItemEx("Darkman2ShieldTosser",0,0,0,28,0,0,15)
TNT1 A 0 A_SpawnItemEx("Darkman2ShieldTosser",0,0,0,28,0,0,195)
TNT1 A 0 A_SpawnItemEx("Darkman2ShieldTosser",0,0,0,28,0,0,-15)
TNT1 A 0 A_SpawnItemEx("Darkman2ShieldTosser",0,0,0,28,0,0,165)
stop
}
}

actor Darkman2ShieldBlocker : ProjSpawnFuncActor
{
damagetype "DM2_Shield"
Obituary "$OB_DARK2SHIELD"

-SOLID
+MISSILE
+DONTSPLASH
+DONTBLAST
+DONTDRAIN
+DONTREFLECT
+DONTRIP
//+RIPPER
//+THRUGHOST
+GHOST
+INVULNERABLE
+SHOOTABLE
//+SKYEXPLODE
//+EXPLODEONWATER
//+EXPLODEONDEATH
+NOBLOOD
+NODAMAGE
+NOCLIP
+NORADIUSDMG
+NOTIMEFREEZE
+NOGRAVITY
+NOTARGETSWITCH
+BRIGHT
//+NOINTERACTION

painchance 0

Species "DUMBDARKSHIELD"

//renderstyle translucent
//alpha 0.85
health 999999

Accuracy 30//Damage
Meleerange 55//WarpX
Stamina -20//WarpAngle

Damage (0)//6
Radius 8
Height 56
Speed 0
scale 2.5
States
{
Spawn:
DSHO F 0
//DSHO F 0 A_ChangeFlag("NOINTERACTION",0)
//DSHO F 1
DSHO F 0 A_JumpIf(CallACS("core_targetexists")==0,"Death")
DSHO F 0 A_JumpIfInTargetInventory("StopShield",1,"SpawnStop")
DSHO F 0 A_Explode(Accuracy*(CallACS("core_checkrune",RUNE_SPREAD,2)*2+1),radius*2,0,0,radius)
DSHO F 1 A_Warp(2,Meleerange,0,0,Stamina*(CallACS("core_checkrune",RUNE_RAGE,2)+1),28)

DSHO G 0 A_JumpIf(CallACS("core_targetexists")==0,"Death")
DSHO G 0 A_JumpIfInTargetInventory("StopShield",1,"SpawnStop")
DSHO G 0 A_Explode(Accuracy*(CallACS("core_checkrune",RUNE_SPREAD,2)*2+1),radius*2,0,0,radius)
DSHO G 1 A_Warp(2,Meleerange,0,0,Stamina*(CallACS("core_checkrune",RUNE_RAGE,2)+1),28)

DSHO H 0 A_JumpIf(CallACS("core_targetexists")==0,"Death")
DSHO H 0 A_JumpIfInTargetInventory("StopShield",1,"SpawnStop")
DSHO H 0 A_Explode(Accuracy*(CallACS("core_checkrune",RUNE_SPREAD,2)*2+1),radius*2,0,0,radius)
DSHO H 1 A_Warp(2,Meleerange,0,0,Stamina*(CallACS("core_checkrune",RUNE_RAGE,2)+1),28)

DSHO G 0 A_JumpIf(CallACS("core_targetexists")==0,"Death")
DSHO G 0 A_JumpIfInTargetInventory("StopShield",1,"SpawnStop")
DSHO G 0 A_Explode(Accuracy*(CallACS("core_checkrune",RUNE_SPREAD,2)*2+1),radius*2,0,0,radius)
DSHO G 1 A_Warp(2,Meleerange,0,0,Stamina*(CallACS("core_checkrune",RUNE_RAGE,2)+1),28)
loop
SpawnStop:
TNT1 A 0
TNT1 A 1
stop
Death:
TNT1 A 0
TNT1 A 1
stop
}
}

actor Darkman2ShieldSpinner_H : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("Darkman2ShieldSpinner",46,0,-28,0,0,0,90)
TNT1 A 0 A_SpawnItemEx("Darkman2ShieldSpinner",46,0,-28,0,0,0,270)
stop
}
}

actor Darkman2ShieldSpinner : ProjSpawnFuncActor
{
var int user_num;
var int user_time;
var int user_time_add;
PROJECTILE
damagetype "DM2_TossSpin"
Obituary "$OB_DARK2SHIELD"
+RIPPER
+SHOOTABLE
-NOBLOCKMAP
+NOBLOOD
+NOTARGETSWITCH
+INVULNERABLE
+NODAMAGE
+NORADIUSDMG
+GHOST
+THRUGHOST
+BRIGHT
+THRUSPECIES
Species "DUMBDARKSHIELD"
mass 9999
damage (50)
Radius 16
Height 56
speed 0
scale 2.5
Args 40
States
{
Spawn:
TNT1 F 0
TNT1 A 0 A_SetUserVar("user_num",1400)
TNT1 A 0 A_SetUserVar("user_time",17)
TNT1 A 0 A_SetUserVar("user_time_add",3)
Spawn2:
TNT1 A 0 A_JumpIf(user_time*100/user_num>92,"Spawn3")
TNT1 A 0 A_Setangle(angle-user_num/user_time)
DSHO F 1 A_ChangeVelocity(Args[0],0,0,3)
TNT1 A 0 A_SetUserVar("user_time",user_time+user_time_add)
TNT1 A 0 A_Setangle(angle-user_num/user_time)
DSHO F 1 A_ChangeVelocity(Args[0],0,0,3)
TNT1 A 0 A_SetUserVar("user_time",user_time+user_time_add)
TNT1 A 0 A_Setangle(angle-user_num/user_time)
DSHO G 1 A_ChangeVelocity(Args[0],0,0,3)
TNT1 A 0 A_SetUserVar("user_time",user_time+user_time_add)
TNT1 A 0 A_Setangle(angle-user_num/user_time)
DSHO G 1 A_ChangeVelocity(Args[0],0,0,3)
TNT1 A 0 A_SetUserVar("user_time",user_time+user_time_add)
TNT1 A 0 A_Setangle(angle-user_num/user_time)
DSHO H 1 A_ChangeVelocity(Args[0],0,0,3)
TNT1 A 0 A_SetUserVar("user_time",user_time+user_time_add)
TNT1 A 0 A_Setangle(angle-user_num/user_time)
DSHO H 1 A_ChangeVelocity(Args[0],0,0,3)
TNT1 A 0 A_SetUserVar("user_time",user_time+user_time_add)
loop
Spawn3:
DSHO FGH 2
loop
Death:
TNT1 A 0
stop
}
}


actor Darkman2ShieldTosser : Darkman2ShieldSpinner
{
damagetype "DM2_Toss"
+EXPLODEONDEATH
Damage (0)
Speed 28
States
{
Spawn:
DSHO F 0
DSHO FFGGHH 1 A_Explode(40,64,0,0,12)
loop
}
}

actor ElectromagneticNet : ProjSpawnFuncActor
{
PROJECTILE
damagetype "DM2_Shock"
Obituary "$OB_DARK2NET"
-NOGRAVITY
+FORCEXYBILLBOARD
+BRIGHT
gravity 0.4//0.275
damage (60)
Radius 7
Height 7
speed 35
scale 2.5
States
{
Spawn:
DSHO D 0
DSHO D 0 ThrustThing(angle*256/360,0,1,0)
SpawnL:
DSHO D 0 ThrustThingZ(0,4,0,1)
DSHO DE 4
loop
Death:
TNT1 A 0 A_SpawnItemEX("ElectrifyEffect")
stop
}
}

actor ElectromagneticNet2 : ElectromagneticNet{speed 25}

actor ElectromagneticNet3 : ElectromagneticNet{speed 15}


//actor DarkMan2_W_NormalBar : NormalBar {Args 4,93}