function cXXXXXXXX.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCondition(cXXXXXXXX.condition)
e1:SetTarget(cXXXXXXXX.target)
e1:SetOperation(cXXXXXXXX.operation)
c:RegisterEffect(e1)
end
function cXXXXXXXX.condition(e,tp,eg,ep,ev,re,r,rp)
if e==re or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()~=1 then return false end
local tc=g:GetFirst()
e:SetLabelObject(tc)
return tc:IsOnField()
end
function cXXXXXXXX.filter(c,re,rp,tf,ceg,cep,cev,cre,cr,crp)
return tf(re,rp,ceg,cep,cev,cre,cr,crp,0,c)
end
function cXXXXXXXX.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tf=re:GetTarget()
local res,ceg,cep,cev,cre,cr,crp=Duel.CheckEvent(re:GetCode(),true)
if chkc then return chkc:IsOnField() and cXXXXXXXX.filter(chkc,re,rp,tf,ceg,cep,cev,cre,cr,crp) end
if chk==0 then return Duel.IsExistingTarget(cXXXXXXXX.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetLabelObject(),re,rp,tf,ceg,cep,cev,cre,cr,crp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c21501505.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetLabelObject(),re,rp,tf,ceg,cep,cev,cre,cr,crp)
end
function cXXXXXXXX.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.ChangeTargetCard(ev,Group.FromCards(tc))
end
end
Like this? It redirects single-targeted effects (on the field).