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

fix Lair of Darkness (#1546)

parent f9665ccd
......@@ -49,6 +49,7 @@ function c12766474.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=rg:SelectSubGroup(tp,aux.mzctcheckrel,false,1,#rg,tp)
e:SetLabel(g:GetCount())
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
end
function c12766474.splimit(e,c,sump,sumtype,sumpos,targetp,se)
......
......@@ -57,6 +57,7 @@ function c15717011.target(e,tp,eg,ep,ev,re,r,rp,chk)
local mat=Duel.SelectFusionMaterial(tp,g:GetFirst(),mg,c,chkf)
Auxiliary.FCheckAdditional=nil
if c59160188 then c59160188.re_activated=false end
aux.UseExtraReleaseCount(mat,tp)
Duel.Release(mat,REASON_COST)
e:SetLabel(g:GetFirst():GetCode())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
......
......@@ -44,6 +44,7 @@ function c17197110.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=rg:SelectSubGroup(tp,c17197110.fselect,false,1,maxc,tp)
e:SetLabel(g:GetCount())
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
end
function c17197110.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -55,6 +55,7 @@ function c20951752.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) end
local g=Duel.GetReleaseGroup(tp)
local ct=g:FilterCount(Card.IsRace,nil,RACE_FAIRY)
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
e:GetLabelObject():SetLabel(ct)
end
......
......@@ -26,6 +26,7 @@ function c26866984.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rg:CheckSubGroup(aux.mzctcheckrel,1,3,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=rg:SelectSubGroup(tp,aux.mzctcheckrel,false,1,3,tp)
aux.UseExtraReleaseCount(g,tp)
e:SetLabel(Duel.Release(g,REASON_COST))
end
function c26866984.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -32,6 +32,7 @@ function c27198001.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rg:CheckSubGroup(aux.mzctcheckrel,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=rg:SelectSubGroup(tp,aux.mzctcheckrel,false,2,2,tp)
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
end
function c27198001.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -77,6 +77,7 @@ function c4059313.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return g:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:Select(tp,1,g:GetCount(),nil)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
local atk=rg:GetSum(Card.GetTextAttack)
e:SetLabel(100,atk)
......
......@@ -28,6 +28,7 @@ function c40998517.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetReleaseGroup(tp):Filter(c40998517.costfilter,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,c40998517.fselect,false,1,rg:GetCount(),tp)
aux.UseExtraReleaseCount(sg,tp)
local ct=Duel.Release(sg,REASON_COST)
e:SetLabel(ct)
end
......
......@@ -46,6 +46,7 @@ function c41329458.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rg:CheckSubGroup(aux.mzctcheckrel,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=rg:SelectSubGroup(tp,aux.mzctcheckrel,false,2,2,tp)
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
end
function c41329458.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -101,6 +101,7 @@ function c44097050.rlcost(e,tp,eg,ep,ev,re,r,rp,chk)
elseif opval[op]==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
rg=g:SelectSubGroup(tp,aux.mzctcheck,false,2,2,tp)
aux.UseExtraReleaseCount(rg,tp)
else
rg=Duel.SelectReleaseGroup(tp,nil,3,3,nil)
end
......
......@@ -20,6 +20,7 @@ function c45898858.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return g:CheckSubGroupEach(c45898858.spchecks,aux.mzctcheckrel,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:SelectSubGroupEach(tp,c45898858.spchecks,false,aux.mzctcheckrel,tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
end
function c45898858.filter(c,e,tp)
......
......@@ -42,6 +42,7 @@ function c46290741.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rg:CheckSubGroup(aux.mzctcheckrel,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=rg:SelectSubGroup(tp,aux.mzctcheckrel,false,2,2,tp)
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
end
function c46290741.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -22,6 +22,7 @@ function c47171541.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rg:CheckSubGroup(aux.mzctcheckrel,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=rg:SelectSubGroup(tp,aux.mzctcheckrel,false,2,2,tp)
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
end
function c47171541.spfilter(c,e,tp)
......
......@@ -29,6 +29,7 @@ function c47826112.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rg:CheckSubGroup(aux.mzctcheckrel,3,3,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=rg:SelectSubGroup(tp,aux.mzctcheckrel,false,3,3,tp)
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
end
function c47826112.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -101,6 +101,7 @@ function c4918855.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rg:CheckSubGroup(aux.mzctcheckrel,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=rg:SelectSubGroup(tp,aux.mzctcheckrel,false,2,2,tp)
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
end
function c4918855.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -57,6 +57,7 @@ function c52101615.target(e,tp,eg,ep,ev,re,r,rp,chk)
local mat=Duel.SelectFusionMaterial(tp,g:GetFirst(),mg,c,chkf)
Auxiliary.FCheckAdditional=nil
if c59160188 then c59160188.re_activated=false end
aux.UseExtraReleaseCount(mat,tp)
Duel.Release(mat,REASON_COST)
e:SetLabel(g:GetFirst():GetCode())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
......
......@@ -21,6 +21,7 @@ function c54813225.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return mg:CheckSubGroup(c54813225.relgoal,1,3,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=mg:SelectSubGroup(tp,c54813225.relgoal,false,1,3,tp)
aux.UseExtraReleaseCount(sg,tp)
Duel.Release(sg,REASON_COST)
end
function c54813225.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -19,6 +19,7 @@ function c54913680.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rg:CheckSubGroup(aux.mzctcheckrel,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,aux.mzctcheckrel,false,2,2,tp)
aux.UseExtraReleaseCount(sg,tp)
Duel.Release(sg,REASON_COST)
end
function c54913680.spfilter(c,e,tp)
......
......@@ -20,6 +20,7 @@ function c61411502.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return g:CheckSubGroupEach(c61411502.rchecks,c61411502.rgoal,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:SelectSubGroupEach(tp,c61411502.rchecks,false,c61411502.rgoal,tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
end
function c61411502.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -87,6 +87,7 @@ function c63180841.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetReleaseGroup(tp):Filter(c63180841.spfilter,nil,tp)
if chk==0 then return g:CheckSubGroup(aux.mzctcheckrel,2,2,tp) end
local rg=g:SelectSubGroup(tp,aux.mzctcheckrel,false,2,2,tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
end
function c63180841.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -42,6 +42,7 @@ function c63972571.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return g:CheckSubGroup(c63972571.fselect,1,g:GetCount(),tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:SelectSubGroup(tp,c63972571.fselect,false,1,g:GetCount(),tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
end
function c63972571.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -19,6 +19,7 @@ function c66607691.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rg:CheckSubGroup(aux.mzctcheckrel,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=rg:SelectSubGroup(tp,aux.mzctcheckrel,false,2,2,tp)
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
end
function c66607691.spfilter(c,e,tp)
......
......@@ -44,6 +44,7 @@ function c720147.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local sg=rg:SelectSubGroup(tp,c720147.fselect,false,1,rg:GetCount(),tp)
sg:KeepAlive()
e:SetLabelObject(sg)
aux.UseExtraReleaseCount(sg,tp)
Duel.Release(sg,REASON_COST)
for rc in aux.Next(sg) do
rc:CreateEffectRelation(e)
......
......@@ -19,6 +19,7 @@ function c72549351.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rg:CheckSubGroup(aux.mzctcheckrel,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=rg:SelectSubGroup(tp,aux.mzctcheckrel,false,2,2,tp)
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
end
function c72549351.spfilter(c,e,tp)
......
......@@ -28,6 +28,7 @@ function c744887.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return g:CheckSubGroup(c744887.fselect,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:SelectSubGroup(tp,c744887.fselect,false,2,2,tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
end
function c744887.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -48,6 +48,7 @@ function c76382116.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
table.insert(code,tc:GetCode())
end
e:SetLabel(table.unpack(code))
aux.UseExtraReleaseCount(sg,tp)
Duel.Release(sg,REASON_COST)
end
function c76382116.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -112,6 +112,7 @@ function c77522571.spcost3(e,tp,eg,ep,ev,re,r,rp,chk)
local g=rg:SelectSubGroup(tp,c77522571.fgoal,false,2,rg:GetCount(),e,tp)
local lv=g:GetSum(Card.GetLevel)
e:SetLabel(lv)
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
end
function c77522571.sptg3(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -31,11 +31,11 @@ function c79402185.fgoal(g,tp)
end
function c79402185.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
local sg=Group.CreateGroup()
local g=Duel.GetReleaseGroup(tp,true):Filter(c79402185.costfilter,nil,tp)
if chk==0 then return g:CheckSubGroupEach(c79402185.spchecks,c79402185.fgoal,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:SelectSubGroupEach(tp,c79402185.spchecks,false,c79402185.fgoal,tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
end
function c79402185.filter(c,e,tp)
......
......@@ -65,6 +65,7 @@ function c88000953.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetReleaseGroup(tp):Filter(c88000953.costfilter,nil,tp,lg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,c88000953.fselect,false,1,rg:GetCount(),tp)
aux.UseExtraReleaseCount(sg,tp)
local ct=Duel.Release(sg,REASON_COST)
e:SetLabel(ct)
end
......
......@@ -57,6 +57,7 @@ function c88696724.target(e,tp,eg,ep,ev,re,r,rp,chk)
local mat=Duel.SelectFusionMaterial(tp,g:GetFirst(),mg,c,chkf)
Auxiliary.FCheckAdditional=nil
if c59160188 then c59160188.re_activated=false end
aux.UseExtraReleaseCount(mat,tp)
Duel.Release(mat,REASON_COST)
e:SetLabel(g:GetFirst():GetCode())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
......
......@@ -31,6 +31,7 @@ function c9341993.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return g:CheckSubGroup(c9341993.fselect,1,g:GetCount(),tp,exc) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:SelectSubGroup(tp,c9341993.fselect,false,1,g:GetCount(),tp,exc)
aux.UseExtraReleaseCount(rg,tp)
e:SetLabel(100,Duel.Release(rg,REASON_COST))
end
function c9341993.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -75,6 +75,7 @@ function c96733134.hspcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rg:CheckSubGroup(aux.mzctcheckrel,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=rg:SelectSubGroup(tp,aux.mzctcheckrel,false,2,2,tp)
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
end
function c96733134.hsptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -2522,3 +2522,14 @@ function Auxiliary.SequenceToGlobal(p,loc,seq)
return 0
end
end
--use the count limit of Lair of Darkness if the tributes are not selected by Duel.SelectReleaseGroup
function Auxiliary.UseExtraReleaseCount(g,tp)
local eg=g:Filter(Auxiliary.ExtraReleaseFilter,nil,tp)
for ec in Auxiliary.Next(eg) do
local te=ec:IsHasEffect(EFFECT_EXTRA_RELEASE_NONSUM,tp)
if te then te:UseCountLimit(tp) end
end
end
function Auxiliary.ExtraReleaseFilter(c,tp)
return c:IsControler(1-tp) and c:IsHasEffect(EFFECT_EXTRA_RELEASE_NONSUM,tp)
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