
// DEATHWEAVER
/*
[2:40 AM] Marrub: FUCK
[2:41 AM] Marrub: FUCK
[2:41 AM] Marrub: FUCK
[2:41 AM] Marrub: FUCK
[2:41 AM] Marrub: FUCK
[2:41 AM] Marrub: I HATE YOU
[2:41 AM] Marrub: DIE
[2:41 AM] Marrub: WHY
[2:41 AM] Marrub: WHY
[2:41 AM] Marrub: WHY
[2:41 AM] Marrub: WHY
[2:41 AM] Yholl: Hahahahahahahahahhahahahaah
[2:41 AM] Yholl: I see you enjoyed the Deathweaver
[2:41 AM] Marrub: AAAAAAAAAA
[2:41 AM] Yholl: Good good
[2:41 AM] Yholl: YEEEEEEEEEEEEEEEEEEEEEEE

	LATER, IN 2017

[4:45 PM] Yholl: quick summon rlarmageddonarachnotron
[4:45 PM] Marrub: fjSDLF;jSL:DFjsDLJFl'
[4:46 PM] Yholl: ashfiuahfaaahahaahahahhaa
[4:46 PM] Marrub: I DON'T KNOW WHAT I WAS EXPECTING

	LATER, IN 2019
	
[6:59 PM] Ethril: OK WHO'S THE WISE GUY
[6:59 PM] Ethril: WHO THOUGHT IT WOULD BE OKAY TO  USE THAT SOUND EFFECT
[7:00 PM] Sgt. Shivers: ?
[7:01 PM] Ethril: don't play dumb with me, you know exactly which monster i'm talking about
[7:03 PM] Sgt. Shivers: the hungry?
[7:03 PM] Ethril: no
[7:04 PM] Ethril: the deathweaver
[7:04 PM] Sgt. Shivers: ah
[7:04 PM] Sgt. Shivers: hahaha
*/
ACTOR RLArmageddonArachnotron : RLArachnotronBase 16563
{
  Health 600
  GibHealth -60
  Radius 34
  Height 70
  Speed 2
  Scale 1.3
  Gravity 0.25
  MaxStepHeight 64
  Mass 200
  
  MinMissileChance 1
  PainThreshold 100
  PainChance 256
  
  DamageFactor "Bullet", 0.75
  
  +QUICKTORETALIATE
  +MISSILEMORE
  +MISSILEEVENMORE
  +FLOATBOB
  +NOBLOOD
  +DONTFALL
  -FLOORCLIP
  
  SeeSound ""
  PainSound "deathweaver/pain"
  DeathSound "deathweaver/pain"
  CrushPainSound "deathweaver/pain"
  
  Obituary "A Deathweaver scared %o to death with bullets and dormant fears."
  Tag "Deathweaver"
    //$category "MP Armageddon"
  
	// Guncaster compatibility
	DropItem "Amber", 192
	DropItem "Ruby", 192
	DropItem "Ruby"
	DropItem "Emerald"
  
  var int user_targetingtimer;
  States
  {
  Spawn:
    TNT1 A 0 NoDelay A_PlaySound("deathweaver/hover", 6, 1, 1, 1.4)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_LookEx (LOF_NOSEESOUND, 0, 0, 0, 360, "DrillerTrauma")
    Goto Spawn
	
  DrillerTrauma:
    TNT1 A 0 A_PlaySound("deathweaver/sight", CHAN_VOICE, 1, 0, 0.8)
    Goto See
  See:
    TNT1 A 0 A_PlaySound("deathweaver/hover", 6, 1, 1, 1.4)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_Chase ("", "Missile")
    Goto See
	
  MissileProper:
    TNT1 A 0 A_JumpIfInTargetInventory ("RLEnergyShieldArmorToken", 1, "MissileNonSuicide")
    TNT1 A 0 A_JumpIfInTargetInventory ("RLRechargeableEnergyShieldArmorToken", 1, "MissileNonSuicide")
    TNT1 A 0 A_JumpIfInTargetInventory ("RLFireShieldArmorToken", 1, "MissileNonSuicide")
    TNT1 A 0 A_JumpIfInTargetInventory ("PowerRLReactiveShieldSystemFire", 1, "MissileNonSuicide")
    TNT1 A 0 A_JumpIfHealthLower (100, 1)
	Goto MissileNonSuicide
    TNT1 A 0 A_JumpIfCloser (750, "SuicideCharge")
	Goto MissileNonSuicide
  MissileNonSuicide:
    TNT1 A 0 A_JumpIfInTargetInventory ("RLEnclaveSetBonusActive", 1, "PlasmaBlast")
    TNT1 A 0 A_JumpIfInTargetInventory ("RLBallisticShieldArmorToken", 1, "PlasmaBlast")
    TNT1 A 0 A_JumpIfInTargetInventory ("RLShieldedArmorToken", 1, "PlasmaBlast")
    TNT1 A 0 A_JumpIfInTargetInventory ("PowerRLReactiveShieldSystemBullet", 1, "PlasmaBlast")
    TNT1 A 0 A_JumpIfCloser (1000, "MachinegunCheck")
    TNT1 A 0 A_JumpIfInTargetInventory ("RLPlasmaShieldArmorToken", 1, "MachinegunCheck")
    TNT1 A 0 A_JumpIfInTargetInventory ("RLKyleTeslaboltArmorToken", 1, "MachinegunCheck")
    TNT1 A 0 A_JumpIfInTargetInventory ("PowerRLReactiveShieldSystemPlasma", 1, "MachinegunCheck")
	Goto PlasmaBlast
	
  Machineguns:
    TNT1 A 0 A_JumpIfInTargetInventory ("RLBallisticShieldArmorToken", 1, "PlasmaBlast")
    TNT1 A 0 A_JumpIfInTargetInventory ("RLShieldedArmorToken", 1, "PlasmaBlast")
    TNT1 A 0 A_JumpIfInTargetInventory ("PowerRLReactiveShieldSystemBullet", 1, "PlasmaBlast")
    TNT1 A 0 A_Jump (96,2)
    TNT1 A 0 A_PlaySound("deathweaver/sight", CHAN_VOICE, 1, 0, 0.8)
    TNT1 A 0 ThrustThing(angle*256/360+random(0,359), random(10,20), 0, 0)
    TNT1 A 0 A_FaceTarget (360, 90)
    TNT1 A 0 A_SetUserVar("user_targetingtimer", random(3,9))
  Targeting:
    TNT1 A 0 A_JumpIf (user_targetingtimer <= 0, "MissileFire")
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_FaceTarget (1, 1)
    TNT1 A 0 A_SetUserVar("user_targetingtimer", user_targetingtimer - 1)
	Goto Targeting
	
  MissileFire:
  RepeatProper:
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    TNT1 A 0 A_JumpIfInventory ("RLDeathweaverFiringCounter", 21, "MissileEnd")
    TNT1 A 0 A_PlaySound("deathweaver/firing", CHAN_WEAPON, 1, 0, 0.7)
    TNT1 A 0 A_PlaySound("deathweaver/firing", CHAN_ITEM, 0.05, 0, 0.20)
    TNT1 A 0 A_JumpIfInventory ("RLDeathweaverStateCounter", 1, "MissileAlt")
    TNT1 A 0 A_GiveInventory ("RLDeathweaverStateCounter", 1)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverFiringCounter", 1)
    TNT1 A 0 A_ScaleVelocity (0.95)
	TNT1 A 0 A_SetPitch(-pitch)
    AARA B 1 Bright A_CustomBulletAttack (6, 1, 1, random(2,5), "RLEnemyBulletPuffNoInfight", 0, CBAF_AIMFACING | CBAF_NORANDOM)
	TNT1 A 0 A_SetPitch(-pitch)
    TNT1 A 0 A_FaceTarget (2, 1)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_ScaleVelocity (0.95)
    Goto RepeatFriendlyCheck
  MissileAlt:
    TNT1 A 0 A_TakeInventory ("RLDeathweaverStateCounter", 1)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverFiringCounter", 1)
    TNT1 A 0 A_ScaleVelocity (0.95)
	TNT1 A 0 A_SetPitch(-pitch)
    AARA C 1 Bright A_CustomBulletAttack (6, 1, 1, random(2,5), "RLEnemyBulletPuffNoInfight", 0, CBAF_AIMFACING | CBAF_NORANDOM)
	TNT1 A 0 A_SetPitch(-pitch)
    TNT1 A 0 A_FaceTarget (2, 1)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_ScaleVelocity (0.95)
    Goto RepeatFriendlyCheck
  MissileEnd:
    TNT1 A 0 A_TakeInventory ("RLDeathweaverFiringCounter", 21)
    TNT1 A 0 A_PlaySound("deathweaver/firingend", CHAN_WEAPON, 1, 0, 0.7)
    TNT1 A 0 A_PlaySound("deathweaver/firingend", CHAN_ITEM, 0.05, 0, 0.20)
    TNT1 A 0 A_JumpIfInventory ("RLDeathweaverStateCounter", 1, "MissileEndAlt")
	TNT1 A 0 A_SetPitch(-pitch)
    AARA B 1 Bright A_CustomBulletAttack (6, 1, 1, random(2,5), "RLEnemyBulletPuffNoInfight", 0, CBAF_AIMFACING | CBAF_NORANDOM)
    AARA C 1 Bright A_GiveInventory ("RLDeathweaverGaze", 1)
    TNT1 A 0 A_SetUserVar("user_targetingtimer", 11)
	Goto MissileEndCycle
  MissileEndAlt:
	TNT1 A 0 A_SetPitch(-pitch)
    AARA C 1 Bright A_CustomBulletAttack (6, 1, 1, random(2,5), "RLEnemyBulletPuffNoInfight", 0, CBAF_AIMFACING | CBAF_NORANDOM)
    TNT1 A 0 A_SetUserVar("user_targetingtimer", 12)
	Goto MissileEndCycle
  MissileEndCycle:
    TNT1 A 0 A_JumpIf (user_targetingtimer <= 0, "MissileEndCycleEndofEnds")
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_FaceTarget
    TNT1 A 0 A_SetUserVar("user_targetingtimer", user_targetingtimer - 1)
	Goto MissileEndCycle
  MissileEndCycleEndofEnds:
    TNT1 A 0 A_MonsterRefire(0, "See")
    Goto Missile
	
  PlasmaBlast:
    TNT1 A 0 A_SetUserVar("user_targetingtimer", random(8,16))
	Goto PlasmaBlastCycle1
  PlasmaBlastCycle1:
    TNT1 A 0 A_JumpIf (user_targetingtimer <= 0, "PlasmaBlastFiring")
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_FaceTarget (360, 90)
    TNT1 A 0 A_SetUserVar("user_targetingtimer", user_targetingtimer - 1)
	Goto PlasmaBlastCycle1
  PlasmaBlastFiring:
    AARA A 1 Bright A_CustomMissile ("RLDeathweaverPlasma", 28)
    TNT1 A 0 A_SetUserVar("user_targetingtimer", 17)
  PlasmaBlastCycle2:
    TNT1 A 0 A_JumpIf (user_targetingtimer <= 0, "See")
    AARA A 1 A_GiveInventory ("RLDeathweaverGaze", 1)
    TNT1 A 0 A_SetUserVar("user_targetingtimer", user_targetingtimer - 1)
	Goto PlasmaBlastCycle2
	
  SuicideCharge:
    AARA AAAAAAAAAA 1 A_FaceTarget (360, 90)
    TNT1 A 0 A_PlaySound("deathweaver/charge", CHAN_VOICE, 1, 0, 0.8)
    TNT1 A 0 A_ChangeFlag ("NOGRAVITY", 1)
    TNT1 A 0 A_ChangeFlag ("FLOAT", 1)
    TNT1 A 0 A_SetUserVar("user_targetingtimer", 35)
	Goto SuicideCharging
  SuicideCharging:
    TNT1 A 0 A_JumpIfInventory ("RLDeathweaverSuicideActivate", 1, "SuicideExplosion")
    TNT1 A 0 A_JumpIf (user_targetingtimer <= 0, "StopSuicide")
    TNT1 A 0 ThrustThing(angle*256/360, 4, 0, 0)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_FaceTarget (9, 90)
    TNT1 A 0 A_CustomMissile ("RLDeathweaverSuicideDetector", 38, 0, 0, CMF_CHECKTARGETDEAD)
    TNT1 A 0 A_SetUserVar("user_targetingtimer", user_targetingtimer - 1)
	Goto SuicideCharging
  StopSuicide:
    TNT1 A 0 A_ChangeFlag ("NOGRAVITY", 0)
    TNT1 A 0 A_ChangeFlag ("FLOAT", 0)
	Goto See
  SuicideExplosion:
    TNT1 A 0 A_CustomMissile ("RLDeathweaverSuicideDamage", 38, 0, 0, CMF_AIMDIRECTION)
    TNT1 A 0 A_GiveInventory ("RLArmageddonArachnotronKillIncrementer", 1, AAPTR_PLAYER1) // Used for tallying total kills and bestiary info
    TNT1 A 0 A_StopSound(6)
    TNT1 A 0 A_BossDeath
    TNT1 A 0 A_Scream
    TNT1 A 0 A_Die ("SelfDestruct")
	Goto Death.SelfDestruct
	
  PainMain:
    TNT1 A 0 A_Pain
    TNT1 A 0 A_Jump (128,"Pain2")
    AARA DDD 1 A_SetAngle (angle+10)
    TNT1 A 0 A_ScaleVelocity (0.9)
    TNT1 A 0 A_PlaySound("arachnotron/pain", 7)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle+10)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle+10)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle+10)
    TNT1 A 0 A_ScaleVelocity (0.9)
    AARA DDD 1 A_SetAngle (angle+10)
    TNT1 A 0 A_ScaleVelocity (0.9)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle+10)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle+10)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle+10)
    TNT1 A 0 A_ScaleVelocity (0.9)
    AARA DDD 1 A_SetAngle (angle+10)
    TNT1 A 0 A_ScaleVelocity (0.9)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle+10)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle+10)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle+10)
    TNT1 A 0 A_ScaleVelocity (0.9)
    AARA DDD 1 A_SetAngle (angle+10)
    Goto PainEnd
  Pain2:
    AARA DDD 1 A_SetAngle (angle-10)
    TNT1 A 0 A_ScaleVelocity (0.9)
    TNT1 A 0 A_PlaySound("arachnotron/pain", 7)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle-10)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle-10)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle-10)
    TNT1 A 0 A_ScaleVelocity (0.9)
    AARA DDD 1 A_SetAngle (angle-10)
    TNT1 A 0 A_ScaleVelocity (0.9)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle-10)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle-10)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle-10)
    TNT1 A 0 A_ScaleVelocity (0.9)
    AARA DDD 1 A_SetAngle (angle-10)
    TNT1 A 0 A_ScaleVelocity (0.9)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle-10)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle-10)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_SetAngle (angle-10)
    TNT1 A 0 A_ScaleVelocity (0.9)
    AARA DDD 1 A_SetAngle (angle-10)
    Goto PainEnd
  PainEnd:
    TNT1 A 0 A_Stop
    TNT1 A 0 A_Jump (128,2)
    TNT1 A 0 A_PlaySound("deathweaver/sight", CHAN_VOICE, 1, 0, 0.8)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_FaceTarget (20)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_FaceTarget (20)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_FaceTarget (20)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_FaceTarget (20)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_FaceTarget (20)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_FaceTarget (20)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_FaceTarget (20)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_FaceTarget (20)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_FaceTarget (20)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_FaceTarget (20)
    Goto See
	
  XDeathMain:
  DeathMain:
    TNT1 A 0 A_GiveInventory ("RLArmageddonArachnotronKillIncrementer", 1, AAPTR_PLAYER1) // Used for tallying total kills and bestiary info
    TNT1 A 0 A_StopSound(6)
    TNT1 A 0 A_BossDeath
    TNT1 A 0 A_Scream
    AARA EFEFE 3
  Death.SelfDestruct:
    AARA G 4 Bright
    TNT1 A 0 A_NoBlocking
    TNT1 A 0 A_SpawnItemEx ("RLReducedGibber", 0,0,0, VelX,VelY,VelZ, 0, SXF_ABSOLUTEMOMENTUM | SXF_USEBLOODCOLOR | SXF_NOCHECKPOSITION)
	TNT1 A 0 A_JumpIf(CallACS("DRLA_MonsterQuake") == 0, 3)
    TNT1 A 0 A_Quake (1, 8, 0, 512, "")
    TNT1 A 0 A_Quake (5, 8, 0, 256, "")
    TNT1 A 0 A_PlaySound ("rlmonsters/mediumexp", 7, 1, 0, 0.6)
    TNT1 A 0 A_PlaySound("rlmonsters/mediumexp", CHAN_ITEM, 0.05, 0, 0.15)
    AARA H 4 Bright
    CELE HI 3 Bright
    CELE JK 2 Bright
    TNT1 A 0
    "####" "#" 0 A_Jump(256, "DestroyedEnd")
    Goto DestroyedEnd
  SimpleXDeathMain:
    TNT1 A 0 A_StopSound(6)
    TNT1 A 0 A_BossDeath
    TNT1 A 0 A_GiveInventory ("RLArmageddonArachnotronKillIncrementer", 1, AAPTR_PLAYER1) // Used for tallying total kills and bestiary info
    TNT1 A 0 A_Scream
    AARA G 4 Bright
    TNT1 A 0 A_NoBlocking
    AARA H 4 Bright
    CELE HI 3 Bright
    CELE JK 2 Bright
    TNT1 A 0
    "####" "#" 0 A_Jump(256, "DestroyedEnd")
    Goto DestroyedEnd
  DeathFrame:
    TNT1 A 0 A_BossDeath
    "####" "#" 0 A_Jump(256, "DestroyedEnd")
    Goto DestroyedEnd
	
	//Ice
  GenericFreezeDeath:
	"####" "#" 0 A_GiveInventory ("RLArmageddonArachnotronKillIncrementer", 1, AAPTR_PLAYER1) // Used for tallying total kills and bestiary info
    "####" "#" 0 A_Jump(256, "GenericFreezeMana")
    Goto GenericFreezeMana
	
  Raise:
    Stop
	
  CrushDRLA:
    TNT1 A 0 A_StopSound(6)
    TNT1 A 30 A_SpawnItemEx("RLCrushedMedium",0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION)
    "####" "#" 0 A_BossDeath
    "####" "#" 0 A_Jump(256, "CrushEnd")
    Goto CrushEnd
//==============================================================================
//					--	DOOMRL ARSENAL STUFF  --
//==============================================================================
  MachinegunCheck:
	"####" "#" 0 A_JumpIf(CallACS("DRLAMonsterOnlyCheck"), 1) // Check for full DRLA
	Goto Machineguns
	"####" "#" 0 A_JumpIf(CallACS("DRLA_specialstarts") == 2, "Duke2LaserAttack")
    "####" "#" 0 A_Jump(256, "Machineguns")
	Goto Machineguns
	
  Pain.RigelBlast:
    TNT1 A 0 A_PlaySound("weapons/dn2gunhit", CHAN_BODY)
    D2F2 Y 2 Bright
    Goto See
  Pain.NeuralStun:
    D2F2 Y 2 Bright
    Goto See
  Pain.CyberDisruptor:
    TNT1 A 0
    Goto Pain.LightningBlue
	
  Death.NeuralStun:
    TNT1 A 0
    Goto Death
  XDeath.RigelBlast:
  Death.RigelBlast:
    TNT1 A 0 A_BossDeath
    TNT1 A 0 A_GiveInventory ("RLDuke2Score", 2000, AAPTR_TARGET)
    TNT1 A 0 A_GiveInventory ("RLArmageddonArachnotronKillIncrementer", 1, AAPTR_PLAYER1) // Used for tallying total kills and bestiary info
    TNT1 A 0 A_PlaySound("weapons/dn2gunexplosion", CHAN_BODY)
    TNT1 A 0 A_NoBlocking
    TNT1 A 0 A_SpawnItemEx ("RLDuke2MediumExplosion", 0,0,16, 0,0,0, 0, SXF_NOCHECKPOSITION)
    TNT1 A 35
    Stop
	
//==============================================================================
//					--	Special Monster Attacks  --
//==============================================================================
  Duke2LaserAttack:
  Duke2LaserRepeat:
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    TNT1 A 0 A_JumpIfInventory ("RLDeathweaverFiringCounter", 21, "Duke2LaserAttackEnd")
    TNT1 A 0 A_JumpIfInventory ("RLDeathweaverStateCounter", 1, "Duke2LaserAttackAlt")
    TNT1 A 0 A_GiveInventory ("RLDeathweaverStateCounter", 1)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverFiringCounter", 1)
    TNT1 A 0 A_ScaleVelocity (0.95)
	TNT1 A 0 A_SetPitch(-pitch)
    AARA B 1 Bright A_CustomBulletAttack (6, 1, 1, random(2,5), "RLEnemyBulletPuffNoInfight", 0, CBAF_AIMFACING | CBAF_NORANDOM)
	TNT1 A 0 A_SetPitch(-pitch)
    TNT1 A 0 A_FaceTarget (2, 1)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_ScaleVelocity (0.95)
    Goto RepeatFriendlyCheck
  Duke2LaserAttackAlt:
    TNT1 A 0 A_TakeInventory ("RLDeathweaverStateCounter", 1)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverFiringCounter", 1)
    TNT1 A 0 A_ScaleVelocity (0.95)
	TNT1 A 0 A_SetPitch(-pitch)
    AARA C 1 Bright A_CustomBulletAttack (6, 1, 1, random(2,5), "RLEnemyBulletPuffNoInfight", 0, CBAF_AIMFACING | CBAF_NORANDOM)
	TNT1 A 0 A_SetPitch(-pitch)
    TNT1 A 0 A_FaceTarget (2, 1)
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_ScaleVelocity (0.95)
    Goto RepeatFriendlyCheck
  Duke2LaserAttackEnd:
    TNT1 A 0 A_SetUserVar("user_targetingtimer", 12)
	Goto Duke2LaserAttackEndCycle
  Duke2LaserAttackEndCycle:
    TNT1 A 0 A_JumpIf (user_targetingtimer <= 0, "Duke2LaserAttackEndCycleEndofEnds")
    TNT1 A 0 A_GiveInventory ("RLDeathweaverGaze", 1)
    AARA A 1 A_FaceTarget
    TNT1 A 0 A_SetUserVar("user_targetingtimer", user_targetingtimer - 1)
	Goto Duke2LaserAttackEndCycle
  Duke2LaserAttackEndCycleEndofEnds:
    TNT1 A 0 A_MonsterRefire(0, "See")
    Goto RepeatFriendlyCheck

//==============================================================================
//					--	Final Doomer Compatibility Stuff  --
//==============================================================================
  DeathXSparkFrame:
    "####" "#" 0 A_JumpIfInTargetInventory("Mana",0,2)
    "####" "#" 0 A_DropItem("MajorManaPod",-1,54)
    AARA D 0 A_BossDeath
    "####" "#" 0 A_Jump(256, "DeathXSpark")
	Goto DeathXSpark
	
//==============================================================================
//					--	Guncaster Compatibility Stuff  --
//==============================================================================
	MidasFrame1:
		AARA D 0 A_SpawnItemEx("Midas_Statue_Arach", 0,0,0, 0,0,0, 0,SXF_TRANSFERPOINTERS|SXF_TRANSFERSPRITEFRAME)
		TNT1 A 0 A_JumpIf(1, "DestroyedEnd")
		Goto DestroyedEnd
	MidasFrame2:
		AARA D 0 A_SpawnItemEx("Midas_Statue_Arach", 0,0,0, frandom(-10.0,-12.0),0,frandom(1.0,3.0), 0,SXF_TRANSFERPOINTERS|SXF_SETMASTER|SXF_TRANSFERSPRITEFRAME)
		TNT1 A 10 A_KillChildren
		TNT1 A 0 A_JumpIf(1, "DestroyedEnd")
		Goto DestroyedEnd
	MidasFrame3:
		AARA D 0 A_SpawnItemEx("Midas_Statue_Arach", 0,0,0, frandom(-15.0,-20.0),0,frandom(10.0,15.0), 0,SXF_TRANSFERPOINTERS|SXF_SETMASTER|SXF_TRANSFERSPRITEFRAME)
		TNT1 A 10 A_KillChildren
		TNT1 A 0 A_JumpIf(1, "DestroyedEnd")
		Goto DestroyedEnd
		
	//Gumpop
    Death.Acid:    //So I did mention about meltdown death once...
        "####" "#" 0 A_JumpIfInTargetInventory("Mana",0,2)
        "####" "#" 0 A_DropItem("MinorManaPod",-1,24)
        "####" "#" 0 ACS_NamedExecuteAlways("Toxic Avenger")
        "####" "#" 0 A_NoBlocking
        "####" "#" 0 A_Scream
    AcidDeathLoop:
        "####" "#" 0 A_JumpIf(ScaleY <= 0, "DestroyedEnd")
        "####" "#" 0 A_FadeOut(0.03)
        AARA D 1 A_SetScale(ScaleX + 0.03, ScaleY - 0.03)
        Loop
		
	//Thunderstruck
	Pain.Lightning:
		"####" "#" 0 A_Jump(164,1)
		Goto Pain
		AARA D 0 A_ChangeFlag("NOPAIN",1)
		"####" "#" 0 A_SetUserVar("User_LightningLock", User_LightningLock + 10)
		"####" "#" 0 A_Jump(256,"LightningLock")
		Goto LightningLock
		
	//Cauterizer
	Pain.LightningBlue:
		"####" "#" 0 A_Jump(48,1)
		Goto Pain
		AARA D 0 A_ChangeFlag("NOPAIN",1)
		"####" "#" 0 A_SetUserVar("User_LightningLock", User_LightningLock + 10)
		"####" "#" 0 A_Jump(256,"BlueLightningLock")
		Goto BlueLightningLock
		
		// Overwrite these for monsters that do not leave corpses behind
	//Dreadful
	Death.Tiberium:
		"####" "#" 0 A_Jump(256, "Death")
		Goto Death
	Death.BlueTiberium:
		"####" "#" 0 A_Jump(256, "Death")
		Goto Death
	//Fire and Lightning
	Death.Fire:
		"####" "#" 0 A_Jump(256,"Death")
		Goto Death
  }
}

ACTOR RLDeathweaverGaze : CustomInventory // Not sure why this thing didn't work. Oh well, TIME TO RAPE THE CODE AHAHAHAHAHAHAHahahfjdfsgfgnrfg
{
  -COUNTITEM
  +INVENTORY.ALWAYSPICKUP
  Inventory.PickupMessage ""
  Inventory.PickupSound ""
  States
  {
  Spawn:
    TNT1 A 1
    Stop
  Pickup:
    TNT1 A 0 
	TNT1 A 0 A_JumpIf(CallACS("DRLA_GetLightLevel") < 100, 1)
    Stop
    TNT1 A 0 A_SpawnItemEx ("RLDeathweaverGazeGlow1", 12,0,42, 0,0,0, 0, SXF_NOCHECKPOSITION)
    TNT1 A 0 A_SpawnItemEx ("RLDeathweaverGazeGlow2", 18,0,42, 0,0,0, 0, SXF_NOCHECKPOSITION)
    TNT1 A 0 A_SpawnItemEx ("RLDeathweaverGazeGlow3", 24,0,42, 0,0,0, 0, SXF_NOCHECKPOSITION)
    TNT1 A 0 A_SpawnItemEx ("RLDeathweaverGazeGlow4", 30,0,42, 0,0,0, 0, SXF_NOCHECKPOSITION)
    Stop
  }
}

ACTOR RLDeathweaverGazeGlow1
{
  Radius 4
  Height 4
  +NOGRAVITY
  +THRUACTORS
  +NOTIMEFREEZE
  +NOINTERACTION
  +NOCLIP
  +NOTONAUTOMAP
  RenderStyle Add
  Alpha 0.7
  Scale 0.15
  States
  {
  Spawn:
    TNT1 A 0 
    AARA I 1 Bright
    AARA I 1 Bright A_FadeTo (0.35, 0.35, 0)
    Stop
  }
}

ACTOR RLDeathweaverGazeGlow2 : RLDeathweaverGazeGlow1
{
  Alpha 0.5
  Scale 0.30
  States
  {
  Spawn:
    TNT1 A 0 
    AARA I 1 Bright
    AARA I 1 Bright A_FadeTo (0.25, 0.25, 0)
    Stop
  }
}

ACTOR RLDeathweaverGazeGlow3 : RLDeathweaverGazeGlow1
{
  Alpha 0.3
  Scale 0.45
  States
  {
  Spawn:
    TNT1 A 0 
    AARA I 1 Bright
    AARA I 1 Bright A_FadeTo (0.15, 0.15, 0)
    Stop
  }
}

ACTOR RLDeathweaverGazeGlow4 : RLDeathweaverGazeGlow1
{
  Alpha 0.1
  Scale 0.60
  States
  {
  Spawn:
    TNT1 A 0 
    AARA I 1 Bright
    AARA I 1 Bright A_FadeTo (0.05, 0.05, 0)
    Stop
  }
}

ACTOR RLDeathweaverPlasma : FastProjectile
{
  Radius 12
  Height 6
  Speed 60
  Damage (random(2,3) * 10)
  DamageType "Plasma"
  Projectile
  +RANDOMIZE
  +THRUGHOST
  +NOTIMEFREEZE
  +BLOODSPLATTER
  RenderStyle Add
  Alpha 0.85
  Scale 0.35
  Decal "EnemyBlueBFGLightning"
  SeeSound "deathweaver/plasma"
  DeathSound "deathweaver/plasmaimpact"
  States
  {
  Spawn:
    AARP A 1 Bright
    Goto Spawn
  Death:
    AARP BCD 4 Bright
    Stop
  }
}

ACTOR RLDeathweaverSuicideDetector
{
  Radius 6
  Height 8
  Speed 50
  Damage 3
  Projectile
  +NOTONAUTOMAP
  States
  {
  Spawn:
    TNT1 A 1
    Stop
  Death:
    TNT1 A 0 A_GiveInventory ("RLDeathweaverSuicideActivate", 1, AAPTR_TARGET)
    Stop
  }
}

ACTOR RLDeathweaverSuicideActivate : Powerup
{
	Powerup.Duration 5
   +INVENTORY.UNTOSSABLE
}

ACTOR RLDeathweaverSuicideDamage
{
  Radius 6
  Height 8
  Speed 0
  Damage 0
  DamageType "Fire"
  +NOCLIP
  +THRUACTORS
  +NOTONAUTOMAP
  Projectile
  States
  {
  Spawn:
    TNT1 A 0
  Death:
    TNT1 A 6 A_Explode (128,128, 0)
    Stop
  }
}

Actor RLDeathweaverStateCounter : Inventory
{
inventory.maxamount 1
}

Actor RLDeathweaverFiringCounter : Inventory
{
inventory.maxamount 21
}

ACTOR RLCCArmageddonArachnotron : RLArmageddonArachnotron
{
  SeeSound "deathweaver/sight"
  DeathSound "rlmonsters/mediumexp"
  +TOUCHY
  States
  {
  See:
    AARA A 3
    Goto See
  Missile:
    AARA A 4
    AARA BCBCBCBCBC 2 Bright
    AARA A 6
    Goto See
  Melee:
    Stop
  Death:
    AARA G 2 Bright A_Scream
    AARA G 2 Bright A_NoBlocking
    AARA H 4 Bright A_BossDeath
    CELE HI 3 Bright
    CELE JK 2 Bright
    TNT1 A -1
    Stop
  }
}
