Commit 6277b503 authored by wind2009's avatar wind2009

Fix Duel.GetFusionMaterial

parent d7e52a1a
...@@ -26,7 +26,7 @@ function s.filter2(c,e,tp,m,f,chkf) ...@@ -26,7 +26,7 @@ function s.filter2(c,e,tp,m,f,chkf)
end end
function s.fcon(e,tp) function s.fcon(e,tp)
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp) local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) local res=Duel.IsExistingMatchingCard(s.filter2,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)
......
...@@ -35,7 +35,7 @@ function s.gcheck(sg) ...@@ -35,7 +35,7 @@ function s.gcheck(sg)
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp) local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,1264319) then if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,1264319) then
local sg=Duel.GetMatchingGroup(s.filter0,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil) local sg=Duel.GetMatchingGroup(s.filter0,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil)
mg1:Merge(sg) mg1:Merge(sg)
......
...@@ -105,8 +105,11 @@ end ...@@ -105,8 +105,11 @@ end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp) function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker() local tc=Duel.GetAttacker()
if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end
e:SetLabelObject(tc) if tc and tc:IsControler(tp) and tc:IsSetCard(0xff) then
return tc and tc:IsControler(tp) and tc:IsSetCard(0xff) e:SetLabelObject(tc)
return true
end
return false
end end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() end if chk==0 then return e:GetHandler():IsAbleToRemove() end
......
...@@ -66,7 +66,7 @@ end ...@@ -66,7 +66,7 @@ end
function s.fsptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.fsptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp) local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) local res=Duel.IsExistingMatchingCard(s.filter2,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)
......
...@@ -39,7 +39,7 @@ function s.fstg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -39,7 +39,7 @@ function s.fstg(e,tp,eg,ep,ev,re,r,rp,chk)
local res1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local res1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp) local mg1=Duel.GetFusionMaterial(tp):Filter(aux.NOT(Card.IsImmuneToEffect),nil,e)
local res2=Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) local res2=Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res2 then if not res2 then
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
......
...@@ -74,7 +74,7 @@ function s.fstg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -74,7 +74,7 @@ function s.fstg(e,tp,eg,ep,ev,re,r,rp,chk)
me:SetValue(s.fuslimit) me:SetValue(s.fuslimit)
Duel.RegisterEffect(me,tp) Duel.RegisterEffect(me,tp)
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil) local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil):Filter(s.filter2,nil,e)
local res=Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) local res=Duel.IsExistingMatchingCard(s.filter,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)
......
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