Commit bd317811 authored by nanahira's avatar nanahira

predata

parent cc5086e0
...@@ -17,12 +17,12 @@ function c100240003.initial_effect(c) ...@@ -17,12 +17,12 @@ function c100240003.initial_effect(c)
e1:SetOperation(c100240003.spop) e1:SetOperation(c100240003.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c100240003.spfilter(c,tp) function c100240003.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousSetCard(0x99) return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousSetCard(0x99)
and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
end end
function c100240003.spcon(e,tp,eg,ep,ev,re,r,rp) function c100240003.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100240003.spfilter,1,nil,tp) return eg:IsExists(c100240003.cfilter,1,nil,tp)
end end
function c100240003.spfilter(c,e,tp) function c100240003.spfilter(c,e,tp)
return c:IsSetCard(0x99) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x99) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -69,7 +69,7 @@ function c100407008.atcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -69,7 +69,7 @@ function c100407008.atcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==c and c:IsChainAttackable(0,true) return Duel.GetAttacker()==c and c:IsChainAttackable(0,true)
end end
function c100407008.atcost(e,tp,eg,ep,ev,re,r,rp,chk) function c100407008.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,e:GetHandler()) nd if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,e:GetHandler()) end
local g=Duel.SelectReleaseGroup(tp,nil,1,1,e:GetHandler()) local g=Duel.SelectReleaseGroup(tp,nil,1,1,e:GetHandler())
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
......
...@@ -23,7 +23,7 @@ function c100407015.initial_effect(c) ...@@ -23,7 +23,7 @@ function c100407015.initial_effect(c)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetCondition(c100407015.descon) e2:SetCondition(c100407015.descon)
e2:SetCost(c68450517.descost) e2:SetCost(c100407015.descost)
e2:SetTarget(c100407015.destg) e2:SetTarget(c100407015.destg)
e2:SetOperation(c100407015.desop) e2:SetOperation(c100407015.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
......
...@@ -11,38 +11,42 @@ function c100407032.initial_effect(c) ...@@ -11,38 +11,42 @@ function c100407032.initial_effect(c)
e1:SetOperation(c100407032.activate) e1:SetOperation(c100407032.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c100407032.fcheck(tp,sg,fc,mg)
if sg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
return sg:IsExists(c100407032.filterchk,1,nil) end
return true
end
function c100407032.filterchk(c)
return c:IsFaceup() and c:IsCode(83104731,95735217) and c:IsOnField()
end
function c100407032.filter0(c) function c100407032.filter0(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave() return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end end
function c100407032.filter1(c,e) function c100407032.filter1(c,e)
return not c:IsImmuneToEffect(e) return not c:IsImmuneToEffect(e)
end end
function c100407032.filter2(c,e,tp,m,f,chkf,agc) function c100407032.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x7) and (not f or f(c)) return c:IsType(TYPE_FUSION) and c:IsSetCard(0x7) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,agc,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c100407032.agfilter(c,e,tp,m,m2,f,chkf)
if c:IsFacedown() or not c:IsCode(83104731,95735217) or not m:IsContains(c) then return false end
local g=m:Clone()
g:Merge(m2)
g:RemoveCard(c)
return Duel.IsExistingMatchingCard(c100407032.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,g,f,chkf,c)
end end
function c100407032.target(e,tp,eg,ep,ev,re,r,rp,chk) function c100407032.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local chkf=tp local chkf=tp
local mg=Duel.GetFusionMaterial(tp) local mg=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(c100407032.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf,nil)
if res then return true end
local mg2=Duel.GetMatchingGroup(c100407032.filter0,tp,LOCATION_DECK,0,nil) local mg2=Duel.GetMatchingGroup(c100407032.filter0,tp,LOCATION_DECK,0,nil)
res=Duel.IsExistingMatchingCard(c100407032.agfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,mg,mg2,nil,chkf) if mg2:GetCount()>0 then
mg:Merge(mg2)
aux.FCheckAdditional=c100407032.fcheck
end
local res=Duel.IsExistingMatchingCard(c100407032.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
aux.FCheckAdditional=nil
if not res then if not res then
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
if ce~=nil then if ce~=nil then
local fgroup=ce:GetTarget() local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp) local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue() local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c100407032.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf,nil) res=Duel.IsExistingMatchingCard(c100407032.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end end
end end
return res return res
...@@ -51,57 +55,39 @@ end ...@@ -51,57 +55,39 @@ end
function c100407032.activate(e,tp,eg,ep,ev,re,r,rp) function c100407032.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c100407032.filter1,nil,e) local mg1=Duel.GetFusionMaterial(tp):Filter(c100407032.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c100407032.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf,nil)
local mg2=Duel.GetMatchingGroup(c100407032.filter0,tp,LOCATION_DECK,0,nil) local mg2=Duel.GetMatchingGroup(c100407032.filter0,tp,LOCATION_DECK,0,nil)
local sg2=Duel.GetMatchingGroup(c100407032.agfilter,tp,LOCATION_MZONE,0,nil,e,tp,mg1,mg2,nil,chkf) if mg2:GetCount()>0 then
local mg3=nil mg1:Merge(mg2)
local sg3=nil aux.FCheckAdditional=c100407032.fcheck
end
local sg1=Duel.GetMatchingGroup(c100407032.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
aux.FCheckAdditional=nil
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
if ce~=nil then if ce~=nil then
local fgroup=ce:GetTarget() local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp) mg2=fgroup(ce,e,tp)
local mf=ce:GetValue() local mf=ce:GetValue()
sg3=Duel.GetMatchingGroup(c100407032.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf) sg2=Duel.GetMatchingGroup(c100407032.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end end
if sg2:GetCount()>0 and (sg1:GetCount()==0 or Duel.SelectYesNo(tp,aux.Stringid(100407032,0)) then local sg=sg1:Clone()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) if sg2 then sg:Merge(sg2) end
local agc=sg2:Select(tp,1,1,nil):GetFirst() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
mg1:Merge(mg2) local tg=sg:Select(tp,1,1,nil)
mg1:RemoveCard(agc) local tc=tg:GetFirst()
local sg0=Duel.GetMatchingGroup(c100407032.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf,agc) if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local sg=sg0:Clone() aux.FCheckAdditional=c100407032.fcheck
if sg3 then sg:Merge(sg3) end local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
local tg=sg:Select(tp,1,1,nil) aux.FCheckAdditional=nil
local tc=tg:GetFirst() tc:SetMaterial(mat1)
if sg0:IsContains(tc) and (sg3==nil or not sg3:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,agc,chkf) Duel.BreakEffect()
tc:SetMaterial(mat1) Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,agc,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
else else
local sg=sg1:Clone() local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
if sg3 then sg:Merge(sg3) end local fop=ce:GetOperation()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) fop(ce,e,tp,tc,mat2)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg3==nil or not sg3:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end end
tc:CompleteProcedure()
end end
...@@ -50,7 +50,7 @@ end ...@@ -50,7 +50,7 @@ end
function c101003016.spcfilter(c,tp,mc) function c101003016.spcfilter(c,tp,mc)
if c:GetPreviousControler()==tp then return false end if c:GetPreviousControler()==tp then return false end
local loc=LOCATION_MZONE local loc=LOCATION_MZONE
if c:IsPreviousLocation(LOCATION_SZONE) then loc=LOCATION_SZONE if c:IsPreviousLocation(LOCATION_SZONE) then loc=LOCATION_SZONE end
local zone=mc:GetColumnZone(loc) local zone=mc:GetColumnZone(loc)
local seq=c:GetPreviousSequence()+16 local seq=c:GetPreviousSequence()+16
return zone and bit.extract(zone,seq)~=0 return zone and bit.extract(zone,seq)~=0
......
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