Commit ac0599fa authored by POLYMER's avatar POLYMER

fix

parent 2170fa66
...@@ -33,10 +33,8 @@ function c20250341.initial_effect(c) ...@@ -33,10 +33,8 @@ function c20250341.initial_effect(c)
e4:SetCondition(c20250341.dckcon) e4:SetCondition(c20250341.dckcon)
e4:SetOperation(c20250341.dckop) e4:SetOperation(c20250341.dckop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(20250341,1))
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_SSET)
e5:SetCode(EVENT_CUSTOM+20250341) e5:SetCode(EVENT_CUSTOM+20250341)
e5:SetProperty(EFFECT_FLAG_DELAY) e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetRange(LOCATION_MZONE) e5:SetRange(LOCATION_MZONE)
...@@ -49,32 +47,23 @@ function c20250341.initial_effect(c) ...@@ -49,32 +47,23 @@ function c20250341.initial_effect(c)
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_SPSUMMON_SUCCESS) e6:SetCode(EVENT_SPSUMMON_SUCCESS)
e6:SetCondition(c20250341.imcon) e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetOperation(c20250341.imop) e6:SetOperation(c20250341.imop)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function c20250341.imcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c20250341.imop(e,tp,eg,ep,ev,re,r,rp) function c20250341.imop(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():AddCounter(0x154a,2) return e:GetHandler():AddCounter(0x154a,2)
end end
function c20250341.addcc(e,tp,eg,ep,ev,re,r,rp) function c20250341.addcc(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end end
function c20250341.adfilter(c) function c20250341.adfilter(c)
return c:IsSetCard(0x54a) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0x54a) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function c20250341.addct(e,tp,eg,ep,ev,re,r,rp,chk) function c20250341.addct(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20250341.adfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c20250341.adfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c20250341.addc(e,tp,eg,ep,ev,re,r,rp) function c20250341.addc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c20250341.adfilter),tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c20250341.adfilter),tp,LOCATION_DECK,0,1,1,nil)
...@@ -86,26 +75,21 @@ end ...@@ -86,26 +75,21 @@ end
function c20250341.cfilter(c,tp) function c20250341.cfilter(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK) return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK)
end end
function c20250341.hdcon(e,tp,eg,ep,ev,re,r,rp) function c20250341.hdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DRAW and eg:IsExists(c20250341.cfilter,1,nil,1-tp) return Duel.GetCurrentPhase()~=PHASE_DRAW and eg:IsExists(c20250341.cfilter,1,nil,1-tp)
end end
function c20250341.hdtg(e,tp,eg,ep,ev,re,r,rp,chk) function c20250341.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x154a,1,REASON_EFFECT) end if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x154a,1,REASON_EFFECT) end
end end
function c20250341.hdop(e,tp,eg,ep,ev,re,r,rp) function c20250341.hdop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(20250339,2)) then if Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(20250339,2)) then
Duel.RemoveCounter(tp,1,0,0x154a,1,REASON_EFFECT) Duel.RemoveCounter(tp,1,0,0x154a,1,REASON_EFFECT)
end end
end end
function c20250341.dckcon(e,tp,eg,ep,ev,re,r,rp) function c20250341.dckcon(e,tp,eg,ep,ev,re,r,rp)
local x=e:GetHandler():GetFlagEffect(20250341) local x=e:GetHandler():GetFlagEffect(20250341)
return x~=e:GetHandler():GetCounter(0x154a) return x~=e:GetHandler():GetCounter(0x154a)
end end
function c20250341.dckop(e,tp,eg,ep,ev,re,r,rp) function c20250341.dckop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
c:ResetFlagEffect(20250341) c:ResetFlagEffect(20250341)
...@@ -117,7 +101,6 @@ function c20250341.dckop(e,tp,eg,ep,ev,re,r,rp) ...@@ -117,7 +101,6 @@ function c20250341.dckop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+20250341,e,0,0,tp,0) Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+20250341,e,0,0,tp,0)
end end
end end
function c20250341.descon(e,tp,eg,ep,ev,re,r,rp) function c20250341.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0x154a)==0 return e:GetHandler():GetCounter(0x154a)==0
end end
...@@ -127,34 +110,41 @@ function c20250341.setfilter(c) ...@@ -127,34 +110,41 @@ function c20250341.setfilter(c)
end end
function c20250341.target(e,tp,eg,ep,ev,re,r,rp,chk) function c20250341.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20250341.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end if chk==0 then
local ct=math.min(2,Duel.GetLocationCount(tp,LOCATION_SZONE))
return ct>0 and Duel.IsExistingMatchingCard(c20250341.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end end
function c20250341.activate(e,tp,eg,ep,ev,re,r,rp) function c20250341.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local ct=math.min(2,Duel.GetLocationCount(tp,LOCATION_SZONE))
if ft<=0 then return end if ct<=0 then return end
if ft>=2 then ft=2 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c20250341.setfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c20250341.setfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
if g:GetCount()>0 then if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ct)
local st=g:SelectSubGroup(tp,aux.dncheck,false,1,ft) if #sg>0 then
if st:GetCount()>0 then Duel.SSet(tp,sg)
Duel.SSet(tp,st) for tc in aux.Next(sg) do
for tc in aux.Next(st) do if tc:IsType(TYPE_QUICKPLAY) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(20250341,3)) e1:SetDescription(aux.Stringid(20250341,3))
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN) e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler()) end
e2:SetDescription(aux.Stringid(20250341,3)) if tc:IsType(TYPE_TRAP) then
e2:SetType(EFFECT_TYPE_SINGLE) local e1=Effect.CreateEffect(e:GetHandler())
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e1:SetDescription(aux.Stringid(20250341,3))
e2:SetCode(EFFECT_QP_ACT_IN_SET_TURN) e1:SetType(EFFECT_TYPE_SINGLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
tc:RegisterEffect(e2) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end end
end end
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