Commit ebb324f4 authored by wind2009's avatar wind2009

Fix

parent 5f9f6114
Pipeline #42474 passed with stages
in 2 minutes and 29 seconds
No preview for this file type
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
101304012 101304012
101304013 101304013
101304014 101304014
101304015
101304016 101304016
101304017 101304017
101304018 101304018
...@@ -22,8 +23,10 @@ ...@@ -22,8 +23,10 @@
101304025 101304025
101304026 101304026
101304027 101304027
101304029
101304030 101304030
101304031 101304031
101304032
101304033 101304033
101304034 101304034
101304035 101304035
...@@ -31,9 +34,11 @@ ...@@ -31,9 +34,11 @@
101304206 101304206
101304038 101304038
101304039 101304039
101304040
101304043 101304043
101304044 101304044
101304045 101304045
101304046
101304047 101304047
101304048 101304048
101304049 101304049
...@@ -46,6 +51,9 @@ ...@@ -46,6 +51,9 @@
101304056 101304056
101304057 101304057
101304058 101304058
101304059
101304060
101304061
101304062 101304062
101304063 101304063
101304064 101304064
...@@ -55,6 +63,8 @@ ...@@ -55,6 +63,8 @@
101304070 101304070
101304208 101304208
101304072 101304072
101304073
101304074
101304075 101304075
101304076 101304076
101304078 101304078
\ No newline at end of file
...@@ -23,18 +23,18 @@ function s.initial_effect(c) ...@@ -23,18 +23,18 @@ function s.initial_effect(c)
e2:SetOperation(s.drop) e2:SetOperation(s.drop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--summon --summon
local e1=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e3:SetDescription(aux.Stringid(id,2))
e1:SetCategory(CATEGORY_SUMMON) e3:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_MAIN_END) e3:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCountLimit(1) e3:SetCountLimit(1)
e1:SetCondition(s.sumcon) e3:SetCondition(s.sumcon)
e1:SetTarget(s.sumtg) e3:SetTarget(s.sumtg)
e1:SetOperation(s.sumop) e3:SetOperation(s.sumop)
c:RegisterEffect(e1) c:RegisterEffect(e3)
end end
function s.otfilter(c,tp) function s.otfilter(c,tp)
return c:IsType(TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_PENDULUM+TYPE_LINK) and (c:IsControler(tp) or c:IsFaceup()) return c:IsType(TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_PENDULUM+TYPE_LINK) and (c:IsControler(tp) or c:IsFaceup())
...@@ -65,8 +65,8 @@ function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -65,8 +65,8 @@ function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local op=0 local op=0
if b1 or b2 then if b1 or b2 then
op=aux.SelectFromOptions(tp, op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,1),1}, {b1,aux.Stringid(id,3),1},
{b2,aux.Stringid(id,2),2}) {b2,aux.Stringid(id,4),2})
end end
e:SetLabel(op,ct) e:SetLabel(op,ct)
if op==1 then if op==1 then
...@@ -93,27 +93,28 @@ function s.drop(e,tp,eg,ep,ev,re,r,rp) ...@@ -93,27 +93,28 @@ function s.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectMatchingCard(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,ct,ct,nil) local g=Duel.SelectMatchingCard(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,ct,ct,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.HintSelection(g)
for tc in aux.Next(g) do for tc in aux.Next(g) do
Duel.NegateRelatedChain(tc,RESET_TURN_SET) Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET) e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3) tc:RegisterEffect(e3)
end end
end end
...@@ -124,7 +125,7 @@ function s.sumcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -124,7 +125,7 @@ function s.sumcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp and Duel.IsMainPhase() return Duel.GetTurnPlayer()==1-tp and Duel.IsMainPhase()
end end
function s.sumfilter(c) function s.sumfilter(c)
return c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1) return c:IsSummonable(true,nil,1)
end end
function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND,0,1,nil) end
...@@ -135,12 +136,6 @@ function s.sumop(e,tp,eg,ep,ev,re,r,rp) ...@@ -135,12 +136,6 @@ function s.sumop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,s.sumfilter,tp,LOCATION_HAND,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
local s1=tc:IsSummonable(true,nil,1)
local s2=tc:IsMSetable(true,nil,1)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tc,true,nil,1) Duel.Summon(tp,tc,true,nil,1)
else
Duel.MSet(tp,tc,true,nil,1)
end
end end
end end
...@@ -16,6 +16,7 @@ function s.initial_effect(c) ...@@ -16,6 +16,7 @@ function s.initial_effect(c)
--to deck --to deck
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
--TODO CATEGORY_MSET
e2:SetCategory(CATEGORY_TODECK+CATEGORY_POSITION) e2:SetCategory(CATEGORY_TODECK+CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_RELEASE) e2:SetCode(EVENT_RELEASE)
...@@ -28,7 +29,7 @@ function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -28,7 +29,7 @@ function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end if chk==0 then return not e:GetHandler():IsPublic() end
end end
function s.thfilter(c) function s.thfilter(c)
return c:IsSetCard(0x2dc) and not (c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)) and c:IsAbleToHand() return c:IsSetCard(0x2dc) and not (c:IsAllTypes(TYPE_RITUAL+TYPE_MONSTER)) and c:IsAbleToHand()
end end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
...@@ -41,13 +42,19 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -41,13 +42,19 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
if g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local dg=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,1,1,nil,REASON_EFFECT)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
if dg:GetCount()>0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD) Duel.SendtoGrave(dg,REASON_EFFECT+REASON_DISCARD)
end
end
end end
end end
function s.tdfilter(c) function s.tdfilter(c)
return c:IsFaceupEx() and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() return c:IsFaceupEx() and c:IsAllTypes(TYPE_RITUAL+TYPE_MONSTER) and c:IsAbleToDeck()
end end
function s.posfilter(c) function s.posfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsCanTurnSet() return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsCanTurnSet()
...@@ -61,10 +68,10 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -61,10 +68,10 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local op=0 local op=0
if b1 or b2 then if b1 or b2 then
op=aux.SelectFromOptions(tp, op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,1),1}, {b1,aux.Stringid(id,2),1},
{b2,aux.Stringid(id,2),2}) {b2,aux.Stringid(id,3),2})
end end
e:SetLabel(op,ct) e:SetLabel(op)
if op==1 then if op==1 then
if e:IsCostChecked() then if e:IsCostChecked() then
e:SetCategory(CATEGORY_TODECK) e:SetCategory(CATEGORY_TODECK)
...@@ -82,7 +89,6 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -82,7 +89,6 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
end end
function s.tdop(e,tp,eg,ep,ev,re,r,rp) function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==1 then if e:GetLabel()==1 then
local g=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,nil)
if aux.NecroValleyNegateCheck(g) then return end if aux.NecroValleyNegateCheck(g) then return end
......
...@@ -16,6 +16,7 @@ function s.initial_effect(c) ...@@ -16,6 +16,7 @@ function s.initial_effect(c)
--to deck --to deck
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0)) e2:SetDescription(aux.Stringid(id,0))
--TODO CATEGORY_SSET
e2:SetCategory(CATEGORY_TODECK) e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_RELEASE) e2:SetCode(EVENT_RELEASE)
...@@ -48,7 +49,7 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -48,7 +49,7 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
{b1,aux.Stringid(id,1),1}, {b1,aux.Stringid(id,1),1},
{b2,aux.Stringid(id,2),2}) {b2,aux.Stringid(id,2),2})
end end
e:SetLabel(op,ct) e:SetLabel(op)
if op==1 then if op==1 then
if e:IsCostChecked() then if e:IsCostChecked() then
e:SetCategory(CATEGORY_TODECK) e:SetCategory(CATEGORY_TODECK)
......
...@@ -31,7 +31,7 @@ end ...@@ -31,7 +31,7 @@ end
function s.chainlm(e,rp,tp) function s.chainlm(e,rp,tp)
return tp==rp return tp==rp
end end
function s.sucfilter(c) function s.sucfilter(c,tp)
return c:IsSummonType(SUMMON_TYPE_ADVANCE) and c:IsControler(tp) return c:IsSummonType(SUMMON_TYPE_ADVANCE) and c:IsControler(tp)
end end
function s.sucop(e,tp,eg,ep,ev,re,r,rp) function s.sucop(e,tp,eg,ep,ev,re,r,rp)
...@@ -77,7 +77,7 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -77,7 +77,7 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
{b1,aux.Stringid(id,1),1}, {b1,aux.Stringid(id,1),1},
{b2,aux.Stringid(id,2),2}) {b2,aux.Stringid(id,2),2})
end end
e:SetLabel(op,ct) e:SetLabel(op)
if op==1 then if op==1 then
if e:IsCostChecked() then if e:IsCostChecked() then
e:SetCategory(CATEGORY_TODECK) e:SetCategory(CATEGORY_TODECK)
......
...@@ -16,6 +16,7 @@ function s.initial_effect(c) ...@@ -16,6 +16,7 @@ function s.initial_effect(c)
--to deck --to deck
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0)) e2:SetDescription(aux.Stringid(id,0))
-- TODO CATEGORY_SSET
e2:SetCategory(CATEGORY_TODECK) e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_RELEASE) e2:SetCode(EVENT_RELEASE)
...@@ -33,8 +34,7 @@ end ...@@ -33,8 +34,7 @@ end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,nil) local b1=Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,nil)
and (not e:IsCostChecked() or Duel.GetFlagEffect(tp,id)==0) and (not e:IsCostChecked() or Duel.GetFlagEffect(tp,id)==0)
local b2=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 local b2=Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil)
and (not e:IsCostChecked() or Duel.GetFlagEffect(tp,id+o)==0) and (not e:IsCostChecked() or Duel.GetFlagEffect(tp,id+o)==0)
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
local op=0 local op=0
...@@ -43,7 +43,7 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -43,7 +43,7 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
{b1,aux.Stringid(id,1),1}, {b1,aux.Stringid(id,1),1},
{b2,aux.Stringid(id,2),2}) {b2,aux.Stringid(id,2),2})
end end
e:SetLabel(op,ct) e:SetLabel(op)
if op==1 then if op==1 then
if e:IsCostChecked() then if e:IsCostChecked() then
e:SetCategory(CATEGORY_TODECK) e:SetCategory(CATEGORY_TODECK)
...@@ -65,7 +65,6 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,7 +65,6 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp)
if aux.NecroValleyNegateCheck(g) then return end if aux.NecroValleyNegateCheck(g) then return end
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
elseif e:GetLabel()==2 then elseif e:GetLabel()==2 then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -28,6 +28,9 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -28,6 +28,9 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectReleaseGroupEx(tp,aux.TRUE,1,1,REASON_COST,true,nil,tp) local g=Duel.SelectReleaseGroupEx(tp,aux.TRUE,1,1,REASON_COST,true,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function s.thfilter(c)
return s.thfilter1(c) or s.thfilter2(c)
end
function s.thfilter1(c) function s.thfilter1(c)
return not c:IsCode(id) and c:IsSetCard(0x2dc) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() return not c:IsCode(id) and c:IsSetCard(0x2dc) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end end
...@@ -35,21 +38,20 @@ function s.thfilter2(c) ...@@ -35,21 +38,20 @@ function s.thfilter2(c)
return c:IsCode(101304015) and c:IsAbleToHand() return c:IsCode(101304015) and c:IsAbleToHand()
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 return Duel.IsExistingMatchingCard(s.thfilter1,tp,LOCATION_DECK,0,1,nil) if chk==0 then
and Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_DECK,0,1,nil) end local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
return g:CheckSubGroup(aux.gffcheck,2,2,s.thfilter1,nil,s.thfilter2,nil)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
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 g1=Duel.GetMatchingGroup(s.thfilter1,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(s.thfilter2,tp,LOCATION_DECK,0,nil) if not g:CheckSubGroup(aux.gffcheck,2,2,s.thfilter1,nil,s.thfilter2,nil) then return end
if g1:GetCount()>0 and g2:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg1=g1:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg2=g2:Select(tp,1,1,nil) local tg1=g:SelectSubGroup(tp,aux.gffcheck,false,2,2,s.thfilter1,nil,s.thfilter2,nil)
sg1:Merge(sg2) if tg1:GetCount()==2 then
Duel.SendtoHand(sg1,nil,REASON_EFFECT) Duel.SendtoHand(tg1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg1) Duel.ConfirmCards(1-tp,tg1)
end end
end end
function s.filter(c,e,tp,chk) function s.filter(c,e,tp,chk)
......
...@@ -19,6 +19,7 @@ function s.initial_effect(c) ...@@ -19,6 +19,7 @@ function s.initial_effect(c)
--draw --draw
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1)) e3:SetDescription(aux.Stringid(id,1))
-- TODO CATEGORY_SSET
e3:SetCategory(CATEGORY_DRAW) e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
...@@ -44,19 +45,19 @@ function s.initial_effect(c) ...@@ -44,19 +45,19 @@ function s.initial_effect(c)
Duel.RegisterEffect(ge2,0) Duel.RegisterEffect(ge2,0)
end end
end end
function s.spfilter(c,e,tp,cost) function s.spfilter(c,e,tp)
return c:IsSetCard(0x2dc) and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x2dc) and c:IsType(TYPE_MONSTER)
and c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEUP) and c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEUP)
and (c:IsLocation(LOCATION_DECK) and Duel.GetMZoneCount(tp)>0 and (c:IsLocation(LOCATION_DECK) and Duel.GetMZoneCount(tp)>0
or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0) or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp,e:IsCostChecked()) end if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp,false) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end end
...@@ -84,7 +85,7 @@ function s.clearop(e,tp,eg,ep,ev,re,r,rp) ...@@ -84,7 +85,7 @@ function s.clearop(e,tp,eg,ep,ev,re,r,rp)
s[0]=0 s[0]=0
end end
function s.drcon(e,tp,eg,ep,ev,re,r,rp) function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(s[0],TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_PENDULUM+TYPE_LINK)~=0 return bit.band(s[0],TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_PENDULUM+TYPE_LINK)>0
end end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=0 local ct=0
...@@ -110,10 +111,10 @@ function s.drop(e,tp,eg,ep,ev,re,r,rp) ...@@ -110,10 +111,10 @@ function s.drop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,ct,REASON_EFFECT)~=0 then if Duel.Draw(tp,ct,REASON_EFFECT)~=0 then
local g=Duel.GetMatchingGroup(Card.IsSSetable,tp,LOCATION_HAND,0,nil) local g=Duel.GetMatchingGroup(Card.IsSSetable,tp,LOCATION_HAND,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.ShuffleHand(tp)
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
Duel.ShuffleHand(tp)
Duel.SSet(tp,sg,tp,false) Duel.SSet(tp,sg,tp,false)
end end
end end
......
...@@ -7,6 +7,7 @@ function s.initial_effect(c) ...@@ -7,6 +7,7 @@ function s.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) 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:SetHintTiming(0,TIMING_MAIN_END+TIMING_END_PHASE)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
...@@ -85,8 +86,11 @@ function s.aclimit(e,re,tp) ...@@ -85,8 +86,11 @@ function s.aclimit(e,re,tp)
local rc=re:GetHandler() local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and rc:IsSummonType(SUMMON_TYPE_SPECIAL) and rc:IsLocation(LOCATION_MZONE) and rc:IsSummonLocation(LOCATION_DECK+LOCATION_EXTRA) return re:IsActiveType(TYPE_MONSTER) and rc:IsSummonType(SUMMON_TYPE_SPECIAL) and rc:IsLocation(LOCATION_MZONE) and rc:IsSummonLocation(LOCATION_DECK+LOCATION_EXTRA)
end end
function s.thfilter(c,rc)
return c:GetEquipTarget()~=rc and c~=rc and c:IsAbleToHand()
end
function s.cfilter(c,tp) function s.cfilter(c,tp)
return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c,c)
end end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk) and Duel.CheckReleaseGroupEx(tp,s.cfilter,1,REASON_COST,true,nil,tp) end if chk==0 then return aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk) and Duel.CheckReleaseGroupEx(tp,s.cfilter,1,REASON_COST,true,nil,tp) end
...@@ -103,7 +107,7 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -103,7 +107,7 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function s.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToChain() then if tc:IsRelateToChain() and tc:IsOnField() then
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
end end
end end
...@@ -7,6 +7,7 @@ function s.initial_effect(c) ...@@ -7,6 +7,7 @@ function s.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -112,8 +113,8 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -112,8 +113,8 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit) e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp,2) Duel.RegisterEffect(e1,tp)
end end
end end
function s.aclimit(e,re,tp) function s.aclimit(e,re,tp)
...@@ -121,10 +122,10 @@ function s.aclimit(e,re,tp) ...@@ -121,10 +122,10 @@ function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and rc:IsSummonType(SUMMON_TYPE_SPECIAL) and rc:IsLocation(LOCATION_MZONE) and rc:IsSummonLocation(LOCATION_DECK+LOCATION_EXTRA) return re:IsActiveType(TYPE_MONSTER) and rc:IsSummonType(SUMMON_TYPE_SPECIAL) and rc:IsLocation(LOCATION_MZONE) and rc:IsSummonLocation(LOCATION_DECK+LOCATION_EXTRA)
end end
function s.sumcon(e,tp,eg,ep,ev,re,r,rp) function s.sumcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 return Duel.IsMainPhase()
end end
function s.sumfilter(c) function s.sumfilter(c)
return c:IsSetCard(0x2dc) and c:IsSummonable(true,nil,1) return c:IsSetCard(0x2dc)
end end
function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil) end
......
...@@ -21,7 +21,7 @@ function s.initial_effect(c) ...@@ -21,7 +21,7 @@ function s.initial_effect(c)
local custom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,id,EVENT_SUMMON_SUCCESS) local custom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,id,EVENT_SUMMON_SUCCESS)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1)) e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(custom_code) e3:SetCode(custom_code)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
...@@ -62,7 +62,7 @@ function s.drop(e,tp,eg,ep,ev,re,r,rp) ...@@ -62,7 +62,7 @@ function s.drop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.cfilter(c,tp,e) function s.cfilter(c,tp,e)
return c:IsControler(tp) and c:IsSummonType(SUMMON_TYPE_ADVANCE) return c:IsSummonPlayer(tp) and c:IsSummonType(SUMMON_TYPE_ADVANCE)
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 eg:IsExists(s.cfilter,1,nil,tp) return eg:IsExists(s.cfilter,1,nil,tp)
...@@ -84,8 +84,7 @@ function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -84,8 +84,7 @@ function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end end
function s.desop(e,tp,eg,ep,ev,re,r,rp) function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local sg=Duel.GetTargetsRelateToChain():Filter(Card.IsOnField,nil)
local sg=g:Filter(Card.IsRelateToChain,nil)
Duel.Destroy(sg,REASON_EFFECT) Duel.Destroy(sg,REASON_EFFECT)
end end
function s.stcon(e,tp,eg,ep,ev,re,r,rp) function s.stcon(e,tp,eg,ep,ev,re,r,rp)
......
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