Commit 370bda4d authored by 未闻皂名's avatar 未闻皂名

2023/7/5 新增:音痴噪声烦恼

parent ea7f40d7
Pipeline #22569 failed with stages
in 63 minutes and 45 seconds
local m=120249058
local cm=_G["c"..m]
cm.name="音痴噪声烦恼"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
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
--Activate
function cm.filter(c,tp)
return c:GetOwner()==tp
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and eg:IsExists(cm.filter,1,nil,1-tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if chk==0 then return ct>0 end
RD.TargetDamage(1-tp,ct*400)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
RD.Damage(nil,ct*400)
if ev>0 then
RD.SendOpponentHandToGrave(tp,aux.Stringid(m,1),1,1)
end
end
--Event
function cm.event(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(Card.IsPreviousLocation,nil,LOCATION_DECK)
Duel.RaiseEvent(eg,EVENT_CUSTOM+m,re,r,rp,ep,g:GetCount())
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