//Table of contents:
/*
-Class Token
-Player Pawn
-Xdeath Body projectile
-Xdeath body playing russian roulette
-Weapon Base
*/

Actor IsPico : ClassToken {}

Actor Pico : PlayerPawn 
{
		Player.ScoreIcon "PICOICON"
		Speed 1
	    Health 100
		Radius 16
		Height 56
		Mass 100
		scale 0.65
		PainChance 255
		Player.MaxHealth 100
		DamageFactor "PicoImmunetothis", 0 //Gross hack for an explosion but it will do
        Player.DisplayName "Pico"
        Player.Face "PIO"
		Species "Player"
		Player.SoundClass "Pico"
		Player.ColorRange 112, 127
			//Colors variants i wanted to implement to the characters but wasn't possible.
			//OTIS "113:113=199:199", "118:118=204:204", "216:216=6:6", "162:162=196:196", "181:181=91:91", "84:84=231:231"
			//Sweat Shop Pico "52:52=216:216", "216:216=0:0"
			//PICONJO "113:113=253:253", "118:118=254:254", "216:216=222:222", "162:162=244:244", "181:181=6:6", "84:84=252:252", "52:52=89:89"
		//For ACS functions and all
		Player.Startitem "IsPico",1
		Player.Startitem "IsPlayer",1
		//Player.StartItem "DefaultMisc", 1
		Player.StartItem "CustomAmmo", 1
		Player.StartItem "PicoMeterCountdown", 245
		Player.StartItem "hatCharacterOffset", 90
		Player.StartItem "SpecialOnHit",1
        //LOADOUT
        Player.StartItem "PicoRifle" 
		Player.StartItem "PicoPencil" 
		Player.Startitem "PicoRifleMag",20
		Player.Startitem "PicoRifleAmmount", 50
		Player.WeaponSlot 1, "PicoPencil", "PicoCanister"
        Player.WeaponSlot 2, "PicoRifle"
		Player.WeaponSlot 3, "PicoAerosol", "PicoShotgun"
		Player.WeaponSlot 4, "Pico2Uzi"
		Player.WeaponSlot 5, "PicoDiskJupiter"
		Player.WeaponSlot 6, "PicoKnifes"
		Player.WeaponSlot 7, "PicoUNDYINGPENLINIANHEAD"
        //End of loadout
		
		States
		{
			Spawn:
				PICO A -1
				Loop
			See:
				PICO AAAABBBBCCCCAAAAJJJJIIII 1 
				Loop
			Missile:
				PICO DDDDDD 1
				Goto Spawn
			Melee:
				PICO EEE 1 BRIGHT
				Goto Missile
			Pain:
				PICO FFFFFFFF 1 
				Goto Spawn
			Death:
				PICO A 0 A_PlayerSkinCheck("AltSkinDeath")
			Death1:
				PICD AB 10 
				PICD C 10 A_NoBlocking
				PICD D 10
				PICD EF 4
			DeathLoop:
				PICD GH 4  
				Loop
			XDeath:
				PIXD A 0 A_PlayerSkinCheck("AltSkinXDeath")
			XDeath1:
				PICO F 5
				TNT1 A 0 A_NoBlocking
				TNT1 A 0 A_spawnitemex("PicoXdeathBody",-2,0,0,-5,0,5,0,SXF_TRANSFERTRANSLATION)
				PICO H 40
				PCLD AB 10
				PCLD C -1
				Stop
			AltSkinDeath:
				PLAY H 6
				PLAY I 6 
				PLAY JK 6
				PLAY L 6 A_NoBlocking
				PLAY MNO 6
				PLAY P -1
				Stop
			AltSkinXDeath:
				PLAY Q 5 
				PLAY R 0 A_NoBlocking
				PLAY R 5 A_SkullPop
				PLAY STUVWX 5
				PLAY Y -1
				Stop
			
		}
}


Actor PicoXdeathBody
{
   Projectile
   
   
   -NOGRAVITY
   +MOVEWITHSECTOR
   Species "Player"
   States
   {
    Spawn:
		PIXD B 2
		Loop
	Death:
		TNT1 A 0 A_SpawnItemEx("PicoXdeath",0,0,0,0,0,0,0,SXF_TRANSFERTRANSLATION)
		Stop	  
	}

}

Actor PicoXdeath
{
	Scale 0.5
	States
	{
    Spawn:
		PIXD C 20 NODELAY
		PIXD D 10
		PIXD E 20
		PIXD F 10
		PIXD GHGHGHGHGHGHGH 2
		PIXD J 20 
		PIXD K 20 
		PIXD L 20 A_playsound("PicoRevolver/Load",4)
		TNT1 A 0 A_Jump (127, "Lucky")
		TNT1 A 0 A_playsound("PicoRevolver/Fire",4)
		PIXD MN 2
		PIXD O -1
		STOP
	Lucky:
		PIXD L 20 A_Playsound("PicoRevolver/click",4)
		PIXD K 40
		PIXD J 20 
		PIXD L 20 A_playsound("PicoRevolver/Load",4)
		TNT1 A 0 A_Jump (127, "VeryLucky")
		goto spawn+22
	VeryLucky:
		PIXD L 20 A_Playsound("PicoRevolver/click",4)
		PIXD K 40
		PIXD J 20
		PIXD C -1
		Stop
	}

}

Actor PicoWeapBase : Weapon
{
	Inventory.RestrictedTo "Pico"
	+Weapon.ammo_optional
	+Weapon.NOALERT
	+INVENTORY.UNTOSSABLE

}
