Commit 0b17799d authored by 未闻皂名's avatar 未闻皂名

2023/6/4 新增:环幻乐姬 动作旋律 添加将返回卡组上面或下面的Cost

parent 5563b533
No preview for this file type
No preview for this file type
......@@ -235,35 +235,35 @@ end
-- 操作: 返回卡组
function RushDuel.SendToDeckAndExists(target, filter, count, expect)
local g = RushDuel.ToMaximunGroup(target)
return Duel.SendtoDeck(g, nil, 2, REASON_EFFECT) ~= 0 and RushDuel.IsOperatedGroupExists(filter, count, expect)
return Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT) ~= 0 and RushDuel.IsOperatedGroupExists(filter, count, expect)
end
-- 操作: 返回卡组上面 (排序)
function RushDuel.SendToDeckTop(target, sort_player, target_player, sort)
local g = RushDuel.ToMaximunGroup(target)
if sort then
local og, ct = RushDuel.SendToDeckSort(g, 0, REASON_EFFECT, sort_player, target_player)
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKTOP, REASON_EFFECT, sort_player, target_player)
return ct
else
return Duel.SendtoDeck(g, nil, 0, REASON_EFFECT)
return Duel.SendtoDeck(g, nil, SEQ_DECKTOP, REASON_EFFECT)
end
end
-- 操作: 返回卡组下面 (排序)
function RushDuel.SendToDeckBottom(target, sort_player, target_player, sort)
local g = RushDuel.ToMaximunGroup(target)
if sort then
local og, ct = RushDuel.SendToDeckSort(g, 1, REASON_EFFECT, sort_player, target_player)
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKBOTTOM, REASON_EFFECT, sort_player, target_player)
return ct
else
return Duel.SendtoDeck(g, nil, 1, REASON_EFFECT)
return Duel.SendtoDeck(g, nil, SEQ_DECKBOTTOM, REASON_EFFECT)
end
end
-- 操作: 返回对方卡组上面 (排序)
function RushDuel.SendToOpponentDeckTop(target, player)
local g = RushDuel.ToMaximunGroup(target)
if g:GetCount() == 1 then
return Duel.SendtoDeck(g, nil, 0, REASON_EFFECT)
return Duel.SendtoDeck(g, nil, SEQ_DECKTOP, REASON_EFFECT)
else
local og, ct = RushDuel.SendToDeckSort(g, 0, REASON_EFFECT, player, 1 - player)
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKTOP, REASON_EFFECT, player, 1 - player)
return ct
end
end
......@@ -271,9 +271,9 @@ end
function RushDuel.SendToOpponentDeckBottom(target, player)
local g = RushDuel.ToMaximunGroup(target)
if g:GetCount() == 1 then
return Duel.SendtoDeck(g, nil, 1, REASON_EFFECT)
return Duel.SendtoDeck(g, nil, SEQ_DECKBOTTOM, REASON_EFFECT)
else
local og, ct = RushDuel.SendToDeckSort(g, 1, REASON_EFFECT, player, 1 - player)
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKBOTTOM, REASON_EFFECT, player, 1 - player)
return ct
end
end
......
......@@ -52,6 +52,16 @@ function RushDuel._private_action_send_deck_sort(sequence, reason, hint_selectio
RushDuel.SetLabelAndObject(e, og, set_label_after, set_object_after)
end
end
-- 内部方法: 返回卡组上面或下面动作
function RushDuel._private_action_send_deck_top_or_bottom(top_desc, bottom_desc, reason, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
return function(g, e, tp, eg, ep, ev, re, r, rp)
RushDuel.HintOrConfirm(g, hint_selection, confirm, 1 - tp)
RushDuel.SetLabelAndObject(e, g, set_label_before, set_object_before)
local sequence = Duel.SelectOption(tp, top_desc, bottom_desc)
local og, ct = RushDuel.SendToDeckSort(g, sequence, reason, tp, tp)
RushDuel.SetLabelAndObject(e, og, set_label_after, set_object_after)
end
end
-- 内部方法: 返回手卡动作
function RushDuel._private_action_send_hand(reason, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
return function(g, e, tp, eg, ep, ev, re, r, rp)
......@@ -89,6 +99,11 @@ function RushDuel.CostSendGroupToDeckSort(filter, check, field, min, max, except
local action = RushDuel._private_action_send_deck_sort(sequence, REASON_COST, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel._private_cost_select_group(HINTMSG_TODECK, filter, check, field, 0, min, max, except_self, action)
end
-- 代价: 选择匹配卡片, 返回卡组上面或下面
function RushDuel.CostSendMatchToDeckTopOrBottom(filter, field, min, max, except_self, top_desc, bottom_desc, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
local action = RushDuel._private_action_send_deck_top_or_bottom(top_desc, bottom_desc, REASON_COST, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel._private_cost_select_match(HINTMSG_TODECK, filter, field, 0, min, max, except_self, action)
end
-- 代价: 选择匹配卡片, 返回手卡
function RushDuel.CostSendMatchToHand(filter, field, min, max, except_self, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
local action = RushDuel._private_action_send_hand(REASON_COST, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
......@@ -222,6 +237,10 @@ end
function RushDuel.CostSendGraveSubToDeckBottom(filter, check, min, max, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendGroupToDeckSort(filter, check, LOCATION_GRAVE, min, max, false, SEQ_DECKBOTTOM, false, true, set_label_before, set_object_before, set_label_after, set_object_after)
end
-- 代价: 让墓地的卡返回卡组上面或下面
function RushDuel.CostSendGraveToDeckTopOrBottom(filter, min, max, top_desc, bottom_desc, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel.CostSendMatchToDeckTopOrBottom(filter, 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)
......
......@@ -26,14 +26,7 @@ end
function cm.thfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
local op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
Duel.SendtoDeck(g,nil,op,REASON_COST)
end
cm.cost=RD.CostSendGraveToDeckTopOrBottom(cm.costfilter,1,1,aux.Stringid(m,1),aux.Stringid(m,2))
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
......
......@@ -23,14 +23,7 @@ end
function cm.tdfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsAbleToDeck()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
local opt=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
Duel.SendtoDeck(g,nil,opt,REASON_COST)
end
cm.cost=RD.CostSendGraveToDeckTopOrBottom(cm.costfilter,1,1,aux.Stringid(m,1),aux.Stringid(m,2))
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
......
......@@ -29,14 +29,7 @@ end
function cm.spfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_GALAXY) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
local opt=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
Duel.SendtoDeck(g,nil,opt,REASON_COST)
end
cm.cost=RD.CostSendGraveToDeckTopOrBottom(cm.costfilter,1,1,aux.Stringid(m,1),aux.Stringid(m,2))
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)
......
local m=120247020
local list={120247025,120247031,120151036,120196050}
local cm=_G["c"..m]
cm.name="环幻乐姬 动作旋律"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Atk Up
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Atk Up
function cm.costfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToDeckOrExtraAsCost()
end
cm.cost=RD.CostSendGraveToDeckTopOrBottom(cm.costfilter,1,1,aux.Stringid(m,1),aux.Stringid(m,2),nil,nil,function(g)
return g:GetFirst():GetCode()
end)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,3),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g)
RD.AttachAtkDef(e,g:GetFirst(),-2000,-2000,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
local code=e:GetLabel()
if (code==list[3] or code==list[4]) then
RD.CanDraw(aux.Stringid(m,4),tp,1)
end
end)
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