-
Notifications
You must be signed in to change notification settings - Fork 1
/
c37564205.lua
34 lines (33 loc) · 1.15 KB
/
c37564205.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--Sawawa-Lunatic Sprinter
local m=37564205
local cm=_G["c"..m]
cm.Senya_name_with_sawawa=true
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(0x14000)
e1:SetCondition(Senya.CheckNoExtra)
e1:SetTarget(cm.atktg)
e1:SetOperation(cm.atkop)
c:RegisterEffect(e1)
Senya.SawawaCommonEffect(c,1,true,false,false)
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfilter,tp,0,LOCATION_EXTRA,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_EXTRA)
end
function cm.rmfilter(c)
return c:IsFacedown() and c:IsAbleToRemove()
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsFaceup() and c:IsRelateToEffect(e)) then return end
local g=Duel.GetMatchingGroup(cm.rmfilter,tp,0,LOCATION_EXTRA,nil)
if g:GetCount()==0 then return end
local gc=g:RandomSelect(tp,1):GetFirst()
Duel.Remove(gc,POS_FACEUP,REASON_EFFECT)
local tc=Duel.GetOperatedGroup():GetFirst()
Senya.CopyStatusAndEffect(e,nil,tc)
end