Commit 6f267f43 authored by Nemo Ma's avatar Nemo Ma

wild

parent 8836e47a
No preview for this file type
expansions/pics/10080420.jpg

43.9 KB | W: | H:

expansions/pics/10080420.jpg

43.8 KB | W: | H:

expansions/pics/10080420.jpg
expansions/pics/10080420.jpg
expansions/pics/10080420.jpg
expansions/pics/10080420.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/111443942.jpg

48.6 KB | W: | H:

expansions/pics/111443942.jpg

45.5 KB | W: | H:

expansions/pics/111443942.jpg
expansions/pics/111443942.jpg
expansions/pics/111443942.jpg
expansions/pics/111443942.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/112538374.jpg

42.2 KB | W: | H:

expansions/pics/112538374.jpg

40.1 KB | W: | H:

expansions/pics/112538374.jpg
expansions/pics/112538374.jpg
expansions/pics/112538374.jpg
expansions/pics/112538374.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/113482285.jpg

44.1 KB | W: | H:

expansions/pics/113482285.jpg

45.1 KB | W: | H:

expansions/pics/113482285.jpg
expansions/pics/113482285.jpg
expansions/pics/113482285.jpg
expansions/pics/113482285.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/114431144.jpg

41.5 KB | W: | H:

expansions/pics/114431144.jpg

34.1 KB | W: | H:

expansions/pics/114431144.jpg
expansions/pics/114431144.jpg
expansions/pics/114431144.jpg
expansions/pics/114431144.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/114439429.jpg

44.8 KB | W: | H:

expansions/pics/114439429.jpg

38.7 KB | W: | H:

expansions/pics/114439429.jpg
expansions/pics/114439429.jpg
expansions/pics/114439429.jpg
expansions/pics/114439429.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/114562761.jpg

46.7 KB | W: | H:

expansions/pics/114562761.jpg

48.4 KB | W: | H:

expansions/pics/114562761.jpg
expansions/pics/114562761.jpg
expansions/pics/114562761.jpg
expansions/pics/114562761.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/114606001.jpg

42.6 KB | W: | H:

expansions/pics/114606001.jpg

43.8 KB | W: | H:

expansions/pics/114606001.jpg
expansions/pics/114606001.jpg
expansions/pics/114606001.jpg
expansions/pics/114606001.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/114644893.jpg

50.6 KB | W: | H:

expansions/pics/114644893.jpg

51.5 KB | W: | H:

expansions/pics/114644893.jpg
expansions/pics/114644893.jpg
expansions/pics/114644893.jpg
expansions/pics/114644893.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/114707556.jpg

48.6 KB | W: | H:

expansions/pics/114707556.jpg

50.2 KB | W: | H:

expansions/pics/114707556.jpg
expansions/pics/114707556.jpg
expansions/pics/114707556.jpg
expansions/pics/114707556.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/114722253.jpg

49.8 KB | W: | H:

expansions/pics/114722253.jpg

46.4 KB | W: | H:

expansions/pics/114722253.jpg
expansions/pics/114722253.jpg
expansions/pics/114722253.jpg
expansions/pics/114722253.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/114890515.jpg

45.3 KB | W: | H:

expansions/pics/114890515.jpg

39.7 KB | W: | H:

expansions/pics/114890515.jpg
expansions/pics/114890515.jpg
expansions/pics/114890515.jpg
expansions/pics/114890515.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/115072031.jpg

48.7 KB | W: | H:

expansions/pics/115072031.jpg

49.4 KB | W: | H:

expansions/pics/115072031.jpg
expansions/pics/115072031.jpg
expansions/pics/115072031.jpg
expansions/pics/115072031.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/115449321.jpg

43.5 KB | W: | H:

expansions/pics/115449321.jpg

46.9 KB | W: | H:

expansions/pics/115449321.jpg
expansions/pics/115449321.jpg
expansions/pics/115449321.jpg
expansions/pics/115449321.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/116301233.jpg

44.9 KB | W: | H:

expansions/pics/116301233.jpg

43.3 KB | W: | H:

expansions/pics/116301233.jpg
expansions/pics/116301233.jpg
expansions/pics/116301233.jpg
expansions/pics/116301233.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/116511113.jpg

51 KB | W: | H:

expansions/pics/116511113.jpg

53.6 KB | W: | H:

expansions/pics/116511113.jpg
expansions/pics/116511113.jpg
expansions/pics/116511113.jpg
expansions/pics/116511113.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/116839253.jpg

54.5 KB | W: | H:

expansions/pics/116839253.jpg

51.4 KB | W: | H:

expansions/pics/116839253.jpg
expansions/pics/116839253.jpg
expansions/pics/116839253.jpg
expansions/pics/116839253.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/117179181.jpg

46.2 KB | W: | H:

expansions/pics/117179181.jpg

52.9 KB | W: | H:

expansions/pics/117179181.jpg
expansions/pics/117179181.jpg
expansions/pics/117179181.jpg
expansions/pics/117179181.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/117485040.jpg

48.6 KB | W: | H:

expansions/pics/117485040.jpg

51.3 KB | W: | H:

expansions/pics/117485040.jpg
expansions/pics/117485040.jpg
expansions/pics/117485040.jpg
expansions/pics/117485040.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/117837139.jpg

51.4 KB | W: | H:

expansions/pics/117837139.jpg

52.7 KB | W: | H:

expansions/pics/117837139.jpg
expansions/pics/117837139.jpg
expansions/pics/117837139.jpg
expansions/pics/117837139.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/117960683.jpg

46.9 KB | W: | H:

expansions/pics/117960683.jpg

46.6 KB | W: | H:

expansions/pics/117960683.jpg
expansions/pics/117960683.jpg
expansions/pics/117960683.jpg
expansions/pics/117960683.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/117981478.jpg

47.9 KB | W: | H:

expansions/pics/117981478.jpg

40 KB | W: | H:

expansions/pics/117981478.jpg
expansions/pics/117981478.jpg
expansions/pics/117981478.jpg
expansions/pics/117981478.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/118353144.jpg

45 KB | W: | H:

expansions/pics/118353144.jpg

49.3 KB | W: | H:

expansions/pics/118353144.jpg
expansions/pics/118353144.jpg
expansions/pics/118353144.jpg
expansions/pics/118353144.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/118426889.jpg

46.3 KB | W: | H:

expansions/pics/118426889.jpg

50.3 KB | W: | H:

expansions/pics/118426889.jpg
expansions/pics/118426889.jpg
expansions/pics/118426889.jpg
expansions/pics/118426889.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/118776531.jpg

69.2 KB | W: | H:

expansions/pics/118776531.jpg

53.2 KB | W: | H:

expansions/pics/118776531.jpg
expansions/pics/118776531.jpg
expansions/pics/118776531.jpg
expansions/pics/118776531.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/118817732.jpg

51 KB | W: | H:

expansions/pics/118817732.jpg

50.6 KB | W: | H:

expansions/pics/118817732.jpg
expansions/pics/118817732.jpg
expansions/pics/118817732.jpg
expansions/pics/118817732.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/118824150.jpg

51.4 KB | W: | H:

expansions/pics/118824150.jpg

49.6 KB | W: | H:

expansions/pics/118824150.jpg
expansions/pics/118824150.jpg
expansions/pics/118824150.jpg
expansions/pics/118824150.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/119150521.jpg

46.9 KB | W: | H:

expansions/pics/119150521.jpg

46.3 KB | W: | H:

expansions/pics/119150521.jpg
expansions/pics/119150521.jpg
expansions/pics/119150521.jpg
expansions/pics/119150521.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/119828752.jpg

51.8 KB | W: | H:

expansions/pics/119828752.jpg

44.3 KB | W: | H:

expansions/pics/119828752.jpg
expansions/pics/119828752.jpg
expansions/pics/119828752.jpg
expansions/pics/119828752.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/120366274.jpg

49.6 KB | W: | H:

expansions/pics/120366274.jpg

42 KB | W: | H:

expansions/pics/120366274.jpg
expansions/pics/120366274.jpg
expansions/pics/120366274.jpg
expansions/pics/120366274.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/121082832.jpg

41.7 KB | W: | H:

expansions/pics/121082832.jpg

42.9 KB | W: | H:

expansions/pics/121082832.jpg
expansions/pics/121082832.jpg
expansions/pics/121082832.jpg
expansions/pics/121082832.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/122842126.jpg

43.1 KB | W: | H:

expansions/pics/122842126.jpg

36.4 KB | W: | H:

expansions/pics/122842126.jpg
expansions/pics/122842126.jpg
expansions/pics/122842126.jpg
expansions/pics/122842126.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/123064604.jpg

42.7 KB | W: | H:

expansions/pics/123064604.jpg

40.6 KB | W: | H:

expansions/pics/123064604.jpg
expansions/pics/123064604.jpg
expansions/pics/123064604.jpg
expansions/pics/123064604.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/127541563.jpg

45 KB | W: | H:

expansions/pics/127541563.jpg

46.5 KB | W: | H:

expansions/pics/127541563.jpg
expansions/pics/127541563.jpg
expansions/pics/127541563.jpg
expansions/pics/127541563.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/129223325.jpg

48 KB | W: | H:

expansions/pics/129223325.jpg

48.6 KB | W: | H:

expansions/pics/129223325.jpg
expansions/pics/129223325.jpg
expansions/pics/129223325.jpg
expansions/pics/129223325.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/4058.jpg

51.6 KB | W: | H:

expansions/pics/4058.jpg

48.7 KB | W: | H:

expansions/pics/4058.jpg
expansions/pics/4058.jpg
expansions/pics/4058.jpg
expansions/pics/4058.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89386000.jpg

10.6 KB | W: | H:

expansions/pics/89386000.jpg

44.8 KB | W: | H:

expansions/pics/89386000.jpg
expansions/pics/89386000.jpg
expansions/pics/89386000.jpg
expansions/pics/89386000.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89386001.jpg

9.35 KB | W: | H:

expansions/pics/89386001.jpg

39.3 KB | W: | H:

expansions/pics/89386001.jpg
expansions/pics/89386001.jpg
expansions/pics/89386001.jpg
expansions/pics/89386001.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89386002.jpg

9.28 KB | W: | H:

expansions/pics/89386002.jpg

39.5 KB | W: | H:

expansions/pics/89386002.jpg
expansions/pics/89386002.jpg
expansions/pics/89386002.jpg
expansions/pics/89386002.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89386003.jpg

10.5 KB | W: | H:

expansions/pics/89386003.jpg

44.8 KB | W: | H:

expansions/pics/89386003.jpg
expansions/pics/89386003.jpg
expansions/pics/89386003.jpg
expansions/pics/89386003.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89386004.jpg

9.24 KB | W: | H:

expansions/pics/89386004.jpg

39.8 KB | W: | H:

expansions/pics/89386004.jpg
expansions/pics/89386004.jpg
expansions/pics/89386004.jpg
expansions/pics/89386004.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89386005.jpg

9.22 KB | W: | H:

expansions/pics/89386005.jpg

38 KB | W: | H:

expansions/pics/89386005.jpg
expansions/pics/89386005.jpg
expansions/pics/89386005.jpg
expansions/pics/89386005.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89386006.jpg

9.19 KB | W: | H:

expansions/pics/89386006.jpg

38.5 KB | W: | H:

expansions/pics/89386006.jpg
expansions/pics/89386006.jpg
expansions/pics/89386006.jpg
expansions/pics/89386006.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89386007.jpg

8.7 KB | W: | H:

expansions/pics/89386007.jpg

37.5 KB | W: | H:

expansions/pics/89386007.jpg
expansions/pics/89386007.jpg
expansions/pics/89386007.jpg
expansions/pics/89386007.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89386008.jpg

9.05 KB | W: | H:

expansions/pics/89386008.jpg

38.5 KB | W: | H:

expansions/pics/89386008.jpg
expansions/pics/89386008.jpg
expansions/pics/89386008.jpg
expansions/pics/89386008.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89386009.jpg

9.36 KB | W: | H:

expansions/pics/89386009.jpg

38.8 KB | W: | H:

expansions/pics/89386009.jpg
expansions/pics/89386009.jpg
expansions/pics/89386009.jpg
expansions/pics/89386009.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89386010.jpg

9.66 KB | W: | H:

expansions/pics/89386010.jpg

41.1 KB | W: | H:

expansions/pics/89386010.jpg
expansions/pics/89386010.jpg
expansions/pics/89386010.jpg
expansions/pics/89386010.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/90700075.jpg

427 KB | W: | H:

expansions/pics/90700075.jpg

651 KB | W: | H:

expansions/pics/90700075.jpg
expansions/pics/90700075.jpg
expansions/pics/90700075.jpg
expansions/pics/90700075.jpg
  • 2-up
  • Swipe
  • Onion skin
--進化の到達点
function c10080420.initial_effect(c) function c10080420.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c10080420.spop) e1:SetOperation(c10080420.ctop2)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_FZONE) e2:SetRange(LOCATION_FZONE)
e2:SetCode(EVENT_CHAIN_SOLVED) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c10080420.spcon) e2:SetCondition(c10080420.drcon)
e2:SetOperation(c10080420.spop) e2:SetOperation(c10080420.drop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_FZONE) e3:SetRange(LOCATION_FZONE)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetOperation(aux.chainreg)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(2)
e3:SetCondition(c10080420.thcon)
e3:SetOperation(c10080420.thop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_CHAIN_SOLVED)
e4:SetRange(LOCATION_FZONE)
e4:SetCondition(c10080420.ctcon)
e4:SetOperation(c10080420.ctop)
c:RegisterEffect(e4)
--leave
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetCode(EVENT_LEAVE_FIELD_P)
e5:SetOperation(c10080420.checkop)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_LEAVE_FIELD) e6:SetCode(EVENT_LEAVE_FIELD)
e6:SetCondition(c10080420.leavecon) e6:SetLabelObject(e5)
e6:SetOperation(c10080420.leaveop) e6:SetOperation(c10080420.leave)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function c10080420.Isshinka(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and (c:IsSetCard(0x10e) or c:IsCode(5338223,7373632,8632967,14154221,24362891,25573054,34026662,34572613,62991886,64815084,74100225,77840540,88760522,93504463,10080420)) function c10080420.evolfilter(c)
return c:IsCode(10080420) --進化の到達点(「ジュラシックワールド」として扱うため実質「進化」カテゴリには含まれない)
or c:IsCode(5338223) --強制進化
or c:IsCode(88760522) --多様進化
or c:IsCode(25573054) --進化する翼
or c:IsCode(34026662) --進化の奇跡
or c:IsCode(77840540) --超進化の繭
or c:IsCode(8632967) --進化の宿命
or c:IsCode(14154221) --進化の代償
or c:IsCode(62991886) --進化する人類
or c:IsCode(24362891) --突然進化
or c:IsCode(64815084) --進化の分岐点
or c:IsCode(74100225) --進化の特異点
or c:IsCode(93504463) --進化への懸け橋
-- 以下、「進化」モンスター(実質「進化」カテゴリには含まれない)
or c:IsCode(44088292) --進化合獣ダイオーキシン
or c:IsCode(80476891) --進化合獣ヒュードラゴン
or c:IsCode(40240595) --進化の繭
or c:IsSetCard(0x10e)
or c:IsCode(7373632)
or c:IsCode(34572613)
end end
function c10080420.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp and c10080420.Isshinka(re:GetHandler())
end function c10080420.ctop2(e,tp,eg,ep,ev,re,r,rp)
function c10080420.spfilter(c,e,tp)
return c:IsSetCard(0x4e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c10080420.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:GetFlagEffect(10080420)>1 or Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c10080420.spfilter,tp,LOCATION_DECK,0,nil,e,tp) if Duel.IsExistingMatchingCard(c10080420.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and c:GetFlagEffect(10080421)<=1
if g:GetCount()<1 then and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(10080420,3)) then
Duel.ConfirmCards(1-tp,Duel.GetFieldGroup(tp,LOCATION_DECK,0)) Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(10080420,2))
return
end
Duel.Hint(HINT_CARD,0,10080420)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil) local g=Duel.SelectMatchingCard(tp,c10080420.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if not sg then return end Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) c:RegisterFlagEffect(10080421,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
c:RegisterFlagEffect(10080420,RESET_PHASE+PHASE_END,0,1) end
end end
function c10080420.xfilter(c,tp)
return c:IsSetCard(0x504e) and c:IsControler(tp) and c:GetSummonType()==SUMMON_TYPE_XYZ function c10080420.cfilter(c,tp)
return c:IsSetCard(0x504e) and c:GetPreviousControler()==tp and c:GetSummonType()==SUMMON_TYPE_XYZ
end end
function c10080420.thcon(e,tp,eg,ep,ev,re,r,rp) function c10080420.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c10080420.xfilter,1,nil,tp) return eg:IsExists(c10080420.cfilter,1,nil,tp)
end end
function c10080420.thfilter(c) function c10080420.thfilter(c)
return c10080420.Isshinka(c) and c:IsAbleToHand() return c10080420.evolfilter(c) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end end
function c10080420.thop(e,tp,eg,ep,ev,re,r,rp) function c10080420.drop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c10080420.thfilter,tp,LOCATION_DECK,0,nil) local c=e:GetHandler()
if g:GetCount()<1 then if Duel.IsExistingMatchingCard(c10080420.thfilter,tp,LOCATION_DECK,0,1,nil) and c:GetFlagEffect(10080420)<=1
Duel.ConfirmCards(1-tp,Duel.GetFieldGroup(tp,LOCATION_DECK,0)) and Duel.SelectYesNo(tp,aux.Stringid(10080420,1)) then
return
end
Duel.Hint(HINT_CARD,0,10080420)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil) local g=Duel.SelectMatchingCard(tp,c10080420.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if not sg then return end Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g)
Duel.ConfirmCards(1-tp,sg) c:RegisterFlagEffect(10080420,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end end
function c10080420.leavecon(e,tp,eg,ep,ev,re,r,rp)
function c10080420.spfilter(c,e,tp)
return (c:IsSetCard(0x304e) or c:IsSetCard(0x504e) or c:IsSetCard(0x604e)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c10080420.ctcon(e,tp,eg,ep,ev,re,r,rp)
if not re then return false end
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
and c10080420.evolfilter(re:GetHandler())
end
function c10080420.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and not c:IsLocation(LOCATION_DECK) if Duel.IsExistingMatchingCard(c10080420.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and c:GetFlagEffect(10080421)<=1
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(10080420,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c10080420.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
c:RegisterFlagEffect(10080421,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end end
function c10080420.leavefilter(c)
function c10080420.rfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() return c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end end
function c10080420.leaveop(e,tp,eg,ep,ev,re,r,rp) function c10080420.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,Duel.GetFieldGroup(tp,LOCATION_HAND,0)) if e:GetHandler():IsDisabled() then
local g=Duel.GetMatchingGroup(c10080420.leavefilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,nil) e:SetLabel(1)
else e:SetLabel(0) end
end
function c10080420.leave(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabelObject():GetLabel()==0 and c:GetPreviousControler()==tp and c:IsPreviousPosition(POS_FACEUP) then
local g=Duel.GetMatchingGroup(c10080420.rfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,nil)
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
end
end end
--影依回转 --影依の廻転
local m=111443942 function c111443942.initial_effect(c)
local cm=_G["c"..m] --Activate
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetCountLimit(1,111443942+EFFECT_COUNT_CODE_OATH)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH) e1:SetTarget(c111443942.target)
e1:SetCondition(cm.condition) e1:SetOperation(c111443942.operation)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--plus effect
if not c111443942.global_check then
c111443942.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(c111443942.sdop)
Duel.RegisterEffect(ge1,0)
end
end
function c111443942.filter(c)
return c:IsSetCard(0x9d) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsCode(111443942)
end
function c111443942.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c111443942.filter,tp,LOCATION_DECK,0,1,nil) end
end
function c111443942.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,111443942,RESET_PHASE+PHASE_END,0,1)
end end
function cm.actfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x9d) and not c:IsCode(m) function c111443942.cfilter(c,tp)
return c:GetPreviousControler()==tp
and (c:IsPreviousLocation(LOCATION_DECK) or c:GetSummonLocation()==LOCATION_DECK
or (c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK))
or c:IsLocation(LOCATION_DECK)) and not c:IsReason(REASON_DRAW)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function c111443942.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c111443942.cfilter,1,nil,tp)
end
function c111443942.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0) local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
return g:IsExists(cm.actfilter,1,nil) if g:GetCount()<=1 then return end
c:RegisterFlagEffect(111443942,RESET_PHASE+PHASE_END,0,1)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
function c111443942.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.actfilter,tp,0xff,0,nil) local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
for tc in aux.Next(g) do if g:GetCount()<=1 then return end
local e0=Effect.CreateEffect(c) if c:GetFlagEffect(111443942)~=0 and Duel.IsExistingMatchingCard(c111443942.filter,tp,LOCATION_DECK,0,2,nil) then
e0:SetType(EFFECT_TYPE_FIELD) local sg=Duel.GetMatchingGroup(c111443942.filter,tp,LOCATION_DECK,0,nil)
e0:SetCode(EFFECT_SPSUMMON_PROC_G) Duel.ConfirmCards(tp,sg)
e0:SetRange(LOCATION_DECK) c:ResetFlagEffect(111443942)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e0:SetReset(RESET_PHASE+PHASE_END)
tc:RegisterEffect(e0,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_ACTIVATE_COST)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCost(cm.costchk)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.actarget)
e1:SetOperation(cm.costop)
Duel.RegisterEffect(e1,tp)
local ae=tc:GetActivateEffect():Clone()
local con=ae:GetCondition()
ae:SetType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_ACTIVATE)
ae:SetCondition(cm.actcon(con))
ae:SetRange(LOCATION_DECK)
ae:SetReset(RESET_PHASE+PHASE_END)
tc:RegisterEffect(ae,true)
end end
end end
function cm.actcon(con)
return function(e,tp,eg,ep,ev,re,r,rp) function c111443942.sdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler():GetOwner()
return (not con or con(e,tp,eg,ep,ev,re,r,rp)) and c:IsSetCard(0x9d) and ((c:IsType(TYPE_TRAP) or (c:IsType(TYPE_SPELL) and c:IsType(TYPE_QUICKPLAY))) or (Duel.GetTurnPlayer()==tp and Duel.GetCurrentChain()==0 and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2))) and c:IsLocation(LOCATION_DECK) local g=Duel.GetMatchingGroup(c111443942.filter,c,LOCATION_DECK,LOCATION_DECK,nil)
local tc=g:GetFirst()
while tc do
if tc:GetFlagEffect(111443942)==0 then
local code=tc:GetOriginalCode()
local ae=tc:GetActivateEffect()
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(ae:GetCode())
e1:SetCategory(ae:GetCategory())
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+ae:GetProperty())
e1:SetRange(LOCATION_DECK)
e1:SetCountLimit(1,code+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c111443942.sfcon)
e1:SetTarget(c111443942.sftg)
e1:SetOperation(c111443942.sfop)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
--activate cost
local e2=Effect.CreateEffect(tc)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ACTIVATE_COST)
e2:SetRange(LOCATION_DECK)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_UNCOPYABLE)
e2:SetTargetRange(LOCATION_DECK,0)
e2:SetCost(c111443942.costchk)
e2:SetTarget(c111443942.costtg)
e2:SetOperation(c111443942.costop)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
tc:RegisterFlagEffect(111443942,RESET_EVENT+0x1fe0000,0,1)
end
tc=g:GetNext()
end end
end end
function cm.cfilter(c)
--deck activate
function c111443942.sfcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,111443942)>0 and Duel.GetFlagEffect(tp,e:GetHandler():GetOriginalCode())==0
end
function c111443942.sftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ae=e:GetHandler():GetActivateEffect()
local fcon=ae:GetCondition()
local fcos=ae:GetCost()
local ftg=ae:GetTarget()
if chk==0 then
return (not fcon or fcon(e,tp,eg,ep,ev,re,r,rp))
and (not fcos or fcos(e,tp,eg,ep,ev,re,r,rp,0))
and (not ftg or ftg(e,tp,eg,ep,ev,re,r,rp,0))
and e:GetHandler():IsSetCard(0x9d) and e:GetHandler():IsType(TYPE_SPELL+TYPE_TRAP)
end
if fcos then
fcos(e,tp,eg,ep,ev,re,r,rp,1)
end
if ftg then
ftg(e,tp,eg,ep,ev,re,r,rp,1)
end
Duel.RegisterFlagEffect(tp,e:GetHandler():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1)
end
function c111443942.sfop(e,tp,eg,ep,ev,re,r,rp)
local ae=e:GetHandler():GetActivateEffect()
local fop=ae:GetOperation()
if fop then
fop(e,tp,eg,ep,ev,re,r,rp)
end
end
--activate field
function c111443942.costfilter(c)
return c:IsSetCard(0x9d) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() return c:IsSetCard(0x9d) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end end
function cm.costchk(e,te_or_c,tp) function c111443942.costchk(e,te_or_c,tp)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE,0,1,nil) local tp=e:GetHandler():GetControler()
return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c111443942.costfilter,tp,LOCATION_GRAVE,0,1,nil)
end end
function cm.actarget(e,te,tp) function c111443942.costtg(e,te,tp)
local tc=te:GetHandler() e:SetLabelObject(te)
e:SetLabelObject(tc) return te:GetHandler():IsLocation(LOCATION_DECK) and te:GetHandler()==e:GetHandler()
return cm.actfilter(tc) and tc:IsLocation(LOCATION_DECK)
end end
function cm.costop(e,tp,eg,ep,ev,re,r,rp) function c111443942.costop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local c=e:GetHandler()
if Duel.GetFlagEffect(tp,tc:GetCode()+1)>0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c111443942.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,2,REASON_EFFECT) local te=e:GetLabelObject()
end Duel.SendtoDeck(g,nil,0,REASON_EFFECT)
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.RegisterFlagEffect(tp,tc:GetCode()+1,RESET_PHASE+PHASE_END,0,1) c:CreateEffectRelation(te)
local e1=Effect.CreateEffect(tc) local ev0=Duel.GetCurrentChain()+1
e1:SetType(EFFECT_TYPE_FIELD) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(1,0) e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetValue(cm.aclimit) e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(c111443942.rsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
end
end end
function cm.aclimit(e,re,tp) function c111443942.rsop(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsLocation(LOCATION_DECK) and re:GetHandler():IsCode(e:GetHandler():GetCode()) local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
end
end end
--煉獄の癇魃
function c113482285.initial_effect(c) function c113482285.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_DECKDES+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,113482285+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,113482285+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c113482285.target) e1:SetTarget(c113482285.target)
e1:SetOperation(c113482285.activate) e1:SetOperation(c113482285.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--sset
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c113482285.setop) e2:SetTarget(c113482285.sstg)
e2:SetOperation(c113482285.ssop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_HAND+LOCATION_GRAVE,LOCATION_HAND+LOCATION_GRAVE)
e3:SetTarget(c113482285.efftg)
e3:SetCode(113482285) e3:SetCode(113482285)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--plus effect
if not c113482285.global_check then
c113482285.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(c113482285.sdop)
Duel.RegisterEffect(ge1,0)
end
end end
function c113482285.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,6) end --change summon condition
local emc=Duel.GetMatchingGroup
Duel.GetMatchingGroup=function(filter,tp,location,locationed,card,args1,args2,args3,args4,args5,args6,args7,args8)
if Duel.IsPlayerAffectedByEffect(tp,113482285) and card~=nil and locationed==0 and (location==LOCATION_GRAVE+LOCATION_HAND or location==LOCATION_GRAVE+LOCATION_HAND+LOCATION_MZONE)
and card:IsSetCard(0xbb) then
return Group.CreateGroup()
else
return emc(filter,tp,location,locationed,card,args1,args2,args3,args4,args5,args6,args7,args8)
end
end end
function c113482285.filter(c) function c113482285.filter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c113482285.thfilter(c)
return (c:IsSetCard(0xc5) or c:IsSetCard(0xbb)) and c:IsAbleToHand()
end end
function c113482285.rthfilter(c) function c113482285.target(e,tp,eg,ep,ev,re,r,rp,chk)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>5
end and Duel.IsExistingMatchingCard(c113482285.filter,tp,LOCATION_DECK,0,1,nil) end
function c113482285.tgfilter(c)
return c:IsSetCard(0xbb) and c:IsAbleToGrave()
end
function c113482285.filter0(c)
return c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function c113482285.filter1(c,e)
return c:IsCanBeFusionMaterial() and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
function c113482285.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0xbb) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function c113482285.activate(e,tp,eg,ep,ev,re,r,rp) function c113482285.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
if not Duel.IsPlayerCanDiscardDeck(tp,6) then return end
local n=0
Duel.ConfirmDecktop(tp,6) Duel.ConfirmDecktop(tp,6)
local g=Duel.GetDecktopGroup(tp,6) local g=Duel.GetDecktopGroup(tp,6):Filter(c113482285.filter,nil)
local sg=g:Filter(c113482285.filter,nil) Duel.SendtoGrave(g,REASON_EFFECT)
if sg:GetCount()>0 then Duel.ShuffleDeck(tp)
n=Duel.SendtoGrave(sg,REASON_EFFECT+REASON_REVEAL) --search
end local hg=Duel.GetMatchingGroup(c113482285.thfilter,tp,LOCATION_DECK,0,nil)
local o1=Duel.GetMatchingGroup(c113482285.thfilter,tp,LOCATION_DECK,0,nil) if g:GetCount()>0 and hg:GetCount()>0 then
if n>=1 and o1:GetCount()>0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local s1=o1:Select(tp,1,1,nil) local thg=hg:Select(tp,1,1,nil)
if s1:GetCount()>0 then Duel.SendtoHand(thg,nil,REASON_EFFECT)
Duel.SendtoHand(s1,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,thg)
Duel.ConfirmCards(1-tp,s1)
end
end end
local o2=Duel.GetMatchingGroup(c113482285.rthfilter,tp,0,LOCATION_ONFIELD,nil) --Bounce
if n>=2 and o2:GetCount()>0 then local bg=Duel.GetMatchingGroup(c113482285.mtfilter,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()>1 and bg:GetCount()>0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local s2=o2:Select(tp,1,2,nil) local tbg=bg:Select(tp,1,2,nil)
if s2:GetCount()>0 then Duel.HintSelection(tbg)
Duel.SendtoHand(s2,nil,REASON_EFFECT) Duel.SendtoHand(tbg,nil,REASON_EFFECT)
end
end end
if n>=3 then --monster effect
if g:GetCount()>2 then
Duel.BreakEffect() Duel.BreakEffect()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -85,28 +89,15 @@ function c113482285.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -85,28 +89,15 @@ function c113482285.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
local o3=Duel.GetMatchingGroup(c113482285.tgfilter,tp,LOCATION_DECK,0,nil) --tograve
if n>=4 and o3:GetCount()>0 then local tg=Duel.GetMatchingGroup(c113482285.filter,tp,LOCATION_DECK,0,nil)
Duel.BreakEffect() if g:GetCount()>3 and tg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local s3=o3:Select(tp,1,4,nil) local tsg=tg:Select(tp,1,4,nil)
if s3:GetCount()>0 then Duel.SendtoGrave(tsg,REASON_EFFECT)
Duel.SendtoGrave(s3,REASON_EFFECT)
end local chkf=tp
local chkf=Duel.GetLocationCountFromEx(tp)>0 and PLAYER_NONE or tp local mg1=Duel.GetMatchingGroup(c113482285.filter1,tp,LOCATION_GRAVE+LOCATION_HAND,0,nil,e)
local mg1=Duel.GetMatchingGroup(c113482285.filter0,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil)
local res=Duel.IsExistingMatchingCard(c113482285.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c113482285.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
if n>0 and res and Duel.SelectYesNo(tp,aux.Stringid(113482285,0)) then
Duel.BreakEffect()
local sg1=Duel.GetMatchingGroup(c113482285.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local sg1=Duel.GetMatchingGroup(c113482285.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil local mg2=nil
local sg2=nil local sg2=nil
...@@ -117,14 +108,14 @@ function c113482285.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -117,14 +108,14 @@ function c113482285.activate(e,tp,eg,ep,ev,re,r,rp)
local mf=ce:GetValue() local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c113482285.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf) sg2=Duel.GetMatchingGroup(c113482285.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then if (sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0)) and Duel.SelectYesNo(tp,aux.Stringid(113482285,3)) then
Duel.BreakEffect()
local sg=sg1:Clone() local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil) local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf) local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1) tc:SetMaterial(mat1)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
...@@ -138,18 +129,131 @@ function c113482285.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -138,18 +129,131 @@ function c113482285.activate(e,tp,eg,ep,ev,re,r,rp)
tc:CompleteProcedure() tc:CompleteProcedure()
end end
end end
end end
function c113482285.thfilter(c)
return (c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER)) or (c:IsSetCard(0xc5) and c:IsType(TYPE_SPELL+TYPE_TRAP)) and c:IsAbleToHand()
end
function c113482285.mtfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end end
function c113482285.actlimit(e,re,tp) function c113482285.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsImmuneToEffect(e)
end end
function c113482285.setop(e,tp,eg,ep,ev,re,r,rp) function c113482285.filter1(c,e)
return c:IsCanBeFusionMaterial() and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
function c113482285.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0xbb) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
end
function c113482285.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
end
function c113482285.ssop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then if c:IsRelateToEffect(e) and c:IsSSetable() then
Duel.ChangePosition(c,POS_FACEDOWN) Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end end
end end
function c113482285.efftg(e,c)
return c:IsSetCard(0xbb) function c113482285.iffilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and not c:IsCode(82734805,58446973)
end
function c113482285.sdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler():GetOwner()
local g=Duel.GetMatchingGroup(c113482285.iffilter,c,LOCATION_GRAVE+LOCATION_HAND,LOCATION_GRAVE+LOCATION_HAND,nil)
local tc=g:GetFirst()
while tc do
if tc:GetFlagEffect(113482285)==0 then
local code=tc:GetOriginalCode()
--special summon
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCondition(c113482285.spcon)
e1:SetOperation(c113482285.spop)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(113482285,RESET_EVENT+0x1fe0000,0,1)
end
tc=g:GetNext()
end
end
function c113482285.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER)
and ((c:IsAbleToRemoveAsCost() and c:IsLocation(LOCATION_HAND+LOCATION_MZONE)) or (c:IsFaceup() and c:IsLocation(LOCATION_REMOVED)))
end
function c113482285.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
if not Duel.IsPlayerAffectedByEffect(tp,113482285) then return false end
local lv=c:GetOriginalLevel()
if c:IsLocation(LOCATION_GRAVE) and lv<5 then return false end
local count=0
if lv>8 then count=3 elseif lv>4 then count=2 else count=1 end
local sum=0
for i=0,4 do
local tc=Duel.GetFieldCard(tp,LOCATION_MZONE,i)
if tc and tc:IsFaceup() and tc:IsType(TYPE_EFFECT) then
if tc:IsType(TYPE_XYZ) then sum=sum+tc:GetRank()
else sum=sum+tc:GetLevel() end
end
end
if sum>8 then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-2 then return false end
if c:IsHasEffect(34822850) then
if ft>0 then
return Duel.IsExistingMatchingCard(c113482285.spfilter,tp,LOCATION_MZONE+LOCATION_REMOVED+LOCATION_HAND,0,count,c)
else
local ct=-ft+1
return Duel.IsExistingMatchingCard(c113482285.spfilter,tp,LOCATION_MZONE,0,ct,nil)
and Duel.IsExistingMatchingCard(c113482285.spfilter,tp,LOCATION_MZONE+LOCATION_REMOVED+LOCATION_HAND,0,count,c)
end
else
return ft>0 and Duel.IsExistingMatchingCard(c113482285.spfilter,tp,LOCATION_REMOVED+LOCATION_HAND,0,count,c)
end
end
function c113482285.spop(e,tp,eg,ep,ev,re,r,rp,c)
local lv=c:GetOriginalLevel()
if c:IsLocation(LOCATION_GRAVE) and lv<5 then return false end
local count=0
if lv>8 then count=3 elseif lv>4 then count=2 else count=1 end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=nil
if c:IsHasEffect(34822850) then
if ft>0 then
g=Duel.SelectMatchingCard(tp,c113482285.spfilter,tp,LOCATION_MZONE+LOCATION_REMOVED+LOCATION_HAND,0,count,count,c)
else
local sg=Duel.GetMatchingGroup(c113482285.spfilter,tp,LOCATION_MZONE+LOCATION_REMOVED+LOCATION_HAND,0,c)
local ct=-ft+1
g=sg:FilterSelect(tp,Card.IsLocation,ct,ct,nil,LOCATION_MZONE)
if ct<count then
sg:Sub(g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=sg:Select(tp,count-ct,count-ct,nil)
g:Merge(g2)
end
end
else
g=Duel.SelectMatchingCard(tp,c113482285.spfilter,tp,LOCATION_REMOVED+LOCATION_HAND,0,count,count,c)
end
local rg=Group.CreateGroup()
local sg=Group.CreateGroup()
local tc=g:GetFirst()
while tc do
if tc:IsLocation(LOCATION_REMOVED) then
rg:AddCard(tc)
else
sg:AddCard(tc)
end
tc=g:GetNext()
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
Duel.SendtoGrave(rg,REASON_COST+REASON_RETURN)
end end
...@@ -33,12 +33,6 @@ function c114303426.initial_effect(c) ...@@ -33,12 +33,6 @@ function c114303426.initial_effect(c)
e4:SetTarget(c114303426.actarget) e4:SetTarget(c114303426.actarget)
e4:SetOperation(c114303426.costop) e4:SetOperation(c114303426.costop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_SPSUMMON_PROC_G)
e5:SetRange(LOCATION_DECK)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
c:RegisterEffect(e5)
end end
function c114303426.cfilter(c,tp) function c114303426.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:GetPreviousControler()==tp and c:IsSetCard(0xaa) return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:GetPreviousControler()==tp and c:IsSetCard(0xaa)
...@@ -94,11 +88,36 @@ function c114303426.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -94,11 +88,36 @@ function c114303426.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c114303426.actarget(e,te,tp) function c114303426.actarget(e,te,tp)
e:SetLabelObject(te)
return te:GetHandler()==e:GetHandler() return te:GetHandler()==e:GetHandler()
end end
function c114303426.costop(e,tp,eg,ep,ev,re,r,rp) function c114303426.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=e:GetHandler() local c=e:GetHandler()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(c114303426.rsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
end
function c114303426.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
end
end end
function c114303426.condition2(e,tp,eg,ep,ev,re,r,rp) function c114303426.condition2(e,tp,eg,ep,ev,re,r,rp)
return c114303426.condition(e,tp,eg,ep,ev,re,r,rp) and not Duel.IsExistingMatchingCard(aux.NOT(Card.IsSetCard),tp,LOCATION_EXTRA,0,1,nil,0xaa) return c114303426.condition(e,tp,eg,ep,ev,re,r,rp) and not Duel.IsExistingMatchingCard(aux.NOT(Card.IsSetCard),tp,LOCATION_EXTRA,0,1,nil,0xaa)
......
--マドルチェ・ビスコンティ
function c114431144.initial_effect(c) function c114431144.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,3,2) aux.AddXyzProcedure(c,nil,3,2)
c:EnableReviveLimit() c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(114431144,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetDescription(aux.Stringid(114431144,0))
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCost(c114431144.cost) e1:SetRange(LOCATION_MZONE)
e1:SetCost(c114431144.spcost)
e1:SetTarget(c114431144.sptg) e1:SetTarget(c114431144.sptg)
e1:SetOperation(c114431144.spop) e1:SetOperation(c114431144.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--material
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(114431144,1)) e2:SetDescription(aux.Stringid(114431144,1))
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
...@@ -19,32 +23,36 @@ function c114431144.initial_effect(c) ...@@ -19,32 +23,36 @@ function c114431144.initial_effect(c)
e2:SetTarget(c114431144.mttg) e2:SetTarget(c114431144.mttg)
e2:SetOperation(c114431144.mtop) e2:SetOperation(c114431144.mtop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--spsummon grave
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,114431144) e3:SetCountLimit(1,114431144)
e3:SetTarget(c114431144.hsptg) e3:SetTarget(c114431144.grtg)
e3:SetOperation(c114431144.hspop) e3:SetOperation(c114431144.grop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--spsummon extra
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_EXTRA)
e4:SetCode(EVENT_FREE_CHAIN) e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1,144311441) e4:SetRange(LOCATION_EXTRA)
e4:SetCost(c114431144.cost2) e4:SetCountLimit(1,114431145)
e4:SetTarget(c114431144.target2) e4:SetCost(c114431144.excost)
e4:SetOperation(c114431144.operation2) e4:SetTarget(c114431144.extg)
e4:SetOperation(c114431144.exop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c114431144.cost(e,tp,eg,ep,ev,re,r,rp,chk)
function c114431144.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function c114431144.spfilter(c,e,tp) function c114431144.spfilter(c,e,tp)
return c:IsSetCard(0x71) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) return c:IsSetCard(0x71) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c114431144.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c114431144.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
...@@ -60,79 +68,90 @@ function c114431144.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,79 +68,90 @@ function c114431144.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function c114431144.mtfilter(c,sc)
return c:IsSetCard(0x71) and c:IsType(TYPE_MONSTER) and c:IsCanBeXyzMaterial(sc) function c114431144.mtfilter(c)
return c:IsSetCard(0x71) and c:IsType(TYPE_MONSTER)
end end
function c114431144.mttg(e,tp,eg,ep,ev,re,r,rp,chk) function c114431144.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() if chk==0 then return e:GetHandler():IsType(TYPE_XYZ)
if chk==0 then return c:IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(c114431144.mtfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,c) end and Duel.IsExistingMatchingCard(c114431144.mtfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function c114431144.mtop(e,tp,eg,ep,ev,re,r,rp) function c114431144.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c114431144.mtfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c114431144.mtfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Overlay(c,g) Duel.Overlay(c,g)
end end
end end
function c114431144.mtfilter2(c,sc)
return c:IsFaceup() and c:IsSetCard(0x71) and c:IsType(TYPE_MONSTER) and c:IsCanBeXyzMaterial(sc) function c114431144.grfilter(c)
return c:IsFaceup() and c:IsSetCard(0x71) and not c:IsType(TYPE_TOKEN)
end end
function c114431144.hsptg(e,tp,eg,ep,ev,re,r,rp,chk) function c114431144.grtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_MZONE) and c114431144.grfilter(chkc,tp) end
if chkc then return chkc:IsOnField() and c114431144.mtfilter2(chkc,c) end if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
if chk==0 then return Duel.IsExistingTarget(c114431144.mtfilter2,tp,LOCATION_MZONE,0,1,nil,c) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) and Duel.IsExistingTarget(c114431144.grfilter,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.SelectTarget(tp,c114431144.mtfilter2,tp,LOCATION_MZONE,0,1,1,nil,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SelectTarget(tp,c114431144.grfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function c114431144.hspop(e,tp,eg,ep,ev,re,r,rp) function c114431144.grop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0
and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local og=tc:GetOverlayGroup() local og=tc:GetOverlayGroup()
if og:GetCount()>0 then if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE) Duel.SendtoGrave(og,REASON_RULE)
end end
Duel.Overlay(c,tc) Duel.Overlay(c,Group.FromCards(tc))
end end
end end
function c114431144.filter2(c)
return c:IsSetCard(0x71) and c:IsAbleToDeckAsCost() function c114431144.exfilter(c)
return c:IsSetCard(0x71) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost()
end end
function c114431144.filter3(c) function c114431144.defilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost() return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost()
end end
function c114431144.cost2(e,tp,eg,ep,ev,re,r,rp,chk) function c114431144.excost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() if chk==0 then return Duel.IsExistingMatchingCard(c114431144.exfilter,tp,LOCATION_HAND,0,1,nil)
local g1=Duel.GetMatchingGroup(c114431144.filter2,tp,LOCATION_HAND,0,nil) and Duel.IsExistingMatchingCard(c114431144.defilter,tp,0,LOCATION_MZONE,1,nil) end
local g2=Duel.GetMatchingGroup(c114431144.filter3,tp,0,LOCATION_MZONE,nil) Duel.ConfirmCards(1-tp,e:GetHandler())
if chk==0 then return g1:GetCount()>0 and g2:GetCount()>0 end
Duel.ConfirmCards(1-tp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=g1:Select(tp,1,1,nil) local g1=Duel.SelectMatchingCard(tp,c114431144.exfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,tg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
tg:Merge(g2:Select(tp,1,1,nil)) local g2=Duel.SelectMatchingCard(tp,c114431144.defilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SendtoDeck(tg,nil,2,REASON_COST) g1:Merge(g2)
Duel.ConfirmCards(1-tp,g1:GetFirst())
Duel.SendtoDeck(g1,nil,2,REASON_COST)
end end
function c114431144.target2(e,tp,eg,ep,ev,re,r,rp,chk) function c114431144.pdfilter(c,e,tp,xyzc)
local c=e:GetHandler() return c:IsCode(74641045) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanBeXyzMaterial(xyzc)
local g3=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,74641045)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2) and g3:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g3:GetFirst():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,true,true,POS_FACEUP) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g3:GetFirst(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end end
function c114431144.operation2(e,tp,eg,ep,ev,re,r,rp) function c114431144.extg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.IsExistingMatchingCard(c114431144.pdfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,c)
and Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCountFromEx(tp,tp,nil,e:GetHandler())>0
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c114431144.exop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g3=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,74641045) if not c:IsRelateToEffect(e) then return end
if not (g3:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,true,true,POS_FACEUP)) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) if Duel.GetLocationCountFromEx(tp,tp,nil,c)<=0 then return end
local tc=g3:Select(tp,1,1,nil):GetFirst() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==1 then local g=Duel.SelectMatchingCard(tp,c114431144.pdfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,c)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
c:SetMaterial(Group.FromCards(tc)) c:SetMaterial(Group.FromCards(tc))
Duel.Overlay(c,Group.FromCards(tc)) Duel.Overlay(c,Group.FromCards(tc))
Duel.SpecialSummon(c,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
......
--EMファンタズム・マジシャン
function c114562761.initial_effect(c) function c114562761.initial_effect(c)
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsType,TYPE_PENDULUM),4,2,nil,nil,99,nil) --xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsType,TYPE_PENDULUM),4,2,nil,nil,5)
c:EnableReviveLimit() c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c,false) aux.EnablePendulumAttribute(c,false)
--pendulum set
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_PZONE) e1:SetCode(EVENT_DESTROYED)
e1:SetCountLimit(1) e1:SetRange(LOCATION_EXTRA)
e1:SetTarget(c114562761.pctg) e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetOperation(c114562761.pcop) e1:SetCondition(c114562761.condition)
e1:SetTarget(c114562761.target)
e1:SetOperation(c114562761.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--salvage
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE) e2:SetRange(LOCATION_PZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e2:SetCountLimit(1,114562761)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetTarget(c114562761.sltg)
e2:SetTargetRange(1,1) e2:SetOperation(c114562761.slop)
e2:SetTarget(c114562761.splimit)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--not pendulum
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_IMMUNE_EFFECT) e3:SetRange(LOCATION_PZONE)
e3:SetRange(LOCATION_MZONE) e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCondition(c114562761.indcon) e3:SetTargetRange(1,1)
e3:SetValue(c114562761.imvalue) e3:SetTarget(c114562761.splimit)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--immune
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EVENT_SPSUMMON_SUCCESS) e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetCondition(c114562761.effcon) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetTarget(c114562761.efftg) e4:SetRange(LOCATION_MZONE)
e4:SetOperation(c114562761.effop) e4:SetCondition(c114562761.efcon)
e4:SetValue(c114562761.efilter)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--xyz charge
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DISABLE) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetCode(EVENT_CHAINING) e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetRange(LOCATION_MZONE) e5:SetCondition(c114562761.thcon)
e5:SetCost(c114562761.cost) e5:SetTarget(c114562761.thtg)
e5:SetCondition(c114562761.discon) e5:SetOperation(c114562761.thop)
e5:SetTarget(c114562761.distg)
e5:SetOperation(c114562761.disop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--negate
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e6:SetCategory(CATEGORY_NEGATE)
e6:SetCode(EVENT_DESTROYED) e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e6:SetCode(EVENT_CHAINING)
e6:SetRange(LOCATION_EXTRA) e6:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e6:SetCondition(c114562761.spcon1) e6:SetRange(LOCATION_MZONE)
e6:SetTarget(c114562761.sptg1) e6:SetCondition(c114562761.ngcon)
e6:SetOperation(c114562761.spop1) e6:SetCost(c114562761.ngcost)
e6:SetTarget(c114562761.ngtg)
e6:SetOperation(c114562761.ngop)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
c114562761.pendulum_level=4 c114562761.pendulum_level=4
function c114562761.pcfilter(c) function c114562761.cfilter(c,tp)
return c:IsType(TYPE_PENDULUM) and c:IsRace(RACE_SPELLCASTER) and not c:IsForbidden() return c:IsPreviousLocation(LOCATION_PZONE) and c:GetPreviousControler()==tp
and c:IsSetCard(0x9f) and not c:IsCode(114562761)
end
function c114562761.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c114562761.cfilter,1,nil,tp)
end end
function c114562761.pctg(e,tp,eg,ep,ev,re,r,rp,chk) function c114562761.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c114562761.pcfilter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return not e:GetHandler():IsPublic()
and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) end
Duel.ConfirmCards(1-tp,e:GetHandler())
end end
function c114562761.pcop(e,tp,eg,ep,ev,re,r,rp) function c114562761.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.SelectMatchingCard(tp,c114562761.pcfilter,tp,LOCATION_GRAVE,0,1,1,nil) if not (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then return end
if g:GetCount()>0 then Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
Duel.SendtoExtraP(g,tp,REASON_EFFECT) end
function c114562761.filter(c)
return c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_PENDULUM)
end
function c114562761.sltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c114562761.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c114562761.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c114562761.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c114562761.slop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.SendtoExtraP(tc,nil,REASON_EFFECT)
end end
end end
function c114562761.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return bit.band(sumtype,SUMMON_TYPE_PENDULUM)~=SUMMON_TYPE_PENDULUM function c114562761.splimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_PENDULUM)~=SUMMON_TYPE_PENDULUM
end end
function c114562761.indcon(e)
function c114562761.efcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayCount()>0 return e:GetHandler():GetOverlayCount()>0
end end
function c114562761.imvalue(e,re) function c114562761.efilter(e,te)
return not re:IsActiveType(TYPE_PENDULUM) return not te:IsActiveType(TYPE_PENDULUM)
end end
function c114562761.effcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM) function c114562761.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_PENDULUM
end end
function c114562761.efffilter(c) function c114562761.thfilter(c)
return c:IsSetCard(0x9f) and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x9f)
end end
function c114562761.efftg(e,tp,eg,ep,ev,re,r,rp,chk) function c114562761.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) if chk==0 then return Duel.IsExistingMatchingCard(c114562761.thfilter,tp,LOCATION_GRAVE,0,2,nil) end
and Duel.IsExistingMatchingCard(c114562761.efffilter,tp,LOCATION_GRAVE,0,1,nil) end
end end
function c114562761.effop(e,tp,eg,ep,ev,re,r,rp) function c114562761.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c114562761.efffilter,tp,LOCATION_GRAVE,0,1,2,nil) local g=Duel.SelectMatchingCard(tp,c114562761.thfilter,tp,LOCATION_GRAVE,0,2,2,nil)
local tc=g:GetFirst()
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Overlay(c,g) while tc do
Duel.Overlay(e:GetHandler(),tc)
tc=g:GetNext()
end end
end
end
function c114562761.ngcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and not re:IsActiveType(TYPE_PENDULUM)
and not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end end
function c114562761.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c114562761.ngcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function c114562761.discon(e,tp,eg,ep,ev,re,r,rp) function c114562761.ngtg(e,tp,eg,ep,ev,re,r,rp,chk)
return re:IsActiveType(TYPE_MONSTER) and not re:IsActiveType(TYPE_PENDULUM) and Duel.IsChainDisablable(ev) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end
function c114562761.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c114562761.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c114562761.cfilter(c,tp)
return not c:IsCode(114562761) and c:IsSetCard(0x9f) and c:IsPreviousLocation(LOCATION_SZONE) and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp
end end
function c114562761.spcon1(e,tp,eg,ep,ev,re,r,rp) function c114562761.ngop(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFacedown() and eg:IsExists(c114562761.cfilter,1,nil,tp) Duel.NegateActivation(ev)
end
function c114562761.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function c114562761.spop1(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
local c=e:GetHandler()
Duel.ConfirmCards(1-tp,c)
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end end
--十二獣の相生
function c114606001.initial_effect(c) function c114606001.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c114606001.target) e1:SetTarget(c114606001.target)
e1:SetOperation(c114606001.operation) e1:SetOperation(c114606001.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--material
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE) e2:SetCode(EVENT_TO_GRAVE)
e2:SetCost(c114606001.thcost) e2:SetCondition(c114606001.matcon)
e2:SetTarget(c114606001.thtg) e2:SetTarget(c114606001.mattg)
e2:SetOperation(c114606001.thop) e2:SetOperation(c114606001.matop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e8=Effect.CreateEffect(c) --tohand
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) local e3=Effect.CreateEffect(c)
e8:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e3:SetCategory(CATEGORY_TOHAND)
e8:SetCode(EVENT_TO_GRAVE) e3:SetType(EFFECT_TYPE_IGNITION)
e8:SetCondition(c114606001.thcon) e3:SetRange(LOCATION_GRAVE)
e8:SetTarget(c114606001.mattg) e3:SetCost(c114606001.thcost)
e8:SetOperation(c114606001.matop) e3:SetTarget(c114606001.thtg)
c:RegisterEffect(e8) e3:SetOperation(c114606001.thop)
c:RegisterEffect(e3)
end end
function c114606001.filter(c,e,tp) function c114606001.filter(c,e,tp)
return c:IsSetCard(0xf1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0xf1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c114606001.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c114606001.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c114606001.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c114606001.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c114606001.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c114606001.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c114606001.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c114606001.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end end
function c114606001.eqlimit(e,c)
return e:GetOwner()==c
end
function c114606001.operation(e,tp,eg,ep,ev,re,r,rp) function c114606001.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end
Duel.Equip(tp,c,tc) Duel.Equip(tp,c,tc)
--Add Equip limit
local e1=Effect.CreateEffect(tc) local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c114606001.eqlimit) e1:SetValue(c114606001.eqlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
end end
function c114606001.eqlimit(e,c)
return e:GetOwner()==c function c114606001.matcon(e,tp,eg,ep,ev,re,r,rp)
end
function c114606001.cfilter(c)
return c:IsSetCard(0xf1) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c114606001.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local loc=LOCATION_HAND
if Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)==12 then loc=loc+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c114606001.cfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c114606001.cfilter,tp,loc,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function c114606001.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c114606001.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
function c114606001.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsReason(REASON_LOST_TARGET) and c:GetPreviousEquipTarget():IsLocation(LOCATION_OVERLAY) local tc=c:GetPreviousEquipTarget()
return c:IsReason(REASON_LOST_TARGET) and c:IsReason(REASON_DESTROY) and tc:IsLocation(LOCATION_OVERLAY)
end end
function c114606001.matfilter(c) function c114606001.matfilter(c)
return c:IsFaceup() and c:IsSetCard(0xf1) and c:IsType(TYPE_XYZ) return c:IsFaceup() and c:IsSetCard(0xf1) and c:IsType(TYPE_XYZ)
...@@ -93,3 +81,30 @@ function c114606001.matop(e,tp,eg,ep,ev,re,r,rp) ...@@ -93,3 +81,30 @@ function c114606001.matop(e,tp,eg,ep,ev,re,r,rp)
Duel.Overlay(tc,Group.FromCards(c)) Duel.Overlay(tc,Group.FromCards(c))
end end
end end
function c114606001.cfilter(c)
return c:IsSetCard(0xf1) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c114606001.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)==12 then
local g=Duel.GetMatchingGroup(c114606001.cfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil)
if chk==0 then return g:GetCount()>0 end
local tg=g:Select(tp,1,1,nil)
Duel.SendtoGrave(tg,REASON_COST)
else
local g=Duel.GetMatchingGroup(c114606001.cfilter,tp,LOCATION_HAND,0,nil)
if chk==0 then return g:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=g:Select(tp,1,1,nil)
Duel.SendtoGrave(tg,REASON_COST)
end
end
function c114606001.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c114606001.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
--遗式世传的神判预 --リチュアに伝わりし神判の予
function c114644893.initial_effect(c) function c114644893.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCountLimit(1,114644893+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,114644893+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c114644893.target) e1:SetTarget(c114644893.target)
e1:SetOperation(c114644893.activate) e1:SetOperation(c114644893.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c114644893.thfilter(c) function c114644893.filter(c)
return c:IsSetCard(0x3a) and not c:IsCode(114644893) and c:IsAbleToHand() return c:IsSetCard(0x3a) and c:GetCode()~=114644893 and c:IsAbleToHand()
end end
function c114644893.target(e,tp,eg,ep,ev,re,r,rp,chk) function c114644893.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c114644893.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c114644893.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c114644893.activate(e,tp,eg,ep,ev,re,r,rp) function c114644893.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c114644893.thfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c114644893.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
...@@ -51,7 +51,7 @@ function c114644893.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,7 +51,7 @@ function c114644893.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetLabelObject(e3) e2:SetLabelObject(e3)
end end
function c114644893.regcon(e,tp,eg,ep,ev,re,r,rp) function c114644893.regcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_RITUAL) return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and re:IsActiveType(TYPE_RITUAL)
end end
function c114644893.regop1(e,tp,eg,ep,ev,re,r,rp) function c114644893.regop1(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabelObject():GetLabel() local ct=e:GetLabelObject():GetLabel()
...@@ -65,24 +65,19 @@ end ...@@ -65,24 +65,19 @@ end
function c114644893.effcon(e,tp,eg,ep,ev,re,r,rp) function c114644893.effcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabel()>0 return e:GetLabel()>0
end end
function c114644893.sfilter(c)
return c:IsSetCard(0x3a) and c:GetCode()~=114644893 and c:IsAbleToHand() function c114644893.rtfilter(c,e,tp,m,ft)
end
function c114644893.dfilter(c)
return c:IsSetCard(0x3a) and c:IsAbleToGrave()
end
function c114644893.filter(c,e,tp,m1,m2,ft)
if not c:IsAttribute(ATTRIBUTE_WATER) or bit.band(c:GetType(),0x81)~=0x81 if not c:IsAttribute(ATTRIBUTE_WATER) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c) local m2=Duel.GetMatchingGroup(c114644893.mfilter,tp,LOCATION_DECK,0,c,c:GetLevel())
m2=m2:Filter(Card.IsCanBeRitualMaterial,c,c) local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if c:IsCode(21105106) then return c:ritual_custom_condition(mg,ft) end local mg2=m2:Filter(Card.IsCanBeRitualMaterial,c,c)
if c.mat_filter then if c.mat_filter then
mg=mg:Filter(c.mat_filter,nil) mg=mg:Filter(c.mat_filter,nil)
mg2=mg2:Filter(c.mat_filter,nil)
end end
if ft>0 then if ft>0 then
return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c) return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c) or mg2:GetCount()>0
or m2:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,1,c)
else else
return ft>-1 and mg:IsExists(c114644893.mfilterf,1,nil,tp,mg,c) return ft>-1 and mg:IsExists(c114644893.mfilterf,1,nil,tp,mg,c)
end end
...@@ -93,47 +88,43 @@ function c114644893.mfilterf(c,tp,mg,rc) ...@@ -93,47 +88,43 @@ function c114644893.mfilterf(c,tp,mg,rc)
return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),0,99,rc) return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),0,99,rc)
else return false end else return false end
end end
function c114644893.mfilter(c,lv)
return c:IsSetCard(0x3a) and c:IsType(TYPE_MONSTER) and (c:GetLevel()==lv or c:IsCode(29888389,47106439,38356857)) and c:IsAbleToGrave()
end
function c114644893.effop(e,tp,eg,ep,ev,re,r,rp) function c114644893.effop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,114644893) Duel.Hint(HINT_CARD,0,114644893)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c114644893.sfilter,tp,LOCATION_DECK,0,1,e:GetLabel(),nil) local g=Duel.SelectMatchingCard(tp,c114644893.filter,tp,LOCATION_DECK,0,1,e:GetLabel(),nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
--ritual
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local dg=Duel.GetMatchingGroup(c114644893.dfilter,tp,LOCATION_DECK,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>-1 and Duel.IsExistingMatchingCard(c114644893.filter,tp,LOCATION_DECK,0,1,nil,e,tp,mg,dg,ft) if ft>-1 and Duel.IsExistingMatchingCard(c114644893.rtfilter,tp,LOCATION_DECK,0,1,nil,e,tp,mg,ft) and Duel.SelectYesNo(tp,aux.Stringid(114644893,1)) then
and Duel.SelectYesNo(tp,aux.Stringid(114644893,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c114644893.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp,mg,dg,ft):GetFirst() local tg=Duel.SelectMatchingCard(tp,c114644893.rtfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,mg,ft)
local tc=tg:GetFirst()
local mat=nil
local tg2=Duel.GetMatchingGroup(c114644893.mfilter,tp,LOCATION_DECK,0,tc,tc:GetLevel())
local mg2=tg2:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc then if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
dg=dg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc:IsCode(21105106) then
tc:ritual_custom_operation(mg)
local mat=tc:GetMaterial()
Duel.ReleaseRitualMaterial(mat)
else
if tc.mat_filter then if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,nil) mg=mg:Filter(tc.mat_filter,nil)
dg=dg:Filter(tc.mat_filter,nil) mg2=mg2:Filter(tc.mat_filter,nil)
end end
local mat=nil if ft>0 and mg2:GetCount()>0
if ft>0 then and (not mg:CheckWithSumEqual(Card.GetRitualLevel,tc:GetLevel(),1,99,tc) or Duel.SelectYesNo(tp,aux.Stringid(114644893,2))) then
if dg:GetCount()>0 and dg:CheckWithSumEqual(Card.GetRitualLevel,tc:GetLevel(),1,1,tc) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
and (mg:GetCount()==0 or Duel.SelectYesNo(tp,aux.Stringid(114644893,2))) then local mat=mg2:Select(tp,1,1,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=dg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,1,tc)
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.SendtoGrave(mat,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL) Duel.SendtoGrave(mat,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
else elseif ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc) mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc)
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
end
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,c114644893.mfilterf,1,1,nil,tp,mg,tc) mat=mg:FilterSelect(tp,c114644893.mfilterf,1,1,nil,tp,mg,tc)
...@@ -144,7 +135,6 @@ function c114644893.effop(e,tp,eg,ep,ev,re,r,rp) ...@@ -144,7 +135,6 @@ function c114644893.effop(e,tp,eg,ep,ev,re,r,rp)
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
end end
end
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure() tc:CompleteProcedure()
......
local m=115072031 --E・HEROソリッド
local cm=_G["c"..m] function c115072031.initial_effect(c)
function cm.initial_effect(c)
--special summon --special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,115072031)
e1:SetCost(cm.spcost) e1:SetCost(c115072031.spcost)
e1:SetTarget(cm.sptg) e1:SetTarget(c115072031.sptg)
e1:SetOperation(cm.spop) e1:SetOperation(c115072031.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--revive --revive
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE) e2:SetCountLimit(1,115072031)
e2:SetCountLimit(1,m) e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost) e2:SetCost(c115072031.gvcost)
e2:SetTarget(cm.target) e2:SetTarget(c115072031.gvtg)
e2:SetOperation(cm.operation) e2:SetOperation(c115072031.gvop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--add fusion setcode --
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ADD_FUSION_SETCODE) e3:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetValue(0xa008) e3:SetTargetRange(LOCATION_HAND,0)
e3:SetTarget(c115072031.etarget)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--spell act in hand --
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD) e4:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e4:SetCode(EFFECT_QP_ACT_IN_NTPHAND) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_ADD_FUSION_SETCODE)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_HAND,0) e4:SetValue(0xad)
e4:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xa5))
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
function c115072031.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,e:GetHandler())
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c115072031.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function cm.spfilter(c,e,tp) function c115072031.spfilter(c,e,tp)
return c:IsSetCard(0x8) and not c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x8) and c:IsType(TYPE_MONSTER) and not c:IsCode(115072031) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function c115072031.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if c:IsRelateToEffect(e) then
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.IsExistingMatchingCard(c115072031.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(115072031,1)) then
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil) local g=Duel.SelectMatchingCard(tp,c115072031.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=sg:GetFirst() Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if tc then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end end
end end
end end
function cm.filter(c,e,tp)
return c:IsSetCard(0x8) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) function c115072031.gvfilter(c,e,tp)
return c:IsSetCard(0x8) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c115072031.gvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c115072031.gvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c115072031.gvfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c115072031.gvfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c115072031.gvfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function c115072031.gvop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function c115072031.etarget(e,c)
return c:IsSetCard(0xa5) and c:IsType(TYPE_QUICKPLAY)
end
...@@ -113,10 +113,10 @@ function cm.spoperation(e,tp,eg,ep,ev,re,r,rp) ...@@ -113,10 +113,10 @@ function cm.spoperation(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.repfilter(c,tp) function cm.repfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0xb5) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE) return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0xb5) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end end
function cm.desfilter(c) function cm.desfilter(c)
return c:IsControler(tp) and c:IsFaceup() and c:IsSetCard(0xb5) and c:IsAbleToDeck() return c:IsFaceup() and c:IsSetCard(0xb5) and c:IsAbleToDeck()
end end
function cm.desreptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -125,6 +125,7 @@ function cm.desreptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -125,6 +125,7 @@ function cm.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.SelectEffectYesNo(tp,c,96) then if Duel.SelectEffectYesNo(tp,c,96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectMatchingCard(tp,cm.desfilter,tp,LOCATION_REMOVED,0,1,g:GetCount(),nil) local sg=Duel.SelectMatchingCard(tp,cm.desfilter,tp,LOCATION_REMOVED,0,1,g:GetCount(),nil)
sg:KeepAlive()
e:SetLabelObject(sg) e:SetLabelObject(sg)
return true return true
else return false end else return false end
......
--半英雄的思念体
function c115848157.initial_effect(c) function c115848157.initial_effect(c)
--darklaw
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c115848157.condition) e1:SetRange(LOCATION_HAND)
e1:SetCost(c115848157.cost) e1:SetCondition(c115848157.darklawcon)
e1:SetOperation(c115848157.operation) e1:SetCost(c115848157.darklawcost)
e1:SetTarget(c115848157.darklawtg)
e1:SetOperation(c115848157.darklawop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCategory(CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE) e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetOperation(c115848157.regop) e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetCondition(c115848157.drawcon)
e2:SetTarget(c115848157.drawtg)
e2:SetOperation(c115848157.drawop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetOperation(c115848157.tgop)
c:RegisterEffect(e3)
end end
function c115848157.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)==0 function c115848157.darklawcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(e:GetHandler():GetControler(),LOCATION_GRAVE,0)==0
end end
function c115848157.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c115848157.darklawcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end end
function c115848157.operation(e,tp,eg,ep,ev,re,r,rp) function c115848157.darklawtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() if chk==0 then return true end
local e1=Effect.CreateEffect(c) end
function c115848157.darklawop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT) e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetTargetRange(0xff,0xff) e1:SetTargetRange(0xff, 0xff)
e1:SetValue(LOCATION_REMOVED) e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c115848157.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() function c115848157.drawcon(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c) return e:GetHandler():GetFlagEffect(115848157)~=0
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_GRAVE)
e1:SetTarget(c115848157.sptg)
e1:SetOperation(c115848157.spop)
e1:SetReset(RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end end
function c115848157.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c115848157.drawtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and e:GetHandler():IsAbleToRemove() end
if chk==0 then return c:IsAbleToRemove() and Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0) Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
end end
function c115848157.spop(e,tp,eg,ep,ev,re,r,rp) function c115848157.drawop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.Remove(c,POS_FACEUP,REASON_EFFECT)==0 then return end local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(tp,1,REASON_EFFECT) if c:IsRelateToEffect(e) and Duel.Remove(c,FACE_UP,REASON_EFFECT)~=0 then
Duel.Draw(p,d,REASON_EFFECT)
end
end
function c115848157.tgop(e,tp,eg,ep,ev,re,r,rp)
if bit.band(r,REASON_RETURN+REASON_ADJUST)~=0 then return end
e:GetHandler():RegisterFlagEffect(115848157,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end end
...@@ -73,7 +73,6 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp) ...@@ -73,7 +73,6 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false) Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
c:CreateEffectRelation(te) c:CreateEffectRelation(te)
local c=e:GetHandler()
local ev0=Duel.GetCurrentChain()+1 local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......
--闇より顕現し絶望の塔
function c116301233.initial_effect(c) function c116301233.initial_effect(c)
c:SetSPSummonOnce(116301233) c:SetSPSummonOnce(116301233)
--splimit
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c116301233.splimit) e1:SetValue(c116301233.splimit)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCondition(c116301233.spcon)
e2:SetCost(c116301233.spcost) e2:SetCost(c116301233.spcost)
e2:SetTarget(c116301233.sptg) e2:SetTarget(c116301233.sptg)
e2:SetOperation(c116301233.spop) e2:SetOperation(c116301233.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=e2:Clone()
e3:SetDescription(aux.Stringid(116301233,2)) e3:SetCode(EVENT_CHAINING)
e3:SetCategory(CATEGORY_DECKDES+CATEGORY_TOGRAVE+CATEGORY_TODECK) e3:SetCondition(c116301233.spcon2)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c116301233.condition)
e3:SetTarget(c116301233.target)
e3:SetOperation(c116301233.operation)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--deckdes
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(116301233,3)) e4:SetDescription(aux.Stringid(116301233,1))
e4:SetCategory(CATEGORY_DECKDES)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_SPSUMMON_SUCCESS) e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c116301233.con) e4:SetCondition(c116301233.tgcon)
e4:SetTarget(aux.TargetBoolFunction(aux.TRUE)) e4:SetTarget(c116301233.tgtg)
e4:SetOperation(c116301233.op) e4:SetOperation(c116301233.tgop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--lifedes
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(116301233,5))
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(c116301233.lfcon)
e5:SetTarget(c116301233.lftg)
e5:SetOperation(c116301233.lfop)
c:RegisterEffect(e5)
end end
function c116301233.splimit(e,se,sp,st) function c116301233.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS) return se:IsHasType(EFFECT_TYPE_ACTIONS)
end end
function c116301233.spfilter(c)
return c:IsCode(04064256) and not c:IsForbidden() function c116301233.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.CheckEvent(EVENT_CHAINING)
end
function c116301233.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.CheckEvent(EVENT_CHAINING) and re:GetHandler()~=e:GetHandler()
end
function c116301233.actfilter(c,tp)
return c:IsCode(4064256) and c:GetActivateEffect():IsActivatable(tp,true,true)
end end
function c116301233.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c116301233.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) and e:GetHandler():GetFlagEffect(116301230)==0 and Duel.IsExistingMatchingCard(c116301233.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end local exc=(e:GetHandler():IsLocation(LOCATION_HAND) and not e:GetHandler():IsAbleToGraveAsCost()) and e:GetHandler() or nil
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,exc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) and Duel.IsExistingMatchingCard(c116301233.actfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end
local g=Duel.SelectMatchingCard(tp,c116301233.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,exc)
local g=Duel.SelectMatchingCard(tp,c116301233.actfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0) local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then if fc then
Duel.SendtoGrave(fc,REASON_RULE) Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect() Duel.BreakEffect()
end end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true) Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
end end
e:GetHandler():RegisterFlagEffect(116301230,RESET_PHASE+PHASE_END,0,1)
end end
function c116301233.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c116301233.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND+LOCATION_GRAVE) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetTargetCard(e:GetHandler())
end end
function c116301233.spop(e,tp,eg,ep,ev,re,r,rp) function c116301233.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<1 then return end local c=e:GetHandler()
Duel.SpecialSummon(e:GetHandler(),0,tp,1-tp,false,false,POS_FACEUP) if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEUP)
end end
function c116301233.filter(c) function c116301233.filter(c)
return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) return c:IsFaceup() and c:IsRace(RACE_ZOMBIE)
end end
function c116301233.condition(e,tp,eg,ep,ev,re,r,rp) function c116301233.tgcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c116301233.filter,1,nil) return not eg:IsContains(e:GetHandler()) and eg:IsExists(c116301233.filter,1,nil)
end end
function c116301233.thfilter(c) function c116301233.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
return not c:IsType(TYPE_PENDULUM) or c:IsLocation(LOCATION_EXTRA) if chk==0 then return e:GetHandler():GetFlagEffect(116301233)==0 end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,nil)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function c116301233.target(e,tp,eg,ep,ev,re,r,rp,chk) function c116301233.tgfilter(c)
return c:IsAbleToGrave()
end
function c116301233.tdfilter(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsLocation(LOCATION_REMOVED) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM))) and c:IsAbleToDeck()
end
function c116301233.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(116301233)==0 and eg:GetFirst()~=c end local b=Duel.IsExistingMatchingCard(c116301233.tgfilter,tp,0,LOCATION_DECK,1,nil)
local op local op=3
if Duel.IsPlayerCanDiscardDeck(1-tp,1) then if b then
op=Duel.SelectOption(1-tp,aux.Stringid(116301233,0),aux.Stringid(116301233,1)) op=Duel.SelectOption(1-tp,aux.Stringid(116301233,2),aux.Stringid(116301233,3))
else
op=2
end
e:SetLabel(op)
if op==2 then
local g=Duel.GetMatchingGroup(c116301233.thfilter,1-tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
elseif op==1 then
local g=Duel.GetMatchingGroup(aux.TRUE,1-tp,LOCATION_DECK,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
e:GetHandler():RegisterFlagEffect(116301233,RESET_PHASE+PHASE_END,0,1)
else else
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,2) op=Duel.SelectOption(1-tp,aux.Stringid(116301233,4))+2
end end
end
function c116301233.operation(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==0 then if op==0 then
Duel.DiscardDeck(1-tp,2,REASON_EFFECT) Duel.DiscardDeck(1-tp,2,REASON_EFFECT)
elseif op==1 then elseif op==1 then
local g=Duel.SelectMatchingCard(1-tp,aux.TRUE,1-tp,LOCATION_DECK,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c116301233.tgfilter,1-tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
c:RegisterFlagEffect(116301233,RESET_PHASE+PHASE_END,0,1)
end end
else elseif op==2 then
local g=Duel.GetMatchingGroup(c116301233.thfilter,1-tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,0,nil) local g=Duel.GetMatchingGroup(c116301233.tdfilter,tp,0,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,nil)
if g:GetCount()>0 then Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
Duel.SendtoDeck(g,nil,nil,REASON_EFFECT) Duel.ShuffleDeck(1-tp)
Duel.BreakEffect()
Duel.DiscardDeck(1-tp,3,REASON_EFFECT) Duel.DiscardDeck(1-tp,3,REASON_EFFECT)
end else
return
end end
end end
function c116301233.gfilter(c,tc)
return c:IsPreviousLocation(LOCATION_GRAVE) and c:IsCode(34193084,71200730,116301233) and c~=tc function c116301233.lffilter(c)
return c:IsFaceup() and c:IsCode(116301233,71200730,34193084) and c:IsPreviousLocation(LOCATION_GRAVE)
end end
function c116301233.con(e,tp,eg,ep,ev,re,r,rp) function c116301233.lfcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c116301233.gfilter,1,nil,e:GetHandler()) return not eg:IsContains(e:GetHandler()) and eg:IsExists(c116301233.lffilter,1,nil)
end end
function c116301233.op(e,tp,eg,ep,ev,re,r,rp) function c116301233.lftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c116301233.lfop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
local atk=0
while tc do while tc do
if tc:IsCode(34193084,71200730,116301233) and e:GetHandler()~=tc then local atk=tc:GetTextAttack()
atk=atk+tc:GetBaseAttack() local life=Duel.GetLP(tp)
if life>=atk then
Duel.SetLP(tp,life-atk)
end end
tc=eg:GetNext() tc=eg:GetNext()
end end
if Duel.GetLP(tp)>=atk then
Duel.SetLP(tp,Duel.GetLP(tp)-atk)
end
end end
--炎星祖-猫头宁 --炎星祖-オウリン
local m=11662004 function c11662004.initial_effect(c)
local cm=_G["c"..m] --link summon
function cm.initial_effect(c)
aux.AddLinkProcedure(c,cm.matfilter,1,1)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddLinkProcedure(c,c11662004.matfilter,1,1)
--set & spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(11662004,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,11662004)
e1:SetCondition(cm.setcon) e1:SetCondition(c11662004.setcon)
e1:SetTarget(cm.settg) e1:SetTarget(c11662004.settg)
e1:SetOperation(cm.setop) e1:SetOperation(c11662004.setop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--level
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2)) e2:SetDescription(aux.Stringid(11662004,2))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCategory(CATEGORY_LVCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetTarget(cm.lvtg) e2:SetTarget(c11662004.lvtg)
e2:SetOperation(cm.lvop) e2:SetOperation(c11662004.lvop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--nagate
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_CHAIN_SOLVING) e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetCondition(cm.condition1) e3:SetCondition(c11662004.discon)
e3:SetOperation(cm.handes) e3:SetOperation(c11662004.disop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--xyz
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD) e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetCode(11662004)
e4:SetCode(m)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(1,0) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,1)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
cm[0]=0
function cm.matfilter(c) --link summon
return c:IsLinkSetCard(0x79) and not c:IsLinkType(TYPE_LINK) function c11662004.matfilter(c)
return c:IsLinkSetCard(0x79)
end end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
--set & spsummon
function c11662004.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end end
function cm.setfilter(c) function c11662004.setfilter(c)
return c:IsSetCard(0x7c) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() return c:IsSetCard(0x7c) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk) function c11662004.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c11662004.setfilter,tp,LOCATION_DECK,0,1,nil) end
end end
function cm.tgfilter(c) function c11662004.tgfilter(c)
return c:IsSetCard(0x79,0x7c) and c:IsAbleToGrave() return (c:IsSetCard(0x79) or c:IsSetCard(0x7c)) and c:IsAbleToGrave()
end end
function cm.spfilter(c,e,tp) function c11662004.spfilter(c,e,tp)
return c:IsSetCard(0x79) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x79) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.setop(e,tp,eg,ep,ev,re,r,rp) function c11662004.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.setfilter,tp,LOCATION_DECK,0,1,1,nil) local sg=Duel.SelectMatchingCard(tp,c11662004.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if not g or g:GetCount()==0 or Duel.SSet(tp,g)==0 then return end if sg:GetCount()==0 then return end
Duel.BreakEffect() Duel.SSet(tp,sg:GetFirst())
if Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) and Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c11662004.tgfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(c11662004.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(11662004,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil) local tg=Duel.SelectMatchingCard(tp,c11662004.tgfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(tg,REASON_EFFECT) if tg:GetCount()~=0 and Duel.SendtoGrave(tg,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local spg=Duel.SelectMatchingCard(tp,c11662004.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(spg,0,tp,tp,false,false,POS_FACEUP)
end
end end
end end
function cm.filter1(c)
return c:IsFaceup() and c:IsSetCard(0x79) and c:GetLevel()>0 --lv
function c11662004.lvfilter(c)
return c:IsFaceup() and c:IsSetCard(0x79) and c:IsLevelAbove(1)
end end
function cm.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c11662004.lvfilter1(c,tp)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.filter1(chkc) end return c11662004.lvfilter(c) and Duel.IsExistingMatchingCard(c11662004.lvfilter2,tp,LOCATION_MZONE,0,1,c,c:GetLevel())
if chk==0 then return Duel.IsExistingTarget(cm.filter1,tp,LOCATION_MZONE,0,1,nil) end end
function c11662004.lvfilter2(c,lv)
return c11662004.lvfilter(c) and not c:IsLevel(lv)
end
function c11662004.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c11662004.lvfilter1(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c11662004.lvfilter1,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.filter1,tp,LOCATION_MZONE,0,1,1,nil) Duel.SelectTarget(tp,c11662004.lvfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
end end
function cm.lvop(e,tp,eg,ep,ev,re,r,rp) function c11662004.lvop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
local lv=tc:GetLevel() local lv=tc:GetLevel()
local e2=Effect.CreateEffect(e:GetHandler()) local g=Duel.GetMatchingGroup(c11662004.lvfilter,tp,LOCATION_MZONE,0,nil)
e2:SetType(EFFECT_TYPE_FIELD) local lc=g:GetFirst()
e2:SetCode(EFFECT_CHANGE_LEVEL) local e1=Effect.CreateEffect(e:GetHandler())
e2:SetTarget(aux.TRUE) e1:SetType(EFFECT_TYPE_FIELD)
e2:SetTargetRange(LOCATION_MZONE,0) e1:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetValue(lv) e1:SetTargetRange(LOCATION_MZONE,0)
e2:SetReset(RESET_PHASE+PHASE_END) e1:SetValue(lv)
Duel.RegisterEffect(e2,tp) e1:SetReset(RESET_PHASE+PHASE_END)
end Duel.RegisterEffect(e1,tp)
end end
function cm.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x79) and c:IsType(TYPE_SYNCHRO) --nagate
function c11662004.stfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGrave()
end end
function cm.condition1(e,tp,eg,ep,ev,re,r,rp) function c11662004.indfilter(c)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsSetCard(0x79)
end end
function cm.desfilter(c) function c11662004.discon(e,tp,eg,ep,ev,re,r,rp)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGrave() local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and ep~=tp and rc:IsRelateToEffect(re)
and Duel.IsExistingMatchingCard(c11662004.indfilter,tp,LOCATION_MZONE,0,1,nil)
end end
function cm.handes(e,tp,eg,ep,ev,re,r,rp) function c11662004.disop(e,tp,eg,ep,ev,re,r,rp)
local id=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID) local g=Duel.GetMatchingGroup(c11662004.stfilter,ep,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
if ep==tp or id==cm[0] or not re:IsActiveType(TYPE_MONSTER) then return end if g:GetCount()>0 and Duel.SelectYesNo(ep,aux.Stringid(11662004,3)) then
cm[0]=id Duel.Hint(HINT_SELECTMSG,ep,HINTMSG_TOGRAVE)
if Duel.IsExistingMatchingCard(cm.desfilter,1-tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) and Duel.SelectYesNo(1-tp,aux.Stringid(m,3)) then local tg=g:Select(ep,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.HintSelection(tg)
local g=Duel.SelectMatchingCard(1-tp,cm.desfilter,1-tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil) if Duel.SendtoGrave(tg,REASON_EFFECT)==0 then
Duel.SendtoGrave(g,REASON_EFFECT) Duel.NegateEffect(ev)
Duel.BreakEffect() end
else else
Duel.NegateEffect(ev) Duel.NegateEffect(ev)
end end
end end
-- change script
local sc=Effect.SetCountLimit
Effect.SetCountLimit=function(e,v,code)
if e:GetDescription() == aux.Stringid(96381979,1) --魁炎星王-ソウコ
or e:GetDescription() == aux.Stringid(37057743,0) --炎星皇-チョウライオ
then
return sc(e,v,EFFECT_COUNT_CODE_SINGLE)
else
return sc(e,v,code)
end
end
local re=Card.RegisterEffect
Card.RegisterEffect=function(c,e)
if (e:GetDescription() == aux.Stringid(96381979,1) --魁炎星王-ソウコ
or e:GetDescription() == aux.Stringid(58504745,0) --間炎星-コウカンショウ
or e:GetDescription() == aux.Stringid(37057743,0)) --炎星皇-チョウライオ
and e:GetDescription() ~= aux.Stringid(11662004,4)
then
local ec=e:Clone()
ec:SetDescription(aux.Stringid(11662004,4))
ec:SetCode(EVENT_FREE_CHAIN)
ec:SetType(EFFECT_TYPE_QUICK_O)
ec:SetCondition(c11662004.con)
c:RegisterEffect(ec)
end
return re(c,e)
end
function c11662004.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,11662004)
end
--PSYフレーム・ブースター
function c116839253.initial_effect(c) function c116839253.initial_effect(c)
c:EnableCounterPermit(0x4) c:EnableCounterPermit(0x4)
--act in hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCondition(c116839253.actcon)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c116839253.target)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetDescription(aux.Stringid(116839253,0))
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCondition(c116839253.handcon) e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1)
e2:SetCost(c116839253.countercost)
e2:SetTarget(c116839253.countertg)
e2:SetOperation(c116839253.counterop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(116839253,0)) e3:SetDescription(aux.Stringid(116839253,1))
e3:SetCategory(CATEGORY_COUNTER) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_END_PHASE) e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCost(c116839253.cost) e3:SetCost(c116839253.efcost)
e3:SetTarget(c116839253.target2) e3:SetTarget(c116839253.thtg)
e3:SetOperation(c116839253.activate2) e3:SetOperation(c116839253.thop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--spsummon
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(116839253,1)) e4:SetDescription(aux.Stringid(116839253,2))
e4:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_SZONE) e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_FREE_CHAIN) e4:SetCode(EVENT_FREE_CHAIN)
e4:SetHintTiming(0,TIMING_END_PHASE) e4:SetHintTiming(0,TIMING_END_PHASE)
e4:SetCountLimit(1) e4:SetCountLimit(1)
e4:SetCost(c116839253.cost2) e4:SetCost(c116839253.efcost)
e4:SetTarget(c116839253.shtg) e4:SetTarget(c116839253.sptg)
e4:SetOperation(c116839253.shop) e4:SetOperation(c116839253.spop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--activate from deck
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(116839253,2)) e5:SetDescription(aux.Stringid(116839253,3))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetRange(LOCATION_SZONE) e5:SetRange(LOCATION_SZONE)
e5:SetCode(EVENT_FREE_CHAIN) e5:SetCode(EVENT_FREE_CHAIN)
e5:SetHintTiming(0,TIMING_END_PHASE) e5:SetHintTiming(0,TIMING_END_PHASE)
e5:SetCountLimit(1) e5:SetCountLimit(1)
e5:SetCost(c116839253.cost2) e5:SetCost(c116839253.efcost)
e5:SetTarget(c116839253.sptg) e5:SetTarget(c116839253.actg)
e5:SetOperation(c116839253.spop) e5:SetOperation(c116839253.acop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--to hand
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(116839253,3)) e6:SetCategory(CATEGORY_TOHAND)
e6:SetType(EFFECT_TYPE_QUICK_O) e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetRange(LOCATION_SZONE) e6:SetRange(LOCATION_GRAVE)
e6:SetCode(EVENT_FREE_CHAIN) e6:SetCode(EVENT_FREE_CHAIN)
e6:SetHintTiming(0,TIMING_END_PHASE) e6:SetCondition(aux.exccon)
e6:SetCost(c116839253.cost2) e6:SetCost(c116839253.srcost)
e6:SetCountLimit(1) e6:SetTarget(c116839253.srtg)
e6:SetTarget(c116839253.tftg) e6:SetOperation(c116839253.srop)
e6:SetOperation(c116839253.tfop)
c:RegisterEffect(e6) c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetCategory(CATEGORY_TOHAND)
e7:SetType(EFFECT_TYPE_QUICK_O)
e7:SetRange(LOCATION_GRAVE)
e7:SetCode(EVENT_FREE_CHAIN)
e7:SetCondition(aux.exccon)
e7:SetCost(aux.bfgcost)
e7:SetTarget(c116839253.thtg)
e7:SetOperation(c116839253.thop)
c:RegisterEffect(e7)
end end
function c116839253.cfilter(c)
return c:IsSetCard(0xc1) and c:IsFaceup() function c116839253.actfilter(c)
return c:IsFaceup() and c:IsSetCard(0xc1)
end
function c116839253.actcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c116839253.actfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c116839253.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if c116839253.countercost(e,tp,eg,ep,ev,re,r,rp,0) and c116839253.countertg(e,tp,eg,ep,ev,re,r,rp,0)
and Duel.SelectYesNo(tp,94) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c116839253.counterop)
c116839253.countercost(e,tp,eg,ep,ev,re,r,rp,1)
c116839253.countertg(e,tp,eg,ep,ev,re,r,rp,1)
else
e:SetProperty(0)
e:SetOperation(nil)
end
end end
function c116839253.handcon(e)
return Duel.IsExistingMatchingCard(c116839253.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) function c116839253.cfilter(c)
return c:IsAbleToGraveAsCost()
end end
function c116839253.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c116839253.countercost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler()) end if chk==0 then return e:GetHandler():GetFlagEffect(116839253)==0
and Duel.IsExistingMatchingCard(c116839253.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler()) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
local g=Duel.GetMatchingGroup(c116839253.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,99,e:GetHandler()) local cg=g:Select(tp,1,g:GetCount(),nil)
e:SetLabel(sg:GetCount()) Duel.SendtoGrave(cg,REASON_COST)
Duel.SendtoGrave(sg,REASON_COST) e:SetLabel(cg:GetCount())
e:GetHandler():RegisterFlagEffect(116839253,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end end
function c116839253.target2(e,tp,eg,ep,ev,re,r,rp,chk) function c116839253.countertg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanAddCounter(tp,0x4,e:GetLabel(),e:GetHandler()) end if chk==0 then return true end
end end
function c116839253.activate2(e,tp,eg,ep,ev,re,r,rp) function c116839253.counterop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() if not e:GetHandler():IsRelateToEffect(e) then return end
if not c:IsRelateToEffect(e) then return end e:GetHandler():AddCounter(0x4,e:GetLabel())
c:AddCounter(0x4,e:GetLabel())
end end
function c116839253.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
function c116839253.efcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x4,1,REASON_COST) end if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x4,1,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x4,1,REASON_COST) e:GetHandler():RemoveCounter(tp,0x4,1,REASON_COST)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function c116839253.shfilter(c)
return c:IsSetCard(0xc1) and not c:IsCode(116839253) and c:IsAbleToHand() and (c:IsFaceup() or c:IsLocation(LOCATION_DECK)) function c116839253.thfilter(c)
return c:IsSetCard(0xc1) and (c:IsLocation(LOCATION_DECK) or c:IsFaceup()) and c:IsAbleToHand()
end end
function c116839253.shtg(e,tp,eg,ep,ev,re,r,rp,chk) function c116839253.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() if chk==0 then return Duel.IsExistingMatchingCard(c116839253.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c116839253.shfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_REMOVED)
end end
function c116839253.shop(e,tp,eg,ep,ev,re,r,rp) function c116839253.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c116839253.shfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c116839253.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function c116839253.spfilter(c,e,tp) function c116839253.spfilter(c,e,tp)
return c:IsSetCard(0xc1) and c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0xc1) and not c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c116839253.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c116839253.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c116839253.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c116839253.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end end
function c116839253.spop(e,tp,eg,ep,ev,re,r,rp) function c116839253.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c116839253.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c116839253.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function c116839253.tffilter(c,tp)
return c:IsSetCard(0xc1) and (c:GetType()==0x20004 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 or c:IsType(TYPE_FIELD)) and not c:IsCode(116839253) and c:GetActivateEffect():IsActivatable(tp) function c116839253.acfilter(c,tp)
return (((c:GetType()==0x20004 or c:GetType()==0x20002) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) or c:IsType(TYPE_FIELD))
and c:IsSetCard(0xc1) and c:GetActivateEffect():IsActivatable(tp)
end end
function c116839253.tftg(e,tp,eg,ep,ev,re,r,rp,chk) function c116839253.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c116839253.tffilter,tp,LOCATION_DECK,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(c116839253.acfilter,tp,LOCATION_DECK,0,1,nil,tp) end
end end
function c116839253.tfop(e,tp,eg,ep,ev,re,r,rp) function c116839253.acop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c116839253.tffilter,tp,LOCATION_DECK,0,nil,tp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then
g=g:Filter(Card.IsType,nil,TYPE_FIELD)
end
if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=g:Select(tp,1,1,nil):GetFirst() local g=Duel.SelectMatchingCard(tp,c116839253.acfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
local tc=g:GetFirst()
if tc then
if tc:IsType(TYPE_FIELD) then if tc:IsType(TYPE_FIELD) then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
if fc then else
Duel.SendtoGrave(fc,REASON_RULE) Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.BreakEffect()
end end
end
local lc
if tc:IsType(TYPE_FIELD) then lc=LOCATION_FZONE else lc=LOCATION_SZONE end
Duel.MoveToField(tc,tp,tp,lc,POS_FACEUP,true)
local te=tc:GetActivateEffect() local te=tc:GetActivateEffect()
local tep=tc:GetControler() local tep=tc:GetControler()
local cost=te:GetCost() local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,116839253,te,0,tp,tp,Duel.GetCurrentChain()) Duel.RaiseEvent(tc,EVENT_CHAIN_SOLVED,tc:GetActivateEffect(),0,tp,tp,Duel.GetCurrentChain())
end
end end
function c116839253.thfilter(c)
return c:IsSetCard(0xc1) and c:IsAbleToHand() and not c:IsCode(116839253) function c116839253.srcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end end
function c116839253.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c116839253.srfilter(c)
if chk==0 then return Duel.IsExistingMatchingCard(c116839253.thfilter,tp,LOCATION_GRAVE,0,1,nil) end return c:IsSetCard(0xc1) and c:IsAbleToHand()
end
function c116839253.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c116839253.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end end
function c116839253.thop(e,tp,eg,ep,ev,re,r,rp) function c116839253.srop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c116839253.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c116839253.thfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
......
--魔弹奏者 马里亚 --魔弾の奏者マリア
local m=117179181 function c117179181.initial_effect(c)
local cm=_G["c"..m] --pendulum summon
function cm.initial_effect(c)
aux.EnablePendulumAttribute(c) aux.EnablePendulumAttribute(c)
--pendulum effect
--link summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(117179181,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_PZONE) e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetTarget(cm.lktg) e1:SetCountLimit(1,117179181)
e1:SetOperation(cm.lkop) e1:SetCost(c117179181.actcost)
e1:SetTarget(c117179181.lktg)
e1:SetOperation(c117179181.lkop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CHAINING) e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_PZONE) e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,m+1) e2:SetOperation(aux.chainreg)
e2:SetCondition(cm.drcon)
e2:SetTarget(cm.drtg)
e2:SetOperation(cm.drop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD) e3:SetDescription(aux.Stringid(117179181,1))
e3:SetCode(EFFECT_QP_ACT_IN_NTPHAND) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetRange(LOCATION_MZONE) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x108)) e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetTargetRange(LOCATION_HAND,0) e3:SetProperty(EFFECT_FLAG_NO_TURN_RESET+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,117179182)
e3:SetCondition(c117179181.spcon)
e3:SetCost(c117179181.actcost)
e3:SetTarget(c117179181.sptg)
e3:SetOperation(c117179181.spop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=e3:Clone() --monster effect
e4:SetCode(EFFECT_TRAP_ACT_IN_HAND) --activate from hand
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e4:SetRange(LOCATION_MZONE)
e4:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x108))
e4:SetTargetRange(LOCATION_HAND,0)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c) local e5=e4:Clone()
e5:SetDescription(aux.Stringid(m,2)) e5:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e5:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_CHAINING)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,m+2)
e5:SetCondition(cm.atkcon)
e5:SetTarget(cm.atktg)
e5:SetOperation(cm.atkop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--spsummon & pset
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(m,3)) e6:SetDescription(aux.Stringid(117179181,2))
e6:SetCategory(CATEGORY_SPECIAL_SUMMON) e6:SetCategory(CATEGORY_SPECIAL_SUMMON)
e6:SetType(EFFECT_TYPE_QUICK_O) e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetRange(LOCATION_HAND+LOCATION_MZONE)
e6:SetCode(EVENT_FREE_CHAIN) e6:SetCode(EVENT_FREE_CHAIN)
e6:SetCountLimit(1,m+3) e6:SetRange(LOCATION_MZONE+LOCATION_HAND)
e6:SetCondition(cm.spcon) e6:SetCountLimit(1,117179183)
e6:SetTarget(cm.sptg) e6:SetCondition(c117179181.sscon)
e6:SetOperation(cm.spop) e6:SetCost(c117179181.actcost)
e6:SetTarget(c117179181.sstg)
e6:SetOperation(c117179181.ssop)
c:RegisterEffect(e6) c:RegisterEffect(e6)
--atk gain
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e7:SetDescription(aux.Stringid(117179181,3))
e7:SetCode(EVENT_CHAINING) e7:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e7:SetRange(LOCATION_HAND) e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e7:SetOperation(cm.sp1) e7:SetProperty(EFFECT_FLAG_DELAY)
e7:SetCode(EVENT_CHAIN_SOLVING)
e7:SetRange(LOCATION_MZONE)
e7:SetCountLimit(1,117179184)
e7:SetCondition(c117179181.atkcon)
e7:SetCost(c117179181.actcost)
e7:SetTarget(c117179181.atktg)
e7:SetOperation(c117179181.atkop)
c:RegisterEffect(e7) c:RegisterEffect(e7)
local e8=e7:Clone() if not c117179181.global_check then
e8:SetCode(EVENT_CHAIN_NEGATED) c117179181.global_check=true
e8:SetOperation(cm.sp2) c117179181[0]=false
c:RegisterEffect(e8) c117179181[1]=false
local ge0=Effect.CreateEffect(c)
ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge0:SetCode(EVENT_CHAINING)
ge0:SetOperation(aux.chainreg)
c:RegisterEffect(ge0,0)
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_SOLVING)
ge1:SetOperation(c117179181.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c117179181.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c117179181.checkop(e,tp,eg,ep,ev,re,r,rp)
c117179181[1-ep]=true
end
function c117179181.clear(e,tp,eg,ep,ev,re,r,rp)
c117179181[0]=false
c117179181[1]=false
end
--description
function c117179181.actcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end end
function cm.matfilter(c)
--link summon
function c117179181.matfilter(c)
return c:IsFaceup() and c:IsSetCard(0x108) return c:IsFaceup() and c:IsSetCard(0x108)
end end
function cm.lkfilter(c,mg) function c117179181.lkfilter(c,mg)
return c:IsLinkSummonable(mg) return c:IsLinkSummonable(mg)
end end
function cm.lktg(e,tp,eg,ep,ev,re,r,rp,chk) function c117179181.lktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,nil) local mg=Duel.GetMatchingGroup(c117179181.matfilter,tp,LOCATION_MZONE,0,nil)
return Duel.IsExistingMatchingCard(cm.lkfilter,tp,LOCATION_EXTRA,0,1,nil,mg) return Duel.IsExistingMatchingCard(c117179181.lkfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function cm.lkop(e,tp,eg,ep,ev,re,r,rp) function c117179181.lkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,nil) local mg=Duel.GetMatchingGroup(c117179181.matfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,cm.lkfilter,tp,LOCATION_EXTRA,0,1,1,nil,mg) local tg=Duel.SelectMatchingCard(tp,c117179181.lkfilter,tp,LOCATION_EXTRA,0,1,1,nil,mg)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
Duel.LinkSummon(tp,tc,mg) Duel.LinkSummon(tp,tc,mg)
end end
end end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE) --spsummon
function c117179181.spcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk) function c117179181.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,LOCATION_PZONE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function cm.drop(e,tp,eg,ep,ev,re,r,rp) function c117179181.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if c:IsRelateToEffect(e) then
if Duel.GetMZoneCount(tp)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
--spsummon & pset
function c117179181.sscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==0 or c117179181[e:GetHandler():GetControler()]
end
function c117179181.ssfilter(c,e,tp)
return c:IsSetCard(0x108) and not c:IsCode(117179181) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c117179181.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c117179181.ssfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))
and not e:GetHandler():IsForbidden() end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c117179181.ssop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c117179181.ssfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 and c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--atk gain
function c117179181.atkcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and e:GetHandler():GetColumnGroup():IsContains(re:GetHandler()) return re:IsHasType(EFFECT_TYPE_ACTIVATE) and e:GetHandler():GetColumnGroup():IsContains(re:GetHandler())
end end
function cm.atkfilter(c) function c117179181.atkfilter(c)
return c:IsSetCard(0x108) and c:IsFaceup() return c:IsFaceup() and c:IsSetCard(0x108) and (c:GetAttack()>0 or c:GetDefense()>0)
end end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk) function c117179181.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.atkfilter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c117179181.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
end end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp) function c117179181.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,cm.atkfilter,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c117179181.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(tc:GetAttack()) e1:SetValue(tc:GetAttack())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE) e2:SetCode(EFFECT_UPDATE_DEFENSE)
...@@ -136,30 +209,3 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -136,30 +209,3 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==0 or e:GetHandler():GetFlagEffect(m)>0
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x108) and not c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0 and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and Duel.GetMZoneCount(tp)>0 and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function cm.sp1(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then return end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function cm.sp2(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then return end
e:GetHandler():ResetFlagEffect(m)
end
\ No newline at end of file
...@@ -19,7 +19,6 @@ function c117485040.initial_effect(c) ...@@ -19,7 +19,6 @@ function c117485040.initial_effect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,117485040)
e3:SetCondition(c117485040.pencon) e3:SetCondition(c117485040.pencon)
e3:SetOperation(c117485040.penop) e3:SetOperation(c117485040.penop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
...@@ -63,6 +62,7 @@ function c117485040.penop(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,6 +62,7 @@ function c117485040.penop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_EXTRA_PENDULUM_SUMMON) e2:SetCode(EFFECT_EXTRA_PENDULUM_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0) e2:SetTargetRange(1,0)
e2:SetCountLimit(1,117485041)
e2:SetValue(aux.TRUE) e2:SetValue(aux.TRUE)
e2:SetReset(RESET_PHASE+PHASE_END) e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
......
--ユベル-Das Erbärmlich Vorhandensein
function c117837139.initial_effect(c) function c117837139.initial_effect(c)
c:EnableReviveLimit()
c:SetUniqueOnField(1,1,117837139,LOCATION_MZONE) c:SetUniqueOnField(1,1,117837139,LOCATION_MZONE)
--spsummon condition
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION) e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--special summon rule
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_IGNITION+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_EXTRA) e1:SetRange(LOCATION_EXTRA)
e1:SetTarget(c117837139.sumtg) e1:SetTarget(c117837139.sumtg)
e1:SetOperation(c117837139.sumop) e1:SetOperation(c117837139.sumop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--cannot release
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_UNRELEASABLE_SUM)
e2:SetValue(1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_UNRELEASABLE_NONSUM)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_UNRELEASABLE_SUM)
e3:SetValue(1)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=e3:Clone() --cannot summon material
e4:SetCode(EFFECT_UNRELEASABLE_NONSUM) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e4:SetValue(1)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c) local e5=e4:Clone()
e5:SetType(EFFECT_TYPE_SINGLE) e5:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e5:SetValue(1)
c:RegisterEffect(e5) c:RegisterEffect(e5)
local e6=e5:Clone() local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) e6:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e6) c:RegisterEffect(e6)
local e7=e5:Clone() local e7=e4:Clone()
e7:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL) e7:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e7) c:RegisterEffect(e7)
local e8=e5:Clone() --atklimit
e8:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL) local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
c:RegisterEffect(e8) c:RegisterEffect(e8)
--cannot be target
local e9=Effect.CreateEffect(c) local e9=Effect.CreateEffect(c)
e9:SetCategory(CATEGORY_SPECIAL_SUMMON) e9:SetType(EFFECT_TYPE_FIELD)
e9:SetType(EFFECT_TYPE_IGNITION) e9:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e9:SetRange(LOCATION_MZONE) e9:SetRange(LOCATION_MZONE)
e9:SetProperty(EFFECT_FLAG_BOTH_SIDE) e9:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e9:SetCountLimit(1) e9:SetTarget(c117837139.target)
e9:SetTarget(c117837139.sumtg2) e9:SetValue(1)
e9:SetOperation(c117837139.sumop2)
c:RegisterEffect(e9) c:RegisterEffect(e9)
local e10=Effect.CreateEffect(c) local e10=e9:Clone()
e10:SetType(EFFECT_TYPE_FIELD) e10:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e10:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e10:SetValue(1)
e10:SetRange(LOCATION_MZONE)
e10:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e10:SetTarget(c117837139.indtg)
e10:SetValue(aux.TRUE)
c:RegisterEffect(e10) c:RegisterEffect(e10)
local e11=e10:Clone() --special summon
e11:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_SPECIAL_SUMMON)
e11:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e11:SetType(EFFECT_TYPE_IGNITION)
e11:SetRange(LOCATION_MZONE)
e11:SetCountLimit(1)
e11:SetTarget(c117837139.sptg)
e11:SetOperation(c117837139.spop)
c:RegisterEffect(e11) c:RegisterEffect(e11)
--cannot select battle target
local e12=Effect.CreateEffect(c) local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_FIELD) e12:SetType(EFFECT_TYPE_FIELD)
e12:SetCode(EFFECT_MUST_ATTACK)
e12:SetRange(LOCATION_MZONE) e12:SetRange(LOCATION_MZONE)
e12:SetTargetRange(LOCATION_MZONE,0) e12:SetTargetRange(LOCATION_MZONE,0)
e12:SetCondition(c117837139.sccon) e12:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e12:SetCondition(c117837139.atkcon)
e12:SetValue(c117837139.atlimit)
c:RegisterEffect(e12) c:RegisterEffect(e12)
local e13=e12:Clone() local e13=e12:Clone()
e13:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET) e13:SetCode(EFFECT_MUST_ATTACK)
e13:SetValue(c117837139.atlimit)
c:RegisterEffect(e13) c:RegisterEffect(e13)
--switch control
local e14=Effect.CreateEffect(c) local e14=Effect.CreateEffect(c)
e14:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e14:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e14:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e14:SetCode(EVENT_PHASE+PHASE_BATTLE_START) e14:SetCode(EVENT_PHASE_START+PHASE_BATTLE_START)
e14:SetRange(LOCATION_MZONE) e14:SetRange(LOCATION_MZONE)
e14:SetCountLimit(1) e14:SetCountLimit(1)
e14:SetCondition(c117837139.condition) e14:SetOperation(c117837139.maop)
e14:SetOperation(c117837139.operation)
c:RegisterEffect(e14) c:RegisterEffect(e14)
end end
--special summon rule
function c117837139.sumfilter(c,e,tp) function c117837139.sumfilter(c,e,tp)
return c:IsCode(78371393,4779091,31764700,117837139) and c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEUP_ATTACK,tp) return c:IsCode(78371393,4779091,31764700,117837139) and c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEUP_ATTACK,tp)
end end
...@@ -92,93 +105,98 @@ function c117837139.sumop(e,tp,eg,ep,ev,re,r,rp) ...@@ -92,93 +105,98 @@ function c117837139.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c117837139.sumfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c117837139.sumfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP_ATTACK)==1 then if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP_ATTACK)==1 then
Duel.SpecialSummon(c,SUMMON_TYPE_LINK,1-tp,1-tp,true,false,POS_FACEUP) Duel.SpecialSummon(c,0,1-tp,1-tp,true,false,POS_FACEUP)
c:CompleteProcedure() c:CompleteProcedure()
end end
end end
function c117837139.sumfilter2(c,e,tp)
return c:IsCode(78371393,4779091,31764700,117837139) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) function c117837139.target(e,c)
return c:IsCode(4779091,31764700,78371393,117837139)
end end
function c117837139.sumtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() function c117837139.cfilter(c)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c117837139.sumfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end return c:IsFaceup() and c:IsCode(4779091,31764700,78371393,117837139)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,0,1,tp,LOCATION_HAND)
end end
function c117837139.sumop2(e,tp,eg,ep,ev,re,r,rp) function c117837139.atkcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end return Duel.IsExistingMatchingCard(c117837139.cfilter,tp,0,LOCATION_MZONE,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c117837139.sumfilter2,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end end
function c117837139.indtg(e,c) function c117837139.atlimit(e,c)
return c:IsCode(78371393,4779091,31764700,117837139) return not (c:IsFaceup() and c:IsCode(4779091,31764700,78371393,117837139))
end end
function c117837139.scfilter(c)
return c:IsCode(78371393,4779091,31764700,117837139) and c:IsFaceup() function c117837139.spfilter(c,e,tp)
return c:IsCode(4779091,31764700,78371393,117837139) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
function c117837139.sccon(e,tp,eg,ep,ev,re,r,rp) function c117837139.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.IsExistingMatchingCard(c117837139.scfilter,tp,0,LOCATION_MZONE,1,nil) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c117837139.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c117837139.atlimit(e,c) function c117837139.spop(e,tp,eg,ep,ev,re,r,rp)
return not (c:IsFaceup() and c:IsCode(78371393,4779091,31764700,117837139)) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c117837139.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP_ATTACK)
end
end end
function c117837139.filter(c,e)
return (not c:IsAbleToChangeControler() or c:IsImmuneToEffect(e)) and c:GetSequence()<5 function c117837139.ccfilter(c)
return c:IsAbleToChangeControler() and c:GetSequence()<5
end end
function c117837139.filter2(c) function c117837139.gfilter(c)
return c:GetSequence()<5 return c:GetFlagEffect(117837139)==0 and c:GetSequence()<5
end end
function c117837139.condition(e) function c117837139.cxfilter(c)
return Duel.GetTurnPlayer()~=e:GetHandler():GetControler() return not c:IsAbleToChangeControler()
end end
function c117837139.operation(e,tp,eg,ep,ev,re,r,rp) function c117837139.maop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then return end
local c=e:GetHandler() local c=e:GetHandler()
if Duel.IsExistingMatchingCard(c117837139.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e) then return false end local g=Duel.GetMatchingGroup(Card.IsDefensePos,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local g1=Duel.GetMatchingGroup(c117837139.filter2,tp,LOCATION_MZONE,0,nil) Duel.ChangePosition(g,POS_FACEUP_ATTACK)
local g2=Duel.GetMatchingGroup(c117837139.filter2,tp,0,LOCATION_MZONE,nil) local g1=Duel.GetMatchingGroup(c117837139.ccfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_CARD,0,117837139) local g2=Duel.GetMatchingGroup(c117837139.ccfilter,tp,0,LOCATION_MZONE,nil)
Duel.ChangePosition(g1,POS_FACEUP_ATTACK) local og1=g1:GetCount()
Duel.ChangePosition(g2,POS_FACEUP_ATTACK) local og2=g2:GetCount()
if g1:GetCount()>g2:GetCount() then if (og1==0 or og2==0) then return end
local g3=g1:RandomSelect(tp,g2:GetCount()) if not (g1:FilterCount(c117837139.cxfilter,nil)==0 or g2:FilterCount(c117837139.cxfilter,nil)==0) then return end
g1:Sub(g3) if og1>og2 then
Duel.SwapControl(g3,g2) local tc1=g1:GetFirst()
Duel.GetControl(g1,1-tp) for i=1,og1-og2 do
elseif g1:GetCount()<g2:GetCount() then Duel.GetControl(tc1,1-tp,PHASE_BATTLE,1)
local g3=g2:RandomSelect(tp,g1:GetCount()) tc1:RegisterFlagEffect(117837139,RESET_EVENT+0x1fe0000,0,1)
g2:Sub(g3) tc1=g1:GetNext()
Duel.SwapControl(g3,g1) end
Duel.GetControl(g2,tp) elseif og1<og2 then
else local tc2=g2:GetFirst()
Duel.SwapControl(g1,g2) for i=1,og2-og1 do
Duel.GetControl(tc2,tp,PHASE_BATTLE,1)
tc2:RegisterFlagEffect(117837139,RESET_EVENT+0x1fe0000,0,1)
tc2=g2:GetNext()
end
end end
if Duel.GetCurrentPhase()==PHASE_BATTLE_START then local cg1=Duel.GetMatchingGroup(c117837139.gfilter,tp,LOCATION_MZONE,0,nil)
local cg2=Duel.GetMatchingGroup(c117837139.gfilter,tp,0,LOCATION_MZONE,nil)
Duel.SwapControl(cg1,cg2,PHASE_BATTLE,1)
--reflect damage
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e1:SetCode(EFFECT_REFLECT_DAMAGE)
e1:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e1:SetTargetRange(1,1)
e1:SetValue(c117837139.refcon)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
--cannot direct attack
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_REFLECT_DAMAGE) e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTargetRange(1,1)
e2:SetValue(c117837139.refcon)
e2:SetReset(RESET_PHASE+PHASE_END) e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
local e14=Effect.CreateEffect(c)
e14:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e14:SetCode(EVENT_PHASE+PHASE_BATTLE)
e14:SetCountLimit(1)
e14:SetOperation(c117837139.operation)
e14:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e14,tp)
end
end end
function c117837139.refcon(e,re,val,r,rp,rc) function c117837139.refcon(e,re,val,r,rp,rc)
return bit.band(r,REASON_EFFECT)~=0 return bit.band(r,REASON_EFFECT)~=0
end end
--极光之宣告者 --極光の宣告者
local m=117960683 function c117960683.initial_effect(c)
local cm=_G["c"..m] --cost
function cm.isherald(c)
return c:IsCode(1249315,17266660,21074344,27383110,44665365,48546368,79306385,79606837,94689635,m,121074344,92919429,46935289)
end
function cm.initial_effect(c)
--negate(herald of the orange light)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetRange(LOCATION_DECK)
e1:SetOperation(c117960683.op)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetTarget(c117960683.thtg)
e2:SetOperation(c117960683.tgop)
c:RegisterEffect(e2)
--revive
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,117960683)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(c117960683.spcost)
e3:SetTarget(c117960683.sptg)
e3:SetOperation(c117960683.spop)
c:RegisterEffect(e3)
end
function c117960683.heraldfilter(c)
return c:IsCode(17266660) --朱光の宣告者
or c:IsCode(21074344) --緑光の宣告者
or c:IsCode(94689635) --紫光の宣告者
or c:IsCode(44665365) --神光の宣告者
or c:IsCode(48546368) --崇光なる宣告者
or c:IsCode(79606837) --虹光の宣告者
or c:IsCode(1249315) --聖光の宣告者
or c:IsCode(27383110) --宣告者の預言
or c:IsCode(79306385) --宣告者の神託
or c:IsCode(117960683) --極光の宣告者
or c:IsCode(121074344) --閃光の宣告者
or c:IsCode(92919429) --宣告者の神巫
or c:IsCode(46935289) --虚光の宣告者(サーチにも蘇生にも対応しないので実質「宣告者」カテゴリには含まれない)
end
function c117960683.filterx(c)
return c:IsCode(17266660,21074344,94689635,44665365,48546368,46935289)
end
function c117960683.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c117960683.filterx,c:GetControler(),LOCATION_HAND+LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
if tc:GetFlagEffect(117960683)==0 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(117960683,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
if not tc:IsType(TYPE_RITUAL+TYPE_LINK) then
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m) e1:SetCost(c117960683.discost)
e1:SetCondition(cm.negcon1) else
e1:SetCost(cm.negcost) e1:SetRange(LOCATION_MZONE)
e1:SetTarget(cm.negtg) e1:SetCost(c117960683.discost2)
e1:SetOperation(cm.negop) end
e1:SetCondition(c117960683.discon)
e1:SetTarget(c117960683.distg)
e1:SetOperation(c117960683.disop)
e1:SetReset(RESET_EVENT+0x1fe0000,1)
tc:RegisterEffect(e1)
--disable spsummon
if tc:IsCode(48546368) then
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT) e2:SetDescription(aux.Stringid(117960683,0))
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e2:SetRange(LOCATION_DECK) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetTargetRange(LOCATION_HAND,0) e2:SetRange(LOCATION_MZONE)
e2:SetTarget(aux.TargetBoolFunction(Card.IsCode,17266660)) e2:SetCode(EVENT_SPSUMMON)
e2:SetLabelObject(e1) e2:SetCondition(c117960683.discon2)
c:RegisterEffect(e2) e2:SetCost(c117960683.discost2)
--negate(herald of the green light) e2:SetTarget(c117960683.distg2)
local e3=e1:Clone() e2:SetOperation(c117960683.disop2)
e3:SetCondition(cm.negcon2) tc:RegisterEffect(e2)
local e4=e2:Clone() end
e4:SetTarget(aux.TargetBoolFunction(Card.IsCode,21074344)) tc:RegisterFlagEffect(117960683,RESET_EVENT+0x1fe0000,0,1)
e4:SetLabelObject(e3) end
c:RegisterEffect(e4) tc=g:GetNext()
--negate(herald of the purple light) end
local e5=e1:Clone() end
e5:SetCondition(cm.negcon3)
local e6=e2:Clone() function c117960683.discon(e,tp,eg,ep,ev,re,r,rp)
e6:SetTarget(aux.TargetBoolFunction(Card.IsCode,94689635)) local c=e:GetHandler()
e6:SetLabelObject(e5) if c:IsCode(17266660) then
c:RegisterEffect(e6)
--negate(herald of perfection,herald of ultimateness)
local e7=e1:Clone()
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(cm.negcon4)
e7:SetCost(cm.discost)
local e8=e2:Clone()
e8:SetTargetRange(LOCATION_MZONE,0)
e8:SetTarget(aux.TargetBoolFunction(Card.IsCode,44665365,48546368))
e8:SetLabelObject(e7)
c:RegisterEffect(e8)
--disable spsummon(herald of ultimateness)
local e9=Effect.CreateEffect(c)
e9:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e9:SetType(EFFECT_TYPE_QUICK_O)
e9:SetRange(LOCATION_MZONE)
e9:SetCode(EVENT_SPSUMMON)
e9:SetCountLimit(1,m)
e9:SetCondition(cm.discon)
e9:SetCost(cm.discost)
e9:SetTarget(cm.distg)
e9:SetOperation(cm.disop)
local e10=e2:Clone()
e10:SetTargetRange(LOCATION_MZONE,0)
e10:SetTarget(aux.TargetBoolFunction(Card.IsCode,48546368))
e10:SetLabelObject(e9)
c:RegisterEffect(e10)
--to hand
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e11:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e11:SetCode(EVENT_TO_GRAVE)
e11:SetTarget(cm.thtg)
e11:SetOperation(cm.thop)
c:RegisterEffect(e11)
--spsummon
local e12=Effect.CreateEffect(c)
e12:SetCategory(CATEGORY_SPECIAL_SUMMON)
e12:SetProperty(EFFECT_FLAG_CARD_TARGET)
e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetCode(EVENT_FREE_CHAIN)
e12:SetRange(LOCATION_GRAVE)
e12:SetHintTiming(0,TIMING_END_PHASE)
e12:SetCountLimit(1,m+1)
e12:SetCost(cm.spcost)
e12:SetTarget(cm.sptg)
e12:SetOperation(cm.spop)
c:RegisterEffect(e12)
local e13=e1:Clone()
e13:SetRange(LOCATION_MZONE)
e13:SetCondition(cm.negcon5)
e13:SetCost(cm.discost)
local e14=e2:Clone()
e14:SetTargetRange(LOCATION_MZONE,0)
e14:SetTarget(aux.TargetBoolFunction(Card.IsCode,46935289))
e14:SetLabelObject(e13)
c:RegisterEffect(e14)
end
function cm.negcon1(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev) return ep~=tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
elseif c:IsCode(21074344) then
return ep~=tp and re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
elseif c:IsCode(94689635) then
return ep~=tp and re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
elseif c:IsCode(46935289) then
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
elseif c:IsType(TYPE_RITUAL) then
if ep==tp or c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
else
return false
end
end end
function cm.costfilter(c) function c117960683.costfilter(c)
return c:IsCode(m) and c:IsAbleToGraveAsCost() return c:IsCode(117960683) and c:IsAbleToGraveAsCost()
end end
function cm.negcost(e,tp,eg,ep,ev,re,r,rp,chk) function c117960683.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_DECK,0,1,nil) end local sg=Group.CreateGroup()
local tc=Duel.GetFirstMatchingCard(cm.costfilter,tp,LOCATION_DECK,0,nil) if chk==0 then return c:IsAbleToGraveAsCost()
Duel.SendtoGrave(Group.FromCards(c,tc),REASON_COST) and Duel.IsExistingMatchingCard(c117960683.costfilter,tp,LOCATION_DECK,0,1,nil) end
end local tc=Duel.GetFirstMatchingCard(c117960683.costfilter,tp,LOCATION_DECK,0,nil)
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk) sg:AddCard(tc)
if chk==0 then return true end sg:AddCard(c)
Duel.SendtoGrave(sg,REASON_COST)
end
function c117960683.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,117960683)==0 end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.RegisterFlagEffect(tp,117960683,RESET_PHASE+PHASE_END,0,1)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end end
end end
function cm.negop(e,tp,eg,ep,ev,re,r,rp) function c117960683.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT) Duel.Destroy(eg,REASON_EFFECT)
end end
end end
function cm.negcon2(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE) function c117960683.filter(c,tp)
and Duel.IsChainNegatable(ev) return c:GetSummonPlayer()==tp
end
function cm.negcon3(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and Duel.IsChainNegatable(ev)
end
function cm.negcon4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if ep==tp or c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
end end
function cm.negcon5(e,tp,eg,ep,ev,re,r,rp) function c117960683.discon2(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) return Duel.GetCurrentChain()==0 and eg:IsExists(c117960683.filter,1,nil,1-tp)
end end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk) function c117960683.discost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c117960683.costfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local tc=Duel.GetFirstMatchingCard(c117960683.costfilter,tp,LOCATION_DECK,0,nil)
local tc=Duel.GetFirstMatchingCard(cm.costfilter,tp,LOCATION_DECK,0,1,nil)
Duel.SendtoGrave(tc,REASON_COST) Duel.SendtoGrave(tc,REASON_COST)
end end
function cm.disfilter(c,tp) function c117960683.distg2(e,tp,eg,ep,ev,re,r,rp,chk)
return c:GetSummonPlayer()==tp
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and eg:IsExists(cm.disfilter,1,nil,1-tp)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local g=eg:Filter(cm.disfilter,nil,1-tp) local g=eg:Filter(c117960683.filter,nil,1-tp)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end end
function cm.disop(e,tp,eg,ep,ev,re,r,rp) function c117960683.disop2(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.disfilter,nil,1-tp) local g=eg:Filter(c117960683.filter,nil,1-tp)
Duel.NegateSummon(g) Duel.NegateSummon(g)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
end end
function cm.thfilter(c)
return cm.isherald(c) and c:IsAbleToHand()
function c117960683.thfilter(c)
return c117960683.heraldfilter(c) and c:IsAbleToHand()
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c117960683.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c117960683.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function c117960683.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c117960683.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
function c117960683.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end end
function cm.spfilter(c,e,tp) function c117960683.spfilter(c,e,tp)
return cm.isherald(c) and not c:IsCode(m,46935289) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c117960683.heraldfilter(c) and not c:IsCode(117960683) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c117960683.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.spfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c117960683.spfilter(chkc,e,tp) end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,0,2,e:GetHandler(),e,tp) end if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingTarget(c117960683.spfilter,tp,LOCATION_GRAVE,0,2,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,2,2,e:GetHandler(),e,tp) local g=Duel.SelectTarget(tp,c117960683.spfilter,tp,LOCATION_GRAVE,0,2,2,e:GetHandler(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function cm.sxfilter(c,tp,mg)
return (c:IsSynchroSummonable(nil,mg) or c:IsXyzSummonable(mg)) and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function c117960683.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or g:GetCount()<2 or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end if g:GetCount()==0 then return end
for tc in aux.Next(g) do if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) local tc=g:GetFirst()
while tc do
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true) tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(e:GetHandler()) end
e2:SetType(EFFECT_TYPE_SINGLE) tc=g:GetNext()
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
end end
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
local sxg=Duel.GetMatchingGroup(cm.sxfilter,tp,LOCATION_EXTRA,0,nil,tp,g) local sg=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil,g)
if sxg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then local xyzg=Duel.GetMatchingGroup(c117960683.xyzfilter,tp,LOCATION_EXTRA,0,nil,g)
if (sg:GetCount()>0 or xyzg:GetCount()>0) and not Duel.SelectYesNo(tp,aux.Stringid(117960683,3)) then return end
if sg:GetCount()>0 and xyzg:GetCount()>0 then
op=Duel.SelectOption(tp,aux.Stringid(117960683,4),aux.Stringid(117960683,5))
elseif sg:GetCount()>0 then
op=Duel.SelectOption(tp,aux.Stringid(117960683,4))
elseif xyzg:GetCount()>0 then
op=Duel.SelectOption(tp,aux.Stringid(117960683,5))+1
else
return
end
Duel.BreakEffect() Duel.BreakEffect()
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sxc=sxg:Select(tp,1,1,nil):GetFirst() local syg=sg:Select(tp,1,1,nil)
if sxc:IsType(TYPE_SYNCHRO) then Duel.SynchroSummon(tp,syg:GetFirst(),nil,g)
Duel.SynchroSummon(tp,sxc,nil,g)
else else
Duel.XyzSummon(tp,sxc,g) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
end local xyz=xyzg:Select(tp,1,1,nil):GetFirst()
Duel.XyzSummon(tp,xyz,g)
end end
end end
function c117960683.xyzfilter(c,mg)
return c:IsXyzSummonable(mg,2,2)
end
--閃光の白石
function c117981478.initial_effect(c) function c117981478.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,117981478) e1:SetCountLimit(1,117981478)
e1:SetCost(c117981478.spcost) e1:SetCost(c117981478.spcost)
e1:SetTarget(c117981478.target) e1:SetTarget(c117981478.sptg)
e1:SetOperation(c117981478.operation) e1:SetOperation(c117981478.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--race
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetTargetRange(LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0) e2:SetTargetRange(LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0)
e2:SetCode(EFFECT_CHANGE_RACE) e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetValue(RACE_DRAGON) e2:SetValue(RACE_DRAGON)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--become material
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_BE_MATERIAL) e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCondition(c117981478.bftg) e3:SetCondition(c117981478.condition)
e3:SetOperation(c117981478.bfop) e3:SetOperation(c117981478.operation)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c117981478.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c117981478.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,e:GetHandler()) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
end end
function c117981478.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c117981478.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.IsPlayerCanSpecialSummonCount(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c117981478.spfilter(c,e,tp) function c117981478.spfilter(c,e,tp)
return c:IsSetCard(0xdd) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0xdd) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c117981478.target(e,tp,eg,ep,ev,re,r,rp,chk) function c117981478.scfilter(c,mg)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1 return c:IsSynchroSummonable(nil,mg)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c117981478.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c117981478.operation(e,tp,eg,ep,ev,re,r,rp) function c117981478.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or not e:GetHandler():IsRelateToEffect(e) then return end local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c117981478.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c117981478.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
local tc=g:GetFirst() Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local c=e:GetHandler() local mg=Group.FromCards(c,g:GetFirst())
local fid=c:GetFieldID() local sg=Duel.GetMatchingGroup(c117981478.scfilter,tp,LOCATION_EXTRA,0,nil,mg)
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(117981478,1)) then
Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) Duel.BreakEffect()
Duel.SpecialSummonComplete()
g:AddCard(c)
local sg=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c,g)
if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(117981478,0)) then
if not sg then return end
local sc=sg:Select(tp,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.SynchroSummon(tp,sc,c,g) local syg=sg:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,syg:GetFirst(),nil,mg)
end
end end
end end
function c117981478.bftg(e,tp,eg,ep,ev,re,r,rp)
function c117981478.condition(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO return r==REASON_SYNCHRO
end end
function c117981478.bfop(e,tp,eg,ep,ev,re,r,rp) function c117981478.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local rc=c:GetReasonCard() local rc=c:GetReasonCard()
if rc:GetFlagEffect(117981478)==0 then if rc:GetFlagEffect(117981478)==0 then
local e1=Effect.CreateEffect(c) --negate
e1:SetDescription(aux.Stringid(117981478,1)) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(117981478,2))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(c117981478.discon) e1:SetCondition(c117981478.discon)
e1:SetOperation(c117981478.disop) e1:SetOperation(c117981478.disop)
e1:SetCode(EVENT_CHAIN_SOLVING) e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) rc:RegisterEffect(e1,true)
e1:SetAbsoluteRange(ep,0,1) local e2=Effect.CreateEffect(e:GetHandler())
rc:RegisterEffect(e1,tp) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_IGNORE_IMMUNE)
rc:RegisterFlagEffect(117981478,RESET_EVENT+RESETS_STANDARD,0,1) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CONTROL_CHANGED)
e2:SetOperation(c117981478.crop)
e2:SetLabelObject(e1)
e2:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e2,true)
rc:RegisterFlagEffect(117981478,RESET_EVENT+0x1fe0000,0,1)
end end
end end
function c117981478.discon(e,tp,eg,ep,ev,re,r,rp) function c117981478.discon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and rp==1-tp and re:GetHandler():IsAttackBelow(2500) return re:IsActiveType(TYPE_MONSTER) and 2500>=re:GetHandler():GetAttack()
and ((ep~=tp and e:GetLabel()%2==0) or (ep==tp and e:GetLabel()%2==1))
end end
function c117981478.disop(e,tp,eg,ep,ev,re,r,rp) function c117981478.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev) Duel.NegateEffect(ev)
end end
function c117981478.crop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabelObject():GetLabel()
e:GetLabelObject():SetLabel(ct+1)
end
--彼岸の到達者 ダンテ
function c118353144.initial_effect(c) function c118353144.initial_effect(c)
c:SetSPSummonOnce(118353144) c:SetSPSummonOnce(118353144)
c:EnableReviveLimit() c:EnableReviveLimit()
--special summon rule
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_TO_GRAVE)
e0:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(c118353144.sprcon)
e0:SetOperation(c118353144.sprop)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EVENT_TO_GRAVE) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_EXTRA) e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c118353144.spcon) e1:SetCondition(c118353144.xyzcon)
e1:SetOperation(c118353144.spop) e1:SetOperation(c118353144.xyzop)
e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--tograve
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(118353144,2))
e2:SetCategory(CATEGORY_TOGRAVE) e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetDescription(aux.Stringid(118353144,0))
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1+EFFECT_COUNT_CODE_SINGLE) e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetCondition(aux.NOT(c118353144.condition)) e2:SetCondition(c118353144.descon1)
e2:SetCost(c118353144.tgcost) e2:SetCost(c118353144.descost)
e2:SetTarget(c118353144.tgtg) e2:SetTarget(c118353144.destg)
e2:SetOperation(c118353144.tgop) e2:SetOperation(c118353144.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone() local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCondition(c118353144.condition) e3:SetCondition(c118353144.descon2)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--battle damage reduce
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_TO_GRAVE) e4:SetRange(LOCATION_GRAVE)
e4:SetRange(LOCATION_MZONE) e4:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e4:SetTarget(c118353144.destg) e4:SetCondition(c118353144.rdcon)
e4:SetOperation(c118353144.desop) e4:SetOperation(c118353144.rdop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--disable
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e5:SetRange(LOCATION_GRAVE) e5:SetRange(LOCATION_GRAVE)
e5:SetOperation(c118353144.damop1) e5:SetTargetRange(LOCATION_GRAVE,0)
e5:SetTarget(c118353144.disable)
e5:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EVENT_CHAINING) e6:SetCode(118353144)
e6:SetRange(LOCATION_GRAVE) e6:SetRange(LOCATION_MZONE)
e6:SetOperation(c118353144.damop2) e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetTargetRange(1,0)
c:RegisterEffect(e6) c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(10463)
e7:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e7)
--spsummon condition
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e8:SetCode(EFFECT_SPSUMMON_CONDITION)
e8:SetValue(c118353144.splimit)
c:RegisterEffect(e8)
--act limit
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_SPSUMMON)
e9:SetOperation(c118353144.limop)
c:RegisterEffect(e9)
end
--replace tograve
local dc=Duel.DiscardDeck
Duel.DiscardDeck=function(tp,count,reason)
if Duel.IsPlayerAffectedByEffect(tp,118353144) and Duel.IsExistingMatchingCard(c118353144.vafilter,tp,LOCATION_DECK,0,count,nil)
and Duel.GetFlagEffect(tp,10463)==0 and Duel.SelectYesNo(tp,aux.Stringid(118353144,1)) then
Duel.RegisterFlagEffect(tp,10463,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_CARD,0,118353144)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c118353144.vafilter,tp,LOCATION_DECK,0,count,count,nil)
return Duel.SendtoGrave(g,reason)
else
return dc(tp,count,reason)
end
end end
function c118353144.xyzfilter(c,tp,xyzc) function c118353144.vafilter(c)
return c118353144.mfilter(c,xyzc) and c:IsControler(tp) and c:IsFaceup() and c:IsPreviousLocation(LOCATION_ONFIELD) and not c:IsType(TYPE_XYZ) and c:IsSetCard(0xb1) return c:IsSetCard(0xb1) and c:IsType(TYPE_MONSTER) and (c:IsAbleToGrave() or c:IsAbleToGraveAsCost())
end
--avoid damage
local ad=Duel.Damage
Duel.Damage=function(tp,amount,reason)
local ag=Duel.GetMatchingGroup(c118353144.adfilter,tp,LOCATION_GRAVE,0,nil)
local def=ag:GetSum(Card.GetDefense)
if Duel.IsPlayerAffectedByEffect(tp,10463) and amount>0 and def>=amount and Duel.SelectYesNo(tp,aux.Stringid(118353144,2)) then
local sg=ag:SelectWithSumGreater(tp,Card.GetDefense,amount)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
return ad(tp,0,reason)
else
return ad(tp,amount,reason)
end
end end
function c118353144.mfilter(c,xyzc) function c118353144.adfilter(c)
return c:IsCanBeXyzMaterial(xyzc) return c:IsSetCard(0xb1) and c:IsType(TYPE_MONSTER) and c:GetDefense()~=0 and c:IsAbleToDeck()
end end
function c118353144.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() function c118353144.splimit(e,se,sp,st)
local mg=eg:Filter(Card.IsType,nil,TYPE_MONSTER) return not e:GetHandler():IsLocation(LOCATION_EXTRA) or (bit.band(st,SUMMON_TYPE_XYZ)==SUMMON_TYPE_XYZ and se:GetHandler():IsCode(118353144))
return mg:IsExists(c118353144.xyzfilter,1,nil,tp,c) and not mg:IsExists(aux.NOT(c118353144.mfilter),1,nil,c) and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end end
function c118353144.spop(e,tp,eg,ep,ev,re,r,rp)
function c118353144.mfilter(c,xyzc)
return c:GetFlagEffect(118353144)~=0 and c:IsCanBeXyzMaterial(xyzc)
end
function c118353144.xyzcon(e,c,og,min,max)
if c==nil then return true end
local tp=c:GetControler()
local mg=nil
if og then
mg=og:Filter(c118353144.mfilter,nil,c)
else
mg=Duel.GetMatchingGroup(c118353144.mfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,c)
end
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and mg:GetCount()>0
end
function c118353144.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.SelectYesNo(tp,aux.Stringid(118353144,0)) then local g=nil
local mg=eg:Filter(Card.IsType,nil,TYPE_MONSTER)
local sg=Group.CreateGroup() local sg=Group.CreateGroup()
for tc in aux.Next(mg) do local xyzg=Group.CreateGroup()
tc:CancelToGrave() if og then
sg:Merge(tc:GetOverlayGroup()) g=og
local tc=og:GetFirst()
else
local mg=nil
if og then
mg=og:Filter(c118353144.mfilter,nil,c)
else
mg=Duel.GetMatchingGroup(c118353144.mfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,c)
end end
Duel.SendtoGrave(sg,REASON_RULE) local ct=mg:GetCount()
c:SetMaterial(mg) xyzg:Merge(mg)
Duel.Overlay(c,mg)
Duel.SpecialSummon(c,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
c:CompleteProcedure()
end end
c:SetMaterial(xyzg)
Duel.Overlay(c,xyzg)
end
function c118353144.sprcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and eg:IsExists(c118353144.cxfilter,1,nil,tp)
and e:GetHandler():IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end end
function c118353144.tgcostfilter(c) function c118353144.cxfilter(c,tp)
return c:IsSetCard(0xb1) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsSetCard(0xb1) and c:IsType(TYPE_MONSTER)
and c:GetPreviousControler()==tp and not c:IsType(TYPE_XYZ)
end end
function c118353144.tgcost(e,tp,eg,ep,ev,re,r,rp,chk) function c118353144.cxfilter2(c,xyzc)
if chk==0 then return Duel.GetFlagEffect(tp,118353144)==0 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) and Duel.IsExistingMatchingCard(c118353144.tgcostfilter,tp,LOCATION_EXTRA,0,1,nil) end return c:IsType(TYPE_MONSTER) and c:IsCanBeXyzMaterial(xyzc) and c:IsLocation(LOCATION_GRAVE)
end
function c118353144.cxfilter3(c)
return c:IsType(TYPE_MONSTER) and c:IsLocation(LOCATION_GRAVE)
end
function c118353144.sprop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=eg:Filter(c118353144.cxfilter2,nil,c)
local g2=eg:Filter(c118353144.cxfilter3,nil)
if g:GetCount()>0 and g:GetCount()==g2:GetCount() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
and Duel.GetFlagEffect(tp,118353144)==0 and Duel.SelectYesNo(tp,aux.Stringid(118353144,3)) then
Duel.RegisterFlagEffect(tp,118353144,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,118353144,RESET_PHASE+PHASE_END,0,1)
Duel.ConfirmCards(1-tp,c)
local tc=g:GetFirst()
while tc do
if tc:GetFlagEffect(118353144)==0 then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
tc:RegisterFlagEffect(118353144,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
tc=g:GetNext()
end
Duel.XyzSummon(tp,c,nil)
end
end
function c118353144.bafilter(c)
return c:IsSetCard(0xb1)
end
function c118353144.descon1(e,tp,eg,ep,ev,re,r,rp)
local og=e:GetHandler():GetOverlayGroup():Filter(c118353144.bafilter,nil)
return og:GetClassCount(Card.GetCode)<2
end
function c118353144.descon2(e,tp,eg,ep,ev,re,r,rp)
local og=e:GetHandler():GetOverlayGroup():Filter(c118353144.bafilter,nil)
return og:GetClassCount(Card.GetCode)>=2
end
function c118353144.cfilter(c)
return c:IsSetCard(0xb1) and c:IsAbleToGraveAsCost()
end
function c118353144.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST)
and Duel.IsExistingMatchingCard(c118353144.cfilter,tp,LOCATION_EXTRA,0,1,nil) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c118353144.tgcostfilter,tp,LOCATION_EXTRA,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c118353144.cfilter,tp,LOCATION_EXTRA,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
function c118353144.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function c118353144.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,PLAYER_ALL,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,PLAYER_ALL,LOCATION_MZONE)
end end
function c118353144.tgop(e,tp,eg,ep,ev,re,r,rp) function c118353144.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
...@@ -94,86 +227,28 @@ function c118353144.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -94,86 +227,28 @@ function c118353144.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
end end
end end
function c118353144.desfilter(c)
return c:IsSetCard(0xb1) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() function c118353144.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end end
function c118353144.destg(e,tp,eg,ep,ev,re,r,rp,chk) function c118353144.rdop(e,tp,eg,ep,ev,re,r,rp)
local n=eg:Filter(Card.IsControler,nil,tp):FilterCount(Card.IsPreviousLocation,nil,LOCATION_DECK) local g=Duel.GetMatchingGroup(c118353144.adfilter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return n>0 and eg:Filter(Card.IsControler,nil,tp):IsExists(Card.IsAbleToDeck,n,nil) and Duel.GetMatchingGroup(c118353144.desfilter,tp,LOCATION_DECK,0,nil):GetCount()>=n and c:GetFlagEffect(118353145)==0 end local def=g:GetSum(Card.GetDefense)
e:SetLabel(n) if ev>0 and ev<=def and Duel.SelectYesNo(tp,aux.Stringid(118353144,2)) then
end local sg=g:SelectWithSumGreater(tp,Card.GetDefense,ev)
function c118353144.desop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
if Duel.SelectYesNo(tp,aux.Stringid(118353144,3)) then Duel.ChangeBattleDamage(tp,0)
Duel.Hint(HINT_CARD,0,118353144)
c:RegisterFlagEffect(118353145,RESET_PHASE+PHASE_END,0,1)
local n=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c118353144.desfilter,tp,LOCATION_DECK,0,n,n,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
Duel.SendtoDeck(eg,nil,2,REASON_EFFECT)
end
end end
end end
function c118353144.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():Filter(Card.IsSetCard,nil,0xb1):GetClassCount(Card.GetCode)>1 function c118353144.disable(e,c)
return c:IsCode(118353144) and e:GetHandler()~=c
end end
function c118353144.damfilter(c)
return c:IsSetCard(0xb1) and c:IsType(TYPE_MONSTER) and c:GetBaseDefense()>0 and c:IsAbleToDeck() function c118353144.limop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()==0 then return end
Duel.SetChainLimitTillChainEnd(c118353144.chlimit)
end end
function c118353144.damop1(e,tp,eg,ep,ev,re,r,rp) function c118353144.chlimit(e,rp,tp)
local val=Duel.GetBattleDamage(tp) return e:IsActiveType(TYPE_TRAP) and e:GetHandler():IsType(TYPE_COUNTER)
local g=Duel.GetMatchingGroup(c118353144.damfilter,tp,LOCATION_GRAVE,0,nil)
if g:GetSum(Card.GetBaseDefense)>val then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=g:SelectWithSumGreater(tp,Card.GetBaseDefense,val)
if tg:GetCount()>0 then
Duel.Hint(HINT_CARD,0,118353144)
Duel.SendtoDeck(tg,nil,nil,REASON_REPLACE)
Duel.ShuffleDeck(tp)
Duel.ChangeBattleDamage(tp,0)
end
end
end
function c118353144.damop2(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetLabel(Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID))
e1:SetValue(c118353144.damval)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
Duel.RegisterEffect(e2,tp)
end
function c118353144.damval(e,re,val,r,rp,rc)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(c118353144.damfilter,tp,LOCATION_GRAVE,0,nil)
if Duel.GetCurrentChain()~=0 and bit.band(r,REASON_EFFECT)~=0 and Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)==e:GetLabel() and g:GetSum(Card.GetBaseDefense)>=val then
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetLabel(val)
e1:SetOperation(c118353144.damop3)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
return 0
end
return val
end
function c118353144.damop3(e,tp,eg,ep,ev,re,r,rp)
local val=e:GetLabel()
local g=Duel.GetMatchingGroup(c118353144.damfilter,tp,LOCATION_GRAVE,0,nil)
if g:GetSum(Card.GetBaseDefense)>=val then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=g:SelectWithSumGreater(tp,Card.GetBaseDefense,val)
if tg:GetCount()>0 then
Duel.Hint(HINT_CARD,0,118353144)
Duel.SendtoDeck(tg,nil,nil,REASON_REPLACE)
Duel.ShuffleDeck(tp)
end
end
end end
--真竜剣の解放
function c118776531.initial_effect(c) function c118776531.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c118776531.target1) e1:SetTarget(c118776531.target)
e1:SetOperation(c118776531.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--act limit
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING) e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c118776531.chainop) e2:SetOperation(c118776531.chainop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--tribute summon
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SUMMON) e3:SetCategory(CATEGORY_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_MAIN_END)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,118776531) e3:SetCountLimit(1,118776531)
e3:SetCondition(c118776531.sumcon) e3:SetCondition(c118776531.sumcon)
e3:SetTarget(c118776531.target2) e3:SetTarget(c118776531.sumtg)
e3:SetOperation(c118776531.activate) e3:SetOperation(c118776531.sumop)
e3:SetLabel(1)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--search & destroy
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SEARCH) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_GRAVE) e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,98725103) e4:SetCountLimit(1,10467)
e4:SetCondition(c118776531.shcon) e4:SetCondition(c118776531.thcon)
e4:SetTarget(c118776531.shtg) e4:SetTarget(c118776531.thtg)
e4:SetOperation(c118776531.shop) e4:SetOperation(c118776531.thop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--act in hand
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE) e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetCode(EFFECT_TRAP_ACT_IN_HAND) e5:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e5:SetCondition(c118776531.actcon) e5:SetCondition(c118776531.handcon)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--
local e6=Effect.CreateEffect(c)
e6:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_REMOVE_TYPE)
e6:SetValue(TYPE_QUICKPLAY)
c:RegisterEffect(e6)
if c118776531.counter==nil then
c118776531.counter=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge1:SetCode(EVENT_TO_GRAVE)
ge1:SetOperation(c118776531.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c118776531.clearop)
Duel.RegisterEffect(ge2,0)
end
end
--activate
function c118776531.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ph=Duel.GetCurrentPhase()
if chk==0 then return true end
if (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) and Duel.IsExistingMatchingCard(c118776531.sumfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.GetFlagEffect(tp,118776531)==0 and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_SUMMON)
e:SetOperation(c118776531.sumop)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
Duel.RegisterFlagEffect(tp,118776531,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(118776531,0))
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
--act limit
function c118776531.chainop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsSetCard(0xf9) then
Duel.SetChainLimit(c118776531.chainlm)
end
end
function c118776531.chainlm(e,rp,tp)
return tp==rp
end end
--tribute summon
function c118776531.sumcon(e,tp,eg,ep,ev,re,r,rp) function c118776531.sumcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2 return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
...@@ -47,19 +101,14 @@ end ...@@ -47,19 +101,14 @@ end
function c118776531.sumfilter(c) function c118776531.sumfilter(c)
return c:IsSetCard(0xf9) and c:IsSummonable(true,nil,1) return c:IsSetCard(0xf9) and c:IsSummonable(true,nil,1)
end end
function c118776531.target1(e,tp,eg,ep,ev,re,r,rp,chk) function c118776531.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return Duel.IsExistingMatchingCard(c118776531.sumfilter,tp,LOCATION_HAND,0,1,nil)
e:SetLabel(0) and Duel.GetFlagEffect(tp,118776531)==0 end
if Duel.IsExistingMatchingCard(c118776531.sumfilter,tp,LOCATION_HAND,0,1,nil) Duel.RegisterFlagEffect(tp,118776531,RESET_PHASE+PHASE_END,0,1)
and Duel.GetFlagEffect(tp,118776531)==0 and Duel.SelectYesNo(tp,94) then
e:SetLabel(1)
Duel.RegisterFlagEffect(tp,118776531,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end end
function c118776531.activate(e,tp,eg,ep,ev,re,r,rp) function c118776531.sumop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()~=1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c118776531.sumfilter,tp,LOCATION_HAND,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c118776531.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
...@@ -67,39 +116,101 @@ function c118776531.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -67,39 +116,101 @@ function c118776531.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Summon(tp,tc,true,nil,1) Duel.Summon(tp,tc,true,nil,1)
end end
end end
function c118776531.chainop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler() --search & destroy
if rc:IsSetCard(0xf9) then function c118776531.thcon(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimit(c118776531.chainlm) return e:GetHandler():IsPreviousLocation(LOCATION_SZONE)
end
end end
function c118776531.chainlm(e,rp,tp) function c118776531.thfilter(c,tp)
return tp==rp return c:IsSetCard(0xf9) and (c:GetType()==0x20004 or c:GetType()==0x20002) and not c:IsCode(118776531)
and (c:IsAbleToHand() or c:GetActivateEffect():IsActivatable(tp))
end end
function c118776531.target2(e,tp,eg,ep,ev,re,r,rp,chk) function c118776531.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetFlagEffect(tp,118776531)==0 if chk==0 then return Duel.IsExistingMatchingCard(c118776531.thfilter,tp,LOCATION_DECK,0,1,nil,tp) end
and Duel.IsExistingMatchingCard(c118776531.sumfilter,tp,LOCATION_HAND,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.RegisterFlagEffect(tp,118776531,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end end
function c118776531.shcon(e,tp,eg,ep,ev,re,r,rp) function c118776531.mpfilter(c)
return e:GetHandler():IsPreviousLocation(LOCATION_SZONE) return c:IsFaceup() and c:IsCode(21377582)
end end
function c118776531.shfilter(c,tp) function c118776531.thop(e,tp,eg,ep,ev,re,r,rp)
return c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(0xf9) and not c:IsCode(118776531) and (c:IsAbleToHand() or c:GetActivateEffect():IsActivatable(tp)) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c118776531.thfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
local tc=g:GetFirst()
if tc then
if tc:IsAbleToHand() and (not tc:GetActivateEffect():IsActivatable(tp) or Duel.SelectYesNo(tp,aux.Stringid(118776531,2))) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.RaiseEvent(tc,EVENT_CHAIN_SOLVED,tc:GetActivateEffect(),0,tp,tp,Duel.GetCurrentChain())
end
--destroy
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
if Duel.IsExistingMatchingCard(c118776531.mpfilter,tp,LOCATION_MZONE,0,1,nil) and sg:GetCount()>0
and Duel.SelectYesNo(tp,aux.Stringid(118776531,3)) then
Duel.BreakEffect()
Duel.Destroy(sg,REASON_EFFECT)
end
end
end
--act in hand
function c118776531.handcon(e)
local ph=Duel.GetCurrentPhase()
local tp=e:GetHandler():GetControler()
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) and Duel.GetTurnPlayer()==tp and Duel.GetCurrentChain()==0
end
--change script
local st=Effect.SetTarget
Effect.SetTarget=function(e,tg)
if e:GetDescription()==aux.Stringid(58984738,1) or e:GetDescription()==aux.Stringid(22499034,1) then
return st(e,c118776531.tg)
else
return st(e,tg)
end
end
local so=Effect.SetOperation
Effect.SetOperation=function(e,op)
if e:GetDescription()==aux.Stringid(58984738,1) or e:GetDescription()==aux.Stringid(22499034,1) then
return so(e,c118776531.op)
else
return so(e,op)
end
end end
function c118776531.shtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c118776531.shfilter,tp,LOCATION_DECK,0,1,nil,tp) end function c118776531.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if c:GetOriginalCode()==58984738 then
if chk==0 then return Duel.IsExistingMatchingCard(c118776531.filter1,tp,LOCATION_DECK,0,1,nil,tp) end
else
if chk==0 then return Duel.IsExistingMatchingCard(c118776531.filter2,tp,LOCATION_DECK,0,1,nil,tp) end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c118776531.shop(e,tp,eg,ep,ev,re,r,rp) function c118776531.filter1(c,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF) return c:IsSetCard(0xf9) and (c:GetType()==0x20004 or c:IsCode(118776531))
local g=Duel.SelectMatchingCard(tp,c118776531.shfilter,tp,LOCATION_DECK,0,1,1,nil,tp) and (c:IsAbleToHand() or c:GetActivateEffect():IsActivatable(tp))
end
function c118776531.filter2(c,tp)
return c:IsSetCard(0xf9) and (c:GetType()==0x20002 or c:IsCode(118776531))
and (c:IsAbleToHand() or c:GetActivateEffect():IsActivatable(tp))
end
function c118776531.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=0
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(58984738,3))
if c:GetOriginalCode()==58984738 then
g=Duel.SelectMatchingCard(tp,c118776531.filter1,tp,LOCATION_DECK,0,1,1,nil,tp)
else
g=Duel.SelectMatchingCard(tp,c118776531.filter2,tp,LOCATION_DECK,0,1,1,nil,tp)
end
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
local b1=tc:IsAbleToHand() local b1=tc:IsAbleToHand()
local b2=tc:GetActivateEffect():IsActivatable(tp) local b2=tc:GetActivateEffect():IsActivatable(tp)
if b1 and (Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or not b2 or Duel.SelectYesNo(tp,aux.Stringid(118776531,0))) then if b1 and (not b2 or Duel.SelectYesNo(tp,aux.Stringid(58984738,2))) then
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
else else
...@@ -108,17 +219,53 @@ function c118776531.shop(e,tp,eg,ep,ev,re,r,rp) ...@@ -108,17 +219,53 @@ function c118776531.shop(e,tp,eg,ep,ev,re,r,rp)
local tep=tc:GetControler() local tep=tc:GetControler()
local cost=te:GetCost() local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,EVENT_CHAIN_SOLVED,te,0,tp,tp,Duel.GetCurrentChain())
end end
local dg=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD) end
if dg:GetCount()>0 and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,0,1,nil,57761191,21377582) and Duel.SelectYesNo(tp,aux.Stringid(118776531,1)) then end
Duel.BreakEffect()
Duel.Destroy(dg,REASON_EFFECT) function c118776531.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsPreviousLocation(LOCATION_ONFIELD) and tc:IsSetCard(0xf9) then
local typ=bit.band(tc:GetOriginalType(),0x7)
if tc:GetOriginalCode()==118776531 and Duel.GetFlagEffect(0,49430783)==0 then
c49430782.counter=c49430782.counter+1
Duel.RegisterFlagEffect(0,49430783,RESET_PHASE+PHASE_END,0,1)
end
if tc:GetOriginalCode()==118776531 and Duel.GetFlagEffect(0,49430784)==0 then
c49430782.counter=c49430782.counter+1
Duel.RegisterFlagEffect(0,49430784,RESET_PHASE+PHASE_END,0,1)
end
if (typ==TYPE_MONSTER and Duel.GetFlagEffect(0,49430782)==0)
or (typ==TYPE_SPELL and Duel.GetFlagEffect(0,49430783)==0)
or (typ==TYPE_TRAP and Duel.GetFlagEffect(0,49430784)==0) then
c49430782.counter=c49430782.counter+1
if typ==TYPE_MONSTER then
Duel.RegisterFlagEffect(0,49430782,RESET_PHASE+PHASE_END,0,1)
elseif typ==TYPE_SPELL then
Duel.RegisterFlagEffect(0,49430783,RESET_PHASE+PHASE_END,0,1)
else
Duel.RegisterFlagEffect(0,49430784,RESET_PHASE+PHASE_END,0,1)
end end
end end
end
tc=eg:GetNext()
end
end
--[[
local ist=Card.IsSetCard
Card.IsSetCard=function(card,category)
return true
end
local co=Effect.SetCountLimit
Effect.SetCountLimit=function(effect,count,code)
return co(effect,99999,code)
end end
function c118776531.actcon(e)
local tp=e:GetHandlerPlayer() local sv=Effect.SetValue
return Duel.GetCurrentChain()==0 and Duel.GetTurnPlayer()==tp Effect.SetValue=function(effect,value)
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) return sv(effect,0)
end end
]]
--青眼の幻白龍
function c118817732.initial_effect(c) function c118817732.initial_effect(c)
aux.AddXyzProcedure(c,nil,8,2)
c:EnableReviveLimit() c:EnableReviveLimit()
--xyz summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(118817732,0)) e1:SetDescription(aux.Stringid(118817732,0))
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA) e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(aux.XyzCondition(nil,8,2,2)) e1:SetCondition(c118817732.xyzcon)
e1:SetTarget(aux.XyzTarget(nil,8,2,2)) e1:SetOperation(c118817732.xyzop)
e1:SetOperation(aux.XyzOperation(nil,8,2,2))
e1:SetValue(SUMMON_TYPE_XYZ) e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(118817732,1))
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_MZONE)
e2:SetRange(LOCATION_EXTRA) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCountLimit(1,118817732) e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetCondition(c118817732.xyzcondition) e2:SetCondition(c118817732.tgcon)
e2:SetTarget(c118817732.xyztarget) e2:SetTarget(c118817732.tgtg)
e2:SetOperation(aux.XyzOperation(nil,8,2,2)) e2:SetValue(aux.tgoval)
e2:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_IMMUNE_EFFECT) e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetRange(LOCATION_MZONE) e3:SetValue(c118817732.efilter)
e3:SetCondition(c118817732.indcon)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_DRAGON))
e3:SetValue(c118817732.imvalue)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--tohand or spsummon
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD) e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c118817732.indcon) e4:SetCountLimit(1)
e4:SetTargetRange(LOCATION_MZONE,0) e4:SetCost(c118817732.spcost)
e4:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_DRAGON)) e4:SetTarget(c118817732.sptg)
e4:SetValue(c118817732.indvalue) e4:SetOperation(c118817732.spop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--destroy
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(118817732,2))
e5:SetCategory(CATEGORY_DESTROY) e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EVENT_ATTACK_ANNOUNCE) e5:SetCode(EVENT_ATTACK_ANNOUNCE)
e5:SetCondition(c118817732.atkcon) e5:SetRange(LOCATION_MZONE)
e5:SetTarget(c118817732.atktg) e5:SetCondition(c118817732.descon)
e5:SetOperation(c118817732.atkop) e5:SetTarget(c118817732.destg)
e5:SetOperation(c118817732.desop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(118817732,3))
e6:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1)
e6:SetCost(c118817732.sccost)
e6:SetTarget(c118817732.sctg)
e6:SetOperation(c118817732.scop)
c:RegisterEffect(e6)
end end
function c118817732.xyzfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsCanOverlay() function c118817732.mfilter(c,xyzc)
return c:IsRace(RACE_DRAGON) and c:IsCanBeXyzMaterial(xyzc)
end end
function c118817732.xyzcondition(e,c,og,min,max) function c118817732.xyzcon(e,c,og,min,max)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local mg return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
if og then and (not min or min<=2 and max>=2)
mg=og and Duel.IsExistingMatchingCard(c118817732.mfilter,tp,LOCATION_HAND,0,2,nil,c)
else and Duel.GetFlagEffect(tp,118817732)==0
mg=Duel.GetFieldGroup(tp,LOCATION_HAND,0) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
return mg:IsExists(c118817732.xyzfilter,2,nil)
end end
function c118817732.xyztarget(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max) function c118817732.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
local xyzg=Group.CreateGroup()
if og and not min then
g=og
local tc=og:GetFirst()
while tc do
sg:Merge(tc:GetOverlayGroup())
tc=og:GetNext()
end
else
local mg=nil local mg=nil
if og then if og then
mg=og mg=og:Filter(c118817732.mfilter,nil,c)
else else
mg=Duel.GetMatchingGroup(c118817732.xyzfilter,tp,LOCATION_HAND,0,nil) mg=Duel.GetMatchingGroup(c118817732.mfilter,tp,LOCATION_HAND,0,nil,c)
end end
local g=mg:Select(tp,2,2,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
if g then local mtg=mg:Select(tp,2,2,nil)
g:KeepAlive() xyzg:Merge(mtg)
e:SetLabelObject(g) end
return true Duel.ConfirmCards(1-c:GetControler(),c)
else return false end Duel.RegisterFlagEffect(c:GetControler(),118817732,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_OPSELECTED,1-c:GetControler(),aux.Stringid(118817732,0))
c:SetMaterial(xyzg)
Duel.Overlay(c,xyzg)
end
function c118817732.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayCount()~=0
end end
function c118817732.indcon(e) function c118817732.tgtg(e,c)
return e:GetHandler():GetOverlayCount()>0 return c:IsRace(RACE_DRAGON)
end end
function c118817732.imvalue(e,re) function c118817732.efilter(e,te)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandlerPlayer()~=e:GetHandlerPlayer() return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and te:GetOwner()~=e:GetOwner()
and te:IsActiveType(TYPE_MONSTER)
end end
function c118817732.indvalue(e,re)
return re:GetHandlerPlayer()~=e:GetHandlerPlayer() function c118817732.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function c118817732.atkcon(e,tp,eg,ep,ev,re,r,rp) function c118817732.spfilter(c,ft,e,tp)
return Duel.GetAttacker():IsType(TYPE_NORMAL) and Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0 return c:IsSetCard(0xdd) and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end end
function c118817732.atktg(e,tp,eg,ep,ev,re,r,rp,chk) function c118817732.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) return Duel.IsExistingMatchingCard(c118817732.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,ft,e,tp)
end
end end
function c118817732.atkop(e,tp,eg,ep,ev,re,r,rp) function c118817732.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateAttack() then local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD) local g=Duel.SelectMatchingCard(tp,c118817732.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,ft,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT) local th=g:GetFirst():IsAbleToHand()
local sp=ft>0 and g:GetFirst():IsCanBeSpecialSummoned(e,0,tp,false,false)
local op=0
if th and sp then op=Duel.SelectOption(tp,aux.Stringid(118817732,2),aux.Stringid(118817732,3))
elseif th then op=0
else op=1 end
if op==0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
else
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
end end
end end
function c118817732.sccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end function c118817732.descon(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) local tc=Duel.GetAttacker()
end return tc:IsType(TYPE_NORMAL)
function c118817732.scfilter(c,e,tp)
return c:IsSetCard(0xdd) and c:IsType(TYPE_MONSTER) and (c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 or c:IsAbleToHand())
end end
function c118817732.sctg(e,tp,eg,ep,ev,re,r,rp,chk) function c118817732.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c118817732.scfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end end
function c118817732.scop(e,tp,eg,ep,ev,re,r,rp) function c118817732.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF) local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
local g=Duel.SelectMatchingCard(tp,c118817732.scfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp) if Duel.Destroy(g,REASON_EFFECT)~=0 then
local tc=g:GetFirst() Duel.NegateAttack()
if tc then
local b1=tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b2=tc:IsAbleToHand()
if b1 and (not b2 or Duel.SelectYesNo(tp,aux.Stringid(118817732,4))) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end end
end end
...@@ -6,7 +6,6 @@ function c119150521.initial_effect(c) ...@@ -6,7 +6,6 @@ function c119150521.initial_effect(c)
e1:SetCountLimit(1,119150520+EFFECT_COUNT_CODE_DUEL) e1:SetCountLimit(1,119150520+EFFECT_COUNT_CODE_DUEL)
e1:SetCondition(c119150521.spcon) e1:SetCondition(c119150521.spcon)
e1:SetCost(c119150521.spcost) e1:SetCost(c119150521.spcost)
e1:SetTarget(aux.TRUE)
e1:SetOperation(c119150521.operation) e1:SetOperation(c119150521.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -49,15 +48,16 @@ function c119150521.costfilter(c) ...@@ -49,15 +48,16 @@ function c119150521.costfilter(c)
end end
function c119150521.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c119150521.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return not c:IsPublic() and Duel.IsExistingMatchingCard(c119150521.costfilter,tp,LOCATION_HAND,0,2,c) end if chk==0 then return c:IsDiscardable() and not c:IsPublic() and Duel.IsExistingMatchingCard(c119150521.costfilter,tp,LOCATION_HAND,0,2,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c119150521.costfilter,tp,LOCATION_HAND,0,2,2,c) local g=Duel.SelectMatchingCard(tp,c119150521.costfilter,tp,LOCATION_HAND,0,2,2,c)
g:AddCard(c) g:AddCard(c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local tg=g:FilterSelect(tp,Card.IsDiscardable,2,2,nil) local tg=g:Select(tp,2,2,nil)
Duel.SendtoGrave(tg,REASON_COST+REASON_DISCARD) Duel.SendtoGrave(tg,REASON_COST+REASON_DISCARD)
end end
function c119150521.operation(e,tp,eg,ep,ev,re,r,rp) function c119150521.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SkipPhase(1-tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1) Duel.SkipPhase(1-tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1) Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1) Duel.SkipPhase(1-tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
......
--Kozmoll Construct
function c120366274.initial_effect(c) function c120366274.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
local e1=Effect.CreateEffect(c) aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0xd2),aux.FilterBoolFunction(Card.IsFusionAttribute,ATTRIBUTE_LIGHT),true)
e1:SetType(EFFECT_TYPE_SINGLE) --cannot spsummon
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_FUSION_MATERIAL)
e1:SetCondition(c120366274.FShaddollCondition(ATTRIBUTE_LIGHT))
e1:SetOperation(c120366274.FShaddollOperation(ATTRIBUTE_LIGHT))
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
...@@ -14,15 +10,19 @@ function c120366274.initial_effect(c) ...@@ -14,15 +10,19 @@ function c120366274.initial_effect(c)
e2:SetRange(LOCATION_EXTRA) e2:SetRange(LOCATION_EXTRA)
e2:SetValue(c120366274.splimit) e2:SetValue(c120366274.splimit)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--tograve
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY) e3:SetDescription(aux.Stringid(120366274,0))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetTarget(c120366274.tgtg) e3:SetTarget(c120366274.tgtg)
e3:SetOperation(c120366274.tgop) e3:SetOperation(c120366274.tgop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(120366274,1))
e4:SetCategory(CATEGORY_DESTROY) e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_BATTLE_START) e4:SetCode(EVENT_BATTLE_START)
...@@ -30,7 +30,9 @@ function c120366274.initial_effect(c) ...@@ -30,7 +30,9 @@ function c120366274.initial_effect(c)
e4:SetTarget(c120366274.destg) e4:SetTarget(c120366274.destg)
e4:SetOperation(c120366274.desop) e4:SetOperation(c120366274.desop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--tohand
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(120366274,2))
e5:SetCategory(CATEGORY_TOHAND) e5:SetCategory(CATEGORY_TOHAND)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_TO_GRAVE) e5:SetCode(EVENT_TO_GRAVE)
...@@ -38,6 +40,7 @@ function c120366274.initial_effect(c) ...@@ -38,6 +40,7 @@ function c120366274.initial_effect(c)
e5:SetTarget(c120366274.thtg) e5:SetTarget(c120366274.thtg)
e5:SetOperation(c120366274.thop) e5:SetOperation(c120366274.thop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--cannot be targeted
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE) e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e6:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
...@@ -46,75 +49,19 @@ function c120366274.initial_effect(c) ...@@ -46,75 +49,19 @@ function c120366274.initial_effect(c)
e6:SetValue(aux.tgoval) e6:SetValue(aux.tgoval)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function c120366274.FShaddollFilter(c,fc,attr)
return (c120366274.FShaddollFilter1(c) or c120366274.FShaddollFilter2(c,attr)) and c:IsCanBeFusionMaterial(fc) and not c:IsHasEffect(6205579)
end
function c120366274.FShaddollExFilter(c,fc,attr)
return c:IsFaceup() and c120366274.FShaddollFilter(c,fc,attr)
end
function c120366274.FShaddollFilter1(c)
return c:IsFusionSetCard(0xd2)
end
function c120366274.FShaddollFilter2(c,attr)
return c:IsFusionAttribute(attr)
end
function c120366274.FShaddollSpFilter1(c,fc,tp,mg,exg,attr,chkf)
return mg:IsExists(c120366274.FShaddollSpFilter2,1,c,fc,tp,c,attr,chkf)
end
function c120366274.FShaddollSpFilter2(c,fc,tp,mc,attr,chkf)
local sg=Group.FromCards(c,mc)
if sg:IsExists(aux.TuneMagicianCheckX,1,nil,sg,EFFECT_TUNE_MAGICIAN_F) then return false end
if not aux.MustMaterialCheck(sg,tp,EFFECT_MUST_BE_FMATERIAL) then return false end
if aux.FCheckAdditional and not aux.FCheckAdditional(tp,sg,fc) then return false end
return ((c120366274.FShaddollFilter1(c) and c120366274.FShaddollFilter2(mc,attr))
or (c120366274.FShaddollFilter2(c,attr) and c120366274.FShaddollFilter1(mc)))
and (chkf==PLAYER_NONE or Duel.GetLocationCountFromEx(tp,tp,sg,fc)>0)
end
function c120366274.FShaddollCondition(attr)
return function(e,g,gc,chkf)
if g==nil then return aux.MustMaterialCheck(nil,e:GetHandlerPlayer(),EFFECT_MUST_BE_FMATERIAL) end
local c=e:GetHandler()
local mg=g:Filter(c120366274.FShaddollFilter,nil,c,attr)
local tp=e:GetHandlerPlayer()
local exg=nil
if gc then
if not mg:IsContains(gc) then return false end
return c120366274.FShaddollSpFilter1(gc,c,tp,mg,exg,attr,chkf)
end
return mg:IsExists(c120366274.FShaddollSpFilter1,1,nil,c,tp,mg,exg,attr,chkf)
end
end
function c120366274.FShaddollOperation(attr)
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
local c=e:GetHandler()
local mg=eg:Filter(c120366274.FShaddollFilter,nil,c,attr)
local g=nil
if gc then
g=Group.FromCards(gc)
mg:RemoveCard(gc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g=mg:FilterSelect(tp,c120366274.FShaddollSpFilter1,1,1,nil,c,tp,mg,exg,attr,chkf)
mg:Sub(g)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg:FilterSelect(tp,c120366274.FShaddollSpFilter2,1,1,nil,c,tp,g:GetFirst(),attr,chkf)
g:Merge(sg)
Duel.SetFusionMaterial(g)
end
end
function c120366274.splimit(e,se,sp,st) function c120366274.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end end
function c120366274.tgfilter(c) function c120366274.tgfilter(c)
return c:IsSetCard(0xd2) and c:IsDestructable() return c:IsSetCard(0xd2) and c:IsAbleToGrave()
end end
function c120366274.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function c120366274.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c120366274.tgfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c120366274.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end end
function c120366274.tgop(e,tp,eg,ep,ev,re,r,rp) function c120366274.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c120366274.tgfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c120366274.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
...@@ -123,7 +70,7 @@ end ...@@ -123,7 +70,7 @@ end
function c120366274.descon(e,tp,eg,ep,ev,re,r,rp) function c120366274.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local bc=c:GetBattleTarget() local bc=c:GetBattleTarget()
return bc and bc:IsSummonType(SUMMON_TYPE_SPECIAL) return bc and bit.band(bc:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end end
function c120366274.destg(e,tp,eg,ep,ev,re,r,rp,chk) function c120366274.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
...@@ -149,5 +96,6 @@ function c120366274.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -149,5 +96,6 @@ function c120366274.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end end
end end
--闪光之宣告者 --閃光の宣告者
local m=121074344 function c121074344.initial_effect(c)
local cm=_G["c"..m] --Negate
function cm.initial_effect(c)
--Negate summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1)) e1:SetDescription(aux.Stringid(121074344,0))
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_TOHAND) e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_SUMMON) e1:SetCode(EVENT_SUMMON)
e1:SetCondition(cm.discon) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCost(cm.discost) e1:SetRange(LOCATION_HAND)
e1:SetTarget(cm.distg) e1:SetCondition(c121074344.discon)
e1:SetOperation(cm.disop) e1:SetCost(c121074344.discost)
e1:SetTarget(c121074344.distg)
e1:SetOperation(c121074344.disop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON) e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e4=e1:Clone()
e4:SetDescription(aux.Stringid(m,0))
e4:SetCountLimit(1,117960683)
e4:SetCost(cm.discost2)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e5)
end end
function cm.discon(e,tp,eg,ep,ev,re,r,rp) function c121074344.discon(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep and Duel.GetCurrentChain()==0 return ep~=tp and Duel.GetCurrentChain()==0
end end
function cm.costfilter(c) function c121074344.costfilter(c,tp)
return c:IsRace(RACE_FAIRY) and c:IsAbleToGraveAsCost() return (c:IsRace(RACE_FAIRY) and c:IsLocation(LOCATION_HAND) or (c:IsCode(117960683) and Duel.GetFlagEffect(tp,117960683)==0))
and c:IsAbleToGraveAsCost()
end end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk) function c121074344.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and if chk==0 then return c:IsAbleToGraveAsCost()
Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,c) end and Duel.IsExistingMatchingCard(c121074344.costfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND,0,1,1,c) local g=Duel.SelectMatchingCard(tp,c121074344.costfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,c,tp)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_DECK) then
Duel.RegisterFlagEffect(tp,10458,RESET_PHASE+PHASE_END,0,1)
end
g:AddCard(c) g:AddCard(c)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) function c121074344.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,eg,eg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,eg,1,0,0)
end end
function cm.disop(e,tp,eg,ep,ev,re,r,rp) function c121074344.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg) Duel.NegateSummon(eg:GetFirst())
Duel.SendtoHand(eg,nil,REASON_EFFECT) Duel.SendtoHand(eg,nil,REASON_EFFECT)
end end
function cm.dcostfilter(c)
return c:IsCode(117960683) and c:IsAbleToGraveAsCost()
end
function cm.discost2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(cm.dcostfilter,tp,LOCATION_DECK,0,1,nil) end
local tc=Duel.GetFirstMatchingCard(cm.dcostfilter,tp,LOCATION_DECK,0,nil)
Duel.SendtoGrave(Group.FromCards(c,tc),REASON_COST)
end
\ No newline at end of file
--帝王の重圧
function c123064604.initial_effect(c) function c123064604.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
...@@ -6,123 +8,167 @@ function c123064604.initial_effect(c) ...@@ -6,123 +8,167 @@ function c123064604.initial_effect(c)
e1:SetTarget(c123064604.target) e1:SetTarget(c123064604.target)
e1:SetOperation(c123064604.activate) e1:SetOperation(c123064604.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--cannot set
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DISABLE) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EFFECT_CANNOT_MSET)
e2:SetCode(EVENT_CHAINING) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1) e2:SetTargetRange(0,1)
e2:SetCondition(c123064604.discon) e2:SetCondition(c123064604.discon)
e2:SetTarget(c123064604.distg) e2:SetTarget(aux.TRUE)
e2:SetOperation(c123064604.disop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_CANNOT_SSET)
e3:SetCode(EFFECT_CANNOT_MSET)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(0,1)
e3:SetCondition(c123064604.setcon)
e3:SetTarget(aux.TRUE)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=e3:Clone() local e4=e2:Clone()
e4:SetCode(EFFECT_CANNOT_SSET) e4:SetCode(EFFECT_CANNOT_TURN_SET)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e5=e3:Clone() local e5=e2:Clone()
e5:SetCode(EFFECT_CANNOT_TURN_SET) e5:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e5:SetTarget(c123064604.sumlimit)
c:RegisterEffect(e5) c:RegisterEffect(e5)
local e6=e3:Clone() --negate
e6:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) local e6=Effect.CreateEffect(c)
e6:SetTarget(c123064604.sumlimit) e6:SetCategory(CATEGORY_NEGATE+CATEGORY_SUMMON)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetCode(EVENT_CHAINING)
e6:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e6:SetRange(LOCATION_SZONE)
e6:SetCountLimit(1)
e6:SetCondition(c123064604.ngcon)
e6:SetTarget(c123064604.ngtg)
e6:SetOperation(c123064604.ngop)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function c123064604.filter1(c,e,tp)
function c123064604.spfilter(c,e,tp)
return c:GetAttack()==800 and c:GetDefense()==1000 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:GetAttack()==800 and c:GetDefense()==1000 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c123064604.filter2(c) function c123064604.thfilter(c)
return c:GetAttack()==2800 and c:GetDefense()==1000 and c:IsAbleToHand() return c:GetAttack()==2800 and c:GetDefense()==1000 and c:IsAbleToHand()
end end
function c123064604.target(e,tp,eg,ep,ev,re,r,rp,chk) function c123064604.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=(Duel.IsExistingMatchingCard(c123064604.filter1,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) local b1=Duel.IsExistingMatchingCard(c123064604.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b2=Duel.IsExistingMatchingCard(c123064604.filter2,tp,LOCATION_DECK,0,1,nil) local b2=Duel.IsExistingMatchingCard(c123064604.thfilter,tp,LOCATION_DECK,0,1,nil)
if chk==0 then return b1 or b2 end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) local op=2
end if (b1 or b2) and Duel.SelectYesNo(tp,aux.Stringid(123064604,3)) then
function c123064604.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local b1=(Duel.IsExistingMatchingCard(c123064604.filter1,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)
local b2=Duel.IsExistingMatchingCard(c123064604.filter2,tp,LOCATION_DECK,0,1,nil)
local op=0
if b1 and b2 then if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(123064604,0),aux.Stringid(123064604,1)) op=Duel.SelectOption(tp,aux.Stringid(123064604,0),aux.Stringid(123064604,1))
elseif b1 then elseif b1 and not b2 then
op=Duel.SelectOption(tp,aux.Stringid(123064604,0)) op=Duel.SelectOption(tp,aux.Stringid(123064604,0))
else elseif not b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(123064604,1))+1 op=Duel.SelectOption(tp,aux.Stringid(123064604,1))+1
end end
if op==0 then if op==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
else
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
end
e:SetLabel(op)
end
function c123064604.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==2 or not e:GetHandler():IsRelateToEffect(e) then return end
local c=e:GetHandler()
if e:GetLabel()==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c123064604.filter1,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c123064604.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end end
else elseif e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c123064604.filter2,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c123064604.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
end end
function c123064604.discon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev) function c123064604.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumpos,POS_FACEDOWN)>0
end
function c123064604.cfilter(c)
return bit.band(c:GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE
end end
function c123064604.sumfilter(c,lv) function c123064604.discon(e)
return c:GetLevel()>=lv and (c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)) and not c:IsPublic() local tp=e:GetHandlerPlayer()
return Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)==0
and Duel.IsExistingMatchingCard(c123064604.cfilter,tp,LOCATION_MZONE,0,1,nil)
and not Duel.IsExistingMatchingCard(c123064604.cfilter,tp,0,LOCATION_MZONE,1,nil)
end end
function c123064604.distg(e,tp,eg,ep,ev,re,r,rp,chk)
local ec=eg:GetFirst() function c123064604.ngcon(e,tp,eg,ep,ev,re,r,rp)
local lv=99 local c=e:GetHandler()
if ec:IsType(TYPE_XYZ) then local rc=re:GetHandler()
lv=ec:GetOriginalRank() if rc:IsType(TYPE_LINK) then return false end
elseif not ec:IsType(TYPE_LINK) then if not rc:IsType(TYPE_XYZ) then
lv=ec:GetOriginalLevel() local lv=rc:GetLevel()
return re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev) and ep~=tp
and Duel.IsExistingMatchingCard(c123064604.lvfilter,tp,LOCATION_HAND,0,1,nil,lv)
else
local rk=rc:GetRank()
return re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev) and ep~=tp
and Duel.IsExistingMatchingCard(c123064604.rkfilter,tp,LOCATION_HAND,0,1,nil,rk)
end end
if chk==0 then return Duel.IsExistingMatchingCard(c123064604.sumfilter,tp,LOCATION_HAND,0,1,nil,lv) end end
function c123064604.lvfilter(c,lv)
return c:GetLevel()>=lv and (c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)) and not c:IsPublic()
end
function c123064604.rkfilter(c,rk)
return c:GetLevel()>=rk and (c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)) and not c:IsPublic()
end
function c123064604.ngtg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=re:GetHandler()
if not rc:IsType(TYPE_XYZ) then
local lv=rc:GetLevel()
if chk==0 then return Duel.IsExistingMatchingCard(c123064604.lvfilter,tp,LOCATION_HAND,0,1,nil,lv) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c123064604.sumfilter,tp,LOCATION_HAND,0,1,1,nil,lv) local g=Duel.SelectMatchingCard(tp,c123064604.lvfilter,tp,LOCATION_HAND,0,1,1,nil,lv)
if g:GetCount()>0 then
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp) local tc=g:GetFirst()
Duel.SetTargetCard(g) e:SetLabelObject(tc)
tc:RegisterFlagEffect(123064604,RESET_EVENT+0x1fe0000+RESET_CHAIN,0,1)
else
local rk=rc:GetRank()
if chk==0 then return Duel.IsExistingMatchingCard(c123064604.rkfilter,tp,LOCATION_HAND,0,1,nil,rk) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c123064604.rkfilter,tp,LOCATION_HAND,0,1,1,nil,rk)
Duel.ConfirmCards(1-tp,g)
local tc=g:GetFirst()
e:SetLabelObject(tc)
tc:RegisterFlagEffect(123064604,RESET_EVENT+0x1fe0000+RESET_CHAIN,0,1)
end end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0) Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,tc,1,0,0)
end
function c123064604.filter(c)
return c:GetFlagEffect(123064604)~=0 and (c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1))
end end
function c123064604.disop(e,tp,eg,ep,ev,re,r,rp) function c123064604.ngop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget() local c=e:GetHandler()
local rc=re:GetHandler()
local tc=e:GetLabelObject()
if not (tc or tc:GetFlagEffect(123064604)~=0) then return end
if tc then if tc then
local s1=tc:IsSummonable(true,nil,1) local s1=tc:IsSummonable(true,nil,1)
local s2=tc:IsMSetable(true,nil,1) local s2=tc:IsMSetable(true,nil,1)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tc,true,nil,1) Duel.Summon(tp,tc,true,nil,1)
else elseif s2 then
Duel.MSet(tp,tc,true,nil,1) Duel.MSet(tp,tc,true,nil,1)
else
return
end end
Duel.NegateEffect(ev)
end end
end Duel.NegateEffect(ev)
function c123064604.cfilter(c) Duel.ShuffleHand(tp)
return bit.band(c:GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE
end
function c123064604.setcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)==0
and Duel.IsExistingMatchingCard(c123064604.cfilter,tp,LOCATION_MZONE,0,1,nil)
and not Duel.IsExistingMatchingCard(c123064604.cfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c123064604.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumpos,POS_FACEDOWN)>0
end end
--オルターガイスト・クウェルハック
function c127541563.initial_effect(c) function c127541563.initial_effect(c)
c:SetUniqueOnField(1,0,127541563)
--act in hand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetCondition(c127541563.actcon)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--activate
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_POSITION) e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetCondition(c127541563.discon)
e2:SetCost(c127541563.discost)
e2:SetTarget(c127541563.distg)
e2:SetOperation(c127541563.disop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e4=Effect.CreateEffect(c) --negate
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) local e3=Effect.CreateEffect(c)
e4:SetRange(LOCATION_SZONE) e3:SetCategory(CATEGORY_NEGATE+CATEGORY_POSITION)
e4:SetCode(EVENT_LEAVE_FIELD) e3:SetType(EFFECT_TYPE_QUICK_O)
e4:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetCondition(c127541563.descon2) e3:SetCode(EVENT_CHAINING)
e4:SetOperation(c127541563.desop2) e3:SetRange(LOCATION_SZONE)
c:RegisterEffect(e4) e3:SetCondition(c127541563.negcon)
e3:SetCost(c127541563.negcost)
e3:SetTarget(c127541563.negtg)
e3:SetOperation(c127541563.negop)
c:RegisterEffect(e3)
--Destroy
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e5:SetRange(LOCATION_SZONE)
e5:SetCode(EVENT_LEAVE_FIELD) e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetCondition(c127541563.descon) e5:SetCondition(c127541563.descon)
e5:SetTarget(c127541563.destg)
e5:SetOperation(c127541563.desop) e5:SetOperation(c127541563.desop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
e3:SetLabelObject(e5)
--spsummon
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE) e6:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e6:SetCode(EFFECT_TRAP_ACT_IN_HAND) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e6:SetCondition(c127541563.handcon) e6:SetCode(EVENT_LEAVE_FIELD)
e6:SetCondition(c127541563.spcon)
e6:SetTarget(c127541563.sptg)
e6:SetOperation(c127541563.spop)
e6:SetLabelObject(e3)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end --
function c127541563.discon(e,tp,eg,ep,ev,re,r,rp) local e7=Effect.CreateEffect(c)
return bit.band(Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION),LOCATION_ONFIELD)~=0 and Duel.IsChainNegatable(ev) and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and rp~=tp e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e7:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e7:SetCode(EVENT_LEAVE_FIELD)
e7:SetOperation(c127541563.lmop)
c:RegisterEffect(e7)
end
function c127541563.actfilter(c)
return not (c:IsFaceup() and c:IsSetCard(0x103))
end
function c127541563.actcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c127541563.actfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c127541563.negcon(e,tp,eg,ep,ev,re,r,rp)
return (re:IsActiveType(TYPE_MONSTER) or (re:IsHasType(EFFECT_TYPE_ACTIVATE)) and not re:IsActiveType(TYPE_PENDULUM))
and Duel.IsChainNegatable(ev) and bit.band(Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION),LOCATION_ONFIELD)~=0 and ep~=tp
end end
function c127541563.cfilter(c) function c127541563.cfilter(c)
return c:IsSetCard(0x103) and c:IsAbleToGraveAsCost() and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) return (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and c:IsSetCard(0x103) and c:IsAbleToGraveAsCost()
end end
function c127541563.discost(e,tp,eg,ep,ev,re,r,rp,chk) function c127541563.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() if chk==0 then return Duel.IsExistingMatchingCard(c127541563.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler())
if chk==0 then return Duel.IsExistingMatchingCard(c127541563.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,c) end and e:GetHandler():GetFlagEffect(127541563)==0 end
e:GetHandler():RegisterFlagEffect(127541563,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c127541563.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,c) local g=Duel.SelectMatchingCard(tp,c127541563.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
function c127541563.distg(e,tp,eg,ep,ev,re,r,rp,chk) function c127541563.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return re:GetHandler():IsCanTurnSet() and not re:GetHandler():IsType(TYPE_PENDULUM) end if chk==0 then return re and re:GetHandler():IsCanTurnSet() end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) and re:GetHandler():IsLocation(LOCATION_MZONE) then
Duel.SetOperationInfo(0,CATEGORY_POSITION,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,eg,1,0,0)
end
end end
function c127541563.disop(e,tp,eg,ep,ev,re,r,rp) function c127541563.negop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local c=e:GetHandler() local c=e:GetHandler()
local rc=re:GetHandler() if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
if not c:IsRelateToEffect(e) then return end local tc=eg:GetFirst()
if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) and rc:IsCanTurnSet() then if tc:IsType(TYPE_MONSTER) then
rc:CancelToGrave() Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
Duel.ChangePosition(eg,POS_FACEDOWN_DEFENSE) else
local rev=EVENT_SSET tc:CancelToGrave()
if rc:IsLocation(LOCATION_MZONE) then rev=EVENT_MSET end Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(rc,rev,e,REASON_EFFECT,tp,tp,0) Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
c:SetCardTarget(rc) end
c:SetCardTarget(tc)
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
e:GetLabelObject():SetLabelObject(tc)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER) e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetReset(RESET_LEAVE) e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetCondition(c127541563.rcon) e1:SetCondition(c127541563.rcon)
e1:SetValue(1) tc:RegisterEffect(e1,true)
rc:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_CHANGE_POSITION) e2:SetCode(EFFECT_CANNOT_TRIGGER)
rc:RegisterEffect(e2) tc:RegisterEffect(e2,true)
c:RegisterFlagEffect(127541563,0,0,1,c:GetFieldID(),nil)
rc:RegisterFlagEffect(127541563,0,0,1,c:GetFieldID(),nil)
end end
end end
function c127541563.rcon(e) function c127541563.rcon(e)
return e:GetOwner():IsHasCardTarget(e:GetHandler()) return not e:GetHandler():IsImmuneToEffect(e) and e:GetOwner():IsRelateToCard(e:GetHandler())
end
function c127541563.gfilter(c,g)
return g:IsContains(c)
end end
function c127541563.descon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c127541563.gfilter,1,nil,e:GetHandler():GetCardTarget()) function c127541563.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_DESTROY_CONFIRMED) then return false end
local tc=e:GetLabelObject()
return tc and eg:IsContains(tc) and c:IsRelateToCard(tc)
end end
function c127541563.desop2(e,tp,eg,ep,ev,re,r,rp) function c127541563.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT) Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end end
function c127541563.descon(e,tp,eg,ep,ev,re,r,rp)
function c127541563.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and not c:IsLocation(LOCATION_DECK) return c:IsPreviousPosition(POS_FACEUP) and not c:IsLocation(LOCATION_DECK)
end end
function c127541563.tgfilter(c,id) function c127541563.desfilter(c)
return c:GetFlagEffectLabel(127541563) and c:GetFlagEffectLabel(127541563)==id return c:IsFacedown() and c:GetFlagEffect(127541563)>0
end end
function c127541563.destg(e,tp,eg,ep,ev,re,r,rp,chk) function c127541563.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local g=Duel.GetMatchingGroup(c127541563.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,e:GetHandler():GetFlagEffectLabel(127541563)) local g=Duel.GetMatchingGroup(c127541563.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK)
end end
function c127541563.spfilter(c,e,tp) function c127541563.spfilter(c,e,tp)
return c:IsSetCard(0x103) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x103) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c127541563.desop(e,tp,eg,ep,ev,re,r,rp) function c127541563.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local g=Duel.GetMatchingGroup(c127541563.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local g=Duel.GetMatchingGroup(c127541563.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c,c:GetFlagEffectLabel(127541563)) if Duel.Destroy(g,REASON_EFFECT)==0 then return end
if Duel.Destroy(g,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c127541563.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(127541563,2)) then local tg=Duel.GetMatchingGroup(c127541563.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
c:ResetFlagEffect(127541563) if tg:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(127541563,2)) then
g:ForEach(function (c) c:ResetFlagEffect(127541563) end) Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c127541563.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local sg=tg:Select(tp,1,1,nil)
if not tg then return end Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function c127541563.hfilter(c)
return c:IsFacedown() or not c:IsSetCard(0x103) function c127541563.lmfilter(c,rc)
return rc:IsHasCardTarget(c) and c:IsFacedown()
end end
function c127541563.handcon(e) function c127541563.lmop(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c127541563.hfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) local g=Duel.GetMatchingGroup(c127541563.lmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,e:GetHandler())
local tc=g:GetFirst()
while tc do
tc:RegisterFlagEffect(127541563,RESET_EVENT+0x1fe0000,0,1)
tc=g:GetNext()
end
end end
--纳迦的存在 --ナーガの存在
function c4058.initial_effect(c) function c4058.initial_effect(c)
c:EnableReviveLimit()
c:SetUniqueOnField(1,0,4058) c:SetUniqueOnField(1,0,4058)
--fusion material Duel.EnableGlobalFlag(GLOBALFLAG_SELF_TOGRAVE)
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x50),4,true) --special summon rule
--spsummon condition
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetValue(c4058.splimit) e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c4058.sprcon)
e1:SetOperation(c4058.sprop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon rule --to s/t zone
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_MZONE)
e2:SetRange(LOCATION_EXTRA) e2:SetCode(EFFECT_SELF_TOGRAVE)
e2:SetCondition(c4058.sprcon) e2:SetCondition(c4058.sdcon)
e2:SetOperation(c4058.sprop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--immune
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetRange(LOCATION_MZONE)
e3:SetRange(LOCATION_ONFIELD) e3:SetCode(EFFECT_SEND_REPLACE)
e3:SetValue(c4058.efilter) e3:SetTarget(c4058.desreptg)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e0=Effect.CreateEffect(c) --to monster zone
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e0:SetRange(LOCATION_MZONE)
e0:SetValue(aux.imval1)
c:RegisterEffect(e0)
--atk
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e4:SetCode(EFFECT_IGNORE_BATTLE_TARGET) e4:SetRange(LOCATION_SZONE)
e4:SetRange(LOCATION_MZONE) e4:SetCode(EFFECT_SELF_TOGRAVE)
e4:SetCondition(c4058.sdcon2)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--sumlimit
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD) e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CANNOT_SUMMON) e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e5:SetRange(LOCATION_SZONE)
e5:SetRange(LOCATION_ONFIELD) e5:SetCode(EFFECT_SEND_REPLACE)
e5:SetTargetRange(1,0) e5:SetTarget(c4058.desreptg2)
e5:SetTarget(c4058.sumlimit)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--extra summon --immune
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_SET_SUMMON_COUNT_LIMIT)
e6:SetRange(LOCATION_ONFIELD)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetTargetRange(1,0)
e6:SetValue(3)
e6:SetTarget(c4058.extg)
c:RegisterEffect(e6)
--Activate
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e7:SetRange(LOCATION_ONFIELD)
e7:SetCode(EFFECT_SEND_REPLACE)
e7:SetTarget(c4058.reptg)
e7:SetValue(c4058.repval)
c:RegisterEffect(e7)
--triple tribute
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD)
e8:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e8:SetRange(LOCATION_MZONE)
e8:SetTargetRange(LOCATION_HAND,0)
e8:SetCondition(c4058.ttcon)
e8:SetTarget(c4058.extg2)
e8:SetOperation(c4058.ttop)
e8:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e8)
--battle
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_ADJUST)
e9:SetRange(LOCATION_SZONE)
e9:SetCondition(c4058.damcon2)
e9:SetOperation(c4058.disop)
c:RegisterEffect(e9)
--battle
local e10=Effect.CreateEffect(c) local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e10:SetType(EFFECT_TYPE_SINGLE)
e10:SetCode(EVENT_ADJUST) e10:SetCode(EFFECT_IMMUNE_EFFECT)
e10:SetRange(LOCATION_MZONE) e10:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e10:SetCondition(c4058.damcon) e10:SetRange(LOCATION_ONFIELD)
e10:SetOperation(c4058.disop2) e10:SetValue(c4058.efilter)
c:RegisterEffect(e10) c:RegisterEffect(e10)
--triple tribute --battle target
local e11=Effect.CreateEffect(c) local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_FIELD) e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_LIMIT_SUMMON_PROC) e11:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e11:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e11:SetRange(LOCATION_MZONE) e11:SetRange(LOCATION_MZONE)
e11:SetTargetRange(LOCATION_HAND,0) e11:SetValue(aux.imval1)
e11:SetCondition(c4058.ttcon2)
e11:SetTarget(c4058.extg3)
e11:SetOperation(c4058.ttop2)
e11:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e11) c:RegisterEffect(e11)
--battle --triple summon
local e12=Effect.CreateEffect(c) local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e12:SetType(EFFECT_TYPE_FIELD)
e12:SetCode(EVENT_PHASE+PHASE_END) e12:SetCode(EFFECT_SET_SUMMON_COUNT_LIMIT)
e12:SetRange(LOCATION_MZONE) e12:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e12:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e12:SetRange(LOCATION_ONFIELD)
e12:SetCountLimit(1) e12:SetTargetRange(1,0)
e12:SetCondition(c4058.damcon3) e12:SetValue(3)
e12:SetOperation(c4058.disop3) e12:SetTarget(aux.TargetBoolFunction(Card.IsRace,0x8000))
c:RegisterEffect(e12) c:RegisterEffect(e12)
--Activate --oath effects
local e13=Effect.CreateEffect(c) local e13=Effect.CreateEffect(c)
e13:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e13:SetType(EFFECT_TYPE_FIELD)
e13:SetRange(LOCATION_MZONE) e13:SetRange(LOCATION_ONFIELD)
e13:SetCode(EVENT_SUMMON_SUCCESS) e13:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e13:SetCondition(c4058.condition2) e13:SetCode(EFFECT_CANNOT_SUMMON)
e13:SetTarget(c4058.target2) e13:SetTarget(c4058.splimit)
e13:SetOperation(c4058.operation2) e13:SetTargetRange(1,0)
c:RegisterEffect(e13) c:RegisterEffect(e13)
--battle local e14=e13:Clone()
local e14=Effect.CreateEffect(c) e14:SetCode(EFFECT_CANNOT_MSET)
e14:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e14:SetCode(EVENT_SUMMON)
e14:SetRange(LOCATION_SZONE)
e14:SetCondition(c4058.damcon4)
e14:SetOperation(c4058.disop)
c:RegisterEffect(e14) c:RegisterEffect(e14)
--Activate --replace
local e15=Effect.CreateEffect(c) local e15=Effect.CreateEffect(c)
e15:SetCategory(CATEGORY_SPECIAL_SUMMON) e15:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e15:SetType(EFFECT_TYPE_ACTIVATE) e15:SetCode(EFFECT_SEND_REPLACE)
e15:SetCode(EVENT_DESTROYED) e15:SetRange(LOCATION_ONFIELD)
e15:SetRange(LOCATION_DECK) e15:SetTarget(c4058.destg)
e15:SetCondition(c4058.condition4) e15:SetValue(c4058.repval)
e15:SetTarget(c4058.target4) c:RegisterEffect(e15)
e15:SetOperation(c4058.activate4) --
local e16=Effect.CreateEffect(c)
e16:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e16:SetRange(LOCATION_ONFIELD)
e16:SetTargetRange(LOCATION_DECK,0)
e16:SetTarget(aux.TargetBoolFunction(Card.IsCode,16067089))
e16:SetLabelObject(e15)
c:RegisterEffect(e16)
--出场
local e17=Effect.CreateEffect(c) local e17=Effect.CreateEffect(c)
e17:SetType(EFFECT_TYPE_FIELD) e17:SetType(EFFECT_TYPE_FIELD)
e17:SetCode(EFFECT_ACTIVATE_COST) e17:SetCode(4058)
e17:SetRange(LOCATION_HAND+LOCATION_DECK) e17:SetRange(LOCATION_ONFIELD)
e17:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE) e17:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e17:SetTargetRange(1,0) e17:SetTargetRange(1,0)
e17:SetTarget(c4058.actarget) c:RegisterEffect(e17)
e17:SetOperation(c4058.costop) --extra summon
local e18=Effect.CreateEffect(c) local e18=Effect.CreateEffect(c)
e18:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT) e18:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e18:SetRange(LOCATION_ONFIELD) e18:SetCode(EVENT_SUMMON_SUCCESS)
e18:SetTargetRange(LOCATION_HAND+LOCATION_DECK,0) e18:SetRange(LOCATION_MZONE)
e18:SetTarget(aux.TargetBoolFunction(Card.IsCode,93217231,80678380,16067089,1683982)) e18:SetOperation(c4058.drop)
e18:SetLabelObject(e17)
c:RegisterEffect(e18) c:RegisterEffect(e18)
--negate --counter
local e19=Effect.CreateEffect(c) local e19=Effect.CreateEffect(c)
e19:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e19:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e19:SetType(EFFECT_TYPE_ACTIVATE) e19:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e19:SetCode(EVENT_CHAINING) e19:SetRange(LOCATION_MZONE)
e19:SetRange(LOCATION_DECK) e19:SetCode(EVENT_PHASE+PHASE_END)
e19:SetCondition(c4058.condition5) e19:SetCountLimit(1)
e19:SetCost(c4058.cost5) e19:SetOperation(c4058.counter)
e19:SetTarget(c4058.target5) c:RegisterEffect(e19)
e19:SetOperation(c4058.activate5) --advance summon
local e20=Effect.CreateEffect(c) local e20=Effect.CreateEffect(c)
e20:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT) e20:SetDescription(aux.Stringid(4058,1))
e20:SetRange(LOCATION_ONFIELD) e20:SetType(EFFECT_TYPE_FIELD)
e20:SetTargetRange(LOCATION_DECK,0) e20:SetCode(EFFECT_SUMMON_PROC)
e20:SetTarget(aux.TargetBoolFunction(Card.IsCode,80678380)) e20:SetRange(LOCATION_MZONE)
e20:SetLabelObject(e19) e20:SetTargetRange(LOCATION_HAND,0)
e20:SetCondition(c4058.otcon)
e20:SetTarget(c4058.ottg)
e20:SetOperation(c4058.otop)
e20:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e20) c:RegisterEffect(e20)
--Activate local e21=e20:Clone()
local e21=Effect.CreateEffect(c) e21:SetCode(EFFECT_SET_PROC)
e21:SetCategory(CATEGORY_DESTROY) c:RegisterEffect(e21)
e21:SetProperty(EFFECT_FLAG_CARD_TARGET) --act qp/trap in hand
e21:SetType(EFFECT_TYPE_ACTIVATE)
e21:SetCode(EVENT_FREE_CHAIN)
e21:SetRange(LOCATION_DECK)
e21:SetTarget(c4058.target6)
e21:SetOperation(c4058.activate6)
local e22=Effect.CreateEffect(c) local e22=Effect.CreateEffect(c)
e22:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT) e22:SetType(EFFECT_TYPE_FIELD)
e22:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e22:SetRange(LOCATION_ONFIELD) e22:SetRange(LOCATION_ONFIELD)
e22:SetTargetRange(LOCATION_DECK,0) e22:SetTargetRange(LOCATION_HAND,0)
e22:SetTarget(aux.TargetBoolFunction(Card.IsCode,93217231)) e22:SetTarget(aux.TargetBoolFunction(c4058.dafilter))
e22:SetLabelObject(e21)
c:RegisterEffect(e22) c:RegisterEffect(e22)
local e27=Effect.CreateEffect(c) --
e27:SetType(EFFECT_TYPE_ACTIVATE)
e27:SetCode(EVENT_FREE_CHAIN)
e27:SetRange(LOCATION_DECK)
local e28=Effect.CreateEffect(c)
e28:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e28:SetRange(LOCATION_ONFIELD)
e28:SetTargetRange(LOCATION_DECK,0)
e28:SetTarget(aux.TargetBoolFunction(Card.IsCode,1683982))
e28:SetLabelObject(e27)
c:RegisterEffect(e28)
--activate from hand
local e23=Effect.CreateEffect(c)
e23:SetType(EFFECT_TYPE_FIELD)
e23:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e23:SetRange(LOCATION_ONFIELD)
e23:SetTarget(aux.TargetBoolFunction(Card.IsCode,93217231,80678380,16067089,1683982))
e23:SetTargetRange(LOCATION_HAND,0)
c:RegisterEffect(e23)
--special summon
local e25=Effect.CreateEffect(c) local e25=Effect.CreateEffect(c)
e25:SetType(EFFECT_TYPE_FIELD) e25:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e25:SetCode(EFFECT_SPSUMMON_PROC_G) e25:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e25:SetRange(LOCATION_DECK) e25:SetCode(EVENT_CHAINING)
e25:SetCondition(c4058.spcon) e25:SetRange(LOCATION_ONFIELD)
local e26=Effect.CreateEffect(c) e25:SetOperation(c4058.actop)
e26:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT) c:RegisterEffect(e25)
e26:SetRange(LOCATION_ONFIELD) --plus effect
e26:SetTargetRange(LOCATION_DECK,0) if not c4058.global_check then
e26:SetTarget(aux.TargetBoolFunction(Card.IsCode,93217231,80678380,16067089,1683982)) c4058.global_check=true
e26:SetLabelObject(e25) local ge1=Effect.CreateEffect(c)
c:RegisterEffect(e26) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
end ge1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
function c4058.splimit(e,se,sp,st) ge1:SetCode(EVENT_ADJUST)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA ge1:SetOperation(c4058.adop)
end Duel.RegisterEffect(ge1,0)
function c4058.spfilter(c) local ge2=Effect.CreateEffect(c)
return c:IsFusionSetCard(0x50) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGraveAsCost() ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
end ge2:SetCode(EVENT_SUMMON)
function c4058.fselect(c,tp,mg,sg,tc) ge2:SetOperation(c4058.regop)
sg:AddCard(c) Duel.RegisterEffect(ge2,0)
local res=false local ge3=ge2:Clone()
if sg:GetClassCount(Card.GetCode)<4 then ge3:SetCode(EVENT_MSET)
res=mg:IsExists(c4058.fselect,1,sg,tp,mg,sg,tc) Duel.RegisterEffect(ge3,0)
else
res=Duel.GetLocationCountFromEx(tp,tp,sg,tc)>0
end end
sg:RemoveCard(c) end
return res
--special summon rule
function c4058.sprfilter(c)
return c:IsSetCard(0x50) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end end
function c4058.sprcon(e,c) function c4058.sprcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c4058.spfilter,tp,LOCATION_DECK,0,nil) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local sg=Group.CreateGroup() local g=Duel.GetMatchingGroup(c4058.sprfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil)
return mg:IsExists(c4058.fselect,1,nil,tp,mg,sg,c) return ft>0 and g:GetClassCount(Card.GetCode)>3
end end
function c4058.sprop(e,tp,eg,ep,ev,re,r,rp,c) function c4058.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c4058.spfilter,tp,LOCATION_DECK,0,nil) local c=e:GetHandler()
local sg=Group.CreateGroup() local g=Duel.GetMatchingGroup(c4058.sprfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil)
while sg:GetClassCount(Card.GetCode)<4 do if chk==0 then return g:GetClassCount(Card.GetCode)>3 end
local tg=Group.CreateGroup()
for i=1,4 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=mg:FilterSelect(tp,c4058.fselect,1,1,sg,tp,mg,sg,c) local sg=g:Select(tp,1,1,nil)
mg:Remove(Card.IsCode,nil,g:GetFirst():GetCode()) g:Remove(Card.IsCode,nil,sg:GetFirst():GetCode())
sg:Merge(g) tg:Merge(sg)
end end
Duel.SendtoGrave(sg,nil,2,REASON_COST+REASON_MATERIAL) Duel.SendtoGrave(tg,REASON_COST)
end
function c4058.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end end
function c4058.filter(c)
--to s/t zone
function c4058.venomfilter(c)
return c:IsFaceup() and c:IsSetCard(0x50) return c:IsFaceup() and c:IsSetCard(0x50)
end end
function c4058.sumlimit(e,c) function c4058.sdcon(e)
return not c:IsRace(RACE_REPTILE) return not Duel.IsExistingMatchingCard(c4058.venomfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function c4058.extg(e,c)
return c:IsRace(RACE_REPTILE)
end
function c4058.extg2(e,c)
return c:IsRace(RACE_REPTILE) and c:IsLevelAbove(5) and c:IsLevelBelow(6)
end end
function c4058.extg3(e,c) function c4058.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
return c:IsRace(RACE_REPTILE) and c:IsLevelAbove(7)
end
function c4058.ttfilter(c)
return c:IsSetCard(0x50) and c:IsType(TYPE_MONSTER) or c:IsLocation(LOCATION_MZONE)
end
function c4058.ttcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
return c:GetLevel()>4 and minc<=1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c4058.ttfilter,tp,LOCATION_DECK+LOCATION_MZONE,0,1,nil)
end
function c4058.ttop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,c4058.ttfilter,tp,LOCATION_DECK+LOCATION_MZONE,0,1,1,nil)
c:SetMaterial(sg)
Duel.SendtoGrave(sg,REASON_SUMMON+REASON_MATERIAL)
end
function c4058.ttcon2(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
return c:GetLevel()>4 and minc<=1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c4058.ttfilter,tp,LOCATION_DECK+LOCATION_MZONE,0,2,nil)
end
function c4058.ttop2(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,c4058.ttfilter,tp,LOCATION_DECK+LOCATION_MZONE,0,2,2,nil)
c:SetMaterial(sg)
Duel.SendtoGrave(sg,REASON_SUMMON+REASON_MATERIAL+REASON_COST)
end
function c4058.repfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsCode(8062132) and c:IsFaceup()
end
function c4058.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(c4058.repfilter,1,nil,tp) and c:IsAbleToGrave() end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.SendtoGrave(c,REASON_REPLACE)
return true
end
return false
end
function c4058.repval(e,c)
return c4058.repfilter(c,e:GetHandlerPlayer())
end
function c4058.damcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c4058.filter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function c4058.disop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE) end
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
...@@ -340,153 +206,243 @@ function c4058.disop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -340,153 +206,243 @@ function c4058.disop2(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+0x1fc0000) e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS) e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1) c:RegisterEffect(e1)
c:RegisterFlagEffect(4058,RESET_EVENT+0x1fc0000,0,1) else
Duel.SendtoGrave(c,REASON_RULE)
end
return true
end end
function c4058.damcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c4058.filter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil) --to monster zone
function c4058.sdcon2(e)
return Duel.IsExistingMatchingCard(c4058.venomfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end end
function c4058.disop(e,tp,eg,ep,ev,re,r,rp) function c4058.desreptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP_ATTACK,true) if chk==0 then return c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE) end
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.MoveToField(c,tp,tp,c:GetPreviousLocation(),c:GetPreviousPosition(),true)
else
Duel.SendtoGrave(c,REASON_RULE)
end
return true
end end
function c4058.cfilter(c)
return c:IsCode(8062132) --immune
function c4058.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end end
function c4058.damcon3(e,tp,eg,ep,ev,re,r,rp)
if c==nil then return true end --summon limit
return Duel.IsExistingMatchingCard(c4058.cfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) function c4058.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_REPTILE)
end end
function c4058.disop3(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT) --send leplace
local g=Duel.SelectMatchingCard(tp,c4058.cfilter,tp,LOCATION_MZONE,0,1,1,nil) function c4058.vmfilter(c,tp)
local tc=g:GetFirst() return c:IsFaceup() and c:IsCode(8062132) and c:IsControler(tp)
while tc do
tc:AddCounter(0x11,1,REASON_EFFECT)
tc=g:GetNext()
end
end end
function c4058.condition2(e,tp,eg,ep,ev,re,r,rp) function c4058.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst() local c=e:GetHandler()
local lv=tc:GetLevel() if chk==0 then return eg:IsExists(c4058.vmfilter,1,nil,tp)
return eg:GetCount()==1 and tc:IsRace(RACE_REPTILE) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and not c:IsStatus(STATUS_DESTROY_CONFIRMED) end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT+REASON_REPLACE)
return true
else return false end
end
function c4058.repval(e,c)
return c:IsFaceup() and c:IsCode(8062132) and c~=e:GetHandler()
end end
function c4058.filter3(c,e,tp,lv)
return (c:GetLevel()==lv or c:GetRank()==lv) and c:IsRace(RACE_REPTILE) and c:IsCanBeSpecialSummoned(e,nil,tp,false,false,POS_FACEUP) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 --extra summon
function c4058.sufilter(c,e,tp)
return c:IsControler(tp) and c:IsRace(RACE_REPTILE) and c:IsType(TYPE_MONSTER)
and Duel.IsExistingMatchingCard(c4058.exfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetLevel())
end end
function c4058.target2(e,tp,eg,ep,ev,re,r,rp,chk) function c4058.exfilter(c,e,tp,lv)
if chk==0 then return Duel.IsExistingMatchingCard(c4058.filter3,tp,LOCATION_EXTRA,0,1,nil,e,tp,eg:GetFirst():GetLevel()) end return (c:GetRank()==lv or c:GetLevel()==lv) and c:IsRace(RACE_REPTILE)
e:SetLabel(eg:GetFirst():GetLevel()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end end
function c4058.operation2(e,tp,eg,ep,ev,re,r,rp) function c4058.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetFlagEffect(tp,4058)==0 and Duel.SelectYesNo(tp,aux.Stringid(4058,1)) then if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.RegisterFlagEffect(tp,4058,RESET_CHAIN,0,1) if eg:IsExists(c4058.sufilter,1,nil,e,tp) then
local g=eg:Filter(c4058.sufilter,nil,e,tp)
local tc=g:GetFirst()
local lv=tc:GetLevel()
if Duel.IsExistingMatchingCard(c4058.exfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,lv)
and Duel.SelectYesNo(tp,aux.Stringid(4058,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c4058.filter3,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,e:GetLabel()) local g=Duel.SelectMatchingCard(tp,c4058.exfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lv)
if g:GetCount()~=0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
end end
end
end end
function c4058.cfilter2(c)
return (c:GetSummonType()==SUMMON_TYPE_ADVANCE or c:GetSummonType()==SUMMON_TYPE_NORMAL) and c:IsSetCard(0x50) --counter
function c4058.counter(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c4058.vmfilter,tp,LOCATION_MZONE,0,nil,tp)
local sg=Group.CreateGroup()
if g:GetCount()==0 then return end
if g:GetCount()==1 then
sg:AddCard(g:GetFirst())
else
sg:AddCard(g:Select(tp,1,1,nil):GetFirst())
end
local tc=sg:GetFirst()
Duel.HintSelection(Group.FromCards(tc))
tc:AddCounter(0x11,1)
local WIN_REASON_VENNOMINAGA = 0x12
if tc:GetCounter(0x11)==3 then
Duel.Win(tp,WIN_REASON_VENNOMINAGA)
end
end end
function c4058.damcon4(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c4058.cfilter2,1,nil) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 --advance
function c4058.otcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end end
function c4058.cfilter3(c,tp) function c4058.ottg(e,c)
return c:IsCode(72677437) and c:GetPreviousControler()==tp local mi,ma=c:GetTributeRequirement()
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) return ((mi<=2 and ma>=2 and Duel.IsExistingMatchingCard(c4058.sprfilter,e:GetHandlerPlayer(),LOCATION_DECK,0,2,nil))
or (mi<=1 and ma>=1) and Duel.IsExistingMatchingCard(c4058.sprfilter,e:GetHandlerPlayer(),LOCATION_DECK,0,1,nil))
and c:IsRace(RACE_REPTILE)
end end
function c4058.condition4(e,tp,eg,ep,ev,re,r,rp) function c4058.otop(e,tp,eg,ep,ev,re,r,rp,c)
return eg:IsExists(c4058.cfilter3,1,nil,tp) local mi,ma=c:GetTributeRequirement()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c4058.sprfilter,tp,LOCATION_DECK,0,mi,ma,nil)
Duel.SendtoGrave(g,REASON_COST)
end end
function c4058.filter4(c,e,tp)
return c:IsCode(8062132) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) --act in hand
function c4058.actop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
if re:GetActivateLocation()~=LOCATION_HAND then return end
if not rc:IsCode(16067089,93217231,80678380,1683982) then return end
Duel.RegisterFlagEffect(rc:GetControler(),rc:GetOriginalCode(),RESET_PHASE+PHASE_END,0,1)
end end
function c4058.target4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 --plus effect
and Duel.IsExistingMatchingCard(c4058.filter4,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end function c4058.dafilter(c)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_HAND) return c:IsType(TYPE_TRAP) and c:IsCode(16067089,93217231,80678380,1683982) and Duel.GetFlagEffect(c:GetControler(),c:GetOriginalCode())==0
end end
function c4058.activate4(e,tp,eg,ep,ev,re,r,rp) function c4058.adop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.GetMatchingGroup(c4058.dafilter,c:GetControler(),LOCATION_DECK,LOCATION_DECK,nil)
local g=Duel.SelectMatchingCard(tp,c4058.filter4,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then while tc do
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP) if tc:GetFlagEffect(4058)==0 then
tc:CompleteProcedure() local code=tc:GetOriginalCode()
local ae=tc:GetActivateEffect()
--deck activate
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(ae:GetCode())
e1:SetCategory(ae:GetCategory())
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+ae:GetProperty())
e1:SetRange(LOCATION_DECK)
e1:SetCountLimit(1,code)
e1:SetCondition(c4058.sfcon)
e1:SetTarget(c4058.sftg)
e1:SetOperation(c4058.sfop)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
--activate cost
local e2=Effect.CreateEffect(tc)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ACTIVATE_COST)
e2:SetRange(LOCATION_DECK)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(LOCATION_DECK,0)
e2:SetCost(c4058.costchk)
e2:SetTarget(c4058.actarget)
e2:SetOperation(c4058.costop)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
tc:RegisterFlagEffect(4058,RESET_EVENT+0x1fe0000,0,1)
end
tc=g:GetNext()
end end
end end
--deck activate
function c4058.sfcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,4058) and Duel.GetFlagEffect(tp,e:GetHandler():GetOriginalCode())==0
end
function c4058.sftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ae=e:GetHandler():GetActivateEffect()
local fcon=ae:GetCondition()
local fcos=ae:GetCost()
local ftg=ae:GetTarget()
if chk==0 then
return (not fcon or fcon(e,tp,eg,ep,ev,re,r,rp))
and (not fcos or fcos(e,tp,eg,ep,ev,re,r,rp,0))
and (not ftg or ftg(e,tp,eg,ep,ev,re,r,rp,0))
and e:GetHandler():IsCode(16067089,93217231,80678380,1683982)
end
if fcos then fcos(e,tp,eg,ep,ev,re,r,rp,1) end
if ftg then ftg(e,tp,eg,ep,ev,re,r,rp,1) end
Duel.RegisterFlagEffect(tp,e:GetHandler():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1)
end
function c4058.sfop(e,tp,eg,ep,ev,re,r,rp)
local ae=e:GetHandler():GetActivateEffect()
local fop=ae:GetOperation()
if fop then fop(e,tp,eg,ep,ev,re,r,rp) end
end
--activate field
function c4058.actarget(e,te,tp) function c4058.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() e:SetLabelObject(te)
return te:GetHandler():IsLocation(LOCATION_HAND+LOCATION_DECK) and te:GetHandler()==e:GetHandler()
end
function c4058.costchk(e,te_or_c,tp)
local tp=e:GetHandler():GetControler()
return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end end
function c4058.costop(e,tp,eg,ep,ev,re,r,rp) function c4058.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=e:GetHandler() local c=e:GetHandler()
if c:IsLocation(LOCATION_DECK) then Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) end Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
--oath effects c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetTargetRange(1,0) e1:SetCountLimit(1)
e1:SetValue(c4058.aclimit) e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetOperation(c4058.rsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
end
function c4058.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
end
end end
function c4058.condition5(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) --summon check
end function c4058.sumcon(e)
function c4058.cfilter4(c) return Duel.GetFlagEffect(e:GetHandlerPlayer(),4058)==0
return c:IsSetCard(0x50) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function c4058.cost5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c4058.cfilter4,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c4058.cfilter4,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end end
function c4058.target5(e,tp,eg,ep,ev,re,r,rp,chk) function c4058.regop(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return true end for tc in aux.Next(eg) do
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if not tc:IsRace(RACE_REPTILE) or (tc:IsFacedown() and not Duel.IsPlayerAffectedByEffect(tc:GetSummonPlayer(),4058)) then
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.RegisterFlagEffect(tc:GetSummonPlayer(),4058,RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end end
end
function c4058.activate5(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end end
end end
function c4058.filter5(c)
return c:IsFaceup() and c:IsRace(RACE_REPTILE)
end
function c4058.target6(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c4058.filter5,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c4058.filter5,tp,LOCATION_MZONE,0,1,1,nil)
e:SetLabelObject(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,2,2,nil)g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,g1:GetCount(),0,0)
end
function c4058.activate6(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
local sc=e:GetLabelObject()
if sg:GetCount()~=3 or sc:IsFacedown() or not sc:IsRace(RACE_REPTILE) or sc:IsControler(1-tp) then return end
Duel.Destroy(sg,REASON_EFFECT)
end
function c4058.aclimit(e,re,tp)
return re:GetHandler():IsLocation(LOCATION_HAND+LOCATION_DECK) and re:GetHandler():IsCode(e:GetHandler():GetCode())
end
function c4058.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return not c:IsPublic()
end
local m=90700075 local m=90700075
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="伍世坏=无限世界" cm.name="端世坏=狱炎耶拉界"
function cm.initial_effect(c) function cm.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -12,14 +12,14 @@ function cm.initial_effect(c) ...@@ -12,14 +12,14 @@ function cm.initial_effect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e2) --c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(m) e3:SetCode(m)
e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED) e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e3:SetTargetRange(1,0) e3:SetTargetRange(1,0)
c:RegisterEffect(e3) --c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e4:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
...@@ -30,7 +30,7 @@ function cm.initial_effect(c) ...@@ -30,7 +30,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e5=e4:Clone() local e5=e4:Clone()
e5:SetCode(EVENT_REMOVE) e5:SetCode(EVENT_REMOVE)
c:RegisterEffect(e5) --c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetRange(LOCATION_GRAVE+LOCATION_REMOVED) e6:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
...@@ -51,6 +51,12 @@ function cm.initial_effect(c) ...@@ -51,6 +51,12 @@ function cm.initial_effect(c)
end end
function cm.enumop(e,tp,eg,ep,ev,re,r,rp) function cm.enumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local e=Effect.CreateEffect(c)
e:SetType(EFFECT_TYPE_FIELD)
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e:SetCode(m)
e:SetTargetRange(1,0)
Duel.RegisterEffect(e,tp)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,0) local g=Duel.GetFieldGroup(tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,0)
g:ForEach( g:ForEach(
function (tc) function (tc)
...@@ -62,7 +68,7 @@ function cm.enumop(e,tp,eg,ep,ev,re,r,rp) ...@@ -62,7 +68,7 @@ function cm.enumop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE) e1:SetCategory(CATEGORY_DECKDES+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+code) e1:SetCountLimit(1,m)
e1:SetCondition(cm.con) e1:SetCondition(cm.con)
e1:SetTarget(cm.tgtg) e1:SetTarget(cm.tgtg)
e1:SetOperation(cm.tgop) e1:SetOperation(cm.tgop)
...@@ -73,7 +79,7 @@ function cm.enumop(e,tp,eg,ep,ev,re,r,rp) ...@@ -73,7 +79,7 @@ function cm.enumop(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING) e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,m+code) e2:SetCountLimit(1,m+100000000)
e2:SetCondition(cm.qtgcon) e2:SetCondition(cm.qtgcon)
e2:SetTarget(cm.qtgtg) e2:SetTarget(cm.qtgtg)
e2:SetOperation(cm.qtgop) e2:SetOperation(cm.qtgop)
...@@ -83,7 +89,7 @@ function cm.enumop(e,tp,eg,ep,ev,re,r,rp) ...@@ -83,7 +89,7 @@ function cm.enumop(e,tp,eg,ep,ev,re,r,rp)
e3:SetCategory(CATEGORY_DECKDES) e3:SetCategory(CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,m+code) e3:SetCountLimit(2,m+200000000)
e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(cm.hdtgcon) e3:SetCondition(cm.hdtgcon)
e3:SetTarget(cm.hdtgtg) e3:SetTarget(cm.hdtgtg)
...@@ -98,11 +104,28 @@ function cm.enumop(e,tp,eg,ep,ev,re,r,rp) ...@@ -98,11 +104,28 @@ function cm.enumop(e,tp,eg,ep,ev,re,r,rp)
e4:SetRange(LOCATION_GRAVE) e4:SetRange(LOCATION_GRAVE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e4:SetCountLimit(1,m+code) e4:SetCountLimit(2,m+300000000)
e4:SetCondition(cm.con) e4:SetCondition(cm.con)
e4:SetTarget(cm.rmtg) e4:SetCost(aux.bfgcost)
e4:SetOperation(cm.rmop) --e4:SetTarget(cm.rmtg)
--e4:SetOperation(cm.rmop)
e4:SetTarget(cm.tdtg)
e4:SetOperation(cm.tdop)
tc:RegisterEffect(e4) tc:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,4))
e5:SetCategory(CATEGORY_DECKDES)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_SUMMON_SUCCESS)
e5:SetCountLimit(1,m+400000000)
e5:SetCondition(cm.con)
e5:SetTarget(cm.ddtg)
e5:SetOperation(cm.ddop)
tc:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EVENT_SPSUMMON_SUCCESS)
tc:RegisterEffect(e6)
end end
) )
end end
...@@ -125,6 +148,7 @@ end ...@@ -125,6 +148,7 @@ end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and Duel.IsPlayerCanDiscardDeck(tp,3) and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_HAND,0,1,c) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and Duel.IsPlayerCanDiscardDeck(tp,3) and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_HAND,0,1,c) end
Duel.RegisterFlagEffect(tp,m+e:GetHandler():GetCode(),RESET_PHASE+PHASE_END,nil,1)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3) Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
...@@ -140,12 +164,11 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -140,12 +164,11 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.qtgcon(e,tp,eg,ep,ev,re,r,rp) function cm.qtgcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and re:GetActivateLocation()==LOCATION_MZONE and Duel.IsPlayerAffectedByEffect(tp,m) return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and re:GetActivateLocation()==LOCATION_MZONE and Duel.IsPlayerAffectedByEffect(tp,m) and Duel.GetFlagEffect(tp,m+e:GetHandler():GetCode())==0
end end
function cm.qtgtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.qtgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) and Duel.IsPlayerCanDiscardDeck(tp,3) end
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) Duel.RegisterFlagEffect(tp,m+e:GetHandler():GetCode(),RESET_PHASE+PHASE_END,nil,1)
and Duel.IsPlayerCanDiscardDeck(tp,3) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3) Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
...@@ -155,16 +178,18 @@ function cm.qtgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -155,16 +178,18 @@ function cm.qtgop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.hdtgcon(e,tp,eg,ep,ev,re,r,rp) function cm.hdtgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK+LOCATION_HAND) and Duel.IsPlayerAffectedByEffect(tp,m) return e:GetHandler():IsPreviousLocation(LOCATION_DECK+LOCATION_HAND) and Duel.IsPlayerAffectedByEffect(tp,m) and Duel.GetFlagEffect(tp,m+e:GetHandler():GetCode())==0
end end
function cm.hdtgtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.hdtgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,5) and Duel.IsPlayerCanDiscardDeck(1-tp,5) end --if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,5) and Duel.IsPlayerCanDiscardDeck(1-tp,5) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,PLAYER_ALL,5) if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,5) end
Duel.RegisterFlagEffect(tp,m+e:GetHandler():GetCode(),RESET_PHASE+PHASE_END,nil,1)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,5)
end end
function cm.hdtgop(e,tp,eg,ep,ev,re,r,rp) function cm.hdtgop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetDecktopGroup(tp,5) local g1=Duel.GetDecktopGroup(tp,5)
local g2=Duel.GetDecktopGroup(1-tp,5) --local g2=Duel.GetDecktopGroup(1-tp,5)
g1:Merge(g2) --g1:Merge(g2)
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
Duel.SendtoGrave(g1,REASON_EFFECT) Duel.SendtoGrave(g1,REASON_EFFECT)
end end
...@@ -185,29 +210,53 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -185,29 +210,53 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT) Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end end
end end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,e:GetHandler()) and Duel.IsPlayerAffectedByEffect(tp,m) and Duel.GetFlagEffect(tp,m+e:GetHandler():GetCode())==0 end
Duel.RegisterFlagEffect(tp,m+e:GetHandler():GetCode(),RESET_PHASE+PHASE_END,nil,1)
local ct=5
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp) function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,m) return Duel.IsPlayerAffectedByEffect(tp,m) and Duel.GetFlagEffect(tp,m+e:GetHandler():GetCode())==0
end end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsAbleToHand() and ((c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER)) or c:IsCode(91588074)) return (c:IsLocation(LOCATION_DECK+LOCATION_GRAVE) or c:IsFaceup()) and c:IsAbleToHand() and ((c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER)))-- or c:IsCode(91588074))
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND+CATEGORY_SEARCH,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function cm.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
Duel.RegisterFlagEffect(tp,m+e:GetHandler():GetCode(),RESET_PHASE+PHASE_END,nil,1)
end
function cm.ddop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(tp,3,REASON_EFFECT)
end
function cm.repfilter(c,tp) function cm.repfilter(c,tp)
return c:IsControler(tp) and c:GetDestination()==LOCATION_REMOVED and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() return c:IsControler(tp) and c:GetDestination()==LOCATION_REMOVED and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return bit.band(r,REASON_COST)~=0 and re and re:GetHandler():IsSetCard(0xbb) and eg:IsExists(cm.repfilter,1,nil,tp) end if chk==0 then return bit.band(r,REASON_COST)~=0 and re and re:GetHandler():IsSetCard(0xbb) and re:GetCode()==EFFECT_SPSUMMON_PROC and eg:IsExists(cm.repfilter,1,nil,tp) end
local g=eg:Filter(cm.repfilter,nil,tp) local g=eg:Filter(cm.repfilter,nil,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
while tc do while tc do
...@@ -220,7 +269,17 @@ function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -220,7 +269,17 @@ function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
tc=g:GetNext() tc=g:GetNext()
end end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_TO_DECK)
e1:SetCountLimit(1)
e1:SetOperation(cm.shop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end end
function cm.repval(e,c) function cm.repval(e,c)
return false return false
end end
function cm.shop(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleDeck(tp)
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