Commit fd8caf9c authored by POLYMER's avatar POLYMER

fix

parent 3b240249
...@@ -207,7 +207,7 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -207,7 +207,7 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) or not Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) then return false end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) or not Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS):Filter(cm.tgfilter,nil,re) local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS):Filter(cm.tgfilter,nil,re)
if #g>0 and Duel.SelectEffectYesNo(tp,e:GetHandler()) then if #g>0 and Duel.SelectEffectYesNo(tp,e:GetHandler()) then
local tc=g:GetFirst() local tg=g
if #g>1 then if #g>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
tg=g:Select(tp,1,#g,nil) tg=g:Select(tp,1,#g,nil)
......
...@@ -108,7 +108,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp) ...@@ -108,7 +108,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local tc=te:GetHandler() local tc=te:GetHandler()
local prop1,prop2=te:GetProperty() local prop1,prop2=te:GetProperty()
local eset={Duel.IsPlayerAffectedByEffect(tp,m)} local eset={Duel.IsPlayerAffectedByEffect(tp,m)}
if (tc:GetFlagEffect(m)>0 and prop2 and prop2&EFFECT_FLAG2_COF>0) or (tc:IsLocation(LOCATION_SZONE) and tc:IsType(TYPE_QUICKPLAY) and ((#eset>0 and tc:IsStatus(STATUS_SET_TURN) and tc:GetEffectCount(EFFECT_QP_ACT_IN_SET_TURN)<=#eset) or Duel.SelectYesNo(tp,aux.Stringid(m,3)))) then if (tc:GetFlagEffect(m)>0 and prop2 and prop2&EFFECT_FLAG2_COF>0) or (tc:IsLocation(LOCATION_SZONE) and tc:IsType(TYPE_QUICKPLAY) and ((#eset>0 and tc:IsStatus(STATUS_SET_TURN) and tc:GetEffectCount(EFFECT_QP_ACT_IN_SET_TURN)<=#eset) or (Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3))))) 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
e:GetHandler():RegisterFlagEffect(m+1,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+ph,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,15)) e:GetHandler():RegisterFlagEffect(m+1,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+ph,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,15))
...@@ -158,7 +158,7 @@ function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -158,7 +158,7 @@ function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
ct=Duel.Remove(sc,POS_FACEUP,REASON_EFFECT) ct=Duel.Remove(sc,POS_FACEUP,REASON_EFFECT)
end end
if ct~=0 and sc:IsLocation(LOCATION_REMOVED) and not sc:IsReason(REASON_REDIRECT) then if ct~=0 and sc:IsLocation(LOCATION_REMOVED) and not sc:IsReason(REASON_REDIRECT) then
sc:RegisterFlagEffect(m+4,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,8-flag,aux.Stringid(m+4,math.max(0,8-flag))) sc:RegisterFlagEffect(m+4,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,50-flag,aux.Stringid(m+4,math.max(0,8-flag)))
local rc=c local rc=c
if re and re:GetHandler() then rc=re:GetHandler() end if re and re:GetHandler() then rc=re:GetHandler() end
local e1=Effect.CreateEffect(rc) local e1=Effect.CreateEffect(rc)
...@@ -185,7 +185,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -185,7 +185,7 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local flag=c:GetFlagEffectLabel(m+4) local flag=c:GetFlagEffectLabel(m+4)
if not flag or e:GetLabel()~=c:GetFieldID() then if not flag or e:GetLabel()~=c:GetFieldID() then
e:Reset() e:Reset()
elseif flag>=9 then elseif flag>=51 then
c:ResetFlagEffect(m+4) c:ResetFlagEffect(m+4)
if c:IsPreviousLocation(LOCATION_ONFIELD) then if c:IsPreviousLocation(LOCATION_ONFIELD) then
--Duel.MoveToField(c,tp,c:GetPreviousControler(),c:GetPreviousLocation(),c:GetPreviousPosition(),true) --Duel.MoveToField(c,tp,c:GetPreviousControler(),c:GetPreviousLocation(),c:GetPreviousPosition(),true)
...@@ -199,6 +199,6 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -199,6 +199,6 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(c,nil,REASON_EFFECT+REASON_TEMPORARY) Duel.Remove(c,nil,REASON_EFFECT+REASON_TEMPORARY)
flag=flag+1 flag=flag+1
c:ResetFlagEffect(m+4) c:ResetFlagEffect(m+4)
c:RegisterFlagEffect(m+4,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,flag,aux.Stringid(m+4,flag)) c:RegisterFlagEffect(m+4,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,flag,aux.Stringid(m+4,math.max(0,flag-42)))
end end
end end
\ No newline at end of file
...@@ -44,15 +44,32 @@ function cm.fselect2(g) ...@@ -44,15 +44,32 @@ function cm.fselect2(g)
local ct3=g:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE) local ct3=g:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)
return ct1%2==0 and ct3%2==0 return ct1%2==0 and ct3%2==0
end end
function cm.fselect3(g)
local ct2=g:FilterCount(cm.sfilter,nil)
return #g%2==0 and #g<=2*ct2
end
function cm.fselect4(g)
return #g%2==0
end
function cm.fselect5(g)
local ct4=g:FilterCount(cm.mfilter,nil)
return #g<=2*ct4
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
if chkc then return false end if chkc then return false end
if chk==0 then return (Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,c) and Duel.IsExistingTarget(cm.sfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c,e)) or (Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_GRAVE,LOCATION_GRAVE,2,nil) and Duel.IsExistingTarget(cm.mfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e)) end if chk==0 then return (Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,c) and Duel.IsExistingTarget(cm.sfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c,e)) or (Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_GRAVE,LOCATION_GRAVE,2,nil) and Duel.IsExistingTarget(cm.mfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e)) end
local g=Duel.GetMatchingGroup(Card.IsCanBeEffectTarget,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,c,e) --local g=Duel.GetMatchingGroup(Card.IsCanBeEffectTarget,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,c,e)
local g1=Duel.GetMatchingGroup(Card.IsCanBeEffectTarget,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c,e)
local g2=Duel.GetMatchingGroup(Card.IsCanBeEffectTarget,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e)
local g3=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
--aux.GCheckAdditional=cm.fselect --aux.GCheckAdditional=cm.fselect
local tg=g:SelectSubGroup(tp,cm.fselect,false,2,#g) local tg=g1:SelectSubGroup(tp,cm.fselect3,false,0,#g1)
--aux.GCheckAdditional=nil aux.GCheckAdditional=cm.fselect5
local tg2=g2:SelectSubGroup(tp,cm.fselect4,false,math.max(0,2-#g1),#g2)
aux.GCheckAdditional=nil
tg:Merge(tg2)
Duel.SetTargetCard(tg) Duel.SetTargetCard(tg)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -113,6 +113,7 @@ function cm.dsop(e,tp,eg,ep,ev,re,r,rp) ...@@ -113,6 +113,7 @@ function cm.dsop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectEffectYesNo(tp,c) then if Duel.SelectEffectYesNo(tp,c) then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
Duel.SSet(tp,c,tp,true) Duel.SSet(tp,c,tp,true)
c:RegisterFlagEffect(m-10,RESET_CHAIN,0,1)
cm.thop(e,tp,eg,ep,ev,re,r,rp) cm.thop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
...@@ -149,7 +150,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -149,7 +150,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.clfilter(c,tp,i) function cm.clfilter(c,tp,i)
return aux.GetColumn(c,tp)==i and not c:IsStatus(STATUS_SUMMONING) return aux.GetColumn(c,tp)==i and not c:IsStatus(STATUS_SUMMONING) and c:GetFlagEffect(m-10)==0
end end
function cm.thcon2(e,tp,eg,ep,ev,re,r,rp) function cm.thcon2(e,tp,eg,ep,ev,re,r,rp)
local ng=Duel.GetMatchingGroup(cm.clfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp,e:GetLabel()) local ng=Duel.GetMatchingGroup(cm.clfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp,e:GetLabel())
......
...@@ -34,8 +34,11 @@ end ...@@ -34,8 +34,11 @@ end
function cm.LConditionFilter(c,f,lc) function cm.LConditionFilter(c,f,lc)
return (((c:IsFaceup() or not c:IsOnField()) and c:IsCanBeLinkMaterial(lc)) or (Duel.GetFlagEffect(lc:GetControler(),m)<=Duel.GetTurnCount() and cm.fdfilter(c))) and (not f or f(c)) return (((c:IsFaceup() or not c:IsOnField()) and c:IsCanBeLinkMaterial(lc)) or (Duel.GetFlagEffect(lc:GetControler(),m)<=Duel.GetTurnCount() and cm.fdfilter(c))) and (not f or f(c))
end end
function cm.LConditionFilter2(c,f,lc)
return (((c:IsFaceup() or not c:IsOnField()) and c:IsCanBeLinkMaterial(lc) and c:IsLocation(LOCATION_MZONE)) or (Duel.GetFlagEffect(lc:GetControler(),m)<=Duel.GetTurnCount() and cm.fdfilter(c))) and (not f or f(c))
end
function cm.GetLinkMaterials(tp,f,lc) function cm.GetLinkMaterials(tp,f,lc)
local mg=Duel.GetMatchingGroup(cm.LConditionFilter,tp,LOCATION_ONFIELD,0,nil,f,lc) local mg=Duel.GetMatchingGroup(cm.LConditionFilter2,tp,LOCATION_ONFIELD,0,nil,f,lc)
local mg2=Duel.GetMatchingGroup(aux.LExtraFilter,tp,LOCATION_HAND+LOCATION_SZONE,LOCATION_ONFIELD,nil,f,lc,tp) local mg2=Duel.GetMatchingGroup(aux.LExtraFilter,tp,LOCATION_HAND+LOCATION_SZONE,LOCATION_ONFIELD,nil,f,lc,tp)
if mg2:GetCount()>0 then mg:Merge(mg2) end if mg2:GetCount()>0 then mg:Merge(mg2) end
return mg return mg
......
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