Commit 00565783 authored by 未闻皂名's avatar 未闻皂名

2024/2/26 新增:磁力苏生,CostCheck改用内核的方法

parent dc40f968
No preview for this file type
-- Rush Duel 辅助函数 -- Rush Duel 辅助函数
RushDuel = RushDuel or {} RushDuel = RushDuel or {}
-- 设置Cost标签, 无视Cost发动效果需做额外判断时使用
function RushDuel.SetCostLabel(e)
e:SetLabel(1)
end
-- 重置Cost标签, 无视Cost发动效果需做额外判断时使用
function RushDuel.ResetCostLabel(e)
e:SetLabel(0)
end
-- 是否设置了Cost标签
function RushDuel.IsCostLabel(e)
return e:GetLabel() == 1
end
-- 为效果设置标签 -- 为效果设置标签
function RushDuel.SetLabelAndObject(effect, target, set_label, set_object) function RushDuel.SetLabelAndObject(effect, target, set_label, set_object)
if effect ~= nil and target ~= nil then if effect ~= nil and target ~= nil then
......
...@@ -13,27 +13,19 @@ function cm.initial_effect(c) ...@@ -13,27 +13,19 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.costfilter(c,tp) function cm.costfilter(c,e,tp)
return c:IsFaceup() and c:IsRace(RACE_DINOSAUR) return c:IsFaceup() and c:IsRace(RACE_DINOSAUR)
and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevelAbove(5) and c:IsRace(RACE_DINOSAUR) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP) return c:IsLevelAbove(5) and c:IsRace(RACE_DINOSAUR) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,false,nil,nil,function(g)
RD.SetCostLabel(e) return g:GetFirst():GetLevel()
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil,tp) end end)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
e:SetLabel(g:GetFirst():GetLevel())
Duel.SendtoGrave(g,REASON_COST)
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)
if chk==0 then if chk==0 then return (e:IsCostChecked() or Duel.GetMZoneCount(tp)>0)
local res=RD.IsCostLabel(e) or Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
RD.ResetCostLabel(e)
return res and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
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)
......
...@@ -22,28 +22,17 @@ end ...@@ -22,28 +22,17 @@ end
function cm.exfilter(c) function cm.exfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) return c:IsAttribute(ATTRIBUTE_DARK)
end end
function cm.costcheck(g,tp) function cm.costcheck(g,e,tp)
return Duel.GetMZoneCount(tp,g)>0 return Duel.GetMZoneCount(tp,g)>0
end end
function cm.excheck(g) function cm.excheck(g)
return g:GetClassCount(Card.GetCode,nil)==1 return g:GetClassCount(Card.GetCode,nil)==1
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendMZoneSubToGrave(cm.costfilter,cm.costcheck,3,3,false)
RD.SetCostLabel(e)
local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return g:CheckSubGroup(cm.costcheck,3,3,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,cm.costcheck,false,3,3,tp)
Duel.SendtoGrave(sg,REASON_COST)
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)
if chk==0 then if chk==0 then return (e:IsCostChecked() or Duel.GetMZoneCount(tp)>0)
local res=e:GetLabel()==1 or Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
RD.ResetCostLabel(e)
return res and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
RD.ResetCostLabel(e)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)~=0 then if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)~=0 then
......
...@@ -13,7 +13,7 @@ function cm.initial_effect(c) ...@@ -13,7 +13,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.costfilter(c,tp) function cm.costfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_MACHINE) return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_MACHINE)
and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end end
...@@ -21,21 +21,11 @@ function cm.spfilter(c,e,tp) ...@@ -21,21 +21,11 @@ function cm.spfilter(c,e,tp)
return c:IsType(TYPE_EFFECT) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_MACHINE) return c:IsType(TYPE_EFFECT) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_MACHINE)
and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,false)
RD.SetCostLabel(e)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
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)
if chk==0 then if chk==0 then return (e:IsCostChecked() or Duel.GetMZoneCount(tp)>0)
local res=e:GetLabel()==1 or Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
RD.ResetCostLabel(e)
return res and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
RD.ResetCostLabel(e)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)~=0 then if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)~=0 then
......
...@@ -21,28 +21,16 @@ end ...@@ -21,28 +21,16 @@ end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsLevel(7) and c:IsRace(RACE_PSYCHO) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP) return c:IsLevel(7) and c:IsRace(RACE_PSYCHO) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,false,nil,nil,function(g)
RD.SetCostLabel(e) return g:GetFirst():GetPreviousCodeOnField()
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil,tp) end end)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
local tc=g:GetFirst()
if Duel.SendtoGrave(tc,REASON_COST)~=0 and tc:GetPreviousCodeOnField()==list[1] then
e:SetLabel(20170039)
else
RD.ResetCostLabel(e)
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)
if chk==0 then if chk==0 then return (e:IsCostChecked() or Duel.GetMZoneCount(tp)>0)
local res=RD.IsCostLabel(e) or Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
RD.ResetCostLabel(e)
return res and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp)
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)
if RD.SelectAndSpecialSummon(cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP)~=0 and e:GetLabel()==20170039 then if RD.SelectAndSpecialSummon(cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP)~=0 and e:GetLabel()==list[1] then
local tc=Duel.GetOperatedGroup():GetFirst() local tc=Duel.GetOperatedGroup():GetFirst()
RD.AttachAtkDef(e,tc,1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) RD.AttachAtkDef(e,tc,1500,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end end
......
...@@ -13,30 +13,23 @@ function cm.initial_effect(c) ...@@ -13,30 +13,23 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.costfilter(c,tp) function cm.costfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0 return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsRace(RACE_PSYCHO) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP) return c:IsRace(RACE_PSYCHO) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,false,nil,nil,function(g)
RD.SetCostLabel(e)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if Duel.SendtoGrave(tc,REASON_COST)~=0 and tc:GetPreviousLevelOnField()>0 and tc:GetPreviousLevelOnField()<=2 then if tc:GetPreviousLevelOnField()>0 and tc:GetPreviousLevelOnField()<=2 then
e:SetLabel(20184003) return 20184003
else else
RD.ResetCostLabel(e) return 0
end end
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)
if chk==0 then if chk==0 then return (e:IsCostChecked() or Duel.GetMZoneCount(tp)>0)
local res=RD.IsCostLabel(e) or Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
RD.ResetCostLabel(e)
return res and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
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)
......
...@@ -19,25 +19,14 @@ end ...@@ -19,25 +19,14 @@ end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsRace(RACE_PLANT) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP) return c:IsRace(RACE_PLANT) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.costcheck(g,tp) function cm.costcheck(g,e,tp)
return Duel.GetMZoneCount(tp,g)>0 return Duel.GetMZoneCount(tp,g)>0
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendMZoneSubToGrave(cm.costfilter,cm.costcheck,2,2,false)
RD.SetCostLabel(e)
local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return g:CheckSubGroup(cm.costcheck,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,cm.costcheck,false,2,2,tp)
Duel.SendtoGrave(sg,REASON_COST)
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)
if chk==0 then if chk==0 then return (e:IsCostChecked() or Duel.GetMZoneCount(tp)>0)
local res=RD.IsCostLabel(e) or Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
RD.ResetCostLabel(e)
return res and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
RD.ResetCostLabel(e)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP) RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)
......
...@@ -13,7 +13,7 @@ function cm.initial_effect(c) ...@@ -13,7 +13,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.costfilter(c,tp) function cm.costfilter(c,e,tp)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_FIRE) return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_FIRE)
and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end end
...@@ -23,20 +23,12 @@ end ...@@ -23,20 +23,12 @@ end
function cm.desfilter(c) function cm.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,false,nil,nil,function(g)
RD.SetCostLabel(e) return g:GetFirst():GetPreviousLevelOnField()
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil,tp) end end)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
e:SetLabel(g:GetFirst():GetLevel())
Duel.SendtoGrave(g,REASON_COST)
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)
if chk==0 then if chk==0 then return (e:IsCostChecked() or Duel.GetMZoneCount(tp)>0)
local res=e:GetLabel()==1 or Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
RD.ResetCostLabel(e)
return res and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp)
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)
......
...@@ -13,27 +13,17 @@ function cm.initial_effect(c) ...@@ -13,27 +13,17 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.costfilter(c,tp) function cm.costfilter(c,e,tp)
return c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0 return c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsLevel(7) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP) return c:IsLevel(7) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,false)
RD.SetCostLabel(e)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
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)
if chk==0 then if chk==0 then return (e:IsCostChecked() or Duel.GetMZoneCount(tp)>0)
local res=e:GetLabel()==1 or Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
RD.ResetCostLabel(e)
return res and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
RD.ResetCostLabel(e)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if RD.SelectAndSpecialSummon(cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP)~=0 then if RD.SelectAndSpecialSummon(cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP)~=0 then
......
...@@ -13,31 +13,23 @@ function cm.initial_effect(c) ...@@ -13,31 +13,23 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--Activate --Activate
function cm.costfilter(c,tp) function cm.costfilter(c,e,tp)
return c:IsFaceup() and c:IsAttackAbove(1600) and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0 return c:IsFaceup() and c:IsAttackAbove(1600) and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsType(TYPE_EFFECT) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP) return c:IsType(TYPE_EFFECT) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,false,function(g)
RD.SetCostLabel(e)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc:GetOriginalLevel()>=7 and tc:IsType(TYPE_EFFECT) then if tc:GetOriginalLevel()>=7 and tc:IsType(TYPE_EFFECT) then
e:SetLabel(20217094) return 20217094
else else
RD.ResetCostLabel(e) return 0
end end
Duel.SendtoGrave(g,REASON_COST) 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)
if chk==0 then if chk==0 then return (e:IsCostChecked() or Duel.GetMZoneCount(tp)>0)
local res=RD.IsCostLabel(e) or Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
RD.ResetCostLabel(e)
return res and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
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)
......
...@@ -17,25 +17,14 @@ cm.indval=RD.ValueEffectIndesType(0,TYPE_TRAP) ...@@ -17,25 +17,14 @@ cm.indval=RD.ValueEffectIndesType(0,TYPE_TRAP)
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsLevel(8) and RD.IsDefense(c,500) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP) return c:IsLevel(8) and RD.IsDefense(c,500) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.costcheck(g,tp) function cm.costcheck(g,e,tp)
return Duel.GetMZoneCount(tp,g)>0 return Duel.GetMZoneCount(tp,g)>0
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendMZoneSubToGrave(Card.IsAbleToGraveAsCost,cm.costcheck,2,2,false)
RD.SetCostLabel(e)
local g=Duel.GetMatchingGroup(Card.IsAbleToGraveAsCost,tp,LOCATION_MZONE,0,nil)
if chk==0 then return g:CheckSubGroup(cm.costcheck,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,cm.costcheck,false,2,2,tp)
Duel.SendtoGrave(sg,REASON_COST)
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)
if chk==0 then if chk==0 then return (e:IsCostChecked() or Duel.GetMZoneCount(tp)>0)
local res=e:GetLabel()==1 or Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
RD.ResetCostLabel(e)
return res and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
RD.ResetCostLabel(e)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if RD.SelectAndSpecialSummon(cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP)~=0 then if RD.SelectAndSpecialSummon(cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP)~=0 then
......
...@@ -21,7 +21,7 @@ end ...@@ -21,7 +21,7 @@ end
function cm.confilter(c,tp) function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup() and c:IsLevelBelow(8) return c:GetSummonPlayer()==tp and c:IsFaceup() and c:IsLevelBelow(8)
end end
function cm.costfilter(c,tp) function cm.costfilter(c,e,tp)
return c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0 return c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
...@@ -30,22 +30,12 @@ end ...@@ -30,22 +30,12 @@ end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp) return eg:IsExists(cm.confilter,1,nil,1-tp)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,false)
RD.SetCostLabel(e)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
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)
if chk==0 then if chk==0 then return (e:IsCostChecked() or Duel.GetMZoneCount(tp)>0)
local res=e:GetLabel()==1 or Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
RD.ResetCostLabel(e)
return res and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
end
Duel.SetTargetCard(eg) Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
RD.ResetCostLabel(e)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if RD.SelectAndSpecialSummon(cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP_ATTACK)~=0 then if RD.SelectAndSpecialSummon(cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,POS_FACEUP_ATTACK)~=0 then
......
local m=120260036
local cm=_G["c"..m]
cm.name="磁力苏生"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.costfilter(c,e,tp)
return c:IsFaceup() and c:IsLevelBelow(4) and c:IsRace(RACE_ROCK)
and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function cm.spfilter(c,e,tp)
return c:IsLevel(7,8) and c:IsRace(RACE_ROCK) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
cm.cost=RD.CostSendMZoneToGrave(cm.costfilter,1,1,false)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (e:IsCostChecked() or Duel.GetMZoneCount(tp)>0)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)
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