Commit 305ec2db authored by TanakaKotoha's avatar TanakaKotoha

lua fix

parent 62424159
......@@ -13,14 +13,14 @@ function c33400402.initial_effect(c)
c:RegisterEffect(e0)
--To Hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(595626,1))
e1:SetDescription(aux.Stringid(33400402,1))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,595627)
e1:SetCondition(c595626.thcon)
e1:SetOperation(c595626.thop)
e1:SetCountLimit(1,33400402)
e1:SetCondition(c33400402.thcon)
e1:SetOperation(c33400402.thop)
c:RegisterEffect(e1)
end
function c33400402.spcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -61,9 +61,10 @@ function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
local rg = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, e:GetHandler())
if chk == 0 then
return Duel.GetLocationCount(tp, LOCATION_MZONE) > -2 and #rg > 1 and
aux.SelectUnselectGroup(rg, e, tp, 2, 2, s.ChkfMMZ(1), 0)
rg:CheckSubGroup(s.ChkfMMZ(1), 2, 2, tp)
end
local g = aux.SelectUnselectGroup(rg, e, tp, 2, 2, s.ChkfMMZ(1), 1, tp, HINTMSG_REMOVE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g = rg:SelectSubGroup(s.ChkfMMZ(1), tp, 2, 2, tp)
Duel.Remove(g, POS_FACEUP, REASON_COST)
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
......
......@@ -53,7 +53,7 @@ function s.MZFilter(c, tp)
return c:IsLocation(LOCATION_MZONE) and c:GetSequence() < 5 and c:IsControler(tp)
end
function s.ChkfMMZ(sumcount)
return function(sg, e, tp, mg)
return function(sg, tp)
return sg:FilterCount(s.MZFilter, nil, tp) + Duel.GetLocationCount(tp, LOCATION_MZONE) >= sumcount
end
end
......@@ -61,9 +61,10 @@ function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
local rg = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_HAND + LOCATION_MZONE + LOCATION_GRAVE, 0, e:GetHandler())
if chk == 0 then
return Duel.GetLocationCount(tp, LOCATION_MZONE) > -3 and #rg > 1 and
aux.SelectUnselectGroup(rg, e, tp, 3, 3, s.ChkfMMZ(1), 0)
rg:CheckSubGroup(s.ChkfMMZ(1), 3, 3, tp)
end
local g = aux.SelectUnselectGroup(rg, e, tp, 3, 3, s.ChkfMMZ(1), 1, tp, HINTMSG_REMOVE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g = rg:SelectSubGroup(s.ChkfMMZ(1), 3, 3, tp)
Duel.Remove(g, POS_FACEUP, REASON_COST)
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
......
......@@ -62,19 +62,17 @@ end
function s.tgfilter(c)
return c:IsSetCard(0x144e) and c:IsAbleToGrave()
end
function s.rescon(sg, e, tp, mg)
return sg:GetClassCount(Card.GetCode) == #sg
end
function s.tgtg(e, tp, eg, ep, ev, re, r, rp, chk)
local g = Duel.GetMatchingGroup(s.tgfilter, tp, LOCATION_DECK, 0, nil)
if chk == 0 then
return aux.SelectUnselectGroup(g, e, tp, 1, 4, s.rescon, chk)
return g:CheckSubGroup(aux.dncheck, 1, 4)
end
Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, g, 1, 0, 0)
end
function s.tgop(e, tp, eg, ep, ev, re, r, rp)
local g = Duel.GetMatchingGroup(s.tgfilter, tp, LOCATION_DECK, 0, nil, e, tp)
local dg = aux.SelectUnselectGroup(g, e, tp, 1, 4, s.rescon, 1, tp, HINTMSG_TOGRAVE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local dg = g:SelectSubGroup(aux.dncheck, tp, 1, 4)
if #dg > 0 then
local ct = Duel.SendtoGrave(dg, REASON_EFFECT)
if ct > 0 and Duel.Recover(tp, ct * 1000, REASON_EFFECT) > 0 then
......
......@@ -33,16 +33,14 @@ end
function s.tgfilter(c)
return c:IsSetCard(0x144e) and c:IsAbleToGrave()
end
function s.rescon(sg, e, tp, mg)
return sg:GetClassCount(Card.GetCode) == #sg
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
if not e:GetHandler():IsRelateToEffect(e) then
return
end
local g = Duel.GetMatchingGroup(s.tgfilter, tp, LOCATION_DECK, 0, nil)
if aux.SelectUnselectGroup(g, e, tp, 1, 3, s.rescon, 0) and Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
local dg = aux.SelectUnselectGroup(g, e, tp, 1, 3, s.rescon, 1, tp, HINTMSG_TOGRAVE)
if g:CheckSubGroup(aux.dncheck, 1, 3) and Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local dg = g:SelectSubGroup(aux.dncheck, tp, 1, 3)
Duel.SendtoGrave(dg, REASON_EFFECT)
end
end
......
......@@ -61,7 +61,7 @@ function c81011302.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c81011302.thfilter(c,lv)
return c:IsLevel(lv) and c:IsRace(RACE_DRAGON) and c:IsAbleToHand()
return c:IsLevel(lv) and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c81011302.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
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