-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathc37564221.lua
72 lines (71 loc) · 2.48 KB
/
c37564221.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
--Septette for the Dead Princess
local m=37564221
local cm=_G["c"..m]
cm.Senya_name_with_sawawa=true
function cm.initial_effect(c)
Senya.SawawaCommonEffect(c,2,true,false,false)
local e9=Effect.CreateEffect(c)
e9:SetDescription(aux.Stringid(37564221,1))
e9:SetCategory(CATEGORY_POSITION)
e9:SetType(EFFECT_TYPE_IGNITION)
e9:SetCountLimit(1,375642211)
e9:SetRange(LOCATION_MZONE)
e9:SetTarget(cm.target)
e9:SetOperation(cm.operation)
c:RegisterEffect(e9)
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(37564221,2))
e6:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_F)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCountLimit(1,375642212)
e6:SetCondition(Senya.CheckNoExtra)
e6:SetTarget(cm.target1)
e6:SetOperation(cm.operation1)
c:RegisterEffect(e6)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanTurnSet() and c:GetFlagEffect(37564221)==0 end
c:RegisterFlagEffect(37564221,RESET_EVENT+0x1fc0000+RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(function(e,c)
return c:IsFacedown() and c:IsLocation(LOCATION_MZONE)
end)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
Duel.RegisterEffect(e2,tp)
end
function cm.rmfilter(c)
return c:GetSummonLocation()==LOCATION_EXTRA and c:IsAbleToDeck() and c:IsFaceup()
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end