Commit cf85df7e authored by salix5's avatar salix5 Committed by GitHub

workaround fix 流星輝巧群 (#1842)

assumption: the max atk of ritual monster < 65535
parent 5bcebc18
...@@ -50,14 +50,14 @@ end ...@@ -50,14 +50,14 @@ end
function c22398665.target(e,tp,eg,ep,ev,re,r,rp,chk) function c22398665.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterialEx(tp):Filter(Card.IsRace,nil,RACE_MACHINE) local mg=Duel.GetRitualMaterialEx(tp):Filter(Card.IsRace,nil,RACE_MACHINE)
return Duel.IsExistingMatchingCard(c22398665.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,nil,e,tp,mg,nil,Card.GetAttack,"Greater") return Duel.IsExistingMatchingCard(c22398665.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,nil,e,tp,mg,nil,aux.GetCappedAttack,"Greater")
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end end
function c22398665.operation(e,tp,eg,ep,ev,re,r,rp) function c22398665.operation(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterialEx(tp):Filter(Card.IsRace,nil,RACE_MACHINE) local mg=Duel.GetRitualMaterialEx(tp):Filter(Card.IsRace,nil,RACE_MACHINE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c22398665.RitualUltimateFilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,nil,e,tp,mg,nil,Card.GetAttack,"Greater") local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c22398665.RitualUltimateFilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,nil,e,tp,mg,nil,aux.GetCappedAttack,"Greater")
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
...@@ -84,11 +84,11 @@ end ...@@ -84,11 +84,11 @@ end
function c22398665.RitualCheckGreater(g,c,atk) function c22398665.RitualCheckGreater(g,c,atk)
if atk==0 then return false end if atk==0 then return false end
Duel.SetSelectedCard(g) Duel.SetSelectedCard(g)
return g:CheckWithSumGreater(Card.GetAttack,atk) return g:CheckWithSumGreater(aux.GetCappedAttack,atk)
end end
function c22398665.RitualCheckEqual(g,c,atk) function c22398665.RitualCheckEqual(g,c,atk)
if atk==0 then return false end if atk==0 then return false end
return g:CheckWithSumEqual(Card.GetAttack,atk,#g,#g) return g:CheckWithSumEqual(aux.GetCappedAttack,atk,#g,#g)
end end
function c22398665.RitualCheck(g,tp,c,atk,greater_or_equal) function c22398665.RitualCheck(g,tp,c,atk,greater_or_equal)
return c22398665["RitualCheck"..greater_or_equal](g,c,atk) and Duel.GetMZoneCount(tp,g,tp)>0 and (not c.mat_group_check or c.mat_group_check(g,tp)) return c22398665["RitualCheck"..greater_or_equal](g,c,atk) and Duel.GetMZoneCount(tp,g,tp)>0 and (not c.mat_group_check or c.mat_group_check(g,tp))
...@@ -97,13 +97,13 @@ end ...@@ -97,13 +97,13 @@ end
function c22398665.RitualCheckAdditional(c,atk,greater_or_equal) function c22398665.RitualCheckAdditional(c,atk,greater_or_equal)
if greater_or_equal=="Equal" then if greater_or_equal=="Equal" then
return function(g) return function(g)
return (not aux.RGCheckAdditional or aux.RGCheckAdditional(g)) and g:GetSum(Card.GetAttack)<=atk return (not aux.RGCheckAdditional or aux.RGCheckAdditional(g)) and g:GetSum(aux.GetCappedAttack)<=atk
end end
else else
return function(g,ec) return function(g,ec)
if atk==0 then return #g<=1 end if atk==0 then return #g<=1 end
if ec then if ec then
return (not aux.RGCheckAdditional or aux.RGCheckAdditional(g,ec)) and g:GetSum(Card.GetAttack)-Card.GetAttack(ec)<=atk return (not aux.RGCheckAdditional or aux.RGCheckAdditional(g,ec)) and g:GetSum(aux.GetCappedAttack)-aux.GetCappedAttack(ec)<=atk
else else
return not aux.RGCheckAdditional or aux.RGCheckAdditional(g) return not aux.RGCheckAdditional or aux.RGCheckAdditional(g)
end end
......
...@@ -2822,3 +2822,12 @@ function Auxiliary.GetCappedLevel(c) ...@@ -2822,3 +2822,12 @@ function Auxiliary.GetCappedLevel(c)
return lv return lv
end end
end end
--
function Auxiliary.GetCappedAttack(c)
local x=c:GetAttack()
if x>MAX_PARAMETER then
return MAX_PARAMETER
else
return x
end
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