--No.16 色の支配者ショック・ルーラー
function c114514016.initial_effect(c)
	--xyz summon
	aux.AddXyzProcedureLevelFree(c,c114514016.mfilter,c114514016.xyzcheck,3,3)
	c:EnableReviveLimit()
	--act limit
	local e1=Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(114514016,0))
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetCountLimit(1)
	e1:SetRange(LOCATION_MZONE)
	e1:SetCost(c114514016.cost)
	e1:SetCondition(c114514016.cond)
	e1:SetTarget(c114514016.target)
	e1:SetOperation(c114514016.operation)
	c:RegisterEffect(e1)
end
aux.xyz_number[114514016]=16
function c114514016.mfilter(c,xyzc)
	return c:IsXyzType(TYPE_MONSTER) and c:IsXyzLevel(xyzc,4)
end
function c114514016.xyzcheck(g)
	return g:GetClassCount(Card.GetAttribute)==1 and g:GetClassCount(Card.GetRace)==1
end
function c114514016.cond(e)
	return not Duel.IsExistingMatchingCard(nil,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler())
end
function c114514016.cost(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
	e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c114514016.target(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return true end
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
	e:SetLabel(Duel.AnnounceType(tp))
end
function c114514016.operation(e,tp,eg,ep,ev,re,r,rp)
	local c=e:GetHandler()
	local e1=Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
	e1:SetCode(EFFECT_CANNOT_ACTIVATE)
	e1:SetTargetRange(1,1)
	if e:GetLabel()==0 then
		e1:SetDescription(aux.Stringid(114514016,2))
		e1:SetValue(c114514016.aclimit1)
	elseif e:GetLabel()==1 then
		e1:SetDescription(aux.Stringid(114514016,3))
		e1:SetValue(c114514016.aclimit2)
	else
		e1:SetDescription(aux.Stringid(114514016,4))
		e1:SetValue(c114514016.aclimit3)
	end
	e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
	Duel.RegisterEffect(e1,tp)
end
function c114514016.aclimit1(e,re,tp)
	return re:IsActiveType(TYPE_MONSTER)
end
function c114514016.aclimit2(e,re,tp)
	return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL)
end
function c114514016.aclimit3(e,re,tp)
	return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_TRAP)
end
