Commit 336e0a9b authored by TanakaKotoha's avatar TanakaKotoha

lua fix

parent d5bded09
......@@ -63,15 +63,23 @@ function c65020050.reacon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c65020050.reafil,1,nil,tp)
end
function c65020050.reatg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroup(tp,0,1):IsExists(Card.IsAbleToRemove,1,nil) end
if chk==0 then return Duel.GetFieldGroup(tp,0,1):IsExists(c65020050.abletoremove,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0)
end
function c65020050.abletoremove(c)
return c:IsAbleToRemove() and not c:IsType(TYPE_TOKEN)
end
function c65020050.reaop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.GetFieldGroup(tp,0,1):IsExists(Card.IsAbleToRemove,1,nil) then return end
local m=Duel.SelectOption(1-tp,aux.Stringid(65020050,0),aux.Stringid(65020050,1))
local b1=Duel.GetMatchingGroupCount(c65020050.abletoremove,tp,0,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_EXTRA,nil)>0
local b2=Duel.GetMatchingGroupCount(c65020050.abletoremove,tp,0,LOCATION_DECK,nil)>0
local m=2
if b1 and b2 then
m=Duel.SelectOption(1-tp,aux.Stringid(65020050,0),aux.Stringid(65020050,1))
elseif b1 then
m=0
elseif b2 then
m=1
end
if m==0 then
local g1=Duel.SelectMatchingCard(1-tp,c65020050.abletoremove,1-tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil)
Duel.HintSelection(g1)
......
......@@ -43,17 +43,17 @@ function c81012009.ovfilter(c)
return c:IsFaceup() and c:IsRace(RACE_PYRO) and c:IsType(TYPE_LINK)
end
function c81012009.mtfilter(c,e)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_PENDULUM) and not c:IsImmuneToEffect(e)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_PENDULUM) and not c:IsImmuneToEffect(e)
end
function c81012009.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c81012009.mtfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,e) end
and Duel.IsExistingMatchingCard(c81012009.mtfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e) end
end
function c81012009.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c81012009.mtfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,e)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c81012009.mtfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e)
if g:GetCount()>0 then
Duel.Overlay(c,g)
end
......
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