Commit adf2d048 authored by wind2009's avatar wind2009

Fix レッド・デーモンズ・チェーン

parent c6db66ee
Pipeline #42576 canceled with stages
in 20 seconds
...@@ -13,15 +13,6 @@ function s.initial_effect(c) ...@@ -13,15 +13,6 @@ function s.initial_effect(c)
e1:SetCost(s.cost) e1:SetCost(s.cost)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--act in set turn --act in set turn
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -42,7 +33,7 @@ end ...@@ -42,7 +33,7 @@ end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetTargetCount(s.filter,tp,0,LOCATION_MZONE,nil) local ct=Duel.GetTargetCount(s.filter,tp,0,LOCATION_MZONE,nil)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil,ct) end if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil,ct) end
local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_HAND,0,1,nil) local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_HAND,0,nil,ct)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=g:SelectSubGroup(tp,s.gcheck,false,1,g:GetCount(),ct) local sg=g:SelectSubGroup(tp,s.gcheck,false,1,g:GetCount(),ct)
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
...@@ -80,12 +71,11 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,12 +71,11 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_LEAVE_FIELD) e3:SetCode(EFFECT_SELF_DESTROY)
e3:SetValue(fid)
e3:SetCondition(s.descon) e3:SetCondition(s.descon)
e3:SetOperation(s.desop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD) e3:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
...@@ -98,10 +88,7 @@ function s.desfilter(c,e) ...@@ -98,10 +88,7 @@ function s.desfilter(c,e)
return e:GetLabel()~=c:GetFlagEffectLabel(id) return e:GetLabel()~=c:GetFlagEffectLabel(id)
end end
function s.descon(e,tp,eg,ep,ev,re,r,rp) function s.descon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e) return e:GetHandler():GetCardTarget():GetCount()==0
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end end
function s.costfilter(c) function s.costfilter(c)
return c:IsCode(70902743) and not c:IsPublic() return c:IsCode(70902743) and not c:IsPublic()
......
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