if not srb2p return end

charStats["rafael"] = {
	name = "Rafael",
	basehp = 50,
	basesp = 45,
	persona = "rafael",
	melee_natk = "rafael_atk1",

	atk = 60,
	acc = 95,
	crit = 12,

	anim_stand = 		{SPR_PLAY, A, 8, "SPR2_STND"},
	anim_stand_hurt =	{SPR_PLAY, A, 1, "SPR2_STND"},
	anim_stand_bored =	{SPR_PLAY, A, 8, "SPR2_STND"},
	anim_guard = 		{SPR_PLAY, A, 1, "SPR2_GARD"},
	anim_move =			{SPR_PLAY, A, B, C, D, E, F, 2, "SPR2_WALK"},
	anim_run =			{SPR_PLAY, A, B, C, D, 2, "SPR2_RUN_"},
	anim_atk =			{SPR_PLAY, A, B, C, D, 2, "SPR2_ROLL"},
	anim_aoa_end =		{SPR_PLAY, D, C, B, A, 2, "SPR2_ROLL"},
	anim_hurt =			{SPR_PLAY, A, 35, "SPR2_PAIN"},
	anim_getdown =		{SPR_PLAY, A, 1, "SPR2_DOWN"},
	anim_downloop =		{SPR_PLAY, A, 1, "SPR2_DOWN"},
	anim_getup =		{SPR_PLAY, A, B, C, D, 1, "SPR2_ROLL"},
	anim_death =		{SPR_PLAY, A, 30, "SPR2_DEAD"},
	anim_revive =		{SPR_PLAY, A, B, C, D, 1, "SPR2_ROLL"},
	anim_special1 =		{SPR_PLAY, A, TICRATE, "SPR2_FALL"},
	anim_evoker =		{SPR_PLAY, A, 2, "SPR2_PSON"},
	anim_evoker_shoot = 	{SPR_PLAY, A, B, C, D, 2, "SPR2_PSON"},

	-- VOICES

	vfx_summon = {"sfx_rfsum1", "sfx_rfsum2", "sfx_rfsum3", "sfx_rfcrt1"},
	vfx_skill = {"sfx_rfskl1"},
	vfx_item = {"sfx_rfuse1"},
	vfx_hurt = {"sfx_rfhrt1", "sfx_rfhrt2"},
	vfx_hurtx = {"sfx_rfhtx1"},
	vfx_die = {"sfx_rfdie1"},
	vfx_heal = {"sfx_rfhl1", "sfx_rfhl2"},
	vfx_healself = {"sfx_rfhl1", "sfx_rfhl2"},
	vfx_kill = {"sfx_rfskl1", "sfx_rfskl2"},
	vfx_1more = {"sfx_rfwin2", "sfx_rfwin3"},
	vfx_crit = {"sfx_rfsum2", "sfx_rfcrt1"},
	vfx_aoaask = {"sfx_rfaoa1"},
	vfx_aoado = {"sfx_rfsum3"},
	vfx_aoarelent = {"sfx_rfmis2", "sfx_rfmis3"},
	vfx_miss = {"sfx_rfmis1", "sfx_rfmis2", "sfx_rfmis3"},
	vfx_dodge = {"sfx_rfdge1"},
	vfx_win = {"sfx_rfwin1", "sfx_rfwin2", "sfx_rfwin3", "sfx_rfwin4"},
	vfx_levelup = {"sfx_rflvl1", "sfx_rfuse1"},

	icon = "ICO_RAFA",
	hudbust = "RAFA_H",
	hudaoa = "H_RAFAOA",
	aoa_quote = "Your free trial of life ends now.",
	hudcutin = "RAFA_A",

	tip = "A powerful magic DPS with great magic and agility but poor endurance. Learns Ice, Curse and Strike skills, but has low HP.",
}

personaList["rafael"] = {
	name = "Penthesilea",
	arcana = ARCANA_LOVERS,

	sprite = SPR_PSN6,
	anim_idle = 	{SPR_PSN6, A, B, 16},
	anim_atk = 		{SPR_PSN6, C, D, E, F, G, H, I, J, J, J, J, J, J, J, J, J, J, J, 3},
	startframe = 0,

	strength = 6,
	magic = 10,
	endurance = 6,
	luck = 8,
	agility = 9,
	weak = ATK_FIRE,
	resist = ATK_ICE|ATK_SLASH,
	skills = {
		{"bufu", 1}, {"eiha", 4},
		{"lunge", 9}, {"mabufu", 12},
		{"maeiha", 15}, {"bufula", 19, "bufu"},
		{"makakaja", 21}, {"eiga", 25}, {"sonic punch", 28, "lunge"},
		{"ice boost", 30}, {"assault dive", 32, "sonic punch"}, {"mabufula", 34, "mabufu"},
		{"maeiga", 37, "maeiha"}, {"bufudyne", 41, "bufula"}, {"eigaon", 43, "eiga"},
		{"mamakakaja", 47, "makakaja"}, {"gigantic fist", 50, "assault dive"}, {"mind charge", 55},
		{"ice amp", 59, "ice boost"}, {"megaton raid", 63, "gigantic fist"}, {"mabufudyne", 67, "mabufula"},
		{"maeigaon", 70, "maeiga"}, {"niflheim", 75, "bufudyne"}
	}
}

attackDefs["rafael_atk1"] = {
	name = "Homing Thok",
	type = ATK_PIERCE,
	power = 50,
	accuracy = 95,
	costtype = CST_HP,
	cost = 0,
	critical = 12,
	physical = true,
	anim_norepel = true,
	desc = "Basic pierce attack that\ndeals damage.",
	target = TGT_ENEMY,
	norandom = true,
	norogue = true,
	anim = function(mo, targets, hittargets, timer)
		local target = hittargets[1]

		if timer == 1 then
			local an = target.angle + ANG60
			local cx = target.x + 480*cos(an)
			local cy = target.y + 480*sin(an)
			CAM_goto(server.P_BattleStatus[mo.battlen].cam, cx, cy, server.P_BattleStatus[mo.battlen].cam.z, 70*FRACUNIT)
			CAM_angle(server.P_BattleStatus[mo.battlen].cam, R_PointToAngle2(cx, cy, target.x, target.y), ANG1*4)
		end

		if mo.closeto then
			mo.closeto = $-1
			mo.angle = R_PointToAngle2(mo.x, mo.y, target.x, target.y)

			if mo.closeto == 53 then
				ANIM_set(mo, mo.anim_atk)
				P_SetObjectMomZ(mo, 10*FRACUNIT)
				P_Thrust(mo, mo.angle, FRACUNIT)

				playSound(mo.battlen, sfx_jump)
			end

			if mo.closeto == 35 then
				playSound(mo.battlen, sfx_thok)
				playSound(mo.battlen, sfx_slash)
				P_TeleportMove(mo, target.x, target.y, target.z+target.height)
				P_InstaThrust(mo, mo.angle, -5*FRACUNIT)
				P_SetObjectMomZ(mo, 5*FRACUNIT)
				ANIM_set(mo, mo.anim_special1)

				damageObject(target)
				if not target.plyr then createSplat(mo) end
			end

			if mo.closeto <= 0 then
				mo.closeto = nil
				return true
			end
		else
			ANIM_set(mo, mo.anim_run)
			mo.angle = R_PointToAngle2(mo.x, mo.y, target.x, target.y)
			P_InstaThrust(mo, mo.angle, 35*FRACUNIT)

			local dist = R_PointToDist2(mo.x, mo.y, target.x, target.y)
			if dist <= 150*FRACUNIT then
				ANIM_set(mo, mo.anim_stand)
				P_InstaThrust(mo, mo.angle, 0)
				mo.closeto = 55
			end
		end
	end,
}