Commit 6c3dbc45 authored by VanillaSalt's avatar VanillaSalt

fix

parent 46a8de3c
...@@ -26,6 +26,13 @@ function c48144509.filter2(c,e,tp,m,f,chkf) ...@@ -26,6 +26,13 @@ function c48144509.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_DRAGON) and (not f or f(c)) return c:IsType(TYPE_FUSION) and c:IsRace(RACE_DRAGON) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function c48144509.filter3(c,e,tp,m,f,chkf)
if c:IsType(TYPE_FUSION) and c:IsRace(RACE_DRAGON) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) then
if c.check_fusion_material_48144509 then return c.check_fusion_material_48144509(m,chkf) end
return c:CheckFusionMaterial(m,nil,chkf)
else return false end
end
function c48144509.target(e,tp,eg,ep,ev,re,r,rp,chk) function c48144509.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp
...@@ -34,7 +41,7 @@ function c48144509.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -34,7 +41,7 @@ function c48144509.target(e,tp,eg,ep,ev,re,r,rp,chk)
local sg=Duel.GetMatchingGroup(c48144509.exfilter0,tp,LOCATION_EXTRA,0,nil) local sg=Duel.GetMatchingGroup(c48144509.exfilter0,tp,LOCATION_EXTRA,0,nil)
mg1:Merge(sg) mg1:Merge(sg)
end end
local res=Duel.IsExistingMatchingCard(c48144509.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) local res=Duel.IsExistingMatchingCard(c48144509.filter3,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
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
...@@ -55,7 +62,7 @@ function c48144509.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,7 +62,7 @@ function c48144509.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c48144509.exfilter1,tp,LOCATION_EXTRA,0,nil,e) local sg=Duel.GetMatchingGroup(c48144509.exfilter1,tp,LOCATION_EXTRA,0,nil,e)
mg1:Merge(sg) mg1:Merge(sg)
end end
local sg1=Duel.GetMatchingGroup(c48144509.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local sg1=Duel.GetMatchingGroup(c48144509.filter3,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil local mg2=nil
local sg2=nil local sg2=nil
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
...@@ -72,7 +79,12 @@ function c48144509.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -72,7 +79,12 @@ function c48144509.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=sg:Select(tp,1,1,nil) local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf) local mat1=nil
if tc.select_fusion_material_48144509 then
mat1=tc.select_fusion_material_48144509(tp,mg1,chkf)
else
mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
end
tc:SetMaterial(mat1) tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -23,12 +23,12 @@ function c48422921.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -23,12 +23,12 @@ function c48422921.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if reg then val=val-reg end if reg then val=val-reg end
Duel.Hint(HINT_SELECTMSG,tp,562) Duel.Hint(HINT_SELECTMSG,tp,562)
local att=Duel.AnnounceAttribute(tp,1,val) local att=Duel.AnnounceAttribute(tp,1,val)
Duel.SetTargetParam(att) e:SetLabel(att)
end end
function c48422921.operation(e,tp,eg,ep,ev,re,r,rp) function c48422921.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local att=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM) local att=e:GetLabel()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_START) e1:SetCode(EVENT_BATTLE_START)
......
...@@ -40,7 +40,7 @@ function c52145422.descon(e,tp,eg,ep,ev,re,r,rp) ...@@ -40,7 +40,7 @@ function c52145422.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO
end end
function c52145422.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c52145422.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsDestructable() end if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsDestructable() end
local ct=e:GetLabel() local ct=e:GetLabel()
if chk==0 then return ct>0 and Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return ct>0 and Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
......
...@@ -32,7 +32,7 @@ function c70456282.spop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -32,7 +32,7 @@ function c70456282.spop(e,tp,eg,ep,ev,re,r,rp,c)
e1:SetCode(EFFECT_ADD_TYPE) e1:SetCode(EFFECT_ADD_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_TUNER) e1:SetValue(TYPE_TUNER)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0xfe0000)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c70456282.filter(c) function c70456282.filter(c)
......
...@@ -20,3 +20,39 @@ end ...@@ -20,3 +20,39 @@ end
function c99267150.batfilter(e,c) function c99267150.batfilter(e,c)
return c:IsAttribute(0x2f) return c:IsAttribute(0x2f)
end end
function c99267150.check_fusion_material_48144509(m,chkf)
local g1=m:Filter(Card.IsRace,nil,RACE_DRAGON)
if chkf~=PLAYER_NONE and not g1:IsExists(Card.IsOnField,1,nil) then return false end
local ct1=g1:GetCount()
local ct2=g1:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)
return (ct1-ct2)+math.min(ct2,2)>=5
end
function c99267150.select_fusion_material_48144509(tp,m,chkf)
local cc=5
local mg1=m:Filter(Card.IsRace,nil,RACE_DRAGON)
local mg2=mg1:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
local sg=Group.CreateGroup()
if mg2:GetCount()>2 then
mg1:Sub(mg2)
if mg1:GetCount()<5 or Duel.SelectYesNo(tp,aux.Stringid(48144509,0)) then
local minc=1
if mg1:GetCount()<4 then minc=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g=mg2:Select(tp,minc,2,nil)
sg:Merge(g)
cc=cc-g:GetCount()
end
end
if chkf~=PLAYER_NONE and mg1:GetCount()>cc then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g=mg1:FilterSelect(tp,aux.FConditionCheckF,1,1,nil,chkf)
mg1:Sub(g)
sg:Merge(g)
cc=cc-1
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g=mg1:Select(tp,cc,cc,nil)
sg:Merge(g)
Duel.SetFusionMaterial(sg)
return sg
end
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