Commit e132422d authored by POLYMER's avatar POLYMER

fix

parent 54395996
...@@ -152,11 +152,53 @@ function cm.spfilter(c,e,tp) ...@@ -152,11 +152,53 @@ function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.leave(e,tp,eg,ep,ev,re,r,rp) function cm.leave(e,tp,eg,ep,ev,re,r,rp)
local b1=r&REASON_SUMMON>0 or (re and (re:GetCode()==EFFECT_SUMMON_PROC or re:GetCode()==EFFECT_SUMMON_COST or re:GetCode()==EVENT_SUMMON)) or Duel.CheckEvent(EVENT_SUMMON)
local b2=re and (re:GetCode()==EFFECT_SET_PROC or re:GetCode()==EFFECT_MSET_COST)
local b3=(re and (re:GetCode()==EFFECT_SPSUMMON_PROC or re:GetCode()==EFFECT_SPSUMMON_PROC_G or re:GetCode()==EFFECT_SPSUMMON_COST or re:GetCode()==EVENT_SPSUMMON)) or Duel.CheckEvent(EVENT_SPSUMMON) --and (not re:GetHandler():IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,nil,re:GetHandler())==Duel.GetLocationCountFromEx(tp,tp,nil,re:GetHandler(),0x1f))
local c=e:GetHandler() local c=e:GetHandler()
if c:IsPreviousControler(tp) then if c:IsPreviousControler(tp) then
local og=c:GetOverlayGroup() local og=c:GetOverlayGroup()
local tg=og:Filter(cm.spfilter,nil,e,tp) local tg=og:Filter(cm.spfilter,nil,e,tp)
if #tg==0 then return end if #tg==0 then return end
if b1 or b2 or b3 then
tg:ForEach(Card.RegisterFlagEffect,m,RESET_EVENT+RESETS_STANDARD-RESET_TOGRAVE-RESET_REMOVE,0,1,c:GetFieldID())
if b1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetLabel(c:GetFieldID())
e1:SetOperation(cm.leave2)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_SUMMON_NEGATED)
Duel.RegisterEffect(e2,tp)
e1:SetLabelObject(e2)
e2:SetLabelObject(e1)
elseif b2 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_MSET)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetLabel(c:GetFieldID())
e1:SetOperation(cm.leave2)
Duel.RegisterEffect(e1,tp)
elseif b3 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetLabel(c:GetFieldID())
e1:SetOperation(cm.leave2)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_NEGATED)
Duel.RegisterEffect(e2,tp)
e1:SetLabelObject(e2)
e2:SetLabelObject(e1)
end
return
end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
...@@ -166,4 +208,23 @@ function cm.leave(e,tp,eg,ep,ev,re,r,rp) ...@@ -166,4 +208,23 @@ function cm.leave(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
end end
end
function cm.ffilter(c,fid)
return c:GetFlagEffect(m)>0 and fid==c:GetFlagEffectLabel(m)
end
function cm.leave2(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if te and aux.GetValueType(te)=="Effect" then te:Reset() end
e:Reset()
local og=Duel.GetMatchingGroup(cm.ffilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e:GetLabel())
local tg=og:Filter(cm.spfilter,nil,e,tp)
if #tg==0 then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:Select(tp,ft,ft,nil)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end end
\ No newline at end of file
...@@ -58,7 +58,7 @@ function cm.repfilter(c,re) ...@@ -58,7 +58,7 @@ function cm.repfilter(c,re)
end end
function cm.desreptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.repfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,c,e) and c:IsCanRemoveCounter(0x1441,2,REASON_EFFECT+REASON_REPLACE) end if chk==0 then return Duel.IsExistingMatchingCard(cm.repfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,c,e) and c:IsCanRemoveCounter(tp,0x1441,2,REASON_EFFECT+REASON_REPLACE) end
if Duel.SelectEffectYesNo(tp,c,96) then if Duel.SelectEffectYesNo(tp,c,96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectMatchingCard(tp,cm.repfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,1,c,e) local g=Duel.SelectMatchingCard(tp,cm.repfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,1,c,e)
......
...@@ -52,8 +52,10 @@ function c98920270.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -52,8 +52,10 @@ function c98920270.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST) Duel.Release(e:GetHandler(),REASON_COST)
end end
function c98920270.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c98920270.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c98920270.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end local c=e:GetHandler()
local bc=c:GetBattleTarget()
if chk==0 then return bc and bc:IsFaceup() and bc:IsRelateToBattle() and Duel.IsExistingMatchingCard(c98920270.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) and c:IsLocation(LOCATION_MZONE) and c:IsRelateToBattle() 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 c98920270.setop(e,tp,eg,ep,ev,re,r,rp) function c98920270.setop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -15,7 +15,7 @@ function c98920556.initial_effect(c) ...@@ -15,7 +15,7 @@ function c98920556.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c98920556.cfilter(c,tp) function c98920556.cfilter(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK) --and c:IsReason(REASON_EFFECT) return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK) and c:IsReason(REASON_EFFECT)
end end
function c98920556.drcon(e,tp,eg,ep,ev,re,r,rp) function c98920556.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c98920556.cfilter,1,nil,1-tp) return eg:IsExists(c98920556.cfilter,1,nil,1-tp)
......
...@@ -42,10 +42,10 @@ function c98920571.initial_effect(c) ...@@ -42,10 +42,10 @@ function c98920571.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
if not c98920571.check then if not c98920571.check then
c98920571.check=true c98920571.check=true
mg=Duel.GetFusionMaterial jerrymg=Duel.GetFusionMaterial
Duel.GetFusionMaterial=function(p) Duel.GetFusionMaterial=function(p)
local g=Duel.GetMatchingGroup(c98920571.filter1,p,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(c98920571.filter1,p,0,LOCATION_MZONE,nil)
return Group.__add(mg(p),g) return Group.__add(jerrymg(p),g)
end end
end end
end end
...@@ -73,7 +73,7 @@ function c98920571.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -73,7 +73,7 @@ function c98920571.operation(e,tp,eg,ep,ev,re,r,rp)
while tc do while tc do
tc:RegisterFlagEffect(98920571,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) tc:RegisterFlagEffect(98920571,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
tc=g:GetNext() tc=g:GetNext()
end end
end end
function c98920571.splimit(e,c) function c98920571.splimit(e,c)
return not c:IsSetCard(0x10f3,0x1046) and c:IsLocation(LOCATION_EXTRA) return not c:IsSetCard(0x10f3,0x1046) and c:IsLocation(LOCATION_EXTRA)
......
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