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

2022/5/8 新增:与未知的邂逅

parent 6366951f
Pipeline #12542 passed with stages
in 3 minutes and 51 seconds
No preview for this file type
local m=120217048
local list={120183013}
local cm=_G["c"..m]
cm.name="与未知的邂逅"
function cm.initial_effect(c)
aux.AddCodeList(c,list[1])
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.confilter(c)
return c:IsFaceup() and c:IsLevelAbove(7) and c:IsRace(RACE_OMEGAPSYCHO+RACE_PSYCHO)
end
function cm.exfilter(c)
return c:IsFaceup() and c:IsCode(list[1])
end
function cm.thfilter(c)
return c:IsLevelAbove(3) and c:IsAbleToHand()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil)
and tc:IsControler(1-tp) and tc:IsLevelBelow(8)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
local tc=Duel.GetAttacker()
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tc,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc and tc:IsRelateToBattle() and RD.SendToOpponentHand(tc)~=0
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
RD.SendToHandAndExists(g,1-tp)
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