Actor FantasyStaff : Weapon 17604
{
//$Category Weapons/DUST
//$Sprite LTBRA0
//$Title "Fantasy Staff"
  Inventory.PickupMessage "You now wield the forgotten Fantasy Staff! Fascinating power awaits you..."
  inventory.PickupSound "FantasyStaff/Recharge"
  Weapon.PreferredSkin "Fist-Marine"
  Obituary "%o experienced phantasmal power like no other by %k."
  Weapon.AmmoType1 "DustMana"
  Weapon.AmmoType2 "DustMana"
  Weapon.AmmoGive 50
  Weapon.AmmoUse1 1
  Weapon.AmmoUse2 1
  +AMMO_OPTIONAL
  States
  {
  Spawn:
    LTBR A -1
    Loop
  Select:
    LTBR M 1 A_Raise
    Loop
  Deselect:
	TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
	TNT1 A 0 A_TakeInventory("MineAction",1)
	TNT1 A 0 A_TakeInventory("RailgunAction",1)
    TNT1 A 0 A_StopSound(7)
    TNT1 A 0 A_JumpIfNoAmmo("Deselect2")
    LTBR ON 4 Bright
    LTBR M 4
  DeselectLoop:
    LTBR M 1 A_Lower
    Loop
  Ready:
    LTBR M 4 A_JumpIfNoAmmo("Ready2")
    LTBR N 0 A_PlaySound("FantasyStaff/Recharge",6)
    LTBR NO 4 Bright
  ReadyLoop:
    TNT1 A 0 A_JumpIfNoAmmo("Ready2")
    LTBR B 0 Bright A_StopSound(7)
    LTBR BBBBCCCCDDDDEEEE 1 Bright A_WeaponReady
    Loop
  Fire:
	TNT1 A 0 A_JumpIfNoAmmo("Ready2")
    LTBR F 0 A_PlaySound("FantasyStaff/Fire",7) 
	LTBR F 1 Bright A_FireCustomMissile("FantasyStaffBeamPlayer",0,0,0,-4)
	LTBR FF 1 Bright A_FireCustomMissile("FantasyStaffBeamPlayer",0,1,0,-4)
    TNT1 A 0 Bright A_PlaySound("FantasyStaff/FireLoop",6)
	LTBR G 1 Bright A_FireCustomMissile("FantasyStaffBeamPlayer",0,0,0,-4)
	LTBR GG 1 Bright A_FireCustomMissile("FantasyStaffBeamPlayer",0,1,0,-4)
    TNT1 A 0 Bright A_PlaySound("FantasyStaff/FireLoop",6)
	LTBR H 1 Bright A_FireCustomMissile("FantasyStaffBeamPlayer",0,0,0,-4)
	LTBR HH 1 Bright A_FireCustomMissile("FantasyStaffBeamPlayer",0,1,0,-4)
    TNT1 A 0 Bright A_PlaySound("FantasyStaff/FireLoop",6)
	LTBR I 1 Bright A_FireCustomMissile("FantasyStaffBeamPlayer",0,0,0,-4)
	LTBR II 1 Bright A_FireCustomMissile("FantasyStaffBeamPlayer",0,1,0,-4)
    TNT1 A 0 Bright A_PlaySound("FantasyStaff/FireLoop",6)
    LTBR A 0 A_Refire
	TNT1 A 0 A_StopSound(7)
    LTBR I 0 A_JumpIfInventory("DustMana",1,1)
    Goto Ready
    LTBR I 0
    Goto Ready+4
  AltFire:
    TNT1 A 0 A_JumpIfInventory("DustMana",100,"BetterAltFire")
	TNT1 A 0 A_PlaySound("FantasyStaff/Fire3",7)
    LTBR G 4 Bright Offset(0,34) A_FireCustomMissile("FantasyProjectileWeakPlayer",0,0,0,-4)
    LTBR H 4 Bright Offset(0,36)
    LTBR L 4 Bright Offset(0,32)
    LTBR A 0 A_Refire
    Goto Ready+4
  BetterAltFire:
    LTBR A 0 Bright A_PlaySound("FantasyStaff/Charge",5)
    LTBR BCDEBCDEBCDEBCD 2 Bright
    LTBR FGHIFGHIFGHI 2 Bright
    LTBR A 0 Bright A_PlaySound("FantasyStaff/Fire2",6)
    LTBR A 0 Bright A_PlaySound("FantasyStaff/Meltdown",7)
    LTBR M 3 Bright Offset(0,48) A_FireCustomMissile("FantasySealPlayer",0,0,0,-8)
	TNT1 A 0 A_TakeInventory("DustMana",100,TIF_NOTAKEINFINITE)
	TNT1 A 0 A_SetPitch (pitch-3)
	TNT1 A 0 A_Recoil(15)
    LTBR M 2 Offset(0,40)
    LTBR M 2 Offset(0,36)
    LTBR M 2 Offset(0,34)
    LTBR M 10 Offset(0,32)
    LTBR M 4 A_JumpIfInventory("Dustmana",1,1)
    LTBR N 0 A_PlaySound("FantasyStaff/Recharge",6)
	LTBR MNOB 4 Bright
    LTBR A 0 A_Refire
    LTBR I 0 A_JumpIfInventory("Dustmana",1,1)
    Goto NoAmmo
    LTBR I 0
    Goto Ready+4
  NoAmmo:
    LTBR ON 4 Bright
    Goto Ready2
  Deselect2:
    LTBR M 1 A_Lower
    Loop
  Ready2:
    LTBR M 0 A_StopSound(7)
    LTBR M 0 A_JumpIfInventory("DustMana",1,"Ready")
    LTBR M 1 A_WeaponReady
    Loop
  }
}



ACTOR FantasySealPlayer : FantasySeal
{
  Speed 200
  Damage 100
  Damagetype "Normal"
  Species "Player"
  +THRUSPECIES
  States
  {
  Death:
	TNT1 A 0
	TNT1 A 0 A_CustomMissile("FantasySealExplosionPlayer",0,0,0,CMF_AIMDIRECTION,0)
	TNT1 A 0 A_CustomMissile("FantasySealExplosionPlayer",0,0,60,CMF_AIMDIRECTION,0)
	TNT1 A 0 A_CustomMissile("FantasySealExplosionPlayer",0,0,120,CMF_AIMDIRECTION,0)
	TNT1 A 0 A_CustomMissile("FantasySealExplosionPlayer",0,0,180,CMF_AIMDIRECTION,0)
	TNT1 A 0 A_CustomMissile("FantasySealExplosionPlayer",0,0,240,CMF_AIMDIRECTION,0)
	TNT1 A 0 A_CustomMissile("FantasySealExplosionPlayer",0,0,300,CMF_AIMDIRECTION,0)
	TNT1 A 0 A_CustomMissile("FantasySealExplosion2Player",0,0,0,CMF_AIMDIRECTION,0)
	TNT1 A 0 A_SpawnItem("BlueProjExplodeLarge")
	TNT1 A 0 A_Explode(30,200)
	TNT1 AAAAAAAAA 0 A_SpawnItemEx("BlueProjParticleSuperLarge",0,0,0,frandom(-7,7),frandom(-7,7),frandom(-7,7),random(0,359))
    CLBB C 1 Bright A_FadeOut(0.2)
    Goto Death+8
  }
}

ACTOR FantasySealExplosionPlayer : FantasySealExplosion
{
  States
  {
  Spawn:
	TNT1 AAAAAAAA 1 A_SpawnItemEx("FantasySealMiniExplodePlayer",random(-30,30),random(-30,30),random(-30,30),random(-4,4),random(-4,4),random(-4,4),random(0,359))
  Death:
	TNT1 A 0
	TNT1 A 0 A_Stop
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 2 A_SpawnItemEx("FantasySealMiniExplodePlayer",random(-100,100),random(-100,100),random(-100,100),random(-4,4),random(-4,4),random(-4,4),random(0,359))
	Stop
  }
}

ACTOR FantasySealExplosion2Player : FantasySealExplosionPlayer
{
  States
  {
  Spawn:
  Death:
	TNT1 A 0
	TNT1 A 0 A_Stop
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 2 A_SpawnItemEx("FantasySealMiniExplodePlayer",random(-100,100),random(-100,100),random(-100,100),random(-4,4),random(-4,4),random(-4,4),random(0,359))
	Stop
  }
}

ACTOR FantasySealMiniExplodePlayer : FantasySealMiniExplode
{
  Damagetype "Player"
  Species "Player"
  States
  {
  Spawn:
	TNT1 A 0
	BXPO AB 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_Explode(30,75,0,0,40)
	BXPO CD 1 Bright A_FadeOut(0.05)
	TNT1 A 0 A_Explode(30,75,0,0,40)
	BXPO EF 1 Bright A_FadeOut(0.05)
	TNT1 A 0 A_Explode(30,75,0,0,40)
	BXPO GHIJKLM 1 Bright A_FadeOut(0.05)
	Stop
  }
}

ACTOR FantasyStaffBeamPlayer : FantasyStaffBeam
{
  Speed 200
  Damage 4
  Damagetype "Player"
  Species "Player"
  +THRUSPECIES
  +PAINLESS
}

ACTOR FantasyProjectileWeakPlayer : FantasyProjectileWeak
{
  Damage 7
  MissileType "FantasyStaffBeamTrail2"
}