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

2024/4/24 新增:即兴果酱音跃:P摘取!

parent 3ae5060f
Pipeline #26682 passed with stages
in 8 minutes and 46 seconds
No preview for this file type
local m=120261063
local cm=_G["c"..m]
cm.name="即兴果酱音跃:P摘取!"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.costfilter(c)
return c:IsRace(RACE_PSYCHO) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.exfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PSYCHO)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,2,4)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetAttacker()
if chk==0 then return tc:IsAttackPos() and RD.IsCanChangePosition(tc) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsRelateToBattle() and tc:IsAttackPos()
and RD.ChangePosition(tc,POS_FACEUP_DEFENSE)~=0
and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_GRAVE,0,1,nil) then
local ct=6-Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if ct>0 then
RD.CanDraw(aux.Stringid(m,1),tp,ct)
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