Commit 6090c272 authored by 花桃白音's avatar 花桃白音

fix operation

parent b1becd0b
...@@ -24,42 +24,47 @@ function cm.initial_effect(c) ...@@ -24,42 +24,47 @@ function cm.initial_effect(c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end) end)
.e("SetOperation",function(e,tp,eg,ep,ev,re,r,rp) .e("SetOperation",function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,1,nil) local exc=nil
local tg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) if e:IsHasType(EFFECT_TYPE_ACTIVATE) then exc=e:GetHandler() end
local setg=Duel.GetMatchingGroup(Card.IsSSetable,tp,LOCATION_HAND,0,g):Filter(Card.IsType,nil,TYPE_TRAP) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,1,nil)
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 if g and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
and Duel.Destroy(tg,REASON_EFFECT)~=0 Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
and setg:GetCount()>0 then local tg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,exc)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end if tg and Duel.Destroy(tg,REASON_EFFECT)~=0 then
if Duel.SelectYesNo(tp,aux.Stringid(m,0)) then local setg=Duel.GetMatchingGroup(Card.IsSSetable,tp,LOCATION_HAND,0,g):Filter(Card.IsType,nil,TYPE_TRAP)
Duel.BreakEffect() if setg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=setg:Select(tp,1,1,nil):GetFirst() if Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
if Duel.SSet(tp,tc,tp,false)~=0 then Duel.BreakEffect()
local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local fid=c:GetFieldID() local tc=setg:Select(tp,1,1,nil):GetFirst()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1,fid) if Duel.SSet(tp,tc,tp,false)~=0 then
local e1=Effect.CreateEffect(c) local c=e:GetHandler()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) local fid=c:GetFieldID()
e1:SetCode(EVENT_CHAIN_SOLVED) tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1,fid)
e1:SetCountLimit(1) local e1=Effect.CreateEffect(c)
e1:SetLabel(fid) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetLabelObject(tc) e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) e1:SetCountLimit(1)
local g=Group.FromCards(e:GetLabelObject()) e1:SetLabel(fid)
return g:IsContains(re:GetHandler()) and tc:GetFlagEffectLabel(m)==e:GetLabel() e1:SetLabelObject(tc)
end) e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) local g=Group.FromCards(e:GetLabelObject())
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end return g:IsContains(re:GetHandler()) and tc:GetFlagEffectLabel(m)==e:GetLabel()
end) end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local tg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) end)
Duel.Destroy(tg,REASON_EFFECT) e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local tg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.Destroy(tg,REASON_EFFECT)
end
end)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e1,tp)
end end
end) end
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e1,tp)
end end
end end
end end
......
...@@ -10,7 +10,7 @@ function cm.initial_effect(c) ...@@ -10,7 +10,7 @@ function cm.initial_effect(c)
.e("SetCountLimit",1,4260609) .e("SetCountLimit",1,4260609)
.e("SetCost",function(e,tp,eg,ep,ev,re,r,rp,chk) .e("SetCost",function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemove() end if chk==0 then return c:IsAbleToRemoveAsCost() end
Duel.Remove(c,POS_FACEUP,REASON_COST) end) Duel.Remove(c,POS_FACEUP,REASON_COST) end)
.e("SetTarget",function(e,tp,eg,ep,ev,re,r,rp,chk) .e("SetTarget",function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5 end if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5 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