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

fix #161,792

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