// SIGIL (Strife)

ACTOR IDMSigil : IDMWeapon
{
  Weapon.Kickback 100
  Weapon.SelectionOrder 50
  Inventory.PickupSound "misc/w_pkup"
  Tag "The SIGIL"
  Inventory.PickupMessage "The SIGIL! (Slot 7)"
  SelfObituary "%o sacrified %hself to the One God with %p SIGIL."
  +WEAPON.BFG
  +WEAPON.NOAUTOAIM
  +WEAPON.NOLMS
  +FLOORCLIP
  States
  {
  Spawn:
    SIGL E -1 Bright
    Stop
  Ready:
    SIGH E 1 A_WeaponReady
    Loop
  Deselect:
    SIGH E 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/sigil",CHAN_WEAPON)
  Sloop:
    SIGH E 1 A_Raise
    Loop
  Fire:
    TNT1 A 0 Bright A_PlaySound("weapons/sigilcharge", CHAN_WEAPON)
    SIGH E 18 Bright A_Light2
    SIGH E 2 Bright A_GunFlash
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	TNT1 A 0 A_FireCustomMissile("IDMSpectralLightningBigBall1")
	TNT1 A 0 DamageThing(39)
    SIGH E 20 DamageThing(1)
    Goto Ready
  Quad:
    TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO)
	TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	Goto Fire+5
  Level2:
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
	TNT1 AA 0 A_FireCustomMissile("SuperLightningBall",random(-10,10),0,0,0,0,10)
	TNT1 A 0 DamageThing(1000000)
    Goto Ready
  QuadLevel2:
    TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO)
	Goto Level2+1
  Flash:
    SIGF A 4 Bright A_Light2
    SIGF B 6 Bright A_LightInverse
    SIGF C 4 Bright A_Light1
    Goto LightDone
  }
}

ACTOR IDMSpectralLightningBigBall1 : SpectralLightningBigBall1
{
  Speed 20
  Radius 20
  Height 8
  Damage 130
  Projectile
  DamageType "Plasma"
  Obituary "%o was unleashed upon the might of %k's SIGIL!"
  +SPECTRAL
  +EXTREMEDEATH
  -STRIFEDAMAGE
  +SKYEXPLODE
  -NOTELEPORT
  +RIPPER
  States
  {
  Spawn:
    ZAP7 AAAAAABBBBBBCCCCCCDDDDDDEEEEEE 1 Bright A_CustomMissile("IDMSpectralLightningH3",0,0,random(-90,90),CMF_TRACKOWNER|CMF_AIMDIRECTION)
    Loop
  }
}

ACTOR IDMSpectralLightningH3 : SpectralLightningH3 replaces SpectralLightningH3
{
  Damage 130
  DamageType "Plasma"
  Speed 75
  -STRIFEDAMAGE
  +SKYEXPLODE
  -NOTELEPORT
  +EXTREMEDEATH
  +RIPPER
  Obituary "%o was unleashed upon the might of %k's SIGIL!"
}

ACTOR IDMSpectralLightningHTail : SpectralLightningHTail replaces SpectralLightningHTail
{
  +NOBLOCKMAP
  +NOGRAVITY
  +DROPOFF
  +CLIENTSIDEONLY
  RenderStyle Add
  States
  {
  Spawn:
    ZAP6 ABC 2 Bright
    Stop
  }
}

ACTOR IDMSpectralLightningBase : SpectralLightningBase replaces SpectralLightningBase
{
  +NOTELEPORT
  +ACTIVATEIMPACT
  +ACTIVATEPCROSS
  -STRIFEDAMAGE
  +SKYEXPLODE
  -NOTELEPORT
  MaxStepHeight 4
  RenderStyle Add
  SeeSound "weapons/sigil"
  DeathSound "weapons/sigilhit"
  DamageType "Plasma"
  Obituary "%o was unleashed upon the might of %k's SIGIL!"
  States
  {
  Death:
    ZAP1 B 3 A_Explode(32,32,0)
    ZAP1 A 3 A_AlertMonsters
    ZAP1 BCDEFE 3
    ZAP1 DCB 2
    ZAP1 A 1
    Stop
  }
}

ACTOR SuperLightningBall : IDMSpectralLightningBigBall1
{
    Radius 30
	Scale 2.0
	Damage 520
	Gravity 0.3
	Bouncetype "Hexen"
	BounceCount 6
	BounceFactor 1.0
	WallBounceFactor 1.0
	-NOGRAVITY
	-NOTELEPORT
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 0 A_GiveInventory("SuperLightningToken",1)
	  ZAP7 AABBCCDDEE 4 Bright A_CustomMissile("HomingSpectralLightning",0,0,random(0,359),CMF_TRACKOWNER|CMF_AIMDIRECTION)
	  TNT1 A 0 A_JumpIfInventory("SuperLightningToken",5,"Death")
	  Loop
    Death:
      ZAP1 B 3 Bright A_Explode(320,320,0)
	  TNT1 A 0 Bright A_AlertMonsters
      ZAP1 A 3 Bright A_CustomMissile("HomingSpectralLightning",0,0,random(0,359),CMF_TRACKOWNER|CMF_AIMDIRECTION,random(-15,15))
      ZAP1 BCDEFE 3 Bright A_CustomMissile("HomingSpectralLightning",0,0,random(0,359),CMF_TRACKOWNER|CMF_AIMDIRECTION,random(-15,15))
      ZAP1 DCB 2 Bright A_CustomMissile("HomingSpectralLightning",0,0,random(0,359),CMF_TRACKOWNER|CMF_AIMDIRECTION,random(-15,15))
      ZAP1 A 1
      Stop
	}
}

ACTOR SuperLightningToken : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 5
}

ACTOR HomingSpectralLightning : IDMSpectralLightningH3
{
	+SEEKERMISSILE
    -NOTELEPORT
	States
	{
	Spawn:
      ZAP6 AAAA 1 Bright A_SeekerMissile(2,10,SMF_LOOK|SMF_PRECISE,256,10)
	  TNT1 A 0 A_SpectralLightningTail
      ZAP6 BBBB 1 Bright A_SeekerMissile(2,10,SMF_LOOK|SMF_PRECISE,256,10)
	  TNT1 A 0 A_SpectralLightningTail
	  ZAP6 CCCC 1 Bright A_SeekerMissile(2,10,SMF_LOOK|SMF_PRECISE,256,10)
      Loop
    }
}