Actor Ivy : PlayerPawn
{
	Mass 700
	Scale 0.4
	Player.Maxhealth 100
	Player.SoundClass "Ivy"
	Player.DisplayName "Ivy"
	Player.ScoreIcon "IVYST"
	Player.ColorRange 112, 127
	Player.ForwardMove 1.0
	Player.SideMove 1.0
	Player.StartItem "Ivy-Plasma", 1
	Player.StartItem "PlasmaAmmoIvy", 150
	Player.StartItem "TieFighterAmmo", 1
	Player.StartItem "Ivy-Railgun", 1
	Player.StartItem "RailgunAmmo", 20
	Player.StartItem "IvyDispersionAmmo", 10
	Player.StartItem "AchievementID", 20
	Player.StartItem "IsHuman", 1	
	Player.StartItem "Screamer", 0
	Player.Weaponslot 1, "Ivy-Plasma"
	Player.Weaponslot 2, "Ivy-Railgun"
	DamageFactor "Grenade", 0.3
	DamageFactor "GhostTrap", 0.0
	Damagefactor "normal", 1.0
	Damagefactor "Sentinel", 0.0
	Damagefactor "GraveStalkerLure", 2.2
	Damagefactor "MechPewPews", 0.0
	Damagefactor "MacheteSlicerino", 0.0
    Damagefactor "GasterSmokeHurt", 0.0
	Damagefactor "StrifeSuit", 0.0
	PainChance 256
	LimitedToTeam 0
	+NOSKIN
	+NOICEDEATH
	+NODAMAGETHRUST
	+GHOST
	+QUICKTORETALIATE
	States
	{
	Spawn:
		SIR2 A 0 A_JumpIfInventory("GloomWatchStack",100,"GloomDeath")
		SIR2 A 0 SetPlayerProperty(0, 0, 3)
		SIR2 A 15 Setplayerproperty(0,0,0)
		SIR2 A 0 A_JumpIfInventory("PlasmaAmmoIvy", 150, "Spawn")
		SIR2 A 0 ACS_ExecuteAlways(996,0)
		SIR2 A 0 A_GiveInventory("PlasmaAmmoIvy", 10)	
		SIR2 A 1
		Loop
	See:
		SIR2 A 0 A_JumpIfInventory("GloomWatchStack",100,"GloomDeath")
		SIR2 A 0 A_JumpIfHealthLower(50,"INeedHealingSee")
		SIR2 AB 3
		SIR2 A 0 A_SpawnItemEx("IvyStomp",0,0,0,0,0,-20,0,0,0) 
		SIR2 ACD 3
		SIR2 A 0 A_SpawnItemEx("IvyStomp",0,0,0,0,0,-20,0,0,0) 
		SIR2 C 3
		Goto Spawn
	INeedHealingSee:
		SIR2 A 0 A_JumpIfInventory("GloomWatchStack",100,"GloomDeath")
		SIR2 A 0 A_SpawnItemEx("INeedHealingTrail",random(-20,20),random(-20,20),0,0,0,10)
		SIR2 AB 3
		SIR2 A 0 A_SpawnItemEx("IvyStomp",0,0,0,0,0,-20,0,0,0) 
		SIR2 ACD 3
		SIR2 A 0 A_SpawnItemEx("IvyStomp",0,0,0,0,0,-20,0,0,0) 
		SIR2 C 3
		Goto Spawn
	Missile:
		SIR2 A 0 A_JumpIfInventory("GloomWatchStack",100,"GloomDeath")
		SIR2 E 12 
		Goto Spawn
	Melee:
		SIR2 A 0 A_JumpIfInventory("GloomWatchStack",100,"GloomDeath")
		SIR2 F 6 bright
		Goto Missile
	Pain.TeleOtherPlant:
	SIR2 G 1 A_GiveInventory("TeleOtherPlanted",1)
	Goto Pain
	Pain.TeleOtherActivateDamage:
	SIR2 G 1 A_JumpIfInventory("TeleOtherPlanted",1,"TeleOtherSend")
	Goto Pain	
	TeleOtherSend:
	TNT1 A 0 A_TakeInventory("TeleOtherPlanted",1)
	TNT1 A 0 A_PlaySound("TeleOther/activate",CHAN_7,1)
	TNT1 A 0 A_SpawnItem("TeleOtherFog")
	TNT1 A 0 ACS_ExecuteAlways(466,0,2)
	SIR2 G 1 A_PlaySound("TeleOther/activate",CHAN_6,1)
	TNT1 A 0 A_SpawnItem("TeleOtherFog")
	Goto Pain
	Death.TeleOtherActivateDamage:
	TNT1 A 0 A_JumpIfInventory("TeleOtherPlanted",1,"TeleOtherSplode")
	TNT1 A 0 A_TakeInventory("TeleOtherPlanted",1)
	TNT1 A 0 A_PlaySound("TeleOther/activate",CHAN_7,1)
	TNT1 A 0 A_SpawnItem("TeleOtherFog")
	TNT1 A 0 A_GiveToTarget("KilledMe",1)
	SIR2 G 1 A_PlaySound("Gibbage/XSplat")
	NULL A 0 A_SpawnItemEx("Custom_BloodySkullIvy", 0, 0, 48, 0.5, 0, 10, random(0,360), SXF_ABSOLUTEVELOCITY)
	NULL A 0 A_PlaySound("gibbage/playergib") 
	NULL A 0 A_NoBlocking 
	NULL A 0 A_SpawnItemEx("PLAYERBOOT", 0, 0, 11, 0, 0, 27, 33, 160, 0)
	NULL A 0 A_SpawnItemEx("PLAYERBOOT", 0, 0, 11, 0, 0, 27, -33, 160, 0)
	NULL A 0 A_SpawnItemEx("SHOTGUYARM", 0, 0, 25, 0, 0, 50, random(0,360), 160, 0)
	NULL A 0 A_SpawnItemEx("SHOTGUYARM", 0, 0, 36, 0, 0, 32, random(0,360), 160, 0)
	NULL A 1 A_SpawnItemEx("GIBBER", 0, 0, 0, 0, 0, 0, 0, 160, 0)
	NULL A -1
	Stop
	TeleOtherSplode:
	TNT1 A 0 A_TakeInventory("TeleOtherPlanted",1)
	TNT1 A 0 A_PlaySound("TeleOther/activate",CHAN_7,1)
	TNT1 A 0 A_SpawnItem("TeleOtherFog")
	TNT1 A 0 ACS_ExecuteAlways(466,0,2)
	TNT1 A 0 A_GiveToTarget("KilledMe",1)
	SIR2 G 1 A_PlaySound("Gibbage/XSplat")
	TNT1 A 0 A_PlaySound("TeleOther/activate",CHAN_6,1)
	TNT1 A 0 A_SpawnItem("TeleOtherFog")
	NULL A 0 A_SpawnItemEx("Custom_BloodySkullIvy", 0, 0, 48, 0.5, 0, 10, random(0,360), SXF_ABSOLUTEVELOCITY)
	NULL A 0 A_PlaySound("gibbage/playergib") 
	NULL A 0 A_NoBlocking 
	NULL A 0 A_SpawnItemEx("PLAYERBOOT", 0, 0, 11, 0, 0, 27, 33, 160, 0)
	NULL A 0 A_SpawnItemEx("PLAYERBOOT", 0, 0, 11, 0, 0, 27, -33, 160, 0)
	NULL A 0 A_SpawnItemEx("SHOTGUYARM", 0, 0, 25, 0, 0, 50, random(0,360), 160, 0)
	NULL A 0 A_SpawnItemEx("SHOTGUYARM", 0, 0, 36, 0, 0, 32, random(0,360), 160, 0)
	NULL A 1 A_SpawnItemEx("GIBBER", 0, 0, 0, 0, 0, 0, 0, 160, 0)
	NULL A -1
	Stop
	Pain.Choke:
		TNT1 A 0 A_GiveToTarget("Health",2)
		TNT1 A 0 A_GiveToTarget("ChokeCharging",1)
		Goto Pain
	Pain.JusticarSpike:
		TNT1 A 0 ACS_NamedExecuteAlways("ChangeActivator",0)
		TNT1 A 0 A_GiveToTarget("Health",2)
	Pain:
		SIR2 G 0 A_JumpIfInventory("GloomWatchStack",100,"GloomDeath")
		SIR2 G 4 
		SIR2 G 4 A_Pain
		Goto Spawn
	Pain.GloomWatcherLure:
	TNT1 A 0 ACS_ExecuteAlways(134)
	TNT1 A 0 A_Playsound("GloomWatcher/FeintAttack",CHAN_7)
	Goto pain
	Death.GloomWatcherlure:
	TNT1 A 0 ACS_ExecuteAlways(134)
	TNT1 A 0 A_Playsound("GloomWatcher/FeintAttack",CHAN_7)
	Goto Death.Jitter
	GloomDeath:
	TNT1 A 1 Damagething(99999,18)
	Goto Death
	Death.Fleshbent:
	TNT1 A 0 A_GiveToTarget("TentacleAmmo",2)
	TNT1 A 0 A_GiveToTarget("Soulscepter1",15)
	TNT1 A 0 A_GiveToTarget("Soulscepter2",50)
	Goto Death.Jitter
	Pain.LoonaClawing:
	TNT1 A 0 A_GiveToTarget("Health",6)
	SIR2 G 20 Setplayerproperty(0,1,0)
	SIR2 G 2 Setplayerproperty(0,0,0)
	Goto Spawn
	Pain.LoonaClawingLightSFX:
	TNT1 A 0 A_PlaySound("Bastet/ClawHitLight",CHAN_6)
	TNT1 A 0 A_GiveToTarget("Health",5)
	SIR2 G 20 Setplayerproperty(0,1,0)
	SIR2 G 2 Setplayerproperty(0,0,0)
	Goto Spawn
	Pain.LoonaClawingHeavySFX:
	TNT1 A 0 A_PlaySound("Bastet/ClawHitHeavy",CHAN_6)
	TNT1 A 0 A_GiveToTarget("Health",8)
	SIR2 G 20 Setplayerproperty(0,1,0)
	SIR2 G 2 Setplayerproperty(0,0,0)
	Goto Spawn
	Death.LoonaClawing:
	TNT1 A 0 A_PlaySound("Bastet/ClawHitHeavy",CHAN_6)
	TNT1 A 0 A_GiveToTarget("Health",50)
	Goto Death.Jitter
	Death.LoonaClawingLightSFX:
	TNT1 A 0 A_PlaySound("Bastet/ClawHitLight",CHAN_6)
	TNT1 A 0 A_GiveToTarget("Health",50)
	Goto Death.Jitter
	Death.LoonaClawingHeavySFX:
	TNT1 A 0 A_PlaySound("Bastet/ClawHitHeavy",CHAN_6)
	TNT1 A 0 A_GiveToTarget("Health",50)
	Goto Death.Jitter
	Pain.BastetClawing:
		TNT1 A 0 A_GiveToTarget("Health",4)
		Goto Pain
	Pain.BastetClawingLightSFX:
		TNT1 A 0 A_PlaySound("Bastet/ClawHitLight",CHAN_5)
		TNT1 A 0 A_GiveToTarget("Health",3)
		Goto Pain
	Pain.BastetClawingHeavySFX:
		TNT1 A 0 A_PlaySound("Bastet/ClawHitHeavy",CHAN_5)
		TNT1 A 0 A_GiveToTarget("Health",6)
		Goto Pain
	Pain.Sickle:
		TNT1 A 0 ACS_NamedExecuteAlways("ChangeActivator",0)
	Pain.Wendigo:
		TNT1 A 0 A_PlaySound("RAVEN1",CHAN_5)
		TNT1 A 0 A_SpawnItemEx ("GIB4", 0, 0, random(0,42), 0, 0, random(2,4), random(0,360), 128)
		TNT1 A 0 A_SpawnItemEx ("GIB4", 0, 0, random(0,42), 0, 0, random(2,4), random(0,360), 128)
		Goto Pain
		Pain.Justicar:
	TNT1 A 0 A_custommissile("Justicarattack",14,0,random(0,360))
	TNT1 A 0 A_GiveToTarget("Health",1)
	TNT1 A 0 A_GiveToTarget("JusticarSecondaryAmmo",1)
	Goto pain
	Pain.CreepStun:
    SIR2 G 0 A_Pain
	SIR2 G 0 A_GiveToTarget("health",5)
	SIR2 G 40 Setplayerproperty(0,1,0)
	SIR2 G 2 Setplayerproperty(0,0,0)
		Goto Spawn
	Death.Creeper:
		SIR2 A 0 A_PlaySoundEx("CreeperAttack","Body")
		SIR2 A 0 A_GiveToTarget("CreeperHeal",1)
		TNT1 A 0 A_GiveToTarget("GhoulAmmo",1)
		SIR2 A 0 ACS_ExecuteAlways(997,0)
		Goto DeathAnimAlt
	Death.CreepStun:
		SIR2 A 0 A_GiveToTarget("Unlock13",1)
		SIR2 A 0 A_GiveToTarget("CreepGotya",1)
		Goto DeathAnimAlt
	Death.SjasScream:
	Death.FrostbiteWind:
	Death.EmtalicSaw:
	Death.LichFire:
		SIR2 A 0 A_GiveToTarget("KilledJ",1)
		Goto DeathAnim
	Death:
	DeathAnim:
		SIR2 A 0 A_GiveToTarget("KillBeep",1)
		SIR2 A 0 A_GiveInventory("ItemDeath",1)
		CALB A 0 A_TakeInventory("KilledCount",999)
		CALB A 0 A_GiveToTarget("KilledMe",1)
		CALB A 0 A_GiveToTarget("KilledIvy",1)
		SIR2 H 1
		SIR2 I 2 A_PlayerScream
		SIR2 J 2 A_NoBlocking
		SIR2 KLMNOP 2
		SIR2 Q -1
		Stop
	DeathAnimAlt:
		SIR2 A 0 A_GiveToTarget("KillIndicator",1)
		SIR2 A 0 A_GiveInventory("ItemDeath",1)
		CALB A 0 A_TakeInventory("KilledCount",999)
		CALB A 0 A_GiveToTarget("KilledMe",1)
		CALB A 0 A_GiveToTarget("KilledIvy",1)
		SIR2 H 1
		SIR2 I 2 A_PlayerScream
		SIR2 J 2 A_NoBlocking
		SIR2 KLMNOP 2
		SIR2 Q -1
		Stop
	Death.GhoulChainSaw:
	TNT1 A 0 A_GiveToTarget("Health",50)
	TNT1 A 0 A_GiveToTarget("BearTarpsAmmo",1)
	TNT1 A 0 A_GiveToTarget("SawyerRageammo",10)
	TNT1 A 0 A_GiveToTarget("DUMMY_SawyerBloodyChainsaw", 1)
	Goto Death.Jitter
	Death.BastetClawing:
	TNT1 A 0 A_PlaySound("Bastet/ClawHitHeavy",CHAN_6)
	TNT1 A 0 A_GiveToTarget("Health",30)
	Goto Death.Jitter
	Death.BastetClawingLightSFX:
	TNT1 A 0 A_PlaySound("Bastet/ClawHitLight",CHAN_6)
	TNT1 A 0 A_GiveToTarget("Health",30)
	Goto Death.Jitter
	Death.BastetClawingHeavySFX:
	TNT1 A 0 A_PlaySound("Bastet/ClawHitHeavy",CHAN_6)
	TNT1 A 0 A_GiveToTarget("Health",30)
	Goto Death.Jitter
	Death.Choke:
		TNT1 A 0 A_GiveToTarget("Health",25)
		TNT1 A 0 A_GiveToTarget("ChokeCharging",40)
	Goto Death.Jitter
	Death.JusticarSpike:
		TNT1 A 0 A_GiveToTarget("Health",15)
	Goto Death.Jitter
	Death.Sinistar:
		TNT1 A 0 A_GiveToTarget("SiniPrimary",1)
	Goto Death.Jitter
	Death.MapGibber:
		TNT1 A 0 A_PlaySound("car/hit",chan_auto)
	Death.MapGibber2:
	Death.Jitter:
		SIR2 G 0 A_GiveToTarget("KillBeep",1)
		SIR2 G 0 A_GiveInventory("ItemDeath",1)
		SIR2 G 0 A_GiveToTarget("KilledMe",1)
		SIR2 G 0 A_GiveToTarget("Crunched",1)
		SIR2 G 1 A_PlaySound("Gibbage/XSplat")
		NULL A 0 A_SpawnItemEx("Custom_BloodySkullIvy", 0, 0, 48, 0.5, 0, 10, random(0,360), SXF_ABSOLUTEVELOCITY)
		NULL A 0 A_PlaySound("Gibbage/PlayerGib") 
		NULL A 0 A_NoBlocking 
		NULL A 0 A_SpawnItemEx("PLAYERBOOT", 0, 0, 11, 0, 0, 27, 33, 160, 0)
		NULL A 0 A_SpawnItemEx("PLAYERBOOT", 0, 0, 11, 0, 0, 27, -33, 160, 0)
		NULL A 0 A_SpawnItemEx("SHOTGUYARM", 0, 0, 25, 0, 0, 50, random(0,360), 160, 0)
		NULL A 0 A_SpawnItemEx("SHOTGUYARM", 0, 0, 36, 0, 0, 32, random(0,360), 160, 0)
		NULL A 1 A_SpawnItemEx("GIBBER", 0, 0, 0, 0, 0, 0, 0, 160, 0)
		NULL A -1
		Stop
	Death.JitterAlt:
		SIR2 G 0 A_GiveToTarget("KillIndicator",1)
		SIR2 G 0 A_GiveInventory("ItemDeath",1)
		SIR2 G 0 A_GiveToTarget("KilledMe",1)
		SIR2 G 0 A_GiveToTarget("Crunched",1)
		SIR2 G 1 A_PlaySound("Gibbage/XSplat")
		NULL A 0 A_SpawnItemEx("Custom_BloodySkullIvy", 0, 0, 48, 0.5, 0, 10, random(0,360), SXF_ABSOLUTEVELOCITY)
		NULL A 0 A_PlaySound("Gibbage/PlayerGib") 
		NULL A 0 A_NoBlocking 
		NULL A 0 A_SpawnItemEx("PLAYERBOOT", 0, 0, 11, 0, 0, 27, 33, 160, 0)
		NULL A 0 A_SpawnItemEx("PLAYERBOOT", 0, 0, 11, 0, 0, 27, -33, 160, 0)
		NULL A 0 A_SpawnItemEx("SHOTGUYARM", 0, 0, 25, 0, 0, 50, random(0,360), 160, 0)
		NULL A 0 A_SpawnItemEx("SHOTGUYARM", 0, 0, 36, 0, 0, 32, random(0,360), 160, 0)
		NULL A 1 A_SpawnItemEx("GIBBER", 0, 0, 0, 0, 0, 0, 0, 160, 0)
		NULL A -1
		Stop
	Death.Harvester:
		TNT1 A 0 A_GiveToTarget("SoulHarvesterFragment",1)
		TNT1 A 0 A_GiveToTarget("KilledJ",1)
		Goto Death.Jitter
	Death.HarvesterRock:
		TNT1 A 0 ACS_NamedExecute("SilverFieldsBell",55)
		Goto DeathAnim
	Death.HarvesterAlt:
		TNT1 A 0 A_GiveToTarget("Crunched2",1)
		TNT1 A 0 ACS_NamedExecute("SilverFieldsBell",55)
		Goto Death.Jitter
	Death.Ravager:
		SIR2 A 0 A_GiveToTarget("KilledR",1)
		SIR2 A 0 A_GiveToTarget("Health",100)
		SIR2 A 0 ACS_ExecuteAlways(997,0,2)
		SIR2 A 0 A_PlaySoundEx("RavagerAttack","Body")
		SIR2 A 0 A_SpawnItemEx("RavagerHit",0,0,32)
		Goto DeathAnimAlt
	Death.RavagerBall:
		SIR2 A 0 A_GiveToTarget("RavagerGotYa",1)
		SIR2 A 0 A_GiveToTarget("KilledJ",1)
		Goto DeathAnimAlt
	Death.Yurei:
		SIR2 A 0 A_GiveToTarget("KilledY",1)
		SIR2 A 0 A_PlaySoundEx("YureiKill1","Body",0,1)
		SIR2 A 0 ACS_ExecuteAlways(997,0,3)
		Goto DeathAnimAlt
	Death.YureiBall:
		SIR2 A 0 A_GiveToTarget("Health",10)
		SIR2 A 0 A_SpawnItemEx("BallFire")
		Goto Death.SjasScream
	Death.UboaRawrScream:
		Goto DeathAnimAlt
	Death.Misty:
	Death.Whiteface:
		SIR2 A 0 A_GiveToTarget("KillBeep",1)
		SIR2 A 0 A_GiveInventory("ItemDeath",1)
		SIR2 A 0 A_GiveToTarget("KilledMe",1)
		SIR2 A 0 A_GiveToTarget("KilledM",1)
		SIR2 HHHHH 1 A_FadeOut(0.05)
		SIR2 A 0 A_PlayerScream
		SIR2 IIIIIJJJJJKKKKK 1 A_FadeOut(0.05)
		SIR2 A 0 A_NoBlocking
		NULL A -1
		Stop
	Death.Clowny:
		SIR2 A 0 ACS_ExecuteAlways(997,0,4)
		SIR2 A 0 A_GiveToTarget("KilledC",1)
		SIR2 A 0 A_GiveToTarget("ClownyAmmo",5)
		Goto DeathAnim
	Death.Mohoph:
		SIR2 A 0 A_GiveToTarget("TransIvy",1)
		TNT1 A 0 A_GiveToTarget("MorphAmmo", 1)
		SIR2 A 0 A_PlaySoundEx("MohophKill","Body")
		SIR2 A 0 ACS_ExecuteAlways(997,0,5)
		Goto DeathAnim
	Death.EmtalicWeak:
		SIR2 A 0 A_PlaySoundEx("RamSuccess","Body")
		Goto DeathAnim
	Death.Emtalic:
		SIR2 A 0  A_PlaySoundEx("RamSuccess","Body")
		Goto Death.Jitter
	Death.I1:
		SIR2 A 0 A_SpawnItemEx("Heart",0,0,32,random(2,3),momy,random(8,12),random(-180,180))
		SIR2 A 0 A_GiveToTarget("KilledI1",1)
		Goto DeathAnim
	Death.I2:
		SIR2 A 0 A_GiveToTarget("KillBeep",1)
		SIR2 A 0 A_GiveInventory("ItemDeath",1)
		SIR2 A 0 A_GiveToTarget("KilledMe",1)
		SIR2 A 0 A_GiveToTarget("KilledI2",1)
		SIR2 A 0 A_GiveToTarget("Clip",1)
		SIR2 G 0 SetPlayerProperty(0,1,4)
		SIR2 G 0 A_Stop
		SIR2 GGGGGGGGGGGGGG 5 A_SpawnItemEx("PainSmoke",0,random(-22,22),random(-22,22),random(2,4),momy,random(8,12),random(-180,180))
		NULL A 0 A_PlayerScream
		NULL A 0 ACS_ExecuteAlways(997,0,6)
		NULL A 0 A_SpawnItemEx("PLAYERBOOT", 0, 0, 11, 0, 0, 27, 33, 160, 0)
		NULL A 0 A_SpawnItemEx("PLAYERBOOT", 0, 0, 11, 0, 0, 27, -33, 160, 0)
		NULL A 0 A_SpawnItemEx("SHOTGUYARM", 0, 0, 25, 0, 0, 50, random(0,360), 160, 0)
		NULL A 0 A_SpawnItemEx("SHOTGUYARM", 0, 0, 36, 0, 0, 32, random(0,360), 160, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner1", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner2", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner3", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner1", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner2", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner3", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner1", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner2", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner3", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner1", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner2", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner3", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner1", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner2", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner3", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner1", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner2", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner3", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner1", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner2", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner3", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner1", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner2", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner3", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner1", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner2", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner3", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner1", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner2", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner3", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner1", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner2", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner3", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner1", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner2", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner3", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner1", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner2", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner3", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner1", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner2", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
        NULL A 0 A_SpawnItemEx ("BoneShardSpawner3", 1, 1, random(8,32), random(0,5), random(0,5), random(8,18), random(0,360), SXF_NOCHECKPOSITION, 0)
		NULL A 1 A_SpawnItemEx("GIBBER", 0, 0, 0, 0, 0, 0, 0, 160, 0)
		NULL A 1 A_SpawnItemEx("SkullGib",0,0,0,random(2,4),random(2,4),random(8,12),random(-180,180))
		NULL A 1 A_SpawnItemEx("ChestGib",0,0,0,random(2,4),random(2,4),random(8,12),random(-180,180))
		NULL AA 1 A_SpawnItemEx("ArmGib",0,0,0,random(2,4),random(2,4),random(8,12),random(-180,180))
		NULL AA 1 A_SpawnItemEx("HandGib",0,0,0,random(2,4),random(2,4),random(8,12),random(-180,180))
		NULL A 1 A_SpawnItemEx("CoccyxGib",0,0,0,random(2,4),random(2,4),random(8,12),random(-180,180))
		NULL AA 1 A_SpawnItemEx("LegGib",0,0,0,random(2,4),random(2,4),random(8,12),random(-180,180))
		NULL AAAAAA 1 A_SpawnItemEx("BoneGib",0,0,0,random(2,4),random(2,4),random(8,12),random(-180,180))
		NULL A -1 A_NoBlocking
		Stop
	Death.I3:
		SIR2 A 0 A_GiveToTarget("KillBeep",1)
		SIR2 A 0 A_GiveInventory("ItemDeath",1)
		SIR2 A 0 A_GiveToTarget("KilledMe",1)
		SIR2 A 0 A_GiveToTarget("KilledI3",1)
		SIR2 HHHHH 1 A_SpawnItemEx("PainSmoke",0,random(-22,22),random(-22,22),random(2,4),momy,random(8,12),random(-180,180))
		SIR2 I 0 A_PlayerScream
		SIR2 IIIII 1 A_SpawnItemEx("PainSmoke",0,random(-22,22),random(-22,22),random(2,4),momy,random(8,12),random(-180,180))
		SIR2 J 0 A_NoBlocking
		SIR2 JJJJJKKKKKLLLLLMMMMM 1 A_SpawnItemEx("PainSmoke",0,random(-22,22),random(-22,22),random(2,4),momy,random(8,12),random(-180,180))
		SIR2 NNNNNNN 3 A_SpawnItemEx("PainSmoke",0,random(-22,22),random(-22,22),random(2,4),momy,random(8,12),random(-180,180))
		SIR2 N -1
		Stop
	Death.I4:
		SIR2 A 0 A_GiveToTarget("KilledI4",1)
		Goto DeathAnim
	Death.I5:
		SIR2 A 0 A_GiveToTarget("KilledI5",1)
		Goto DeathAnim
	Pain.RavagerBall:
		SIR2 A 0 ACS_ExecuteAlways(920,0)
		Goto Pain
	Pain.YureiBall:
		SIR2 A 0 A_GiveToTarget("Health",10)
		SIR2 A 0 A_SpawnItemEx("BallFire")
		Goto Pain
	Pain.Emtalic:
		SIR2 A 0 A_PlaySoundEx("RamSuccess","Body")
		Goto Pain
	Pain.EmtalicWeak:
		SIR2 A 0 A_PlaySoundEx("RamSuccess","Body")
		Goto Pain
	Death.Tenebra:
		TNT1 A 0 A_GiveToTarget("Health",20)
		Goto DeathAnim
	Death.TenebraRail:
	Death.Telefrag:
	Death.Grenade:
	Death.Termissiles:
	Death.ChaosExpl12:
	Death.KarenExplo:
	Death.IlluNukeKABUUM:
	Death.CalebDynamite:
	Death.Wendigo:
	Death.MorphRipperGib:
	Death.DarkVortex:
	Death.ImpostorJitter:
	Death.PuppetStrings:
	Death.LichIce:
	Death.LichLightning:
	Death.AsylumCannonBall:
		Goto Death.Jitter
	Death.TrueDivine:
		TNT1 A 0 A_PlaySoundEx("SoulSnatchStinger",CHAN_AUTO,0,1)
		TNT1 A 0 A_SpawnItemEx("SoulSnatch")
		Goto Death.JitterAlt
	Death.Judgement:
		TNT1 A 0 A_SpawnItemEx("StellarisThunderFX")
		Goto Death.JitterAlt
	Death.VoltMelee:
	Death.AmperRail:
		TNT1 A 0 A_GiveToTarget("VoltRingAmmo",2)
		TNT1 A 0 A_GiveToTarget("AmperSpeedTokenCheck",1)
		Goto Death.Jitter
	Pain.FrostbiteWind:
	Pain.Ravager:
	Pain.Juglava:
	Pain.HarvesterRock:
	Pain.EmtalicSaw:
	Pain.MorphRipper:
	Pain.MorphRipperGib:
	Pain.I1:
	Pain.I3:
	Pain.ZombiePoison:
	Pain.Asylum:
	Pain.AsylumCannonBall:
	Pain.FleshlingMissile:
	Pain.DarkVortex:
	Pain.ImpostorJitter:
	Pain.BlueFire:
	Pain.PuppetStrings:
	Pain.LichFire:
	Pain.LichIce:
	Pain.LichLightning:
	Pain.Whiteface:
		TNT1 A 0 ACS_NamedExecuteAlways("ChangeActivator",0)
		Goto Pain
	}
}

Actor IvyStomp : CyborgStomp
{
	DeathSound "IvyStep"
}

Actor Ivy-Railgun : Weapon
{
	Weapon.SlotNumber 2
	Weapon.AmmoType "RailgunAmmo"
	Weapon.AmmoGive 10
	Weapon.AmmoUse 1
	Inventory.Icon "IVYRAIL"
	+WEAPON.NOAUTOAIM
	+WEAPON.NOALERT
	+INVENTORY.UNDROPPABLE
	Decal "BulletChip"
	AttackSound "RailgunShot"
	Obituary "%k duck hunted %o."
  +NOALERT
  states
  {
  Ready:
    IVRL A 2 A_WeaponReady
    wait
  Ready2:
  	LDHR S 2 A_WeaponReady
	wait
  Deselect:
  	IVRL A 0 A_JumpIfInventory("ZoomedIn",1,2)
	IVRL A 0 A_JumpIfInventory("ZoomedIn2",1,2)
    IVRL A 1 A_Lower
    wait
	LDHR T 13 A_ZoomFactor(1.0)
	LDHR T 1 A_TakeInventory("ZoomedIn",1)
	LDHR T 1 A_TakeInventory("ZoomedIn2",1)
	LDHR T 1 
	goto Deselect+1
  Select:
    IVRL A 0 A_Zoomfactor(1.0)
	LDHR T 0 A_TakeInventory("ZoomedIn",1)
	LDHR T 0 A_TakeInventory("ZoomedIn2",1)
    IVRL A 1 A_Raise
    wait
	Fire:
	    IVRL B 0 A_JumpIfInventory("ZoomedIn",1,"Fire2")
		IVRL B 0 A_JumpIfInventory("ZoomedIn2",1,"Fire2")
		IVRL B 0 A_Light1
		IVRL B 2 bright A_RailAttack(30,4,1,"00 00 00","FF 00 00",0,0,"RailPuff")
		IVRL C 1 bright A_Light2
		IVRL D 1 bright A_Light1
		IVRL E 1 bright
		IVRL F 1 bright
		IVRL G 1 bright
		IVRL H 1 
		IVRL I 1 
		IVRL JK 5 A_Light0
		Goto Ready
  Fire2:
		LDHR T 0 A_Light1
		LDHR T 3 bright A_RailAttack(36,0,1,"00 00 00","FF 00 00",0,0,"RailPuff")
		LDHR T 3 A_Light2
		LDHR T 3 A_Light1
		LDHR T 15 A_Light0
	goto Ready2
  AltFire:
    IVRL A 0 A_JumpIfInventory("ZoomedIn",1,"ZoomOut")
    IVRL A 0 A_Playsound("Zoomsound")
    IVRL A 0 A_GiveInventory("ZoomedIn",1)
    LDHR T 13 A_ZoomFactor(3.0)
	LDHR T 2 
	Goto Ready2
  ZoomOut:
    IVRL A 0 A_Playsound("Zoomsound")
  	LDHR T 13 A_ZoomFactor(1.0)
	LDHR T 1 A_TakeInventory("ZoomedIn",1)
	LDHR T 1 
	goto Ready
	}
}

actor zoomedin : inventory { inventory.maxamount 1 }

actor zoomedin2 : inventory { inventory.maxamount 1 }


Actor RailgunAmmo : Ammo
{
	Ammo.BackPackAmount 20
	Ammo.BackPackMaxAmount 20
	Inventory.Amount 20
	Inventory.MaxAmount 20
	Inventory.Icon "RAILCLIP"
	+INVENTORY.IGNORESKILL
	States
	{
	Spawn:
		TNT1 A -1
		Stop
	}
}

Actor Ivy-Plasma : Weapon
{
	Weapon.AmmoType "PlasmaAmmoIvy"
	Weapon.AmmoGive 50
	Weapon.AmmoUse 0
	Weapon.AmmoType2 "IvyDispersionAmmo"
	Weapon.AmmoGive2 2
	Weapon.AmmoUse2 1
	Weapon.SlotNumber 1
	Inventory.Icon "IVYPLAS"
	+WEAPON.NOAUTOAIM
	+WEAPON.NOALERT
	+INVENTORY.UNDROPPABLE
	Decal "BulletChip"
	States
	{
	Select:
		PLGN A 1 A_Raise
		Loop
	Ready:
		PLGN A 3 A_WeaponReady
		PLGN A 0 A_JumpIfInventory("CyborgDashCheck",1,"TieFighter")
		Goto Ready
	Deselect:
		PLGN A 1 A_Lower
		Loop
	Fire:
		PLGN A 1 A_JumpIfInventory("PlasmaAmmoIvy",1,"NormalShot")
	NoAmmo:
		PLGN A 0 A_PlaySound("STEAM",CHAN_7)
		PLGN AAAAAAAA 1 A_SpawnItemEx("IvyNoAmmoPlasmaTrail",7,random(-1,1),41,0,0,1)
		PLGN A 20
		Goto Ready
	NormalShot:
		PLGN A 0 A_GunFlash
		PLGN A 0 A_PlayWeaponSound("PlasmaShot")
		PLGN A 0 A_TakeInventory("PlasmaAmmoIvy",1)
		PLGN A 0 A_GiveInventory("IvyDispersionAmmo",1)
		PLGN B 2 Bright A_FireCustomMissile("IvyPlasma",0,1,9,6)
		PLGN E 1
		PLGN E 1 A_Refire
		PLGN F 1
		PLGN G 2
		PLGN H 2
		PLGN G 2
		PLGN F 1
		Goto Ready
	AltFire:
		PLGN A 0 A_JumpIfInventory("IvyDispersionAmmo",10,"FiremodeCheck")
		Goto Ready
	FiremodeCheck:
		PLGN A 0 A_JumpIfInventory("PlasmaAmmoIvy",20,"FiremodeActivate")
		Goto Ready
	FireModeActivate:
		PLGN A 0 A_GunFlash
		PLGN A 0 A_PlayWeaponSound("IVALTF")
		PLGN A 0 A_TakeInventory("PlasmaAmmoIvy",2)
		PLGN B 2 Bright A_FireCustomMissile("SwarmSpreadShotLaunch",0,1,6)
		PLGN E 2
		PLGN A 0 A_PlayWeaponSound("IVALTF")
		PLGN A 0 A_TakeInventory("PlasmaAmmoIvy",2)
		PLGN B 2 Bright A_FireCustomMissile("SwarmSpreadShotLaunch",0,1,6)
		PLGN E 2
		PLGN A 0 A_PlayWeaponSound("IVALTF")
		PLGN A 0 A_TakeInventory("PlasmaAmmoIvy",2)
		PLGN B 2 Bright A_FireCustomMissile("SwarmSpreadShotLaunch",0,1,6)
		PLGN E 2
		PLGN A 0 A_PlayWeaponSound("IVALTF")
		PLGN A 0 A_TakeInventory("PlasmaAmmoIvy",2)
		PLGN B 2 Bright A_FireCustomMissile("SwarmSpreadShotLaunch",0,1,6)
		PLGN E 2
		PLGN A 0 A_PlayWeaponSound("IVALTF")
		PLGN A 0 A_TakeInventory("PlasmaAmmoIvy",2)
		PLGN B 2 Bright A_FireCustomMissile("SwarmSpreadShotLaunch",0,1,6)
		PLGN E 2
		PLGN A 0 A_PlayWeaponSound("IVALTF")
		PLGN A 0 A_TakeInventory("PlasmaAmmoIvy",2)
		PLGN B 2 Bright A_FireCustomMissile("SwarmSpreadShotLaunch",0,1,6)
		PLGN E 2
		PLGN A 0 A_PlayWeaponSound("IVALTF")
		PLGN A 0 A_TakeInventory("PlasmaAmmoIvy",2)
		PLGN B 2 Bright A_FireCustomMissile("SwarmSpreadShotLaunch",0,1,6)
		PLGN E 2
		PLGN A 0 A_PlayWeaponSound("IVALTF")
		PLGN A 0 A_TakeInventory("PlasmaAmmoIvy",2)
		PLGN B 2 Bright A_FireCustomMissile("SwarmSpreadShotLaunch",0,1,6)
		PLGN E 2
		PLGN A 0 A_PlayWeaponSound("IVALTF")
		PLGN A 0 A_TakeInventory("PlasmaAmmoIvy",2)
		PLGN B 2 Bright A_FireCustomMissile("SwarmSpreadShotLaunch",0,1,6)
		PLGN E 2
		PLGN A 0 A_PlayWeaponSound("IVALTF")
		PLGN A 0 A_TakeInventory("PlasmaAmmoIvy",2)
		PLGN B 2 Bright A_FireCustomMissile("SwarmSpreadShotLaunch",0,1,6)
		PLGN E 2
		PLGN E 1
		PLGN F 1
		PLGN G 2
		PLGN H 2
		PLGN G 2
		PLGN F 1
		PLGN A 20 
		Goto Ready
	TieFighter:
		PLGN A 0 A_TakeInventory("CyborgDashCheck",999)
		PLGN A 0 A_JumpIfInventory("TieFighterAmmo",1,"NewTieFighter")
		Goto Ready
	NewTieFighter:
		PLGN A 0 A_Playsound("SENTPT")
		PLGN A 50
		PLGN A 1 A_SpawnItemEx("PhazonTieFighter",50,0,120)
		PLGN A 0 A_TakeInventory("TieFighterAmmo",1)
		Goto Ready
	}
}

Actor IvyNoAmmoPlasmaTrail
{
	RenderStyle Add
	Alpha 0.7
	Scale 0.1
	
	+NOGRAVITY
	+NOBLOCKMAP
	-SHOOTABLE
	-SOLID
	+CLIENTSIDEONLY
	States
	{
	Spawn:
		PAO2 A 2 bright A_FadeOut(0.1)
		Loop
	Death:
		TNT1 A 0
		Stop
	}
}


ACTOR SwarmSpreadShotLaunch //"Breaks" after a short time into SwarmSpreadShotPrep.
{
   Speed 18
   Radius 15
   Height 8
   Damage (5)
   Obituary "%o got deleted by %k."
   Alpha 0.8
   Scale 0.6
   PROJECTILE
   Damagetype "Plasma"
   RenderStyle Add
   +RANDOMIZE
   +BRIGHT
   States
   {
   Spawn:
      TNT1 A 0
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)		
      BSTB A 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB B 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB C 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB D 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB E 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB F 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB G 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB H 1
      TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
      Goto Death
   Bounce:  //Prevents bug where duplicate projectiles would spawn when Spawn state was finished while projectile hit wall from certain distance.
      TNT1 A 0
	  Goto Death+2
   XDeath:
	  TNT1 A 0 A_GiveToTarget("HitBeep",1)
	  Goto Death
   Death:
	  TNT1 A 0
	  TNT1 A 0 A_SpawnItemEx("SwarmSpreadShotPrep",0,0,5,random(-2,2),random(-2,2),random(-1,0),0,0)
	  TNT1 A 0 A_SpawnItem("SwarmSeekShockwave",0,0,0,0)
	  TNT1 A 0 A_PlaySound("SWRMFIR",5,1)
	  TNT1 A 0 A_SetTranslucent(0.6)
	  TNT1 A 0 A_Stop
      TRPF AABCDE 1
      Stop 	 
   }
}

ACTOR SwarmSpreadShotPrep //"Breaks" after a short time into SwarmFastProj.
{
   Speed 3
   Radius 15
   Height 8
   Damage (8)
   Obituary "%o got deleted by %k."
   Damagetype "Plasma"
   Alpha 0.8
   Scale 0.6
   RenderStyle Add
   PROJECTILE
   +RANDOMIZE
   +BRIGHT
   States
   {
   Spawn:
      TNT1 A 0
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)		
      BSTB A 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB B 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB C 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB D 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB E 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB F 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB G 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB H 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB I 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB J 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB K 1
	  TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
	  BSTB L 1
      TNT1 A 0 A_SpawnItemEx("SwarmGlowSmall", 0, 0, -1, 0, 0, 0, 0, 0)
      Goto Death
   Bounce:  //Prevents bug where duplicate projectiles would spawn when Spawn state was finished while projectile hit wall from certain distance.
      TNT1 A 0
	  Goto Death+2	
   XDeath:
	  TNT1 A 0 A_GiveToTarget("HitBeep",1)
	  Goto Death
   Death:
	  TNT1 A 0
	  TNT1 A 0 A_CustomMissile("SwarmFastProj", 0, 0, 0, CMF_AIMDIRECTION)
	  TNT1 A 0 A_SpawnItem("SwarmSeekShockwave",0,0,0,0)
	  TNT1 A 0 A_PlaySound("SSEEKSHK",5,1)
	  TNT1 A 0 A_SetTranslucent(0.6)
      TRPF AABCDE 1
      Stop
   }
}

ACTOR SwarmFastProj : FastProjectile
{
     Speed 130
     Radius 3
     Height 3
     Mass 10
	 Damage (15)
	 Obituary "%o got deleted by %k."
	 DeathSound "SWRMPRJC"
	 Damagetype "Plasma"
     MissileHeight 8
	 RenderStyle Add
     Alpha 0.8
     Scale 0.6
     PROJECTILE
	 +BRIGHT
     States
     {
     Spawn:
	 	TNT1 A 0
	    TNT1 A 0 A_SpawnItemEx("SwarmGlow", 0, 0, 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("SwarmWaveTail", 0, 0, 0, 0, 0, 0, 0, 0)
        BSTB A 1
	    TNT1 A 0 A_SpawnItemEx("SwarmGlow", 0, 0, 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("SwarmWaveTail", 0, 0, 0, 0, 0, 0, 0, 0)
		BSTB B 1
		TNT1 A 0 A_SpawnItemEx("SwarmGlow", 0, 0, 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("SwarmWaveTail", 0, 0, 0, 0, 0, 0, 0, 0)
		BSTB C 1
		TNT1 A 0 A_SpawnItemEx("SwarmGlow", 0, 0, 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("SwarmWaveTail", 0, 0, 0, 0, 0, 0, 0, 0)
		BSTB D 1
		TNT1 A 0 A_SpawnItemEx("SwarmGlow", 0, 0, 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("SwarmWaveTail", 0, 0, 0, 0, 0, 0, 0, 0)
		BSTB E 1
		TNT1 A 0 A_SpawnItemEx("SwarmGlow", 0, 0, 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("SwarmWaveTail", 0, 0, 0, 0, 0, 0, 0, 0)
		BSTB F 1
		TNT1 A 0 A_SpawnItemEx("SwarmGlow", 0, 0, 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("SwarmWaveTail", 0, 0, 0, 0, 0, 0, 0, 0)
		BSTB G 1
		TNT1 A 0 A_SpawnItemEx("SwarmGlow", 0, 0, 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("SwarmWaveTail", 0, 0, 0, 0, 0, 0, 0, 0)
		BSTB H 1
		TNT1 A 0 A_SpawnItemEx("SwarmGlow", 0, 0, 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("SwarmWaveTail", 0, 0, 0, 0, 0, 0, 0, 0)
		BSTB I 1
		TNT1 A 0 A_SpawnItemEx("SwarmGlow", 0, 0, 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("SwarmWaveTail", 0, 0, 0, 0, 0, 0, 0, 0)
		BSTB J 1
		TNT1 A 0 A_SpawnItemEx("SwarmGlow", 0, 0, 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("SwarmWaveTail", 0, 0, 0, 0, 0, 0, 0, 0)
		BSTB K 1
		TNT1 A 0 A_SpawnItemEx("SwarmGlow", 0, 0, 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("SwarmWaveTail", 0, 0, 0, 0, 0, 0, 0, 0)
		BSTB L 1
		TNT1 A 0 A_SpawnItemEx("SwarmGlow", 0, 0, 0, 0, 0, 0, 0, 0)
		TNT1 A 0 A_SpawnItemEx("SwarmWaveTail", 0, 0, 0, 0, 0, 0, 0, 0)
		Loop  
	 XDeath:
	    TNT1 A 0 A_GiveToTarget("HitBeep",1)
	    Goto Death
     Death: 
	    TNT1 A 0
	    TNT1 A 0 A_SetTranslucent(0.6)
		TNT1 A 0 A_SpawnItem("SwarmSeekExp",0,0,0,0)
        TRPF AA 1
		TRPF B 1
		TRPF C 1
		TRPF D 1
		TRPF E 1
        Stop   
     }
}

//AESTHETIC EFFECTS

ACTOR SwarmSeekExp  //Deals no damage.
{
   Projectile
   Radius 6
   Height 6
   Speed 0
   RenderStyle Add
   Alpha 0.25
   Scale 0.5
   +NOCLIP
   +THRUACTORS
   +CLIENTSIDEONLY
   +BRIGHT
   States
   {
   Spawn:
      TNT1 A 0
      Goto Death
   Death:
      TSXP A 1
      TNT1 A 0 A_SetTranslucent(0.1)
      TSXP A 1
      Stop
   }
}

ACTOR SwarmSeekExpSmall : SwarmSeekExp
{
   Scale 0.3
}

ACTOR SwarmSeekShockwave  //Deals no damage.
{
   Projectile
   Radius 6
   Height 6
   Speed 0
   RenderStyle Add
   Alpha 0.25
   Scale 0.4
   +NOCLIP
   +THRUACTORS
   +CLIENTSIDEONLY
   +BRIGHT
   States
   {
   Spawn:
      TNT1 A 0
      Goto Death
   Death:
      TSXP A 1
      TNT1 A 0 A_SetTranslucent(0.1)
      TSXP A 1
      TSXP A 1
      Stop
   }
}

ACTOR SwarmGlow
{
    +NOINTERACTION
	+THRUACTORS
	+CLIENTSIDEONLY
    RenderStyle Add
    Alpha 0.4
    Scale 0.5
    States
{
   Spawn:
	SWGL A 2 Bright
	TNT1 A 1
	Stop
   }
}

ACTOR SwarmGlowSmall : SwarmGlow
{
    Scale 0.3
}

ACTOR SwarmWaveTail
{
    +NOINTERACTION
	+THRUACTORS
	+CLIENTSIDEONLY
    RenderStyle Add
    Alpha 0.3
    Scale 0.5
    States
{
   Spawn:
	TRPF BCD 1 Bright
	Stop
   }
}

actor PhazonTieFighter
{
    Health 150
    Radius 12
    Height 26
    Speed 5
    PainChance 0
    MONSTER 
	scale 1.2
    +NOGRAVITY
	+NOBLOOD
	+SPAWNCEILING
	+QUICKTORETALIATE
	+FRIENDLY
	+DONTHURTSPECIES
	+NOBLOOD
	+NOBLOCKMONST
	+MISSILEMORE
	+MISSILEEVENMORE
	+LOOKALLAROUND
	+NEVERRESPAWN
	+DONTDRAIN
    HitObituary "%o was blasted by a ... Tie fighter?"
	PainSound "drone/pain" 
	DeathSound "drone/die" 
	Damagefactor "Minion2", 0.6
	Damagefactor "Sentinel", 0.0
	Damagefactor "ChaosExpl12", 0.0
	Damagefactor "ChaosExpl1", 0.0
	Damagefactor "ChaosExpl2", 0.0
	Damagefactor "MechPewPews", 0.0
	Damagefactor "MacheteSlicerino", 0.0
	Damagefactor "GraveStalkerLure", 10.0
    Damagefactor "GasterSmokeHurt", 0.0
	Damagefactor "ChexWarrior", 0.0
	Damagefactor "ChexWarriorChainsaw", 0.0
	Damagefactor "UnmakerLaser", 0.0
    States
    {
    Spawn:
	    DRON A 0 A_Playsound("STTELEPT")
		DRON A 1 A_SpawnItemEx("SentinelSpawnerPoof",0,0,0,0,0,0,0,0)
        DRON A 3 bright A_Look
		DRON A 0 bright A_playsoundEx("drone/idle","Soundslot5",1)
        Goto See
    See:
        DRON AAA 1 bright A_Chase
        Loop
    Missile:
        DRON A 1 bright A_Jump(256,"MissileLoop1","MissileLoop2","MissileLoop3")
	MissileLoop1:
		DRON D 0 Bright A_Playsound("DRONFIRE")
        DRON D 0 bright A_CustomMissile("TieFighterShot",-12,-6)
		DRON D 0 bright A_CustomMissile("TieFighterShot",-12,6)
		DRON B 2 bright A_FaceTarget
    	DRON C 2 bright A_FaceTarget
		DRON D 2 bright A_FaceTarget
		Goto See
	MissileLoop2:
		DRON D 0 Bright A_Playsound("DRONFIRE")
        DRON D 0 bright A_CustomMissile("TieFighterShot",-12,-12)
		DRON D 0 bright A_CustomMissile("TieFighterShot",-12,12)
		DRON B 2 bright A_FaceTarget
    	DRON C 2 bright A_FaceTarget
		DRON D 2 bright A_FaceTarget
		DRON D 0 Bright A_Playsound("DRONFIRE")
        DRON D 0 bright A_CustomMissile("TieFighterShot",-12,-12)
		DRON D 0 bright A_CustomMissile("TieFighterShot",-12,12)
		DRON B 2 bright A_FaceTarget
    	DRON C 2 bright A_FaceTarget
		DRON D 2 bright A_FaceTarget
		Goto See
	MissileLoop3:
		DRON D 0 Bright A_Playsound("DRONFIRE")
        DRON D 0 bright A_CustomMissile("TieFighterShot",-12,-12)
		DRON D 0 bright A_CustomMissile("TieFighterShot",-12,12)
		DRON B 2 bright A_FaceTarget
    	DRON C 2 bright A_FaceTarget
		DRON D 2 bright A_FaceTarget
		DRON D 0 Bright A_Playsound("DRONFIRE")
        DRON D 0 bright A_CustomMissile("TieFighterShot",-12,-12)
		DRON D 0 bright A_CustomMissile("TieFighterShot",-12,12)
		DRON B 2 bright A_FaceTarget
    	DRON C 2 bright A_FaceTarget
		DRON D 2 bright A_FaceTarget
		DRON D 0 Bright A_Playsound("DRONFIRE")
		DRON D 0 bright A_CustomMissile("TieFighterShot",-12,-12)
		DRON D 0 bright A_CustomMissile("TieFighterShot",-12,12)
		DRON B 2 bright A_FaceTarget
    	DRON C 2 bright A_FaceTarget
		DRON D 2 bright A_FaceTarget
		Goto See
    Pain:
        DRON A 3 bright A_Pain
        Goto See
    Death:
		TNT1 A 0 A_GiveToTarget("HitBeep",1)
	    DRON E 0 Bright A_StopSoundEx ("SoundSlot5")
        DRON E 0 bright A_NoBlocking
		DRON E 0 bright A_NoGravity
		DRON E 0 bright A_Scream
		DRON E 6 bright A_SetTranslucent(1.0,0)
		DRON F 6 bright A_SetTranslucent(0.9,0)
		DRON G 6 bright A_SetTranslucent(0.8,0)
		DRON H 6 bright A_SetTranslucent(0.7,0)
		DRON I 6 bright A_SetTranslucent(0.6,0)
		DRON J 6 bright A_SetTranslucent(0.5,0)
		DRON K 6 bright A_SetTranslucent(0.4,0)
        NULL A -1
        Stop
	Pain.FrostbiteWind:
	Pain.Ravager:
	Pain.Juglava:
	Pain.HarvesterRock:
	Pain.EmtalicSaw:
	Pain.MorphRipper:
	Pain.MorphRipperGib:
	Pain.I1:
	Pain.I3:
	Pain.ZombiePoison:
	Pain.JusticarSpike:
	Pain.Asylum:
	Pain.AsylumCannonBall:
	Pain.FleshlingMissile:
	Pain.DarkVortex:
	Pain.ImpostorJitter:
	Pain.BlueFire:
	Pain.PuppetStrings:
	Pain.LichFire:
	Pain.LichIce:
	Pain.LichLightning:
	Pain.Whiteface:
		TNT1 A 0 A_GiveToTarget("HitBeep",1)
		Goto Pain
    }
}

actor TieFighterShot : SerpentFX
{
  Speed 26
  Damage (3)
  Damagetype "Sentinel"
  Scale 0.9
  States
  {
  Spawn:
    DRFX ABAB 1 bright A_SpawnItemEx("DronePlasmaTrail")
    Goto Spawn
  Death:
    DRFX CDEFGH 4 bright A_Playweaponsound("Sentinel/Pewpoof")
    Stop
  }

}

ACTOR DronePlasmaTrail
{
  RenderStyle Translucent
  Alpha 0.75
  Scale 0.9
  +NOBLOCKMAP
  +NOGRAVITY
  +NOCLIP
  +DONTSPLASH
  +NOTELEPORT
  +CLIENTSIDEONLY
  States
  {
  Spawn:
    DRFX A 0
	DRFX A 1 A_SetTranslucent(0.70, 1)
	DRFX B 1 A_SetTranslucent(0.65, 1)
	DRFX A 1 A_SetTranslucent(0.60, 1)
	DRFX B 1 A_SetTranslucent(0.55, 1)
	DRFX A 1 A_SetTranslucent(0.50, 1)
	DRFX B 1 A_SetTranslucent(0.45, 1)
	DRFX A 1 A_SetTranslucent(0.40, 1)
	DRFX B 1 A_SetTranslucent(0.35, 1)
	DRFX A 1 A_SetTranslucent(0.20, 1)
	DRFX B 1 A_SetTranslucent(0.15, 1)
	DRFX A 1 A_SetTranslucent(0.10, 1)
	DRFX B 1 A_SetTranslucent(0.05, 1)
    Stop
  }
}
	
Actor TieFighterAmmo : CustomInventory
{
	Inventory.Amount 2
	Inventory.MaxAmount 2
	+INVENTORY.UNDROPPABLE
	+INVBAR
	States
	{
	Spawn:
		TNT1 A 0
		Stop
	Use:
		TNT1 A 0 A_GiveInventory("CyborgDashcheck",1)
		Fail
	}
}

Actor PlasmaAmmoIvy : Ammo
{
	Ammo.BackPackAmount 150
	Ammo.BackPackMaxAmount 150
	Inventory.Amount 150
	Inventory.MaxAmount 150
	Inventory.Icon "PLASCELL"
	+INVENTORY.IGNORESKILL
	States
	{
	Spawn:
		TNT1 A -1
		Stop
	}
}

ACTOR IvyPlasma : fastprojectile
{
   Radius 10
   Height 10
   Speed 100
   Damage (9)
   Damagetype "Plasma"
   Missiletype "IvyXTrail1"
   SeeSound "PlasmaShot"
   DeathSound "Weapons/PlasmaX"
   Obituary "%o got deleted by %k."
   Scale 1.0
   PROJECTILE
   RenderStyle Add
   States
   {
   Spawn:
	 TNT1 A 1 
	 TNT1 A 0 A_PlaySound("GwenPlasma/whiz")
     loop
   XDeath:
      TNT1 A 0 A_GiveToTarget("HitBeep",1)
	  Goto Death
   Death:
      TNT1 A 1 bright
      Stop
   }
}

ACTOR IvyXTrail1
{
	+NOINTERACTION
	+CLIENTSIDEONLY
	Radius 4
	Height 4
	scale 1.6
	Renderstyle Add
	Alpha 1.0
	States
	{
	Spawn:
		YSHT ABCDEFG 1 BRIGHT
		Stop
	}
}

Actor PlasmaTrail
{
	RenderStyle Add
	Alpha 0.7
	Scale 0.1
	
	+NOGRAVITY
	+NOBLOCKMAP
	-SHOOTABLE
	-SOLID
	+CLIENTSIDEONLY
	States
	{
	Spawn:
		IVPL AB 3 bright A_FadeOut(0.1)
		Loop
	Death:
		TNT1 A 0
		Stop
	}
}

Actor IvyDispersionAmmo : Ammo
{
	Ammo.BackPackAmount 10
	Ammo.BackPackMaxAmount 10
	Inventory.Amount 10
	Inventory.MaxAmount 10
	+INVENTORY.IGNORESKILL
	States
	{
	Spawn:
		TNT1 A -1
		Stop
	}
}