Commit 4fb5d1f3 authored by wind2009's avatar wind2009

Fix

parent 6e979463
Pipeline #42069 failed with stages
in 2 minutes and 33 seconds
...@@ -30,9 +30,8 @@ function s.initial_effect(c) ...@@ -30,9 +30,8 @@ function s.initial_effect(c)
--addattack --addattack
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2)) e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET) e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_BE_MATERIAL) e4:SetCode(EVENT_BE_MATERIAL)
e4:SetCountLimit(1,id+o*2) e4:SetCountLimit(1,id+o*2)
e4:SetCondition(s.atkcon) e4:SetCondition(s.atkcon)
......
...@@ -71,7 +71,7 @@ end ...@@ -71,7 +71,7 @@ end
function s.effop(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.effop(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if e:GetLabel()==1 then if e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
local g=Duel.SelectMatchingCard(tp,Card.IsCanAddCounter,tp,0,LOCATION_MZONE,1,1,nil,0x1041,1) local g=Duel.SelectMatchingCard(tp,Card.IsCanAddCounter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,0x1041,1)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
Duel.HintSelection(g) Duel.HintSelection(g)
......
...@@ -87,7 +87,7 @@ function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -87,7 +87,7 @@ function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
sg=g:Clone() sg=g:Clone()
Duel.SetTargetCard(sg) Duel.SetTargetCard(sg)
else else
Duel.Hint(HINTMSG_DESTROY,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
sg=Duel.SelectTarget(tp,aux.IsInGroup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,g) sg=Duel.SelectTarget(tp,aux.IsInGroup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,g)
end end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,sg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,sg,1,0,0)
......
...@@ -5,50 +5,56 @@ function s.initial_effect(c) ...@@ -5,50 +5,56 @@ function s.initial_effect(c)
--spsummon --spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(s.cost) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE+TIMING_CHAIN_END)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_CHAINING)
e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(s.discon)
e2:SetTarget(s.distg)
e2:SetOperation(s.disop)
c:RegisterEffect(e2)
end end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.resfilter(c,e,tp)
local g=Duel.GetReleaseGroup(tp) return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,c,e,tp)
if chk==0 then return g:CheckSubGroup(aux.mzctcheckrel,1,1,tp) end and Duel.GetMZoneCount(tp,c)>0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:SelectSubGroup(tp,aux.mzctcheckrel,false,1,1,tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
end end
function s.filter(c,e,tp) function s.filter(c,e,tp)
return (c:IsCode(60800381) return (aux.IsCodeOrListed(c,60800381) or aux.IsCodeOrListed(c,44508094))
or aux.IsCodeListed(c,60800381)
or c:IsCode(44508094)
or aux.IsCodeListed(c,44508094))
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then local b1=Duel.CheckReleaseGroup(tp,s.resfilter,1,nil,e,tp)
return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end local ch=Duel.GetCurrentChain()
local b2=false
if e:GetHandler():IsStatus(STATUS_CHAINING) then ch=ch-1 end
local tse=nil
if ch>1 then
local se,p=Duel.GetChainInfo(ch-1,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
tse=Duel.GetChainInfo(ch,CHAININFO_TRIGGERING_EFFECT)
local tep=Duel.GetChainInfo(ch,CHAININFO_TRIGGERING_PLAYER)
b2=se and se:GetHandler():IsType(TYPE_SYNCHRO) and se:IsActiveType(TYPE_MONSTER) and p==tp and tep==1-tp and Duel.IsChainDisablable(ev)
end
if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,1),1},
{b2,aux.Stringid(id,2),2})
e:SetLabel(op)
if op==1 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
local g=Duel.SelectReleaseGroup(tp,s.resfilter,1,1,nil,e,tp)
e:SetLabelObject(g)
Duel.Release(g,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE)
elseif op==2 then
e:SetCategory(CATEGORY_DISABLE)
if tse then
local og=Group.FromCards(tse:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DISABLE,og,1,0,0)
end
end
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
--splimit
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD) e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
...@@ -57,33 +63,19 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,33 +63,19 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e0:SetTarget(s.splimit) e0:SetTarget(s.splimit)
e0:SetReset(RESET_PHASE+PHASE_END) e0:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e0,tp) Duel.RegisterEffect(e0,tp)
local op=e:GetLabel()
if op==1 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local rcg=e:GetLabelObject()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,1,rcg,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
end elseif op==2 then
function s.discon(e,tp,eg,ep,ev,re,r,rp) local ch=Duel.GetCurrentChain()
if not Duel.IsChainDisablable(ev) then return false end Duel.NegateEffect(ch-1)
local te,p=Duel.GetChainInfo(ev-1,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER) end
return te and te:GetHandler():IsType(TYPE_SYNCHRO) and te:IsActiveType(TYPE_MONSTER) and p==tp and rp==1-tp
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
--splimit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetTargetRange(1,0)
e0:SetTarget(s.splimit)
e0:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e0,tp)
Duel.NegateEffect(ev)
end end
function s.splimit(e,c) function s.splimit(e,c)
return not c:IsType(TYPE_SYNCHRO) and c:IsLocation(LOCATION_EXTRA) return not c:IsType(TYPE_SYNCHRO) and c:IsLocation(LOCATION_EXTRA)
......
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