-
Notifications
You must be signed in to change notification settings - Fork 1
/
c37564206.lua
56 lines (55 loc) · 2.12 KB
/
c37564206.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
--Sawawa-Satori Crisis
local m=37564206
local cm=_G["c"..m]
cm.Senya_name_with_sawawa=true
function cm.initial_effect(c)
Senya.SawawaCommonEffect(c,1,true,false,false)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetCondition(Senya.CheckNoExtra)
e1:SetCost(Senya.SawawaRemoveCost(1))
e1:SetTarget(cm.xmtg)
e1:SetOperation(cm.xmop)
c:RegisterEffect(e1)
end
function cm.xmfilter(c,e,tp)
local gg=c:GetOverlayGroup()
return c:IsType(TYPE_XYZ) and gg:IsExists(cm.ssfilter,1,nil,e,tp)
end
function cm.ssfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.xmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.xmfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cm.xmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g1=Duel.SelectTarget(tp,cm.xmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_MZONE)
end
function cm.xmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local gg=tc:GetOverlayGroup()
if not (gg:IsExists(cm.ssfilter,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsRelateToEffect(e)) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=gg:FilterSelect(tp,cm.ssfilter,1,1,nil,e,tp)
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then
local ssed=Duel.GetOperatedGroup()
local ssc=ssed:GetFirst()
if ssc:IsType(TYPE_XYZ) and (tc:IsControler(tp) or tc:IsAbleToChangeControler()) then
if Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(ssc,Group.FromCards(tc))
end
end
end
end