Commit f6948963 authored by POLYMER's avatar POLYMER

fix

parent 58e95d1b
......@@ -144,10 +144,10 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
function cm.desop2(e,tp,eg,ep,ev,re,r,rp)
e:Reset()
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then Duel.Destroy(tc,REASON_EFFECT) end
e:Reset()
end
\ No newline at end of file
......@@ -73,6 +73,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e8:SetCode(EVENT_ADJUST)
e8:SetLabel(code)
e8:SetCondition(function() return not pnfl_adjusting end)
e8:SetOperation(cm.sdop)
Duel.RegisterEffect(e8,tp)
if Duel.GetFlagEffect(tp,code+0xffffff)==0 then
......@@ -100,12 +101,14 @@ function cm.sdtg(e,c)
return c:IsCode(m) and c:IsFaceup()
end
function cm.sdop(e,tp,eg,ep,ev,re,r,rp)
pnfl_adjusting=true
local phase=Duel.GetCurrentPhase()
local c=e:GetHandler()
if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL then return end
if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL then pnfl_adjusting=false return end
local sdg=Duel.GetMatchingGroup(cm.cfilter2,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,m,e)
if #sdg>0 and cm.sdcon(e) and Duel.Destroy(sdg,REASON_EFFECT) then
local sdg=Duel.GetMatchingGroup(cm.cfilter2,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,m,e)
if #sdg>0 and cm.sdcon(e) then Duel.Readjust() end
if #sdg>0 and cm.sdcon(e) then pnfl_adjusting=false Duel.Readjust() end
end
pnfl_adjusting=false
end
\ No newline at end of file
......@@ -123,6 +123,7 @@ function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
pnfl_adjusting=true
local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......@@ -135,6 +136,7 @@ function cm.repop(e,tp,eg,ep,ev,re,r,rp)
local op=turne:GetOperation()
op(turne,turne:GetOwnerPlayer(),nil,0,0,0,0,0)
end
pnfl_adjusting=false
end
function cm.confilter(c)
return c:IsFaceup() and c:IsSetCard(0xc976)
......
......@@ -63,7 +63,7 @@ function s.cfilter(c,ce)
return (c:GetOriginalType()&(TYPE_SPELL+TYPE_TRAP)>0 and c:IsSetCard(0x3a70) or not c:IsSetCard(0x3a70) and c:IsOnField() and ec:IsLocation(LOCATION_HAND) and ec:IsPublic() and ce:GetType()&EFFECT_TYPE_ACTIVATE==0) and c:IsAbleToGraveAsCost()
end
function s.sscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
......@@ -87,7 +87,7 @@ function s.sscost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,c,e) end
if chk==0 then return s.sscost(e,tp,eg,ep,ev,re,r,rp,chk) and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,c,e) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local cc=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,c,e):GetFirst()
if cc:IsFacedown() then Duel.ConfirmCards(1-tp,cc) end
......
......@@ -58,7 +58,7 @@ function s.pcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPublic()
end
function s.sscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
......
......@@ -75,7 +75,7 @@ function s.thcon(e,tp,eg,ep,ev,re,r,rp,chk)
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function s.sscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
......@@ -101,7 +101,7 @@ function s.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumpos,POS_FACEDOWN)>0
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return s.sscost(e,tp,eg,ep,ev,re,r,rp,chk) end
Duel.ConfirmCards(1-tp,e:GetHandler())
s.sscost(e,tp,eg,ep,ev,re,r,rp,chk)
end
......
......@@ -63,7 +63,7 @@ function s.thcon(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.GetCustomActivityCount(id,1-tp,ACTIVITY_CHAIN)>=3
end
function s.sscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
......@@ -89,7 +89,7 @@ function s.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumpos,POS_FACEDOWN)>0
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return s.sscost(e,tp,eg,ep,ev,re,r,rp,chk) end
Duel.ConfirmCards(1-tp,e:GetHandler())
s.sscost(e,tp,eg,ep,ev,re,r,rp,chk)
end
......
......@@ -63,7 +63,7 @@ function s.thcon(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.GetCustomActivityCount(id,1-tp,ACTIVITY_CHAIN)>=3
end
function s.sscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
......@@ -89,7 +89,7 @@ function s.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumpos,POS_FACEDOWN)>0
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return s.sscost(e,tp,eg,ep,ev,re,r,rp,chk) end
Duel.ConfirmCards(1-tp,e:GetHandler())
s.sscost(e,tp,eg,ep,ev,re,r,rp,chk)
end
......
......@@ -63,7 +63,7 @@ function s.thcon(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.GetCustomActivityCount(id,1-tp,ACTIVITY_CHAIN)>=3
end
function s.sscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
......@@ -89,7 +89,7 @@ function s.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumpos,POS_FACEDOWN)>0
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return s.sscost(e,tp,eg,ep,ev,re,r,rp,chk) end
Duel.ConfirmCards(1-tp,e:GetHandler())
s.sscost(e,tp,eg,ep,ev,re,r,rp,chk)
end
......
......@@ -59,7 +59,7 @@ function s.descon(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.GetFlagEffect(tp,id)>=3
end
function s.sscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
......@@ -85,7 +85,7 @@ function s.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumpos,POS_FACEDOWN)>0
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return s.sscost(e,tp,eg,ep,ev,re,r,rp,chk) end
Duel.ConfirmCards(1-tp,e:GetHandler())
s.sscost(e,tp,eg,ep,ev,re,r,rp,chk)
end
......
......@@ -65,7 +65,7 @@ function s.cfilter(c)
return (c:GetOriginalType()&TYPE_SPELL+TYPE_TRAP)>0 and c:IsSetCard(0x3a70) and c:IsAbleToGraveAsCost()
end
function s.sscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
......
......@@ -29,7 +29,7 @@ function c37900998.initial_effect(c)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetRange(LOCATION_MZONE)
e3:SetDescription(1,37900998)
e3:SetCountLimit(1,37900998)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetTarget(c37900998.tg3)
e3:SetOperation(c37900998.op3)
......@@ -101,7 +101,7 @@ function c37900998.con(e,tp,eg,ep,ev,re,r,rp)
local all=Duel.GetFieldGroup(tp,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE,0)
local lp1=Duel.GetLP(tp)
local lp2=Duel.GetLP(1-tp)
return (lp2-lp1)>4000 and #g>0 and #g==#all and Duel.GetLocationCountFromEx(tp,tp,g,c)>0
return lp2>lp1 and (lp2-lp1)>=4000 and #g>0 and #g==#all and Duel.GetLocationCountFromEx(tp,tp,g,c)>0
end
function c37900998.w(c)
return c:IsLocation(LOCATION_HAND) and not c:IsPublic()
......
......@@ -49,18 +49,21 @@ function cm.desfilter(c)
return c:IsSetCard(0x3620) and (c:IsLocation(LOCATION_HAND) or (c:IsLocation(LOCATION_ONFIELD) and c:IsFaceup()))
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsControler(tp) and cm.desfilter(chkc,tp) end
if chkc then return chkc:IsControler(tp) and cm.desfilter(chkc,tp) end
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(cm.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,nil,tp) end
and Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler(),tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,nil,tp)
local g=Duel.SelectMatchingCard(tp,cm.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,e:GetHandler(),tp)
e:SetLabelObject(g)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
local c=e:GetHandler()
local tc=nil
if Duel.GetFirstTarget() then tc=Duel.GetFirstTarget() else tc=e:GetLabelObject():GetFirst() end
if Duel.Destroy(tc,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
......@@ -39,16 +39,19 @@ end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and cm.desfilter(chkc,tp) end
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(cm.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,nil,tp) end
and Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler(),tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,nil,tp)
local g=Duel.SelectMatchingCard(tp,cm.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,e:GetHandler(),tp)
e:SetLabelObject(g)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
local tc=nil
if Duel.GetFirstTarget() then tc=Duel.GetFirstTarget() else tc=e:GetLabelObject():GetFirst() end
if Duel.Destroy(tc,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
......
......@@ -21,7 +21,7 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_EXTRA+LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,m)
e1:SetCountLimit(1,m+20000000)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(cm.destg)
e1:SetOperation(cm.desop)
......@@ -74,16 +74,19 @@ end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and cm.desfilter(chkc,tp) end
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(cm.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,nil,tp) end
and Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler(),tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,nil,tp)
local g=Duel.SelectMatchingCard(tp,cm.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,e:GetHandler(),tp)
e:SetLabelObject(g)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
local tc=nil
if Duel.GetFirstTarget() then tc=Duel.GetFirstTarget() else tc=e:GetLabelObject():GetFirst() end
if Duel.Destroy(tc,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
......
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