Commit 49e81bca authored by fallenstardust's avatar fallenstardust

fix LEDE-JP055\072 script

parent b5b04414
...@@ -70,7 +70,7 @@ function c101204055.sumlimit(e,c,sump,sumtype,sumpos,targetp) ...@@ -70,7 +70,7 @@ function c101204055.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumpos,POS_FACEDOWN)>0 return bit.band(sumpos,POS_FACEDOWN)>0
end end
function c101204055.filter(c) function c101204055.filter(c)
return c:IsSetCard(0x7) and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP)) and c:IsAbleToHand() return not c:IsCode(101204055) and c:IsSetCard(0x7) and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP)) and c:IsAbleToHand()
end end
function c101204055.target(e,tp,eg,ep,ev,re,r,rp,chk) function c101204055.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101204055.filter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c101204055.filter,tp,LOCATION_DECK,0,1,nil) end
......
...@@ -44,14 +44,14 @@ end ...@@ -44,14 +44,14 @@ 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) function c101204072.condition(e,tp,eg,ep,ev,re,r,rp)
return c:IsOnField() and c:IsCode(83104731) return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,1,nil)
end end
function c101204072.fcheck(tp,sg,fc) function c101204072.fcheck(tp,sg,fc)
return sg:FilterCount(c101204072.ffilter,nil,tp)>0 return sg:IsExists(c101204072.filter,1,nil)
end end
function c101204072.condition(e,tp,eg,ep,ev,re,r,rp) function c101204072.filter(c)
return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,1,nil) return c:IsLocation(LOCATION_ONFIELD) and c:IsCode(83104731)
end end
function c101204072.target(e,tp,eg,ep,ev,re,r,rp,chk) function c101204072.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
...@@ -59,9 +59,8 @@ function c101204072.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -59,9 +59,8 @@ 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 aux.FCheckAdditional=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
...@@ -71,6 +70,7 @@ function c101204072.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -71,6 +70,7 @@ function c101204072.target(e,tp,eg,ep,ev,re,r,rp,chk)
res=Duel.IsExistingMatchingCard(c101204072.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf) res=Duel.IsExistingMatchingCard(c101204072.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end end
end end
aux.FCheckAdditional=nil
return res return res
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
...@@ -82,9 +82,8 @@ function c101204072.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -82,9 +82,8 @@ 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 aux.FCheckAdditional=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)
...@@ -101,9 +100,7 @@ function c101204072.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -101,9 +100,7 @@ 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()
...@@ -123,4 +120,5 @@ function c101204072.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -123,4 +120,5 @@ function c101204072.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true) tc:RegisterEffect(e1,true)
end end
aux.FCheckAdditional=nil
end end
\ No newline at end of file
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