Commit a3860aae authored by mercury233's avatar mercury233 Committed by GitHub

update fusion spell check (#1287)

parent 6142fe0e
......@@ -48,6 +48,9 @@ function c21140872.initial_effect(c)
c:RegisterEffect(e3)
end
c21140872.material_setcode=0x3b
function c21140872.red_eyes_fusion_check(tp,sg,fc)
return aux.gffcheck(sg,Card.IsFusionCode,74677422,Card.IsRace,RACE_WARRIOR)
end
function c21140872.eqcon(e)
return Duel.GetAttacker():IsSetCard(0x3b)
end
......
......@@ -26,6 +26,9 @@ function c25793414.initial_effect(c)
c:RegisterEffect(e2)
end
c25793414.material_type=TYPE_SYNCHRO
function c25793414.synchro_fusion_check(tp,sg,fc)
return aux.gffcheck(sg,Card.IsFusionCode,14577226,Card.IsFusionSetCard,0xf0)
end
function c25793414.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsType(TYPE_MONSTER) end
if chk==0 then return Duel.IsExistingTarget(Card.IsType,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,TYPE_MONSTER) end
......
......@@ -27,8 +27,12 @@ function c36484016.filter1(c,e)
return c:IsOnField() and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
function c36484016.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and aux.IsMaterialListType(c,TYPE_SYNCHRO) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
if not (c:IsType(TYPE_FUSION) and aux.IsMaterialListType(c,TYPE_SYNCHRO) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
aux.FCheckAdditional=c.synchro_fusion_check or c36484016.fcheck
local res=c:CheckFusionMaterial(m,nil,chkf)
aux.FCheckAdditional=nil
return res
end
function c36484016.filter4(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
......@@ -42,7 +46,6 @@ function c36484016.target(e,tp,eg,ep,ev,re,r,rp,chk)
local mg1=Duel.GetFusionMaterial(tp):Filter(c36484016.filter0,nil)
local mg2=Duel.GetMatchingGroup(c36484016.filter4,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
aux.FCheckAdditional=c36484016.fcheck
local res=Duel.IsExistingMatchingCard(c36484016.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -53,7 +56,6 @@ function c36484016.target(e,tp,eg,ep,ev,re,r,rp,chk)
res=Duel.IsExistingMatchingCard(c36484016.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
aux.FCheckAdditional=nil
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
......@@ -64,7 +66,6 @@ function c36484016.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetFusionMaterial(tp):Filter(c36484016.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(c36484016.filter4,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
aux.FCheckAdditional=c36484016.fcheck
local sg1=Duel.GetMatchingGroup(c36484016.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
......@@ -81,6 +82,7 @@ function c36484016.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
aux.FCheckAdditional=tc.synchro_fusion_check or c36484016.fcheck
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)
tc:SetMaterial(mat1)
......
......@@ -29,8 +29,12 @@ function c41940225.filter1(c,e)
return c:IsFaceup() and c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
end
function c41940225.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and aux.IsMaterialListCode(c,78193831) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
if not (c:IsType(TYPE_FUSION) and aux.IsMaterialListCode(c,78193831) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
aux.FCheckAdditional=c.destruction_swordsman_fusion_check or c41940225.fcheck
local res=c:CheckFusionMaterial(m,nil,chkf)
aux.FCheckAdditional=nil
return res
end
function c41940225.filter3(c,e)
return not c:IsImmuneToEffect(e)
......@@ -44,7 +48,6 @@ function c41940225.target(e,tp,eg,ep,ev,re,r,rp,chk)
local mg1=Duel.GetFusionMaterial(tp)
local mg2=Duel.GetMatchingGroup(c41940225.filter0,tp,0,LOCATION_MZONE,nil)
mg1:Merge(mg2)
aux.FCheckAdditional=c41940225.fcheck
local res=Duel.IsExistingMatchingCard(c41940225.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -55,7 +58,6 @@ function c41940225.target(e,tp,eg,ep,ev,re,r,rp,chk)
res=Duel.IsExistingMatchingCard(c41940225.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
aux.FCheckAdditional=nil
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
......@@ -65,7 +67,6 @@ function c41940225.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetFusionMaterial(tp):Filter(c41940225.filter3,nil,e)
local mg2=Duel.GetMatchingGroup(c41940225.filter1,tp,0,LOCATION_MZONE,nil,e)
mg1:Merge(mg2)
aux.FCheckAdditional=c41940225.fcheck
local sg1=Duel.GetMatchingGroup(c41940225.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
......@@ -82,6 +83,7 @@ function c41940225.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
aux.FCheckAdditional=tc.destruction_swordsman_fusion_check or c41940225.fcheck
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)
tc:SetMaterial(mat1)
......
......@@ -17,8 +17,12 @@ function c55704856.filter1(c,e)
return (c:IsLocation(LOCATION_MZONE) or c:IsFaceup()) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function c55704856.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and aux.IsMaterialListSetCard(c,0x1093) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
if not (c:IsType(TYPE_FUSION) and aux.IsMaterialListSetCard(c,0x1093) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
aux.FCheckAdditional=c.cyber_fusion_check or c55704856.fcheck
local res=c:CheckFusionMaterial(m,nil,chkf)
aux.FCheckAdditional=nil
return res
end
function c55704856.filter3(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck()
......@@ -30,7 +34,6 @@ function c55704856.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(c55704856.filter0,tp,LOCATION_MZONE+LOCATION_REMOVED,0,nil)
aux.FCheckAdditional=c55704856.fcheck
local res=Duel.IsExistingMatchingCard(c55704856.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -41,7 +44,6 @@ function c55704856.target(e,tp,eg,ep,ev,re,r,rp,chk)
res=Duel.IsExistingMatchingCard(c55704856.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
aux.FCheckAdditional=nil
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
......@@ -49,7 +51,6 @@ end
function c55704856.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg=Duel.GetMatchingGroup(c55704856.filter1,tp,LOCATION_MZONE+LOCATION_REMOVED,0,nil,e)
aux.FCheckAdditional=c55704856.fcheck
local sg1=Duel.GetMatchingGroup(c55704856.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg3=nil
local sg2=nil
......@@ -66,6 +67,7 @@ function c55704856.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
aux.FCheckAdditional=tc.cyber_fusion_check or c55704856.fcheck
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat=Duel.SelectFusionMaterial(tp,tc,mg,nil,chkf)
tc:SetMaterial(mat)
......
......@@ -36,8 +36,12 @@ function c6172122.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c6172122.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and aux.IsMaterialListSetCard(c,0x3b) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
if not (c:IsType(TYPE_FUSION) and aux.IsMaterialListSetCard(c,0x3b) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
aux.FCheckAdditional=c.red_eyes_fusion_check or c6172122.fcheck
local res=c:CheckFusionMaterial(m,nil,chkf)
aux.FCheckAdditional=nil
return res
end
function c6172122.fcheck(tp,sg,fc)
return sg:IsExists(Card.IsFusionSetCard,1,nil,0x3b)
......@@ -48,7 +52,6 @@ function c6172122.target(e,tp,eg,ep,ev,re,r,rp,chk)
local mg1=Duel.GetFusionMaterial(tp)
local mg2=Duel.GetMatchingGroup(c6172122.filter0,tp,LOCATION_DECK,0,nil)
mg1:Merge(mg2)
aux.FCheckAdditional=c6172122.fcheck
local res=Duel.IsExistingMatchingCard(c6172122.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -59,7 +62,6 @@ function c6172122.target(e,tp,eg,ep,ev,re,r,rp,chk)
res=Duel.IsExistingMatchingCard(c6172122.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
aux.FCheckAdditional=nil
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
......@@ -69,7 +71,6 @@ function c6172122.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetFusionMaterial(tp):Filter(c6172122.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(c6172122.filter0,tp,LOCATION_DECK,0,nil)
mg1:Merge(mg2)
aux.FCheckAdditional=c6172122.fcheck
local sg1=Duel.GetMatchingGroup(c6172122.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
......@@ -86,6 +87,7 @@ function c6172122.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
aux.FCheckAdditional=tc.red_eyes_fusion_check or c6172122.fcheck
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)
tc:SetMaterial(mat1)
......
......@@ -23,6 +23,9 @@ function c64599569.initial_effect(c)
c:RegisterEffect(e4)
end
c64599569.material_setcode=0x1093
function c64599569.cyber_fusion_check(tp,sg,fc)
return sg:IsExists(Card.IsFusionCode,1,nil,70095154)
end
function c64599569.sucop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
......
......@@ -50,6 +50,9 @@ function c86240887.initial_effect(c)
e7:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e7)
end
function c86240887.destruction_swordsman_fusion_check(tp,sg,fc)
return aux.gffcheck(sg,Card.IsFusionCode,78193831,Card.IsRace,RACE_DRAGON)
end
function c86240887.val(e,c)
return Duel.GetMatchingGroupCount(c86240887.filter,c:GetControler(),0,LOCATION_GRAVE+LOCATION_MZONE,nil)*1000
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