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

2022/5/15 新增:水稻梯田保安

parent ead85c1c
Pipeline #12735 passed with stages
in 4 minutes and 31 seconds
No preview for this file type
local m=120109016
local cm=_G["c"..m]
cm.name="水稻梯田保安"
function cm.initial_effect(c)
--Position
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_POSITION)
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
--Position
function cm.costfilter(c)
return c:IsLevelAbove(5) and c:IsAbleToGraveAsCost()
end
function cm.filter(c)
return c:IsFaceup() and c:IsRace(RACE_AQUA)
end
function cm.posfilter(c)
return c:IsAttackPos() and RD.IsCanChangePosition(c)
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.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)
if ct==0 then return end
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.posfilter,tp,0,LOCATION_MZONE,1,ct,nil,function(g)
RD.ChangePosition(g,POS_FACEUP_DEFENSE)
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