Commit d9a6961d authored by 花桃白音's avatar 花桃白音

fix #161,792

parent 41231cc5
No preview for this file type
...@@ -156,7 +156,7 @@ function cm.operation1(e,tp,eg,ep,ev,re,r,rp) ...@@ -156,7 +156,7 @@ function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetLabel(record_type) e2:SetLabel(record_type)
e2:SetOperation(function(de) e2:SetOperation(function(de)
local c=de:GetHandler() local dc=de:GetHandler()
dc:SetCardData(CARDDATA_TYPE,de:GetLabel()) dc:SetCardData(CARDDATA_TYPE,de:GetLabel())
de:Reset() de:Reset()
end end
...@@ -195,7 +195,7 @@ function cm.operation1(e,tp,eg,ep,ev,re,r,rp) ...@@ -195,7 +195,7 @@ function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
tc:RegisterEffect(e2,true) tc:RegisterEffect(e2,true)
elseif op==1 then elseif op==1 then
Duel.NegateSummon(tc) Duel.NegateSummon(tc)
if not Duel.Equip(tp,tc,c,false,true) then return end if not Duel.Equip(tp,tc,c,false,true) then return end
--equip limit --equip limit
local e1=Effect.CreateEffect(tc) local e1=Effect.CreateEffect(tc)
...@@ -234,22 +234,24 @@ function cm.actop(e,tp) ...@@ -234,22 +234,24 @@ function cm.actop(e,tp)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.eqfilter),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,tp) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.eqfilter),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
local tc=g:GetFirst() local tc=g:GetFirst()
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) if tc:IsType(TYPE_SPELL) and not tc:IsType(TYPE_EQUIP) then
local record_type=tc:GetOriginalType() Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
tc:SetCardData(CARDDATA_TYPE,record_type|TYPE_EQUIP) local record_type=tc:GetOriginalType()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1) tc:SetCardData(CARDDATA_TYPE,record_type|TYPE_EQUIP)
local e2=Effect.CreateEffect(c) tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) local e2=Effect.CreateEffect(c)
e2:SetCode(EVENT_MOVE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetCode(EVENT_MOVE)
e2:SetLabel(record_type) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetOperation(function(de) e2:SetLabel(record_type)
local c=de:GetHandler() e2:SetOperation(function(de)
dc:SetCardData(CARDDATA_TYPE,de:GetLabel()) local dc=de:GetHandler()
de:Reset() dc:SetCardData(CARDDATA_TYPE,de:GetLabel())
end de:Reset()
) end
tc:RegisterEffect(e2) )
tc:RegisterEffect(e2)
end
if not Duel.Equip(tp,tc,c) then return end if not Duel.Equip(tp,tc,c) then return end
--equip limit --equip limit
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
......
...@@ -20,7 +20,7 @@ function s.initial_effect(c) ...@@ -20,7 +20,7 @@ function s.initial_effect(c)
e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetTargetRange(POS_FACEUP_DEFENSE,0) e2:SetTargetRange(POS_FACEUP_ATTACK+POS_FACEUP_DEFENSE,0)
e2:SetCondition(s.spcon) e2:SetCondition(s.spcon)
e2:SetOperation(s.spop) e2:SetOperation(s.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -51,23 +51,23 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,23 +51,23 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local fid=c:GetFieldID() local fid=c:GetFieldID()
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,EFFECT_FLAG_CLIENT_HINT,1,fid,66) c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_OPPO_TURN,EFFECT_FLAG_CLIENT_HINT,1,fid,66)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC) e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Add counter --Add counter
local e3=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_LEAVE_FIELD) e2:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(s.ctcon) e2:SetCondition(s.ctcon)
e3:SetOperation(s.ctop) e2:SetOperation(s.ctop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
Duel.RegisterEffect(e3,tp) Duel.RegisterEffect(e2,tp)
if not Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_SZONE,0,1,nil) and if not Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_SZONE,0,1,nil,e,tp) and
Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_ONFIELD,0,1,nil) and not Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_ONFIELD,0,1,nil,e,tp) and not
Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_ONFIELD,0,1,nil) then Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_ONFIELD,0,1,nil,e,tp) then
local tcc=Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_ONFIELD,0,1,1,nil,e,tp):GetFirst() local tcc=Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_ONFIELD,0,1,1,nil,e,tp):GetFirst()
if Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,tcc,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then if Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,tcc,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,tcc,e,tp) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,tcc,e,tp)
...@@ -105,10 +105,10 @@ function s.spcon(e,c) ...@@ -105,10 +105,10 @@ function s.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsCanRemoveCounter(tp,1,0,0x15c1,5,REASON_COST) and Duel.IsCanRemoveCounter(tp,1,0x15c1,0x15c1,3,REASON_COST)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c) function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.RemoveCounter(tp,1,0,0x15c1,3,REASON_COST) Duel.RemoveCounter(tp,1,0x15c1,0x15c1,3,REASON_COST)
end end
function s.remtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -117,6 +117,9 @@ function s.remtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -117,6 +117,9 @@ function s.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=g:GetCount() local ct=g:GetCount()
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,ct,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,ct,0,0)
end end
function s.spfilter(c,e,tp)
return c:IsAbleToRemove() and c:GetCounter(0x15c1)>0
end
function s.sfilter(c,e,tp) function s.sfilter(c,e,tp)
return (c:IsCode(79250008) or c:IsCode(79250009)) and c:GetActivateEffect():IsActivatable(tp,true,true) return (c:IsCode(79250008) or c:IsCode(79250009)) and c:GetActivateEffect():IsActivatable(tp,true,true)
end end
...@@ -125,6 +128,7 @@ function s.remop(e,tp,eg,ep,ev,re,r,rp) ...@@ -125,6 +128,7 @@ function s.remop(e,tp,eg,ep,ev,re,r,rp)
if #g>0 then if #g>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT) Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end end
Duel.BreakEffect()
if Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then if Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
local gg=Duel.SelectMatchingCard(tp,s.sfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local gg=Duel.SelectMatchingCard(tp,s.sfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=gg:GetFirst() local tc=gg:GetFirst()
......
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