Commit 17999b4c authored by 大崎甜花's avatar 大崎甜花 Committed by GitHub

Update c14010049.lua

parent bf260181
...@@ -96,7 +96,7 @@ function cm.XyzLevelFreeTarget(f,gf,minct,maxct) ...@@ -96,7 +96,7 @@ function cm.XyzLevelFreeTarget(f,gf,minct,maxct)
local g=mg:SelectSubGroup(tp,cm.XyzLevelFreeGoal,true,minc,maxc,tp,c,gf) local g=mg:SelectSubGroup(tp,cm.XyzLevelFreeGoal,true,minc,maxc,tp,c,gf)
cm.GCheckAdditional=nil cm.GCheckAdditional=nil
if g and #g>0 then if g and #g>0 then
local g1=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,g,tp,c) local g1=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,g,tp,c,g)
if g1 and #g1>0 then if g1 and #g1>0 then
g1:GetFirst():CancelToGrave() g1:GetFirst():CancelToGrave()
g:Merge(g1) g:Merge(g1)
...@@ -146,9 +146,11 @@ function cm.XyzLevelFreeOperation(f,gf,minct,maxct) ...@@ -146,9 +146,11 @@ function cm.XyzLevelFreeOperation(f,gf,minct,maxct)
end end
end end
end end
function cm.filter(c,tp,xyzc) function cm.filter(c,tp,xyzc,matg)
local og=Group.FromCards(c)
if matg then og:Merge(matg) end
return not c:IsType(TYPE_TOKEN) return not c:IsType(TYPE_TOKEN)
and (c:IsControler(tp) or c:IsAbleToChangeControler()) and not c:IsStatus(STATUS_BATTLE_DESTROYED) and (not xyzc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,c,xyzc)>0) and (c:IsControler(tp) or c:IsAbleToChangeControler()) and not c:IsStatus(STATUS_BATTLE_DESTROYED) and (not xyzc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,og,xyzc)>0)
end end
function cm.spcost(e,c,tp) function cm.spcost(e,c,tp)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler(),tp,e:GetHandler()) return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler(),tp,e:GetHandler())
...@@ -178,4 +180,4 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -178,4 +180,4 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
Duel.SendtoDeck(c,nil,2,REASON_EFFECT) Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end end
end end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment