actor SlenderManBossWeapon : MegaBuster
{
tag "   "
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 2
+INVENTORY.UNDROPPABLE
+WEAPON.AMMO_OPTIONAL
Obituary ""
weapon.ammotype "BossJumpCharge"
weapon.ammotype2 "BossRageCharge"
Scale 2.0
States
{
Spawn:
TNT1 A 0
stop
Ready:
SLTA A 0 ACS_NamedExecuteAlways("GiveExecution",0)
SLTA A 0 ACS_ExecuteAlways(991,0,11008)
SLTA A 1 
SLTA A 1 A_Gunflash
Goto Ready2
Ready2:
SLTA A 1 A_WeaponReady
loop
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
SLTA A 1 A_Lower
loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
SLTA A 1 A_Raise
Loop

Fire:
SLTA A 0
SLTA N 0 A_JumpIfInventory("SlenderIsInYourWalls",1,"CloakCancel")
SLTA A 0 A_JumpIfInventory("SlenderPhaseFlag8",1,"FireX")
SLTA A 0 A_JumpIfInventory("SlenderPhaseFlag5",1,"Fire2")
Fire1:
SLTA E 0 A_Jump(256,"Fire1a","Fire1b","Fire1c","Fire1d")
Fire1a: SLT1 A 0 A_Recoil(0) goto Fire1X
Fire1b: SLT2 B 0 A_Recoil(0) goto Fire1X
Fire1c: SLT3 C 0 A_Recoil(0) goto Fire1X
Fire1d: SLT4 D 0 A_Recoil(0) goto Fire1X
Fire1X:
"####" BC 1
"####" D 1 A_GiveInventory("SlendrilInventory_P",1)
"####" D 10
"####" C 9
"####" B 9
"####" A 4
"####" A 0 A_Refire
Goto Ready2

Fire2:
SLTA BC 1
SLTA D 1 A_GiveInventory("SlendrilInventory_P",1)
SLTA E 19
SLTA D 12
SLTA C 12
SLTA B 12
SLTA A 0 A_Refire
Goto Ready2

FireX:
SLTA BC 1
SLTA D 1 A_GiveInventory("SlendrilInventory_P",1)
SLTA E 13
SLTA D 8
SLTA C 8
SLTA B 8
SLTA A 0 A_Refire
Goto Ready2

Altfire:
TNT1 A 0 //A_JumpIfInventory("BossRageCharge", 1000, "WorldOfDarkness")
SLTA A 0 A_JumpIfInventory("SlenderIsInYourWalls",1,"CloakCancel")
SLTA A 1 A_JumpIfInventory("SlenderWallsAmmo",175,"Cloak")
goto NoAmmo

Cloak:
SLTA A 0 A_JumpIfInventory("SlenderPhaseFlag5",1,"CloakX")
SLTA BDE 1 A_SetTranslucent(0.25)
TNT1 A 0 A_SetTranslucent(0.0)
TNT1 C 0 A_ChangeFlag("INVULNERABLE",1)
TNT1 C 0 A_ChangeFlag("NODAMAGE",1)
TNT1 C 0 A_ChangeFlag("SOLID",0)
TNT1 C 0 A_ChangeFlag("SHOOTABLE",0)
TNT1 C 0 A_ChangeFlag("BLOCKEDBYSOLIDACTORS",0)

TNT1 A 0 A_GiveInventory("SlenderIsInYourWalls",1)
TNT1 A 5 ACS_ExecuteAlways(191,0,APROP_Speed,115,100)
goto ReadyCloak
CloakX:
TNT1 C 0 A_ChangeFlag("INVULNERABLE",1)
TNT1 C 0 A_ChangeFlag("NODAMAGE",1)
TNT1 C 0 A_ChangeFlag("CANPASS",1)
TNT1 C 0 A_ChangeFlag("SOLID",0)
TNT1 C 0 A_ChangeFlag("SHOOTABLE",0)
TNT1 C 0 A_ChangeFlag("BLOCKEDBYSOLIDACTORS",0)
TNT1 A 0 A_SpawnItemEx("SlenderManClone",0,0,4)
TNT1 A 3 A_SetTranslucent(0.0)
TNT1 A 0 A_GiveInventory("SlenderIsInYourWalls",1)
TNT1 A 8 ACS_ExecuteAlways(191,0,APROP_Speed,125,100)
goto ReadyCloak

ReadyCloak:
TNT1 A 1 A_WeaponReady
TNT1 A 0 A_TakeInventory("SlenderWallsAmmo",random(1,2))
TNT1 A 0 A_JumpIfInventory("SlenderWallsAmmo",1,"ReadyCloak")
Goto CloakCancel
CloakCancel:
SLTA A 4 
TNT1 C 0 A_ChangeFlag("INVULNERABLE",0)
TNT1 C 0 A_ChangeFlag("NODAMAGE",0)
TNT1 C 0 
TNT1 C 0 A_ChangeFlag("SHOOTABLE",1)
TNT1 C 0 A_ChangeFlag("BLOCKEDBYSOLIDACTORS",1)
TNT1 A 0 A_SpawnItemEx("Resolidifier")
SLTA A 0 ACS_ExecuteAlways(191,0,APROP_Speed,150,100)
TNT1 A 0 A_SetTranslucent(0.75)
SLTA A 0 A_TakeInventory("SlenderWallsAmmo",175)
SLTA A 0 A_TakeInventory("SlenderIsInYourWalls",1)
SLTA A 0 A_TakeInventory("JumpChargeStop",1)
SLTA A 8 A_PlaySoundEx("weapon/tengudash","Weapon")
SLTA A 0 ACS_ExecuteAlways(191,0,APROP_Speed,100,100)
SLTA A 4
SLTA AAA 1 A_WeaponReady(WRF_NOSECONDARY)
goto Ready2


WorldOfDarkness:
TNT1 A 0 A_JumpIfInventory("SlenderDark1", 1, "NoAmmo")
SLTA AFG 1
TNT1 A 0 A_TakeInventory("BossRageCharge", 1000)
TNT1 A 0 A_GiveInventory("BrightBlind", 110)
TNT1 A 0 ACS_ExecuteAlways(400, 0, 779) // darker zone ;~; oniiiichaaan helppp mee
TNT1 A 0 ACS_ExecuteAlways(400, 0, 780) // the weirdest flash ever. A black flash for Slenderman.
TNT1 A 19
SLTA G 15
SLTA F 15
SLTA A 15
goto Ready2

NoAmmo:
SLTA A 1 ACS_Execute(979,0)
SLTA A 0 A_Refire
goto Ready2

Flash:
TNT1 A 0 A_JumpIfInventory("SlenderIsInYourWalls",1,"FlashNo")
TNT1 A 1 A_JumpIfInventory("SlenderPhaseFlag4",1,"FlashReal")
TNT1 A 0 A_GiveInventory("SlenderWallsAmmo",1)
loop
FlashReal:
TNT1 A 0 A_RadiusGive("SlenderWhiteLevel5Check",132,RGF_PLAYERS|RGF_NOSIGHT,1)
TNT1 A 0 A_RadiusGive("SlenderWhiteLevel4Check",275,RGF_PLAYERS|RGF_NOSIGHT,1)
TNT1 A 0 A_RadiusGive("SlenderWhiteLevel3Check",425,RGF_PLAYERS|RGF_NOSIGHT,1)
TNT1 A 0 A_RadiusGive("SlenderWhiteLevel2Check",750,RGF_PLAYERS|RGF_NOSIGHT,1)
TNT1 A 0 A_RadiusGive("SlenderWhiteLevel1Check",890,RGF_PLAYERS|RGF_NOSIGHT,1)
TNT1 A 0 A_GiveInventory("SlenderWallsAmmo",1)
TNT1 A 0 A_JumpIfInventory("SlenderIsInYourWalls",1,"FlashNo")
TNT1 A 1
loop
FlashNo:
TNT1 A 0
TNT1 A 1
TNT1 A 1 A_JumpIfInventory("SlenderIsInYourWalls",1,"FlashNo")
TNT1 A 1
goto Flash
}
}

actor SlendrilInventory_P : CustomInventory
{
States
{
Pickup:
TNT1 E 0
TNT1 E 0 A_Jump(256,"ObitOne","ObitTwo","ObitThree","ObitFour","ObitFive", "ObitSix", "ObitSeven", "ObitEight","ObitNine","ObitTen")
ObitOne: 		TNT1 E 0 A_FireCustomMissile("Slendril1" ,0,1,0,0) Goto FireEnd
ObitTwo:		TNT1 E 0 A_FireCustomMissile("Slendril2" ,0,1,0,0) Goto FireEnd
ObitThree: 		TNT1 E 0 A_FireCustomMissile("Slendril3" ,0,1,0,0) Goto FireEnd
ObitFour: 		TNT1 E 0 A_FireCustomMissile("Slendril4" ,0,1,0,0) Goto FireEnd
ObitFive: 		TNT1 E 0 A_FireCustomMissile("Slendril5" ,0,1,0,0) Goto FireEnd
ObitSix: 		TNT1 E 0 A_FireCustomMissile("Slendril6" ,0,1,0,0) Goto FireEnd
ObitSeven: 		TNT1 E 0 A_FireCustomMissile("Slendril7" ,0,1,0,0) Goto FireEnd
ObitEight: 		TNT1 E 0 A_FireCustomMissile("Slendril8" ,0,1,0,0) Goto FireEnd
ObitNine: 		TNT1 E 0 A_FireCustomMissile("Slendril9" ,0,1,0,0) Goto FireEnd
ObitTen: 		TNT1 E 0 A_FireCustomMissile("Slendril10",0,1,0,0) Goto FireEnd
FireEnd:
TNT1 A 0
stop
}
}

actor SlenderProtect : PowerProtection {powerup.duration 3 damagefactor "Slender", 0.0}

actor Slendril1 : SaxtonFist
{
Translation "198:198=0:0", "192:192=4:4"
-NOINTERACTION
+RIPPER
speed 85
Obituary "$OB_SLENDER1_1"
radius 10
height 25
scale 2.5
damage (0)
damage (1*ACS_NamedExecuteWithResult("SH_SlenderDamage",1))
damagetype "Slender"
States
{
Spawn:
MXP1 A 0
MXP1 A 2 A_CountDown
wait
Death:
MXP1 A 0 A_Explode(1*ACS_NamedExecuteWithResult("SH_SlenderDamage",1),20,0,0,20)
goto XDeath
XDeath:
MXP1 B 0 A_Stop
MXP1 A 2
MXP1 B 2
MXP1 CDE 2
stop
}
}

actor Slendril2  : Slendril1 {Obituary "$OB_SLENDER1_2" }
actor Slendril3  : Slendril1 {Obituary "$OB_SLENDER1_3" }
actor Slendril4  : Slendril1 {Obituary "$OB_SLENDER1_4" }
actor Slendril5  : Slendril1 {Obituary "$OB_SLENDER1_5" }
actor Slendril6  : Slendril1 {Obituary "$OB_SLENDER1_6" }
actor Slendril7  : Slendril1 {Obituary "$OB_SLENDER1_7" }
actor Slendril8  : Slendril1 {Obituary "$OB_SLENDER1_8" }
actor Slendril9  : Slendril1 {Obituary "$OB_SLENDER1_9" }
actor Slendril10 : Slendril1 {Obituary "$OB_SLENDER1_10"}


actor SlenderEclipseTentacle
{
Obituary "$OB_SLENDER2"
translation "59:63=3:3", "249:249=5:5"
+FLOORHUGGER
+DONTSPLASH
scale 2.5
reactiontime 12
+MISSILE
damagetype "Slender"
states
{
Spawn:
BEC2 A 0
BEC2 A 12
"####" G 0 A_PlaySound("misc/mm3explosion", "Voice",0.1)
BEC2 BCDEF 2
BEC2 G 8
BEC2 G 0 A_Jump(256, 0, 2, 3, 4, 5, 6)
TentacleTime:
BEC2 HIHJKL 3 A_Explode(1*ACS_NamedExecuteWithResult("SH_SlenderDamage",3), 42, 0, 0, 42)//A_Countdown
BEC2 L 0 A_Countdown
loop
Death:
BEC2 JMN 3
BEC2 A 3
stop
}
}

actor SlenderEclipseTentacleSpawner
{
renderstyle none
PROJECTILE
+FLOORHUGGER
+RIPPER
speed 35
+THRUACTORS
reactiontime 14
states
{
Spawn:
PLAY A 0
PLAY A 4 A_SpawnITemex("SlenderEclipseTentacle")
PLAY A 0 A_Countdown
loop
}
}


// Darkness //

actor SlenderDark : CustomInventory
{
+INVENTORY.AUTOACTIVATE
inventory.amount 1
states
{
Spawn:
TNT1 A 1
stop
Pickup:
TNT1 A 1
TNT1 A 1 ACS_ExecuteAlways(712,0,0)
stop
}
}

actor UnSlenderDark : CustomInventory
{
+INVENTORY.AUTOACTIVATE
inventory.amount 1
states
{
Spawn:
TNT1 A 1
stop
Pickup:
TNT1 A 1
TNT1 A 1 ACS_ExecuteAlways(712,0,1)
stop
}
}

actor PowerSlendyCanSee : PowerupGiver
{
+INVENTORY.AUTOACTIVATE
Powerup.Type "Torch"
Powerup.Duration 0x7FFFFFFF
}

actor SlenderPlayerReveal : PowerupGiver
{
Powerup.Duration 0x7FFFFFFF
Powerup.Type "Scanner"
+INVENTORY.AUTOACTIVATE
+INVENTORY.ALWAYSPICKUP
}

actor SlenderWanderingSound : CustomInventory
{
States
{
Pickup:
TNT1 A 0
stop
}
}

actor SlenderDark1 : Once {}
actor SlenderIsInYourWalls : Once {}
Actor SlenderWallsAmmo : Inventory {Inventory.MaxAmount 175}

actor SlenderManClone
{
Obituary "$OB_SLENDER3"
alpha 0.70 renderstyle translucent scale 2.5 gravity 1.5
Height 56
Radius 40
reactiontime 175
PROJECTILE
+SEEKERMISSILE
+ripper
-SOLID
-NOGRAVITY
+DONTBLAST
+NOEXPLODEFLOOR
+HEXENBOUNCE bouncefactor 1.0 wallbouncefactor 0.0
Translation "190:195=3:3", "198:198=8:8"
States
{
Spawn:
SLCB K 1 A_Jumpif(floorz==z, "Land")
loop
Land:
SLCB A 0 A_Changeflag("NOCLIP",1)
SLCB A 0 A_Changeflag("NOGRAVITY",1)
SLCB A 0 A_Stop
SLCB A 5 A_SetAngle(random(0,359)) //leniency to not just be fucked
SLCB A 0
Spawn15:
SLCB A 0 A_RadiusGive("SlenderWhiteLevel5Check",132,RGF_PLAYERS|RGF_NOSIGHT|RGF_NOTARGET,1)
SLCB A 0 A_RadiusGive("SlenderWhiteLevel4Check",275,RGF_PLAYERS|RGF_NOSIGHT|RGF_NOTARGET,1)
SLCB A 0 A_RadiusGive("SlenderWhiteLevel3Check",425,RGF_PLAYERS|RGF_NOSIGHT|RGF_NOTARGET,1)
SLCB A 0 A_RadiusGive("SlenderWhiteLevel2Check",750,RGF_PLAYERS|RGF_NOSIGHT|RGF_NOTARGET,1)
SLCB A 0 A_RadiusGive("SlenderWhiteLevel1Check",890,RGF_PLAYERS|RGF_NOSIGHT|RGF_NOTARGET,1)
SLCB A 1 A_GiveInventory("CutterFlag",1)
SLCB A 0 A_JumpIfInventory("CutterFlag",10,"Spawn2")
loop
Spawn2:
SLCB A 0 A_RadiusGive("SlenderWhiteLevel5Check",132,RGF_PLAYERS|RGF_NOSIGHT|RGF_NOTARGET,1)
SLCB A 0 A_RadiusGive("SlenderWhiteLevel4Check",275,RGF_PLAYERS|RGF_NOSIGHT|RGF_NOTARGET,1)
SLCB A 0 A_RadiusGive("SlenderWhiteLevel3Check",425,RGF_PLAYERS|RGF_NOSIGHT|RGF_NOTARGET,1)
SLCB A 0 A_RadiusGive("SlenderWhiteLevel2Check",750,RGF_PLAYERS|RGF_NOSIGHT|RGF_NOTARGET,1)
SLCB A 0 A_RadiusGive("SlenderWhiteLevel1Check",890,RGF_PLAYERS|RGF_NOSIGHT|RGF_NOTARGET,1)
SLCB A 1 A_SeekerMissile (2, 4, SMF_LOOK, 256, 1)
SLCB A 0 A_JumpIfTargetInLOS("Launch", 0, JLOSF_PROJECTILE)
SLCB A 0 A_Countdown
loop
Launch:
SLCB K 0 A_Stop
SLCB KK 0 A_FaceTarget
SLCB A 0 A_PlaySoundEx("weapon/tengudash","Weapon")
SLCB A 0 A_CustomMissile("SlenderManClone2",0,0,0,0)
stop
Death:
SLCB IJ 1 A_FadeOut(0.06)
loop
}
}

actor SlenderManClone2 : SlenderManClone
{
Obituary "$OB_SLENDER3"
damagetype "Slender2"
-HEXENBOUNCE
-NOEXPLODEFLOOR
+NOGRAVITY
-RIPPER
damage (40)
speed 40
reactiontime 35
States
{
Spawn:
SLCB K 0
SLCB AAAA 0 A_SeekerMissile (80, 90, SMF_LOOK|SMF_CURSPEED|SMF_PRECISE, 256, 1)
SLCB K 1 A_CountDown
loop
XDeath:
Death:
SLCB K 0 A_Stop
SLCB KJ 2 A_FadeOut(0.1)
loop
}
}