if not srb2p return end

freeslot("sfx_rsum1", "sfx_rsum2", "sfx_rsum3", "sfx_rsum4", "sfx_rhrt1", "sfx_rhrt2", "sfx_rhrt3", "sfx_rhrt4", "sfx_rhrt5", "sfx_rhrt6", "sfx_rhrt7", "sfx_rhrt8",
"sfx_rhtx1", "sfx_rhtx2", "sfx_rhtx3", "sfx_rhtx4", "sfx_rhtx5", "sfx_rhtx6", "sfx_rhel1", "sfx_rhel2", "sfx_rhel3", "sfx_rhel1", "sfx_rhel2", "sfx_rhel3", "sfx_rkil1", "sfx_rkil2", "sfx_rkil3", "sfx_rkil4",
"sfx_raoi1", "sfx_raoi2", "sfx_raoa1", "sfx_raor1", "sfx_raor2", "sfx_rmis1", "sfx_rmis2", "sfx_rmis3", "sfx_rdge1", "sfx_rdge2", "sfx_rdge3", "sfx_rdge4",
"sfx_rwin1", "sfx_rwin2", "sfx_rwin3", "sfx_rwin4", "sfx_rwin5", "sfx_rlvl1", "sfx_rlvl2", "sfx_rlvl3")

charStats["ruby"] = {   

  
		-- GENERAL

		name = "Ruby",		-- This is only for bots / enemies
		basehp = 60,			-- base HP for level 1 (Cannot be <= 0)
		basesp = 70,			-- base SP for level 1 (Can be 0, but not < 0!)
		persona = "rubyspersona",		-- Persona to use
		melee_natk = "ruby_atk", -- normal melee attack

		-- Normal attack attributes
		-- Scales with game difficulty
		atk = 35,	-- power (generally < 50)
		acc = 95,	-- accuracy (%)
		crit = 50,	-- crit rate (%)
		
		wep = "r_fists_01",
		weptype = WPT_KNUCKLES,
		-- Note: As of Beta 1.0.0, not all animations are implemented
		-- (* = unimplemented)

		anim_stand = 		{SPR_PLAY, A, 15, "SPR2_STND"},			-- standing
		anim_stand_hurt =	{SPR_PLAY, A, 4, "SPR2_STND"},			-- standing (low HP) *
		anim_stand_bored =	{SPR_PLAY, A, B, C, D, 15, "SPR2_WALK"},			-- standing (occasionally plays after anim_stand has played several times)
		anim_guard = 		{SPR_PLAY, A, 1, "SPR2_STND"},			-- guarding
		anim_move =			{SPR_PLAY, A, B, C, D, 5, "SPR2_WALK"},		-- moving
		anim_run =			{SPR_PLAY, A, B, 3, "SPR2_RUN"},		-- guess what
		anim_atk =			{SPR_PLAY, A, B, C, D, 4, "SPR2_ROLL"},		-- attacking
		anim_aoa_end =		{SPR_PLAY, A, B, C, D, 4, "SPR2_ROLL"},			-- jumping out of all-out attack
		anim_hurt =			{SPR_PLAY, A, 6, "SPR2_PAIN"},			-- taking damage
		anim_getdown =		{SPR_PLAY, A, 6, "SPR2_PAIN"},			-- knocked down from weakness / crit *
		anim_downloop =		{SPR_PLAY, A, 5, "SPR2_PAIN"},			-- is down
		anim_getup =		{SPR_PLAY, A, 5, "SPR2_FALL"},			-- gets up from down
		anim_death =		{SPR_PLAY, A, 30, "SPR2_DEAD"},			-- dies
		anim_revive =		{SPR_PLAY, A, 10, "SPR2_STND"},			-- gets revived
        anim_evoker = 		{SPR_PLAY, A, 8, "SPR2_PNCH"},			-- 
		-- anim_special1 through anim_special32 may also be used for various purposes (ie: attack animations)
		-- HUD DEFINTIIONS
		vfx_summon = {"sfx_rsum1", "sfx_rsum2", "sfx_rsum3", "sfx_rsum4"},
		vfx_skill = {},
		vfx_item = {},
		vfx_hurt = {"sfx_rhrt1", "sfx_rhrt2", "sfx_rhrt3", "sfx_rhrt4", "sfx_rhrt5", "sfx_rhrt6", "sfx_rhrt7", "sfx_rhrt8"}, 
		vfx_hurtx = {"sfx_rhtx1", "sfx_rhtx2", "sfx_rhtx3", "sfx_rhtx4", "sfx_rhtx5", "sfx_rhtx6"},
		vfx_die = {},
		vfx_heal = {"sfx_rhel1", "sfx_rhel2", "sfx_rhel3"},
		vfx_healself = {"sfx_rhel1"},
		vfx_1more = {},
		vfx_crit = {},
		vfx_kill = {"sfx_rkil1", "sfx_rkil2", "sfx_rkil3", "sfx_rkil4"},
		vfx_aoaask = {"sfx_raoi1", "sfx_raoi2"},
		vfx_aoado = {"sfx_raoa1"},
		vfx_aoarelent = {"sfx_raor1", "sfx_raor2"},
		vfx_miss = {"sfx_rmis1", "sfx_rmis2", "sfx_rmis3"},
		vfx_dodge = {"sfx_rdge1", "sfx_rdge2", "sfx_rdge3", "sfx_rdge4"},
		vfx_win = {"sfx_rwin1", "sfx_rwin2", "sfx_rwin3", "sfx_rwin4", "sfx_rwin5"},
		vfx_levelup = {"sfx_rlvl1", "sfx_rlvl2", "sfx_rlvl3"},
        


		icon = "ICO_RUBY",
		hudbust = "H_RUBY",	
		hudaoa = "RUBY_AOA",
		aoa_quote = "Kill Kill Kill Kill Kill",
		hudcutin = "RUBY_A",
		hudspr = "",
		tip = "Ruby is an all-round buffer with Elec skills and a reliably high accuracy. He has a lot of HP and SP so don't be afraid to go all out!"

}
         
personaList["rubyspersona"] = {
		-- GENERAL
		name = "None",
		arcana = ARCANA_MAGICIAN,

		-- STATS (@ lv10)

		sprite = SPR_NULL,
		anim_idle = 	{SPR_NULL, A},
		anim_atk = 		{SPR_NULL, A},
		startframe = 0,

		strength = 6,
		magic = 12,
		endurance = 10,
		luck = 4,
		agility = 6,
		weak = ATK_ELEC,
		resist = ATK_FIRE|ATK_STRIKE,
		skills = {
					{"lunge", 1},{"sonic punch", 18, "lunge"},{"assault dive", 25, "sonic punch"},{"gigantic fist", 48, "assault dive"},
					{"zio", 3},{"zionga", 21, "zio"},{"ziodyne", 52, "zionga"},{"thunder reign", 85, "ziodyne"},
					{"mazio", 15},{"mazionga", 37, "mazio"},{"maziodyne", 63, "mazionga"},
					{"dia", 7},{"diarama", 23, "dia"},{"diarahan", 58, "diarama"},
					{"tarukaja", 11},{"matarukaja", 38, "tarukaja"},
					{"makakaja", 5},{"mamakakaja", 38, "makakaja"},
					{"rakukaja", 12},{"marakukaja", 38, "rakukaja"},
					{"sukukaja", 14},{"masukukaja", 38, "sukukaja"}
		}
}

attackDefs["ruby_atk"] = {
		name = "Punch",
		type = ATK_STRIKE,
		power = 35,
		accuracy = 85,
		critical = 7, -- was 7
		target = TGT_ENEMY,
		cost = CST_HP,
		cost = 0,
		desc = "yep its a punch alright",
		anim_norepel = true,	-- do not bounce back our ANIMATION
		physical = true,	-- don't play the summoning anim for phys attacks, duh
		anim = 	function(mo, targets, hittargets, timer)
					local target = targets[1]
					local atarget = hittargets[1]
					if timer == 1
						ANIM_set(mo, mo.anim_run, true)
						mo.reachedtarget = false	-- yeah we can use variables here that you like it or not :^)
						
						mo.stx = mo.x
						mo.sty = mo.y
						mo.stz = mo.z
						S_StartSound(mo, sfx_zoom)
						//mo.momz = 5*FRACUNIT
						mo.angle = R_PointToAngle2(mo.x, mo.y, target.x, target.y)
						mo.stsp = R_PointToDist2(mo.x, mo.y, target.x, target.y)/30
						P_InstaThrust(mo, mo.angle, mo.stsp)
						mo.atktimer = 0
					elseif not mo.reachedtarget
						P_InstaThrust(mo, mo.angle, mo.stsp)
						
						if R_PointToDist2(mo.x, mo.y, target.x, target.y) < mo.stsp+FRACUNIT
							//mo.momz = 10*FRACUNIT
							mo.reachedtarget = true
							ANIM_set(mo, mo.anim_evoker, true)
							damageObject(atarget)
							localquake(mo.battlen, FRACUNIT*7, 4)
							playSound(mo.battlen, sfx_phys)
							mo.hittarget = true
							
							mo.atktimer = 1
							
							P_InstaThrust(mo, mo.angle, 0)
						end
					elseif mo.atktimer < 10
						ANIM_set(mo, mo.anim_evoker, true)
						mo.atktimer = $ + 1
					elseif mo.atktimer == 10
						mo.atktimer = $ + 1
						mo.stsp = R_PointToDist2(mo.x, mo.y, mo.stx, mo.sty)/30
						mo.angle = R_PointToAngle2(mo.x, mo.y, mo.stx, mo.sty)
						P_InstaThrust(mo, mo.angle, mo.stsp)
						ANIM_set(mo, mo.anim_run, true)
					elseif R_PointToDist2(mo.x, mo.y, mo.stx, mo.sty) > mo.stsp+FRACUNIT
						P_InstaThrust(mo, mo.angle, mo.stsp)
					else
						mo.reachedtarget = nil
						mo.stx = nil
						mo.sty = nil
						mo.stz = nil
						return true
					end
				end
	}