Commit 19518648 authored by Momobako's avatar Momobako

Push by Appveyor

parent b5befd12
...@@ -13,21 +13,11 @@ function cm.initial_effect(c) ...@@ -13,21 +13,11 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
cm.fit_monster={37564225} cm.fit_monster={37564225}
function cm.filter(c,e,tp,m1,m2,ft) function cm.filter(c,e,tp,m1,m2)
if not c:IsCode(37564225) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end if not c:IsCode(37564225) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c) local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
mg:Merge(m2) mg:Merge(m2)
if ft>0 then return Senya.CheckRitualMaterial(c,mg,tp,c:GetLevel(),nil,true)
return mg:CheckWithSumGreater(Card.GetRitualLevel,8,c)
else
return mg:IsExists(cm.mfilterf,1,nil,tp,mg,c)
end
end
function cm.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,8,rc)
else return false end
end end
function cm.mfilter(c) function cm.mfilter(c)
return Senya.check_set_sawawa(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() return Senya.check_set_sawawa(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
...@@ -36,33 +26,20 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -36,33 +26,20 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil)
local ft=Duel.GetMZoneCount(tp) return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1,mg2)
return ft>-1 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1,mg2,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE,0,nil)
local ft=Duel.GetMZoneCount(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1,mg2,ft) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1,mg2)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc) local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
mg:Merge(mg2) mg:Merge(mg2)
local mat=nil local mat=Senya.SelectRitualMaterial(tc,mg,tp,tc:GetLevel(),nil,true)
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,8,tc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,cm.mfilterf,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,8,tc)
mat:Merge(mat2)
end
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -14,12 +14,6 @@ function cm.initial_effect(c) ...@@ -14,12 +14,6 @@ function cm.initial_effect(c)
e1:SetOperation(cm.operation) e1:SetOperation(cm.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function cm.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local l=e:GetLabel() local l=e:GetLabel()
e:SetLabel(0) e:SetLabel(0)
...@@ -30,13 +24,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -30,13 +24,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tempc=Senya.IgnoreActionCheck(Duel.CreateToken,tp,tcode) local tempc=Senya.IgnoreActionCheck(Duel.CreateToken,tp,tcode)
if not tempc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) then return false end if not tempc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) then return false end
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,e:GetHandler(),tempc) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,e:GetHandler(),tempc)
local ft=Duel.GetMZoneCount(tp) return Senya.CheckRitualMaterial(tempc,mg,tp,tempc:GetLevel(),nil,true)
if ft<0 then return false end
if ft>0 then
return mg:CheckWithSumGreater(Card.GetRitualLevel,tempc:GetLevel(),tempc)
else
return mg:IsExists(cm.mfilterf,1,nil,tp,mg,tempc)
end
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
...@@ -47,19 +35,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,19 +35,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tcode=c.dfc_front_side local tcode=c.dfc_front_side
local tempc=Duel.CreateToken(tp,tcode) local tempc=Duel.CreateToken(tp,tcode)
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,c,tempc) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,c,tempc)
local ft=Duel.GetMZoneCount(tp) local mat=Senya.SelectRitualMaterial(tempc,mg,tp,tempc:GetLevel(),nil,true)
local mat=nil
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tempc:GetLevel(),tempc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,cm.mfilterf,1,1,nil,tp,mg,tempc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tempc:GetLevel(),tempc)
mat:Merge(mat2)
end
c:SetMaterial(mat) c:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -28,47 +28,23 @@ end ...@@ -28,47 +28,23 @@ end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local ft=Duel.GetMZoneCount(tp)
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,c,c) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,c,c)
if c.mat_filter then if c.mat_filter then
mg=mg:Filter(c.mat_filter,nil) mg=mg:Filter(c.mat_filter,nil)
end end
if not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) then return end if not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) then return end
if ft>0 then return Senya.CheckRitualMaterial(c,mg,tp,c:GetLevel(),nil,true)
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
else
return mg:IsExists(cm.mfilterf,1,nil,tp,mg,c)
end
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp) function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetMZoneCount(tp) if not e:GetHandler():IsRelateToEffect(e) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
local c=e:GetHandler() local c=e:GetHandler()
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,c,c) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,c,c)
if c.mat_filter then if c.mat_filter then
mg=mg:Filter(c.mat_filter,nil) mg=mg:Filter(c.mat_filter,nil)
end end
local mat=nil local mat=Senya.SelectRitualMaterial(c,mg,tp,c:GetLevel(),nil,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,c:GetLevel(),c)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,cm.mfilterf,1,1,nil,tp,mg,c)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,c:GetLevel(),c)
mat:Merge(mat2)
end
c:SetMaterial(mat) c:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
local chk=mat:IsExists(cm.nhfilter,1,nil) local chk=mat:IsExists(cm.nhfilter,1,nil)
......
...@@ -33,47 +33,23 @@ end ...@@ -33,47 +33,23 @@ end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local ft=Duel.GetMZoneCount(tp)
local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c) local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c)
if c.mat_filter then if c.mat_filter then
mg=mg:Filter(c.mat_filter,nil) mg=mg:Filter(c.mat_filter,nil)
end end
if not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) then return end if not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) then return end
if ft>0 then return Senya.CheckRitualMaterial(c,mg,tp,c:GetLevel(),nil,true)
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
else
return mg:IsExists(cm.mfilterf,1,nil,tp,mg,c)
end
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp) function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetMZoneCount(tp) if not e:GetHandler():IsRelateToEffect(e) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
local c=e:GetHandler() local c=e:GetHandler()
local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c) local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c)
if c.mat_filter then if c.mat_filter then
mg=mg:Filter(c.mat_filter,nil) mg=mg:Filter(c.mat_filter,nil)
end end
local mat=nil local mat=Senya.SelectRitualMaterial(c,mg,tp,c:GetLevel(),nil,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,c:GetLevel(),c)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,cm.mfilterf,1,1,nil,tp,mg,c)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,c:GetLevel(),c)
mat:Merge(mat2)
end
c:SetMaterial(mat) c:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -2515,17 +2515,50 @@ function cm.DFCBackSideCommonEffect(c) ...@@ -2515,17 +2515,50 @@ function cm.DFCBackSideCommonEffect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
--for ritual update --for ritual update
function cm.CheckRitualMaterialGoal(g,c,tp,lv,f) function cm.CheckRitualMaterialGoal(g,c,tp,lv,f,gt)
local ct=g:GetCount() local ct=g:GetCount()
return cm.CheckSummonLocation(c,tp,g) and g:CheckWithSumEqual(f,lv,ct,ct,c) return cm.CheckSummonLocation(c,tp,g) and (g:CheckWithSumEqual(f,lv,ct,ct,c) or (gt and cm.CheckGreaterExact(g,f,lv,c)))
end end
function cm.CheckRitualMaterial(c,g,tp,lv,f) function cm.DivideValueMax(f,...)
local ext_params={...}
return function(c)
local v=f(c,table.unpack(ext_params))
local v1=bit.band(v,0xffff)
local v2=bit.rshift(v,16)
return math.max(v1,v2)
end
end
function cm.DivideValueMin(f,...)
local ext_params={...}
return function(c)
local v=f(c,table.unpack(ext_params))
local v1=bit.band(v,0xffff)
local v2=bit.rshift(v,16)
if v1<=0 then
return v2
elseif v2<=0 then
return v1
else
return math.min(v1,v2)
end
end
end
function cm.CheckGreaterExactCounterCheck(c,g,f,lv,...)
g:RemoveCard(c)
local res=g:GetSum(cm.DivideValueMin(f,...))>=lv
g:AddCard(c)
return res
end
function cm.CheckGreaterExact(g,f,lv,...)
return g:GetSum(cm.DivideValueMax(f,...))>=lv and not g:IsExists(cm.CheckGreaterExactCounterCheck,1,nil,g,f,lv,...)
end
function cm.CheckRitualMaterial(c,g,tp,lv,f,gt)
local f=f or Card.GetRitualLevel local f=f or Card.GetRitualLevel
return cm.CheckGroup(g,cm.CheckRitualMaterialGoal,nil,1,99,c,tp,lv,f) return cm.CheckGroup(g,cm.CheckRitualMaterialGoal,nil,1,99,c,tp,lv,f,gt)
end end
function cm.SelectRitualMaterial(c,g,tp,lv,f) function cm.SelectRitualMaterial(c,g,tp,lv,f,gt)
local f=f or Card.GetRitualLevel local f=f or Card.GetRitualLevel
return cm.SelectGroup(tp,HINTMSG_RELEASE,g,cm.CheckRitualMaterialGoal,nil,1,99,c,tp,lv,f) return cm.SelectGroup(tp,HINTMSG_RELEASE,g,cm.CheckRitualMaterialGoal,nil,1,99,c,tp,lv,f,gt)
end end
--for anifriends sound effects --for anifriends sound effects
function cm.AddSummonSE(c,desc) function cm.AddSummonSE(c,desc)
......
...@@ -43,47 +43,23 @@ end ...@@ -43,47 +43,23 @@ end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local ft=Duel.GetMZoneCount(tp)
local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c) local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c)
if c.mat_filter then if c.mat_filter then
mg=mg:Filter(c.mat_filter,nil) mg=mg:Filter(c.mat_filter,nil)
end end
if not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) then return end if not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) then return end
if ft>0 then return Senya.CheckRitualMaterial(c,mg,tp,c:GetLevel(),nil,true)
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
else
return mg:IsExists(cm.mfilterf,1,nil,tp,mg,c)
end
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function cm.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp) function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetMZoneCount(tp) if not e:GetHandler():IsRelateToEffect(e) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
local c=e:GetHandler() local c=e:GetHandler()
local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c) local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c)
if c.mat_filter then if c.mat_filter then
mg=mg:Filter(c.mat_filter,nil) mg=mg:Filter(c.mat_filter,nil)
end end
local mat=nil local mat=Senya.SelectRitualMaterial(c,mg,tp,c:GetLevel(),nil,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,c:GetLevel(),c)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,cm.mfilterf,1,1,nil,tp,mg,c)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,c:GetLevel(),c)
mat:Merge(mat2)
end
c:SetMaterial(mat) c:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
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