Commit bb705aa6 authored by Tachibana's avatar Tachibana

nmbd

parent 8dd0231c
......@@ -8,7 +8,7 @@ function cm.initial_effect(c)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(cm.sptg)
......@@ -38,14 +38,24 @@ function cm.thfilter(c)
end
function cm.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then return cm.CheckGroup(mg,function(g) return g:GetClassCount(Card.GetCode)==1 end,nil,1,3) end
if chk==0 then return mg:CheckSubGroup(function(g) return g:GetClassCount(Card.GetCode)==1 end,nil,1,3) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,nil,tp,LOCATION_DECK)
end
function cm.spop1(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
local g=cm.SelectGroup(tp,HINTMSG_TODECK,mg,function(g) return g:GetClassCount(Card.GetCode)==1 end,nil,1,3)
local sg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if sg:GetCount()==0 then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=sg:Select(tp,1,1,nil)
sg:RemoveCard(hg:GetFirst())
sg=sg:Filter(Card.IsCode,nil,hg:GetFirst():GetCode())
if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
Duel.SendtoHand(g,tp,REASON_EFFECT)
local tg=sg:Select(tp,1,2,nil)
hg:Merge(tg)
end
Duel.SendtoHand(hg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,hg)
end
function cm.spfilter(c)
return c:IsSetCard(0xfa3) and c:IsType(TYPE_FUSION) and c.thop
......@@ -57,7 +67,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local tt=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=tt:GetFirst()
Duel.ConfirmCards(tc,1-tp)
Duel.ConfirmCards(1-tp,tc)
local op=tc.thop
if op then op(e,tp,eg,ep,ev,re,r,rp) 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