Commit 338a9804 authored by nanahira's avatar nanahira Committed by mercury233

update Tatsunoko (#916)

parent 3af2f0fe
...@@ -30,49 +30,55 @@ function c55863245.initial_effect(c) ...@@ -30,49 +30,55 @@ function c55863245.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c55863245.synfilter1(c,syncard,tuner,f) function c55863245.synfilter1(c,syncard,tuner,f)
return c:IsFaceup() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c)) return (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c))
end end
function c55863245.synfilter2(c,syncard,tuner,f,g,lv,minc,maxc) function c55863245.syncheck(c,g,mg,tp,lv,syncard,minc,maxc)
if c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c)) then g:AddCard(c)
lv=lv-c:GetLevel() local ct=g:GetCount()
if lv<0 then return false end local res=(ct<maxc and mg:IsExists(c55863245.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc))
if lv==0 then return minc==1 end or (ct>=minc and c55863245.syngoal(g,tp,lv,syncard))
return g:CheckWithSumEqual(Card.GetSynchroLevel,lv,minc-1,maxc-1,syncard) g:RemoveCard(c)
else return false end return res
end
function c55863245.syngoal(g,tp,lv,syncard)
local ct=g:GetCount()
return g:CheckWithSumEqual(Card.GetSynchroLevel,lv,ct,ct,syncard) and Duel.GetLocationCountFromEx(tp,tp,g,syncard)>0 and g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)<=1
end end
function c55863245.syncon(e) function c55863245.syncon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end end
function c55863245.syntg(e,syncard,f,minc,maxc) function c55863245.syntg(e,syncard,f,min,max)
local minc=min+1
local maxc=max+1
local c=e:GetHandler() local c=e:GetHandler()
local tp=syncard:GetControler() local tp=syncard:GetControler()
local lv=syncard:GetLevel()-c:GetLevel() local lv=syncard:GetLevel()
if lv<=0 then return false end if lv<=0 then return false end
local g1=Duel.GetMatchingGroup(c55863245.synfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f) local g=Group.FromCards(e:GetHandler())
return g1:CheckWithSumEqual(Card.GetSynchroLevel,lv,minc,maxc,syncard) local mg=Duel.GetMatchingGroup(c55863245.synfilter1,tp,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE,c,syncard,c,f)
or Duel.IsExistingMatchingCard(c55863245.synfilter2,tp,LOCATION_HAND,0,1,nil,syncard,c,f,g1,lv,minc,maxc) return mg:IsExists(c55863245.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc)
end end
function c55863245.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc,maxc) function c55863245.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,min,max)
local minc=min+1
local maxc=max+1
local c=e:GetHandler() local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel() local lv=syncard:GetLevel()
local g1=Duel.GetMatchingGroup(c55863245.synfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f) local g=Group.FromCards(e:GetHandler())
local g2=Duel.GetMatchingGroup(c55863245.synfilter2,tp,LOCATION_HAND,0,nil,syncard,c,f,g1,lv,minc,maxc) local mg=Duel.GetMatchingGroup(c55863245.synfilter1,tp,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE,c,syncard,c,f)
if not g1:CheckWithSumEqual(Card.GetSynchroLevel,lv,minc,maxc,syncard) for i=1,maxc do
or (g2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(55863245,0))) then local cg=mg:Filter(c55863245.syncheck,g,g,mg,tp,lv,syncard,minc,maxc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) if cg:GetCount()==0 then break end
local sg=g2:Select(tp,1,1,nil) local minct=1
local tc=sg:GetFirst() if c55863245.syngoal(g,tp,lv,syncard) then
if lv>tc:GetLevel() then if not Duel.SelectYesNo(tp,210) then break end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) minct=0
local tg=g1:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv-tc:GetLevel(),minc-1,maxc-1,syncard)
sg:Merge(tg)
end end
Duel.SetSynchroMaterial(sg)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=g1:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv,minc,maxc,syncard) local sg=cg:Select(tp,minct,1,nil)
Duel.SetSynchroMaterial(sg) if sg:GetCount()==0 then break end
g:Merge(sg)
end end
Duel.SetSynchroMaterial(g)
end end
function c55863245.efilter(e,te) function c55863245.efilter(e,te)
return te:IsActiveType(TYPE_MONSTER) and te:GetOwner()~=e:GetOwner() return te:IsActiveType(TYPE_MONSTER) and te:GetOwner()~=e:GetOwner()
......
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