// Repeater

ACTOR Repeater : IDMWeapon
{
	Inventory.PickupMessage "Repeater! (Slot 6)"
	Weapon.AmmoType "IDMCell"
	Weapon.AmmoUse 2
	Weapon.AmmoGive 40
	Weapon.Selectionorder 100
	//Weapon.PreferredSkin "RepeaterMarine"
	DamageType "HitPlasma"
	Tag "Repeater"
	AttackSound "weapons/repeaterfire"
	+WEAPON.NOLMS
	States
	{
	Spawn:
	  REPG I -1 Bright
	  Stop
	Ready:
	  REPG A 1 A_WeaponReady
	  Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
	  REPG A 0 A_Raise
	  REPG A 0 A_Raise
	  REPG A 1 A_Raise
	  Loop
	Deselect:
	  REPG A 0 A_Lower
	  REPG A 0 A_Lower
	  REPG A 1 A_Lower
	  Loop
	Fire:
	  TNT1 A 0 A_Playsound("weapons/repeaterspinup",CHAN_6)
	  REPG ABCD 3
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponlevel2",1,"Level2")
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	  REPG E 2 Bright Offset(0,36) A_FireBullets(6.0,3.0,-1,1,"RepeaterPuff")
	  REPG E 1 Bright Offset(0,34)
	  REPG F 2 Bright Offset(0,32)
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  REPG G 2 Bright Offset(0,36) A_FireBullets(6.0,3.0,-1,1,"RepeaterPuff")
	  REPG G 1 Bright Offset(0,34)
	  REPG H 2 Bright Offset(0,32)
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  REPG E 2 Bright Offset(0,36) A_FireBullets(6.0,3.0,-1,1,"RepeaterPuff")
	  REPG F 2 Bright Offset(0,32)
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  REPG G 2 Bright Offset(0,36) A_FireBullets(6.0,3.0,-1,1,"RepeaterPuff")
	  REPG H 2 Bright Offset(0,34)
	Hold:
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponlevel2",1,"Level2Hold")
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadHold")
	  REPG E 2 Bright Offset(0,36) A_FireBullets(6.0,3.0,-1,1,"RepeaterPuff")
	  REPG F 1 Bright Offset(0,32)
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  REPG G 2 Bright Offset(0,36) A_FireBullets(6.0,3.0,-1,1,"RepeaterPuff")
	  REPG H 1 Bright Offset(0,34)
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_Refire("Hold")
	FireEnd:
	  TNT1 A 0 A_Playsound("weapons/repeaterspindown",CHAN_6)
	  REPG ABCDA 2 Offset(0,32)
	  REPG B 3
	  REPG C 4
	  REPG DDDDAAAA 1 A_Refire("Fire")
	  REPG BC 5
	  REPG DDDDD 1 A_Refire("Fire")
	  Goto Ready
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  REPG E 3 Bright A_FireBullets(6.0,3.0,-1,1,"ExtremeRepeaterPuff")
	  REPG F 2 Bright
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  REPG G 3 Bright A_FireBullets(6.0,3.0,-1,1,"ExtremeRepeaterPuff")
	  REPG H 2 Bright
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  REPG E 2 Bright A_FireBullets(6.0,3.0,-1,1,"ExtremeRepeaterPuff")
	  REPG F 2 Bright
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  REPG G 2 Bright A_FireBullets(6.0,3.0,-1,1,"ExtremeRepeaterPuff")
	  REPG H 2 Bright
	  Goto Hold
	QuadHold:
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  REPG E 2 Bright A_FireBullets(6.0,3.0,-1,1,"ExtremeRepeaterPuff")
	  REPG F 1 Bright
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  REPG G 2 Bright A_FireBullets(6.0,3.0,-1,1,"ExtremeRepeaterPuff")
	  Goto Hold+9
	Level2:
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
	  TNT1 A 0 A_FireCustomMissile("RepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  REPG E 3 Bright A_FireBullets(8.0,4.0,3,1,"RepeaterPuff")
	  REPG F 3 Bright A_FireCustomMissile("RepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_FireCustomMissile("RepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  REPG G 3 Bright A_FireBullets(8.0,4.0,3,1,"RepeaterPuff")
	  REPG H 3 Bright A_FireCustomMissile("RepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_FireCustomMissile("RepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  REPG E 2 Bright A_FireBullets(8.0,4.0,3,1,"RepeaterPuff")
	  REPG F 2 Bright A_FireCustomMissile("RepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_FireCustomMissile("RepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  REPG G 2 Bright A_FireBullets(8.0,4.0,3,1,"RepeaterPuff")
	  REPG H 2 Bright A_FireCustomMissile("RepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  Goto Hold
	QuadLevel2:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  TNT1 A 0 A_FireCustomMissile("ExtremeRepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  REPG E 3 Bright A_FireBullets(8.0,4.0,3,1,"ExtremeRepeaterPuff")
	  REPG F 3 Bright A_FireCustomMissile("ExtremeRepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  TNT1 A 0 A_FireCustomMissile("ExtremeRepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  REPG G 3 Bright A_FireBullets(8.0,4.0,3,1,"ExtremeRepeaterPuff")
	  REPG H 3 Bright A_FireCustomMissile("ExtremeRepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  TNT1 A 0 A_FireCustomMissile("ExtremeRepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  REPG E 2 Bright A_FireBullets(8.0,4.0,3,1,"ExtremeRepeaterPuff")
	  REPG F 2 Bright A_FireCustomMissile("ExtremeRepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  TNT1 A 0 A_FireCustomMissile("ExtremeRepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  REPG G 2 Bright A_FireBullets(8.0,4.0,3,1,"ExtremeRepeaterPuff")
	  REPG H 2 Bright A_FireCustomMissile("ExtremeRepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  Goto Hold
	Level2Hold:
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2Hold")
	  TNT1 A 0 A_FireCustomMissile("RepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  REPG E 2 Bright A_FireBullets(8.0,4.0,3,1,"RepeaterPuff")
	  REPG F 1 Bright A_FireCustomMissile("RepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_FireCustomMissile("RepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  REPG G 2 Bright A_FireBullets(8.0,4.0,3,1,"RepeaterPuff")
	  REPG H 1 Bright A_FireCustomMissile("RepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  Goto Hold+10
	QuadLevel2Hold:
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  TNT1 A 0 A_FireCustomMissile("ExtremeRepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  REPG E 2 Bright A_FireBullets(8.0,4.0,3,1,"ExtremeRepeaterPuff")
	  REPG F 1 Bright A_FireCustomMissile("ExtremeRepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  TNT1 A 0 A_FireCustomMissile("ExtremeRepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  REPG G 2 Bright A_FireBullets(8.0,4.0,3,1,"ExtremeRepeaterPuff")
	  REPG H 1 Bright A_FireCustomMissile("ExtremeRepeaterBlasterShot",frandom(-6,6),0,frandom(-2,2),1,0,random(-3,3))
	  Goto Hold+10
	Flash:
	  TNT1 A 4 A_Light2
	  TNT1 A 3 A_Light1
	  Goto LightDone
	}
}

ACTOR RepeaterPuff
{
  Radius 3
  Height 3
  RenderStyle Add
  Alpha 0.75
  Decal MummyScorch
  DamageType "HitPlasma"
  Obituary "%o was disrupted by %k's Repeater."
  SelfObituary "%o irradiated %hself with %p own Repeater."
  +ALWAYSPUFF
  +PUFFONACTORS
  +PUFFGETSOWNER
  +NOBLOCKMAP
  +NOGRAVITY
  +BLOODLESSIMPACT
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_PlaySound("Weapons/RepeaterHit",CHAN_AUTO)
    TNT1 A 0 A_Explode(random(15,75),96)
    REPF ABCDEFG 3 Bright
    Stop
  }
}

ACTOR ExtremeRepeaterPuff : RepeaterPuff
{
	Seesound "misc/crit"
	+EXTREMEDEATH
	DamageType "Extreme"
}

ACTOR RepeaterBlasterShot : BlasterShot
{
	Obituary "%o was disrupted by %k's Repeater."
}

ACTOR ExtremeRepeaterBlasterShot : RepeaterBlasterShot
{
	+EXTREMEDEATH
	States
	{
	XDeath:
		TNT1 A 0 A_Playsound("misc/crit",CHAN_AUTO)
		Goto Death
	}
}