Actor Ghostbuster : PlayerPawn
{
	Health 100
	Player.MaxHealth 100
	Radius 16
	Height 56
	Mass 400
	+GHOST
	+QUICKTORETALIATE
	+NOTARGET
	limitedtoteam 0
	PainChance 256
	Player.soundclass "peter"
	Player.startitem "AchievementID", 1
	+NOSKIN
	Player.scoreicon "GHOSTBS"
	+NOICEDEATH
	Player.DisplayName "Ghostbuster"
	Player.StartItem "GhostBusterPlasma"
	Player.StartItem "GhostBusterTraps"
	Player.StartItem "ProtonCharge", 150
	Player.StartItem "TrapAmmo", 10
	Player.StartItem "GBCancelItem"
	Player.startitem "ArrowSingle", 35
	Player.StartItem "ClassID", 4
	Player.StartItem "HumanTeam", 1
	DamageFactor "GhostbusterTrap", 0.0
	DamageFactor "HunterSuperIceArrowTrail2", 0.0
	DamageFactor "Drone", 0.0
	DamageFactor "DimmedVision", 0.5
	DamageFactor "GhostbusterExpander", 0.0
	DamageFactor "Poison", 0.0
	DamageFactor "FlaskT2", 0.0
	Player.ColorRange 112, 127
	Species "Human"
	PainChance "Mohoph", 256
	PainChance "MohophRange", 256
	States
	{
	Spawn:
		PETE A 15
		PETE A 0 A_JumpIf (momz>0, "Spawn")
		PETE A 0 A_JumpIfInventory("ProtonCharge", 0, "Spawn")
		PETE A 0 ACS_ExecuteAlways(996, 0)
		PETE A 0 
		PETE A 0 A_GiveInventory("ProtonCharge", 10)
		Loop
		PETE A 1
		Loop
	See:
		PETE AB 4 ACS_Execute(984,0)
		PETE A 0 A_SpawnItemEx ("MarineStomp", 0, 0, 0, 0, 0, -20, 0,0, 0) 
		PETE CD 4
		PETE A 0 A_SpawnItemEx ("MarineStomp", 0, 0, 0, 0, 0, -20, 0,0, 0) 
		Goto Spawn+7
	Pain.Creepstun:
		KNIG G 0 HealThing(1)
		PETE G 0 A_Pain
		PETE G 18 ACS_ExecuteAlways(986,0)
		Goto Spawn
	Pain.CreeperHealBall:
		PETE G 1
		PETE G 0 A_GiveToTarget("CreeperHealBallHealer", 1)
		PETE G 8 A_Pain
		Goto Spawn
	Pain.DimmedVision:
		TNT1 A 0 A_Pain
		TNT1 A 0 A_GiveInventory("VisionDimmer", 1)
		TNT1 A 0 A_GiveInventory("VisionDimEffect", 1) // ACS_ExecuteAlways(753, 0)
		TNT1 A 0 ACS_ExecuteAlways(754, 0)
		TNT1 A 0 HealThing(1)
		PETE G 7
		Goto Spawn		
	Missile:
		PETE E 6
		Goto Spawn
	Melee:
		PETE F 12 Bright
		Goto Missile
	Pain.ChokeAttack:
		PETE G 1
		PETE G 0 A_GiveToTarget("ChokePainHealer", 1)
		PETE G 0 A_GiveToTarget("VomitPoints", 2)
		PETE G 8 A_Pain
		Goto Spawn
	Pain:
		PETE G 0 A_Pain
		PETE G 18
		Goto Spawn
	Pain.Impale:
		TNT1 A 0 ThrustThingZ(0,10,0,1)
		Goto Pain
	Pain.MorgBat:
		TNT1 A 0 A_giveToTarget("MorgHeal", 3)
		Goto Pain		
	Pain.Mohoph:
		PETE G 1
		TNT1 A 0 A_GiveToTarget("MohophHeal", 1)
		goto Pain
	Pain.MohophRange:
		PETE G 1
		TNT1 AAA 0 A_GiveToTarget("MohophHeal", 1)
		Goto Pain
	Death:
	DeathAnim:
		PETE A 0 A_GiveInventory("RocketAmmo",1)
		PETE A 0 A_GiveToTarget("KilledGhostbuster", 1)
		PETE A 0 A_GiveToTarget("TotalKillCount", 1)
		TNT1 A 0 A_GiveToTarget("LowHPKill", 1)
		PETE A 0 A_GiveToTarget("CheckAchievements", 1)
		PETE H 7 
		PETE I 7 A_PlayerScream
		PETE J 5 A_NoBlocking
		PETE KLM 5
		PETE N -1
		Stop
	GibDeath:
		Death.ImpaleBite:
		TNT1 A 0 A_GiveToTarget("ImpaleKill", 1)
		TNT1 A 0 A_GiveToTarget("DoubleImpaleKill", 1)
		TNT1 A 0 A_GiveToTarget("JitterskullPoints", 1)
		TNT1 A 0 A_GiveToTarget("VomitPoints", 10)
		TNT1 A 0 A_GiveToTarget("KilledMarine", 1)
		TNT1 A 0 A_GiveToTarget("TotalKillCount", 1)
		TNT1 A 0 A_GiveToTarget("HumanKillCount", 1)
		TNT1 A 0 A_GiveToTarget("CheckAchievements", 1)
		TNT1 A 0 A_GiveToTarget("Crunched",1)
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_PlaySound("gibbage/xsplat")
		TNT1 A 0 A_SkullPop("Custom_BloodySkull")
		TNT1 A 0 A_PlaySound("gibbage/playergib") 
		TNT1 A 0 A_SpawnItemEx("PLAYERBOOT", 0, 0, 11, 0, 0, 27, 33, 160, 0)
		TNT1 A 0 A_SpawnItemEx("PLAYERBOOT", 0, 0, 11, 0, 0, 27, -33, 160, 0)
		TNT1 A 0 A_SpawnItemEx("SHOTGUYARM", 0, 0, 25, 0, 0, 50, random(0,360), 160, 0)
		TNT1 A 0 A_SpawnItemEx("SHOTGUYARM", 0, 0, 36, 0, 0, 32, random(0,360), 160, 0)
		TNT1 A 0 A_SpawnItemEx("GIBBER", 0, 0, 0, 0, 0, 0, 0, 160, 0)
		PLAY A 1
		BLAN A -1
		Stop
	Death.CreeperHealBall:
		PETE G 0 A_GiveToTarget("CreeperHealBallHealer", 1)
		TNT1 A 0 A_GiveToTarget("HealBallsFired", 1)
		PETE A 0 A_GiveToTarget("CreepHealKill", 1)
		TNT1 A 0 A_GiveToTarget("CreeperMaxCharge", 1)
        Goto DeathAnim
	Death.CreeperMelee:
		PETE A 0 A_PlaySoundEx("creeperattack", "Body")
		PETE A 0 A_GiveToTarget("Creeperheal",1)
		TNT1 A 0 A_GiveToTarget("HealBallsFired", 1)
		PETE A 0 A_SpawnItemEx("SoulSprite", 0, 0, 0, 0, 0, 2)
		PETE A 0 ACS_ExecuteAlways(997,0)
		PETE A 0 A_GiveToTarget("CreeperMeleeKill", 1)
		TNT1 A 0 A_GiveToTarget("CreeperMaxCharge", 1)
		Goto DeathAnim
    Death.SjasScream:
        PETE A 0 A_GiveToTarget("SjasScreamKill", 1)
        PETE A 0 A_GiveToTarget("SjasMeleeMulti", 1)
		Goto DeathAnim
    Death.JitterMelee:
        PETE A 0 A_GiveToTarget("JitterMeleeKill", 1)
        PETE A 0 A_GiveToTarget("JitterMeleeMulti", 1)
        Goto GibDeath
    Death.CreepStun:
        PETE A 0 A_GiveToTarget("CreepStunKill", 1)
		TNT1 A 0 A_GiveToTarget("HealBallsFired", 1)
		TNT1 A 0 A_GiveToTarget("CreeperMaxCharge", 1)
        Goto DeathAnim
    Death.ChokeVomit:
        PETE A 0 A_GiveToTarget("ChokeVomitKill", 1)
        Goto DeathAnim
    Death.ChokeAttack:
        PETE A 0 A_GiveToTarget("ChokeAttackKill", 1)
		PETE A 0 A_GiveToTarget("ChokeDeathHealer", 1)
        Goto GibDeath
	Death.ChokeVomit:
		GO99 A 0 A_GiveToTarget("ChokeVomitKill", 1)
		Goto DeathAnim
	Death.ChokeFeast:
		KNIG A 0 A_GiveToTarget("ChokeFeasTKill", 1)
		Goto DeathAnim		
    Death.ChokeBloodBall:
		TNT1 A 0 A_GiveToTarget("VomitPoints", 15)
        PETE A 0 A_GiveToTarget("ChokeBloodBallKill", 1)
		PETE A 0 A_GiveToTarget("ChokeBloodBallMulti", 1)
        Goto DeathAnim
    Death.FrostbiteMelee:
        PETE A 0 A_GiveToTarget("FrostbiteMeleeKill", 1)
        Goto GibDeath
	Death.FrostbiteMortar:
		TNT1 A 0 A_GiveToTarget("FrostyMortarKill", 1)
		Goto DeathAnim		
    Death.FrostbiteIceBreath:
		PETE G 0 A_GiveInventory("RocketAmmo",1)
		PETE A 0 A_NoBlocking
		HUNT A 0 A_GiveToTarget("FrostyBreathMulti", 1)
        PETE A 0 A_GiveToTarget("FrostbiteIceBreathKill", 1)
        PETE A 0 A_SpawnItemEx("GhostbusterIceDeath")
		PETE A 0 A_GiveToTarget("KilledGhostbuster", 1)
		PETE A 0 A_GiveToTarget("TotalKillCount", 1)
		PETE A 0 A_GiveToTarget("CheckAchievements", 1)
		PETE A 0 A_GiveToTarget("CheckAchievements", 1)
		PETE A 0 A_PlayerScream
		PETE A 1
		BLAN A -1
		Stop
    Death.Impale:
        TNT1 A 0 A_GiveToTarget("ImpaleKill", 1)
		TNT1 A 0 A_GiveToTarget("DoubleImpaleKill", 1)
        Goto DeathAnim
    Death.IceFiendMelee:
		TNT1 A 0 A_GiveToTarget("NightmareMeleeKill", 1)
	Death.DimmedVision:
	DimVisionDeath:
		TNT1 A 0 A_JumpIfInventory("VisionDimmer", 1, 1)
		Goto FadeDeath
		TNT1 A 0 A_GiveToTarget("NightmareHealer", 1)
		TNT1 A 0 A_GiveToTarget("DimDurationEffect", 2)
		TNT1 A 0 A_GiveToTarget("InvisibleCounter", 0)
		TNT1 A 0 A_GiveToTarget("DimmedMeleeKill", 1)
		TNT1 A 0 A_Jump(192, 3)
		TNT1 AA 0 A_PlaySoundEx("IcefiendBackstab1", 5, 0, 1)
		Goto FadeDeath
		TNT1 A 0 A_Jump(192, 3)
		TNT1 AA 0 A_PlaySoundEx("IcefiendBackstab2", 5, 0, 1)
		Goto FadeDeath
		TNT1 A 0 A_Jump(192, 3)
		TNT1 AA 0 A_PlaySoundEx("IcefiendBackstab3", 5, 0, 1)
		Goto FadeDeath
		TNT1 AA 0 A_PlaySoundEx("IcefiendBackstab4", 5, 0, 1)
	    Goto FadeDeath
	Death.NightmareCleave:
		TNT1 A 0 A_GiveToTarget("CleaveKill", 1)
		TNT1 A 0 A_JumpIfInventory("VisionDimmer", 1, "DimVisionDeath")
	    Goto FadeDeath
	FadeDeath:
	    TNT1 A 0 A_GiveToTarget("InvisibleCounter", 8)
		TNT1 A 0 A_GiveInventory("RocketAmmo", 1)
		TNT1 A 0 A_GiveToTarget("KilledGhostBuster", 1)
		TNT1 A 0 A_GiveToTarget("TotalKillCount", 1)
		TNT1 A 0 A_GiveToTarget("HumanKillCount", 1)
		TNT1 A 0 A_GiveToTarget("LowHPKill", 1)
		TNT1 A 0 A_GiveToTarget("CheckAchievements", 1)
		PETE G 1
		TNT1 A 0 A_SpawnItemEx("FadeGhostbuster", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
		BLAN A -1
	Stop
	Death.MohophRange:
	Death.Mohoph:
		PLAY A 0 A_GiveToTarget("TransGhostbuster",1)
		TNT1 A 0 A_GiveToTarget("MorphAmmo", 1)
		PLAY A 0 A_PlaySoundEx("MohophKill","Body")
		TNT1 A 0 A_giveToTarget("MohophClone", 1)
		TNT1 A 0 A_GiveToTarget("MohophKill", 1)
		TNT1 A 0 A_GiveToTarget("KilledGhostbuster2", 1)
		TNT1 A 0 A_GiveToTarget("MohophGBText", 1)
		TNT1 A 0 A_JumpIfInTargetInventory("MohophJustMorphed", 1, 2)
		TNT1 A 0 A_Jump(256, 2)
		TNT1 A 0 A_GiveToTarget("JustMorphedKill", 1)		
		TNT1 A 0 ACS_ExecuteAlways(514, 0, 3)
		PLAY A 0 ACS_ExecuteAlways(976,0)
		TNT1 A 0 A_JumpIfInTargetInventory("MohophWarlockCheck", 1, 1)
		Goto DeathAnim
		TNT1 A 0 A_GiveToTarget("MorphAmmo", 1)
		Goto DeathAnim
	Death.MorgMelee:
		TNT1 A 0 A_GiveToTarget("MorgBatAmmo", 2)
		TNT1 A 0 A_GiveToTarget("MorgMeleeKill", 1)
		TNT1 A 0 A_GiveToTarget("MorgMulti", 1)
		Goto DeathAnim
	Death.MorgBat:
		TNT1 A 0 A_GiveToTarget("MorgBatKill", 1)
		Goto DeathAnim			
	}
}

actor GBCancelItem : CustomInventory
{
	inventory.amount 1
	inventory.maxamount 1
	+INVBAR
	+INVENTORY.UNDROPPABLE
	States
	{
	Spawn:
		TNT1 A 0
		stop
		Use:
		TNT1 A 0 A_GiveInventory("GBCancel",1)
		fail
	}
}


actor GBCancel : Inventory
{
	inventory.amount 1
	inventory.maxamount 1
	States
	{
	Spawn:
	TNT1 A 1
	stop
	}
}

actor UpgradeSound : CustomInventory
{
	States
	{
	Spawn:
		TNT1 A 1
		loop
		Pickup:
		TNT1 A 0 A_PlaySoundEx("gbupgrade","Voice")
		stop
	}
}

ACTOR Custom_GBBloodySkull : Custom_BloodySkull
{
	States
	{
    Spawn:
        PETE O 0 ThrustThingZ (0, 45, 0, 1)
        goto See 
       See:
	    PETE O 0 A_GiveInventory("RocketAmmo",1)
        PETE O 5 A_Custommissile("Blood", -5,0,0)
        PETE OOO 5 
        PETE OOOO 5 
        loop
       Death:
		PETE Z 0 A_Jump (16,4)
        PETE O 0 A_Jump (32,4)
        PETE O 0 A_Jump (64,4)
        PETE O 0 A_Jump (128,4)
        PETE O -1 A_CheckPlayerDone
        Wait
        PETE O -1 A_CheckPlayerDone
        Wait
        PETE O -1 A_CheckPlayerDone
        Wait
        PETE O -1 A_CheckPlayerDone
	}
}

actor GhostBusterTraps : Weapon
{
	Weapon.SlotNumber 2
	Weapon.SelectionOrder 1000
	inventory.icon "GBTRAPZ"
	Weapon.AmmoUse2 1
	Weapon.AmmoGive 10
	Weapon.AmmoType2 "TrapAmmo"
	obituary "%o was caught in one of %k's ghost traps."
	+WEAPON.NOAUTOAIM
	Inventory.PickupMessage "You got the Ghost Traps!"
	+INVENTORY.UNDROPPABLE
	+AMMO_OPTIONAL
	+ALT_AMMO_OPTIONAL
	States
	{
	Spawn:
		BPAK A 400
		loop
		Select:
		TRAP C 0 A_Raise
		TRAP C 1 A_Raise
		Loop
		Deselect:
		TRAP C 0 A_Lower
		TRAP C 1 A_Lower
		Loop
		Ready:
		TNT1 A 0 ACS_ExecuteAlways(700, 0, WM_GB_TRAP)
		TRAP C 1 A_WeaponReady
		Goto Ready+1
		Fire:
		TRAP C 0 A_JumpIfInventory("GhostTrapCheck",1,"RaiseDet")
		TRAP C 0 A_PlaySoundEx("weapons/trapdetonate","Voice")
		TRAP D 6 A_GiveInventory("DetonateCheck",1)
		TRAP C 9 A_TakeInventory("DetonateCheck",999)
		Goto Ready+1
		Altfire:
		TRAP C 0 A_JumpIfInventory("GhostTrapCheck",1,"NewTrap")
		TRAP C 0 A_JumpIfNoAmmo("NoAmmo")
		TRAP C 0 A_GiveInventory("GhostTrapCheck",1)
		TRAP C 1 offset (0, 40)
		TRAP C 1 offset (0, 50)
		TRAP C 1 offset (0, 60)
		TRAP C 1 offset (0, 70)
		TRAP C 1 offset (0, 80)
		TRAP C 1 offset (0, 90)
		Goto NewTrap
		NewTrap:
		TRAP A 1 offset (0, 60) A_JumpIfNoAmmo("RaiseDet")
		TRAP A 1 offset (0, 50)
		TRAP A 1 offset (0, 40)
		TRAP A 0 offset (0, 0) A_TakeInventory("TrapAmmo",1)
		TRAP B 1 offset (0, 0) A_SpawnItemEx("GhostTrap", 16, 4, 32, 6, 0, 0, 0, SXF_TRANSFERTRANSLATION, 0)
		TRAP B 1 offset (0, 20)
		TRAP B 1 offset (0, 30)
		TRAP B 1 offset (0, 40)
		TRAP B 1 offset (0, 50)
		TRAP B 1 offset (0, 60)
		TRAP B 1 offset (0, 70)
		TRAP B 1 offset (0, 80)
		TRAP B 1 offset (0, 90)
		TRAP B 1 offset (0, 100)
		TNT1 AAA 1 offset (0, 100) A_WeaponReady
		Goto RaiseDet
		RaiseDet:
		TRAP C 1 offset (0, 110) A_TakeInventory("GhostTrapCheck",999)
		TRAP C 1 offset (0, 100)
		TRAP C 1 offset (0, 90)
		TRAP C 1 offset (0, 80)
		TRAP C 1 offset (0, 70)
		TRAP C 1 offset (0, 60)
		TRAP C 1 offset (0, 50)
		TRAP C 1 offset (0, 40)
		Goto Ready+1
		NoAmmo:
		TRAP C 15 A_PlaySoundEx("weapons/grenadeno","Voice")
		Goto Ready+1
	}
}

Actor GhostBusterPlasma : Weapon
{
	Weapon.SlotNumber 1
	Weapon.SelectionOrder 100
	inventory.icon "GBGUN1"
	Weapon.AmmoUse 1
	Weapon.AmmoGive 125
	Weapon.AmmoType "ProtonCharge"
	obituary "%o was zapped by %k's proton pack."
	Inventory.PickupMessage "You got the Proton Pack!"
	+WEAPON.NOAUTOAIM
	+INVENTORY.UNDROPPABLE
	+AMMO_OPTIONAL
	States
	{
	Spawn:
		BPAK A 400
		Loop
	Ready:
		PACK J 1
		PACK I 1
		PACK H 1 
		PACK G 1 
		PACK F 1 
		PACK E 1 
		PACK D 1 A_PlaySoundEx("pack/heatup","Weapon")
		PACK C 1
		PACK B 1
		PACK A 0 A_JumpIfInventory("GBCancel",1,"Downgrade")
		PACK A 1 A_WeaponReady
		Goto Ready + 9
	Select:
		TNT1 A 0 ACS_ExecuteAlways(700, 0, WM_GB_NORM)
		TNT1 A 1 A_Raise
		TNT1 A 0 A_Raise
		Goto Select+1
	Deselect:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1 
		PACK J 1 
		TNT1 A 1 A_Lower 
		TNT1 A 0 A_Lower
		Goto Deselect+9
	Fire:
		PACK D 0 A_JumpIfNoAmmo("Firefail")
		PACK B 1 
		PACK C 1
		PACK D 1
		Goto Hold
	Hold:
		PACK D 0 A_JumpIfNoAmmo("Firefail2")
		TNT1 A 0 A_GunFlash
		PACK D 2 A_FireCustomMissile("GhostbusterBall", 0, 1, 8, 3)
		PACK D 1 A_Refire
		PACK D 3 A_ClearReFire
		PACK CBA 1
		Goto Ready+9
	Firefail:
		PACK D 0 A_ClearReFire
		PACK A 18 A_PlaySoundEx("weapons/cyborgfail","Voice")
		Goto Ready+9
	Firefail2:
		PACK D 0 A_ClearReFire
		PACK D 18 A_PlaySoundEx("weapons/cyborgfail","Voice")
		PACK CBA 1
		goto Ready+9
	Altfire:
		PACK A 0 A_JumpIfInventory("GBSjasUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBJitterskullUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBCreeperUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBChokeUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBFrostbiteUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBDefilerUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBIcefiendUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBMohophUpgradeToken", 1, "Transform")
		TNT1 A 0 A_JumpIfInventory("GBMorgwyrUpgradeToken", 1, "Transform")
		PACK A 20 A_PlaySoundEx("gbupgradefail","Voice")
		Goto Ready+9
	Transform:
		PACK B 1 A_GiveInventory("GhostbusterUpgraded", 1)
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1 A_GiveInventory("AbsorbCount",1)
		PACK J 20 ACS_ExecuteAlways(711, 0)
		Goto Ready
	Downgrade:
		PACK A 0 A_TakeInventory("GBCancel")
		Goto Ready+9
	Flash:
		TNT1 A 0 A_Light1 // 1
		TNT1 A 0 A_Light0 // 1
		Goto LightDone
	}
}

actor AbsorbCount : Inventory
{
	inventory.amount 1
	inventory.maxamount 999
}

Actor GhostbusterSmoke
{
	PROJECTILE
	Scale 0.85
	Alpha 0.9
	Renderstyle Add
	DamageType "GhostbusterHorror"
	Species "Human"
	Damage (4)
	Speed 32
	Radius 6
	Height 8
	+RIPPER
	+BLOODLESSIMPACT
	+THRUSPECIES
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_Jump(128, "Spawn2")
			X033 ABCD 3
			X033 EFGHIJKLMNOP 2 A_FadeOut(0.1)
		Stop
		Spawn2:
			X03F ABCD 3
			X03F EFGHIJKLMNOP 2 A_FadeOut(0.1)
		Stop
	}
}

Actor GhostBusterHorror : Weapon
{
	Weapon.SlotNumber 1
	Weapon.SelectionOrder 100
	Weapon.AmmoGive 150
	Weapon.AmmoUse 10
	Weapon.AmmoType "ProtonCharge"
	Obituary "%o tasted %k's mist"
	Inventory.PickupMessage "You got the Proton Pack!"
	Inventory.Icon "GBICE"
	+WEAPON.NOAUTOAIM
	+INVENTORY.UNDROPPABLE
	+AMMO_OPTIONAL
	States
	{
	Spawn:
		BPAK A 400
		Loop
	Ready:
		PACK J 1
		PACK I 1
		PACK H 1 
		PACK G 1 
		PACK F 1 
		PACK E 1 
		PACK D 1 A_PlaySoundEx("pack/heatup","Weapon")
		PACK C 1
		PACK B 1
		PACK A 0 A_JumpIfInventory("GBCancel",1,"Downgrade")
		PACK A 1 A_WeaponReady
		Goto Ready+9
	Select:
	    TNT1 A 0 ACS_ExecuteAlways(700, 0, WM_GB_SHARD)
		TNT1 A 1 A_Raise
		TNT1 A 0 A_Raise
		Goto Select+1
	Deselect:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1 
		PACK J 1 
		TNT1 A 1 A_Lower 
		TNT1 A 0 A_Lower
		Goto Deselect+9
	Fire:
		PACK D 0 A_JumpIfNoAmmo("Firefail")
		PACK B 1 
		PACK C 1
		PACK D 1
		PACK L 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK M 2
		PACG NO 2
		Goto Hold
	Hold:
		PACK D 0 A_JumpIfNoAmmo("Firefail2")
		TNT1 A 0 A_GunFlash
		PACK O 0 A_PlaySoundEx("ghostbuster/Smoke", "Weapon")
		PACG R 2
		TNT1 A 0 A_FireCustomMissile("GhostbusterSmoke", random(-80,80)/10.0, 1, 0, 0, 0, random(-50,50)/10.0)
		TNT1 AAAAAAA 0 A_FireCustomMissile("GhostbusterSmoke", random(-80,80)/10.0, 0, 0, 0, 0, random(-50,50)/10.0)
		PACG S 3 offset (0, 37)
		PACG O 3 offset (5, 42)
		PACG O 3 offset (10, 47)
		PACG O 4 offset (5, 42)
		PACG O 4 offset (0, 37)
		PACG N 1 A_Refire
		PACK L 3 A_ClearReFire
		PACK M 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK CBA 1
		Goto Ready+9
	Firefail:
		PACK U 0 A_ClearReFire
		PACK A 18 A_PlaySound("weapons/cyborgfail")
		Goto Ready+9
	Firefail2:
		PACK D 0 A_ClearReFire
		PACK U 18 A_PlaySound("weapons/cyborgfail")
		PACK T 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK M 3
		PACK L 2
		PACK CBA 1
		goto Ready+9
	Altfire:
		PACK A 0 A_JumpIfInventory("GBSjasUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBJitterskullUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBCreeperUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBChokeUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBFrostbiteUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBDefilerUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBIcefiendUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBMohophUpgradeToken", 1, "Transform")
		TNT1 A 0 A_JumpIfInventory("GBMorgwyrUpgradeToken", 1, "Transform")
		PACK A 20 A_PlaySoundEx("gbupgradefail","Voice")
		Goto Ready+9
	Transform:
		PACK B 1 A_GiveInventory("GhostbusterUpgraded", 1)
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1 A_GiveInventory("AbsorbCount",1)
		PACK J 20 ACS_ExecuteAlways(711, 0)
		Goto Ready
	Downgrade:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1
		PACK J 20 ACS_ExecuteAlways(712,0)
		Goto Ready
	Flash:
		TNT1 A 1 A_Light1
		TNT1 A 1 A_Light0
		Goto LightDone		
	}
}

Actor GhostBusterRock : Weapon
{
	Weapon.SlotNumber 1
	Weapon.SelectionOrder 100
	Weapon.AmmoUse 30
	Weapon.AmmoGive 150
	Weapon.AmmoType "ProtonCharge"
	Inventory.Icon "GBDEF"
	Obituary "%o got crushed under %k's rocks."
	Inventory.PickupMessage "You got the Proton Pack!"
	+WEAPON.NOAUTOAIM
	+INVENTORY.UNDROPPABLE
	+AMMO_OPTIONAL
	States
	{
	Spawn:
		BPAK A 400
		Loop
	Ready:
		PACK J 1
		PACK I 1
		PACK H 1 
		PACK G 1 
		PACK F 1 
		PACK E 1 
		PACK D 1 A_PlaySoundEx("pack/heatup","Weapon")
		PACK C 1
		PACK B 1
		PACK A 0 A_JumpIfInventory("GBCancel",1,"Downgrade")
		PACK A 1 A_WeaponReady
		Goto Ready + 9
	Select:
		TNT1 A 0 ACS_ExecuteAlways(700, 0, WM_GB_IMPALE)
		TNT1 A 1 A_Raise
		TNT1 A 0 A_Raise
		Goto Select+1
	Deselect:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1 
		PACK J 1 
		TNT1 A 1 A_Lower 
		TNT1 A 0 A_Lower
		Goto Deselect+9
	Fire:
		PACK D 0 A_JumpIfNoAmmo("Firefail")
		PACK B 1 
		PACK C 1
		PACK D 1
		PACK L 3 A_PlaySoundEx("pack/change1","Weapon")
		Goto Hold
	Hold:
		PACK M 0 A_JumpIfNoAmmo("Firefail2")
		TNT1 A 0 A_GunFlash
		TNT1 AA 0 A_PlaySoundEx("ghostbuster/Rock", 5)
		PACK M 1 
		PACK Z 1 A_FireCustomMissile("GBDefilerBall", 0, 1, 0, 3)
		PACK Z 1 offset (0, 37)
		PACK Z 1 offset (5, 42)
		PACK Z 1 offset (10, 47)
		PACK Z 1 offset (5, 42)
		PACK Z 1 offset (0, 37)
		PACK Z 1 
		PACK L 3 
		PACK M 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK CB 1
		PACK A 8
		Goto Ready+9
	Firefail:
		PACK U 0 A_ClearReFire
		PACK A 18 A_PlaySound("weapons/cyborgfail")
		Goto Ready+9
	Firefail2:
		PACK D 0 A_ClearReFire
		PACK U 18 A_PlaySound("weapons/cyborgfail")
		PACK T 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK M 3
		PACK L 2
		PACK CBA 1
		goto Ready+9
	Altfire:
		PACK A 0 A_JumpIfInventory("GBSjasUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBJitterskullUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBCreeperUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBChokeUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBFrostbiteUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBDefilerUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBIcefiendUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBMohophUpgradeToken", 1, "Transform")
		TNT1 A 0 A_JumpIfInventory("GBMorgwyrUpgradeToken", 1, "Transform")
		PACK A 20 A_PlaySoundEx("gbupgradefail","Voice")
		Goto Ready+9
	Transform:
		PACK B 1 A_GiveInventory("GhostbusterUpgraded", 1)
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1 A_GiveInventory("AbsorbCount",1)
		PACK J 20 ACS_ExecuteAlways(711, 0)
		Goto Ready
	Downgrade:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1
		PACK J 20 ACS_ExecuteAlways(712,0)
		Goto Ready
	Flash:
		TNT1 A 1 A_Light1
		TNT1 A 1 A_Light0
		Goto LightDone		
	}
}

Actor RockPieces
{
	Radius 5
	Height 5
	Mass 15
	Speed 0
	Scale 1.25
	DamageType "GhostbusterDefilerBall"
	Damage (5)
	PROJECTILE
	Obituary "%o got crushed under %k's rocks."
	+NOTELEPORT
    States
	{
	Spawn:
		DIRT GH 3
	SpawnLoop:
		DIRT I 3 A_Gravity
		Loop
	Death:
		DIRT KL 4
		Stop
	}
}

actor GBDefilerBall
{
	PROJECTILE
	+SKYEXPLODE
	-NOGRAVITY
	gravity 2.0
	+HEXENBOUNCE
	+MTHRUSPECIES
	bouncefactor 0.0
	wallbouncefactor 0.0
	Damage 0
	Speed 30
	Height 8
	damagetype "GhostbusterDefilerBall"
	Obituary "%o got crushed under %k's rocks."
	Radius 8
	scale 1.5
	reactiontime 5
	States
	{
		Spawn:
		GBDF A 2 bright A_SpawnItemEx("RockPieces", random(-6,6), random(-6,6), random(0,6), random(-8,8), random(-8,8), random(1,6), random(0, 359))
		TNT1 A 0 A_Explode(8, 96, 0)
		EMBP A 0 bright A_SpawnItemEx("RockPieces", random(-6,6), random(-6,6), random(0,6), random(-8,8), random(-8,8), random(1,6), random(0, 359))
		GBDF B 2 bright A_SpawnItemEx("RockPieces", random(-6,6), random(-6,6), random(0,6), random(-8,8), random(-8,8), random(1,6), random(0, 359))
		TNT1 A 0 A_Explode(8, 96, 0)
		EMBP A 0 bright A_SpawnItemEx("RockPieces", random(-6,6), random(-6,6), random(0,6), random(-8,8), random(-8,8), random(1,6), random(0, 359))
		GBDF C 2 bright A_SpawnItemEx("RockPieces", random(-6,6), random(-6,6), random(0,6), random(-8,8), random(-8,8), random(1,6), random(0, 359))
		TNT1 A 0 A_Explode(8, 96, 0)
		EMBP A 0 bright A_SpawnItemEx("RockPieces", random(-6,6), random(-6,6), random(0,6), random(-8,8), random(-8,8), random(1,6), random(0, 359))
		GBDF D 2 bright A_SpawnItemEx("RockPieces", random(-6,6), random(-6,6), random(0,6), random(-8,8), random(-8,8), random(1,6), random(0, 359))
		TNT1 A 0 A_Explode(8, 96, 0)
		EMBP A 0 bright A_SpawnItemEx("RockPieces", random(-6,6), random(-6,6), random(0,6), random(-8,8), random(-8,8), random(1,6), random(0, 359))
		GBDF E 2 bright A_SpawnItemEx("RockPieces", random(-6,6), random(-6,6), random(0,6), random(-8,8), random(-8,8), random(1,6), random(0, 359))
		TNT1 A 0 A_Explode(8, 96, 0)
		EMBP A 0 bright A_SpawnItemEx("RockPieces", random(-6,6), random(-6,6), random(0,6), random(-8,8), random(-8,8), random(1,6), random(0, 359))
		EMBP A 0 A_CountDown
		loop
		Death:
		TNT1 AA 0 A_PlaySoundEx("ghostbuster/RockExp", 4)
		TNT1 A 0 A_Explode(64, 128)
		TNT1 AAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("RockPieces", random(-6,6), random(-6,6), random(0,4), random(-8,8), random(-8,8), random(1,16), random(0, 359))
		MISL BCD 4
		Stop
	}
}

Actor GhostBusterEcho : GhostBusterPlasma
{
	Weapon.AmmoUse 5
	inventory.icon "GBGUN3"
	Obituary "%o was whispered to death by %k's sonic echo."
	states
	{
	Spawn:
		BPAK A 400
		Loop
	Ready:
		PACK J 1
		PACK I 1
		PACK H 1 
		PACK G 1 
		PACK F 1 
		PACK E 1 
		PACK D 1 A_PlaySoundEx("pack/heatup","Weapon")
		PACK C 1
		PACK B 1
		PACK A 0 A_JumpIfInventory("GBCancel",1,"Downgrade")
		PACK A 1 A_WeaponReady
		Goto Ready+9
	Select:
		TNT1 A 0 ACS_ExecuteAlways(700, 0, WM_GB_ECHO)
		TNT1 A 1 A_Raise
		TNT1 A 0 A_Raise
		Goto Select+1
	Deselect:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1 
		PACK J 1 
		TNT1 A 1 A_Lower 
		TNT1 A 0 A_Lower
		Goto Deselect+9
	Fire:
		PACK B 0 A_JumpIfNoAmmo("Firefail")
		PACK B 1 
		PACK C 1
		PACK D 1
		PACK L 3 A_PlaySoundEx("pack/change1","Weapon")
		Goto Hold
	Hold:
		PACK U 0 A_JumpIfNoAmmo("Firefail2")
		TNT1 A 0 A_GunFlash
		PACK U 0 A_PlaySoundEx("echoshot","Weapon")
		PACK U 1 A_FireCustomMissile("EchoShot", 0, 1, 0, 3)
		PACK U 1 offset (0, 37)
		PACK U 1 offset (5, 42)
		PACK U 1 offset (10, 47)
		PACK U 1 offset (15, 75)
		PACK U 1 offset (20, 52)
		PACK U 1 offset (25, 57)
		PACK U 1 offset (30, 62)
		PACK U 1 offset (25, 57)
		PACK U 1 offset (20, 52)
		PACK U 1 offset (15, 75)
		PACK U 1 offset (10, 47)
		PACK U 1 offset (5, 42)
		PACK U 1 offset (0, 37)
		PACK U 3 offset (0, 32)
		PACK U 1 A_Refire
		PACK T 3 A_ClearReFire
		PACK M 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK CBA 1
		Goto Ready+9
	Firefail:
		PACK U 0 A_ClearReFire
		PACK A 18 A_PlaySound("weapons/cyborgfail")
		Goto Ready+9
	Firefail2:
		PACK D 0 A_ClearReFire
		PACK U 18 A_PlaySound("weapons/cyborgfail")
		PACK T 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK M 3
		PACK L 2
		PACK CBA 1
		goto Ready+9
	Altfire:
		PACK A 0 A_JumpIfInventory("GBSjasUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBJitterskullUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBCreeperUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBChokeUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBFrostbiteUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBDefilerUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBIcefiendUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBMohophUpgradeToken", 1, "Transform")
		TNT1 A 0 A_JumpIfInventory("GBMorgwyrUpgradeToken", 1, "Transform")
		PACK A 20 A_PlaySoundEx("gbupgradefail","Voice")
		Goto Ready+9
	Transform:
		PACK B 1 A_GiveInventory("GhostbusterUpgraded", 1)
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1 A_GiveInventory("AbsorbCount",1)
		PACK J 20 ACS_ExecuteAlways(711, 0)
		Goto Ready
	Downgrade:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1
		PACK J 20 ACS_ExecuteAlways(712,0)
		Goto Ready
	Flash:
		TNT1 A 1 A_Light1
		TNT1 A 1 A_Light0
		Goto LightDone		
	}
}

actor GhostBusterBone : GhostBusterPlasma
{
	Weapon.AmmoUse 30
	inventory.icon "GBGUN4"
	Obituary "%o was obliterated by %k's bone cannon."
	states
	{
	Spawn:
		BPAK A 400
		Loop
	Ready:
		PACK J 1
		PACK I 1
		PACK H 1 
		PACK G 1 
		PACK F 1 
		PACK E 1 
		PACK D 1 A_PlaySoundEx("pack/heatup","Weapon")
		PACK C 1
		PACK B 1
		PACK A 0 A_JumpIfInventory("GBCancel",1,"Downgrade")
		PACK A 1 A_WeaponReady
		Goto Ready + 9
	Select:
		TNT1 A 0 ACS_ExecuteAlways(700, 0, WM_GB_BONE)
		TNT1 A 1 A_Raise
		TNT1 A 0 A_Raise
		Goto Select+1
	Deselect:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1 
		PACK J 1 
		TNT1 A 1 A_Lower 
		TNT1 A 0 A_Lower
		Goto Deselect+9
	Fire:
		PACK D 0 A_JumpIfNoAmmo("Firefail")
		PACK M 0 A_PlaySoundEx("pack/change1","Weapon")
		Goto Hold
	Hold:
		PACK P 0 A_JumpIfNoAmmo("Firefail2")
		TNT1 A 0 A_GunFlash
		PACK P 0 A_PlaySound ("boneshot", 7/*slot*/, 1.0, 0, ATTN_NORM)
		PACK P 4 offset (30, 62)
		PACK P 0 //A_TakeInventory("ProtonCharge", 25)
		PACK P 0 offset (30, 62) A_RailAttack(75, 8, 1, "white", "none", 0, 0, "GhostbusterBonePuff")
		PACK P 3 offset (20, 52)
		PACK P 3 offset (10, 47)
		PACK P 3 offset (0, 37)
		PACK P 12 //6//A_JumpIfNoAmmo("Firefail4")
		PACK P 3 A_Refire
		PACK Q 3 A_ClearReFire
		PACK M 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK CBA 1
		Goto Ready+9
	Firefail:
		PACK P 0 A_ClearReFire
		PACK A 18 A_PlaySoundEx("weapons/cyborgfail","Weapon")
		Goto Ready+9
	Firefail2:
		PACK D 0 A_ClearReFire
		PACK P 18 A_PlaySound("weapons/cyborgfail")
		PACK Q 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK M 3
		PACK L 2
		PACK CBA 1
		goto Ready+9
	Altfire:
		PACK A 0 A_JumpIfInventory("GBSjasUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBJitterskullUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBCreeperUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBChokeUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBFrostbiteUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBDefilerUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBIcefiendUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBMohophUpgradeToken", 1, "Transform")
		TNT1 A 0 A_JumpIfInventory("GBMorgwyrUpgradeToken", 1, "Transform")
		PACK A 20 A_PlaySoundEx("gbupgradefail","Voice")
		Goto Ready+9
	Transform:
		PACK B 1 A_GiveInventory("GhostbusterUpgraded", 1)
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1 A_GiveInventory("AbsorbCount",1)
		PACK J 20 ACS_ExecuteAlways(711, 0)
		Goto Ready
	Downgrade:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1
		PACK J 20 ACS_ExecuteAlways(712,0)
		Goto Ready
	Flash:
		TNT1 A 1 A_Light1
		TNT1 A 1 A_Light0
		Goto LightDone		
	}
}

Actor GhostbusterBonePuff : BulletPuff
{	
	DamageType "GhostbusterBoneCannon"
	Obituary "%o was obliterated by %k's bone cannon."
	States
	{
	  Spawn:
		NULL A 1
		Goto Melee
	  Melee:
		NULL A 1
		Stop
	}
}

actor GhostBusterBlood : GhostBusterPlasma
{
	Weapon.AmmoUse 2
	inventory.icon "GBGUN5"
	Obituary "%o got bloodied by %k."
	states
	{
	Spawn:
		BPAK A 400
		Loop
		Ready:
		PACK J 1
		PACK I 1
		PACK H 1 
		PACK G 1 
		PACK F 1 
		PACK E 1 
		PACK D 1 A_PlaySoundEx("pack/heatup","Weapon")
		PACK C 1
		PACK B 1
		PACK A 0 A_JumpIfInventory("GBCancel",1,"Downgrade")
		PACK A 1 A_WeaponReady
		Goto Ready + 9
		Select:
		TNT1 A 0 ACS_ExecuteAlways(700, 0, WM_GB_BLOOD)
		TNT1 A 1 A_Raise
		TNT1 A 0 A_Raise
		Goto Select+1
		Fire:
		PACK D 0 A_JumpIfNoAmmo("Firefail")
		PACK B 1 
		PACK C 1
		PACK D 1 
		PACK L 3
		PACK M 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK N 3
		PACK O 2
		Goto Hold
		Deselect:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1 
		PACK J 1 
		TNT1 A 1 A_Lower 
		TNT1 A 0 A_Lower
		Goto Deselect+9
		Hold:
		PACK D 0 A_JumpIfNoAmmo("Firefail2")
		TNT1 A 0 A_GunFlash
		PACK R 2
		PACK R 0 A_FireCustomMissile("BloodSlime", random(-3,3), 1, 0, 3)
		PACK S 2
		PACK S 0 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK O 0 A_PlaySoundEx("Slime1","Weapon")
		PACK O 1 A_Refire
		PACK N 3 A_ClearReFire
		PACK M 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK CBA 1
		Goto Ready+9
		Firefail:
		PACK A 0 A_ClearReFire
		PACK A 18 A_PlaySoundEx("weapons/cyborgfail","Weapon")
		Goto Ready+9
		Firefail2:
		PACK D 0 A_ClearReFire
		PACK O 18 A_PlaySoundEx("weapons/cyborgfail","Weapon")
		PACK N 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK M 3
		PACK L 2
		PACK CBA 1
		goto Ready+9
	Altfire:
		PACK A 0 A_JumpIfInventory("GBSjasUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBJitterskullUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBCreeperUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBChokeUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBFrostbiteUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBDefilerUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBIcefiendUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBMohophUpgradeToken", 1, "Transform")
		TNT1 A 0 A_JumpIfInventory("GBMorgwyrUpgradeToken", 1, "Transform")
		PACK A 20 A_PlaySoundEx("gbupgradefail","Voice")
		Goto Ready+9
	Transform:
		PACK B 1 A_GiveInventory("GhostbusterUpgraded", 1)
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1 A_GiveInventory("AbsorbCount",1)
		PACK J 20 ACS_ExecuteAlways(711, 0)
		Goto Ready
		Downgrade:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1
		PACK J 20 ACS_ExecuteAlways(712,0)
		Goto Ready
	Flash:
		TNT1 A 1 A_Light1
		TNT1 A 1 A_Light0
		Goto LightDone		
	}
}


actor GhostBusterIce : GhostBusterPlasma
{
	Weapon.AmmoUse 15
	inventory.icon "GBGUN6"
	Obituary "%o felt the ice wrath of %k."
	states
	{
	Spawn:
		BPAK A 400
		Loop
	Ready:
		PACK J 1
		PACK I 1
		PACK H 1 
		PACK G 1 
		PACK F 1 
		PACK E 1 
		PACK D 1 A_PlaySoundEx("pack/heatup","Weapon")
		PACK C 1
		PACK B 1
		PACK A 0 A_JumpIfInventory("GBCancel",1,"Downgrade")
		PACK A 1 A_WeaponReady
		Goto Ready + 9
	Select:
		TNT1 A 0 ACS_ExecuteAlways(700, 0, WM_GB_ICE)
		TNT1 A 1 A_Raise
		TNT1 A 0 A_Raise
		Goto Select+1
	Deselect:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1 
		PACK J 1 
		TNT1 A 1 A_Lower 
		TNT1 A 0 A_Lower
		Goto Deselect+9
	Fire:
		PACK D 0 A_JumpIfNoAmmo("Firefail")
		PACK B 1 
		PACK C 1
		PACK D 1
		PACK L 3
		PAC2 E 3 A_PlaySoundEx("pack/change1","Weapon")
		Goto Hold
	Hold:
		PAC2 E 0 A_JumpIfNoAmmo("Firefail2")
		TNT1 A 0 A_GunFlash
		PAC2 E 0 A_TakeInventory("ProtonCharge", 15)
		TNT1 A 0 A_PlayWeaponSound("icerain")
		PAC2 ABC 2
		PAC2 D 2 A_SpawnItemEx("ShardShield", 0, 0, 0)
		PAC2 CBA 2 
		PAC2 E 3 A_Refire
		PAC2 E 3 A_ClearReFire
		PACK M 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK CBA 1
		Goto Ready+9
	Firefail:
		PACK U 0 A_ClearReFire
		PACK A 18 A_PlaySoundEx("weapons/cyborgfail","Weapon")
		Goto Ready+9
	Firefail2:
		PAC2 E 0 A_ClearReFire
		PAC2 E 18 A_PlaySoundEx("weapons/cyborgfail","Weapon")
		PAC2 E 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK M 3
		PACK L 2
		PACK CBA 1
		goto Ready+9
	Altfire:
		PACK A 0 A_JumpIfInventory("GBSjasUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBJitterskullUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBCreeperUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBChokeUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBFrostbiteUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBDefilerUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBIcefiendUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBMohophUpgradeToken", 1, "Transform")
		TNT1 A 0 A_JumpIfInventory("GBMorgwyrUpgradeToken", 1, "Transform")
		PACK A 20 A_PlaySoundEx("gbupgradefail","Voice")
		Goto Ready+9
	Transform:
		PACK B 1 A_GiveInventory("GhostbusterUpgraded", 1)
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1 A_GiveInventory("AbsorbCount",1)
		PACK J 20 ACS_ExecuteAlways(711, 0)
		Goto Ready
		Downgrade:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1
		PACK J 20 ACS_ExecuteAlways(712,0)
		Goto Ready
	Flash:
		TNT1 A 1 A_Light1
		TNT1 A 1 A_Light0
		Goto LightDone		
	}
}

Actor ShardShield
{
	Radius 1
	Height 1
	Speed 0
	DamageType "GhostbusterIceFall"
	Obituary "%o felt the ice wrath of %k."
	PROJECTILE
	-SOLID
	-TELESTOMP
	+NOCLIP
	+THRUGHOST
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_Explode(25, 25, 0)
		// Straight up
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 0, 0, 24, 0)
		// Vertical ball
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 0, 24, 0, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 0, 16, 6, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 0, 12, 12, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 0, 6, 16, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 0, -2, 16, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 0, -6, 12, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 0, -6, 6, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 0, -24, 0, 0)
		// Side ball
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 24, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 16, 0, 6, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 12, 0, 12, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 6, 0, 16, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, -6, 0, 16, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, -12, 0, 12, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, -16, 0, 6, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, -24, 0, 0, 0)
		// Diag1
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, -24, 24, 0, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, -16, 16, 6, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, -12, 12, 12, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 6, 6, 16, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 6, -6, 16, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 12, -12, 12, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 16, -16, 6, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 24, -24, 0, 0)
		// Diag2
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 24, 24, 0, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 16, 16, 6, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 12, 12, 12, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, 6, 6, 16, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, -6, -6, 16, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, -12, -12, 12, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, -16, -16, 6, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, -24, -24, 0, 0)
		// Random
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 0, random(-24,24), random(-24,24), random(1,24), 0)
		// Ground
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, 0, 24, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, 8, 24, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, 24, 24, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, 24, 8, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, 24, 0, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, 24, -8, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, 24, -24, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, 8, -24, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, 0, -24, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, -8, -24, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, -24, -24, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, -24, -8, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, -24, 0, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, -24, 8, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, -24, 24, 0)
		TNT1 A 0 A_SpawnItemEx("IceBallShardsIF", 0, 0, 3, -8, 24, 0)
		Stop
	}
}

Actor IceBallShardsIF
{
	Height 15
	Radius 12
	Scale 1.5
	DamageType "GhostbusterIceFall"
	Obituary "%o felt the ice wrath of %k."
	Damage (random(6,9))
	PROJECTILE
	+BRIGHT
	Speed 42
	Deathsound "weapons/arrowexplode"
	Seesound "gbsoul"
	States
	{
		Spawn:
			ICPR NOPQ 2
			loop
		Death:
			ICPR R 2
			Stop
	}		
}

actor GhostBusterSoul : GhostBusterPlasma
{
	Weapon.AmmoUse 5
	inventory.icon "GBGUN2"
	Obituary "%o vanished into the lost screams from %k's soul plasma."
	states
	{
	Spawn:
		BPAK A 400
		Loop
		Ready:
		PACK J 1
		PACK I 1
		PACK H 1 
		PACK G 1 
		PACK F 1 
		PACK E 1 
		PACK D 1 A_PlaySound("pack/heatup")
		PACK C 1
		PACK B 1
		PACK A 0 A_JumpIfInventory("GBCancel",1,"Downgrade")
		PACK A 1 A_WeaponReady
		Goto Ready + 9
		Select:
		TNT1 A 0 ACS_ExecuteAlways(700, 0, WM_GB_SOUL)
		TNT1 A 1 A_Raise
		TNT1 A 0 A_Raise
		Goto Select+1
		Deselect:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1 
		PACK J 1 
		TNT1 A 1 A_Lower 
		TNT1 A 0 A_Lower
		Goto Deselect+9
		Fire:
		PACK D 0 A_JumpIfNoAmmo("Firefail")
		PACK B 1 
		PACK C 1
		PACK D 1 
		PACK L 3
		PACK M 3 A_PlaySound("pack/change1")
		PACK V 3
		PACK W 2
		Goto Hold
		Hold:
		PACK W 0 A_JumpIfNoAmmo("Firefail2")
		PACK D 0 A_JumpIfInventory("ProtonCharge", 5, 2)
		PACK D 0 A_Jump(256, "FireFail2")
		TNT1 A 0 A_GunFlash
		PACK W 2 A_FireCustomMissile("SoulBlast", 0, 1, 6, 3)
		PACK W 1 offset (0, 32)
		PACK W 1 offset (8, 37)
		PACK W 1 offset (11, 42)
		PACK W 1 offset (8, 37)
		PACK W 1 offset (0, 32)
		PACK W 1 A_Refire
		PACK V 3 A_ClearReFire
		PACK M 3 A_PlaySound("pack/change1")
		PACK CBA 1
		Goto Ready+9
		Firefail:
		PACK A 0 A_ClearReFire
		PACK A 18 A_PlaySound("weapons/cyborgfail")
		Goto Ready+9
		Firefail2:
		PACK W 0 A_ClearReFire
		PACK W 18 A_PlaySound("weapons/cyborgfail")
		PACK V 3 A_PlaySound("pack/change1")
		PACK M 3
		PACK L 2
		PACK CBA 1
		goto Ready+9
	Altfire:
		PACK A 0 A_JumpIfInventory("GBSjasUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBJitterskullUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBCreeperUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBChokeUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBFrostbiteUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBDefilerUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBIcefiendUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBMohophUpgradeToken", 1, "Transform")
		TNT1 A 0 A_JumpIfInventory("GBMorgwyrUpgradeToken", 1, "Transform")
		PACK A 20 A_PlaySoundEx("gbupgradefail","Voice")
		Goto Ready+9
	Transform:
		PACK B 1 A_GiveInventory("GhostbusterUpgraded", 1)
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1 A_GiveInventory("AbsorbCount",1)
		PACK J 20 ACS_ExecuteAlways(711, 0)
		Goto Ready
		Downgrade:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1
		PACK J 20 ACS_ExecuteAlways(712,0)
		Goto Ready
	Flash:
		TNT1 A 1 A_Light1
		TNT1 A 1 A_Light0
		Goto LightDone		
	}
}

Actor BusterAttack : Inventory
{
	inventory.amount 1
	inventory.maxamount 20
	+IGNORESKILL
}

Actor GhostBusterRandom : GhostBusterPlasma
{
	Weapon.AmmoUse 15
	Inventory.Icon "GBGUNRAN"
	States
	{
	Spawn:
		BPAK A 400
		Loop
	Ready:
		PACK J 1
		PACK I 1
		PACK H 1 
		PACK G 1 
		PACK F 1 
		PACK E 1 
		PACK D 1 A_PlaySoundEx("pack/heatup","Weapon")
		PACK C 1
		PACK B 1
		PACK A 0 A_JumpIfInventory("GBCancel",1,"Downgrade")
		PACK A 1 A_WeaponReady
		Goto Ready+9
	Select:
		TNT1 A 1 A_Raise
		TNT1 A 0 A_Raise
		Loop
	Deselect:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1 
		PACK J 1 
		TNT1 A 1 A_Lower 
		TNT1 A 0 A_Lower
	Goto Deselect+9
	Fire:
		PACK D 0 A_JumpIfNoAmmo("Firefail")
		PACK B 1 
		PACK C 1
		PACK D 1
		PACK L 3
		PAC2 E 3 A_PlaySoundEx("pack/change1","Weapon")
		Goto Hold
	Altfire:
		PACK A 0 A_JumpIfInventory("GBSjasUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBJitterskullUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBCreeperUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBChokeUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBFrostbiteUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBDefilerUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBIcefiendUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBMohophUpgradeToken", 1, "Transform")
		TNT1 A 0 A_JumpIfInventory("GBMorgwyrUpgradeToken", 1, "Transform")
		PACK A 20 A_PlaySoundEx("gbupgradefail","Voice")
		Goto Ready+9		
	Hold:
		PAC2 E 0 A_JumpIfNoAmmo("Firefail2")
		PACK B 0 ACS_ExecuteAlways(779,0) 
		PAC2 E 0 A_TakeInventory("ProtonCharge",15)
		TNT1 A 0 A_JumpIfInventory("BusterAttack", 9, "Morgwyr")
		PAC2 E 0 A_JumpIfInventory("BusterAttack",8,"Impaler")
		PAC2 E 0 A_JumpIfInventory("BusterAttack",7,"Icefiend")
		PAC2 E 0 A_JumpIfInventory("BusterAttack",6,"FrostBite")
		PAC2 E 0 A_JumpIfInventory("BusterAttack",5,"Choke")
		PAC2 E 0 A_JumpIfInventory("BusterAttack",4,"Jitterskull")
		PAC2 E 0 A_JumpIfInventory("BusterAttack",3,"Creeper")
		PAC2 E 0 A_JumpIfInventory("BusterAttack",2,"Sjas")
		PAC2 E 0 A_JumpIfInventory("BusterAttack",1,"Normal")
		Goto Normal
	Transform:
		PACK B 1 A_GiveInventory("GhostbusterUpgraded", 1)
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1 A_GiveInventory("AbsorbCount",1)
		PACK J 20 ACS_ExecuteAlways(711, 0)
		Goto Ready	
	Normal:
		PACK P 0 A_TakeInventory("BusterAttack",999)
		PACK DDDDDDDDDDDDDDDDDD 2 A_FireCustomMissile("GhostBusterBall",0,0,8,3)
		PACK D 6
		PACK D 1 A_Refire
		PACK D 3 A_ClearReFire
		PACK CBA 1
		Goto Ready+9
	Sjas:
		PACK P 0 A_TakeInventory("BusterAttack",999)
		PACK O 0 A_PlaySoundEx("EchoShot","Weapon")
		PACK U 1 A_FireCustomMissile("EchoShot",0,0,0,3)
		PACK U 1 offset (0, 37)
		PACK U 1 offset (5, 42)
		PACK U 1 offset (10, 47)
		PACK U 1 offset (15, 75)
		PACK U 1 offset (20, 52)
		PACK U 1 offset (25, 57)
		PACK U 1 offset (30, 62)
		PACK U 1 offset (25, 57)
		PACK U 1 offset (20, 52)
		PACK U 1 offset (15, 75)
		PACK U 1 offset (10, 47)
		PACK U 1 offset (5, 42)
		PACK U 1 offset (0, 37)
		PACK U 6 offset (0, 32)
		PACK O 0 A_PlaySoundEx("EchoShot","Weapon")
		PACK U 1 A_FireCustomMissile("EchoShot",0,0,0,3)
		PACK U 1 offset (0, 37)
		PACK U 1 offset (5, 42)
		PACK U 1 offset (10, 47)
		PACK U 1 offset (15, 75)
		PACK U 1 offset (20, 52)
		PACK U 1 offset (25, 57)
		PACK U 1 offset (30, 62)
		PACK U 1 offset (25, 57)
		PACK U 1 offset (20, 52)
		PACK U 1 offset (15, 75)
		PACK U 1 offset (10, 47)
		PACK U 1 offset (5, 42)
		PACK U 1 offset (0, 37)
		PACK U 6 offset (0, 32)
		PACK M 3 A_PlaySoundEx("EchoShot","Weapon")	
		PACK U 1 A_FireCustomMissile("EchoShot",0,0,0,3)
		PACK U 1 offset (0, 37)
		PACK U 1 offset (5, 42)
		PACK U 1 offset (10, 47)
		PACK U 1 offset (15, 75)
		PACK U 1 offset (20, 52)
		PACK U 1 offset (25, 57)
		PACK U 1 offset (30, 62)
		PACK U 1 offset (25, 57)
		PACK U 1 offset (20, 52)
		PACK U 1 offset (15, 75)
		PACK U 1 offset (10, 47)
		PACK U 1 offset (5, 42)
		PACK U 1 offset (0, 37)
		PACK U 6 offset (0, 32)
		PACK U 1 A_Refire
		PACK T 3 A_ClearReFire
		PACK M 3 A_PlaySoundEx("pack/change1","Weapon")	
		PACK CBA 1
		Goto Ready+9
	Creeper:
		PACK P 0 A_TakeInventory("BusterAttack",999)
		PACK W 2 A_FireCustomMissile("SoulBlast",0,0,6,3)
		PACK W 1 offset (0, 32)
		PACK W 1 offset (8, 37)
		PACK W 1 offset (11, 42)
		PACK W 1 offset (8, 37)
		PACK W 1 offset (0, 32)
		PACK W 2 A_FireCustomMissile("SoulBlast",0,0,6,3)
		PACK W 1 offset (0, 32)
		PACK W 1 offset (8, 37)
		PACK W 1 offset (11, 42)
		PACK W 1 offset (8, 37)
		PACK W 1 offset (0, 32)
		PACK W 2 A_FireCustomMissile("SoulBlast",0,0,6,3)
		PACK W 1 offset (0, 32)
		PACK W 1 offset (8, 37)
		PACK W 1 offset (11, 42)
		PACK W 1 offset (8, 37)
		PACK W 1 offset (0, 32)
		PACK W 2 A_FireCustomMissile("SoulBlast",0,0,6,3)
		PACK W 1 offset (0, 32)
		PACK W 1 offset (8, 37)
		PACK W 1 offset (11, 42)
		PACK W 1 offset (8, 37)
		PACK W 1 offset (0, 32)
		PACK W 2 A_FireCustomMissile("SoulBlast",0,0,6,3)
		PACK W 1 offset (0, 32)
		PACK W 1 offset (8, 37)
		PACK W 1 offset (11, 42)
		PACK W 1 offset (8, 37)
		PACK W 1 offset (0, 32)
		PACK W 2 A_FireCustomMissile("SoulBlast",0,0,6,3)
		PACK W 1 offset (0, 32)
		PACK W 1 offset (8, 37)
		PACK W 1 offset (11, 42)
		PACK W 1 offset (8, 37)
		PACK W 1 offset (0, 32)
		PACK W 1 A_Refire
		PACK V 3 A_ClearReFire
		PACK M 3 A_PlaySound("pack/change1")
		PACK CBA 1
		Goto Ready+9
	Jitterskull:
		PACK P 0 A_TakeInventory("BusterAttack",999)
		PACK P 0 A_PlayWeaponSound("boneshot")
		PACK P 3 offset (30, 62) A_RailAttack(75, 8, 1, "white", "none", 0, 0, "GhostbusterBonePuff")
		PACK P 3 offset (20, 52)
		PACK P 3 offset (10, 47)
		PACK P 3 offset (0, 37)
		PACK P 6
		PACK P 0 A_PlayWeaponSound("boneshot")
		PACK P 3 offset (30, 62) A_RailAttack(75, 8, 0, "white", "none", 0, 0, "GhostbusterBonePuff")
		PACK P 3 offset (20, 52)
		PACK P 3 offset (10, 47)
		PACK P 3 offset (0, 37)
		PACK P 6
		PACK P 0 A_PlayWeaponSound("boneshot")
		PACK P 3 offset (30, 62) A_RailAttack(75, 8, 0, "white", "none", 0, 0, "GhostbusterBonePuff")
		PACK P 3 offset (20, 52)
		PACK P 3 offset (10, 47)
		PACK P 3 offset (0, 37)
		PACK P 6
		PACK P 3 A_Refire
		PACK Q 3 A_ClearReFire
		PACK M 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK CBA 1
		Goto Ready+9
	Choke:
		PACK P 0 A_TakeInventory("BusterAttack",999)
		PACK R 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK S 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK O 0 A_PlaySoundEx("Slime1","Weapon")
		PACK R 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK S 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK O 0 A_PlaySoundEx("Slime1","Weapon")
		PACK R 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK S 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK O 0 A_PlaySoundEx("Slime1","Weapon")
		PACK R 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK S 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK O 0 A_PlaySoundEx("Slime1","Weapon")
		PACK R 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK S 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK O 0 A_PlaySoundEx("Slime1","Weapon")
		PACK R 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK S 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK O 0 A_PlaySoundEx("Slime1","Weapon")
		PACK R 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK S 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK O 0 A_PlaySoundEx("Slime1","Weapon")
		PACK R 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK S 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK O 0 A_PlaySoundEx("Slime1","Weapon")
		PACK R 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK S 2 A_FireCustomMissile("BloodSlime", random(-3,3), 0, 0, 3)
		PACK O 0 A_PlaySoundEx("Slime1","Weapon")
		PACK O 1 A_Refire
		PACK N 3 A_ClearReFire
		PACK M 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK CBA 1
		Goto Ready+9
	FrostBite:
		PACK P 0 A_TakeInventory("BusterAttack",999)
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_PlayWeaponSound("icerain")
		PAC2 ABC 2
		PAC2 D 2 A_SpawnItemEx("ShardShield", 0, 0, 0)
		PAC2 CBA 2
		TNT1 A 0 A_PlayWeaponSound("icerain")
		PAC2 ABC 2
		PAC2 D 2 A_SpawnItemEx("ShardShield", 0, 0, 0)
		PAC2 CBA 2
		TNT1 A 0 A_PlayWeaponSound("icerain")
		PAC2 ABC 2
		PAC2 D 2 A_SpawnItemEx("ShardShield", 0, 0, 0)
		PAC2 CBA 2
		PAC2 E 3 A_Refire
		PAC2 E 3 A_ClearReFire
		PACK M 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK CBA 1
		Goto Ready+9
	Icefiend:
		PACK P 0 A_TakeInventory("BusterAttack",999)
		TNT1 A 0 A_GunFlash
		PACK O 0 A_PlaySoundEx("ghostbuster/Smoke", "Weapon")
		PACG R 2
		TNT1 A 0 A_FireCustomMissile("GhostbusterSmoke", random(-80,80)/10.0, 0, 0, 0, 0, random(-50,50)/10.0)
		TNT1 AAAAAAA 0 A_FireCustomMissile("GhostbusterSmoke", random(-80,80)/10.0, 0, 0, 0, 0, random(-50,50)/10.0)
		PACG S 3 offset (0, 37)
		PACG O 3 offset (5, 42)
		PACG O 3 offset (10, 47)
		PACG O 4 offset (5, 42)
		PACG O 4 offset (0, 37)
		TNT1 A 0 A_GunFlash
		PACK O 0 A_PlaySoundEx("ghostbuster/Smoke", "Weapon")
		PACG R 2
		TNT1 A 0 A_FireCustomMissile("GhostbusterSmoke", random(-80,80)/10.0, 0, 0, 0, 0, random(-50,50)/10.0)
		TNT1 AAAAAAA 0 A_FireCustomMissile("GhostbusterSmoke", random(-80,80)/10.0, 0, 0, 0, 0, random(-50,50)/10.0)
		PACG S 3 offset (0, 37)
		PACG O 3 offset (5, 42)
		PACG O 3 offset (10, 47)
		PACG O 4 offset (5, 42)
		PACG O 4 offset (0, 37)
		TNT1 A 0 A_GunFlash
		PACK O 0 A_PlaySoundEx("ghostbuster/Smoke", "Weapon")
		PACG R 2
		TNT1 A 0 A_FireCustomMissile("GhostbusterSmoke", random(-80,80)/10.0, 0, 0, 0, 0, random(-50,50)/10.0)
		TNT1 AAAAAAA 0 A_FireCustomMissile("GhostbusterSmoke", random(-80,80)/10.0, 0, 0, 0, 0, random(-50,50)/10.0)
		PACG S 3 offset (0, 37)
		PACG O 3 offset (5, 42)
		PACG O 3 offset (10, 47)
		PACG O 4 offset (5, 42)
		PACG O 4 offset (0, 37)
		PACG N 1 A_Refire
		PACK L 3 A_ClearReFire
		PACK M 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK CBA 1
		Goto Ready+9
	Impaler:
		PACK P 0 A_TakeInventory("BusterAttack",999)
		TNT1 A 0 A_GunFlash
		TNT1 AA 0 A_PlaySoundEx("ghostbuster/Rock", 5)
		PACK M 1 A_FireCustomMissile("GBDefilerBall", 0, 1, 0, 3)
		PACK M 1 offset (0, 37)
		PACK M 1 offset (5, 42)
		PACK M 1 offset (10, 47)
		PACK M 1 offset (5, 42)
		PACK M 1 offset (0, 37)
		PACK M 1 
		PACK L 3 
		TNT1 A 0 A_GunFlash
		TNT1 AA 0 A_PlaySoundEx("ghostbuster/Rock", 5)
		PACK M 1 A_FireCustomMissile("GBDefilerBall", 0, 0, 0, 3)
		PACK M 1 offset (0, 37)
		PACK M 1 offset (5, 42)
		PACK M 1 offset (10, 47)
		PACK M 1 offset (5, 42)
		PACK M 1 offset (0, 37)
		PACK M 1 
		PACK L 3 	
		TNT1 A 0 A_GunFlash
		TNT1 AA 0 A_PlaySoundEx("ghostbuster/Rock", 5)
		PACK M 1 A_FireCustomMissile("GBDefilerBall", 0, 0, 0, 3)
		PACK M 1 offset (0, 37)
		PACK M 1 offset (5, 42)
		PACK M 1 offset (10, 47)
		PACK M 1 offset (5, 42)
		PACK M 1 offset (0, 37)
		PACK M 1 A_Refire
		PACK L 3 A_ClearRefire
		PACK M 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK CB 1
		PACK A 8
		Goto Ready+9
	Morgwyr:
		PACK P 0 A_TakeInventory("BusterAttack",999)
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_PlaySound("Ghostbuster/Expander", 7, 1.0, 0, ATTN_NORM)
		TNT1 A 0 A_SpawnItemEx("ExpanderFlash")
		PACE C 3 A_FireBullets(3.2, 2.2, -1, random(3,4)*random(1,2), "ExpanderShot", FBF_NORANDOM)
		PACE A 2
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_PlaySound("Ghostbuster/Expander", 7, 1.0, 0, ATTN_NORM)
		TNT1 A 0 A_SpawnItemEx("ExpanderFlash")
		PACE C 3 A_FireBullets(3.2, 2.2, -1, random(3,4)*random(1,2), "ExpanderShot", FBF_NORANDOM)
		PACE A 2
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_PlaySound("Ghostbuster/Expander", 7, 1.0, 0, ATTN_NORM)
		TNT1 A 0 A_SpawnItemEx("ExpanderFlash")
		PACE C 3 A_FireBullets(3.2, 2.2, -1, random(3,4)*random(1,2), "ExpanderShot", FBF_NORANDOM)
		PACE A 2
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_PlaySound("Ghostbuster/Expander", 7, 1.0, 0, ATTN_NORM)
		TNT1 A 0 A_SpawnItemEx("ExpanderFlash")
		PACE C 3 A_FireBullets(3.2, 2.2, -1, random(3,4)*random(1,2), "ExpanderShot", FBF_NORANDOM)
		PACE A 2 A_Refire	
		PACE B 2 A_ClearRefire
		PACK M 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK CBA 1	
		Goto ready+9
	Firefail:
		PACK P 0 A_TakeInventory("BusterAttack",999)
		PACK U 0 A_ClearReFire
		PACK A 18 A_PlaySoundEx("weapons/cyborgfail","Weapon")
		Goto Ready+9
	Firefail2:
		PACK P 0 A_TakeInventory("BusterAttack",999)
		PAC2 E 0 A_ClearReFire
		PAC2 E 18 A_PlaySoundEx("weapons/cyborgfail","Weapon")
		PAC2 E 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK M 3
		PACK L 2
		PACK CBA 1
		goto Ready+9
	Downgrade:
		PACK P 0 A_TakeInventory("BusterAttack",999)
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1
		PACK J 20 ACS_ExecuteAlways(712,0)
		Goto Ready
	}
}

Actor ExpanderShot : Bulletpuff
{
	Alpha 0.85
	Renderstyle Add
	Scale 0.58
	DamageType "GhostbusterExpander"
	Vspeed 0
	+ALWAYSPUFF
	+PUFFONACTORS
	+PUFFGETSOWNER
	
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_Explode(8, 56, 0, 0, 28)
			GBEP ABCD 2 Bright A_FadeOut(0.1)
		Stop
	}
}

actor ExpanderFlash
{
	Radius 8
	Height 8
	Scale 0.5
	+NOGRAVITY
	States
	{
		Spawn:
		TNT1 A 3
		Stop
	}
}

actor GhostBusterExpander : GhostBusterPlasma
{
	Weapon.AmmoUse 3
	inventory.icon "GBGUNEXP"
	Obituary "%o was enlarged by %k's expander."
	states
	{
	Spawn:
		BPAK A 400
		Loop
	Ready:
		PACK J 1
		PACK I 1
		PACK H 1 
		PACK G 1 
		PACK F 1 
		PACK E 1 
		PACK D 1 A_PlaySoundEx("pack/heatup","Weapon")
		PACK C 1
		PACK B 1
		PACK A 0 A_JumpIfInventory("GBCancel",1,"Downgrade")
		PACK A 1 A_WeaponReady
		Goto Ready + 9
	Select:
		TNT1 A 0 ACS_ExecuteAlways(700, 0, WM_GB_EXP)
		TNT1 A 1 A_Raise
		TNT1 A 0 A_Raise
		Goto Select+1
	Deselect:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1 
		PACK J 1 
		TNT1 A 1 A_Lower 
		TNT1 A 0 A_Lower
		Goto Deselect+9
	Fire:
		PACK D 0 A_JumpIfNoAmmo("Firefail")
		PACK M 0 A_PlaySoundEx("pack/change1","Weapon")
		PACE BA 4
		Goto Hold
	Hold:
		PACK P 0 A_JumpIfNoAmmo("Firefail2")
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_PlaySound("Ghostbuster/Expander", 7/*slot*/, 1.0, 0, ATTN_NORM)
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("ExpanderFlash")
		PACE C 3 A_FireBullets(3.2, 2.2, 1, random(3,4)*random(1,2), "ExpanderShot", FBF_NORANDOM | FBF_USEAMMO)
		PACE A 2
		PACE A 2 A_Refire
		PACE B 2 A_ClearReFire
		PACK M 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK CBA 1
		Goto Ready+9
	Firefail:
		PACK P 0 A_ClearReFire
		PACK A 18 A_PlaySoundEx("weapons/cyborgfail","Weapon")
		Goto Ready+9
	Firefail2:
		PACK D 0 A_ClearReFire
		PACE A 18 A_PlaySound("weapons/cyborgfail")
		PACE B 3 A_PlaySoundEx("pack/change1","Weapon")
		PACK M 3
		PACK L 2
		PACK CBA 1
		goto Ready+9
	Altfire:
		PACK A 0 A_JumpIfInventory("GBSjasUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBJitterskullUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBCreeperUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBChokeUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBFrostbiteUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBDefilerUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBIcefiendUpgradeToken", 1, "Transform")
		PACK A 0 A_JumpIfInventory("GBMohophUpgradeToken", 1, "Transform")
		TNT1 A 0 A_JumpIfInventory("GBMorgwyrUpgradeToken", 1, "Transform")
		PACK A 20 A_PlaySoundEx("gbupgradefail","Voice")
		Goto Ready+9
	Transform:
		PACK B 1 A_GiveInventory("GhostbusterUpgraded", 1)
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1 A_GiveInventory("AbsorbCount",1)
		PACK J 20 ACS_ExecuteAlways(711, 0)
		Goto Ready
	Downgrade:
		PACK B 1 
		PACK C 1 
		PACK D 1 
		PACK E 1 
		PACK F 1
		PACK G 1 
		PACK H 1 
		PACK I 1
		PACK J 1
		PACK J 20 ACS_ExecuteAlways(712,0)
		Goto Ready
	Flash:
		TNT1 A 1 A_Light1
		TNT1 A 1 A_Light0
		Goto LightDone		
	}
}

actor SoulBlast
{
	PROJECTILE
	scale 0.6
	Speed 35 
	+SEEKERMISSILE
	Height	7
	Radius	6
	renderstyle add
	deathsound "weapons/arrowexplode"
	seesound "gbsoul"
	alpha 0.8
	translation "112:127=80:111"
	Damage (25)
	DamageType "GhostbusterSoul"
	Obituary "%o vanished into the lost screams from %k's soul plasma."
	states
	{
	Spawn:
		SPIR P 0
		SPIR P 1 A_Jump(256,0,5,10,15,20,25)
		SPIR PPPPP 0 A_BishopMissileWeave
		SPIR PPPPP 0 A_BishopMissileWeave
		SPIR PPPPP 0 A_BishopMissileWeave
		SPIR PPPPP 0 A_BishopMissileWeave
		SPIR PPPPP 0 A_BishopMissileWeave
		SPIR P 0
		goto Flying
		Flying:
		SPIR P 0 A_SpawnItem("SoulFadefx")
		SPIR P 0 A_SeekerMissile (5, 15) 
		SPIR P 1 A_BishopMissileWeave
		loop
		Death:
		OXPL ABCDEFGHIJKLM 1 A_FadeOut(0.01)
		stop
	}
}

actor SoulFadefx
{
	+CLIENTSIDEONLY
	- SOLID
	+NOGRAVITY
	height 1
	radius 1
	scale 0.18
	renderstyle translucent
	alpha 1.0
	translation "112:127=80:111"
	States
	{
	Spawn:
		OXPL ACEGIKM 1 A_FadeOut(0.2)
		stop
	}
}

actor EchoShot
{
	Radius		10
	Speed		32
	Height		10
	damage (40)
	PROJECTILE
	renderstyle none
	seesound "echobounce"
	DamageType "GhostbusterEcho"
	+DOOMBOUNCE
	+DONTREFLECT
	bouncecount 5
	bouncefactor 1.0
	reactiontime 80
	wallbouncefactor 1.0
	states
	{
	Spawn:
		TNT1 A 0 A_CountDown
		TNT1 A 1 A_SpawnItem("EchoWave")
		loop
	}
}

actor EchoWave
{
	+CLIENTSIDEONLY
	- SOLID
	+NOGRAVITY
	height 1
	radius 1
	scale 0.2
	renderstyle translucent
	alpha 1.0
	translation "112:127=224:231"
	states
	{
	Spawn:
		PR2E OMKIGECA 1 bright A_FadeOut(0.04)
		stop
	}
}

ACTOR Bloodslime
{
	Radius		6
	Height		12
	Speed		60
	Damage	(10) //(random(10,12))
	DamageType "GhostbusterBlood"
	Obituary "%o was bloodied by %k."
	PROJECTILE
	-NOGRAVITY
	renderstyle translucent
	alpha 1.0
	SeeSound ""
	States
	{
	Spawn:
		TNT1 A 0 
		TNT1 A 2 ThrustThingZ (0, random(0,8), random(0,1), 1)
		SLIM BC 3 A_SpawnItem("NashGore_FlyingBloodTrail",0,0,0,1)
		SLIM C 0 A_FadeOut(0.05)
		Goto Spawn+3
		Death:
		TNT1 A 3 A_PlaySound("Slime1")
		Stop
	}
}

actor GhostTrapCheck : Inventory
{
  Inventory.PickupMessage "GO GO JESUS RANGERS!"
  Inventory.Amount 1
  Inventory.MaxAmount 1
  Inventory.Icon "CELLA0"
    States
  {
  Spawn:
    CELL A -1
    Stop
  }
}

actor DetonateCheck : Inventory
{
Inventory.PickupMessage "GO GO JESUS RANGERS!"
  Inventory.Amount 1
  Inventory.MaxAmount 1
  Inventory.Icon "CELLA0"
    States
  {
  Spawn:
    CELL A -1
    Stop
  }
}

ACTOR ProtonCharge : Ammo
{
  +INVENTORY.IGNORESKILL
  Inventory.PickupMessage "Proton charge!"
  Inventory.Amount 150
  Inventory.MaxAmount 150
  Ammo.BackpackAmount 150
  Ammo.BackpackMaxAmount 150
  Inventory.Icon "CELLA0"
  States
  {
  Spawn:
    CELL A -1
    Stop
  }
}

Actor TransformAmmo : Ammo
{
  +INVENTORY.IGNORESKILL
  Inventory.PickupMessage "Proton charge!"
  Inventory.Amount 1
  Inventory.MaxAmount 100
  States
  {
  Spawn:
    CELL A -1
    Stop
  }
}

actor GhostBusterBall
{
	decal "ProtonDecal"
	scale 0.8
	renderstyle add
	alpha 0.95
	PROJECTILE
	+RANDOMIZE
	damagetype "GhostbusterProton"
	speed 38
	radius 4
	height 4
	Damage (10)
	seesound "weapons/protonpackfire"
	deathsound "weapons/plasmax"
	States
	{
	Spawn:
		PROT AB 2 bright
		Loop
		Death:
		PROT EFGHIJK 2 bright
		Stop
	}
}

actor GhostTrap
{
	radius 5
	scale 0.8
	height 16
	renderstyle translucent
	alpha 1.0
	Speed 0
	PROJECTILE
	-CANBLAST
	-NOLIFTDROP
	-NOGRAVITY
	damagetype "GhostbusterTrap"
	Obituary "%o was caught in one of %k's ghost traps."
	States
	{
		Spawn:
			GTRP E 1 A_JumpIfInTargetInventory("DetonateCheck", 1, "Death2")
			GTRP E 0 A_GiveInventory("Trapcount",1)
			GTRP E 0 A_JumpIfInventory("Trapcount",2100,"Spawn2")
			GTRP E 0 A_JumpIf(waterlevel == 2, "FadeOut")
			GTRP E 0 A_JumpIfInTargetInventory("RocketAmmo", 1, "Fadeout")
			GTRP E 0 A_JumpIf(z - floorz == 0, 1)
		Loop
			GTRP E 0 ACS_ExecuteAlways(503, 0)
		Goto NoVelocityCheck
		NoVelocityCheck:
			GTRP E 1 A_JumpIfInTargetInventory("DetonateCheck", 1, "Death2")
			GTRP E 0 A_GiveInventory("Trapcount",1)
			GTRP E 0 A_JumpIfInventory("Trapcount",2100,"Spawn2")
			GTRP E 0 A_JumpIf(waterlevel == 2, "FadeOut")
			GTRP E 0 A_JumpIfInTargetInventory("RocketAmmo", 1, "Fadeout")
		Loop
		Spawn2:
			GTRP E 0 A_SpawnItem("BulletPuff",0,6)
			GTRP E 0 A_PlaySoundEx("weapons/trapzip", "Voice")
			GTRP E 1 A_JumpIfInTargetInventory("DetonateCheck", 1, "Death2")
			GTRP E 0 A_GiveInventory("Trapcount",1)
			GTRP E 0 A_JumpIfInventory("Trapcount",2275,"Smoke")
			GTRP E 0 A_JumpIf(waterlevel == 2, "FadeOut")
			GTRP E 0 A_JumpIfInTargetInventory("RocketAmmo", 1, "Fadeout")
			GTRP E 0 A_JumpIf(z - floorz == 0, 1)
			Goto Spawn2+2
			GTRP E 0 ACS_ExecuteAlways(503, 0)
			Goto Spawn2+2
		Smoke:
			GTRP H 0 A_PlaySoundEx("weapons/arrowexplode", "Voice")
			GTRP H 0 A_SpawnItemEx("GBExplosion", 0, 0, 8, 0, 0, 0, 0, 128, 0) 
			GTRP H 0 A_SpawnItemEx("GBFirey", random(-2,2), random(-2,2), 8, 0, 0, 1, 0, 128, 0) 
			GTRP H 4 A_SpawnItemEx("GBSmokeLarge", random(-2,2), random(-2,2), 8, 0, 0, 1, 0, 128, 0) 
			GTRP H 0 A_SpawnItemEx("GBFirey", random(-2,2), random(-2,2), 8, 0, 0, 1, 0, 128, 0) 
			GTRP H 4 A_SpawnItemEx("GBSmokeLarge", random(-2,2), random(-2,2), 8, 0, 0, 1, 0, 128, 0) 
			GTRP H 0 A_SpawnItemEx("GBFirey", random(-2,2), random(-2,2), 8, 0, 0, 1, 0, 128, 0) 
			GTRP H 4 A_SpawnItemEx("GBSmokeLarge", random(-2,2), random(-2,2), 8, 0, 0, 1, 0, 128, 0) 
			GTRP H 0 A_SpawnItemEx("GBFirey", random(-2,2), random(-2,2), 8, 0, 0, 1, 0, 128, 0) 
			GTRP H 4 A_SpawnItemEx("GBSmokeLarge", random(-2,2), random(-2,2), 8, 0, 0, 1, 0, 128, 0) 
			GTRP H 60
			Goto Fadeout
		Death:
			GRTP E 0 A_PlaySound("weapons/traphit")
			GTRP E 0 A_JumpIf(waterlevel == 2, "FadeOut")
			GTRP E 0 A_ChangeFlag("MISSILE",0)
			GTRP E 1 A_ChangeFlag("NOBLOCKMAP",0)
			Goto Spawn
		Death2:
			GTRP A 0 A_PlaySound("weapons/trapcharge")
			GTRP A 5
			GTRP A 0 A_PlaySound("weapons/trap")
			GTRP A 5 A_SpawnItemEx("GhostTrapFX", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION, 0)
			GTRP A 0 A_SpawnItemEx("gbtrapeffect", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION, 0)
			GTRP AAAAAAAAAAAAA 8 A_Explode(32, 128, 0)
			GTRP A 8
			GTRP H 20
			Goto Fadeout
		Fadeout:
			GTRP H 1 A_FadeOut(0.05)
			Loop
	}
}

Actor gbtrapeffect
{
	Scale 0.4
	Alpha 0.0
	RenderStyle Add
	+NOINTERACTION
	+NOGRAVITY
	+NOBLOCKMAP
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			TNT1 A 1
			TNT1 A 0 A_SpawnItemEx("gbtrapeffectball", random(-128, 128), random(-128, 128), 0, 0, 0, random(2, 6), 0, SXF_TRANSFERTRANSLATION, 0)
			stop
	}
}

actor GBExplosion
{
	renderstyle translucent
	alpha 1.0
	scale 0.2
	+NOGRAVITY
	-SOLID
	+NOBLOCKMAP
	radius 1
	height 1
	States
	{
	Spawn:
		NKXP BCDEFGHIJKLMNOPQRSTUV 2 bright A_FadeOut(0.04)
		Stop
	}
}

ACTOR GBSmokeLarge : BulletPuff
{
	Health		1
	RenderStyle Translucent
	Alpha		0
	Scale		.3
	States
	{
	Spawn:
		NULL A 0
		Goto See
	See:
		NULL A 0 A_Jump(192,1)
		Goto See+7
		NULL A 0
		NULL A 0 A_Jump(128,1)
		Goto See+11
		NULL A 0
		NULL A 0 A_Jump(64,1)
		Goto See+15
		NULL A 0
		NULL A 0
		Goto See+19
		SMOK A 12 A_SetTranslucent(.15,0)
		SMOK A 12 A_SetTranslucent(.35,0)
		SMOK A 12 A_SetTranslucent(.5,0)
		SMOK A 1 A_Fadeout(.02)
		Wait
		SMOK B 12 A_SetTranslucent(.15,0)
		SMOK B 12 A_SetTranslucent(.35,0)
		SMOK B 12 A_SetTranslucent(.5,0)
		SMOK B 1 A_Fadeout(.025)
		Wait
		SMOK C 12 A_SetTranslucent(.15,0)
		SMOK C 12 A_SetTranslucent(.35,0)
		SMOK C 12 A_SetTranslucent(.5,0)
		SMOK C 1 A_Fadeout(.03)
		Wait
		SMOK D 12 A_SetTranslucent(.15,0)
		SMOK D 12 A_SetTranslucent(.35,0)
		SMOK D 12 A_SetTranslucent(.5,0)
		SMOK D 1 A_Fadeout(.035)
		Wait
	}
}

ACTOR GBFirey : BulletPuff
{
	Health		1
	RenderStyle Add
	Alpha		0
	Scale		.17
	Obituary "%o burned to death"
	States
	{
	Spawn:
		NULL A 0
		NULL A 0
		Goto See
	See:
		NULL A 0 A_Jump(170,1)
		Goto See+7
		NULL A 0
		NULL A 0 A_Jump(85,1)
		Goto See+11
		NULL A 0
		NULL A 0
		Goto See+15
		//-----------------------
		BFIR B 5 Bright //A_PlaySound("Barrel/Fire")
		BFIR A 5 Bright A_SetTranslucent(.4,1)
		BFIR A 5 Bright A_SetTranslucent(.8,1)
		BFIR A 1 Bright A_Fadeout(.06)
		Wait
		BFIR B 5 Bright //A_PlaySound("Barrel/Fire")
		BFIR B 5 Bright A_SetTranslucent(.4,1)
		BFIR B 5 Bright A_SetTranslucent(.8,1)
		BFIR B 1 Bright A_Fadeout(.08)
		Wait
		BFIR B 5 Bright //A_PlaySound("Barrel/Fire")
		BFIR C 5 Bright A_SetTranslucent(.4,1)
		BFIR C 5 Bright A_SetTranslucent(.8,1)
		BFIR C 1 Bright A_Fadeout(.10)
		Wait
	}
}


actor Trapcount : Inventory
{
	inventory.amount 1
	inventory.maxamount 2275
	states
	{
	Spawn:
		PLAY A 1
		loop
	}
}

actor TrapAmmo : Ammo
{
  inventory.pickupmessage "Picked up a new trap."
  inventory.amount 1
  inventory.maxamount 50
  inventory.icon "GTRPE0"
  ammo.backpackamount 10
  ammo.backpackmaxamount 100
  +IGNORESKILL
  states
  {
  Spawn:
    GTRP E -1
    stop
  }
}


actor GhostTrapFX
{
	scale 0.8
	renderstyle translucent
	alpha 0.5
	height 5
	radius 7
	States
	{
	Spawn:
		GTRP BCDCDCDCDCDCDCDCDCDCDB 5 bright
		Stop 
	}
}

actor GBTrapDelayer : PowerDamage
{
	damagefactor "nothing", 1.0
	powerup.duration 42
}

Actor gbtrapeffectball
{
	Scale 0.4
	Alpha 0.0
	RenderStyle Add
	+NOINTERACTION
	+NOGRAVITY
	+NOBLOCKMAP
	+CLIENTSIDEONLY
	States
	{
		Spawn:
			TNT1 A 0
			OBSK AAAAA 1 Bright A_FadeIn(0.2)
		Loopdis:
			OBSK A 1 Bright A_FadeOut(0.03)
			Wait
	}
}