/*
Weapon: Lazer Rifle
Original by: MaxPower8905
Remake by: Gothic
Sprites:
	Weapon: Amuscaria
	Attacks: Cyclones, edited by Gothic
Sounds: Descent and Starcraft, mixed by Gothic
*/

//Zandronum compatible
Actor IllusionLaserRifle : Weapon
{
//$Category Weapons
//$Title "Lazer Rifle"
Weapon.SelectionOrder 300
Weapon.AmmoType1 "Clip"
Weapon.AmmoUse1 1
Inventory.PickupMessage "You got the X5000 Illusion Laser Rifle!"
Obituary "%o was lasered by %k's Illusion Laser Rifle."
Weapon.SlotNumber 4
Tag "Illusion Laser Rifle"
Inventory.RestrictedTo "ReimuClass", "MarisaClass", "SanaeClass"
States
	{
	Spawn:
		RLRP A -1
		Stop
	Ready:
		RLRW A 0 A_PlaySound("weapon/rlrifle/idle",7,0.5,true)
		RLRW AAABBBCCC 1 A_WeaponReady
		Loop
	Deselect:
		RLRW A 0 A_StopSound(7)
		RLRW A 1 A_Lower
		goto Deselect+1
	Select:
		RLRW A 1 A_Raise
		Loop
	Fire:
		RLRF A 0 Bright A_GunFlash
		RLRF A 0 Bright A_StopSound(7)
		RLRF A 0 Bright A_PlaySound("weapon/rlrifle/fire")
		RLRF A 4 Bright offset(0,41) A_RailAttack(12, 0, 1, none, none, RGF_SILENT, 0, "HakkeroLaserPuff", 1.4, 0.7, 0, 0, 8.0, 0, "HakkeroLaserTrail", 1)
		RLRF A 0 Bright A_PlaySound("weapon/rlrifle/fire")
		RLRF A 2 Bright offset(0,41) A_RailAttack(12, 0, 1, none, none, RGF_NOPIERCING|RGF_SILENT, 0, "HakkeroLaserPuff", 1.4, 0.7, 0, 0, 8.0, 0, "HakkeroLaserTrail", 1)
		RLRF B 2 offset(0,34)
		RLRF B 1 offset(0,32) A_ReFire
		Goto Ready
	Flash:
		TNT1 A 3 A_Light2
		TNT1 A 3 A_Light1
		Goto LightDone
	}
}

Actor RainbowLaserRifle : Weapon 
{
//$Category Weapons
//$Title "Lazer Rifle"
Weapon.SelectionOrder 300
Weapon.AmmoType1 "Shell"
Weapon.AmmoUse1 2
Weapon.AmmoType2 "Shell"
Weapon.AmmoUse2 20
Weapon.AmmoGive 8
Inventory.PickupMessage "You got the X2401 Rainbow Wire Rifle!"
Obituary "%o was pierced by %k's Rainbow Wire Rifle."
Weapon.SlotNumber 3
Tag "Rainbow Wire Rifle"
Inventory.RestrictedTo "ReimuClass", "MarisaClass", "SanaeClass"
States
	{
	Spawn:
		RLRP A -1
		Stop
	Ready:
		RLRW A 0 A_PlaySound("weapon/rlrifle/idle",7,0.5,true)
		RLRW AAABBBCCC 1 A_WeaponReady
		Loop
	Deselect:
		RLRW A 0 A_StopSound(7)
		RLRW A 1 A_Lower
		goto Deselect+1
	Select:
		RLRW A 1 A_Raise
		Loop
	Fire:
		RLRW A 1 A_PlaySound("weapon/rlrifle/charge")
		RLRW BCABCABCAB 1
		RLRW C 1 A_StopSound(7)
		RLRF A 0 Bright A_GunFlash
		RLRF A 0 Bright A_PlaySound("weapon/rlrifle/altfire")
		RLRF A 1 BRIGHT A_RailAttack(25, 0, 1, none, none, RGF_SILENT, 8192, "HakkeroLaserPuff", 1.4, 0.7, 0, 0, 8.0, 0, "HakkeroLaserTrail", 1)
		RLRF A 1 BRIGHT A_RailAttack(25, 0, 0, none, none, RGF_SILENT, 8182, "HakkeroLaserPuff", 2.8, 1.4, 0, 0, 8.0, 0, "HakkeroLaserTrail2", 1)
		RLRF A 1 BRIGHT A_RailAttack(25, 0, 0, none, none, RGF_SILENT, 8192, "HakkeroLaserPuff", 4.2, 2.1, 0, 0, 8.0, 0, "HakkeroLaserTrail3", 1)
		RLRF A 1 BRIGHT A_RailAttack(25, 0, 0, none, none, RGF_SILENT, 8192, "HakkeroLaserPuff", 5.6, 2.8, 0, 0, 8.0, 0, "HakkeroLaserTrail4", 1)
		RLRF A 1 BRIGHT A_RailAttack(25, 0, 0, none, none, RGF_SILENT, 8192, "HakkeroLaserPuff", 7.0, 3.5, 0, 0, 8.0, 0, "HakkeroLaserTrail", 1)
		RLRF A 1 BRIGHT A_RailAttack(25, 0, 0, none, none, RGF_SILENT, 8192, "HakkeroLaserPuff", 8.4, 4.2, 0, 0, 8.0, 0, "HakkeroLaserTrail2", 1)
		RLRF A 1 BRIGHT A_RailAttack(25, 0, 0, none, none, RGF_SILENT, 8192, "HakkeroLaserPuff", 9.8, 4.9, 0, 0, 8.0, 0, "HakkeroLaserTrail3", 1)
		RLRF A 1 BRIGHT A_RailAttack(25, 0, 0, none, none, RGF_SILENT, 8192, "HakkeroLaserPuff", 9.8, 4.9, 0, 0, 8.0, 0, "HakkeroLaserTrail4", 1)
		RLRF A 1 Bright offset(0,45)
		RLRF B 1 Bright offset(0,39)
		RLRW A 1 offset(0,35)
		RLRW B 1 offset(0,32)
		RLRW CABCABC 1
		RLRW A 1 A_ReFire
		Goto Ready
	AltFire:
		PUNG B 0 A_Jump(85,"AltFire2")
		PUNG B 4 A_PlaySound("cyber/hoof")
		PUNG C 4 A_TAKEINVENTORY("Shell",20)
		PUNG D 4 A_SpawnItemEX("AliceAllySpreadDoll", 32, 0, 32, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
		Goto Ready
	AltFire2:
		PUNG B 4 A_PlaySound("cyber/hoof")
		PUNG C 4 A_TAKEINVENTORY("Shell",20)
		TNT1 A 0 A_SpawnItemEX("AliceAllyBeamDoll", 32, 0, 32, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
		Goto Ready
	Flash:
		TNT1 A 3 A_Light2
		TNT1 A 3 A_Light1
		Goto LightDone
	}
}

ACTOR HakkeroLaserPuff : BulletPuff
{
  +FORCEXYBILLBOARD
  +BLOODLESSIMPACT
  DamageType "TouhouHakkeroLaser"
}

ACTOR HakkeroLaserTrail
{
  Radius 8
  Speed 10
  Height 12
  Scale 0.2
  Renderstyle Add
  Alpha 1.0
  +NOGRAVITY
  +NOINTERACTION
  +FORCEXYBILLBOARD
  States
  {
  Spawn:
    STA1 A 1 Bright A_FadeOut(0.02)
    Loop
  }
}
ACTOR HakkeroLaserTrail2 : HakkeroLaserTrail
{
  States
  {
  Spawn:
    STA3 A 1 Bright A_FadeOut(0.02)
    Loop
  }
}
ACTOR HakkeroLaserTrail3 : HakkeroLaserTrail
{
  States
  {
  Spawn:
    STA5 A 1 Bright A_FadeOut(0.02)
    Loop
  }
}
ACTOR HakkeroLaserTrail4 : HakkeroLaserTrail
{
  States
  {
  Spawn:
    STA7 A 1 Bright A_FadeOut(0.02)
    Loop
  }
}
ACTOR HakkeroShot
{
  Radius 8
  Speed 50
  Height 12
  damage (4)
  Scale 0.2
  Projectile
  Renderstyle Add
  Alpha 0.4
  DeathSound ""
  +THRUSPECIES
  +FORCEXYBILLBOARD
  Species "Player"
  DamageType "TouhouHakkeroShot"
  States
  {
  Spawn:
	TNT1 A 0
	STA2 A 1 A_Jump(128,"Painful")
	Goto LoopState
  Painful:
	"####" A 1 A_ChangeFlag("PAINLESS",0)
  LoopState:
    "####" A 1 Bright
    Loop
  Death:
    "####" AAAAAAAAAA 2 Bright A_FadeOut(0.1)
    Stop
  }
}
ACTOR AliceAllySpreadDoll
{
//$Category "Touhou Characters"
  floatspeed 8
  Speed 8
  fastspeed 12
  MONSTER
  Health 30
  Radius 16
  Height 48
  Scale 1
  MinMissileChance 200
  Mass 200
  +THRUSPECIES
  Species "Player"
  +DONTHARMSPECIES
  +DONTHARMCLASS
  +FLOORCLIP
  +DONTFALL
  +NOGRAVITY
  +FLOAT
  +NOICEDEATH
  +FRIENDLY
  -COUNTKILL
  -SOLID
  Painchance 128
  Painsound "touhou/pain"
  DeathSound "touhou/nuefire"
  Obituary "%o failed to avoid Alice's dolls."
  States
  {
  Spawn:
    DO11 ABCD 3 A_Look
    Loop
  See:
    DO11 ABCD 3 A_Chase
    Loop
  Pain:
    DO11 A 3 A_Pain
    Goto See
  Melee:
  Missile:
    DO11 GGHH 2 A_FaceTarget
	DO11 I 3 A_CustomMissile("AliceAllyDollShotR",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	DO11 J 3 A_CustomMissile("AliceAllyDollShotO",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	DO11 I 3 A_CustomMissile("AliceAllyDollShotY",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	DO11 J 3 A_CustomMissile("AliceAllyDollShotG",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	DO11 I 3 A_CustomMissile("AliceAllyDollShotC",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	DO11 J 3 A_CustomMissile("AliceAllyDollShotB",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	DO11 I 3 A_CustomMissile("AliceAllyDollShotV",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	DO11 J 3 A_CustomMissile("AliceAllyDollShotW",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	DO11 I 3 A_CustomMissile("AliceAllyDollShotR",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	DO11 J 3 A_CustomMissile("AliceAllyDollShotO",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	DO11 I 3 A_CustomMissile("AliceAllyDollShotY",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	DO11 J 3 A_CustomMissile("AliceAllyDollShotG",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	DO11 I 3 A_CustomMissile("AliceAllyDollShotC",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	DO11 J 3 A_CustomMissile("AliceAllyDollShotB",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	DO11 I 3 A_CustomMissile("AliceAllyDollShotV",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	DO11 J 3 A_CustomMissile("AliceAllyDollShotW",16,0,frandom(-22.5,22.5),CMF_AIMOFFSET|CMF_OFFSETPITCH,frandom(-5.625,5.625))
	Goto See
  Death:
    DO11 A 1 A_ScreamAndUnblock
	DO11 AAAAAAAAAA 1 A_FadeOut
    Stop
  Death.Disappear:
    DO11 A 1 A_ScreamAndUnblock
	DO11 AAAAAAAAAA 1 A_FadeOut
    Stop
  }
}
ACTOR AliceAllyBeamDoll : AliceAllySpreadDoll
{
//$Category "Touhou Characters"
  +THRUSPECIES
  Species "Player"
  +DONTHARMSPECIES
  +DONTHARMCLASS
  +FLOORCLIP
  +DONTFALL
  +NOGRAVITY
  +FLOAT
  +NOICEDEATH
  +FRIENDLY
  -COUNTKILL
  -SOLID
  States
  {
  Melee:
  Missile:
	DO11 GGHH 1 A_FaceTarget
	DO11 I 1 A_CustomMissile("AliceAllyDollShotR2",16,0,0,CMF_AIMDIRECTION)
	DO11 I 1 A_CustomMissile("AliceAllyDollShotO2",16,0,0,CMF_AIMDIRECTION)
	DO11 J 1 A_CustomMissile("AliceAllyDollShotY2",16,0,0,CMF_AIMDIRECTION)
	DO11 J 1 A_CustomMissile("AliceAllyDollShotG2",16,0,0,CMF_AIMDIRECTION)
	DO11 I 1 A_CustomMissile("AliceAllyDollShotC2",16,0,0,CMF_AIMDIRECTION)
	DO11 I 1 A_CustomMissile("AliceAllyDollShotB2",16,0,0,CMF_AIMDIRECTION)
	DO11 J 1 A_CustomMissile("AliceAllyDollShotV2",16,0,0,CMF_AIMDIRECTION)
	DO11 J 1 A_CustomMissile("AliceAllyDollShotW2",16,0,0,CMF_AIMDIRECTION)
	DO11 I 1 A_CustomMissile("AliceAllyDollShotR2",16,0,0,CMF_AIMDIRECTION)
	DO11 I 1 A_CustomMissile("AliceAllyDollShotO2",16,0,0,CMF_AIMDIRECTION)
	DO11 J 1 A_CustomMissile("AliceAllyDollShotY2",16,0,0,CMF_AIMDIRECTION)
	DO11 J 1 A_CustomMissile("AliceAllyDollShotG2",16,0,0,CMF_AIMDIRECTION)
	DO11 I 1 A_CustomMissile("AliceAllyDollShotC2",16,0,0,CMF_AIMDIRECTION)
	DO11 I 1 A_CustomMissile("AliceAllyDollShotB2",16,0,0,CMF_AIMDIRECTION)
	DO11 J 1 A_CustomMissile("AliceAllyDollShotV2",16,0,0,CMF_AIMDIRECTION)
	DO11 J 1 A_CustomMissile("AliceAllyDollShotW2",16,0,0,CMF_AIMDIRECTION)
	Goto See
  }
}
ACTOR AliceAllyDollShotR
{
  Radius 2
  Height 4
  Speed 10
  FastSpeed 20
  damage (10)
  Projectile
  +PAINLESS
  +FORCEXYBILLBOARD
  +THRUSPECIES
  Species "PLayer"
  RenderStyle Add
  SeeSound "touhou/fire"
  DeathSound "touhou/hit"
  DamageType "TouhouAllyDamage"
  States
  {
  Spawn:
    RRIC A 1 Bright
	Loop
  Death:
    RRIC AAAAAAAAAA 1 Bright A_FadeOut
    Stop
  }
}
ACTOR AliceAllyDollShotR2 : AliceAllyDollShotR
{
  Speed 20
  FastSpeed 30
}
ACTOR AliceAllyDollShotO : AliceAllyDollShotR
{
  States
  {
  Spawn:
    ORIC A 1 Bright
	Loop
  Death:
    ORIC AAAAAAAAAA 1 Bright A_FadeOut
    Stop
  }
}
ACTOR AliceAllyDollShotO2 : AliceAllyDollShotO
{
  Speed 20
  FastSpeed 30
}
ACTOR AliceAllyDollShotY : AliceAllyDollShotR
{
  States
  {
  Spawn:
    YRIC A 1 Bright
	Loop
  Death:
    YRIC AAAAAAAAAA 1 Bright A_FadeOut
    Stop
  }
}
ACTOR AliceAllyDollShotY2 : AliceAllyDollShotY
{
  Speed 20
  FastSpeed 30
}
ACTOR AliceAllyDollShotG : AliceAllyDollShotR
{
  States
  {
  Spawn:
    GRIC A 1 Bright
	Loop
  Death:
    GRIC AAAAAAAAAA 1 Bright A_FadeOut
    Stop
  }
}
ACTOR AliceAllyDollShotG2 : AliceAllyDollShotG
{
  Speed 20
  FastSpeed 30
}
ACTOR AliceAllyDollShotC : AliceAllyDollShotR
{
  States
  {
  Spawn:
    CRIC A 1 Bright
	Loop
  Death:
    CRIC AAAAAAAAAA 1 Bright A_FadeOut
    Stop
  }
}
ACTOR AliceAllyDollShotC2 : AliceAllyDollShotC
{
  Speed 20
  FastSpeed 30
}
ACTOR AliceAllyDollShotB : AliceAllyDollShotR
{
  States
  {
  Spawn:
    BRIC A 1 Bright
	Loop
  Death:
    BRIC AAAAAAAAAA 1 Bright A_FadeOut
    Stop
  }
}
ACTOR AliceAllyDollShotB2 : AliceAllyDollShotB
{
  Speed 20
  FastSpeed 30
}
ACTOR AliceAllyDollShotV : AliceAllyDollShotR
{
  States
  {
  Spawn:
    VRIC A 1 Bright
	Loop
  Death:
    VRIC AAAAAAAAAA 1 Bright A_FadeOut
    Stop
  }
}
ACTOR AliceAllyDollShotV2 : AliceAllyDollShotV
{
  Speed 20
  FastSpeed 30
}
ACTOR AliceAllyDollShotW : AliceAllyDollShotR
{
  -PAINLESS
  States
  {
  Spawn:
    WRIC A 1 Bright
	Loop
  Death:
    WRIC AAAAAAAAAA 1 Bright A_FadeOut
    Stop
  }
}
ACTOR AliceAllyDollShotW2 : AliceAllyDollShotW
{
  Speed 20
  FastSpeed 30
}
