Commit 4f31dc31 authored by Nemo Ma's avatar Nemo Ma

fix

parent 6ea0013e
...@@ -60,16 +60,16 @@ function cm.negop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,16 +60,16 @@ function cm.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then if Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local ec=re:GetHandler() local ec=re:GetHandler()
local g=Group.CreateGroup() local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g) Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.cgefilter(tp)) Duel.ChangeChainOperation(ev,cm.cgefilter)
Duel.SendtoDeck(ec,nil,SEQ_DECKTOP,REASON_EFFECT) Duel.SendtoDeck(ec,nil,SEQ_DECKTOP,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil) local g2=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g2,REASON_EFFECT) Duel.SendtoGrave(g2,REASON_EFFECT)
end end
end end
function cm.cgefilter(tp) function cm.cgefilter(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end end
...@@ -154,7 +154,7 @@ function cm.tgop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -154,7 +154,7 @@ function cm.tgop2(e,tp,eg,ep,ev,re,r,rp)
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
end end
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT) Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end end
end end
end end
if key==1 then if key==1 then
...@@ -175,7 +175,7 @@ function cm.tgop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -175,7 +175,7 @@ function cm.tgop2(e,tp,eg,ep,ev,re,r,rp)
local g4=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,1,nil) local g4=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,1,nil)
local ck=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4)) local ck=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4))
if ck==0 then Duel.SendtoDeck(g4,nil,0,REASON_EFFECT) end if ck==0 then Duel.SendtoDeck(g4,nil,0,REASON_EFFECT) end
if ck==1 then Duel.SendtoDeck(g4,nil,1,REASON_EFFECT) end if ck==1 then Duel.SendtoDeck(g4,nil,1,REASON_EFFECT) end
end end
end end
if tc:IsCode(ac) then if tc:IsCode(ac) then
......
...@@ -44,24 +44,29 @@ function cm.lcheck(g,lc) ...@@ -44,24 +44,29 @@ function cm.lcheck(g,lc)
return g:IsExists(Card.IsLinkType,1,nil,TYPE_PENDULUM) return g:IsExists(Card.IsLinkType,1,nil,TYPE_PENDULUM)
end end
function cm.cfilter(c) function cm.cfilter(c)
return cm.MagiaDoll(c) and c:IsType(TYPE_PENDULUM) and c:IsAbleToExtraAsCost() and (c:IsFaceup() or c:IsLocation(LOCATION_DECK+LOCATION_HAND)) return cm.MagiaDoll(c) and c:GetOriginalType()&TYPE_PENDULUM~=0
and (c:IsFaceup() or c:IsLocation(LOCATION_DECK+LOCATION_HAND))
end
function cm.gselect(g,tp)
return Duel.GetLocationCountFromEx(tp,tp,g,TYPE_PENDULUM)>0
end end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_DECK,0,2,nil) end local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_DECK,0,nil)
if chk==0 then return g:CheckSubGroup(cm.gselect,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,0)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,0))
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_DECK,0,2,2,nil) local sg=g:SelectSubGroup(tp,cm.gselect,false,2,2,tp)
Duel.SendtoExtraP(g,nil,REASON_COST) Duel.SendtoExtraP(sg,nil,REASON_COST)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local c=e:GetHandler()
local ft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
if ft<=0 then return end if ft<=0 then return end
if ft>3 then ft=3 end if ft>3 then ft=3 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
...@@ -87,14 +92,14 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -87,14 +92,14 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
tc=g:GetNext() tc=g:GetNext()
end end
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
sg:KeepAlive() g:KeepAlive()
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetLabel(fid) e3:SetLabel(fid)
e3:SetLabelObject(sg) e3:SetLabelObject(g)
e3:SetCondition(cm.descon) e3:SetCondition(cm.descon)
e3:SetOperation(cm.desop) e3:SetOperation(cm.desop)
Duel.RegisterEffect(e3,tp) Duel.RegisterEffect(e3,tp)
......
...@@ -31,7 +31,10 @@ function s.initial_effect(c) ...@@ -31,7 +31,10 @@ function s.initial_effect(c)
end end
function s.cfilter(c,tp) function s.cfilter(c,tp)
return c:IsSetCard(0x2b) and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) return c:IsSetCard(0x2b) and Duel.IsExistingTarget(s.cfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c,tp)
end
function s.cfilter2(c,ec,tp)
return c:IsFaceup() and c:IsCanTurnSet() and Duel.CheckReleaseGroupEx(tp,Card.IsSetCard,1,Group.FromCards(c,ec),0x2b)
end end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,s.cfilter,1,e:GetHandler()) end if chk==0 then return Duel.CheckReleaseGroupEx(tp,s.cfilter,1,e:GetHandler()) end
...@@ -39,7 +42,7 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -39,7 +42,7 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function s.filter(c) function s.filter(c)
return c:IsFaceup() and c:IsCanTurnSet() and Duel.CheckReleaseGroupEx(tp,Card.IsSetCard,1,Group.FromCards(c,ec),0x2b) return c:IsFaceup() and c:IsCanTurnSet()
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
......
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