// content by Luigifan

//----------- ability definition -----------

//main thinker
addHook("ThinkFrame", function()
	for player in players.iterate do
		if player.mo.skin ~= "sonja_belnades" then
			continue
		end
	end
end)

//Defining variables
addHook ("PlayerThink", function(player)
	if player.mo and player.mo.valid then
	
		if player.mo.skin ~= "sonja_belnades" then
			return
		end
		
		if player.custom1down == nil then --if the player does not have this variable yet
			player.custom1down = 0 --give it a starting number
		end
		
		if player.cmd.buttons & BT_CUSTOM1 > 0 then --if the player is pressing Custom 1
			player.custom1down = $1 + 1 --increment custom1 variable
		else
			player.custom1down = 0 --reset custom1 variable
		end
		
		if player.custom2down == nil then --if the player does not have this variable yet
			player.custom2down = 0 --give it a starting number
		end
		
		if player.cmd.buttons & BT_CUSTOM2 > 0 then --if the player is pressing Custom 2
			player.custom2down = $1 + 1 --increment custom2 variable
		else
			player.custom2down = 0 --reset custom2 variable
		end
		
		if player.custom3down == nil then --if the player does not have this variable yet
			player.custom3down = 0 --give it a starting number
		end
		
		if player.cmd.buttons & BT_CUSTOM3 > 0 then --if the player is pressing Custom 3
			player.custom3down = $1 + 1 --increment custom3 variable
		else
			player.custom3down = 0 --reset custom3 variable
		end
		
		if player.tossflagdown == nil then --if the player does not have this variable yet
			player.tossflagdown = 0 --give it a starting number
		end
		
		if player.cmd.buttons & BT_TOSSFLAG > 0 then --if the player is pressing Toss Flag
			player.tossflagdown = $1 + 1 --increment tossflag variable
		else
			player.tossflagdown = 0 --reset tossflag variable
		end
		
		if player.firenormaldown == nil then --if the player does not have this variable yet
			player.firenormaldown = 0 --give it a starting number
		end
		
		if player.cmd.buttons & BT_FIRENORMAL > 0 then --if the player is pressing Fire Normal
			player.firenormaldown = $1 + 1 --increment firenormal variable
		else
			player.firenormaldown = 0 --reset firenormal variable
		end
		
		if player.cmd.buttons & BT_ATTACK > 0 then --if the player is pressing Fire
			player.firedown = $1 + 1 --increment fire variable
		else
			player.firedown = 0 --reset fire variable
		end
		
		if player.mo.vixenvortexed == nil then
			player.mo.vixenvortexed = 0
		end
		
		if player.mo.energy == nil then
			player.mo.energy = 100*FRACUNIT
		end
		
		if player.mo.holyboltcharge == nil then
			player.mo.holyboltcharge = 0
		end
		
		if player.mo.holyboltcooldown == nil then
			player.mo.holyboltcooldown = 0
		end
	end
end)

addHook("PlayerThink", function(player)
	if player.mo and player.mo.valid then
		
		if player.mo.skin ~= "sonja_belnades" then
			return
		end
		
		if player.slowedtime == nil then
			player.slowedtime = 0
		end
		
		if player.slowedtimecheckpoint == nil then
			player.slowedtimecheckpoint = 0
		end
		
		if player.rewoundtime == nil then
			player.rewoundtime = 0
		end
		
		if player.rewoundtimecheckpoint == nil then
			player.rewoundtimecheckpoint = 0
		end
		
		if player.finaltime == nil then
			player.finaltime = 0
		end
		
		if player.evasion == nil then
			player.evasion = 0
		end
		
		if player.flashprep == nil then
			player.flashprep = 0
		end
		
		if player.attacker == nil then
			player.attacker = 0
		end
		
		if player.counterready == nil then
			player.counterready = 0
		end
		
		if player.attacker == nil then
			player.attacker = 0
		end
		
		if player.counter == nil then
			player.counter = 0
		end
	end
end)