-- Persona Support --
if not srb2p return end

-- Stats
charStats["voidy"] = {
	-- GENERAL
	name = "Voidy", -- Only for bots/enemies
	basehp = 70, -- Base HP/SP at level 1
	basesp = 30,
	persona = "seth", -- Determines actual stats
	melee_natk = "voidy_atk1", -- Normal melee attack
	melee_satk = "voidy_atk2",
	wep = "voidy_weapon1", -- Default weapon
	weptype = WPT_CLAWS, -- Equippable weapon type(s)
	atk = 40, -- Attack power of physical attacks
	acc = 90, -- Accuracy of physical attacks
	crit = 5, -- Critical rate of physical attacks
	supercolor_start = SKINCOLOR_ABYSSAL1, -- If Super Form is applicable, will use this flash
	-- ANIMS
	anim_stand = {SPR_PLAY, A, 8, "SPR2_STND"}, -- Standing
	anim_stand_hurt = {SPR_PLAY, A, 1, "SPR2_STND"}, -- Standing (Low HP)
	anim_stand_bored = {SPR_PLAY, A, B, A, B, A, B, A, B, 15, "SPR2_WAIT"}, -- Standing (Rare)
	anim_guard = {SPR_PLAY, C, 1, "SPR2_BNCE"}, -- Guarding
	anim_move = {SPR_PLAY, A, B, C, D, E, F, G, H, 2, "SPR2_WALK"}, -- Moving
	anim_run = {SPR_PLAY, A, B, C, D, E, F, G, H, 2, "SPR2_RUN_"}, -- Running
	anim_atk = {SPR_PLAY, A, B, C, D, 2, "SPR2_ROLL"}, -- Attacking
	anim_aoa_end = {SPR_PLAY, D, C, B, A, 2, "SPR2_ROLL"}, -- Jumping out from All Out Attack
	anim_hurt = {SPR_PLAY, A, 35, "SPR2_PAIN"}, -- Taking damage
	anim_getdown = {SPR_PLAY, A, 1, "SPR2_PAIN"}, -- Knocked down from weakness/crit
	anim_downloop = {SPR_PLAY, A, 1, "SPR2_CNT1"}, -- Is down
	anim_getup = {SPR_PLAY, A, B, C, D, 1, "SPR2_ROLL"}, -- Gets up from down
	anim_death = {SPR_PLAY, A, 30, "SPR2_DEAD"}, -- Dies
	anim_revive = {SPR_PLAY, A, B, C, D, 1, "SPR2_ROLL"}, -- Gets revived
	anim_evoker = {SPR_PLAY, A, 1, "SPR2_FINT"}, -- Uses evoker
	anim_evoker_shoot = {SPR_PLAY, A, B, C, D, E, F, G, 2, "SPR2_TALB"},
	anim_special1 = {SPR_PLAY, A, B, C, 2, "SPR2_MLEE"}, -- Custom stuff. Can have up to 32
	anim_special2 = {SPR_PLAY, D, E, F, 2, "SPR2_MLEE"},
	anim_special3 = {SPR_PLAY, G, H, I, 2, "SPR2_MLEE"},
	anim_special4 = {SPR_PLAY, A, 2, "SPR2_STND"},
	-- SUPER ANIMS
	anim_stand_super = {SPR_PLAY, A, B, C, D, E, F, G, H, 8, "SPR2_STND"},
	anim_guard = {SPR_PLAY, A, 1, "SPR2_STND"},
	anim_move_super = {SPR_PLAY, A, B, C, D, 2, "SPR2_WALK"},
	anim_run_super = {SPR_PLAY, A, B, C, D, 2, "SPR2_RUN_"},
	anim_atk_super = {SPR_PLAY, A, 2, "SPR2_ROLL"},
	anim_aoa_end_super = {SPR_PLAY, A, 2, "SPR2_ROLL"},
	anim_hurt_super = {SPR_PLAY, A, 35, "SPR2_PAIN"},
	anim_getup_super = {SPR_PLAY, A, B, C, D, E, F, G, H, 8, "SPR2_STND"},
	anim_evoker_super = {SPR_PLAY, A, 1, "SPR2_STND"},
	anim_evoker_shoot_super = {SPR_PLAY, A, 2, "SPR2_STND"},
	anim_special1_super = {SPR_PLAY, A, 2, "SPR2_MLEE"},
	anim_special2_super = {SPR_PLAY, A, B, C, D, E, 2, "SPR2_MLEE"},
	anim_special3_super = {SPR_PLAY, A, 2, "SPR2_FALL"},
	anim_special4_super = {SPR_PLAY, A, 2, "SPR2_JUMP"},
	-- VOICES
	vfx_summon = {"sfx_vosum1", "sfx_vosum2", "sfx_vosum3"},
    vfx_skill = {"sfx_voskl1", "sfx_voskl2", "sfx_voskl3"},
    vfx_item = {"sfx_voitm1", "sfx_voitm2", "sfx_voitm3"},
    vfx_hurt = {"sfx_vohrt1", "sfx_vohrt2", "sfx_vohrt3"},
    vfx_hurtx = {"sfx_voxht1", "sfx_voxht2", "sfx_voxht3"},
    vfx_die = {"sfx_vodie1", "sfx_vodie2", "sfx_vodie3"},
    vfx_heal = {"sfx_vohel1", "sfx_vohel2"},
    vfx_healself = {"sfx_vohel3"},
    vfx_kill = {"sfx_vokll1", "sfx_vokll2", "sfx_vokll3"},
    vfx_1more = {"sfx_vo1mor", "sfx_vo2mor", "sfx_vo3mor"},
    vfx_crit = {"sfx_vocrt1", "sfx_vocrt2", "sfx_vocrt3"},
    vfx_aoaask = {"sfx_voask1", "sfx_voask2", "sfx_voask3"},
    vfx_aoado = {"sfx_vodo1", "sfx_vodo2", "sfx_vodo3"},
    vfx_aoarelent = {"sfx_vorlt1", "sfx_vorlt2", "sfx_vorlt3"},
    vfx_miss = {"sfx_vomss1", "sfx_vomss2", "sfx_vomss3"},
    vfx_dodge = {"sfx_vodod1", "sfx_vodod2", "sfx_vodod3"},
    vfx_win = {"sfx_vowin1", "sfx_vowin2", "sfx_vowin3"},
    vfx_levelup = {"sfx_volvl1", "sfx_volvl2", "sfx_volvl3"},
	-- HUD/UI
	hudaoa = "H_VDYAOA", -- Patch for All Out Attack hud
	hudbust = "H_VDYBAR", -- Patch to draw on the stat hud
	icon = "ICO_VOID", -- Icon for net select and other menus
	hudcutin = "VOID_A", -- Cut in
	hudsaoa = "H_AVDYAO",
	hudsbust = "H_AVDYBA",
	hudscutin = "AVDY_A",
	aoa_quote = "I shall consume \nall in my path!", -- Something to say when in a Hold-Up
	tip = "Learns Slash, Wind (Gravity in Bionis), Strike, and Almighty. While her magic can be just as strong as her physicals, her SP is very low and is best kept for Defense debuffs. Try killing foes with your melee attack to alleviate the issue." -- A brief description of how the character generally plays in battle
}

VFX_freeslotC("voidy")

-- Persona
personaList["seth"] = {
	-- GENERAL
	name = "Seth",
	arcana = ARCANA_TOWER,
	sprite = SPR_SETH,
	startframe = 0,
	anim_idle = {SPR_SETH, A, B, C, D, E, F, G, F, E, D, C, B, A, 8},
	anim_atk = {SPR_SETH, H, I, J, K, L, M, N, O, P, Q, R, S, 2},
	-- STATS (At level 10)
	strength = 11,
	magic = 7,
	endurance = 8,
	luck = 4,
	agility = 10,
	-- AFFINITIES
	block = bionis and ATK_WIND|ATK_GRAVITY or ATK_WIND,
	resist = bionis and ATK_SLASH|ATK_STRIKE|ATK_POISON or ATK_SLASH|ATK_STRIKE,
	weak = bionis and ATK_BLESS|ATK_FOREST or ATK_BLESS,
	-- SKILLSET
	skills = {
		{"cleave", 1}, {bionis and "gry-bionis" or "garu", 3},
		{"rakunda", 7}, {"challenger 1", 12}, 
		{"vo_chi blast", 15}, {"magry", 18}, 
		{"giant slice", 21}, {bionis and "gryva-bionis" or "garula", 25}, 
		
		{"vo_fortify spirit", 28, "cleave"}, {"mind charge", 33, bionis and "gry-bionis" or "garu"}, 
		{"marakunda", 37, "rakunda"}, {"challenger 2", 41, "challenger 1"}, 
		{"heat wave", 45, "vo_chi blast"}, {"megido", 48, "magry"}, 
		{"fatal end", 52, "giant slice"}, {bionis and "grydyne-bionis" or "garudyne", 57, bionis and "gryva-bionis" or "garula"}, 
		
		{"vo_taunt", 59, "marakunda"}, {"vicious strike", 63, "heat wave"}, 
		{"megidola", 67, "megido"}, {"brave blade", 75, "fatal end"}, 
		{"vo_destructive joy", 81, "challenger 2"}, {"megidolaon", 85, "megidola"},
		
		// Cleave > Giant Slice > Fatal End > Brave Blade
		// Garu/Gry > Garula/Gryva > Garudyne/Grydyne
		// Rakunda > Marakunda > Taunt
		// Challenger 1 > Challenger 2 > Destructive Joy
		// Chi Blast > Heat Wave > Vicious Strike
		// Magry > Megido > Megidola > Megidolaon
		// Fortify Spirit
		// Mind Charge
	},
}

-- Weapons
weaponsList["voidy_weapon1"] = {
	name = "Neon Talons",
	type = WPT_CLAWS,
	rarity = 1,
	element = nil,
	atk = 400,
	acc = 90,
	crit = 5,
	desc = "Voidy's starting weapon. \nClaws that are imbuded with an unearthly \nenergy, allowing Voidy to rip the very fabric \nof reality itself.",
	slot = "vo_arms master",
}

weaponsList["voidy_weapon2"] = {
	name = "Vampiric Talons",
	type = WPT_CLAWS,
	rarity = 3,
	element = ATK_SLASH,
	atk = 1200,
	acc = 90,
	crit = 5,
	desc = "Voidy's 2nd tier weapon. \nClaws that once belonged to a vampire lord. \nBlood drains from the receiver of the attack \nfrom which the wearer absorbs the blood.",
	st = 1,
	ag = 1,
	slot = "vo_drain attack",
}

weaponsList["voidy_weapon3"] = {
	name = "Durga Talons",
	type = WPT_CLAWS,
	rarity = 5,
	element = ATK_SLASH,
	atk = 2000,
	acc = 90,
	crit = 5,
	desc = "Voidy's 3rd tier weapon. \nClaws that were said to have belonged to a \nwar god. No mere mortal can handle an \nattack from these.",
	st = 3,
	ag = 3,
	slot = "vo_temporal edge",
}

-- Velvet Shop
table.insert(shopList["velvet_shop_mp1"].weapons, {makeWeapon("voidy_weapon1", 10), 900, nil, 4})
table.insert(shopList["velvet_shop_mp1"].weapons, {makeWeapon("voidy_weapon2"), 5000, 3})
table.insert(shopList["velvet_shop_mp1"].weapons, {makeWeapon("voidy_weapon3"), 13500, 6})

-- Void Shop
table.insert(shopList["void_shop"].weapons, {makeWeapon("voidy_weapon1", 10), 800, nil, 6})
table.insert(shopList["void_shop"].weapons, {makeWeapon("voidy_weapon2"), 1600, 6, 12})
table.insert(shopList["void_shop"].weapons, {makeWeapon("voidy_weapon3"), 3000, 12})

-- Bionis Shop
if bionis
	table.insert(shopList["shop_bionis"].weapons, {makeWeapon("voidy_weapon1", 10), 900, nil, 4})
	table.insert(shopList["shop_bionis"].weapons, {makeWeapon("voidy_weapon2"), 5000, 3})
	table.insert(shopList["shop_bionis"].weapons, {makeWeapon("voidy_weapon3"), 13500, 6})
	table.insert(shopList["shop_ameno"].weapons, {makeWeapon("voidy_weapon2", 10), 10000, 3})
	table.insert(shopList["shop_ameno"].weapons, {makeWeapon("voidy_weapon3", 10), 27000, 6})
end

-- Skills
attackDefs["voidy_atk1"] = {
	name = "Atom Shredder",
	type = ATK_ALMIGHTY,
	power = 360,
	accuracy = 90,
	critical = 5,
	hits = 3,
	target = TGT_ENEMY,
	costtype = CST_HP,
	cost = 0,
	desc = "x3 Miniscule Almighty damage \nto one enemy. Regain target's \nremaining SP on kill.",
	anim_norepel = true,
	physical = true,
	anim = function(mo, targets, hittargets, timer)
				local target = targets[1]		
				local btl = server.P_BattleStatus[mo.battlen]
				local cam = btl.cam
                if timer == 1
					ANIM_set(mo, mo.anim_run, true)
					local cx = target.x + 300*cos(target.angle + ANG1*90)
					local cy = target.y + 300*sin(target.angle + ANG1*90)
					CAM_goto(server.P_BattleStatus[mo.battlen].cam, cx, cy, target.z + FRACUNIT*50, 70*FRACUNIT)
					CAM_angle(server.P_BattleStatus[mo.battlen].cam, R_PointToAngle2(cx, cy, target.x, target.y))
					mo.oldangle = mo.angle
					mo.angle = R_PointToAngle2(mo.x, mo.y, target.x, target.y)
                    mo.reachedtarget = false
                end
                if not mo.reachedtarget
                    P_InstaThrust(mo, mo.angle, FRACUNIT*36)
					if R_PointToDist2(mo.x, mo.y, target.x, target.y) < 36*FRACUNIT
						mo.reachedtarget = timer
						P_InstaThrust(mo, 0, 0)
						local tpdestx = target.x + 128*cos(target.angle)
						local tpdesty = target.y + 128*sin(target.angle)
						P_TeleportMove(mo, tpdestx, tpdesty, target.z)
					end
				end
				if mo.reachedtarget and timer - mo.reachedtarget == 1
					ANIM_set(mo, mo.anim_special1)
					playSound(mo.battlen, sfx_claw1)
					damageObject(target)
					local s = P_SpawnMobj(target.x, target.y, target.z, MT_DUMMY)
					s.state = S_SHREDDERR1
				elseif mo.reachedtarget and timer - mo.reachedtarget == 11
					ANIM_set(mo, mo.anim_special2)
					playSound(mo.battlen, sfx_claw1)
					damageObject(target)
					local s = P_SpawnMobj(target.x, target.y, target.z, MT_DUMMY)
					s.state = S_SHREDDERL1
				elseif mo.reachedtarget and timer - mo.reachedtarget == 21
					ANIM_set(mo, mo.anim_special3)
					playSound(mo.battlen, sfx_claw2)
					damageObject(target)
					local s = P_SpawnMobj(mo.x, mo.y, mo.z, MT_DUMMY)
					s.state = S_DUALSHREDDER
					P_InstaThrust(s, mo.angle, FRACUNIT*12)
					s.fuse = 12
					s.angle = mo.angle
				end
				if mo.reachedtarget and timer - mo.reachedtarget == 1 
				or mo.reachedtarget and timer - mo.reachedtarget == 11 
				or mo.reachedtarget and timer - mo.reachedtarget == 21 
					if target != mo and not target.hp
						if not mo.gotsp
							damageSP(mo, -target.sp)
							playSound(mo.battlen, sfx_heal)
							mo.gotsp = true
						end
					end
				end
				if mo.reachedtarget and timer - mo.reachedtarget > 31
					mo.gotsp = false
					return true
                end
			end,
}

attackDefs["voidy_atk2"] = {
	name = "Reality Shredder",
	type = ATK_ALMIGHTY,
	power = 5120,
	accuracy = 999,
	hits = 8,
	target = TGT_ALLENEMIES,
	costtype = CST_HP,
	cost = 0,
	desc = "Instantly kills all non-boss foes. \nx8 light Almighty damage to bosses. \nDepletes 25 SP for each hit.",
	norogue = true,
	norandom = true,
	nometronome = true,
	anim_norepel = true,
	norepel = true,
	hudfunc = function(v, mo, timer)
					if timer > 60
					and timer < 63
						v.fadeScreen(0, 10)
					end
				end,
	anim = function(mo, targets, hittargets, timer)		
				local btl = server.P_BattleStatus[mo.battlen]
				local cam = btl.cam
				local avgx, avgy = 0, 0
				for i = 1, #hittargets
					avgx = $ + hittargets[i].x/FRACUNIT
					avgy = $ + hittargets[i].y/FRACUNIT
				end
				avgx = ($/#hittargets)*FRACUNIT
				avgy = ($/#hittargets)*FRACUNIT
				local zpos = mo.z + FRACUNIT*100
                if timer == 10
					ANIM_set(mo, mo.anim_special1)
					S_StartSound(mo, sfx_vdysa1)
					local indicator = P_SpawnMobj(avgx, avgy, zpos, MT_DUMMY)
					indicator.sprite = SPR_ASHR
					indicator.frame = N|FF_FULLBRIGHT|FF_TRANS50
					indicator.colorize = true
					indicator.color = SKINCOLOR_RED
					playSound(mo.battlen, sfx_s3k5c)
					indicator.tics = 61
					mo.indicator = indicator
				elseif timer >= 11 and timer < 61
					if mo.indicator and mo.indicator.valid
						if leveltime%5 == 0
							mo.indicator.flags2 = $|MF2_DONTDRAW
						else
							mo.indicator.flags2 = $ & ~MF2_DONTDRAW
						end
					end
				elseif timer >= 61 and timer < 71
					if timer == 61
						ANIM_set(mo, mo.anim_special2)
						playSound(mo.battlen, sfx_rail1)
						P_StartQuake(FRACUNIT*70, TICRATE*1)
						mo.oldangle = mo.angle
						local portal = P_SpawnMobj(avgx, avgy, zpos, MT_DUMMY)
						portal.state = S_REALITYSHREDDER_SPAWN
						mo.portal = portal
					end
					if timer > 61 and timer < 69
						mo.angle = $ + ANGLE_45
					end
					if timer == 69
						mo.angle = mo.oldangle
					end
				elseif timer >= 71 and timer < 251
					if timer == 71	
						P_StartQuake(30*FRACUNIT, TICRATE*4)
						ANIM_set(mo, mo.anim_stand, true)
					end
					if leveltime%13 == 0
						playSound(mo.battlen, sfx_succ)
					end
					if mo.portal and mo.portal.valid
						local h_angle = P_RandomRange(1, 359)*ANG1
						local v_angle = P_RandomRange(1, 359)*ANG1
						local dist = 256
						local spd = P_RandomRange(40, 50)
						local s_x = mo.portal.x+ dist*FixedMul(cos(h_angle), cos(v_angle))
						local s_y = mo.portal.y+ dist*FixedMul(sin(h_angle), cos(v_angle))
						local s_z = (mo.portal.z + 200*FRACUNIT)+ dist* sin(v_angle)
						local s = P_SpawnMobj(s_x, s_y, s_z, MT_DUMMY)
						s.frame = A|FF_FULLBRIGHT
						s.color = SKINCOLOR_WHITE
						s.scale = FRACUNIT*3/2
						s.destscale = FRACUNIT/5
						s.target = mo.portal
						s.tics = 10
						s.momx = (mo.portal.x - s.x)/10
						s.momy = (mo.portal.y - s.y)/10
						s.momz = ((mo.portal.z + 200*FRACUNIT) - s.z)/10
						for k,v in ipairs(hittargets)
							if timer == 71
								ANIM_set(v, v.anim_hurt)
							end
							if not v.boss
								v.flags = $|MF_NOGRAVITY|MF_NOCLIP
								v.momx = (mo.portal.x - v.x)/90
								v.momy = (mo.portal.y - v.y)/90
								v.momz = ((mo.portal.z + 200*FRACUNIT) - v.z)/90
								if v.z == mo.portal.z + 200*FRACUNIT
									v.flags2 = $|MF2_DONTDRAW
								end
							end
							if timer == 91 
							or timer == 111 
							or timer == 131 
							or timer == 151 
							or timer == 171 
							or timer == 191 
							or timer == 211
								if v.boss
									damageObject(v)
									damageSP(v, 25)
								end
							end
						end
					end
					if timer == 221
						ANIM_set(mo, mo.anim_special3)
						S_StartSound(mo, sfx_vdysa2)
					elseif timer == 241
						ANIM_set(mo, mo.anim_special4)
					end
				elseif timer == 251
					for k,v in ipairs(hittargets)
						if v.boss
							damageObject(v)
							damageSP(v, 25)
						else
							damageObject(v, 9999)
							damageSP(v, 200)
						end
					end
					P_StartQuake(30*FRACUNIT, TICRATE*1/3)
				end
				if timer == 300
					return true
				end
			end,
}

attackDefs["vo_arms master"] = {
	name = "Arms Master",
	type = ATK_PASSIVE,
	passive = PSV_SKILLCOST,
	desc = "Lowers the costs of \nPhysical skills by half.",
	norandom = true,
	norogue = true,
	anim = function(mo, skill, cost)
		if skill.costtype == CST_HP 
		or skill.costtype == CST_HPPERCENT
			cost = $*1/2
		end
		return cost
	end,
}

attackDefs["vo_drain attack"] = {
	name = "Drain Attack",
	type = ATK_PASSIVE,
	desc = "Non-Almighty Physical attacks will \nrestore HP based on half \nof the damage dealt.",
	passive = PSV_ONDAMAGE,
	norogue = true,
	norandom = true,
	anim = 	function(mo, target)
				if target ~= mo 
				and target.damagestate ~= DMG_MISS 
				and target.damagestate ~= DMG_BLOCK 
				and target.damagestate ~= DMG_DRAIN 
				and mo.attack
					if mo.attack.name == "Atom Shredder"
						local heal = (target.redhp - target.hp)/2
						damageObject(mo, -heal)
					elseif (mo.attack.costtype == CST_HP or mo.attack.costtype == CST_HPPERCENT)
						if not (mo.attack.type == ATK_ALMIGHTY)
							local heal = (target.redhp - target.hp)/2
							damageObject(mo, -heal)
						end
					end
				end
			end,
}

attackDefs["vo_temporal edge"] = {
	name = "Temporal Edge",
	type = ATK_PASSIVE,
	desc = "Non-Almighty Physical attacks \nwill add a 40% chance of instakill \nagainst non-boss foes.",
	passive = PSV_TRIGGERDAMAGE,
	norogue = true,
	norandom = true,
	anim = 	function(mo, target, dmg, crit)
				if target ~= mo 
				and target.damagestate ~= DMG_MISS 
				and target.damagestate ~= DMG_BLOCK 
				and target.damagestate ~= DMG_DRAIN 
				and mo.attack
					if mo.attack.name == "Atom Shredder"
						if not target.boss 
						and P_RandomRange(0, 100) < 40
							dmg = 9999
						end
					elseif (mo.attack.costtype == CST_HP or mo.attack.costtype == CST_HPPERCENT) 
						if not (mo.attack.type == ATK_ALMIGHTY)
							if not target.boss 
							and P_RandomRange(0, 100) < 40
								dmg = 9999
							end
						end
					end
				end
				return dmg
			end,
}

attackDefs["vo_chi blast"] = {
	name = "Chi Blast",
	type = ATK_STRIKE,
	power = 120,
	accuracy = 80,
	costtype = CST_HPPERCENT,
	technical = COND_FREEZE,
	cost = 10,
	critical = 2,
	desc = "Light Strike damage to \nall enemies.",
	target = TGT_ALLENEMIES,
	norouge = true,
	norandom = true,
	anim = function(mo, targets, hittargets, timer)
		for k,e in ipairs(hittargets)
			local target = e
			if timer == 20
				playSound(mo.battlen, sfx_s3ka5)
			elseif timer > 20 and timer < 65
				if not (timer%4)
					local ol = P_SpawnMobj(mo.x, mo.y, mo.z, MT_DUMMY)
					ol.sprite = SPR_NTHK
					ol.scale = FRACUNIT*3
					ol.destscale = 1
					ol.scalespeed = FRACUNIT*1/2
					ol.frame = B|FF_FULLBRIGHT
					ol.color = SKINCOLOR_ORANGE
					ol.tics = 8
				end
				local tg = P_SpawnGhostMobj(mo)
				tg.destscale = mo.scale*2
				tg.fuse = 6
				tg.scalespeed = (mo.scale*3)/6
				tg.colorize = true
				tg.color = SKINCOLOR_ORANGE
				tg.blendmode = AST_ADD
			elseif timer == 65
				damageObject(target)
				playSound(mo.battlen, sfx_pstop)
				for i = 1,32
					local dust = P_SpawnMobj(mo.x, mo.y, mo.z + 32*FRACUNIT, MT_DUMMY)
					dust.angle = ANGLE_90 + ANG1* (11*(i-1))
					dust.destscale = FRACUNIT*5
					dust.state = S_AOADUST1
					dust.frame = A|FF_FULLBRIGHT
					P_InstaThrust(dust, dust.angle, 5*FRACUNIT)
				end
				local d = P_SpawnMobj(target.x, target.y, target.z+128*FRACUNIT, MT_THOK)
				d.sprite = SPR_THMP
				d.frame = B|FF_FULLBRIGHT
				d.scale = FRACUNIT/4
				d.destscale = FRACUNIT*3
				d.scalespeed = FRACUNIT/8
				d.fuse = TICRATE-10
				d.tics = d.fuse
				d.momz = FRACUNIT*2
				d.momx = P_RandomRange(0, FRACUNIT-1)*P_RandomRange(-8, 8)
				d.momy = P_RandomRange(0, FRACUNIT-1)*P_RandomRange(-8, 8)
				d.color = SKINCOLOR_ORANGE
				if not target.plyr
					createSplat(mo)
					createSplat(mo)
				end
				localquake(mo.battlen, FRACUNIT*10, 10)
				for i=1,16
					local b = P_SpawnMobj(target.x, target.y, target.z+20*FRACUNIT, MT_DUMMY)
					b.momx = P_RandomRange(-8, 8)*FRACUNIT
					b.momy = P_RandomRange(-8, 8)*FRACUNIT
					b.momz = P_RandomRange(-8, 8)*FRACUNIT
					b.state = S_AOADUST1
					b.frame = A|FF_FULLBRIGHT
					b.scale = FRACUNIT*3
					b.destscale = FRACUNIT/12
				end
			end
		end
		if timer == 110
			return true
		end
	end,
}

local regstatuses = COND_BURN|COND_FREEZE|COND_SHOCK|COND_BRAINWASH|COND_DIZZY|COND_SILENCE|COND_SLEEP|COND_HEX|COND_DESPAIR|COND_RAGE|COND_HUNGER|COND_POISON
local biostatuses = bionis and COND_BURN|COND_FREEZE|COND_SHOCK|COND_BRAINWASH|COND_DIZZY|COND_SILENCE|COND_SLEEP|COND_HEX|COND_DESPAIR|COND_RAGE|COND_HUNGER|COND_POISON|COND_TIMESLOW|COND_BLEED|COND_EGO|COND_FATIGUE|COND_PARANOIA|COND_PETRIFY

attackDefs["vo_fortify spirit"] = {
	name = "Fortify Spirit",
	type = ATK_PASSIVE,
	desc = "Halves odds of being inflicted \nwith any ailment.",
	passive = PSV_COND_RESIST,
	power = 50,
	status = biostatuses or regstatuses,
	norandom = true,
	norogue = true,
}

attackDefs["vo_taunt"] = {
	name = "Taunt",
	type = ATK_SUPPORT,
	costtype = CST_SP,
	cost = 20,
	desc = "Lower enemies' defense and \nraise their physical attack \nboth by 2 stages.",
	target = TGT_ALLENEMIES,
	superdebuff = true,
	norogue = true,
	norandom = true,
	norepel = true,
	anim = function(mo, targets, hittargets, timer)
		for i = 1, #targets do
			local target = targets[i]
			if timer == 20
				playSound(mo.battlen, sfx_debuff)
				buffStat(target, "def", -BUFFSTEP*2)
				buffStat(target, "atk", BUFFSTEP*2)
				BTL_logMessage(targets[1].battlen, "Enraged! (Defense drastically down)")
				for i = 1,16
					local dust = P_SpawnMobj(target.x, target.y, target.z, MT_DUMMY)
					dust.angle = ANGLE_90 + ANG1* (22*(i-1))
					dust.state = S_CDUST1
					P_InstaThrust(dust, dust.angle, 30*FRACUNIT)
					dust.color = SKINCOLOR_BLACK
					dust.scale = FRACUNIT*2
				end
			elseif timer > 20 and timer <= 50
				if leveltime%2 == 0
					for i = 1,16
						local thok = P_SpawnMobj(target.x+P_RandomRange(-70, 70)*FRACUNIT, target.y+P_RandomRange(-70, 70)*FRACUNIT, target.z+P_RandomRange(100, 150)*FRACUNIT, MT_DUMMY)
						thok.state = S_CDUST1
						thok.momz = P_RandomRange(3, 10)*FRACUNIT*-1
						thok.color = SKINCOLOR_BLACK
						thok.tics = 5
						thok.scale = FRACUNIT*3/2
						thok.flags = MF_NOGRAVITY|MF_NOBLOCKMAP
					end
				end
				for i = 1, 8
					local thok = P_SpawnMobj(target.x+P_RandomRange(-70, 70)*FRACUNIT, target.y+P_RandomRange(-70, 70)*FRACUNIT, target.z+P_RandomRange(100, 150)*FRACUNIT, MT_DUMMY)
					thok.sprite = SPR_SUMN
					thok.frame = F|FF_FULLBRIGHT|TR_TRANS50
					thok.momz = P_RandomRange(6, 16)*FRACUNIT*-1
					thok.color = SKINCOLOR_LAVENDER
					thok.tics = 5
					thok.flags = MF_NOGRAVITY|MF_NOBLOCKMAP
				end
			end
		end
		if timer == 60
			return true
		end
	end,
}

local regaffinities1 = ATK_PASSIVE|ATK_SLASH|ATK_STRIKE|ATK_PIERCE|ATK_FIRE|ATK_ICE|ATK_WIND|ATK_ELEC|ATK_PSY|ATK_NUCLEAR|ATK_BLESS|ATK_CURSE|ATK_ALMIGHTY
local bioaffinities1 = bionis and ATK_PASSIVE|ATK_SLASH|ATK_STRIKE|ATK_PIERCE|ATK_FIRE|ATK_ICE|ATK_WIND|ATK_ELEC|ATK_PSY|ATK_NUCLEAR|ATK_BLESS|ATK_CURSE|ATK_ALMIGHTY|ATK_EARTH|ATK_WATER|ATK_FOREST|ATK_POISON|ATK_METAL|ATK_GRAVITY
attackDefs["vo_destructive joy"] = {
	name = "Destructive Joy",
	type = bioaffinities1 or regaffinities1,
	desc = "Boost all damage (including \nAlmighty) by 20%.",
	power = 20,
	passive = PSV_BOOST,
}

-- Fusion Skills
local VoidyFusions_BTL_splitSkills = BTL_splitSkills
BTL_splitSkills = function(v)
	if server.gamemode ~= GM_PVP 
	and server.gamemode ~= GM_VOIDRUN
		if v.skin == "voidy" 
		and #v.allies_noupdate
			if v.level >= 72
				for i = 1, #v.allies_noupdate
					if not v.allies_noupdate[i] or not v.allies_noupdate[i].valid then continue end
					if v.allies_noupdate[i].skin == "flchan"
						table.insert(v.skills, "antichthon v")
					end
				end
			end
			if v.level >= 77 and not v.boss
				for i = 1, #v.allies_noupdate
					if not v.allies_noupdate[i] or not v.allies_noupdate[i].valid then continue end
					if v.allies_noupdate[i].skin == "ember"
						table.insert(v.skills, "freikugel v")
					end
				end
			end
		end
	end
	VoidyFusions_BTL_splitSkills(v)
end

attackDefs["antichthon v"] = {
	name = "Antichthon",
	type = ATK_ALMIGHTY,
	power = 350,
	accuracy = 90,
	costtype = CST_SP,
	cost = 48,
	desc = "Fusion (w/ FL Chan) -  \nHeavy Almighty dmg to all enemies.\nLowers all stats by 1 stage.",
	target = TGT_ALLENEMIES,
	norogue = true,
	norandom = true,
	nometronome = true,
	nocast = function(targets, n, mo)
		local tgt = targets[n]
		local battlen = tgt.battlen
		local skincheck = "flchan"
		local checkteam = tgt.enemies
		local found
		mo.fusionpartner = false
		local fusioncost = ATK_getSkillCost(mo, attackDefs["antichthon v"])
		local can_afford
		local incapacitated
		for i = 1, #checkteam do
			if checkteam[i].skin == skincheck
				found = true
				mo.fusionpartner = checkteam[i]
				if mo.fusionpartner.sp and mo.fusionpartner.sp >= fusioncost
					can_afford = true
				end
				if mo.fusionpartner.down 
				or mo.fusionpartner.status_condition == COND_SHOCK 
				or mo.fusionpartner.status_condition == COND_BRAINWASH 
				or mo.fusionpartner.status_condition == COND_SLEEP 
				or mo.fusionpartner.status_condition == COND_RAGE
					incapacitated = true
					break
				end
			end
		end
		if not found
			BTL_logMessage(battlen, "FL Chan is not alive.")
			playSound(battlen, sfx_not)
			return true
		elseif not can_afford
			BTL_logMessage(battlen, mo.fusionpartner.name.." has insufficient SP.")
			playSound(battlen, sfx_not)
			return true
		elseif incapacitated
			BTL_logMessage(battlen, mo.fusionpartner.name.." can't think for themselves right now.")
			playSound(battlen, sfx_not)
			return true
		end
	end,
	hudfunc = function(v, mo, timer)
		for i = 1, #mo.allies do
			local target = mo.allies[i]
			local firstt = TICRATE - timer
			local t = (TICRATE - (firstt*2))
			local t2 = (t<<FRACBITS)/3
			local t3 = t2
			local scale = t*FRACUNIT/6
			local trflag = V_70TRANS
			if firstt < 15
				trflag = V_90TRANS - (V_10TRANS)
			end
			if scale > 0
			and timer < TICRATE
				v.drawScaled(160<<FRACBITS, 100<<FRACBITS, scale, v.cachePatch("H_1M_B"), trflag)
				v.drawScaled(160<<FRACBITS, 100<<FRACBITS, scale, v.cachePatch("H_1M_C"))
			end
			t3 = FixedMul(t3, t3)
			t3 = $+ FixedMul(t3, t2)
			local pp = v.cachePatch(charStats[mo.skin] and charStats[mo.skin].hudaoa or "")
			if mo.status_condition == COND_SUPER
			and charStats[mo.skin] and charStats[mo.skin].hudsaoa
				pp = v.cachePatch(charStats[mo.skin].hudsaoa)
			end
			if timer <100
				v.drawScaled((150)<<FRACBITS + t3/3, (80)<<FRACBITS +t3/8, FRACUNIT/2, pp, V_SNAPTOLEFT, v.getColormap(TC_DEFAULT, mo.color))
				pp = v.cachePatch(charStats["flchan"] and charStats["flchan"].hudaoa or "voidy")
				if target.skin == "flchan"
					v.drawScaled((150)<<FRACBITS - t3/3, (80)<<FRACBITS -t3/7, FRACUNIT/2, pp, V_SNAPTOLEFT, v.getColormap(TC_DEFAULT, target.color))
				end
			end
		end
	end,
	anim = function(mo, targets, hittargets, timer)
		for i = 1, #mo.allies do
			local target = mo.allies[i]
			if timer == 1
				if target.skin == "flchan"
					VFX_Play(target, VFX_AOADO)
					local fusioncost = ATK_getSkillCost(mo, attackDefs["antichthon v"])
					damageSP(target, fusioncost)
				end
			elseif timer >= 1
				if target.skin == "voidy"
					summonAura(target, SKINCOLOR_TEAL)
				end
				if target.skin == "flchan"
					summonAura(target, SKINCOLOR_TEAL)
				end
			end
		end
		if timer == 1
			mo.fangle = 0
			mo.fdist = 400
			mo.columns = {}
			playSound(mo.battlen, sfx_aoado)
			VFX_Play(target, VFX_AOADO)
		end
		local avgx, avgy = 0, 0
		for i = 1, #hittargets
			avgx = $ + hittargets[i].x/FRACUNIT
			avgy = $ + hittargets[i].y/FRACUNIT
		end
		avgx = ($/#hittargets)*FRACUNIT
		avgy = ($/#hittargets)*FRACUNIT
		local zpos = mo.z + FRACUNIT*200	
		if timer == 20
			playSound(mo.battlen, sfx_absorb)
			local frei = P_SpawnMobj(avgx, avgy, zpos, MT_DUMMY)
			frei.state = S_PLAY_STND
			frei.tics = 30
			frei.fuse = 30
			frei.sprite = SPR_FREI
			frei.frame = G|TR_TRANS20|FF_FULLBRIGHT
			frei.scale = FRACUNIT*5
			frei.color = SKINCOLOR_BLACK
		elseif timer > 20 and timer <= 50
			if timer == 25 
			or timer == 35 
			or timer == 45
				local bx = avgx + P_RandomRange(-192, 192)*FRACUNIT
				local by = avgy + P_RandomRange(-129, 192)*FRACUNIT
				local bz = mo.z + P_RandomRange(0, 256)*FRACUNIT
				for i = 1, 32
					local boom = P_SpawnMobj(bx + P_RandomRange(-20, 20)*FRACUNIT, by + P_RandomRange(-20, 20)*FRACUNIT, bz + 10*FRACUNIT, MT_DUMMY)
					boom.state = S_CQUICKBOOM1
					boom.color = SKINCOLOR_ORANGE
					boom.momx = P_RandomRange(-20, 20)*FRACUNIT
					boom.momy = P_RandomRange(-20, 20)*FRACUNIT
					boom.momz = P_RandomRange(-20, 20)*FRACUNIT
					boom.scale = FRACUNIT*3/2
				end
				playSound(mo.battlen, sfx_megi6)
				localquake(mo.battlen, FRACUNIT*32, 10)
			end
			if not (timer%4)
				local ol = P_SpawnMobj(avgx, avgy, zpos + FRACUNIT*50, MT_DUMMY)
				ol.sprite = SPR_NTHK
				ol.scale = 1
				ol.destscale = FRACUNIT*8
				ol.scalespeed = FRACUNIT
				ol.frame = B|FF_FULLBRIGHT
				ol.color = SKINCOLOR_CRIMSON
				ol.tics = 8
			end
		elseif timer == 51
			for k,v in ipairs(hittargets)
				damageObject(v)
				if v.damagestate ~= DMG_MISS
					buffStat(v, "atk", -25)
					buffStat(v, "mag", -25)
					buffStat(v, "def", -25)
					buffStat(v, "agi", -25)
					BTL_logMessage(mo.battlen, "Weakened overall combat performance!")
				end
			end
			for i = 1, 16
				local boom = P_SpawnMobj(avgx + P_RandomRange(-20, 20)*FRACUNIT, avgy + P_RandomRange(-20, 20)*FRACUNIT, zpos, MT_DUMMY)
				boom.state = S_CQUICKBOOM1
				boom.color = SKINCOLOR_ORANGE
				boom.momx = P_RandomRange(-20, 20)*FRACUNIT
				boom.momy = P_RandomRange(-20, 20)*FRACUNIT
				boom.momz = P_RandomRange(-20, 20)*FRACUNIT
				boom.scale = FRACUNIT*3/2
			end
			playSound(mo.battlen, sfx_megi5)
			localquake(mo.battlen, FRACUNIT*16, 10)
		elseif timer == 90
			return true
		end
	end,
}

attackDefs["freikugel v"] = {
	name = "Freikugel EX",
	type = ATK_ALMIGHTY,
	power = 650,
	accuracy = 9999,
	costtype = CST_HPPERCENT,
	cost = 20,
	desc = "Fusion (w/ Ember) - \nInsta-kill/Severe Almighty dmg. \nCan only use if 1 foe remains.",
	target = TGT_ENEMY,
	critical = 40,
	norogue = true,
	norandom = true,
	nometronome = true,
	nocast = function(targets, n, mo)
		local tgt = targets[n]
		local battlen = tgt.battlen
		local skincheck = "ember"
		local checkteam = tgt.enemies
		local checkenemies = tgt.allies
		local found
		mo.fusionpartner = false
		local fusioncost = ATK_getSkillCost(mo, attackDefs["freikugel v"])
		local can_afford
		local incapacitated
		for i = 1, #checkteam do
			if checkteam[i].skin == skincheck
				found = true
				mo.fusionpartner = checkteam[i]
				if mo.fusionpartner.hp and mo.fusionpartner.hp >= fusioncost
					can_afford = true
				end
				if mo.fusionpartner.down 
				or mo.fusionpartner.status_condition == COND_SHOCK 
				or mo.fusionpartner.status_condition == COND_BRAINWASH 
				or mo.fusionpartner.status_condition == COND_SLEEP 
				or mo.fusionpartner.status_condition == COND_RAGE
					incapacitated = true
					break
				end
			end
		end
		local remaining = 0
		for i = 1, #checkenemies do
			if checkenemies[i].hp
				remaining = $ + 1
			end
		end
		if not found
			BTL_logMessage(battlen, "Ember is not alive.")
			playSound(battlen, sfx_not)
			return true
		elseif not can_afford
			BTL_logMessage(battlen, mo.fusionpartner.name.." has insufficient HP.")
			playSound(battlen, sfx_not)
			return true
		elseif incapacitated
			BTL_logMessage(battlen, mo.fusionpartner.name.." can't think for themselves right now.")
			playSound(battlen, sfx_not)
			return true
		elseif remaining > 1
			BTL_logMessage(battlen, "There's still some enemies around...")
			playSound(battlen, sfx_not)
			return true
		end
	end,
	hudfunc = function(v, mo, timer)
		for i = 1, #mo.allies do
			local target = mo.allies[i]
			local firstt = TICRATE - timer
			local t = (TICRATE - (firstt*2))
			local t2 = (t<<FRACBITS)/3
			local t3 = t2
			local scale = t*FRACUNIT/6
			local trflag = V_70TRANS
			if firstt < 15
				trflag = V_90TRANS - (V_10TRANS)
			end
			if scale > 0
			and timer < TICRATE
				v.drawScaled(160<<FRACBITS, 100<<FRACBITS, scale, v.cachePatch("H_1M_B"), trflag)
				v.drawScaled(160<<FRACBITS, 100<<FRACBITS, scale, v.cachePatch("H_1M_C"))
			end
			t3 = FixedMul(t3, t3)
			t3 = $+ FixedMul(t3, t2)
			local pp = v.cachePatch(charStats[mo.skin] and charStats[mo.skin].hudaoa or "")
			if mo.status_condition == COND_SUPER
			and charStats[mo.skin] and charStats[mo.skin].hudsaoa
				pp = v.cachePatch(charStats[mo.skin].hudsaoa)
			end
			if timer <100
				v.drawScaled((150)<<FRACBITS + t3/3, (80)<<FRACBITS +t3/8, FRACUNIT/2, pp, V_SNAPTOLEFT, v.getColormap(TC_DEFAULT, mo.color))
				pp = v.cachePatch(charStats["ember"] and charStats["ember"].hudaoa or "voidy")
				if target.skin == "ember"
					if target.status_condition == COND_SUPER
					and charStats[target.skin] and charStats[target.skin].hudsaoa
						pp = v.cachePatch(charStats[target.skin].hudsaoa)
					end
					v.drawScaled((150)<<FRACBITS - t3/3, (80)<<FRACBITS -t3/7, FRACUNIT/2, pp, V_SNAPTOLEFT, v.getColormap(TC_DEFAULT, target.color))
				end
			end
		end
	end,
	anim = function(mo, targets, hittargets, timer)
		for i = 1, #mo.allies do
			local target = mo.allies[i]
			if timer == 1
				if target.skin == "ember"
					VFX_Play(target, VFX_AOADO)
					if not (target.boss)
						local fusioncost = ATK_getSkillCost(mo, attackDefs["freikugel v"])
						target.hp = $ - fusioncost
					end
				end
			elseif timer >= 1
				if target.skin == "voidy"
					summonAura(target, SKINCOLOR_TEAL)
				end
				if target.skin == "ember"
					summonAura(target, SKINCOLOR_TEAL)
				end
			end
		end
		if timer == 1
			mo.fangle = 0
			mo.fdist = 400
			mo.columns = {}
			playSound(mo.battlen, sfx_aoado)
			VFX_Play(target, VFX_AOADO)
		end
		local target = hittargets[1]
		if timer == 20
			local sun = P_SpawnMobj(mo.x,mo.y,mo.z + FRACUNIT*120,MT_DUMMY)
			sun.sprite = SPR_NTHK
			sun.frame = A|FF_FULLBRIGHT
			sun.color = SKINCOLOR_PEACHY
			sun.scale = FRACUNIT*2
			sun.tics = -1
			mo.sun = sun
			playSound(mo.battlen, sfx_s3k84)
		elseif timer >= 20 and timer <= 40
			if mo.sun and mo.sun.valid
				local h_angle = P_RandomRange(1, 359)*ANG1
				local v_angle = P_RandomRange(1, 359)*ANG1
				local dist = 256
				local spd = P_RandomRange(40, 50)
				local s_x = mo.sun.x+ dist*FixedMul(cos(h_angle), cos(v_angle))
				local s_y = mo.sun.y+ dist*FixedMul(sin(h_angle), cos(v_angle))
				local s_z = (mo.sun.z+mo.sun.height/2)+ dist* sin(v_angle)
				local s = P_SpawnMobj(s_x, s_y, s_z, MT_DUMMY)
				s.frame = A|FF_FULLBRIGHT
				s.color = SKINCOLOR_PEACHY
				s.scale = FRACUNIT*3/2
				s.destscale = FRACUNIT/5
				s.target = mo.sun
				s.tics = 10
				s.momx = (mo.sun.x - s.x)/10
				s.momy = (mo.sun.y - s.y)/10
				s.momz = (mo.sun.z - s.z)/10
			end
		elseif timer >= 40 and timer <= 50
			local cx = mo.sun.x + 1*cos(mo.sun.angle + ANG1*90)
            local cy = mo.sun.y + 1*sin(mo.sun.angle + ANG1*90)
            local stinger = P_SpawnMobj(cx, cy, mo.sun.z, MT_DUMMY)
            stinger.frame = A|FF_FULLBRIGHT
			stinger.color = SKINCOLOR_PEACHY
			stinger.scale = FRACUNIT*3
            stinger.momx = (target.x - stinger.x)/2
            stinger.momy = (target.y - stinger.y)/2
            stinger.momz = (target.z - stinger.z)/2
			stinger.fuse = 20
			local stinger = P_SpawnMobj(cx, cy, mo.sun.z, MT_DUMMY)
            stinger.frame = A|FF_FULLBRIGHT
			stinger.color = SKINCOLOR_PEACHY
			stinger.scale = FRACUNIT*3
            stinger.momx = (target.x - stinger.x)/2
            stinger.momy = (target.y - stinger.y)/2
            stinger.momz = (target.z - stinger.z)/2
			stinger.fuse = 20
			local stinger = P_SpawnMobj(cx, cy, mo.sun.z, MT_DUMMY)
            stinger.frame = A|FF_FULLBRIGHT
			stinger.color = SKINCOLOR_PEACHY
			stinger.scale = FRACUNIT*3
            stinger.momx = (target.x - stinger.x)/2
            stinger.momy = (target.y - stinger.y)/2
            stinger.momz = (target.z - stinger.z)/2
			stinger.fuse = 20
			if timer == 45
				if not (target.boss)
					damageObject(target, 9999)
				else
					damageObject(target)
				end
				localquake(mo.battlen, FRACUNIT*64, 10)
				playSound(mo.battlen, sfx_s3k54)
				playSound(mo.battlen, sfx_trfire)
				playSound(mo.battlen, sfx_hamas2)
			end
		end
		if timer == 70
			if mo.sun and mo.sun.valid
				mo.sun.fuse = 20
				mo.sun.destscale = 1
				mo.sun.scalepseed = FRACUNIT/20
				mo.sun = nil
			end
			return true
		end
	end,
}

-- Trait
personaList["seth"].trait = "spiteful force"

attackDefs["spiteful force"] = {
	name = "Spiteful Force",
	type = ATK_PASSIVE,
	desc = "Boost Almighty damage by 5% for \nevery 10% of max HP lost. Magical \nAlmighty skills cost 25% less SP.",
	passive = PSV_TRIGGERDAMAGE,
	implicit = "spiteful force.p2",
	norogue = true,
	norandom = true,
	anim = 	function(mo, target, dmg, crit)
				if target ~= mo  
				and mo.attack 
				and (mo.attack.type == ATK_ALMIGHTY)
					if ((mo.hp <= mo.maxhp*9/10) and (mo.hp > mo.maxhp*8/10))
						dmg = $*105/100
					elseif ((mo.hp <= mo.maxhp*8/10) and (mo.hp > mo.maxhp*7/10))
						dmg = $*110/100
					elseif ((mo.hp <= mo.maxhp*7/10) and (mo.hp > mo.maxhp*6/10))
						dmg = $*115/100
					elseif ((mo.hp <= mo.maxhp*6/10) and (mo.hp > mo.maxhp*5/10))
						dmg = $*120/100
					elseif ((mo.hp <= mo.maxhp*5/10) and (mo.hp > mo.maxhp*4/10))
						dmg = $*125/100
					elseif ((mo.hp <= mo.maxhp*4/10) and (mo.hp > mo.maxhp*3/10))
						dmg = $*130/100
					elseif ((mo.hp <= mo.maxhp*3/10) and (mo.hp > mo.maxhp*2/10))
						dmg = $*135/100
					elseif ((mo.hp <= mo.maxhp*2/10) and (mo.hp > mo.maxhp*1/10))
						dmg = $*140/100
					elseif (mo.hp <= mo.maxhp*1/10) 
						dmg = $*145/100
					end
				end
				return dmg
			end,
}

attackDefs["spiteful force.p2"] = {
	name = "Spiteful Force",
	type = ATK_PASSIVE,
	passive = PSV_SKILLCOST,
	desc = "Boost Almighty damage by 5% for \nevery 10% of max HP lost. Magical \nAlmighty skills cost 25% less SP.",
	norandom = true,
	norogue = true,
	anim = function(mo, skill, cost)
		if skill.type == ATK_ALMIGHTY 
		and (skill.costtype == CST_SP or skill.costtype == CST_SPPERCENT)
			cost = $*3/4
		end
		return cost
	end,
}