Commit 848a183b authored by VanillaSalt's avatar VanillaSalt

fix

parent ccf0fc75
......@@ -75,7 +75,7 @@ function c17016362.mtop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCountLimit(1)
e2:SetOperation(c17016362.desop)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
tc:RegisterEffect(e2,true)
tc:RegisterEffect(e2)
end
end
function c17016362.desop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -18,7 +18,7 @@ function c22174866.initial_effect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_RECOVER)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_EVENT_PLAYER)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetCondition(c22174866.thcon)
e3:SetTarget(c22174866.thtg)
......@@ -37,7 +37,7 @@ function c22174866.thfilter(c)
end
function c22174866.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c22174866.thfilter(chkc) end
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
if chk==0 then return ep==tp and e:GetHandler():IsRelateToEffect(e) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c22174866.thfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
......
......@@ -39,6 +39,9 @@ function c51194046.initial_effect(c)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(c51194046.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_MSET)
Duel.RegisterEffect(ge2,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD)
ge2:SetCode(EFFECT_MATERIAL_CHECK)
......
......@@ -29,12 +29,9 @@ function c56611470.xyzfilter(c,mg)
return c:IsXyzSummonable(mg)
end
function c56611470.mfilter1(c,exg)
return exg:IsExists(c56611470.mfilter2,1,nil,c)
return exg:IsExists(c56611470.mfilter2,1,nil,c,exg)
end
function c56611470.mfilter2(c,mc)
return c.xyz_filter(mc)
end
function c56611470.mfilter3(c,mc,exg)
function c56611470.mfilter2(c,mc,exg)
return exg:IsExists(Card.IsXyzSummonable,1,nil,Group.FromCards(c,mc))
end
function c56611470.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......@@ -43,11 +40,11 @@ function c56611470.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and mg:GetCount()>1
and Duel.IsExistingMatchingCard(c56611470.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,mg) end
local exg=Duel.GetMatchingGroup(c56611470.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg1=mg:FilterSelect(tp,c56611470.mfilter1,1,1,nil,exg)
local tc1=sg1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sg2=mg:FilterSelect(tp,c56611470.mfilter3,1,1,tc1,tc1,exg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg2=mg:FilterSelect(tp,c56611470.mfilter2,1,1,tc1,tc1,exg)
sg1:Merge(sg2)
Duel.SetTargetCard(sg1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
......
......@@ -14,7 +14,7 @@ function c58569561.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_RECOVER)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_EVENT_PLAYER)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetCondition(c58569561.poscon)
e2:SetTarget(c58569561.postg)
......@@ -50,7 +50,7 @@ function c58569561.poscon(e,tp,eg,ep,ev,re,r,rp)
end
function c58569561.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
if chk==0 then return ep==tp and e:GetHandler():IsRelateToEffect(e) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
......
......@@ -37,10 +37,12 @@ function c59546797.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function c59546797.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Recover(tp,1000,REASON_EFFECT)
elseif Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
function c59546797.atkcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -50,8 +50,8 @@ function c65305468.initial_effect(c)
end
c65305468.xyz_number=0
c65305468.xyz_count=2
function c65305468.mfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and not c:IsSetCard(0x48)
function c65305468.mfilter(c,xyzc)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and not c:IsSetCard(0x48) and c:IsCanBeXyzMaterial(xyzc)
end
function c65305468.xyzfilter1(c,g)
return g:IsExists(c65305468.xyzfilter2,1,c,c:GetRank())
......@@ -62,31 +62,34 @@ end
function c65305468.xyzcon(e,c,og)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c65305468.mfilter,tp,LOCATION_MZONE,0,nil)
if og then mg=og end
local mg=nil
if og then
mg=og:Filter(c65305468.mfilter,nil,c)
else
mg=Duel.GetMatchingGroup(c65305468.mfilter,tp,LOCATION_MZONE,0,nil,c)
end
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and mg:IsExists(c65305468.xyzfilter1,1,nil,mg)
end
function c65305468.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og)
local g=Group.CreateGroup()
local g=nil
local sg=Group.CreateGroup()
if og then
g=og
local tc=og:GetFirst()
while tc do
g:AddCard(tc)
sg:Merge(tc:GetOverlayGroup())
tc=og:GetNext()
end
else
local mg=Duel.GetMatchingGroup(c65305468.mfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g1=mg:FilterSelect(tp,c65305468.xyzfilter1,1,1,nil,mg)
local tc1=g1:GetFirst()
g=mg:FilterSelect(tp,c65305468.xyzfilter1,1,1,nil,mg)
local tc1=g:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g2=mg:FilterSelect(tp,c65305468.xyzfilter2,1,1,tc1,tc1:GetRank())
local tc2=g2:GetFirst()
g:AddCard(tc1)
g:AddCard(tc2)
g:Merge(g2)
sg:Merge(tc1:GetOverlayGroup())
sg:Merge(tc2:GetOverlayGroup())
end
......
......@@ -12,7 +12,7 @@ function c68473226.initial_effect(c)
--effect reg
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCode(EVENT_BE_PRE_MATERIAL)
e2:SetCondition(c68473226.regcon)
e2:SetOperation(c68473226.regop)
c:RegisterEffect(e2)
......@@ -43,6 +43,10 @@ function c68473226.regop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(1)
e1:SetCondition(c68473226.indcon)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
end
function c68473226.indcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_MZONE)
end
......@@ -35,15 +35,28 @@ function c83546647.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c83546647.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_CHAIN)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetRange(LOCATION_HAND)
e2:SetOperation(c83546647.clearop)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_CHAIN)
e2:SetLabel(Duel.GetCurrentChain())
e2:SetLabelObject(e1)
tc:RegisterEffect(e2)
Duel.SetTargetCard(g)
e:SetLabelObject(g:GetFirst())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function c83546647.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local tc1=e:GetLabelObject()
local tc1=Duel.GetFirstTarget()
if not tc1:IsRelateToEffect(e) or not tc1:IsCanBeSpecialSummoned(e,0,tp,false,false) then return end
local tc2=Duel.GetFirstMatchingCard(c83546647.spfilter2,tp,LOCATION_DECK,0,nil,e,tp,tc1:GetCode())
if tc2 then
......@@ -52,3 +65,8 @@ function c83546647.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonComplete()
end
end
function c83546647.clearop(e,tp,eg,ep,ev,re,r,rp)
if ev~=e:GetLabel() then return end
e:GetLabelObject():Reset()
e:Reset()
end
......@@ -15,7 +15,6 @@ function c85967160.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_RECOVER)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e2:SetCountLimit(1)
e2:SetCondition(c85967160.adcon)
e2:SetTarget(c85967160.adtg)
......@@ -30,7 +29,7 @@ function c85967160.adcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function c85967160.adtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
if chk==0 then return ep==tp and e:GetHandler():IsRelateToEffect(e) end
end
function c85967160.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -15,7 +15,7 @@ function c96789758.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_RECOVER)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_EVENT_PLAYER)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCountLimit(1)
e2:SetCondition(c96789758.drcon)
e2:SetTarget(c96789758.drtg)
......@@ -33,7 +33,7 @@ function c96789758.drcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function c96789758.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
if chk==0 then return ep==tp and e:GetHandler():IsRelateToEffect(e) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
......
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