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

2024/4/28 新增:龙搬运工,整合改变表示形式的Cost

parent c6ab82ac
No preview for this file type
......@@ -78,6 +78,16 @@ function RushDuel._private_action_send_hand(reason, hint_selection, confirm, set
end
end
end
-- 内部方法: 改变表示形式动作
function RushDuel._private_action_change_position(position, set_label_before, set_object_before, set_label_after, set_object_after)
return function(g, e, tp, eg, ep, ev, re, r, rp)
RushDuel.SetLabelAndObject(e, g, set_label_before, set_object_before)
if RushDuel.ChangePosition(g, position) ~= 0 then
local og = Duel.GetOperatedGroup()
RushDuel.SetLabelAndObject(e, og, set_label_after, set_object_after)
end
end
end
-- 代价: 选择匹配卡片, 送去墓地
function RushDuel.CostSendMatchToGrave(filter, field, min, max, except_self, hint_selection, confirm, set_label_before, set_object_before, set_label_after, set_object_after)
......@@ -294,6 +304,11 @@ 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.CostChangePosition(filter, min, max, position, except_self, set_label_before, set_object_before, set_label_after, set_object_after)
local action = RushDuel._private_action_change_position(position, set_label_before, set_object_before, set_label_after, set_object_after)
return RushDuel._private_cost_select_match(HINTMSG_POSCHANGE, filter, LOCATION_MZONE, 0, min, max, except_self, action)
end
-- 代价: 让自己场上表侧表示的这张卡返回手卡
function RushDuel.CostSendSelfToHand()
return function(e, tp, eg, ep, ev, re, r, rp, chk)
......
......@@ -18,12 +18,7 @@ function cm.costfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelAbove(7) and c:IsRace(RACE_WARRIOR)
and RD.IsCanChangePosition(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil) end
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
end)
end
cm.cost=RD.CostChangePosition(cm.costfilter,1,1)
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)
......
......@@ -18,12 +18,7 @@ function cm.costfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsLevelAbove(5) and c:IsRace(RACE_FIEND)
and RD.IsCanChangePosition(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil) end
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
end)
end
cm.cost=RD.CostChangePosition(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
......
......@@ -10,6 +10,7 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
......@@ -19,6 +20,9 @@ function cm.thfilter(c)
return ((c:IsLevel(10) and c:IsType(TYPE_MAXIMUM)) or c:IsCode(list[1]) or c:IsCode(list[2]))
and c:IsAbleToHand()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsCanAttachBattleIndes(e:GetHandler(),1)
end
cm.cost1=RD.CostPayLP(500)
cm.cost2=RD.CostSendHandToDeck(Card.IsAbleToDeckAsCost,2,2,false)
cm.cost=RD.CostMerge(cm.cost1,cm.cost2)
......
......@@ -29,17 +29,12 @@ function cm.spcon(e,c)
end
--Atk Up
function cm.costfilter(c)
return RD.IsCanChangePosition(c)
return c:IsFaceup() and RD.IsCanChangePosition(c)
end
function cm.filter(c)
return c:IsFaceup() and c:IsCode(list[1])
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil) end
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
RD.ChangePosition(g)
end)
end
cm.cost=RD.CostChangePosition(cm.costfilter,1,1)
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
......
local m=120261035
local cm=_G["c"..m]
cm.name="龙搬运工"
function cm.initial_effect(c)
--Confirm
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Confirm
function cm.costfilter(c)
return c:IsFaceup() and c:IsLevelAbove(7) and c:IsRace(RACE_DRAGON) and RD.IsCanChangePosition(c)
end
function cm.filter(c)
return c:IsFacedown() and c:GetSequence()<5
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler())
end
cm.cost=RD.CostChangePosition(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_SZONE,1,nil) end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_FACEDOWN,cm.filter,tp,0,LOCATION_SZONE,1,1,nil,function(g)
Duel.ConfirmCards(tp,g)
if g:GetFirst():IsType(TYPE_TRAP) then
Duel.Destroy(g,REASON_EFFECT)
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