Commit 1a548fb7 authored by fallenstardust's avatar fallenstardust

update QCDB-JP001 script

parent d2e56678
...@@ -37,67 +37,113 @@ function c100212001.initial_effect(c) ...@@ -37,67 +37,113 @@ function c100212001.initial_effect(c)
e3:SetTarget(c100212001.sptg) e3:SetTarget(c100212001.sptg)
e3:SetOperation(c100212001.spop) e3:SetOperation(c100212001.spop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
if not c100212001.global_check then
c100212001.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_SOLVING)
ge1:SetOperation(c100212001.count)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_CHAIN_SOLVED)
ge2:SetOperation(c100212001.reset)
Duel.RegisterEffect(ge2,0)
end
end
function c100212001.count(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsCode(71143015) then
c100212001.chain_solving=true
end
end
function c100212001.reset(e,tp,eg,ep,ev,re,r,rp)
c100212001.chain_solving=false
end end
function c100212001.FShaddollFilter(c) function c100212001.FShaddollFilter(c)
return c:IsFusionSetCard(0xdd) or c:IsFusionSetCard(0xcf) and c:IsFusionType(TYPE_RITUAL) or c:IsFusionCode(23995346) or c:IsHasEffect(EFFECT_FUSION_SUBSTITUTE) return c:IsFusionSetCard(0xdd) or c:IsFusionSetCard(0xcf) and c:IsFusionType(TYPE_RITUAL) or c:IsFusionCode(23995346) or c:IsHasEffect(EFFECT_FUSION_SUBSTITUTE)
end end
function c100212001.Chaos_FShaddollFilter(c,mg,fe) function c100212001.Ultimate_FShaddollFilter(c)
return c:IsFusionSetCard(0xcf) and c:IsFusionType(TYPE_RITUAL) and mg:CheckSubGroup(c100212001.FShaddollSpgcheck,1,3,c,fe) return c:IsFusionSetCard(0xdd) or (c:IsFusionSetCard(0xcf) and c:IsFusionType(TYPE_RITUAL)) or c:IsFusionCode(23995346)
end end
function c100212001.Blue_Eyes_Ultimate_Dragon(c,g,fe) function c100212001.Chaos_FShaddollFilter(c,mg,fc,chkf)
return (c:IsFusionCode(23995346) return c:IsFusionSetCard(0xcf) and c:IsFusionType(TYPE_RITUAL) and mg:CheckSubGroup(c100212001.FShaddollSpgcheck,1,3,fc,c,chkf)
or c:IsHasEffect(EFFECT_FUSION_SUBSTITUTE) and not fe:GetHandler():IsCode(71143015)) end
and g:FilterCount(Card.IsFusionSetCard,c,0xdd)==0 function c100212001.Blue_Eyes_Ultimate_Dragon(c)
return c:IsFusionCode(23995346) and not c:IsHasEffect(EFFECT_FUSION_SUBSTITUTE)
or c:IsHasEffect(EFFECT_FUSION_SUBSTITUTE)
end end
function c100212001.FShaddollSpgcheck(g,c,fe) function c100212001.FShaddollSpgcheck(g,fc,ec,chkf)
return (g:FilterCount(c100212001.Blue_Eyes_Ultimate_Dragon,c,g,fe)==1 local sg=g:Clone()
or g:FilterCount(Card.IsFusionSetCard,c,0xdd)==3) sg:AddCard(ec)
local c=g:Filter(c100212001.Blue_Eyes_Ultimate_Dragon,nil):GetFirst()
if aux.FCheckAdditional and not aux.FCheckAdditional(tp,sg,fc)
or aux.FGoalCheckAdditional and not aux.FGoalCheckAdditional(tp,sg,fc) then return false end
return (g:FilterCount(c100212001.Blue_Eyes_Ultimate_Dragon,nil)==1
and g:FilterCount(Card.IsFusionSetCard,c,0xdd)==0
or g:FilterCount(Card.IsFusionSetCard,nil,0xdd)==3)
and (chkf==PLAYER_NONE or Duel.GetLocationCountFromEx(tp,tp,sg,fc)>0)
end end
function c100212001.Necessarily_FShaddollFilter(c,gc) function c100212001.Necessarily_FShaddollFilter(c,gc)
return c:IsCode(gc:GetCode()) return c:IsCode(gc:GetCode())
end end
function c100212001.Necessarily_FShaddollSpgcheck(g,c,fe,gc) function c100212001.Necessarily_FShaddollSpgcheck(g,gc,fc,ec,chkf)
return g:FilterCount(Card.IsFusionSetCard,c,0xdd)==3 and g:FilterCount(c100212001.Necessarily_FShaddollFilter,nil,gc)==1 local c=g:Filter(c100212001.Blue_Eyes_Ultimate_Dragon,nil):GetFirst()
local sg=g:Clone()
sg:AddCard(ec)
if aux.FCheckAdditional and not aux.FCheckAdditional(tp,sg,fc)
or aux.FGoalCheckAdditional and not aux.FGoalCheckAdditional(tp,sg,fc) then return false end
return ((g:FilterCount(c100212001.Blue_Eyes_Ultimate_Dragon,nil)==1
and g:FilterCount(Card.IsFusionSetCard,c,0xdd)==0
or g:FilterCount(Card.IsFusionSetCard,nil,0xdd)==3) and g:FilterCount(c100212001.Necessarily_FShaddollFilter,nil,gc)==1)
and (chkf==PLAYER_NONE or Duel.GetLocationCountFromEx(tp,tp,sg,fc)>0)
end end
function c100212001.FShaddollCondition() function c100212001.FShaddollCondition()
return function(e,g,gc,chkf) return function(e,g,gc,chkf)
if g==nil then return aux.MustMaterialCheck(nil,e:GetHandlerPlayer(),EFFECT_MUST_BE_FMATERIAL) end if g==nil then return aux.MustMaterialCheck(nil,e:GetHandlerPlayer(),EFFECT_MUST_BE_FMATERIAL) end
local c=e:GetHandler() local fc=e:GetHandler()
local tp=e:GetHandlerPlayer()
local mg=g:Filter(c100212001.FShaddollFilter,nil) local mg=g:Filter(c100212001.FShaddollFilter,nil)
if gc then if gc then
if not mg:IsContains(gc) then return false end if not mg:IsContains(gc) then return false end
end end
return mg:IsExists(c100212001.Chaos_FShaddollFilter,1,nil,mg,e) return mg:IsExists(c100212001.Chaos_FShaddollFilter,1,nil,mg,fc,chkf)
end end
end end
function c100212001.FShaddollOperation() function c100212001.FShaddollOperation()
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf) return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
local c=e:GetHandler() local fc=e:GetHandler()
local mg=eg:Filter(c100212001.FShaddollFilter,nil) local tp=e:GetHandlerPlayer()
local mg=nil
if c100212001.chain_solving then
mg=eg:Filter(c100212001.Ultimate_FShaddollFilter,nil)
else
mg=eg:Filter(c100212001.FShaddollFilter,nil)
end
local g=nil local g=nil
if gc then if gc then
if c100212001.Chaos_FShaddollFilter(c,mg,e) then if not mg:IsContains(gc) then return false end
end
if gc then
if c100212001.Chaos_FShaddollFilter(gc,mg,fc,chkf) then
g=Group.FromCards(gc) g=Group.FromCards(gc)
mg:RemoveCard(gc) mg:RemoveCard(gc)
end end
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g=mg:FilterSelect(tp,c100212001.Chaos_FShaddollFilter,1,1,nil,mg,e) g=mg:FilterSelect(tp,c100212001.Chaos_FShaddollFilter,1,1,nil,mg,fc,chkf)
mg:Sub(g) mg:Sub(g)
end end
local sg=nil local sg=nil
if gc and g:FilterCount(c100212001.Necessarily_FShaddollFilter,nil,gc)==1 then if gc and g:FilterCount(c100212001.Necessarily_FShaddollFilter,nil,gc)==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
sg=mg:SelectSubGroup(tp,c100212001.FShaddollSpgcheck,true,1,3,g,e) sg=mg:SelectSubGroup(tp,c100212001.FShaddollSpgcheck,false,1,3,gc,g:GetFirst(),fc,chkf)
else else
if gc and c100212001.Blue_Eyes_Ultimate_Dragon(gc,g,e) then if gc then
sg=Group.FromCards(gc)
elseif gc then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
sg=mg:SelectSubGroup(tp,c100212001.Necessarily_FShaddollSpgcheck,true,1,3,g,e,gc) sg=mg:SelectSubGroup(tp,c100212001.Necessarily_FShaddollSpgcheck,false,1,3,gc,g:GetFirst(),fc,chkf)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
sg=mg:SelectSubGroup(tp,c100212001.FShaddollSpgcheck,true,1,3,g,e) sg=mg:SelectSubGroup(tp,c100212001.FShaddollSpgcheck,true,1,3,g:GetFirst(),fc,chkf)
end end
end end
while not sg do while not sg do
...@@ -106,7 +152,7 @@ function c100212001.FShaddollOperation() ...@@ -106,7 +152,7 @@ function c100212001.FShaddollOperation()
g=mg:FilterSelect(tp,c100212001.Chaos_FShaddollFilter,1,1,nil,mg,e) g=mg:FilterSelect(tp,c100212001.Chaos_FShaddollFilter,1,1,nil,mg,e)
mg:Sub(g) mg:Sub(g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
sg=mg:SelectSubGroup(tp,c100212001.FShaddollSpgcheck,true,1,3,g,e) sg=mg:SelectSubGroup(tp,c100212001.FShaddollSpgcheck,true,1,3,g:GetFirst(),fc,chkf)
end end
g:Merge(sg) g:Merge(sg)
Duel.SetFusionMaterial(g) Duel.SetFusionMaterial(g)
......
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