Commit 68485e70 authored by 未闻皂名's avatar 未闻皂名

2022/6/24 新增:落盖

parent 6ade8cab
No preview for this file type
local m=120222064
local cm=_G["c"..m]
cm.name="落盖"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsFaceup() and c:IsSummonLocation(LOCATION_GRAVE)
end
function cm.filter(c)
return c:IsFaceup() and c:IsLevelBelow(8) and RD.IsCanChangePosition(c) and c:IsCanTurnSet()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
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)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_SET,cm.filter,tp,0,LOCATION_MZONE,1,2,nil,function(g)
RD.ChangePosition(g,POS_FACEDOWN_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