--孤高の格闘家
function c82452993.initial_effect(c)
	--Activate
	local e1=Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e1:SetTarget(c82452993.target)
	e1:SetOperation(c82452993.operation)
	c:RegisterEffect(e1)
end
function c82452993.filter(c)
	local code=c:GetCode()
	return c:IsFaceup() and (code==8508055 or code==3810071 or code==49814180)
end
function c82452993.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
	if chkc then return false end
	local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
	if chk==0 then return g:GetCount()==1 and c82452993.filter(g:GetFirst()) end
	Duel.SetTargetCard(g)
end
function c82452993.operation(e,tp,eg,ep,ev,re,r,rp)
	local c=e:GetHandler()
	local tc=Duel.GetFirstTarget()
	if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
		c:SetCardTarget(tc)
		local e1=Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_OWNER_RELATE)
		e1:SetRange(LOCATION_MZONE)
		e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
		e1:SetCondition(c82452993.rcon)
		e1:SetValue(1)
		e1:SetReset(RESET_EVENT+0x1fe0000)
		tc:RegisterEffect(e1,true)
		local e2=e1:Clone()
		e2:SetCode(EFFECT_IMMUNE_EFFECT)
		e2:SetValue(c82452993.efilter)
		tc:RegisterEffect(e2,true)
	end
end
function c82452993.rcon(e)
	return e:GetOwner():IsHasCardTarget(e:GetHandler())
end
function c82452993.efilter(e,re)
	return re:IsActiveType(TYPE_MONSTER)
end
