actor ShadowBladeBoss : BaseMM8BDMWep_CBM
{
dropitem "ShadowBladeWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 1
Obituary "$OB_SHADOWBLADE"
weapon.ammotype "CloakAmmo"
inventory.icon "Sha1Icon"
States
{
Spawn:
C_03 H 1
loop

Ready:
SHAH A 0 ACS_ExecuteAlways(998,0,767)
SHAH A 0 A_GunFlash
SHAH A 0 A_JumpIfInventory("CloakFlag",1,"ReadyCloak")
SHAH A 0 A_SetTranslucent(1.0,0)
SHAH A 0 A_ChangeFlag("CANTSEEK",0)
SHAH A 0 A_TakeInventory("CloakFlag",1)
goto Ready2
ReadyCloak:
SHAH A 1 A_WeaponReady
SHAH A 0 A_SpawnItemEx("CloakVisualSpawner",0,0,0,momx,momy,momz,0,9,0)
SHAH A 0 A_JumpIfInventory("CloakFlag",1,"ReadyCloak")
goto Ready+3
Ready2:
SHAH A 0 A_JumpIfInventory("ShadowSlide",1,"ReadySlide")
SHAH A 0 A_JumpIfInventory("CloakAmmo",28,"ReadyFull")
SHAH A 10 A_WeaponReady(WRF_NOSECONDARY)
SHAH A 0 A_GiveInventory("CloakAmmo",2) 
Goto Ready2+1
ReadySlide:
SLID C 1 A_WeaponReady(WRF_NOSECONDARY)
SLID C 0 A_JumpIfInventory("ShadowSlide",1,"ReadySlide")
goto Ready2
ReadyFull:
SHAH A 10 A_WeaponReady
SHAH A 0 A_GiveInventory("CloakAmmo",2) 
loop
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
TNT1 A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
SHAH A 1 A_Raise
Loop
Fire:
//SHAH A 0 A_JumpIfInventory("WepToggleFlag",1,"Fire2")
SHAH A 0 A_PlaySoundEx("weapon/shadow","Weapon")
SHAH A 0 A_SetTranslucent(1.0,0)
SHAH A 0 A_ChangeFlag("CANTSEEK",0)
SHAH A 0 A_TakeInventory("CloakFlag",1)
SHAH A 0 A_TakeInventory("ShadowSlide",1)
TNT1 A 0 A_TakeInventory("CloakFlagDelay",3)
SNAH A 0 A_GiveInventory("ShadowmanMain_CI",1)
SHAH BCDEFG 2
TNT1 A 4
SHAH HI 1
SHAH A 2
SHAH A 0 A_GiveInventory("CloakAmmo",2) 
SHAH A 0 A_Refire
goto Ready2

Flash:
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_JumpIfInventory("CloakFlag",1,1)
stop
TNT1 A 2 A_GiveInventory("CloakFlagDelay",1)
TNT1 A 0 A_JumpIfInventory("CloakFlagDelay",3,1)
loop
TNT1 A 0 A_TakeInventory("CloakAmmo",1)
TNT1 A 0 A_TakeInventory("CloakFlagDelay",999)
TNT1 A 0 A_JumpIfInventory("CloakAmmo",1,"Flash")
TNT1 A 0 A_TakeInventory("CloakFlag",1)
stop

Altfire:
SHAH A 0 A_JumpIfInventory("CloakAmmo",28,"Altfire2")
SHAH A 0 A_JumpIfInventory("CloakFlag",1,"Slide")
SHAH A 1
Goto AltfireOff
AltfireOff:
SHAH A 1 A_SetTranslucent(1.0,0)
SHAH A 0 A_ChangeFlag("CANTSEEK",0)
SHAH A 0 A_TakeInventory("CloakFlag",1)
SHAH A 0 A_TakeInventory("CloakFlagDelay",6)
goto Ready2
Slide:
SHAH A 0 A_GiveInventory("ShadowSlide",1)
SHAH A 0 A_TakeInventory("CloakAmmo",6)
SHAH A 0 A_PlaySoundEx("weapon/tengudash","Weapon")
SHAH A 1 A_SetTranslucent(1.0,0)
SHAH A 0 A_ChangeFlag("CANTSEEK",0)
SHAH A 0 A_TakeInventory("CloakFlag",6)
SHAH A 0 A_TakeInventory("CloakFlagDelay",6)
goto ReadySlide
Altfire2:
SHAH A 0 A_TakeInventory("CloakAmmo",1)
SHAH A 1 A_SetTranslucent(0.9,0)
SHAH A 1 A_SetTranslucent(0.8,0)
SHAH A 1 A_SetTranslucent(0.7,0)
SHAH A 1 A_SetTranslucent(0.6,0)
SHAH A 1 A_SetTranslucent(0.5,0)
SHAH A 1 A_SetTranslucent(0.4,0)
SHAH A 1 A_SetTranslucent(0.3,0)
SHAH A 1 A_SetTranslucent(0.2,0)
SHAH A 1 A_SetTranslucent(0.1,0)
SHAH A 0 A_ChangeFlag("CANTSEEK",1)
SHAH A 1 A_SetTranslucent(0.0,0)
SHAH A 0 A_GiveInventory("CloakFlag",1)
SHAH A 0 A_GunFlash
goto ReadyCloak
}
}

actor ShadowBladerBoss : ShadowBladeBoss
{
Weapon.SlotNumber 2
inventory.icon "Sha2Icon"
+WEAPON.NOAUTOAIM
States
{
Ready:
SHAH J 0 ACS_ExecuteAlways(998,0,767)
SHAH J 0 A_GunFlash
SHAH J 0 A_JumpIfInventory("CloakFlag",1,"ReadyCloak")
SHAH J 0 A_SetTranslucent(1.0,0)
SHAH J 0 A_ChangeFlag("CANTSEEK",0)
SHAH J 0 A_TakeInventory("CloakFlag",1)
goto Ready2
ReadyCloak:
SHAH J 1 A_WeaponReady
SHAH J 0 A_SpawnItemEx("CloakVisualSpawner",0,0,0,momx,momy,momz,0,9,0)
SHAH J 0 A_JumpIfInventory("CloakFlag",1,"ReadyCloak")
goto Ready+3
Ready2:
SHAH J 0 A_JumpIfInventory("ShadowSlide",1,"ReadySlide")
SHAH J 0 A_JumpIfInventory("CloakAmmo",28,"ReadyFull")
SHAH J 10 A_WeaponReady(WRF_NOSECONDARY)
SHAH J 0 A_GiveInventory("CloakAmmo",2) 
Goto Ready2+1
ReadySlide:
SLID C 1 A_WeaponReady(WRF_NOSECONDARY)
SLID C 0 A_JumpIfInventory("ShadowSlide",1,"ReadySlide")
goto Ready2
ReadyFull:
SHAH J 10 A_WeaponReady
SHAH J 0 A_GiveInventory("CloakAmmo",2) 
loop
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
TNT1 A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
SHAH J 1 A_Raise
Loop
Fire:
SHAH J 0 A_PlaySoundEx("weapon/shadow","Weapon")
SHAH J 0 A_SetTranslucent(1.0,0)
SHAH J 0 A_ChangeFlag("CANTSEEK",0)
SHAH J 0 A_TakeInventory("CloakFlag",1)
SHAH J 0 A_TakeInventory("ShadowSlide",1)
SHAH J 0 A_TakeInventory("CloakFlagDelay",3)
SNAH J 0 A_GiveInventory("ShadowmanMain3_CI",1)
SHAH BCDEFG 2
TNT1 A 4
SHAH HI 1
SHAH J 2
SHAH A 0 A_GiveInventory("CloakAmmo",2) 
SHAH A 0 A_Refire
Goto Ready2
Altfire:
SHAH A 0 A_JumpIfInventory("CloakAmmo",28,"Altfire2")
SHAH A 0 A_JumpIfInventory("CloakFlag",1,"AltfireSlide")
SLID C 1 
Goto AltfireOff
AltfireOff:
SHAH J 1 A_SetTranslucent(1.0,0)
SHAH J 0 A_ChangeFlag("CANTSEEK",0)
SHAH J 0 A_TakeInventory("CloakFlag",1)
goto Ready2
AltfireSlide:
SHAH J 0 A_GiveInventory("ShadowSlide",1)
SHAH J 0 A_TakeInventory("CloakAmmo",6)
SHAH J 0 A_PlaySoundEx("weapon/tengudash","Weapon")
SHAH J 1 A_SetTranslucent(1.0,0)
SHAH J 0 A_ChangeFlag("CANTSEEK",0)
SHAH J 0 A_TakeInventory("CloakFlagDelay",6)
SHAH J 0 A_TakeInventory("CloakFlag",6)
goto ReadySlide
Altfire2:
SHAH J 0 A_TakeInventory("CloakAmmo",1)
SHAH J 1 A_SetTranslucent(0.9,0)
SHAH J 1 A_SetTranslucent(0.8,0)
SHAH J 1 A_SetTranslucent(0.7,0)
SHAH J 1 A_SetTranslucent(0.6,0)
SHAH J 1 A_SetTranslucent(0.5,0)
SHAH J 1 A_SetTranslucent(0.4,0)
SHAH J 1 A_SetTranslucent(0.3,0)
SHAH J 1 A_SetTranslucent(0.2,0)
SHAH J 1 A_SetTranslucent(0.1,0)
SHAH J 0 A_ChangeFlag("CANTSEEK",1)
SHAH J 1 A_SetTranslucent(0.0,0)
SHAH J 0 A_GiveInventory("CloakFlag",1)
SHAH J 0 A_GunFlash
goto ReadyCloak
}
}


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

actor CloakFlag : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor CloakFlagDelay : Inventory
{
inventory.amount 1
inventory.maxamount 6
}

actor ShadowBladeCBM : ShadowBlade 
{
translation "202:202=4:4", "199:199=210:210"
Damage (15)//16
Speed 32//31
States
{
Spawn:
SHAH OPOP 3
SHAH O 0 A_ScaleVelocity(-1)
SHAH OPOP 3
Stop
Death:
TNT1 A 1 A_SpawnItemEx("ShadowBladeCBMDead",0,0,0,0,0,0,0,1)
stop
}
}

actor ShadowBladeCBMB : ShadowBladeCBM{translation "202:202=205:205", "199:199=74:74"}
actor ShadowBladeCBMR : ShadowBladeCBM{translation "202:202=171:171", "199:199=41:41"}
actor ShadowBladeCBMO : ShadowBladeCBM{translation "202:202=104:104", "199:199=128:128"}
actor ShadowBladeCBMP : ShadowBladeCBM{translation "202:202=229:229", "199:199=232:232"}

actor ShadowBladeCBMDead : ShadowBladeCBM
{
+DONTSPLASH
-RIPPER
Damage (15)
Speed 0
States
{
Spawn:
SHAH O 0 
SHAH O 1 A_Jump(256,"A","B")
A:
SHAH O 105
SHAH O 0 A_ChangeFlag("NOINTERACTION",1)
SHAH O 0 A_ChangeFlag("MISSILE",0)
goto End1
B:
SHAH P 105
SHAH P 0 A_ChangeFlag("NOINTERACTION",1)
SHAH P 0 A_ChangeFlag("MISSILE",0)
goto End2
End1:
SHAH O 2 A_Fadeout(0.1)
loop
End2:
SHAH P 2 A_Fadeout(0.1)
loop
Death:
TNT1 A 1
stop
}
}

actor ShadowNoReturnBlade : ShadowBlade
{
translation "192:192=4:4"
//damage (8)
damage (5)
States
{
Spawn:
SHAH MNMN 3
loop
}
}

actor ShadowNoReturnBladeB : ShadowNoReturnBlade{translation "192:192=205:205"}
actor ShadowNoReturnBladeR : ShadowNoReturnBlade{translation "192:192=171:171"}
actor ShadowNoReturnBladeO : ShadowNoReturnBlade{translation "192:192=104:104"}
actor ShadowNoReturnBladeP : ShadowNoReturnBlade{translation "192:192=229:229"}

actor ShadowNoReturnBlade2 : ShadowNoReturnBlade
{
damage (6)
}

actor ShadowNoReturnBlade2B : ShadowNoReturnBladeB{damage (6)}
actor ShadowNoReturnBlade2R : ShadowNoReturnBladeR{damage (6)}
actor ShadowNoReturnBlade2O : ShadowNoReturnBladeO{damage (6)}
actor ShadowNoReturnBlade2P : ShadowNoReturnBladeP{damage (6)}


/*
actor WepToggleFlag : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor Non-Boomer : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "ShadIcon"
scale 2.0
+COUNTITEM
+INVBAR
states
{
Spawn:
ALIE A 1
stop
Use:
TNT1 A 0 //A_PlaySoundEx("item/refill", "Item")
TNT1 A 0 A_GiveInventory("WepToggleFlag",1)
TNT1 A 0 A_GiveInventory("Boomer",1)
stop
}
}

actor Boomer : CustomInventory //not the sick kind of boomer
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "ShadIcon"
scale 2.0
+COUNTITEM
+INVBAR
states
{
Spawn:
ALIE A 1
stop
Use:
TNT1 A 0 //A_PlaySoundEx("item/refill", "Item")
TNT1 A 0 A_TakeInventory("WepToggleFlag",1)
TNT1 A 0 A_GiveInventory("Non-Boomer",1)
stop
}
}
*/

actor CloakVisualSpawner
{
scale 2.5
Radius 1
Height 1
-SOLID
+NOGRAVITY
+NOINTERACTION
+DONTBLAST
RenderStyle "Translucent"
Alpha 0.6
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(143,0)==-1,"Spawn2")
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(143,0)==0,"Blue")
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(143,0)==1,"Red")
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(143,0)==2,"Orange")
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(143,0)==3,"Purple")
Spawn2:
TNT1 A 1
stop
Blue:
TNT1 A 0 A_SpawnItemEx("CloakVisualB",0,0,60,momx,momy,momz,0,9)
TNT1 A 1
stop
Red:
TNT1 A 0 A_SpawnItemEx("CloakVisualR",0,0,60,momx,momy,momz,0,9)
TNT1 A 1
stop
Orange:
TNT1 A 0 A_SpawnItemEx("CloakVisualO",0,0,60,momx,momy,momz,0,9)
TNT1 A 1
stop
Purple:
TNT1 A 0 A_SpawnItemEx("CloakVisualP",0,0,60,momx,momy,momz,0,9)
TNT1 A 1
stop
}
}

actor CloakVisualB : CloakVisualSpawner
{
Translation "56:56=85:85","192:192=205:205","198:198=74:74","195:195=74:74","199:199=74:74","202:202=205:205","204:204=205:205","249:249=75:75","250:250=196:196"
//+CLIENTSIDEONLY
+NONETID
VisibleToTeam 0
states
{
Spawn:
SHAM J 0
SHAM J 1
stop
}
}

actor CloakVisualR : CloakVisualB
{
Translation "56:56=85:85","192:192=171:171","198:198=41:41","195:195=41:41","199:199=41:41","202:202=171:171","204:204=171:171","249:249=43:43","250:250=170:170"
VisibleToTeam 1
}

actor CloakVisualO : CloakVisualB
{
Translation "56:56=85:85","192:192=104:104","198:198=128:128","195:195=128:128","199:199=128:128","202:202=104:104","204:204=104:104","249:249=131:131","250:250=138:138"
VisibleToTeam 2
}

actor CloakVisualP : CloakVisualB
{
Translation "56:56=85:85","192:192=229:229","198:198=232:232","195:195=232:232","199:199=232:232","202:202=229:229","204:204=229:229","249:249=223:223","250:250=214:214"
VisibleToTeam 3
}


actor ShadowmanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("ShadowBladeCBM",0,1,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("ShadowBladeCBMB",0,1,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("ShadowBladeCBMR",0,1,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("ShadowBladeCBMO",0,1,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("ShadowBladeCBMP",0,1,8,0)
goto Done
}
}

actor ShadowmanMain3_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("ShadowNoReturnBlade2",0,1,8,0)
TNT1 A 0 A_FireCustomMissile("ShadowNoReturnBlade",10,0,8,0)
TNT1 A 0 A_FireCustomMissile("ShadowNoReturnBlade",-10,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("ShadowNoReturnBlade2B",0,1,8,0)
TNT1 A 0 A_FireCustomMissile("ShadowNoReturnBladeB",10,0,8,0)
TNT1 A 0 A_FireCustomMissile("ShadowNoReturnBladeB",-10,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("ShadowNoReturnBlade2R",0,1,8,0)
TNT1 A 0 A_FireCustomMissile("ShadowNoReturnBladeR",10,0,8,0)
TNT1 A 0 A_FireCustomMissile("ShadowNoReturnBladeR",-10,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("ShadowNoReturnBlade2O",0,1,8,0)
TNT1 A 0 A_FireCustomMissile("ShadowNoReturnBladeO",10,0,8,0)
TNT1 A 0 A_FireCustomMissile("ShadowNoReturnBladeO",-10,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("ShadowNoReturnBlade2P",0,1,8,0)
TNT1 A 0 A_FireCustomMissile("ShadowNoReturnBladeP",10,0,8,0)
TNT1 A 0 A_FireCustomMissile("ShadowNoReturnBladeP",-10,0,8,0)
goto Done
}
}
