actor DarkShieldWep_NormalBar : NormalBar { args 4, 93 }

actor DarkShieldWep : BaseMM8BDMWep
{
Weapon.AmmoUse 1
Weapon.AmmoGive 28
Weapon.SlotNumber 7
Inventory.Pickupmessage "$PU_DARKSHIELD"
Obituary "$OB_DARKSHIELD"
Tag "$TAG_DARKSHIELD"
weapon.ammotype "DarkShieldAmmo"
inventory.icon "XTR0WI_M"
States
{
SpawnLoop:
XWI0 M -1
loop

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

Ready:
XH0M A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_DARKSHIELD)
XH0M A 0 A_GunFlash("Flash",1)
XH0M A 1 A_WeaponReady
wait
ReadyShield:
XH0M A 0 A_GiveInventory("DarkShieldPowerSpeed",1)
XH0M AAAAAAAAAAAAAAAAAAAA 1 Offset(0,50)A_WeaponReady(1)
XH0M A 0 A_TakeInventory("DarkShieldAmmo",1,1)
XH0M A 0 A_JumpIfInventory("DarkShieldAmmo",1,"ReadyShield")
goto ShieldThrow

Fire:
XH0M B 0 A_JumpIfInventory("ShieldCheck",1,"ShieldThrow")
XH0M B 0 A_JumpIfNoAmmo("NoAmmo")
XH0M B 0 A_GiveInventory("ShieldCheck",1)
XH0M B 0 A_TakeInventory("StopShield",9)
XH0M B 0 A_SpawnItemEx("DarkShieldBlocker",55,0,0,0,0,0,0,1)
XH0M B 0 A_SpawnItemEx("DarkShieldBlocker",55,0,0,0,0,0,180,1)
XH0M B 2
XH0M CDEF 2 A_GiveInventory("DarkShieldPowerSpeed",1)
XH0M A 2 Offset(0,78)
XH0M A 2 Offset(0,50)
XH0M A 0 A_TakeInventory("DarkShieldAmmo",1,1)
goto ReadyShield
ShieldThrow:
XH0M B 0 A_GiveInventory("StopShield",1)
XH0M G 0 A_TakeInventory("ShieldCheck",999)
XH0M G 0 A_FireCustomMissile("DarkShieldSpinner_H",0,1,0,0)
XH0M G 3 Offset(-20,18)
XH0M H 3 A_WeaponReady(14)
XH0M H 10 A_TakeInventory("DarkShieldPowerSpeed",999)
XH0M G 3 Offset(-20,18)
Goto Ready+2

Flash:
TNT1 A 1 A_GiveInventory("DarkShieldFlash_P",1)
loop
NoAmmo:
XH0M A 1 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+2
}
}

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

actor DarkShieldPowerSpeed : PowerSpeed
{
+POWERSPEED.NOTRAIL
Powerup.Duration -2
Speed 1.30
}

actor PowerDarkShieldSnd : Powerup
{
Powerup.Duration 10
}

actor DarkShieldFlash_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("ShieldCheck",1,"PickupSnd")
stop
PickupSnd:
TNT1 A 0 A_JumpIfInventory("PowerDarkShieldSnd",1,"No")
TNT1 A 0 A_GiveInventory("PowerDarkShieldSnd",1)
TNT1 A 0 A_PlaySoundEx("weapon/shieldhum","Body")
stop
No:
TNT1 A 0
stop
}
}


actor DarkShieldBlocker : ProjSpawnFuncActor
{
damagetype "DarkShield"
Obituary "$OB_DARKSHIELD"

-SOLID
+MISSILE
+DONTSPLASH
+DONTBLAST
+DONTDRAIN
+DONTREFLECT
+DONTRIP
+GHOST
+INVULNERABLE
+SHOOTABLE
+NOBLOOD
+NOCLIP
+NODAMAGE
+NORADIUSDMG
+NOTIMEFREEZE
+NOGRAVITY
+NOTARGETSWITCH
+BRIGHT

painchance 0

Species "DUMBDARKSHIELD"

health 999999

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

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

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

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

XH0M S 0 A_JumpIf(CallACS("core_targetexists")==0,"Death")
XH0M S 0 A_JumpIfInTargetInventory("StopShield",1,"SpawnStop")
XH0M S 0 A_Explode(Accuracy*(CallACS("core_checkrune",RUNE_SPREAD,2)*2+1),radius*2,0,0,radius)
XH0M S 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 DarkShieldSpinner_H : BasicHelper
{
Translation "202:202=93:93"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("DarkShieldSpinner",46,0,-28,0,0,0,90)
TNT1 A 0 A_SpawnItemEx("DarkShieldSpinner",46,0,-28,0,0,0,270)
stop
}
}

actor DarkShieldSpinner : ProjSpawnFuncActor
{
var int user_num;
var int user_time;
var int user_time_add;
PROJECTILE
damagetype "DarkShield"
Obituary "$OB_DARKSHIELD"
+RIPPER
+SHOOTABLE
-NOBLOCKMAP
+NOBLOOD
+NOTARGETSWITCH
+INVULNERABLE
+NODAMAGE
+NORADIUSDMG
+GHOST
+THRUGHOST
+BRIGHT
+THRUSPECIES
Species "DUMBDARKSHIELD"
mass 9999
damage (80)
Radius 16
Height 56
speed 0
scale 2.5
Args 40//Speed
States
{
Spawn:
TNT1 A 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)
XH0M R 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)
XH0M R 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)
XH0M S 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)
XH0M S 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)
XH0M T 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)
XH0M T 1 A_ChangeVelocity(Args[0],0,0,3)
TNT1 A 0 A_SetUserVar("user_time",user_time+user_time_add)
loop
Spawn3:
XH0M RST 2
loop
Death:
TNT1 A 0
stop
}
}
