// content by Luigifan

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

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

//Defining variables
addHook ("PlayerThink", function(player)
	if player.mo and player.mo.valid then
	
		if player.mo.skin ~= "cassandra_b" 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 ~= "cassandra_b" then
			return
		end
		
		if player.mo.copy == nil then
			player.mo.copy = 0
		end
		
		if player.mo.copypoweruse == nil then
			player.mo.copypoweruse = 0
		end
		
		if player.mo.copyboltcooldown == nil then
			player.mo.copyboltcooldown = 0
		end
		
		if player.mo.mimicry == nil then
			player.mo.mimicry = 0
		end
		
		if player.mo.copypowerjump == nil then
			player.mo.copypowerjump = 0
		end
		
		if player.mo.copyduration == nil then
			player.mo.copyduration = 0
		end
		
		if player.extrahit == nil then
			player.extrahit = 0
		end
		
		if player.mo.selfexplosion == nil then
			player.mo.selfexplosion = 0
		end
	end
end)