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

2023/8/25 新增:波状防壁

parent e341b425
Pipeline #23275 passed with stages
in 7 minutes and 3 seconds
No preview for this file type
local m=120246038
local cm=_G["c"..m]
cm.name="波状防壁"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_ATKCHANGE)
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.exfilter(c)
return c:IsLevelAbove(1) and c:IsLocation(LOCATION_GRAVE)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
local bc=Duel.GetAttackTarget()
return tc:IsControler(1-tp) and bc and bc:IsDefensePos()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,5) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,5)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if RD.SendDeckTopToGraveAndExists(tp,5) then
local g=Duel.GetOperatedGroup():Filter(cm.exfilter,nil)
if g:GetCount()==0 then return end
local atk=g:GetSum(Card.GetLevel)*-100
local tc=Duel.GetAttacker()
if tc and tc:IsRelateToBattle() and tc:IsFaceup() then
RD.AttachAtkDef(e,tc,atk,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
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