Commit dc319905 authored by POLYMER's avatar POLYMER

fix

parent 2dd10fe8
...@@ -110,7 +110,7 @@ function c10150075.setcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -110,7 +110,7 @@ function c10150075.setcon(e,tp,eg,ep,ev,re,r,rp)
end end
function c10150075.setop(e,tp,eg,ep,ev,re,r,rp) function c10150075.setop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler() local rc=re:GetHandler()
if rc:IsRelateToEffect(re) and Duel.SelectYesNo(tp,aux.Stringid(10150075,0)) then if rc:IsRelateToEffect(re) and rc:IsFaceup() and Duel.SelectYesNo(tp,aux.Stringid(10150075,0)) then
Duel.Hint(HINT_CARD,0,10150075) Duel.Hint(HINT_CARD,0,10150075)
rc:CancelToGrave() rc:CancelToGrave()
Duel.ChangePosition(rc,POS_FACEDOWN) Duel.ChangePosition(rc,POS_FACEDOWN)
......
...@@ -55,6 +55,7 @@ function cm.initial_effect(c) ...@@ -55,6 +55,7 @@ function cm.initial_effect(c)
end end
end end
function cm.check(e,tp,eg,ep,ev,re,r,rp) function cm.check(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnCount()<=0 then return end
for tc in aux.Next(eg) do for tc in aux.Next(eg) do
if tc:IsPreviousLocation(LOCATION_DECK) and tc:IsLocation(LOCATION_HAND) then if tc:IsPreviousLocation(LOCATION_DECK) and tc:IsLocation(LOCATION_HAND) then
local p=tc:GetControler() local p=tc:GetControler()
...@@ -111,7 +112,7 @@ function cm.imop(e,tp,eg,ep,ev,re,r,rp) ...@@ -111,7 +112,7 @@ function cm.imop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(0x20000000+m+1) e2:SetCode(EFFECT_FLAG_EFFECT+m+1)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(e:GetHandler():GetLocation()) e2:SetRange(e:GetHandler():GetLocation())
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
...@@ -127,14 +128,15 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -127,14 +128,15 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(rp,m+2)==0 and #g>0 then --and Duel.SelectYesNo(rp,aux.Stringid(m,1)) then if Duel.GetFlagEffect(rp,m+2)==0 and #g>0 then --and Duel.SelectYesNo(rp,aux.Stringid(m,1)) then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,rp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,rp,HINTMSG_ATOHAND)
local tc=g:Select(rp,0,1,nil):GetFirst() local tg=g:CancelableSelect(rp,0,1,nil)
if not tc then if not tg then
if cm[rp+10]==nil then if cm[rp+10]==nil then
cm[rp+10]=Duel.SelectYesNo(rp,aux.Stringid(m,3)) cm[rp+10]=Duel.SelectYesNo(rp,aux.Stringid(m,3))
end end
if cm[rp+10] then Duel.RegisterFlagEffect(rp,m+2,RESET_CHAIN,0,1) end if cm[rp+10] then Duel.RegisterFlagEffect(rp,m+2,RESET_CHAIN,0,1) end
return return
end end
local tc=tg:GetFirst()
if Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND) then if Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND) then
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,4)) tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,4))
Duel.ConfirmCards(1-rp,tc) Duel.ConfirmCards(1-rp,tc)
......
...@@ -24,6 +24,7 @@ function cm.initial_effect(c) ...@@ -24,6 +24,7 @@ function cm.initial_effect(c)
local _CRemoveOverlayCard=Card.RemoveOverlayCard local _CRemoveOverlayCard=Card.RemoveOverlayCard
local _FilterSelect=Group.FilterSelect local _FilterSelect=Group.FilterSelect
local _Select=Group.Select local _Select=Group.Select
local _CancelableSelect=Group.CancelableSelect
local _SelectUnselect=Group.SelectUnselect local _SelectUnselect=Group.SelectUnselect
local function Local_RandomSelect(g,tp,ct) local function Local_RandomSelect(g,tp,ct)
local cg=g:Clone() local cg=g:Clone()
...@@ -167,6 +168,23 @@ function cm.initial_effect(c) ...@@ -167,6 +168,23 @@ function cm.initial_effect(c)
return _Select(g,sp,min,max,nc) return _Select(g,sp,min,max,nc)
end end
end end
function Group.CancelableSelect(g,sp,min,max,nc)
if Duel.GetFlagEffect(0,m)>0 and min<=1 and max==1 then
local ng=g:Clone()
if aux.GetValueType(nc)=="Card" then ng:RemoveCard(nc) end
if aux.GetValueType(nc)=="Group" then ng:Sub(nc) end
if not Duel.SelectYesNo(sp,aux.Stringid(m,2)) then return Group.CreateGroup() end
Duel.Hint(HINT_CARD,0,m)
--local ct=Duel.GetFlagEffectLabel(sp,m)
--Duel.SetFlagEffectLabel(sp,m,ct+1)
cm[sp]=cm[sp]+1
local tg=ng:RandomSelect(sp,1)
if tg:GetFirst() and tg:GetFirst():IsLocation(LOCATION_DECK+LOCATION_EXTRA) then Duel.ConfirmCards(sp,tg) end
return tg
else
return _CancelableSelect(g,sp,min,max,nc)
end
end
function Group.SelectUnselect(cg,sg,sp,finish,cancel,...) function Group.SelectUnselect(cg,sg,sp,finish,cancel,...)
if Duel.GetFlagEffect(0,m)>0 then return _SelectUnselect(cg,sg,sp,finish,false,...) end if Duel.GetFlagEffect(0,m)>0 then return _SelectUnselect(cg,sg,sp,finish,false,...) end
return _SelectUnselect(cg,sg,sp,finish,cancel,...) return _SelectUnselect(cg,sg,sp,finish,cancel,...)
......
...@@ -166,14 +166,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -166,14 +166,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local tg=g:Filter(function(c) return c:IsFacedown() and c:IsControler(1-tp) end,nil) local tg=g:Filter(function(c) return c:IsFacedown() and c:IsControler(1-tp) end,nil)
Duel.ConfirmCards(tp,tg) Duel.ConfirmCards(tp,tg)
Duel.Hint(HINT_SELECTMSG,0,aux.Stringid(11451031,4)) Duel.Hint(HINT_SELECTMSG,0,aux.Stringid(11451031,4))
local sc=g:Select(tp,0,1,nil):GetFirst() local sg=g:CancelableSelect(tp,0,1,nil)
if not sc then if not sg then
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
if ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then ph=PHASE_BATTLE end if ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then ph=PHASE_BATTLE end
Duel.RegisterFlagEffect(tp,11451031,RESET_PHASE+ph,0,1) Duel.RegisterFlagEffect(tp,11451031,RESET_PHASE+ph,0,1)
pnfl_adjusting=false pnfl_adjusting=false
return return
end end
local sc=sg:GetFirst()
PNFL_MIRROR_ACTIVATE[tp]={} PNFL_MIRROR_ACTIVATE[tp]={}
for ce,te in pairs(PNFL_MIRROR_COPY[tp]) do for ce,te in pairs(PNFL_MIRROR_COPY[tp]) do
local tg=ce:GetTarget() or aux.TRUE local tg=ce:GetTarget() or aux.TRUE
...@@ -323,7 +324,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp) ...@@ -323,7 +324,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end end
end end
function cm.costop2(e,tp,eg,ep,ev,re,r,rp) function cm.costop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -165,14 +165,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -165,14 +165,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local tg=g:Filter(function(c) return c:IsFacedown() and c:IsControler(1-tp) end,nil) local tg=g:Filter(function(c) return c:IsFacedown() and c:IsControler(1-tp) end,nil)
Duel.ConfirmCards(tp,tg) Duel.ConfirmCards(tp,tg)
Duel.Hint(HINT_SELECTMSG,0,aux.Stringid(11451031,4)) Duel.Hint(HINT_SELECTMSG,0,aux.Stringid(11451031,4))
local sc=g:Select(tp,0,1,nil):GetFirst() local sg=g:CancelableSelect(tp,0,1,nil)
if not sc then if not sg then
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
if ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then ph=PHASE_BATTLE end if ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then ph=PHASE_BATTLE end
Duel.RegisterFlagEffect(tp,11451031,RESET_PHASE+ph,0,1) Duel.RegisterFlagEffect(tp,11451031,RESET_PHASE+ph,0,1)
pnfl_adjusting=false pnfl_adjusting=false
return return
end end
local sc=sg:GetFirst()
PNFL_MIRROR_ACTIVATE[tp]={} PNFL_MIRROR_ACTIVATE[tp]={}
for ce,te in pairs(PNFL_MIRROR_COPY[tp]) do for ce,te in pairs(PNFL_MIRROR_COPY[tp]) do
local tg=ce:GetTarget() or aux.TRUE local tg=ce:GetTarget() or aux.TRUE
......
...@@ -163,14 +163,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -163,14 +163,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local tg=g:Filter(function(c) return c:IsFacedown() and c:IsControler(1-tp) end,nil) local tg=g:Filter(function(c) return c:IsFacedown() and c:IsControler(1-tp) end,nil)
Duel.ConfirmCards(tp,tg) Duel.ConfirmCards(tp,tg)
Duel.Hint(HINT_SELECTMSG,0,aux.Stringid(11451031,4)) Duel.Hint(HINT_SELECTMSG,0,aux.Stringid(11451031,4))
local sc=g:Select(tp,0,1,nil):GetFirst() local sg=g:CancelableSelect(tp,0,1,nil)
if not sc then if not sg then
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
if ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then ph=PHASE_BATTLE end if ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then ph=PHASE_BATTLE end
Duel.RegisterFlagEffect(tp,11451031,RESET_PHASE+ph,0,1) Duel.RegisterFlagEffect(tp,11451031,RESET_PHASE+ph,0,1)
pnfl_adjusting=false pnfl_adjusting=false
return return
end end
local sc=sg:GetFirst()
PNFL_MIRROR_ACTIVATE[tp]={} PNFL_MIRROR_ACTIVATE[tp]={}
for ce,te in pairs(PNFL_MIRROR_COPY[tp]) do for ce,te in pairs(PNFL_MIRROR_COPY[tp]) do
local tg=ce:GetTarget() or aux.TRUE local tg=ce:GetTarget() or aux.TRUE
......
...@@ -161,14 +161,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -161,14 +161,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local tg=g:Filter(function(c) return c:IsFacedown() and c:IsControler(1-tp) end,nil) local tg=g:Filter(function(c) return c:IsFacedown() and c:IsControler(1-tp) end,nil)
Duel.ConfirmCards(tp,tg) Duel.ConfirmCards(tp,tg)
Duel.Hint(HINT_SELECTMSG,0,aux.Stringid(11451031,4)) Duel.Hint(HINT_SELECTMSG,0,aux.Stringid(11451031,4))
local sc=g:Select(tp,0,1,nil):GetFirst() local sg=g:CancelableSelect(tp,0,1,nil)
if not sc then if not sg then
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
if ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then ph=PHASE_BATTLE end if ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then ph=PHASE_BATTLE end
Duel.RegisterFlagEffect(tp,11451031,RESET_PHASE+ph,0,1) Duel.RegisterFlagEffect(tp,11451031,RESET_PHASE+ph,0,1)
pnfl_adjusting=false pnfl_adjusting=false
return return
end end
local sc=sg:GetFirst()
PNFL_MIRROR_ACTIVATE[tp]={} PNFL_MIRROR_ACTIVATE[tp]={}
for ce,te in pairs(PNFL_MIRROR_COPY[tp]) do for ce,te in pairs(PNFL_MIRROR_COPY[tp]) do
local tg=ce:GetTarget() or aux.TRUE local tg=ce:GetTarget() or aux.TRUE
......
...@@ -132,7 +132,7 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -132,7 +132,7 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local mt=1 local mt=1
if tab[3]&(1<<i)~=0 then mt=2 end if tab[3]&(1<<i)~=0 then mt=2 end
local g=Duel.GetMatchingGroup(cm.desfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp,i) local g=Duel.GetMatchingGroup(cm.desfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp,i)
if #g>0 then dg:Merge(g:Select(tp,0,mt,nil)) end if #g>0 then dg:Merge(g:CancelableSelect(tp,0,mt,nil)) end
end end
end end
Duel.Destroy(dg,REASON_EFFECT) Duel.Destroy(dg,REASON_EFFECT)
......
...@@ -230,12 +230,19 @@ function cm.mvop(e,tp,eg,ep,ev,re,r,rp,opt,lab) ...@@ -230,12 +230,19 @@ function cm.mvop(e,tp,eg,ep,ev,re,r,rp,opt,lab)
local chk=false local chk=false
local g2=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil) local g2=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local g1=Duel.GetMatchingGroup(cm.tffilter,tp,LOCATION_REMOVED,0,nil) local g1=Duel.GetMatchingGroup(cm.tffilter,tp,LOCATION_REMOVED,0,nil)
if ct>=1 and #g2>0 then if ct>=1 and #(g1+g2)>0 then
if opt==2 then return true end if opt==2 then return true end
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
if #g1==0 or Duel.SelectYesNo(tp,aux.Stringid(m,b1)) then end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) if ct>=1 and #g2>0 then
local sg=g2:Select(tp,1,ct,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Group.CreateGroup()
if #g1==0 then
sg=g2:Select(tp,1,ct,nil)
else
sg=g2:CancelableSelect(tp,0,ct,nil)
end
if sg and #sg>0 then
ct=ct-#sg ct=ct-#sg
chk=true chk=true
if fid~=0 then Duel.RaiseEvent(c,11451718,e,fid,0,0,0) end if fid~=0 then Duel.RaiseEvent(c,11451718,e,fid,0,0,0) end
...@@ -245,11 +252,13 @@ function cm.mvop(e,tp,eg,ep,ev,re,r,rp,opt,lab) ...@@ -245,11 +252,13 @@ function cm.mvop(e,tp,eg,ep,ev,re,r,rp,opt,lab)
end end
g1=Duel.GetMatchingGroup(cm.tffilter,tp,LOCATION_REMOVED,0,nil) g1=Duel.GetMatchingGroup(cm.tffilter,tp,LOCATION_REMOVED,0,nil)
if ct>=1 and #g1>0 then if ct>=1 and #g1>0 then
if opt==2 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
Duel.HintSelection(Group.FromCards(c)) if not chk then
if not chk or Duel.SelectYesNo(tp,aux.Stringid(m,b1+4)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sg=g1:Select(tp,1,ct,nil) local sg=g1:Select(tp,1,ct,nil)
else
sg=g1:CancelableSelect(tp,0,ct,nil)
end
if sg and #sg>0 then
if fid~=0 then Duel.RaiseEvent(c,11451718,e,fid,0,0,0) end if fid~=0 then Duel.RaiseEvent(c,11451718,e,fid,0,0,0) end
if opt==1 then Duel.RegisterFlagEffect(tp,0xffffff+m,RESET_PHASE+PHASE_END,0,1) end if opt==1 then Duel.RegisterFlagEffect(tp,0xffffff+m,RESET_PHASE+PHASE_END,0,1) end
sg:ForEach(cm.returntofield,e) sg:ForEach(cm.returntofield,e)
......
...@@ -412,10 +412,10 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -412,10 +412,10 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local bg=ng:GetMinGroup(cm.distance2,ac,tp) local bg=ng:GetMinGroup(cm.distance2,ac,tp)
if bg and #bg>0 then if bg and #bg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
bc=bg:Select(tp,0,1,nil):GetFirst() local bcg=bg:CancelableSelect(tp,0,1,nil)
if bc then if bcg then
Duel.HintSelection(Group.FromCards(bc)) Duel.HintSelection(bcg)
rg:AddCard(bc) rg:Merge(bcg)
end end
end end
end end
......
...@@ -94,20 +94,20 @@ function cm.acfilter(c,tp) ...@@ -94,20 +94,20 @@ function cm.acfilter(c,tp)
return c:IsSetCard(0xc976) and c:IsAbleToGraveAsCost() and Duel.GetFlagEffect(0,m+code+0xffffff)==0 and (not code2 or Duel.GetFlagEffect(0,m+code2+0xffffff)==0) --and not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,c:GetCode()) return c:IsSetCard(0xc976) and c:IsAbleToGraveAsCost() and Duel.GetFlagEffect(0,m+code+0xffffff)==0 and (not code2 or Duel.GetFlagEffect(0,m+code2+0xffffff)==0) --and not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,c:GetCode())
end end
function Group.ForEach(group,func,...) function Group.ForEach(group,func,...)
if aux.GetValueType(group)=="Group" and group:GetCount()>0 then if aux.GetValueType(group)=="Group" and group:GetCount()>0 then
local d_group=group:Clone() local d_group=group:Clone()
for tc in aux.Next(d_group) do for tc in aux.Next(d_group) do
func(tc,...) func(tc,...)
end end
end end
end end
function cm.acop(e,tp,eg,ep,ev,re,r,rp) function cm.acop(e,tp,eg,ep,ev,re,r,rp)
if cm[0] then return end if cm[0] then return end
if e:GetHandler():GetFlagEffect(m)>0 then return end if e:GetHandler():GetFlagEffect(m)>0 then return end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1) e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.acfilter,tp,LOCATION_DECK,0,0,1,nil,tp) local g=Duel.GetMatchingGroup(cm.acfilter,tp,LOCATION_DECK,0,nil,tp):CancelableSelect(tp,0,1,nil)
if #g>0 then if g and #g>0 then
local code,code2=g:GetFirst():GetCode() local code,code2=g:GetFirst():GetCode()
Duel.RegisterFlagEffect(0,m+code+0xffffff,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(0,m+code+0xffffff,RESET_PHASE+PHASE_END,0,1)
if code2 then Duel.RegisterFlagEffect(0,m+code2+0xffffff,RESET_PHASE+PHASE_END,0,1) end if code2 then Duel.RegisterFlagEffect(0,m+code2+0xffffff,RESET_PHASE+PHASE_END,0,1) end
......
...@@ -273,9 +273,9 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp,c,sg,og) ...@@ -273,9 +273,9 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
local tp=c:GetControler() local tp=c:GetControler()
local bg=Duel.GetMatchingGroup(cm.spcfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,0,c,e,tp) local bg=Duel.GetMatchingGroup(cm.spcfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,0,c,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local bc=bg:Select(tp,0,1,nil):GetFirst() local bcg=bg:CancelableSelect(tp,0,1,nil)
if bc then if bcg then
sg:AddCard(bc) sg:Merge(bcg)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end end
end end
\ No newline at end of file
...@@ -115,7 +115,7 @@ function cm.initial_effect(c) ...@@ -115,7 +115,7 @@ function cm.initial_effect(c)
Duel.RegisterEffect(ge6,0) Duel.RegisterEffect(ge6,0)
local ge7=Effect.CreateEffect(c) local ge7=Effect.CreateEffect(c)
ge7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge7:SetCode(EVENT_PHASE+PHASE_END) ge7:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge7:SetOperation(cm.clear2) ge7:SetOperation(cm.clear2)
Duel.RegisterEffect(ge7,0) Duel.RegisterEffect(ge7,0)
end end
......
...@@ -83,8 +83,8 @@ function cm.initial_effect(c) ...@@ -83,8 +83,8 @@ function cm.initial_effect(c)
local tp=tc:GetControler() local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.SelectMatchingCard(tp,cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,0,1,nil,cm[1],tp,tc) local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,0,1,nil)
if #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) cm[1]=nil Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _Merge(sg,tg) end if tg and #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) cm[1]=nil Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _Merge(sg,tg) end
end end
cm[1]=nil cm[1]=nil
return _Merge(sg,obj) return _Merge(sg,obj)
...@@ -95,8 +95,8 @@ function cm.initial_effect(c) ...@@ -95,8 +95,8 @@ function cm.initial_effect(c)
local tp=tc:GetControler() local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.SelectMatchingCard(tp,cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,0,1,nil,nil,tp,tc) local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,0,1,nil)
if #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) local tc2=tg:GetFirst() tc2.pendulum_rule[tc2]:SetLabel(1) if tc.pendulum_rule and tc.pendulum_rule[tc] then tc.pendulum_rule[tc]:SetLabel(0) end Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _SpecialSummonRule(tp,tc2,SUMMON_TYPE_PENDULUM) end if tg and #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) local tc2=tg:GetFirst() tc2.pendulum_rule[tc2]:SetLabel(1) if tc.pendulum_rule and tc.pendulum_rule[tc] then tc.pendulum_rule[tc]:SetLabel(0) end Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _SpecialSummonRule(tp,tc2,SUMMON_TYPE_PENDULUM) end
end end
_SpecialSummonRule(tp,tc,sumtype) _SpecialSummonRule(tp,tc,sumtype)
end end
......
...@@ -83,8 +83,8 @@ function cm.initial_effect(c) ...@@ -83,8 +83,8 @@ function cm.initial_effect(c)
local tp=tc:GetControler() local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.SelectMatchingCard(tp,cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,0,1,nil,cm[1],tp,tc) local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,0,1,nil)
if #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) cm[1]=nil Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _Merge(sg,tg) end if tg and #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) cm[1]=nil Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _Merge(sg,tg) end
end end
cm[1]=nil cm[1]=nil
return _Merge(sg,obj) return _Merge(sg,obj)
...@@ -95,8 +95,8 @@ function cm.initial_effect(c) ...@@ -95,8 +95,8 @@ function cm.initial_effect(c)
local tp=tc:GetControler() local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.SelectMatchingCard(tp,cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,0,1,nil,nil,tp,tc) local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,0,1,nil)
if #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) local tc2=tg:GetFirst() tc2.pendulum_rule[tc2]:SetLabel(1) if tc.pendulum_rule and tc.pendulum_rule[tc] then tc.pendulum_rule[tc]:SetLabel(0) end Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _SpecialSummonRule(tp,tc2,SUMMON_TYPE_PENDULUM) end if tg and #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) local tc2=tg:GetFirst() tc2.pendulum_rule[tc2]:SetLabel(1) if tc.pendulum_rule and tc.pendulum_rule[tc] then tc.pendulum_rule[tc]:SetLabel(0) end Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _SpecialSummonRule(tp,tc2,SUMMON_TYPE_PENDULUM) end
end end
_SpecialSummonRule(tp,tc,sumtype) _SpecialSummonRule(tp,tc,sumtype)
end end
......
...@@ -82,8 +82,8 @@ function cm.initial_effect(c) ...@@ -82,8 +82,8 @@ function cm.initial_effect(c)
local tp=tc:GetControler() local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.SelectMatchingCard(tp,cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,0,1,nil,cm[1],tp,tc) local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,0,1,nil)
if #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) cm[1]=nil Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _Merge(sg,tg) end if tg and #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) cm[1]=nil Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _Merge(sg,tg) end
end end
cm[1]=nil cm[1]=nil
return _Merge(sg,obj) return _Merge(sg,obj)
...@@ -94,8 +94,8 @@ function cm.initial_effect(c) ...@@ -94,8 +94,8 @@ function cm.initial_effect(c)
local tp=tc:GetControler() local tp=tc:GetControler()
if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then if 1==1 then --and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11451912,0))
local tg=Duel.SelectMatchingCard(tp,cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,0,1,nil,nil,tp,tc) local tg=Duel.GetMatchingGroup(cm.tspfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,nil,tp,tc):CancelableSelect(tp,0,1,nil)
if #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) local tc2=tg:GetFirst() tc2.pendulum_rule[tc2]:SetLabel(1) if tc.pendulum_rule and tc.pendulum_rule[tc] then tc.pendulum_rule[tc]:SetLabel(0) end Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _SpecialSummonRule(tp,tc2,SUMMON_TYPE_PENDULUM) end if tg and #tg>0 then Duel.RegisterFlagEffect(tp,tg:GetFirst():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1) local tc2=tg:GetFirst() tc2.pendulum_rule[tc2]:SetLabel(1) if tc.pendulum_rule and tc.pendulum_rule[tc] then tc.pendulum_rule[tc]:SetLabel(0) end Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(11451912,6)) return _SpecialSummonRule(tp,tc2,SUMMON_TYPE_PENDULUM) end
end end
_SpecialSummonRule(tp,tc,sumtype) _SpecialSummonRule(tp,tc,sumtype)
end end
......
...@@ -10,6 +10,7 @@ function cm.initial_effect(c) ...@@ -10,6 +10,7 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN) e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(cm.spcon) e1:SetCondition(cm.spcon)
--e1:SetCost(cm.spcost)
e1:SetTarget(cm.sptg) e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop) e1:SetOperation(cm.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -30,6 +31,32 @@ end ...@@ -30,6 +31,32 @@ end
function cm.tdfilter(c) function cm.tdfilter(c)
return c:IsAbleToHand() or (c:IsLocation(LOCATION_MZONE) and c:IsCanTurnSet()) return c:IsAbleToHand() or (c:IsLocation(LOCATION_MZONE) and c:IsCanTurnSet())
end end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return true end
if not c:IsPublic() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,6))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e:GetHandler():RegisterEffect(e1)
else
e:GetHandler():RegisterFlagEffect(11451544,RESET_EVENT+RESETS_STANDARD,0,1)
local eset={e:GetHandler():IsHasEffect(EFFECT_PUBLIC)}
if #eset>0 then
for _,ae in pairs(eset) do
if ae:IsHasType(EFFECT_TYPE_SINGLE) then
ae:Reset()
else
local tg=ae:GetTarget() or aux.TRUE
ae:SetTarget(function(e,c,...) return tg(e,c,...) and c:GetFlagEffect(11451544)==0 end)
end
end
end
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)
local ec=eg:GetFirst() local ec=eg:GetFirst()
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND,0,nil,tp,POS_FACEDOWN) local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND,0,nil,tp,POS_FACEDOWN)
...@@ -49,7 +76,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,7 +76,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local b3=Duel.GetTurnPlayer()==tp local b3=Duel.GetTurnPlayer()==tp
if #g>0 and (b1 or b2 or b3) and Duel.GetCurrentChain()>1 then if #g>0 and (b1 or b2 or b3) and Duel.GetCurrentChain()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g:Select(tp,0,Duel.GetCurrentChain()-1,nil) local rg=g:CancelableSelect(tp,0,Duel.GetCurrentChain()-1,nil)
if not rg or #rg==0 then return end if not rg or #rg==0 then return end
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT) Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
local fid=c:GetFieldID() local fid=c:GetFieldID()
......
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