local cm,m,o=GetID()
function cm.initial_effect(c)
	vgd.VgCard(c)
	local e1=Effect.CreateEffect(c)
    e1:SetType(EFFECT_TYPE_FIELD)
    e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
    e1:SetCode(AFFECT_CODE_OVERLAY_INSTEAD_WHEN_RIDE)
    e1:SetRange(LOCATION_MZONE)
	e1:SetCondition(function (e,tp,eg,ep,ev,re,r,rp)
		return vgf.WhiteWing(e) and vgf.VMonsterCondition(e)
	end)
    e1:SetTargetRange(1,0)
    c:RegisterEffect(e1)
	local e2=Effect.CreateEffect(c)
    e2:SetType(EFFECT_TYPE_SINGLE)
    e2:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
    e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
    e2:SetRange(LOCATION_MZONE)
    e2:SetCondition(function (e,tp,eg,ep,ev,re,r,rp)
		return vgf.DarkWing(e) and vgf.VMonsterCondition(e)
	end)
    e2:SetValue(function (e,tc)
		return tc:IsLevelBelow(1) and vgf.RMonsterFilter(tc)
	end)
    c:RegisterEffect(e2)
	vgd.AbilityAuto(c,m,nil,EFFECT_TYPE_SINGLE,EVENT_SPSUMMON_SUCCESS,cm.op,nil,vgf.VSummonCondition)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
	local g=Duel.GetDecktopGroup(tp,1)
	vgf.Sendto(LOCATION_LOCK,g,POS_FACEUP,REASON_EFFECT)
end