Commit 0361b252 authored by 未闻皂名's avatar 未闻皂名

2024/4/3 选择效果/Cost更新

parent dca8b4e1
Pipeline #26232 passed with stages
in 8 minutes and 11 seconds
......@@ -79,23 +79,19 @@ function RushDuel.CreateSingleEffect(e, desc, card, code, value, reset, forced)
return e1
end
-- 创建效果: 选择效果
function RushDuel.CreateMultiChooseEffect(card, condition, cost, hint1, target1, operation1, hint2, target2, operation2, category1, category2)
function RushDuel.CreateMultiChooseEffect(card, condition, cost, hint1, target1, operation1, hint2, target2, operation2)
local e1 = Effect.CreateEffect(card)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
local e2 = e1:Clone()
e1:SetDescription(hint1)
e2:SetDescription(hint2)
e1:SetCategory(category1 or 0)
e2:SetCategory(category2 or 0)
if condition ~= nil then
e1:SetCondition(condition)
e2:SetCondition(condition)
end
if cost ~= nil then
e1:SetCost(cost)
e2:SetCost(cost)
end
local e2 = e1:Clone()
e1:SetDescription(hint1)
e2:SetDescription(hint2)
if target1 ~= nil then
e1:SetTarget(target1)
end
......
......@@ -290,7 +290,96 @@ end
function RushDuel.CostSendGraveSubToDeckTopOrBottom(filter, check, min, max, top_desc, bottom_desc, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendGroupToDeckTopOrBottom(filter, check, LOCATION_GRAVE, min, max, false, top_desc, bottom_desc, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 怪兽返回手卡
-- 代价: 怪兽返回手卡
function RushDuel.CostSendMZoneToHand(filter, min, max, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToHand(filter, LOCATION_MZONE, min, max, except_self, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 让自己场上表侧表示的这张卡返回手卡
function RushDuel.CostSendSelfToHand()
return function(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return e:GetHandler():IsAbleToHandAsCost()
end
Duel.SendtoHand(RushDuel.ToMaximunGroup(e:GetHandler()), nil, REASON_COST)
end
end
-- 代价: 改变表示形式
function RushDuel.CostChangePosition(pos)
return function(e, tp, eg, ep, ev, re, r, rp, chk)
local c = e:GetHandler()
if chk == 0 then
return (not pos or not c:IsPosition(pos)) and RushDuel.IsCanChangePosition(c)
end
if pos then
RD.ChangePosition(c, pos)
else
RD.ChangePosition(c)
end
end
end
-- 代价: 合并2个代价
function RushDuel.CostMerge(cost1, cost2)
return function(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return cost1(e, tp, eg, ep, ev, re, r, rp, chk) and cost2(e, tp, eg, ep, ev, re, r, rp, chk)
end
cost1(e, tp, eg, ep, ev, re, r, rp, chk)
cost2(e, tp, eg, ep, ev, re, r, rp, chk)
end
end
-- 代价: 从2个代价中选择1个
function RushDuel.CostChooseAction(hit1, hit2, hit3, filter1, check1, zone1, count1, action1, filter2, check2, zone2, count2, action2)
return function(e, tp, eg, ep, ev, re, r, rp, chk)
local g1 = Duel.GetMatchingGroup(filter1, tp, zone1, 0, nil)
local g2 = Duel.GetMatchingGroup(filter2, tp, zone2, 0, nil)
local b1, b2
if check1 then
b1 = g1:CheckSubGroup(check1, count1, count1)
else
b1 = g1:GetCount() >= count1
end
if check2 then
b2 = g2:CheckSubGroup(check2, count2, count2)
else
b2 = g2:GetCount() >= count2
end
if chk == 0 then
return b1 or b2
end
local sg
if b1 and not b2 then
Duel.Hint(HINT_SELECTMSG, tp, hit1)
if check1 then
sg = g1:SelectSubGroup(tp, check1, false, count1, count1)
else
sg = g1:Select(tp, count1, count1, nil)
end
action1(sg, e, tp, eg, ep, ev, re, r, rp)
elseif b2 and not b1 then
Duel.Hint(HINT_SELECTMSG, tp, hit2)
if check2 then
sg = g2:SelectSubGroup(tp, check2, false, count2, count2)
else
sg = g2:Select(tp, count2, count2, nil)
end
action2(sg, e, tp, eg, ep, ev, re, r, rp)
else
g1:Merge(g2)
Duel.Hint(HINT_SELECTMSG, tp, hit3)
local min, max = count1, count2
if min > max then
min, max = max, min
end
sg = g1:SelectSubGroup(tp, function(g)
return (RushDuel.GroupAllCount(g, Card.IsLocation, count1, zone1) and (not check1 or check1(sg))) or
(RushDuel.GroupAllCount(g, Card.IsLocation, count2, zone2) and (not check2 or check2(sg)))
end, false, min, max)
if sg:GetCount() == count1 and (not check1 or check1(sg)) then
action1(sg, e, tp, eg, ep, ev, re, r, rp)
elseif sg:GetCount() == count2 and (not check2 or check2(sg)) then
action2(sg, e, tp, eg, ep, ev, re, r, rp)
end
end
end
end
......@@ -7,7 +7,8 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[1],list[1])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,cm.condition,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,nil,CATEGORY_TOGRAVE+CATEGORY_GRAVE_ACTION+CATEGORY_DESTROY)
local e1,e2=RD.CreateMultiChooseEffect(c,cm.condition,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_GRAVE_ACTION+CATEGORY_DESTROY)
end
--Multi-Choose Effect
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -16,11 +16,7 @@ end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler())
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return RD.IsCanChangePosition(c) end
RD.ChangePosition(c)
end
cm.cost=RD.CostChangePosition()
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
......
......@@ -17,11 +17,7 @@ end
function cm.filter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAttackPos() and RD.IsCanChangePosition(c) end
RD.ChangePosition(c,POS_FACEUP_DEFENSE)
end
cm.cost=RD.CostChangePosition(POS_FACEUP_DEFENSE)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
......
......@@ -18,11 +18,7 @@ cm.indval=RD.ValueEffectIndesType(0,TYPE_TRAP)
function cm.filter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and RD.IsDefenseAbove(c,2000)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return RD.IsCanChangePosition(c) end
RD.ChangePosition(c)
end
cm.cost=RD.CostChangePosition()
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
end
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_DESTROY,CATEGORY_ATKCHANGE)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_DESTROY)
e2:SetCategory(CATEGORY_ATKCHANGE)
end
--Multi-Choose Effect
cm.cost=RD.CostSendDeckTopToGrave(1)
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,nil,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_POSITION,CATEGORY_DESTROY)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,nil,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_POSITION)
e2:SetCategory(CATEGORY_DESTROY)
end
--Position
function cm.posfilter(c)
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_TODECK+CATEGORY_GRAVE_ACTION,CATEGORY_TODECK)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
e2:SetCategory(CATEGORY_TODECK)
end
--Multi-Choose Effect
cm.cost=RD.CostSendGraveToDeckBottom(Card.IsAbleToDeckOrExtraAsCost,1,1)
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE,CATEGORY_ATKCHANGE)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_ATKCHANGE)
e2:SetCategory(CATEGORY_ATKCHANGE)
end
--Multi-Choose Effect
cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1)
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE,CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_ATKCHANGE)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
end
--Multi-Choose Effect
cm.cost=RD.CostSendDeckTopToGrave(1)
......
......@@ -7,7 +7,8 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,cm.condition,cm.cost,aux.Stringid(m,1),nil,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE)
local e1,e2=RD.CreateMultiChooseEffect(c,cm.condition,cm.cost,aux.Stringid(m,1),nil,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_ATKCHANGE)
end
--Multi-Choose Effect
function cm.confilter1(c)
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON,CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
end
--Multi-Choose Effect
function cm.costfilter(c)
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE,CATEGORY_DESTROY)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_ATKCHANGE)
e2:SetCategory(CATEGORY_DESTROY)
end
--Multi-Choose Effect
cm.cost=RD.CostSendDeckTopToGrave(1)
......
......@@ -7,7 +7,11 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,cm.condition,nil,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_DAMAGE+CATEGORY_ATKCHANGE,CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
local e1,e2=RD.CreateMultiChooseEffect(c,cm.condition,nil,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_ATKCHANGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCategory(CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
end
--Multi-Choose Effect
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
......@@ -16,10 +20,10 @@ end
--Damage
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,2000)
RD.TargetDamage(tp,2000)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
if Duel.Damage(tp,2000,REASON_EFFECT)~=0 then
if RD.Damage()~=0 then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.BreakEffect()
......@@ -35,10 +39,10 @@ function cm.spfilter(c,e,tp)
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
RD.TargetRecover(tp,1000)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
if Duel.Recover(tp,1000,REASON_EFFECT)~=0 then
if RD.Recover()~=0 then
RD.CanSelectAndSpecialSummon(aux.Stringid(m,4),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP,true)
end
end
\ No newline at end of file
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),nil,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE,CATEGORY_POSITION)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),nil,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_ATKCHANGE)
e2:SetCategory(CATEGORY_POSITION)
end
--Multi-Choose Effect
cm.cost=RD.CostSendDeckTopToGrave(1)
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,nil,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION,CATEGORY_DESTROY)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,nil,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e2:SetCategory(CATEGORY_DESTROY)
end
--To Hand
function cm.thfilter(c)
......
......@@ -7,7 +7,8 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_ATKCHANGE)
end
--Multi-Choose Effect
cm.cost=RD.CostSendDeckTopToGrave(1)
......
......@@ -7,7 +7,11 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_DAMAGE,CATEGORY_DRAW+CATEGORY_TOGRAVE)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
end
--Multi-Choose Effect
function cm.costfilter(c)
......@@ -17,19 +21,19 @@ cm.cost=RD.CostSendGraveSubToDeck(cm.costfilter,aux.dncheck,2,2)
--Damage
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1500)
RD.TargetDamage(1-tp,1500)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,1500,REASON_EFFECT)
RD.Damage()
end
--Draw
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,3) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,3)
RD.TargetDraw(tp,3)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_HAND)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,3,REASON_EFFECT)~=0 then
if RD.Draw()~=0 then
RD.SelectAndDoAction(HINTMSG_TOGRAVE,Card.IsAbleToGrave,tp,LOCATION_HAND,0,2,2,nil,function(g)
Duel.BreakEffect()
RD.SendToGraveAndExists(g)
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,nil,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON,CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,nil,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
end
--Multi-Choose Effect
function cm.spfilter(c,e,tp)
......
......@@ -7,18 +7,21 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_DRAW+CATEGORY_TOGRAVE,CATEGORY_ATKCHANGE)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCategory(CATEGORY_ATKCHANGE)
end
--Multi-Choose Effect
cm.cost=RD.CostSendHandToGrave(Card.IsAbleToGraveAsCost,1,1)
--Draw
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
RD.TargetDraw(tp,2)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,2,REASON_EFFECT)~=0 then
if RD.Draw()~=0 then
RD.SelectAndDoAction(HINTMSG_TOGRAVE,Card.IsAbleToGrave,tp,LOCATION_HAND,0,1,1,nil,function(g)
Duel.BreakEffect()
RD.SendToGraveAndExists(g)
......
......@@ -17,11 +17,7 @@ end
function cm.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_INSECT) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return RD.IsCanChangePosition(c) end
RD.ChangePosition(c)
end
cm.cost=RD.CostChangePosition()
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetMZoneCount(tp)>1
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,2,nil,e,tp) end
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,cm.condition,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE,CATEGORY_DESTROY)
local e1,e2=RD.CreateMultiChooseEffect(c,cm.condition,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_ATKCHANGE)
e2:SetCategory(CATEGORY_DESTROY)
end
--Multi-Choose Effect
function cm.confilter(c)
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE,CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_ATKCHANGE)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
end
--Multi-Choose Effect
cm.cost=RD.CostSendDeckTopToGrave(1)
......
......@@ -7,7 +7,8 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_ATKCHANGE)
end
--Multi-Choose Effect
cm.cost=RD.CostSendDeckTopToGrave(1)
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE,CATEGORY_DESTROY)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_ATKCHANGE)
e2:SetCategory(CATEGORY_DESTROY)
end
--Multi-Choose Effect
cm.cost=RD.CostSendDeckTopToGrave(1)
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,nil,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_POSITION+CATEGORY_ATKCHANGE,CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,nil,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_POSITION+CATEGORY_ATKCHANGE)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
end
--Position
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -21,11 +21,7 @@ end
function cm.exfilter(c)
return c:IsType(TYPE_SPELL)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return RD.IsCanChangePosition(c) end
RD.ChangePosition(c)
end
cm.cost=RD.CostChangePosition()
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local dam=Duel.GetMatchingGroupCount(cm.filter,tp,0,LOCATION_GRAVE,nil)*100
if chk==0 then return dam>0 end
......
......@@ -7,7 +7,11 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,cm.condition,nil,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_DAMAGE+CATEGORY_ATKCHANGE,CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
local e1,e2=RD.CreateMultiChooseEffect(c,cm.condition,nil,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_ATKCHANGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCategory(CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
end
--Multi-Choose Effect
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
......@@ -16,10 +20,10 @@ end
--Damage
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,2000)
RD.TargetDamage(tp,2000)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
if Duel.Damage(tp,2000,REASON_EFFECT)~=0 then
if RD.Damage()~=0 then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.BreakEffect()
......@@ -35,10 +39,10 @@ function cm.spfilter(c,e,tp)
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
RD.TargetRecover(tp,1000)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
if Duel.Recover(tp,1000,REASON_EFFECT)~=0 then
if RD.Recover()~=0 then
RD.CanSelectAndSpecialSummon(aux.Stringid(m,4),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP,true)
end
end
\ No newline at end of file
......@@ -20,11 +20,7 @@ end
function cm.exfilter(c)
return c:IsPosition(POS_FACEUP_DEFENSE)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAttackPos() and RD.IsCanChangePosition(c) end
RD.ChangePosition(c,POS_FACEUP_DEFENSE)
end
cm.cost=RD.CostChangePosition(POS_FACEUP_DEFENSE)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
end
......
......@@ -21,11 +21,7 @@ end
function cm.posfilter(c)
return c:IsFaceup() and c:IsRace(RACE_GALAXY) and RD.IsCanChangePosition(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAttackPos() and RD.IsCanChangePosition(c) end
RD.ChangePosition(c,POS_FACEUP_DEFENSE)
end
cm.cost=RD.CostChangePosition(POS_FACEUP_DEFENSE)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
RD.TargetDamage(1-tp,500)
......
......@@ -7,7 +7,8 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[1])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,cm.condition,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,nil,CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
local e1,e2=RD.CreateMultiChooseEffect(c,cm.condition,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
end
--Multi-Choose Effect
function cm.confilter1(c,tp)
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_DESTROY,CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_DESTROY)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
end
--Multi-Choose Effect
function cm.costfilter(c)
......
......@@ -7,7 +7,8 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE,0)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_ATKCHANGE)
end
--Multi-Choose Effect
cm.cost=RD.CostSendDeckTopToGrave(1)
......
......@@ -21,11 +21,7 @@ function cm.thfilter(c)
end
cm.cost1=RD.CostPayLP(500)
cm.cost2=RD.CostSendHandToDeck(Card.IsAbleToDeckAsCost,2,2,false)
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk) and cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk) end
cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
end
cm.cost=RD.CostMerge(cm.cost1,cm.cost2)
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
......
......@@ -21,10 +21,7 @@ end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<=1
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHandAsCost() end
Duel.SendtoHand(e:GetHandler(),nil,REASON_COST)
end
cm.cost=RD.CostSendSelfToHand()
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
......
......@@ -14,11 +14,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Atk Up
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return RD.IsCanChangePosition(c) end
RD.ChangePosition(c)
end
cm.cost=RD.CostChangePosition()
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
end
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_ATKCHANGE,CATEGORY_DESTROY)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_ATKCHANGE)
e2:SetCategory(CATEGORY_DESTROY)
end
--Multi-Choose Effect
function cm.filter(c)
......
......@@ -21,10 +21,7 @@ end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<=1
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHandAsCost() end
Duel.SendtoHand(e:GetHandler(),nil,REASON_COST)
end
cm.cost=RD.CostSendSelfToHand()
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
......
......@@ -7,7 +7,8 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),nil,cm.operation2,0,CATEGORY_ATKCHANGE)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),nil,cm.operation2)
e2:SetCategory(CATEGORY_ATKCHANGE)
end
--Multi-Choose Effect
cm.cost=RD.CostSendDeckTopToGrave(1)
......
......@@ -16,11 +16,7 @@ end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler())
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return RD.IsCanChangePosition(c) end
RD.ChangePosition(c)
end
cm.cost=RD.CostChangePosition()
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
......
......@@ -27,11 +27,7 @@ function cm.exfilter(c)
end
cm.cost1=RD.CostSendHandToGrave(cm.costfilter,1,1)
cm.cost2=RD.CostPayLP(500)
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk) and cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk) end
cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
end
cm.cost=RD.CostMerge(cm.cost1,cm.cost2)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
......
......@@ -7,7 +7,8 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,cm.condition,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,0,CATEGORY_DESTROY)
local e1,e2=RD.CreateMultiChooseEffect(c,cm.condition,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e2:SetCategory(CATEGORY_DESTROY)
end
--Multi-Choose Effect
function cm.costfilter(c)
......
......@@ -24,11 +24,7 @@ function cm.thfilter(c)
end
cm.cost1=RD.CostSendDeckTopToGrave(2)
cm.cost2=RD.CostSendSelfToGrave()
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk) and cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk) end
cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
end
cm.cost=RD.CostMerge(cm.cost1,cm.cost2)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
......
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2,CATEGORY_TODECK+CATEGORY_GRAVE_ACTION,CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
end
--Multi-Choose Effect
cm.cost=RD.CostSendHandToDeckBottom(Card.IsAbleToDeckAsCost,1,1,false)
......
......@@ -26,30 +26,17 @@ end
function cm.filter(c)
return c:IsAttackPos() and c:IsAbleToHand()
end
function cm.costcheck(g)
return RD.GroupAllCount(g,Card.IsLocation,1,LOCATION_ONFIELD)
or RD.GroupAllCount(g,Card.IsLocation,4,LOCATION_GRAVE)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
and Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetMatchingGroup(cm.costfilter1,tp,LOCATION_ONFIELD,0,nil)
local g2=Duel.GetMatchingGroup(cm.costfilter2,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return g1:GetCount()>0 or g2:GetCount()>3 end
local sg
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
if g1:GetCount()<1 then
sg=g2:Select(tp,4,4,nil)
elseif g2:GetCount()<4 then
sg=g1:Select(tp,1,1,nil)
else
g1:Merge(g2)
sg=g1:SelectSubGroup(tp,cm.costcheck,false,1,4)
end
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
cm.cost=RD.CostChooseAction(HINTMSG_TODECK,HINTMSG_TODECK,HINTMSG_TODECK,
cm.costfilter1,nil,LOCATION_ONFIELD,1,function(g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end,
cm.costfilter2,nil,LOCATION_GRAVE,4,function(g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
......
......@@ -22,11 +22,7 @@ end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler()) and Duel.GetLP(tp)>=Duel.GetLP(1-tp)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAttackPos() and RD.IsCanChangePosition(c) end
RD.ChangePosition(c,POS_FACEUP_DEFENSE)
end
cm.cost=RD.CostChangePosition(POS_FACEUP_DEFENSE)
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
......
......@@ -22,11 +22,7 @@ end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>9
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAttackPos() and RD.IsCanChangePosition(c) end
RD.ChangePosition(c,POS_FACEUP_DEFENSE)
end
cm.cost=RD.CostChangePosition(POS_FACEUP_DEFENSE)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
RD.Damage(1-tp,500)
......
......@@ -19,35 +19,16 @@ end
function cm.costfilter2(c)
return c:IsLevelAbove(7) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FIEND) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.costcheck(g)
return RD.GroupAllCount(g,Card.IsLocation,1,LOCATION_HAND)
or RD.GroupAllCount(g,Card.IsLocation,3,LOCATION_GRAVE)
end
function cm.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FIEND) and RD.IsCanChangePosition(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetMatchingGroup(cm.costfilter1,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(cm.costfilter2,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return g1:GetCount()>0 or g2:GetCount()>2 end
local sg
if g1:GetCount()<1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
sg=g2:Select(tp,3,3,nil)
elseif g2:GetCount()<3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
sg=g1:Select(tp,1,1,nil)
else
g1:Merge(g2)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1))
sg=g1:SelectSubGroup(tp,cm.costcheck,false,1,3)
end
if sg:GetCount()==1 then
Duel.SendtoGrave(sg,REASON_COST)
else
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
end
cm.cost=RD.CostChooseAction(HINTMSG_TOGRAVE,HINTMSG_TODECK,aux.Stringid(m,1),
cm.costfilter1,nil,LOCATION_HAND,1,function(g)
Duel.SendtoGrave(g,REASON_COST)
end,
cm.costfilter2,nil,LOCATION_GRAVE,3,function(g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
......
......@@ -22,32 +22,13 @@ end
function cm.costcheck2(g)
return g:GetClassCount(Card.GetLevel)==g:GetCount()
end
function cm.costcheck(g)
return RD.GroupAllCount(g,Card.IsLocation,1,LOCATION_HAND)
or (RD.GroupAllCount(g,Card.IsLocation,5,LOCATION_GRAVE) and cm.costcheck2(g))
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetMatchingGroup(cm.costfilter1,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(cm.costfilter2,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return g1:GetCount()>0 or g2:GetClassCount(Card.GetLevel)>4 end
local sg
if g1:GetCount()<1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
sg=g2:SelectSubGroup(tp,cm.costcheck2,false,5,5)
elseif g2:GetClassCount(Card.GetLevel)<5 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
sg=g1:Select(tp,1,1,nil)
else
g1:Merge(g2)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1))
sg=g1:SelectSubGroup(tp,cm.costcheck,false,1,5)
end
if sg:GetCount()==1 then
Duel.SendtoGrave(sg,REASON_COST)
else
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
end
cm.cost=RD.CostChooseAction(HINTMSG_TOGRAVE,HINTMSG_TODECK,aux.Stringid(m,1),
cm.costfilter1,nil,LOCATION_HAND,1,function(g)
Duel.SendtoGrave(g,REASON_COST)
end,
cm.costfilter2,cm.costcheck2,LOCATION_GRAVE,5,function(g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
RD.TargetDraw(tp,2)
......
local m=120260035
local cm=_G["c"..m]
cm.name="磁力雷充"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.costfilter(c)
return c:IsRace(RACE_ROCK) and c:IsAbleToGraveAsCost()
end
function cm.exfilter(c)
return c:IsFaceup() and c:GetBaseAttack()==3500 and c:IsRace(RACE_ROCK)
end
cm.cost=RD.CostSendHandToGrave(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
RD.TargetDraw(tp,2)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if RD.Draw()~=0 and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,nil,tp,0,LOCATION_MZONE,1,1,nil,function(g)
Duel.Destroy(g,REASON_EFFECT)
end)
end
end
\ No newline at end of file
......@@ -23,11 +23,7 @@ function cm.exfilter(c)
end
cm.cost1=RD.CostSendDeckTopToGrave(2)
cm.cost2=RD.CostSendHandToGrave(cm.costfilter,1,1)
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk) and cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk) end
cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
end
cm.cost=RD.CostMerge(cm.cost1,cm.cost2)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
RD.TargetDraw(tp,1)
......
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