Commit b5b04414 authored by fallenstardust's avatar fallenstardust

fix LEDE-JP072 script

parent c26306d7
--古代の機械競闘 --古代的机械竞斗
function c101204072.initial_effect(c) function c101204072.initial_effect(c)
aux.AddCodeList(c,83104731) aux.AddCodeList(c,83104731)
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
...@@ -44,6 +44,12 @@ end ...@@ -44,6 +44,12 @@ end
function c101204072.filter3(c) function c101204072.filter3(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove() return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end end
function c101204072.ffilter(c,tp)
return c:IsOnField() and c:IsCode(83104731)
end
function c101204072.fcheck(tp,sg,fc)
return sg:FilterCount(c101204072.ffilter,nil,tp)>0
end
function c101204072.condition(e,tp,eg,ep,ev,re,r,rp) function c101204072.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,1,nil) return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,1,nil)
end end
...@@ -53,7 +59,9 @@ function c101204072.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -53,7 +59,9 @@ function c101204072.target(e,tp,eg,ep,ev,re,r,rp,chk)
local mg1=Duel.GetFusionMaterial(tp):Filter(c101204072.filter0,nil) local mg1=Duel.GetFusionMaterial(tp):Filter(c101204072.filter0,nil)
local mg2=Duel.GetMatchingGroup(c101204072.filter3,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(c101204072.filter3,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2) mg1:Merge(mg2)
aux.FGoalCheckAdditional=c101204072.fcheck
local res=Duel.IsExistingMatchingCard(c101204072.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) local res=Duel.IsExistingMatchingCard(c101204072.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
aux.FGoalCheckAdditional=nil
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
...@@ -74,7 +82,9 @@ function c101204072.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -74,7 +82,9 @@ function c101204072.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetFusionMaterial(tp):Filter(c101204072.filter1,nil,e) local mg1=Duel.GetFusionMaterial(tp):Filter(c101204072.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(c101204072.filter3,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(c101204072.filter3,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2) mg1:Merge(mg2)
aux.FGoalCheckAdditional=c101204072.fcheck
local sg1=Duel.GetMatchingGroup(c101204072.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local sg1=Duel.GetMatchingGroup(c101204072.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
aux.FGoalCheckAdditional=nil
local mg3=nil local mg3=nil
local sg2=nil local sg2=nil
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
...@@ -91,7 +101,9 @@ function c101204072.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -91,7 +101,9 @@ function c101204072.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
aux.FGoalCheckAdditional=c101204072.fcheck
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf) local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
aux.FGoalCheckAdditional=nil
tc:SetMaterial(mat1) tc:SetMaterial(mat1)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect() Duel.BreakEffect()
......
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