--サボット関数コントロール用

local sabot_rand_decision = math.random(1023)

if sabot_rand_decision<=1 then
	sabot_rank = 1
elseif sabot_rand_decision<=3 then
	sabot_rank = 2
elseif sabot_rand_decision<=7 then
	sabot_rank = 3
elseif sabot_rand_decision<=15 then
	sabot_rank = 4
elseif sabot_rand_decision<=31 then
	sabot_rank = 5
elseif sabot_rand_decision<=63 then
	sabot_rank = 6
elseif sabot_rand_decision<=127 then
	sabot_rank = 7
elseif sabot_rand_decision<=255 then
	sabot_rank = 8
elseif sabot_rand_decision<=511 then
	sabot_rank = 9
elseif sabot_rand_decision<=1023 then
	sabot_rank = 10
end

function sabot_wakeup()
	local i= math.random(1023)
	if sabot_rank== 1 then
		if i<=1 then sabot_after_guard() end
	elseif sabot_rank== 2 then
		if i<=3 then sabot_after_guard() end
	elseif sabot_rank== 3 then
		if i<=7 then sabot_after_guard() end
	elseif sabot_rank== 4 then
		if i<=15 then sabot_after_guard() end
	elseif sabot_rank== 5 then
		if i<=31 then sabot_after_guard() end
	elseif sabot_rank== 6 then
		if i<=63 then sabot_after_guard() end
	elseif sabot_rank== 7 then
		if i<=127 then sabot_after_guard() end
	elseif sabot_rank== 8 then
		if i<=255 then sabot_after_guard() end
	elseif sabot_rank== 9 then
		if i<=511 then sabot_after_guard() end
	elseif sabot_rank==10 then
		if i<=1023 then sabot_after_guard() end
	end
end