Commit ce34d01b authored by wind2009's avatar wind2009

Merge remote-tracking branch 'upstream/master' into develop

parents 5d61b658 bb1c1c6c
......@@ -64,6 +64,9 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function s.filter(c,e)
return c:IsAbleToHand() and c:IsCanBeEffectTarget(e)
end
function s.thfilters(c)
return c:IsFaceup() and c:IsAllTypes(TYPE_CONTINUOUS|TYPE_TRAP) and c:IsSetCard(0x1c1)
end
......@@ -71,7 +74,7 @@ function s.sgselect(g)
return g:IsExists(s.thfilters,1,nil)
end
function s.thtg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,e)
if chkc then return false end
if chk==0 then return g:CheckSubGroup(s.sgselect,2,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
......
......@@ -38,8 +38,9 @@ end
function s.mfilter2(c)
return c:IsRace(RACE_ILLUSION)
end
function s.sprfilter(c)
return c:GetOriginalType()&TYPE_MONSTER~=0 and c:IsFaceup() and c:IsAbleToGraveAsCost()
function s.sprfilter(c,sc)
return c:GetOriginalType()&TYPE_MONSTER~=0 and c:IsFaceup()
and c:IsAbleToGraveAsCost() and c:IsCanBeFusionMaterial(sc,SUMMON_TYPE_SPECIAL)
end
function s.sgchk(g,tp,sc)
return Duel.GetLocationCountFromEx(tp,tp,g,sc)>0
......@@ -47,12 +48,12 @@ end
function s.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_SZONE,0,e:GetHandler())
local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_SZONE,0,c,c)
return g:CheckSubGroup(s.sgchk,2,2,tp,c)
end
function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local cp=c:GetControler()
local g=Duel.GetMatchingGroup(s.sprfilter,cp,LOCATION_SZONE,0,nil)
local g=Duel.GetMatchingGroup(s.sprfilter,cp,LOCATION_SZONE,0,c,c)
Duel.Hint(HINT_SELECTMSG,cp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(cp,s.sgchk,true,2,2,cp,c)
if sg then
......
--白の枢機竜
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddFusionProcCodeFun(c,68468459,s.mfilter,6,true,true)
aux.AddCodeList(c,68468459)
aux.AddMaterialCodeList(c,68468459)
--aux.AddFusionProcCodeFun(c,68468459,s.mfilter,6,true,true)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_FUSION_MATERIAL)
e0:SetCondition(s.Alba_System_Drugmata_Fusion_Condition())
e0:SetOperation(s.Alba_System_Drugmata_Fusion_Operation())
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......@@ -36,32 +45,79 @@ end
function s.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
function s.samecheck(c,sg)
local fuscodes={c:GetFusionCode()}
for _,code in ipairs(fuscodes) do
if not sg:IsExists(Card.IsCode,1,nil,code) then return true end
end
return false
function s.Alba_System_Drugmata_Fusion_Filter(c,mg,fc,tp,chkf,gc)
if not c:IsFusionCode(68468459) and not c:IsHasEffect(EFFECT_FUSION_SUBSTITUTE) then return false end
local g=mg:Filter(s.matfilter,c,tp)
aux.GCheckAdditional=aux.dncheck
local res=g:CheckSubGroup(s.Alba_System_Drugmata_Fusion_Gcheck,6,6,fc,tp,c,chkf,gc)
aux.GCheckAdditional=nil
return res
end
function s.migfilter(c,fc)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(fc:GetControler())
function s.matfilter(c,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and not c:IsHasEffect(6205579)
end
if not s.abs_list then
s.abs_list={}
function s.Alba_System_Drugmata_Fusion_Gcheck(g,fc,tp,ec,chkf,gc)
local sg=g:Clone()
sg:AddCard(ec)
if sg:IsExists(aux.TuneMagicianCheckX,1,nil,sg,EFFECT_TUNE_MAGICIAN_F) then return false end
if gc and not sg:IsContains(gc) then return false end
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:GetClassCount(Card.GetFusionCode)==g:GetCount()
and (chkf==PLAYER_NONE or Duel.GetLocationCountFromEx(tp,tp,sg,fc)>0)
end
function s.mfilter(c,fc,sub,mg,sg)
if not s.migfilter(c,fc) then return false end
if sg then
if #sg==0 then return false end -- must select at 2nd place, to determine which one is abs
if #sg==1 then
s.abs_list[fc]=sg:GetFirst()
return true
function s.Alba_System_Drugmata_Fusion_Condition()
return function(e,g,gc,chkf)
if g==nil then return aux.MustMaterialCheck(nil,e:GetHandlerPlayer(),EFFECT_MUST_BE_FMATERIAL) end
local fc=e:GetHandler()
local tp=e:GetHandlerPlayer()
if gc then
if not g:IsContains(gc) then return false end
return g:IsExists(s.Alba_System_Drugmata_Fusion_Filter,1,nil,g,fc,tp,chkf,gc)
end
return g:IsExists(s.Alba_System_Drugmata_Fusion_Filter,1,nil,g,fc,tp,chkf,nil)
end
end
function s.Alba_System_Drugmata_Fusion_Operation()
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
local fc=e:GetHandler()
local tp=e:GetHandlerPlayer()
local fg=eg:Clone()
local g=nil
local sg=nil
while not sg do
if g then
fg:AddCard(g:GetFirst())
end
if gc then
if s.Alba_System_Drugmata_Fusion_Filter(gc,fg,fc,tp,chkf) then
g=Group.FromCards(gc)
fg:RemoveCard(gc)
local mg=fg:Filter(s.matfilter,fc,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
sg=mg:SelectSubGroup(tp,s.Alba_System_Drugmata_Fusion_Gcheck,false,6,6,fc,tp,g:GetFirst(),chkf,gc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g=fg:FilterSelect(tp,s.Alba_System_Drugmata_Fusion_Filter,1,1,nil,fg,fc,tp,chkf,gc)
fg:Sub(g)
local mg=fg:Filter(s.matfilter,fc,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
sg=mg:SelectSubGroup(tp,s.Alba_System_Drugmata_Fusion_Gcheck,true,6,6,fc,tp,g:GetFirst(),chkf,gc)
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g=fg:FilterSelect(tp,s.Alba_System_Drugmata_Fusion_Filter,1,1,nil,fg,fc,tp,chkf,nil)
fg:Sub(g)
local mg=fg:Filter(s.matfilter,fc,tp)
aux.GCheckAdditional=aux.dncheck
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
sg=mg:SelectSubGroup(tp,s.Alba_System_Drugmata_Fusion_Gcheck,true,6,6,fc,tp,g:GetFirst(),chkf)
aux.GCheckAdditional=nil
end
end
g:Merge(sg)
Duel.SetFusionMaterial(g)
end
return s.samecheck(c,sg-s.abs_list[fc])
end
return true
end
function s.costfilter(c)
return c:IsAbleToGraveAsCost()
......
......@@ -31,8 +31,8 @@ function s.initial_effect(c)
c:RegisterEffect(e2)
end
c95095116.material_type=TYPE_SYNCHRO
function s.mfilter(c)
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE)
function s.mfilter(c,fc)
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsControler(fc:GetControler())
end
function s.negcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
This diff is collapsed.
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