Commit 87a20e1d authored by mercury233's avatar mercury233

fix

parent fc164207
Pipeline #21799 passed with stages
in 44 seconds
......@@ -31,6 +31,7 @@ function s.initial_effect(c)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,id+o)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
......
......@@ -55,7 +55,7 @@ end
function s.spdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spdfilter(chkc,e,tp) and chkc~=c end
if chk==0 then return Duel.GetMZoneCount(1-tp,e:GetHandler())>0
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.spdfilter,tp,LOCATION_GRAVE,0,1,c,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spdfilter,tp,LOCATION_GRAVE,0,1,1,c,e,tp)
......@@ -64,10 +64,10 @@ end
function s.spdpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,SEQ_DECKBOTTOM,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_DECK) and tc:IsRelateToEffect(e) then
if Duel.SpecialSummon(tc,0,tp,1-tp,false,false,POS_FACEUP) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,SEQ_DECKBOTTOM,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_DECK)
and tc:IsRelateToEffect(e) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.SpecialSummon(tc,0,tp,1-tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -20,10 +20,25 @@ function s.initial_effect(c)
e2:SetDescription(aux.Stringid(id,3))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DRAW)
e2:SetCost(s.expcost)
e2:SetTarget(s.exptg)
e2:SetOperation(s.expop)
c:RegisterEffect(e2)
end
function Auxiliary.SelectFromOptions(tp,...)
local options={...}
local ops={}
local opvals={}
for i=1,#options do
if options[i][1] then
table.insert(ops,options[i][2])
table.insert(opvals,options[i][3] or i)
end
end
if #ops==0 then return nil end
local select=Duel.SelectOption(tp,table.unpack(ops))
return opvals[select+1]
end
function s.cfilter(c,tp)
return c:IsSummonPlayer(tp) and c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
......@@ -32,15 +47,20 @@ function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local opt=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
e:SetLabel(opt)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoDeck(e:GetHandler(),nil,e:GetLabel(),REASON_EFFECT)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local opt=aux.SelectFromOptions(tp,
{true,aux.Stringid(id,1),SEQ_DECKTOP},
{true,aux.Stringid(id,2),SEQ_DECKBOTTOM})
Duel.SendtoDeck(c,nil,opt,REASON_EFFECT)
end
end
function s.expcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function s.exptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
end
......
......@@ -21,7 +21,7 @@ function s.initial_effect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+o)
......@@ -30,17 +30,31 @@ function s.initial_effect(c)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
end
function Auxiliary.SelectFromOptions(tp,...)
local options={...}
local ops={}
local opvals={}
for i=1,#options do
if options[i][1] then
table.insert(ops,options[i][2])
table.insert(opvals,options[i][3] or i)
end
end
if #ops==0 then return nil end
local select=Duel.SelectOption(tp,table.unpack(ops))
return opvals[select+1]
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsLevel(5) and (c:IsCanBeSpecialSummoned(e,0,tp,false,false) or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp))
return c:IsLevel(5) and (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
or Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp))
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end
if chk==0 then return (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 or Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0)
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......@@ -50,14 +64,12 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
if not tc:IsRelateToEffect(e) then return end
local s1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
local s2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
local op=0
Duel.Hint(HINT_SELECTMSG,tp,0)
if s1 and s2 then op=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
elseif s1 then op=Duel.SelectOption(tp,aux.Stringid(id,1))
elseif s2 then op=Duel.SelectOption(tp,aux.Stringid(id,2))+1
else return end
if op==0 then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else Duel.SpecialSummon(tc,0,tp,1-tp,false,false,POS_FACEUP) end
local toplayer=aux.SelectFromOptions(tp,
{s1,aux.Stringid(id,1),tp},
{s2,aux.Stringid(id,2),1-tp})
if toplayer~=nil then
Duel.SpecialSummon(tc,0,tp,toplayer,false,false,POS_FACEUP)
end
end
function s.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
......
......@@ -7,10 +7,12 @@ function s.initial_effect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_LIMIT_ZONE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
e1:SetValue(s.zones)
c:RegisterEffect(e1)
--reduce scale
local e2=Effect.CreateEffect(c)
......@@ -23,6 +25,16 @@ function s.initial_effect(c)
e2:SetOperation(s.rsop)
c:RegisterEffect(e2)
end
function s.zones(e,tp,eg,ep,ev,re,r,rp)
local zone=0xff
local p0=Duel.CheckLocation(tp,LOCATION_PZONE,0)
local p1=Duel.CheckLocation(tp,LOCATION_PZONE,1)
local b=e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsLocation(LOCATION_SZONE)
if not b or p0 and p1 then return zone end
if p0 then zone=zone-0x1 end
if p1 then zone=zone-0x10 end
return zone
end
function s.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsAbleToRemoveAsCost()
end
......
......@@ -40,8 +40,14 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,1,nil,tp):GetFirst()
if not (tc and Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)) then return end
local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if not tc then return end
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
local g=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_DECK,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local mg=g:SelectSubGroup(tp,aux.dncheck,false,5,5)
......@@ -49,6 +55,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect()
Duel.ConfirmCards(1-tp,mg)
local sg=mg:RandomSelect(1-tp,1)
Duel.ConfirmCards(tp,sg)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -88,6 +88,8 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.sfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
......@@ -78,6 +78,8 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.sfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
......@@ -26,8 +26,10 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp)
local tg=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsCanBeSpecialSummoned),tp,0,LOCATION_GRAVE+LOCATION_HAND,nil,e,0,1-tp,false,false)
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and #tg>0 and Duel.SelectYesNo(1-tp,aux.Stringid(id,1)) then
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0
and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and #tg>0
and Duel.SelectYesNo(1-tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local tc=tg:Select(1-tp,1,1,nil):GetFirst()
Duel.BreakEffect()
if Duel.SpecialSummonStep(tc,0,1-tp,1-tp,false,false,POS_FACEUP) then
......
......@@ -9,6 +9,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(aux.dscon)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
......@@ -16,7 +17,7 @@ function s.initial_effect(c)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id)
......
......@@ -9,6 +9,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetHintTiming(TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
......@@ -21,6 +22,7 @@ function s.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+o)
e2:SetHintTiming(TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(s.spcon)
e2:SetCost(s.cost)
e2:SetTarget(s.sptg)
......@@ -71,5 +73,7 @@ end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.sfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,e:GetLabel())
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -37,7 +37,8 @@ function s.filter(c)
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
......
......@@ -20,6 +20,7 @@ function s.initial_effect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(s.thtg)
......
......@@ -22,6 +22,7 @@ function s.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(s.descon)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
......
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