ACTOR Guncaster : PlayerPawn
{
	Game Heretic
	Health 100
   	player.maxhealth 100
	Radius 16
	Height 56
	Mass 100
	PainChance 255
    player.soundclass "Guncaster"
    player.forwardmove 1.33
	player.sidemove 1.33
	Player.JumpZ 14.0
	Player.GruntSpeed 24.0
	Player.ViewHeight 51
	Player.AttackZOffset 20
	Player.DisplayName "Cygnis"
	Player.Face "DRG"
	Player.ColorRange 209,224
	Player.FlechetteType "CasterPoisonBag"
	Player.SpawnClass Any

	Player.StartItem VisionToggler
	Player.StartItem DynamiteWeapon
	Player.StartItem DynamiteQuickToss
	Player.StartItem FirebreathTome
	Player.StartItem Longhorn
	Player.StartItem LonghornAmmo 20
	Player.StartItem Dergfist
	Player.StartItem Mana 100
	Player.StartItem Dosh 400
	Player.StartItem HammerSpaceCounter 10
	Player.StartItem FirebreathActive

	Player.WeaponSlot 1, "Dergfist"
	Player.WeaponSlot 2, "Longhorn", "Longhorn2"
	Player.WeaponSlot 3, "Strucker", "Ironblast", "Strucker2", "Ironblast2"
	Player.WeaponSlot 4, "Pulverizer", "Pulverizer2"
	Player.WeaponSlot 5, "DynamiteWeapon", "Sovereign", "Sovereign2"
	Player.WeaponSlot 6, "Cauterizer", "Cauterizer2"
	Player.WeaponSlot 7, "Old Dreadful", "Old Dreadful2"
	Player.WeaponSlot 9, "ATotallyUselessSomething"
	
	var int user_spellbuttons[4]; //The quick-selection thingamajib
	var int user_amuletopen;
	
	+THRUSPECIES
	+DONTBLAST
	
	Species "Rrerr"
	
	//General damage types
	DamageFactor "Fire", 0.25 //In case I forget or can't really change some damages
	DamageFactor "Ice", 1.2 //BAAAAD!
	DamageFactor "Falling", 0.0 //Apparently some levels, even if you have falling damage off, are complete dicks, and still make you suffer from that shit. This guy laughs at your smelly falling damage!
	DamageFactor "Fire2", 0.6 //Monsters fire damage.

	//Spell damage types
	DamageFactor "Pound", 0.0 //Hackjob, hackjob everywhere.
	DamageFactor "Crow", 0.0 //That'd be pretty awful to be strucked by your own crows in a middle of a firefight, eh?
	DamageFactor "Fire3", 0.0 //Self fire damage.
	DamageFactor "Sovereign", 0.3 //Did someone say... cannon jumps? Well, not like he needs them... or that they work with such air control... but it's still awesome, hee.
	DamageFactor "Slime", 0.75 //Heavy boots, that is.
	DamageFactor "Flesh", 0.0 //So you don't get exploded by corpse blasts. I know, everything is hacky as shit.
	DamageFactor "Annihilation", 0.0 //I wouldn't have to resolve to that, if silly CMF_TRACKOWNER would actually work!

	//Doom damage types
	DamageFactor "FuckRevenants", 0.5 //What says on the tin!
	DamageFactor "Bueller", 0.85 //Dem hitscanners should DIE.
	
	Player.Colorset 0, "Cygnis", 145, 160, 154
	Player.Colorset 1, "Neymathir", 113, 128, 128
	Player.Colorset 2, "Vermathin", 36, 47, 41
	Player.Colorset 3, "Surtra", 145, 152, 150
	Player.Colorset 4, "Azaron", 209, 218, 215, 225, 240, 185, 200//, 225, 240, 185, 196, 0, 35, 66, 80
	Player.Colorset 5, "Leurith", 0, 15, 0, 225, 240, 66, 79
	Player.Colorset 6, "Blain", 185, 200, 195
	Player.Colorset 7, "Xaeratustra", 169, 176, 173
	
	States
	{
	Spawn:
		CYGG A -1
		Stop
 	 See:
		CYGG A 0 A_JumpIfInventory("PowerBerserkDamage",1,"SeeBerserk") 
		CYGG A 0 A_PlaySound("Guncaster/Move",0,0.3)
		CYGG AB 5
 		CYGG A 0 A_SpawnItemEx("GuncasterStep", 0, 0, 0, 0, 0, -10, 0,0, 0)
		CYGG A 0 A_PlaySound("Guncaster/Move",0,0.3)
		CYGG CD 5
 		CYGG C 0 A_SpawnItemEx("GuncasterStep", 0, 0, 0, 0, 0, -10, 0,0, 0)
		Goto Spawn
	SeeBerserk: 
		CYGG A 0 A_PlaySound("Guncaster/Move",0,0.3)
		CYGG AB 5
 		CYGG A 0 A_SpawnItemEx("BerserkStep", 0, 0, 0, 0, 0, -10, 0,0, 0)
		CYGG A 0 A_PlaySound("Guncaster/Move",0,0.3)
		CYGG CD 5
 		CYGG C 0 A_SpawnItemEx("BerserkStep", 0, 0, 0, 0, 0, -10, 0,0, 0)
		Goto Spawn
	Melee:
		CYGG F 6 Bright
		Goto Missile
	Missile:
		CYGG E 12
		Goto Spawn
	Pain:
		CYGG G 3
		CYGG G 3 A_Pain
		Goto Spawn
	Death:
	AltSkinDeath:
		CYGG H 5
		CYGG I 5 A_PlayerScream
		CYGG J 5 A_NoBlocking
		CYGG K 5
		CYGG L -1
		Stop
	XDeath:
	AltSkinXDeath:
		CYGG H 5
		CYGG I 5 A_PlayerScream
		CYGG J 5 A_NoBlocking
		CYGG K 5
		CYGG L -1
		Stop
	Death.Acid:
		CYGG G 1
		"####" "#" 1 A_Playsound("Gumpop/Expand",5)
		"####" "###################################" 1 A_SetScale(ScaleX+frandom(0.01,0.025))
		"####" "#" 1 A_Playsound("Gumpop/Pop",5)
		TNT1 AAAAAA 0 A_CustomMissile ("CeilBloodLauncherLong", 0, 0, random (0, 360), 2, random (50, 130))
		TNT1 AA 0 A_CustomMissile ("XDeath1", 32, 0, random (0, 360), 2, random (0, 160))
		TNT1 AA 0 A_CustomMissile ("XDeath2", 32, 0, random (0, 360), 2, random (0, 160))
		TNT1 AA 0 A_CustomMissile ("XDeath3", 32, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_CustomMissile ("XDeath4", 32, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAAAAAAA 0 A_CustomMissile ("SuperWallRedBlood", 40, 0, random (0, 360), 2, random (-5, 5))
		TNT1 AAAA 0 A_CustomMissile ("Instestin", 32, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("Brutal_FlyingBlood", 35, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAAAAA 0 A_CustomMissile ("SuperGoreSpawner", 32, 0, random (0, 360), 2, random (50, 130))
		TNT1 A 0 A_ChangeFlag("SOLID", 0)
		TNT1 A 0 A_ChangeFlag("FLOORCLIP", 1)
		XMED ABCDE 5
		Wait
	}
}

actor GuncasterStep
{
PROJECTILE
+NOBLOOD
+DONTBLAST
damage 0
radius 10
deathsound "Guncaster/Step"
States
{
Spawn:
TNT1 A 1
Stop
Death:
TNT1 A 1
Stop
}
}

actor BerserkStep
{
PROJECTILE
+NOBLOOD
+DONTBLAST
damage 0
radius 10
deathsound "Berserk/Step"
States
{
Spawn:
TNT1 A 1
Stop
Death:
TNT1 A 0 A_Quake(1,4,0,128,"none")
TNT1 AAAAAA 0 A_SpawnItemEx("BerserkStep_Effect",frandom(2.0,-2.0),frandom(2.0,-2.0),frandom(2.0,-2.0),frandom(0.2,-0.2),frandom(0.2,-0.2),frandom(0.4,0.1),frandom(0.0,360.0),SXF_CLIENTSIDE,0)
TNT1 A 5
Stop
}
}

actor StompCooldown : Inventory
{
	Inventory.MaxAmount 600
}

actor KickDummyForward : Inventory { Inventory.MaxAmount 1 }
actor KickDummyBackward : Inventory { Inventory.MaxAmount 1 }
actor KickDummyLeft : Inventory { Inventory.MaxAmount 1 }
actor KickDummyRight : Inventory { Inventory.MaxAmount 1 }