Commit 1f1604a9 authored by 未闻皂名's avatar 未闻皂名

2021/12/20 一时风锁改为自定义事件触发

parent 13762787
...@@ -6,16 +6,25 @@ function cm.initial_effect(c) ...@@ -6,16 +6,25 @@ function cm.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION+CATEGORY_RECOVER) e1:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_TO_GRAVE) e1:SetCode(EVENT_CUSTOM+m)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(cm.condition) e1:SetCondition(cm.condition)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.activate) e1:SetOperation(cm.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Event
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TO_GRAVE)
ge1:SetOperation(cm.event)
Duel.RegisterEffect(ge1,0)
end
end end
--Activate --Activate
function cm.filter(c,tp) function cm.filter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_DECK) return c:IsPreviousControler(tp)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.filter,1,nil,1-tp) return eg:IsExists(cm.filter,1,nil,1-tp)
...@@ -31,4 +40,11 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -31,4 +40,11 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=g:RandomSelect(1-tp,1) local sg=g:RandomSelect(1-tp,1)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT) Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end end
end
--Event
function cm.event(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(Card.IsPreviousLocation,nil,LOCATION_DECK)
if g:GetCount()>0 then
Duel.RaiseEvent(g,EVENT_CUSTOM+m,re,r,rp,ep,ev)
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