Commit 1636a89c authored by nekrozar's avatar nekrozar

fix Megalith

parent c6ecec9f
......@@ -24,11 +24,11 @@ function c25726386.initial_effect(c)
e2:SetOperation(c25726386.disop)
c:RegisterEffect(e2)
end
function c25726386.filter(c,e,tp)
return c:IsSetCard(0x138) and c~=e:GetHandler()
function c25726386.filter(c,e,tp,chk)
return c:IsSetCard(0x138) and (not chk or c~=e:GetHandler())
end
function c25726386.matfilter(c,e,tp)
return c~=e:GetHandler()
function c25726386.matfilter(c,e,tp,chk)
return not chk or c~=e:GetHandler()
end
function c25726386.rscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
......
......@@ -21,11 +21,11 @@ function c63233638.initial_effect(c)
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
end
function c63233638.filter(c,e,tp)
return c:IsSetCard(0x138) and c~=e:GetHandler()
function c63233638.filter(c,e,tp,chk)
return c:IsSetCard(0x138) and (not chk or c~=e:GetHandler())
end
function c63233638.matfilter(c,e,tp)
return c~=e:GetHandler()
function c63233638.matfilter(c,e,tp,chk)
return not chk or c~=e:GetHandler()
end
function c63233638.rscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
......
......@@ -22,11 +22,11 @@ function c99628747.initial_effect(c)
e2:SetOperation(c99628747.desop)
c:RegisterEffect(e2)
end
function c99628747.filter(c,e,tp)
return c:IsSetCard(0x138) and c~=e:GetHandler()
function c99628747.filter(c,e,tp,chk)
return c:IsSetCard(0x138) and (not chk or c~=e:GetHandler())
end
function c99628747.matfilter(c,e,tp)
return c~=e:GetHandler()
function c99628747.matfilter(c,e,tp,chk)
return not chk or c~=e:GetHandler()
end
function c99628747.rscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
......
......@@ -1551,8 +1551,8 @@ function Auxiliary.RitualCheckAdditional(c,lv,greater_or_equal)
end
end
end
function Auxiliary.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_equal,gc)
if bit.band(c:GetType(),0x81)~=0x81 or (filter and not filter(c,e,tp)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
function Auxiliary.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_equal,gc,chk)
if bit.band(c:GetType(),0x81)~=0x81 or (filter and not filter(c,e,tp,chk)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
if m2 then
mg:Merge(m2)
......@@ -1579,12 +1579,12 @@ function Auxiliary.RitualUltimateTarget(filter,level_function,greater_or_equal,s
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
if mat_filter then mg=mg:Filter(mat_filter,nil,e,tp) end
if mat_filter then mg=mg:Filter(mat_filter,nil,e,tp,true) end
local exg=nil
if grave_filter then
exg=Duel.GetMatchingGroup(Auxiliary.RitualExtraFilter,tp,LOCATION_GRAVE,0,nil,grave_filter)
end
return Duel.IsExistingMatchingCard(Auxiliary.RitualUltimateFilter,tp,summon_location,0,1,nil,filter,e,tp,mg,exg,level_function,greater_or_equal)
return Duel.IsExistingMatchingCard(Auxiliary.RitualUltimateFilter,tp,summon_location,0,1,nil,filter,e,tp,mg,exg,level_function,greater_or_equal,nil,true)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,summon_location)
if grave_filter then
......
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