ACTOR TomeSpawner : RandomSpawner replaces Gauntlets
{
	DropItem "SkullfireBringer" 255 2
	DropItem "FrostbiteBringer" 255 2
	DropItem "GumpopBringer" 255 3
	DropItem "ThunderBringer" 255 2
	DropItem "ThreadcutterBringer" 255 2
	DropItem "SkypunchBringer" 255 2
	DropItem "CrowsBringer" 255 2
	DropItem "BreathBringer" 255 1
	DropItem "CorpseBringer" 255 2
	DropItem "AnnihilationBringer" 255 1
}

ACTOR TomeBasis : Inventory
{
	Inventory.PickupSound "Tome/Pickup"
	Inventory.MaxAmount 1
	+FLOATBOB
	//+INVBAR
}

ACTOR TomeBringer : CustomInventory
{
	Inventory.MaxAmount 0
	Inventory.PickupSound "Tome/Pickup"
	+FLOATBOB
	+INVENTORY.AUTOACTIVATE
	+COUNTITEM
	States
	{
	Spawn:
	TNT1 A 0
	Stop
	}
}

ACTOR TomeFade
{
	+NOINTERACTION
	+NOGRAVITY
	Renderstyle Add
	States
	{
	Spawn:
	BOOK Z 1 A_FadeOut(0.25)
	BOOK Z 0 A_SetScale(ScaleX+0.05,ScaleX)
	Loop
	}
}

//Firebreath
ACTOR FirebreathBringer : TomeBringer
{
	Inventory.PickupMessage "You just obtained the power to breathe fire!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleOrange",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK K 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	Pickup:
	TNT1 A 0 A_JumpIfInventory("FirebreathTome",1,"Dosh")
	TNT1 A 0 A_GiveInventory("FirebreathTome",1)
	Stop
	Dosh:
	TNT1 A 0 A_GiveInventory("Dosh",600)
	Stop
	}
}

ACTOR FirebreathTome : TomeBasis
{
	Inventory.PickupMessage "You just obtained the power to breathe fire!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleOrange",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK K 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	}
}

//Skullfire
ACTOR SkullfireBringer : TomeBringer
{
	Inventory.PickupMessage "You just obtained the power of casting Skullfire!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleOrange",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK A 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	Pickup:
	TNT1 A 0 A_JumpIfInventory("SkullfireTome",1,"Dosh")
	TNT1 A 0 A_GiveInventory("SkullfireTome",1)
	Stop
	Dosh:
	TNT1 A 0 A_GiveInventory("Dosh",450)
	Stop
	}
}

ACTOR SkullfireTome : TomeBasis
{
	Inventory.PickupMessage "You just obtained the power of casting Skullfire!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleOrange",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK A 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	}
}

//Frostbite
ACTOR FrostbiteBringer : TomeBringer
{
	Inventory.PickupMessage "You just obtained the power of casting Frostbite!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleCyan",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK B 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	Pickup:
	TNT1 A 0 A_JumpIfInventory("FrostbiteTome",1,"Dosh")
	TNT1 A 0 A_GiveInventory("FrostbiteTome",1)
	Stop
	Dosh:
	TNT1 A 0 A_GiveInventory("Dosh",500)
	Stop
	}
}

ACTOR FrostbiteTome : TomeBasis
{
	Inventory.PickupMessage "You just obtained the power of casting Frostbite!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleCyan",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK B 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	}
}

//Gumpop
ACTOR GumpopBringer : TomeBringer
{
	Inventory.PickupMessage "You just obtained the power of casting Gumpop!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleGreen",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK C 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	Pickup:
	TNT1 A 0 A_JumpIfInventory("GumpopTome",1,"Dosh")
	TNT1 A 0 A_GiveInventory("GumpopTome",1)
	Stop
	Dosh:
	TNT1 A 0 A_GiveInventory("Dosh",300)
	Stop
	}
}

ACTOR GumpopTome : TomeBasis
{
	Inventory.PickupMessage "You just obtained the power of casting Gumpop!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleGreen",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK C 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	}
}

//Thunderstruck
ACTOR ThunderBringer : TomeBringer
{
	Inventory.PickupMessage "You just obtained the power of casting Thunderstruck!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleYellow",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK D 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	Pickup:
	TNT1 A 0 A_JumpIfInventory("ThunderTome",1,"Dosh")
	TNT1 A 0 A_GiveInventory("ThunderTome",1)
	Stop
	Dosh:
	TNT1 A 0 A_GiveInventory("Dosh",875)
	Stop
	}
}

ACTOR ThunderTome : TomeBasis
{
	Inventory.PickupMessage "You just obtained the power of casting Thunderstruck!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleYellow",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK D 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	}
}

//Threadcutter
ACTOR ThreadcutterBringer : TomeBringer
{
	Inventory.PickupMessage "You just obtained the power of casting Threadcutter!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleKnives",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK E 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	Pickup:
	TNT1 A 0 A_JumpIfInventory("ThreadcutterTome",1,"Dosh")
	TNT1 A 0 A_GiveInventory("ThreadcutterTome",1)
	Stop
	Dosh:
	TNT1 A 0 A_GiveInventory("Dosh",750)
	Stop
	}
}

ACTOR ThreadcutterTome : TomeBasis
{
	Inventory.PickupMessage "You just obtained the power of casting Threadcutter!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleKnives",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK E 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	}
}

//Skypunch
ACTOR SkypunchBringer : TomeBringer
{
	Inventory.PickupMessage "You just obtained the power of casting Skypunch!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleCyan",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK F 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	Pickup:
	TNT1 A 0 A_JumpIfInventory("SkypunchTome",1,"Dosh")
	TNT1 A 0 A_GiveInventory("SkypunchTome",1)
	Stop
	Dosh:
	TNT1 A 0 A_GiveInventory("Dosh",750)
	Stop
	}
}

ACTOR SkypunchTome : TomeBasis
{
	Inventory.PickupMessage "You just obtained the power of casting Skypunch!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleCyan",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK F 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	}
}

//Crows
ACTOR CrowsBringer : TomeBringer
{
	Inventory.PickupMessage "You just obtained the power of casting Hitchcock's Birds!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleRed",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK G 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	Pickup:
	TNT1 A 0 A_JumpIfInventory("CrowsTome",1,"Dosh")
	TNT1 A 0 A_GiveInventory("CrowsTome",1)
	Stop
	Dosh:
	TNT1 A 0 A_GiveInventory("Dosh",1000)
	Stop
	}
}

ACTOR CrowsTome : TomeBasis
{
	Inventory.PickupMessage "You just obtained the power of casting Hitchcock's Birds!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleRed",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK G 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	}
}

//Scourgebreath
ACTOR BreathBringer : TomeBringer
{
	Inventory.PickupMessage "You just obtained the power of casting Scourgebreath!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleRed",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK H 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	Pickup:
	TNT1 A 0 A_JumpIfInventory("BreathTome",1,"Dosh")
	TNT1 A 0 A_GiveInventory("BreathTome",1)
	Stop
	Dosh:
	TNT1 A 0 A_GiveInventory("Dosh",2000)
	Stop
	}
}

ACTOR BreathTome : TomeBasis
{
	Inventory.PickupMessage "You just obtained the power of casting Scourgebreath!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleOrange",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK H 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	}
}

//Corpseblast
ACTOR CorpseBringer : TomeBringer
{
	Inventory.PickupMessage "You just obtained the power of casting Corpseblast!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticlePurple",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK I 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	Pickup:
	TNT1 A 0 A_JumpIfInventory("CorpseTome",1,"Dosh")
	TNT1 A 0 A_GiveInventory("CorpseTome",1)
	Stop
	Dosh:
	TNT1 A 0 A_GiveInventory("Dosh",500)
	Stop
	}
}

ACTOR CorpseTome : TomeBasis
{
	Inventory.PickupMessage "You just obtained the power of casting Corpseblast!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticlePurple",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK I 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	}
}

//Annihilation
ACTOR AnnihilationBringer : TomeBringer
{
	Inventory.PickupMessage "You just obtained the power of casting Annihilation!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleBlue",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK J 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	Pickup:
	TNT1 A 0 A_JumpIfInventory("AnnihilationTome",1,"Dosh")
	TNT1 A 0 A_GiveInventory("AnnihilationTome",1)
	Stop
	Dosh:
	TNT1 A 0 A_GiveInventory("Dosh",4000)
	Stop
	}
}

ACTOR AnnihilationTome : TomeBasis
{
	Inventory.PickupMessage "You just obtained the power of casting Annihilation!"
	States
	{
	Spawn:
	TNT1 AA 0 A_SpawnItemEx("TomeParticleBlue",frandom(15.0,-15.0),frandom(15.0,-15.0),30+frandom(15.0,-15.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	BOOK J 1 Bright A_SpawnItemEx("TomeFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE)
	Loop
	}
}