Commit 68c60cbc authored by Nemo Ma's avatar Nemo Ma

Upd 1102

parent 3ca64d2c
No preview for this file type
expansions/pics/11180010.jpg

90.8 KB | W: | H:

expansions/pics/11180010.jpg

32.7 KB | W: | H:

expansions/pics/11180010.jpg
expansions/pics/11180010.jpg
expansions/pics/11180010.jpg
expansions/pics/11180010.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180011.jpg

88 KB | W: | H:

expansions/pics/11180011.jpg

34.2 KB | W: | H:

expansions/pics/11180011.jpg
expansions/pics/11180011.jpg
expansions/pics/11180011.jpg
expansions/pics/11180011.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180012.jpg

85.1 KB | W: | H:

expansions/pics/11180012.jpg

32.9 KB | W: | H:

expansions/pics/11180012.jpg
expansions/pics/11180012.jpg
expansions/pics/11180012.jpg
expansions/pics/11180012.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180013.jpg

93.6 KB | W: | H:

expansions/pics/11180013.jpg

31.4 KB | W: | H:

expansions/pics/11180013.jpg
expansions/pics/11180013.jpg
expansions/pics/11180013.jpg
expansions/pics/11180013.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180014.jpg

83.9 KB | W: | H:

expansions/pics/11180014.jpg

30.6 KB | W: | H:

expansions/pics/11180014.jpg
expansions/pics/11180014.jpg
expansions/pics/11180014.jpg
expansions/pics/11180014.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180016.jpg

84.2 KB | W: | H:

expansions/pics/11180016.jpg

32.2 KB | W: | H:

expansions/pics/11180016.jpg
expansions/pics/11180016.jpg
expansions/pics/11180016.jpg
expansions/pics/11180016.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180017.jpg

87.1 KB | W: | H:

expansions/pics/11180017.jpg

32.5 KB | W: | H:

expansions/pics/11180017.jpg
expansions/pics/11180017.jpg
expansions/pics/11180017.jpg
expansions/pics/11180017.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180018.jpg

93 KB | W: | H:

expansions/pics/11180018.jpg

32 KB | W: | H:

expansions/pics/11180018.jpg
expansions/pics/11180018.jpg
expansions/pics/11180018.jpg
expansions/pics/11180018.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180019.jpg

87.6 KB | W: | H:

expansions/pics/11180019.jpg

31.4 KB | W: | H:

expansions/pics/11180019.jpg
expansions/pics/11180019.jpg
expansions/pics/11180019.jpg
expansions/pics/11180019.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180020.jpg

84.9 KB | W: | H:

expansions/pics/11180020.jpg

32.8 KB | W: | H:

expansions/pics/11180020.jpg
expansions/pics/11180020.jpg
expansions/pics/11180020.jpg
expansions/pics/11180020.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180021.jpg

90.4 KB | W: | H:

expansions/pics/11180021.jpg

31.1 KB | W: | H:

expansions/pics/11180021.jpg
expansions/pics/11180021.jpg
expansions/pics/11180021.jpg
expansions/pics/11180021.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180023.jpg

96 KB | W: | H:

expansions/pics/11180023.jpg

32.6 KB | W: | H:

expansions/pics/11180023.jpg
expansions/pics/11180023.jpg
expansions/pics/11180023.jpg
expansions/pics/11180023.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180024.jpg

36.3 KB | W: | H:

expansions/pics/11180024.jpg

33.1 KB | W: | H:

expansions/pics/11180024.jpg
expansions/pics/11180024.jpg
expansions/pics/11180024.jpg
expansions/pics/11180024.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180025.jpg

34.9 KB | W: | H:

expansions/pics/11180025.jpg

33.2 KB | W: | H:

expansions/pics/11180025.jpg
expansions/pics/11180025.jpg
expansions/pics/11180025.jpg
expansions/pics/11180025.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180030.jpg

19 KB | W: | H:

expansions/pics/11180030.jpg

34.9 KB | W: | H:

expansions/pics/11180030.jpg
expansions/pics/11180030.jpg
expansions/pics/11180030.jpg
expansions/pics/11180030.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180031.jpg

16.6 KB | W: | H:

expansions/pics/11180031.jpg

31.7 KB | W: | H:

expansions/pics/11180031.jpg
expansions/pics/11180031.jpg
expansions/pics/11180031.jpg
expansions/pics/11180031.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180032.jpg

36.6 KB | W: | H:

expansions/pics/11180032.jpg

36.1 KB | W: | H:

expansions/pics/11180032.jpg
expansions/pics/11180032.jpg
expansions/pics/11180032.jpg
expansions/pics/11180032.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11180033.jpg

31.6 KB | W: | H:

expansions/pics/11180033.jpg

31.9 KB | W: | H:

expansions/pics/11180033.jpg
expansions/pics/11180033.jpg
expansions/pics/11180033.jpg
expansions/pics/11180033.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/66690315.jpg

61.6 KB | W: | H:

expansions/pics/66690315.jpg

63.4 KB | W: | H:

expansions/pics/66690315.jpg
expansions/pics/66690315.jpg
expansions/pics/66690315.jpg
expansions/pics/66690315.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/71688492.jpg

42.1 KB | W: | H:

expansions/pics/71688492.jpg

41.7 KB | W: | H:

expansions/pics/71688492.jpg
expansions/pics/71688492.jpg
expansions/pics/71688492.jpg
expansions/pics/71688492.jpg
  • 2-up
  • Swipe
  • Onion skin
-- 龙裔显现
local s, id = GetID()
function s.initial_effect(c)
-- Card type (Monster)
aux.EnablePendulumAttribute(c)
-- ①: Special Summon condition
--幻殇·玉龙·凤玉
function c11180010.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_REMOVE+CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
e1:SetCountLimit(1,11180010)
e1:SetCost(c11180010.spcost)
e1:SetTarget(c11180010.sptg)
e1:SetOperation(c11180010.spop)
c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
Duel.AddCustomActivityCounter(11180010,ACTIVITY_SPSUMMON,c11180010.counterfilter)
end
function s.fit1(c)
return c:IsLevelBelow(2) or c:IsLinkBelow(2) or c:IsRankBelow(2)
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(s.fit1,1,nil) then
Duel.RegisterFlagEffect(rp,id,0,0,0)
end
end
function s.counterfilter(c)
function c11180010.counterfilter(c)
return c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3)
end
function s.splimit(e,c)
function c11180010.splimit(e,c)
return not (c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3))
end
function s.costfilter(c,tp)
return c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost()
end
function s.cfilter(c)
return c:GetSequence()<5
function c11180010.costfilter(c,tp)
return (c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost()) and Duel.GetMZoneCount(tp,c)>0
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler()) and Duel.GetFlagEffect(tp,id)<1 end
local e1=Effect.CreateEffect(e:GetHandler())
function c11180010.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c11180010.costfilter,tp,0xe,0,1,c,tp)
and Duel.GetFlagEffect(tp,11180010)==0 end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c11180010.splimit)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,e:GetHandler())
local g=Duel.SelectMatchingCard(tp,c11180010.costfilter,tp,0xe,0,1,1,c,tp)
local tc=g:GetFirst()
if tc:IsAbleToGraveAsCost() and (not tc:IsAbleToRemoveAsCost() or Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))==0) then
if tc:IsAbleToGraveAsCost() and (not tc:IsAbleToRemoveAsCost() or Duel.SelectOption(tp,1191,1192)==0) then
Duel.SendtoGrave(tc,REASON_COST)
else
Duel.Remove(tc,POS_FACEUP,REASON_COST)
end
e:SetLabelObject(tc)
e:SetLabel(tc:GetType())
end
function s.dragonfilter(c,ty)
return c:IsSetCard(0x6450) and not c:IsType(ty) and (c:IsAbleToGrave() or c:IsAbleToRemove())
end
function s.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 not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) then
e:SetCategory(CATEGORY_TOGRAVE+CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
e:SetLabel(0)
else
e:SetCategory(CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,PLAYER_ALL,LOCATION_GRAVE)
e:SetLabel(1)
end
function c11180010.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
function c11180010.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
local num=e:GetLabel()
local ty=bit.band(e:GetLabelObject():GetType(),0x7)
-- Additional effect if no monsters before summon
if num==0 then
local g2=Duel.GetMatchingGroup(s.dragonfilter,tp,LOCATION_DECK,0,nil,ty)
if #g2>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
local type=e:GetLabel()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
local ct=Duel.GetMatchingGroupCount(c11180010.mmzmfilter,tp,LOCATION_MZONE,0,nil)
local b1=Duel.IsExistingMatchingCard(c11180010.opfilter,tp,LOCATION_DECK,0,1,nil,type) and (ct==1)
local b2=Duel.IsExistingMatchingCard(c11180010.negfilter,tp,0xc,0xc,1,nil,type) and (ct>1)
if (b1 or b2) and Duel.SelectYesNo(tp,aux.Stringid(11180010,0)) then
Duel.BreakEffect()
if b1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg=g2:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if tc:IsAbleToGrave() and (not tc:IsAbleToRemove() or Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))==0) then
Duel.SendtoGrave(tc,REASON_EFFECT)
else
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
local g=Duel.SelectMatchingCard(tp,c11180010.opfilter,tp,LOCATION_DECK,0,1,1,nil,type)
if g:GetCount()>0 then
local tc=g:GetFirst()
if tc and tc:IsAbleToGrave() and (not tc:IsAbleToRemove() or Duel.SelectOption(tp,1191,1192)==0) then
Duel.SendtoGrave(tc,REASON_EFFECT)
else
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
end
else
-- Different effects based on card type sent
if ty&TYPE_MONSTER~=0 and #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
elseif ty&TYPE_SPELL~=0 then
local g3=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_REMOVED,0,nil)
local g4=g3:Filter(Card.IsSetCard,nil,0x6450)
local g5=g4:Filter(Card.IsType,nil,TYPE_TRAP)
if #g5>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g5:Select(tp,1,1,nil)
Duel.SSet(tp,sg)
elseif b2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectMatchingCard(tp,c11180010.negfilter,tp,0xc,0xc,1,1,nil,type)
if #g>0 then
Duel.HintSelection(g)
end
local tc=g:GetFirst()
if tc and tc:IsCanBeDisabledByEffect(e,false) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_DECKSHF)
c:RegisterEffect(e1)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
end
end
end
end
function c11180010.mmzmfilter(c)
return c:GetSequence()<5
end
function c11180010.opfilter(c,type)
return c:IsSetCard(0x3450,0x6450) and not c:IsType(type) and (c:IsAbleToGrave() or c:IsAbleToRemove())
end
function c11180010.negfilter(c,type)
return aux.NegateAnyFilter(c) and not c:IsType(type)
end
\ No newline at end of file
-- 幻殇龙裔
local s, id = GetID()
function s.initial_effect(c)
-- 1回合1次
aux.EnablePendulumAttribute(c)
--玉龙·幻殇·赤裔
function c11180011.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_REMOVE)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
e1:SetCountLimit(1,11180011)
e1:SetCost(c11180011.spcost)
e1:SetTarget(c11180011.sptg)
e1:SetOperation(c11180011.spop)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
Duel.AddCustomActivityCounter(11180011,ACTIVITY_SPSUMMON,c11180011.counterfilter)
end
function s.fit1(c)
return c:IsLevelBelow(2) or c:IsLinkBelow(2) or c:IsRankBelow(2)
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(s.fit1,1,nil) then
Duel.RegisterFlagEffect(rp,id,0,0,0)
end
end
function s.counterfilter(c)
function c11180011.counterfilter(c)
return c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3)
end
function s.splimit(e,c)
function c11180011.splimit(e,c)
return not (c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3))
end
function s.costfilter(c,tp)
return c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost()
function c11180011.costfilter(c,tp)
return (c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost()) and Duel.GetMZoneCount(tp,c)>0
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
function c11180011.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,c) and Duel.GetFlagEffect(tp,id)<1 end
local e1=Effect.CreateEffect(e:GetHandler())
if chk==0 then return Duel.IsExistingMatchingCard(c11180011.costfilter,tp,0xe,0,1,c,tp)
and Duel.GetFlagEffect(tp,11180011)==0 end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c11180011.splimit)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,c)
local g=Duel.SelectMatchingCard(tp,c11180011.costfilter,tp,0xe,0,1,1,c,tp)
local tc=g:GetFirst()
if tc:IsAbleToGraveAsCost() and (not tc:IsAbleToRemoveAsCost() or Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))==0) then
Duel.SendtoGrave(g,REASON_COST)
if tc:IsAbleToGraveAsCost() and (not tc:IsAbleToRemoveAsCost() or Duel.SelectOption(tp,1191,1192)==0) then
Duel.SendtoGrave(tc,REASON_COST)
else
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.Remove(tc,POS_FACEUP,REASON_COST)
end
e:SetLabelObject(tc)
e:SetLabel(tc:GetType())
end
function s.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 not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) then
e:SetCategory(CATEGORY_GRAVE_ACTION)
end
e:SetLabel(num)
function c11180011.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
function c11180011.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local num=e:GetLabel()
local ty=bit.band(e:GetLabelObject():GetType(),0x7)
-- 如果主要怪兽区原本没有怪兽
if num==0 then
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil,ty)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if tc:IsAbleToGrave() and (not tc:IsAbleToRemove() or Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))==0) then
Duel.SendtoGrave(sg,REASON_EFFECT)
else
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
else
-- 主要怪兽区有怪兽时的效果
if ty&TYPE_MONSTER~=0 then
-- 如果是怪兽,盖放对方墓地1张魔法·陷阱
local g=Duel.GetMatchingGroup(Card.IsType,tp,0,LOCATION_GRAVE,nil,TYPE_SPELL+TYPE_TRAP)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,1,1,nil)
Duel.SSet(tp,sg)
end
elseif ty&TYPE_TRAP~=0 then
-- 如果是陷阱,回收1张除外的「龙裔」卡
local g3=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_REMOVED,0,nil)
local g4=g3:Filter(Card.IsSetCard,nil,0x6450)
if #g4>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g4:Select(tp,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_RETURN)
end
end
end
-- 离场返回卡组
local type=e:GetLabel()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_DECKSHF)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
c:RegisterEffect(e1)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
local ct=Duel.GetMatchingGroupCount(c11180011.mmzmfilter,tp,LOCATION_MZONE,0,nil)
local b1=Duel.IsExistingMatchingCard(nil,tp,0xc,0xc,1,nil) and (ct==1)
local b2=Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c11180011.spfilter),tp,0x10,0,1,nil,e,tp,type) and (ct>1)
if (b1 or b2) and Duel.SelectYesNo(tp,aux.Stringid(11180011,0)) then
Duel.BreakEffect()
if b1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,0xc,0xc,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,0x40)
end
elseif b2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c11180011.spfilter),tp,0x10,0,1,1,nil,e,tp,type)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
end
function s.filter(c,ty)
return c:IsSetCard(0x6450) and not c:IsType(ty) and (c:IsAbleToGrave() or c:IsAbleToRemove())
function c11180011.mmzmfilter(c)
return c:GetSequence()<5
end
function c11180011.spfilter(c,e,tp,type)
return c:IsSetCard(0x3450) and not c:IsType(type) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
\ No newline at end of file
-- 幻殇龙裔(新效果)
local s, id = GetID()
function s.initial_effect(c)
-- 1回合1次
aux.EnablePendulumAttribute(c)
function c11180012.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,3))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_REMOVE)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
e1:SetCountLimit(1,11180012)
e1:SetCost(c11180012.spcost)
e1:SetTarget(c11180012.sptg)
e1:SetOperation(c11180012.spop)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
Duel.AddCustomActivityCounter(11180012,ACTIVITY_SPSUMMON,c11180012.counterfilter)
end
function s.fit1(c)
return c:IsLevelBelow(2) or c:IsLinkBelow(2) or c:IsRankBelow(2)
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(s.fit1,1,nil) then
Duel.RegisterFlagEffect(rp,id,0,0,0)
end
end
function s.counterfilter(c)
function c11180012.counterfilter(c)
return c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3)
end
function s.splimit(e,c)
function c11180012.splimit(e,c)
return not (c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3))
end
function s.costfilter(c,tp)
return c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost()
function c11180012.costfilter(c,tp)
return (c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost()) and Duel.GetMZoneCount(tp,c)>0
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
function c11180012.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,c) and Duel.GetFlagEffect(tp,id)<1 end
local e1=Effect.CreateEffect(e:GetHandler())
if chk==0 then return Duel.IsExistingMatchingCard(c11180012.costfilter,tp,0xe,0,1,c,tp)
and Duel.GetFlagEffect(tp,11180012)==0 end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c11180012.splimit)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,c)
local g=Duel.SelectMatchingCard(tp,c11180012.costfilter,tp,0xe,0,1,1,c,tp)
local tc=g:GetFirst()
if tc:IsAbleToGraveAsCost() and (not tc:IsAbleToRemoveAsCost() or Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))==0) then
Duel.SendtoGrave(g,REASON_COST)
if tc:IsAbleToGraveAsCost() and (not tc:IsAbleToRemoveAsCost() or Duel.SelectOption(tp,1191,1192)==0) then
Duel.SendtoGrave(tc,REASON_COST)
else
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.Remove(tc,POS_FACEUP,REASON_COST)
end
e:SetLabelObject(tc)
e:SetLabel(tc:GetType())
end
function s.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 Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) then
e:SetLabel(1)
e:SetCategory(CATEGORY_DRAW+CATEGORY_TOHAND)
else
e:SetLabel(0)
end
function c11180012.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
function c11180012.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local num=e:GetLabel()
local ty=bit.band(e:GetLabelObject():GetType(),0x7)
-- 如果主要怪兽区原本没有怪兽
if num==0 then
local g=Duel.GetMatchingGroup(s.setfilter,tp,LOCATION_DECK,0,nil,ty)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,1,1,nil)
Duel.SSet(tp,sg)
end
else
-- 主要怪兽区有怪兽时的效果
if ty&TYPE_MONSTER~=0 then
-- 如果是怪兽,选场上1张表侧卡效果无效
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
elseif ty&TYPE_SPELL~=0 then
-- 如果是魔法卡,抽1张卡
Duel.Draw(tp,1,REASON_EFFECT)
end
end
-- 离场返回卡组
local type=e:GetLabel()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_DECKSHF)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
c:RegisterEffect(e1)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
local ct=Duel.GetMatchingGroupCount(c11180012.mmzmfilter,tp,LOCATION_MZONE,0,nil)
local b1=Duel.IsExistingMatchingCard(c11180012.setfilter,tp,0x1,0,1,nil,type) and (ct==1)
local b2=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0x10,0x10,1,nil) and (ct>1)
if (b1 or b2) and Duel.SelectYesNo(tp,aux.Stringid(11180012,0)) then
Duel.BreakEffect()
if b1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c11180012.setfilter,tp,0x1,0,1,1,nil,type)
if g:GetCount()>0 then
Duel.SSet(tp,g)
end
elseif b2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0x10,0x10,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,0x5,0x40)
end
end
end
end
end
function s.setfilter(c,ty)
return c:IsSetCard(0x6450) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsType(ty) and c:IsSSetable()
function c11180012.mmzmfilter(c)
return c:GetSequence()<5
end
function c11180012.setfilter(c,type)
return c:IsSetCard(0x6450) and not c:IsType(type) and c:IsSSetable()
end
\ No newline at end of file
-- 幻殇龙裔(新效果)
local s, id = GetID()
function s.initial_effect(c)
-- 1回合1次
aux.EnablePendulumAttribute(c)
function c11180013.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_REMOVE+CATEGORY_TODECK)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
e1:SetCountLimit(1,11180013)
e1:SetCost(c11180013.spcost)
e1:SetTarget(c11180013.sptg)
e1:SetOperation(c11180013.spop)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
Duel.AddCustomActivityCounter(11180013,ACTIVITY_SPSUMMON,c11180013.counterfilter)
end
function s.fit1(c)
return c:IsLevelBelow(2) or c:IsLinkBelow(2) or c:IsRankBelow(2)
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(s.fit1,1,nil) then
Duel.RegisterFlagEffect(rp,id,0,0,0)
end
end
function s.counterfilter(c)
function c11180013.counterfilter(c)
return c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3)
end
function s.splimit(e,c)
function c11180013.splimit(e,c)
return not (c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3))
end
function s.costfilter(c,tp)
return c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost()
function c11180013.costfilter(c,tp)
return (c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost()) and Duel.GetMZoneCount(tp,c)>0
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
function c11180013.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,c) and Duel.GetFlagEffect(tp,id)<1 end
local e1=Effect.CreateEffect(e:GetHandler())
if chk==0 then return Duel.IsExistingMatchingCard(c11180013.costfilter,tp,0xe,0,1,c,tp)
and Duel.GetFlagEffect(tp,11180013)==0 end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c11180013.splimit)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,c)
local g=Duel.SelectMatchingCard(tp,c11180013.costfilter,tp,0xe,0,1,1,c,tp)
local tc=g:GetFirst()
if tc:IsAbleToGraveAsCost() and (not tc:IsAbleToRemoveAsCost() or Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))==0) then
if tc:IsAbleToGraveAsCost() and (not tc:IsAbleToRemoveAsCost() or Duel.SelectOption(tp,1191,1192)==0) then
Duel.SendtoGrave(tc,REASON_COST)
else
Duel.Remove(tc,POS_FACEUP,REASON_COST)
end
e:SetLabelObject(tc)
e:SetLabel(tc:GetType())
end
function s.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 not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) then
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,PLAYER_ALL,LOCATION_ONFIELD)
e:SetLabel(0)
else
if bit.band(e:GetLabelObject():GetType(),0x7)==TYPE_MONSTER then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
e:SetCategory(CATEGORY_GRAVE_SPSUMMON)
else
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end
e:SetLabel(1)
end
function c11180013.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
function c11180013.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local num=e:GetLabel()
local ty=bit.band(e:GetLabelObject():GetType(),0x7)
-- 如果主要怪兽区原本没有怪兽
if num==0 then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
local type=e:GetLabel()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
local ct=Duel.GetMatchingGroupCount(c11180013.mmzmfilter,tp,LOCATION_MZONE,0,nil)
local b1=Duel.IsExistingMatchingCard(c11180013.tdfilter,tp,0xc,0xc,1,nil,type) and (ct==1)
local b2=Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c11180013.thfilter),tp,0x10,0,1,nil,type) and (ct>1)
if (b1 or b2) and Duel.SelectYesNo(tp,aux.Stringid(11180013,0)) then
Duel.BreakEffect()
if b1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:FilterSelect(tp,function(c,ty) return not c:IsType(ty) end,1,1,nil,ty)
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
else
-- 主要怪兽区有怪兽时的效果
if ty&TYPE_MONSTER~=0 then
-- 如果是怪兽,从墓地或手卡特召1只「幻殇」怪兽
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,nil,e,tp)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
local g=Duel.SelectMatchingCard(tp,c11180013.tdfilter,tp,0xc,0xc,1,1,nil,type)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,2,0x40)
end
elseif ty&TYPE_SPELL~=0 then
-- 如果是魔法卡,从除外区特召1只「幻殇」怪兽
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_REMOVED,0,nil,e,tp)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
elseif b2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c11180013.thfilter),tp,0x10,0,1,1,nil,type)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,0x40)
end
end
end
-- 离场返回卡组
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_DECKSHF)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
c:RegisterEffect(e1)
end
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x3450) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function c11180013.mmzmfilter(c)
return c:GetSequence()<5
end
function c11180013.tdfilter(c,type)
return c:IsFaceup() and not c:IsType(type) and c:IsAbleToDeck()
end
function c11180013.thfilter(c,type)
return c:IsSetCard(0x3450,0x6450) and not c:IsType(type) and c:IsAbleToHand()
end
\ No newline at end of file
......@@ -74,8 +74,8 @@ end
-- ② When sent to GY target
function s.thfilter(c)
return (c:IsSetCard(0x3450) and c:IsType(TYPE_MONSTER)) or
(c:IsSetCard(0x6450) and c:IsType(TYPE_SPELL+TYPE_TRAP))
return (c:IsSetCard(0x3450) and c:IsType(TYPE_MONSTER) and c:IsLocation(LOCATION_DECK)) or
(c:IsSetCard(0x6450) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsLocation(0x30) and c:IsFaceupEx())
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
-- 龙裔幻殇速攻魔法
--净玉之鸣
local s, id = GetID()
function s.initial_effect(c)
-- Quick-Play Spell type
-- ①: Choose 1 of 2 effects
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+100)
e1:SetCountLimit(1,id)
e1:SetTarget(s.efftg)
e1:SetOperation(s.effop)
c:RegisterEffect(e1)
end
-- Effect selection target
function s.pubfilter(c,tp)
return c:IsSetCard(0x3450,0x6450) and not c:IsPublic()
and Duel.IsExistingMatchingCard(s.nbfilter,tp,0xc,0xc,1,nil,c:GetType())
end
function s.nbfilter(c,type)
return c:IsFaceup() and aux.NegateAnyFilter(c) and c:IsAbleToRemove() and c:IsType(type)
and c~=cc
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x3450) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
if #g<1 or Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))==0 then
e:SetLabel(0)
else
e:SetLabel(1)
end
local b1=Duel.IsExistingMatchingCard(s.pubfilter,tp,LOCATION_HAND,0,1,c,tp)
local b2=Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp)
if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp,{b1,aux.Stringid(id,1)},{b2,aux.Stringid(id,2)})
e:SetLabel(op)
end
-- Effect operation
function s.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local op=e:GetLabel()
-- Effect 1: Declare card name and make effects cannot be negated
if op==0 then
-- Get list of valid cards to declare
getmetatable(c).announce_filter={0x3450,OPCODE_ISSETCARD,0x6450,OPCODE_ISSETCARD,OPCODE_OR}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(c).announce_filter))
-- Create effect that prevents negation
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DISEFFECT)
e1:SetValue(s.efilter)
e1:SetLabel(ac)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
-- Effect 2: Special Summon from GY or banish
else
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,s.pubfilter,tp,LOCATION_HAND,0,1,1,nil)
if #g<1 then return end
local pc=g:GetFirst()
local type=pc:GetType()
local tc=Duel.SelectMatchingCard(tp,s.nbfilter,tp,0xc,0xc,1,1,aux.ExceptThisCard(e),type):GetFirst()
if tc and tc:IsCanBeDisabledByEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
Duel.AdjustInstantly()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
elseif op==2 then
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......@@ -59,15 +71,3 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
-- Filter for Effect 1
function s.efilter(e,ct)
local p=e:GetHandlerPlayer()
local te,tp=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
return p==tp and te:GetHandler():IsCode(e:GetLabel())
end
-- Filter for Effect 2
function s.spfilter(c,e,tp)
return c:IsSetCard(0x3450) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
......@@ -37,7 +37,8 @@ function s.negcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev)
end
function s.cfilter(c,type)
return c:IsType(type) and (c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost())
return c:IsType(type) and c:IsSetCard(0x3450,0x6450)
and (c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost())
end
-- ①: Cost function
function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
-- 玉龙·幻殇·苍龙
local s, id = GetID()
function s.initial_effect(c)
-- 可以在「幻殇」怪兽上叠放超量召唤
function c11180023.initial_effect(c)
--xyz
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,3,2,s.ovfilter,aux.Stringid(id,0))
-- ①效果:1回合1次,去素材送墓/除外并堆墓
aux.AddXyzProcedure(c,nil,3,2)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_REMOVE)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(s.rmcost)
e1:SetTarget(s.rmtg)
e1:SetOperation(s.rmop)
e1:SetCountLimit(1,11180023)
e1:SetCost(c11180023.cost)
e1:SetTarget(c11180023.target)
e1:SetOperation(c11180023.operation)
c:RegisterEffect(e1)
-- ②效果:从墓地/除外返回卡组并送墓/除外场上卡
--atk/def down
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOGRAVE+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e2:SetCountLimit(2,id+1) -- 1回合2次
e2:SetTarget(s.tdtg)
e2:SetOperation(s.tdop)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x3450))
e2:SetValue(c11180023.value1)
c:RegisterEffect(e2)
end
function s.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3450) and not c:IsCode(id)
end
function s.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
-- ①效果处理
function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) and Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
--atk/def down
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetValue(c11180023.value2)
c:RegisterEffect(e3)
end
function c11180023.cost(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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g1=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g1>0 then
local tc=g1:GetFirst()
if tc:IsAbleToGrave() and (not tc:IsAbleToRemove() or Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))==0) then
Duel.SendtoGrave(tc,REASON_COST)
else
Duel.Remove(tc,POS_FACEUP,REASON_COST)
end
end
end
function s.rmfilter(c)
return c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost()
function c11180023.thfilter(c)
return c:IsSetCard(0x3450,0x6450) and c:IsAbleToHand()
end
function s.tgfilter(c)
return (c:IsSetCard(0x6450) or c:IsSetCard(0x3450)) and (c:IsAbleToGrave() or c:IsAbleToRemove())
function c11180023.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11180023.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil)
function c11180023.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c11180023.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
-- 选择场上1张卡送墓/除外
-- 从卡组堆1张「幻殇」或「龙裔」卡
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g2=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g2>0 then
local tc=g2:GetFirst()
if tc:IsAbleToGrave() and (not tc:IsAbleToRemove() or Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))==0) then
Duel.SendtoGrave(tc,REASON_EFFECT)
else
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
end
-- ②效果处理
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 then
-- 选择自己场上最多3张卡送墓/除外
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg=g:Select(tp,1,3,nil)
for tc in aux.Next(sg) do
if tc:IsAbleToGrave() and (not tc:IsAbleToRemove() or Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))==0) then
Duel.SendtoGrave(tc,REASON_EFFECT)
else
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
end
end
function c11180023.value1(e,c)
return Duel.GetOverlayCount(tp,LOCATION_MZONE,LOCATION_MZONE)*600
end
function c11180023.value2(e,c)
return Duel.GetOverlayCount(tp,LOCATION_MZONE,LOCATION_MZONE)*(-600)
end
\ No newline at end of file
--幻殇·玉麒
function c11180030.initial_effect(c)
--xx
function c11180030.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x3450),3,3)
--alt summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(1166)
e1:SetDescription(aux.Stringid(11180030,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c11180030.LinkCondition(function(c) return c:IsLinkSetCard(0x3450) end,3,3,gf))
e1:SetTarget(c11180030.LinkTarget(function(c) return c:IsLinkSetCard(0x3450) end,3,3,gf))
e1:SetOperation(c11180030.LinkOperation(function(c) return c:IsLinkSetCard(0x3450) end,3,3,gf))
e1:SetValue(SUMMON_TYPE_LINK)
e1:SetCountLimit(1,11180030+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c11180030.spscon)
e1:SetTarget(c11180030.spstg)
e1:SetOperation(c11180030.spsop)
c:RegisterEffect(e1)
--cannot be link material
--cannot be effect target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e3:SetValue(1)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c11180030.etlimit)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--xx
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,11180030)
e1:SetCondition(c11180030.xxcon1)
e1:SetTarget(c11180030.xxtg1)
e1:SetOperation(c11180030.xxop1)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,11180030)
e1:SetCondition(c11180030.xxcon2)
e1:SetTarget(c11180030.xxtg2)
e1:SetOperation(c11180030.xxop2)
c:RegisterEffect(e1)
--destroy
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_SEND_REPLACE)
e4:SetTarget(c11180030.reptg)
e4:SetValue(c11180030.repval)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCondition(c11180030.spcon)
e4:SetTarget(c11180030.sptg)
e4:SetOperation(c11180030.spop)
c:RegisterEffect(e4)
end
function c11180030.slmfil(c)
return c:IsLinkSetCard(0x6450) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
end
function c11180030.LinkCondition(f,minct,maxct,gf)
return function(e,c,og,lmat,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local minc=minct
local maxc=maxct
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local tp=c:GetControler()
local mg=nil
if og then
mg=og:Filter(Auxiliary.LConditionFilter,nil,f,c,e)
else
mg=Auxiliary.GetLinkMaterials(tp,f,c,e)
if Duel.GetFlagEffect(tp,11180030)==0 then
local smg=Duel.GetMatchingGroup(c11180030.slmfil,tp,LOCATION_GRAVE,0,nil)
mg:Merge(smg)
end
end
if lmat~=nil then
if not Auxiliary.LConditionFilter(lmat,f,c,e) then return false end
mg:AddCard(lmat)
end
local fg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_LMATERIAL)
if fg:IsExists(Auxiliary.MustMaterialCounterFilter,1,nil,mg) then return false end
Duel.SetSelectedCard(fg)
return mg:CheckSubGroup(Auxiliary.LCheckGoal,minc,maxc,tp,c,gf,lmat)
end
function c11180030.etlimit(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function c11180030.LinkTarget(f,minct,maxct,gf)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,lmat,min,max)
local minc=minct
local maxc=maxct
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local mg=nil
if og then
mg=og:Filter(Auxiliary.LConditionFilter,nil,f,c,e)
else
mg=Auxiliary.GetLinkMaterials(tp,f,c,e)
if Duel.GetFlagEffect(tp,11180030)==0 then
local smg=Duel.GetMatchingGroup(c11180030.slmfil,tp,LOCATION_GRAVE,0,nil)
mg:Merge(smg)
end
end
if lmat~=nil then
if not Auxiliary.LConditionFilter(lmat,f,c,e) then return false end
mg:AddCard(lmat)
end
local fg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_LMATERIAL)
Duel.SetSelectedCard(fg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local cancel=Duel.IsSummonCancelable()
local sg=mg:SelectSubGroup(tp,Auxiliary.LCheckGoal,cancel,minc,maxc,tp,c,gf,lmat)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c11180030.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c11180030.LinkOperation(f,minct,maxct,gf)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,lmat,min,max)
local g=e:GetLabelObject()
c:SetMaterial(g)
Auxiliary.LExtraMaterialCount(g,c,tp)
local sg=g:Filter(c11180030.slmfil,nil):Filter(Card.IsLocation,nil,LOCATION_GRAVE)
if sg:GetCount()>0 then
g:Sub(sg)
Duel.Remove(sg,POS_FACEUP,REASON_MATERIAL+REASON_LINK)
Duel.RegisterFlagEffect(tp,11180030,RESET_PHASE+PHASE_END,0,1)
end
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_LINK)
g:DeleteGroup()
end
end
function c11180030.xxcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c11180030.ctfil(c)
return c:IsAbleToRemoveAsCost() or c:IsAbleToGraveAsCost()
end
function c11180030.negfil(c,xtype)
return c:IsType(xtype) and aux.NegateAnyFilter(c)
end
function c11180030.ctgck1(g,tp)
local ct1=g:FilterCount(Card.IsType,nil,TYPE_MONSTER)
local ct2=g:FilterCount(Card.IsType,nil,TYPE_SPELL)
local ct3=g:FilterCount(Card.IsType,nil,TYPE_TRAP)
return (ct1==0 or Duel.IsExistingMatchingCard(c11180030.negfil,tp,0,LOCATION_ONFIELD,ct1,nil,TYPE_MONSTER))
and (ct2==0 or Duel.IsExistingMatchingCard(c11180030.negfil,tp,0,LOCATION_ONFIELD,ct2,nil,TYPE_SPELL))
and (ct3==0 or Duel.IsExistingMatchingCard(c11180030.negfil,tp,0,LOCATION_ONFIELD,ct3,nil,TYPE_TRAP))
end
function c11180030.xxtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c11180030.ctfil,tp,LOCATION_ONFIELD,0,e:GetHandler())
if chk==0 then return g:CheckSubGroup(c11180030.ctgck1,1,10,tp) end
local sg=g:SelectSubGroup(tp,c11180030.ctgck1,false,1,10,tp)
local ct1=sg:FilterCount(Card.IsType,nil,TYPE_MONSTER)
local ct2=sg:FilterCount(Card.IsType,nil,TYPE_SPELL)
local ct3=sg:FilterCount(Card.IsType,nil,TYPE_TRAP)
e:SetLabel(ct1,ct2,ct3)
local tc=sg:GetFirst()
while tc do
Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
if tc:IsAbleToGrave() and (not tc:IsAbleToRemove() or Duel.SelectOption(tp,1191,1192)==0) then
Duel.SendtoGrave(tc,REASON_EFFECT)
else
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
tc=sg:GetNext()
end
end
function c11180030.xxop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct1,ct2,ct3=e:GetLabel()
local xg=Group.CreateGroup()
if ct1>0 and Duel.IsExistingMatchingCard(c11180030.negfil,tp,0,LOCATION_ONFIELD,ct1,nil,TYPE_MONSTER) then
local sg=Duel.SelectMatchingCard(tp,c11180030.negfil,tp,0,LOCATION_ONFIELD,ct1,ct1,nil,TYPE_MONSTER)
xg:Merge(sg1)
end
if ct2>0 and Duel.IsExistingMatchingCard(c11180030.negfil,tp,0,LOCATION_ONFIELD,ct2,nil,TYPE_SPELL) then
local sg=Duel.SelectMatchingCard(tp,c11180030.negfil,tp,0,LOCATION_ONFIELD,ct2,ct2,nil,TYPE_SPELL)
xg:Merge(sg)
end
if ct3>0 and Duel.IsExistingMatchingCard(c11180030.negfil,tp,0,LOCATION_ONFIELD,ct3,nil,TYPE_TRAP) then
local sg=Duel.SelectMatchingCard(tp,c11180030.negfil,tp,0,LOCATION_ONFIELD,ct3,ct3,nil,TYPE_TRAP)
xg:Merge(sg)
end
local tc=xg:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=e1:Clone()
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
tc:RegisterEffect(e3)
end
tc=xg:GetNext()
end
end
function c11180030.xxcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c11180030.setfil(c,xtype)
if not c:IsType(xtype) then return false end
if rc:IsType(TYPE_MONSTER) then
return rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
else
return rc:IsSSetable(true)
function c11180030.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsLevel(3) or c:IsSetCard(0x3450))
end
function c11180030.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c11180030.spfilter(chkc,e,tp,check) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c11180030.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c11180030.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c11180030.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c11180030.ctgck2(g,tp)
local ct1=g:FilterCount(Card.IsType,nil,TYPE_MONSTER)
local ct2=g:FilterCount(Card.IsType,nil,TYPE_SPELL)
local ct3=g:FilterCount(Card.IsType,nil,TYPE_TRAP)
return (ct1==0 or Duel.IsExistingMatchingCard(c11180030.negfil,tp,0,LOCATION_DECK,ct1,nil,TYPE_MONSTER))
and (ct2==0 or Duel.IsExistingMatchingCard(c11180030.negfil,tp,0,LOCATION_DECK,ct2,nil,TYPE_SPELL))
and (ct3==0 or Duel.IsExistingMatchingCard(c11180030.negfil,tp,0,LOCATION_DECK,ct3,nil,TYPE_TRAP))
and Duel.GetLocationCount(tp,LOCATION_MZONE)>=ct1
and Duel.GetLocationCount(tp,LOCATION_SZONE)>=ct2+ct3
end
function c11180030.xxtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c11180030.ctfil,tp,LOCATION_ONFIELD,0,e:GetHandler())
if chk==0 then return g:CheckSubGroup(c11180030.ctgck2,1,10,tp) end
local sg=g:SelectSubGroup(tp,c11180030.ctgck2,false,1,10,tp)
local ct1=sg:FilterCount(Card.IsType,nil,TYPE_MONSTER)
local ct2=sg:FilterCount(Card.IsType,nil,TYPE_SPELL)
local ct3=sg:FilterCount(Card.IsType,nil,TYPE_TRAP)
e:SetLabel(ct1,ct2,ct3)
local tc=sg:GetFirst()
while tc do
Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
if tc:IsAbleToGrave() and (not tc:IsAbleToRemove() or Duel.SelectOption(tp,1191,1192)==0) then
Duel.SendtoGrave(tc,REASON_EFFECT)
else
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
tc=sg:GetNext()
end
end
function c11180030.xxop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct1,ct2,ct3=e:GetLabel()
if ct1>0 and Duel.IsExistingMatchingCard(c11180030.setfil,tp,0,LOCATION_DECK,ct1,nil,TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=ct1 then
local sg=Duel.SelectMatchingCard(tp,c11180030.setfil,tp,0,LOCATION_DECK,ct1,ct1,nil,TYPE_MONSTER)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
local xg=Group.CreateGroup()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<ct2+ct3 then return false end
if ct2>0 and Duel.IsExistingMatchingCard(c11180030.setfil,tp,0,LOCATION_DECK,ct2,nil,TYPE_SPELL) then
local sg=Duel.SelectMatchingCard(tp,c11180030.setfil,tp,0,LOCATION_DECK,ct2,ct2,nil,TYPE_SPELL)
xg:Merge(sg)
end
if ct3>0 and Duel.IsExistingMatchingCard(c11180030.setfil,tp,0,LOCATION_DECK,ct3,nil,TYPE_TRAP) then
local sg=Duel.SelectMatchingCard(tp,c11180030.setfil,tp,0,LOCATION_DECK,ct3,ct3,nil,TYPE_TRAP)
xg:Merge(sg)
end
Duel.SSet(tp,xg)
end
function c11180030.repfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD) and c:IsSetCard(0x3450,0x6450) and (c:IsReason(REASON_DESTROY) or c:GetDestination()==LOCATION_REMOVED) and not c:IsReason(REASON_REPLACE)
end
function c11180030.repfil(c)
return c:IsSetCard(0x3450,0x6450) and c:IsAbleToRemove()
end
function c11180030.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c11180030.repfilter,1,nil,tp) and Duel.IsExistingMatchingCard(c11180030.repfil,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
if Duel.SelectYesNo(tp,aux.Stringid(11180030,3)) then
local sg=Duel.SelectMatchingCard(tp,c11180030.repfil,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
return true
else return false end
function c11180030.spsfilter(c,tp,sc)
return c:IsSetCard(0x3450,0x6450)
and c:IsAbleToRemoveAsCost()
end
function c11180030.repval(e,c)
return c11180030.repfilter(c,c:GetControler())
function c11180030.spscon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c11180030.spsfilter,tp,LOCATION_GRAVE,0,3,nil,tp,c)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c11180030.spstg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c11180030.spsfilter,tp,LOCATION_GRAVE,0,nil,tp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,3,3,nil)
if #sg==3 then
e:SetLabelObject(sg)
sg:KeepAlive()
return true
else return false end
end
function c11180030.spsop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Remove(g,POS_FACEUP,REASON_SPSUMMON)
g:DeleteGroup()
end
\ No newline at end of file
......@@ -4,36 +4,25 @@ function c11180031.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x3450),10,true)
--spsummon proc
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c11180031.hspcon)
e1:SetTarget(c11180031.hsptg)
e1:SetOperation(c11180031.hspop)
c:RegisterEffect(e1)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCountLimit(1,11180032+EFFECT_COUNT_CODE_OATH)
e0:SetCondition(c11180031.sprcon)
e0:SetTarget(c11180031.sprtg)
e0:SetOperation(c11180031.sprop)
c:RegisterEffect(e0)
--pendulum set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11180031,0))
e1:SetCategory(CATEGORY_LEAVE_GRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(c11180031.pctg)
e1:SetOperation(c11180031.pcop)
c:RegisterEffect(e1)
--copy self trap
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(c11180031.cpcon)
e2:SetTarget(c11180031.cptg)
e2:SetOperation(c11180031.cpop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
--lv
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
......@@ -42,43 +31,38 @@ function c11180031.initial_effect(c)
e1:SetTarget(c11180031.lvtg)
e1:SetOperation(c11180031.lvop)
c:RegisterEffect(e1)
end
function c11180031.spctfil(c,tp)
if not ((c:IsAbleToRemoveAsCost() or c:IsAbleToGraveAsCost()) and c:IsSetCard(0x3450,0x6450)) then return false end
return c:IsLocation(LOCATION_GRAVE+LOCATION_HAND) or c:IsFaceup()
end
function c11180031.spctgck(g,e,tp)
return g:FilterCount(Card.IsSetCard,nil,0x3450)==1
and g:FilterCount(Card.IsSetCard,nil,0x6450)==1
and Duel.GetLocationCountFromEx(tp,tp,g,e:GetHandler())>0
end
function c11180031.hspcon(e,c)
function c11180031.sprfilter(c)
return c:IsSetCard(0x3450,0x6450) and c:IsAbleToRemoveAsCost()
and (not c:IsLocation(LOCATION_EXTRA) or c:IsFaceup())
end
function c11180031.fselect(g,tp)
return Duel.GetLocationCountFromEx(tp,tp,g,TYPE_FUSION)>0
and g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND)
and g:IsExists(Card.IsLocation,1,nil,LOCATION_ONFIELD)
and g:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE)
and g:IsExists(Card.IsLocation,1,nil,LOCATION_EXTRA)
end
function c11180031.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c11180031.spctfil,tp,LOCATION_HAND+LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_ONFIELD,0,nil)
return g:CheckSubGroup(c11180031.spctgck,2,2,e,tp)
local tp=c:GetControler()
local rg=Duel.GetMatchingGroup(c11180031.sprfilter,tp,0x5e,0,nil)
return rg:CheckSubGroup(c11180031.fselect,4,4,tp)
end
function c11180031.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c11180031.spctfil,tp,LOCATION_HAND+LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_ONFIELD,0,nil)
local sg=g:SelectSubGroup(tp,c11180031.spctgck,true,2,2,e,tp)
if sg then
function c11180031.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetMatchingGroup(c11180031.sprfilter,tp,0x5e,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=rg:SelectSubGroup(tp,c11180031.fselect,true,4,4,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c11180031.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
local tc=g:GetFirst()
while tc do
Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
if tc:IsAbleToGrave() and (not tc:IsAbleToRemove() or Duel.SelectOption(tp,1191,1192)==0) then
Duel.SendtoGrave(tc,REASON_EFFECT)
else
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
tc=g:GetNext()
end
function c11180031.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Remove(g,POS_FACEUP,REASON_SPSUMMON)
g:DeleteGroup()
end
function c11180031.pcfilter(c)
return c:IsSetCard(0x3450) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
......@@ -91,83 +75,25 @@ function c11180031.pcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,c11180031.pcfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 and Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true) and c:IsRelateToEffect(e) and Duel.SelectYesNo(tp,aux.Stringid(11180031,0)) then
Duel.BreakEffect()
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c11180031.pcfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function c11180031.cpcon(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler():GetReasonCard()
return rc:IsSetCard(0x3450,0x6450) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c11180031.cpfil(c)
return c:IsSetCard(0x6450) and (c:IsType(TYPE_SPELL) or c:GetType()==TYPE_TRAP) and c:CheckActivateEffect(false,true,false)~=nil
end
function c11180031.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local te=e:GetLabelObject()
local tg=te:GetTarget()
return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
end
if chk==0 then return Duel.IsExistingTarget(c11180031.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c11180031.filter,tp,LOCATION_GRAVE,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true)
Duel.ClearTargetCard()
g:GetFirst():CreateEffectRelation(e)
local tg=te:GetTarget()
e:SetProperty(te:GetProperty())
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
end
function c11180031.cpop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
local tc=te:GetHandler()
if not (tc:IsRelateToEffect(e)) then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
function c11180031.filter(c)
return c:IsFaceup() and c:GetLevel()>0
end
function c11180031.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11180031.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
function c11180031.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINGMSG_LVRANK)
local lv=Duel.AnnounceLevel(tp,1,8,e:GetHandler():GetLevel())
e:SetLabel(lv)
end
function c11180031.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.SelectMatchingCard(tp,c11180031.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst()
if tc then
local op=0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
if tc:IsLevel(1) then
op=Duel.SelectOption(tp,aux.Stringid(11180031,1))+1
else
op=Duel.SelectOption(tp,aux.Stringid(11180031,1),aux.Stringid(11180031,2))+1
end
if op==1 then
lv=Duel.AnnounceLevel(tp,1,10)
elseif op==2 then
local x=tc:GetLevel()-1
if x>10 then x=10 end
lv=Duel.AnnounceLevel(tp,1,x)
lv=-lv
end
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
end
\ No newline at end of file
--幻殇·双子·光暗之龙
function c11180032.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,c11180032.sfilter1,aux.NonTuner(c11180032.sfilter2),5)
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--special summon
local e0=Effect.CreateEffect(c)
......@@ -14,48 +14,37 @@ function c11180032.initial_effect(c)
e0:SetTarget(c11180032.sprtg)
e0:SetOperation(c11180032.sprop)
c:RegisterEffect(e0)
--recover
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c11180032.lpcon1)
e1:SetOperation(c11180032.lpop1)
c:RegisterEffect(e1)
--sp_summon effect
--nontuner
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c11180032.regcon)
e2:SetOperation(c11180032.regop)
e2:SetCode(EFFECT_NONTUNER)
e2:SetValue(c11180032.tnval)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c11180032.lpcon2)
e3:SetOperation(c11180032.lpop2)
e3:SetLabelObject(e2)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c11180032.damcon2)
e3:SetOperation(c11180032.damop2)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_REMOVE)
e4:SetCountLimit(1,11180032+3000)
e4:SetCondition(c11180032.spcon)
e4:SetTarget(c11180032.sptg)
e4:SetOperation(c11180032.spop)
c:RegisterEffect(e4)
end
function c11180032.sfilter1(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsSynchroType(TYPE_SYNCHRO)
function c11180032.cfilter(c,tp)
return c:IsSummonPlayer(tp)
end
function c11180032.damcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsExists(c11180032.cfilter,1,nil,1-tp)
end
function c11180032.sfilter2(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsSynchroType(TYPE_SYNCHRO)
function c11180032.damop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,11180032)
Duel.Damage(1-tp,500,REASON_EFFECT)
end
function c11180032.tnval(e,c)
return e:GetHandler():IsControler(c:GetControler())
end
function c11180032.sprfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3450,0x6450) and c:IsAbleToDeckAsCost()
......@@ -69,7 +58,7 @@ end
function c11180032.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c11180032.sprfilter,tp,LOCATION_REMOVED,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:CancelableSelect(tp,2,2,nil)
local sg=g:Select(tp,2,2,nil)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
......@@ -81,77 +70,4 @@ function c11180032.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_SPSUMMON)
g:DeleteGroup()
end
function c11180032.spcon(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetOwner():IsSetCard(0x3450,0x6450)
end
function c11180032.spfilter(c,e,tp)
local b1=c:IsSetCard(0x3450) and c:IsType(TYPE_MONSTER) and c:IsFaceupEx()
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (not c:IsLocation(LOCATION_EXTRA) and Duel.GetMZoneCount(tp)>0
or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0)
local b2=c:IsSetCard(0x3450,0x6450) and c:IsType(0x6) and c:IsFaceupEx() and c:IsAbleToHand()
return b1 or b2
end
function c11180032.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11180032.spfilter,tp,0x70,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0x70)
end
function c11180032.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c11180032.spfilter),tp,0x70,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.HintSelection(g)
local tc=g:GetFirst()
if tc:IsType(0x1) then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
elseif tc:IsType(0x6) then
Duel.SendtoHand(tc,nil,0x40)
end
end
end
function c11180032.cfilter(c,sp)
return c:IsSummonPlayer(sp) and c:IsFaceup()
end
function c11180032.lpcon1(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return eg:IsExists(c11180032.cfilter,1,nil,1-tp)
and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE))
and not Duel.IsChainSolving()
end
function c11180032.lpop1(e,tp,eg,ep,ev,re,r,rp)
local lg=eg:Filter(c11180032.cfilter,nil,1-tp)
local rnum=lg:GetSum(Card.GetAttack)+lg:GetSum(Card.GetDefense)
if Duel.Recover(tp,rnum,REASON_EFFECT)<1 then return end
end
function c11180032.regcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return eg:IsExists(c11180032.cfilter,1,nil,1-tp)
and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE))
and Duel.IsChainSolving()
end
function c11180032.regop(e,tp,eg,ep,ev,re,r,rp)
local lg=eg:Filter(c11180032.cfilter,nil,1-tp)
local g=e:GetLabelObject()
if g==nil or #g==0 then
lg:KeepAlive()
e:SetLabelObject(lg)
else
g:Merge(lg)
end
Duel.RegisterFlagEffect(tp,60643554,RESET_CHAIN,0,1)
end
function c11180032.lpcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,60643554)>0
end
function c11180032.lpop2(e,tp,eg,ep,ev,re,r,rp)
Duel.ResetFlagEffect(tp,60643554)
local lg=e:GetLabelObject():GetLabelObject()
lg=lg:Filter(Card.IsLocation,nil,LOCATION_MZONE)
local rnum=lg:GetSum(Card.GetAttack)+lg:GetSum(Card.GetDefense)
local g=Group.CreateGroup()
g:KeepAlive()
e:GetLabelObject():SetLabelObject(g)
lg:DeleteGroup()
if Duel.Recover(tp,rnum,REASON_EFFECT)<1 then return end
end
\ No newline at end of file
......@@ -3,80 +3,96 @@ function c11180033.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,c11180033.mfilter,nil,2,99)
--immune
--material
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CAN_FORBIDDEN)
e1:SetCondition(c11180033.con)
e1:SetOperation(c11180033.op)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,11180033)
e1:SetCondition(c11180033.mtcon)
e1:SetTarget(c11180033.mttg)
e1:SetOperation(c11180033.mtop)
c:RegisterEffect(e1)
--damage
--immune
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,11180033)
e2:SetCondition(c11180033.damcon)
e2:SetTarget(c11180033.damtg)
e2:SetOperation(c11180033.damop)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetValue(c11180033.efilter)
e2:SetCondition(c11180033.effcon)
c:RegisterEffect(e2)
--atk
--atk and def up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(c11180033.val)
e3:SetCondition(c11180033.effcon)
e3:SetValue(6000)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e4)
--extra attack
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_EXTRA_ATTACK)
e5:SetValue(c11180033.val)
c:RegisterEffect(e5)
end
function c11180033.val(e)
local c=e:GetHandler()
local g=c:GetOverlayGroup()
return g:GetClassCount(Card.GetAttribute)-1
end
function c11180033.efilter(e,te)
return te:IsActiveType(TYPE_MONSTER) and te:GetOwner()~=e:GetOwner()
end
function c11180033.mfilter(c,xyzc)
return c:IsLevelAbove(1) and c:IsSetCard(0x3450)
return c:IsSetCard(0x3450) and c:IsFaceup()
end
function c11180033.con(e,tp,eg,ep,ev,re,r,rp)
function c11180033.mtcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c11180033.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(c11180033.efilter)
c:RegisterEffect(e1)
end
function c11180033.matfilter(c)
return c:IsFaceupEx() and c:IsSetCard(0x3450) and c:IsCanOverlay() and c:IsLevel(3)
end
function c11180033.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
function c11180033.mttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and c11180033.matfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c11180033.matfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectTarget(tp,c11180033.matfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,4,nil)
local gg=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
if gg:GetCount()>0 then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,gg,gg:GetCount(),0,0)
end
end
function c11180033.filter(c)
return c:IsSetCard(0x3450) and c:IsFaceup() and c:GetAttack()>0
and c:GetAttackAnnouncedCount()==0
function c11180033.mtfilter(c,e)
return c:IsRelateToEffect(e) and c:IsCanOverlay()
end
function c11180033.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
function c11180033.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c11180033.mtfilter,nil,e)
if c:IsRelateToEffect(e) and g:GetCount()>0 then
Duel.Overlay(c,g)
end
end
function c11180033.damtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c11180033.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c11180033.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c11180033.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetFirst():GetAttack())
function c11180033.attfilter(c)
return c:IsSetCard(0x3450) and c:IsType(TYPE_MONSTER)
end
function c11180033.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Damage(1-tp,tc:GetAttack(),REASON_EFFECT)
function c11180033.effcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetHandler():GetOverlayGroup()
local att=0
for tc in aux.Next(g) do
if c11180033.attfilter(tc) then
att=att|tc:GetAttribute()
end
end
local gattr=ATTRIBUTE_EARTH|ATTRIBUTE_WATER|ATTRIBUTE_FIRE|ATTRIBUTE_WIND|ATTRIBUTE_LIGHT|ATTRIBUTE_DARK
return att&gattr==gattr
end
function c11180033.atkfilter(c)
return c:IsFaceupEx() and (c:IsLevel(3) or c:IsRank(3))
end
function c11180033.val(e,c)
return Duel.GetMatchingGroupCount(c11180033.atkfilter,c:GetControler(),0x14,0,nil)*500
function c11180033.efilter(e,te)
return not te:GetOwner():IsSetCard(0x3450,0x6450)
end
\ No newline at end of file
--乱流舞者 尤可
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--search when normal summoned
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--add to hand from deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_DECK)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.athcon)
e2:SetCost(s.athcost)
e2:SetTarget(s.athtg)
e2:SetOperation(s.athop)
c:RegisterEffect(e2)
-- 添加全局效果:连锁结束时检查卡组表侧卡
if not ConfirmCheck then
ConfirmCheck=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(s.regcon)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
-- 连锁结束时检查是否有表侧卡的条件
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsPosition,p,LOCATION_DECK,LOCATION_DECK,nil,POS_FACEUP_DEFENSE)>0
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsPosition,p,LOCATION_DECK,0,nil,POS_FACEUP_DEFENSE)
local g2=Duel.GetFieldGroup(p,LOCATION_EXTRA,0)
if #g2>0 then
Duel.ConfirmCards(p,g+g2,true)
end
end
end
function s.mark_as_faceup(c)
c:ReverseInDeck()
c:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
function s.thfilter(c)
return c:IsSetCard(0x9225) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,g)
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(7)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetTargetRange(1,0)
e2:SetTarget(s.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
end
end
function s.splimit(e,c)
return not (c:GetLevel()==7 or c:GetRank()==7)
end
function s.athcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsPosition(POS_FACEUP_ATTACK) or c:IsPosition(POS_FACEUP_DEFENSE) then
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
local faceup_cards=Group.CreateGroup()
for tc in aux.Next(g) do
if tc:GetFlagEffect(id+1000)>0 then
faceup_cards:AddCard(tc)
end
end
if faceup_cards:GetCount()>0 then
Duel.ConfirmCards(tp,faceup_cards)
Duel.ConfirmCards(1-tp,faceup_cards)
end
return true
end
return false
end
function s.athcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.ConfirmCards(1-tp,tc)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_COST)
Duel.ShuffleDeck(tp)
s.mark_as_faceup(tc)
end
end
function s.athtg(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 s.athop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
\ No newline at end of file
--乱流舞者 科莱
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--special summon effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--special summon from deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_DECK)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.spcon)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
-- 保留全局效果
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsPosition,p,LOCATION_DECK,0,nil,POS_FACEUP_DEFENSE)
local g2=Duel.GetFieldGroup(p,LOCATION_EXTRA,0)
if #g2>0 then
Duel.ConfirmCards(p,g+g2,true)
end
end
end
function s.mark_as_faceup(c)
if c:GetLocation()==LOCATION_DECK then
c:ReverseInDeck()
c:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<3 then return end
local g=Duel.GetDecktopGroup(tp,3)
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,Card.IsAbleToHand,1,1,nil)
if #sg>0 then
if Duel.SendtoHand(sg,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,sg)
g:Sub(sg)
if #g>0 then
-- 确保卡片表面向上放回卡组
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_DECKSHF)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
tc:RegisterEffect(e1)
end
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(tp)
for tc in aux.Next(g) do
s.mark_as_faceup(tc)
end
end
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not (c:GetLevel()==7 or c:GetRank()==7)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPosition(POS_FACEUP_ATTACK) or c:IsPosition(POS_FACEUP_DEFENSE)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.ConfirmCards(1-tp,tc)
-- 确保卡片表面向上放回卡组
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_DECKSHF)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
tc:RegisterEffect(e1)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_COST)
Duel.ShuffleDeck(tp)
s.mark_as_faceup(tc)
end
end
function s.sptg2(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
Duel.SetOperationInfo(0,CATEGORY_DECKDES,e:GetHandler(),1,0,0)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
\ No newline at end of file
--乱流舞者 由伊
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--hand effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.hcost)
e1:SetTarget(s.htg)
e1:SetOperation(s.hop)
c:RegisterEffect(e1)
--special summon from deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_DECK)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.spcon)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
-- 保留全局效果
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsPosition,p,LOCATION_DECK,0,nil,POS_FACEUP_DEFENSE)
local g2=Duel.GetFieldGroup(p,LOCATION_EXTRA,0)
if #g2>0 then
Duel.ConfirmCards(p,g+g2,true)
end
end
end
function s.mark_as_faceup(c)
if c:GetLocation()==LOCATION_DECK then
c:ReverseInDeck()
c:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
function s.mfilter(c)
return c:IsSetCard(0x9225) and c:IsType(TYPE_MONSTER)
end
function s.hcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function s.htg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and
Duel.IsExistingMatchingCard(s.mfilter,tp,LOCATION_DECK,0,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.hop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(s.mfilter,tp,LOCATION_DECK,0,nil)
local dcount=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if dcount==0 then return end
if g:GetCount()==0 then
Duel.ConfirmDecktop(tp,dcount)
return
end
local seq=-1
local tc=g:GetFirst()
local target=nil
while tc do
if tc:GetSequence()>seq then
seq=tc:GetSequence()
target=tc
end
tc=g:GetNext()
end
local reveal_count = dcount - seq
Duel.ConfirmDecktop(tp,reveal_count)
local revealed = Duel.GetDecktopGroup(tp, reveal_count)
if target:IsAbleToHand() then
Duel.DisableShuffleCheck()
Duel.SendtoHand(target,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,target)
revealed:RemoveCard(target)
revealed:AddCard(c)
local return_count = revealed:GetCount()
if return_count > 0 then
-- 确保卡片表面向上放回卡组
for tc in aux.Next(revealed) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_DECKSHF)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
tc:RegisterEffect(e1)
end
Duel.SendtoDeck(revealed,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(tp)
for tc in aux.Next(revealed) do
s.mark_as_faceup(tc)
end
end
else
Duel.ShuffleDeck(tp)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not (c:GetLevel()==7 or c:GetRank()==7)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPosition(POS_FACEUP_ATTACK) or c:IsPosition(POS_FACEUP_DEFENSE)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.ConfirmCards(1-tp,tc)
-- 确保卡片表面向上放回卡组
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_DECKSHF)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
tc:RegisterEffect(e1)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_COST)
Duel.ShuffleDeck(tp)
s.mark_as_faceup(tc)
end
end
function s.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
Duel.SetOperationInfo(0,CATEGORY_DECKDES,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
\ No newline at end of file
--乱流舞者 伊塔尔
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--hand effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.hcost)
e1:SetTarget(s.htg)
e1:SetOperation(s.hop)
c:RegisterEffect(e1)
--special summon from deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_DECK)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.spcon)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
-- 保留全局效果
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsPosition,p,LOCATION_DECK,0,nil,POS_FACEUP_DEFENSE)
local g2=Duel.GetFieldGroup(p,LOCATION_EXTRA,0)
if #g2>0 then
Duel.ConfirmCards(p,g+g2,true)
end
end
end
function s.mark_as_faceup(c)
if c:GetLocation()==LOCATION_DECK then
c:ReverseInDeck()
c:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
function s.stfilter(c)
return c:IsSetCard(0x9225) and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP))
end
function s.hcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function s.htg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and
Duel.IsExistingMatchingCard(s.stfilter,tp,LOCATION_DECK,0,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.hop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(s.stfilter,tp,LOCATION_DECK,0,nil)
local dcount=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if dcount==0 then return end
if g:GetCount()==0 then
Duel.ConfirmDecktop(tp,dcount)
return
end
local seq=-1
local tc=g:GetFirst()
local target=nil
while tc do
if tc:GetSequence()>seq then
seq=tc:GetSequence()
target=tc
end
tc=g:GetNext()
end
local reveal_count = dcount - seq
Duel.ConfirmDecktop(tp,reveal_count)
local revealed = Duel.GetDecktopGroup(tp, reveal_count)
if target:IsAbleToHand() then
Duel.DisableShuffleCheck()
Duel.SendtoHand(target,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,target)
revealed:RemoveCard(target)
revealed:AddCard(c)
local return_count = revealed:GetCount()
if return_count > 0 then
-- 确保卡片表面向上放回卡组
for tc in aux.Next(revealed) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_DECKSHF)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
tc:RegisterEffect(e1)
end
Duel.SendtoDeck(revealed,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(tp)
for tc in aux.Next(revealed) do
s.mark_as_faceup(tc)
end
end
else
Duel.ShuffleDeck(tp)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not (c:GetLevel()==7 or c:GetRank()==7)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPosition(POS_FACEUP_ATTACK) or c:IsPosition(POS_FACEUP_DEFENSE)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.ConfirmCards(1-tp,tc)
-- 确保卡片表面向上放回卡组
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_DECKSHF)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
tc:RegisterEffect(e1)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_COST)
Duel.ShuffleDeck(tp)
s.mark_as_faceup(tc)
end
end
function s.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
Duel.SetOperationInfo(0,CATEGORY_DECKDES,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
\ No newline at end of file
--乱流舞者 萨缪
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--hand effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.hcost)
e1:SetTarget(s.htg)
e1:SetOperation(s.hop)
c:RegisterEffect(e1)
--special summon from deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_DECK)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.spcon)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
-- 保留全局效果
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsPosition,p,LOCATION_DECK,0,nil,POS_FACEUP_DEFENSE)
local g2=Duel.GetFieldGroup(p,LOCATION_EXTRA,0)
if #g2>0 then
Duel.ConfirmCards(p,g+g2,true)
end
end
end
function s.mark_as_faceup(c)
if c:GetLocation()==LOCATION_DECK then
c:ReverseInDeck()
c:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
function s.hcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.ConfirmCards(1-tp,e:GetHandler())
end
function s.htg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5
end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,tp,5)
end
function s.hop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local dcount=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if dcount<5 then return end
Duel.ConfirmDecktop(tp,5)
local revealed = Duel.GetDecktopGroup(tp, 5)
revealed:AddCard(c)
local return_count = revealed:GetCount()
if return_count > 0 then
-- 确保卡片表面向上放回卡组
for tc in aux.Next(revealed) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_DECKSHF)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
tc:RegisterEffect(e1)
end
Duel.SendtoDeck(revealed,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(tp)
for tc in aux.Next(revealed) do
s.mark_as_faceup(tc)
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not (c:GetLevel()==7 or c:GetRank()==7)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPosition(POS_FACEUP_ATTACK) or c:IsPosition(POS_FACEUP_DEFENSE)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.ConfirmCards(1-tp,tc)
-- 确保卡片表面向上放回卡组
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_DECKSHF)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
tc:RegisterEffect(e1)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_COST)
Duel.ShuffleDeck(tp)
s.mark_as_faceup(tc)
end
end
function s.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
Duel.SetOperationInfo(0,CATEGORY_DECKDES,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
\ No newline at end of file
--乱流舞者 哈雅
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--draw when special summoned by "乱流舞者" card
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(s.drcon)
e1:SetTarget(s.drtg)
e1:SetOperation(s.drop)
c:RegisterEffect(e1)
--special summon from deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_DECK)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.spcon)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
if not ConfirmCheck then
ConfirmCheck=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(s.regcon)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
-- 连锁结束时检查是否有表侧卡的条件
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsPosition,p,LOCATION_DECK,LOCATION_DECK,nil,POS_FACEUP_DEFENSE)>0
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsPosition,p,LOCATION_DECK,0,nil,POS_FACEUP_DEFENSE)
local g2=Duel.GetFieldGroup(p,LOCATION_EXTRA,0)
if #g2>0 then
Duel.ConfirmCards(p,g+g2,true)
end
end
end
function s.mark_as_faceup(c)
c:ReverseInDeck()
c:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not re then return false end
local rc=re:GetHandler()
return rc and rc:IsSetCard(0x9225)
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)==2 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function s.splimit(e,c)
return not (c:GetLevel()==7 or c:GetRank()==7)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsPosition(POS_FACEUP_ATTACK) or c:IsPosition(POS_FACEUP_DEFENSE) then
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
local faceup_cards=Group.CreateGroup()
for tc in aux.Next(g) do
if tc:GetFlagEffect(id+1000)>0 then
faceup_cards:AddCard(tc)
end
end
if faceup_cards:GetCount()>0 then
Duel.ConfirmCards(tp,faceup_cards)
Duel.ConfirmCards(1-tp,faceup_cards)
end
return true
end
return false
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
Duel.ConfirmCards(1-tp,tc)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_COST)
Duel.ShuffleDeck(tp)
s.mark_as_faceup(tc)
end
function s.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
Duel.SetOperationInfo(0,CATEGORY_DECKDES,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
\ No newline at end of file
--飓风乱流舞者 辛
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,7,2,nil,nil,99)
--material effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(s.matcon)
e1:SetTarget(s.mattg)
e1:SetOperation(s.matop)
c:RegisterEffect(e1)
--draw and attach
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.drcon)
e2:SetTarget(s.drtg)
e2:SetOperation(s.drop)
c:RegisterEffect(e2)
--return to deck - 二速效果
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e3:SetCountLimit(1,id+o*2)
e3:SetCost(s.rtcost)
e3:SetTarget(s.rttg)
e3:SetOperation(s.rtop)
c:RegisterEffect(e3)
-- 保留全局效果
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsPosition,p,LOCATION_DECK,0,nil,POS_FACEUP_DEFENSE)
local g2=Duel.GetFieldGroup(p,LOCATION_EXTRA,0)
if #g2>0 then
Duel.ConfirmCards(p,g+g2,true)
end
end
end
function s.mark_as_faceup(c)
if c:GetLocation()==LOCATION_DECK then
c:ReverseInDeck()
c:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
function s.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function s.mattg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
-- 同一连锁上不能发动
if Duel.GetFlagEffect(tp,id)~=0 then return false end
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5
end
-- 注册连锁标志
Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,5)
end
function s.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local dcount=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if dcount<5 then return end
Duel.ConfirmDecktop(tp,5)
local revealed = Duel.GetDecktopGroup(tp, 5)
local attach_count = math.min(2, revealed:GetCount())
if attach_count > 0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local attach_group = revealed:Select(tp,1,attach_count,nil)
if attach_group:GetCount() > 0 then
Duel.Overlay(c,attach_group)
revealed:Sub(attach_group)
end
end
local return_count = revealed:GetCount()
if return_count > 0 then
-- 确保卡片表面向上放回卡组
for tc in aux.Next(revealed) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_DECKSHF)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
tc:RegisterEffect(e1)
end
Duel.SendtoDeck(revealed,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(tp)
for tc in aux.Next(revealed) do
s.mark_as_faceup(tc)
end
end
end
-- ②效果
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsSetCard(0x9225) and re:GetHandler():GetLocation()==LOCATION_DECK
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
-- 同一连锁上不能发动
if Duel.GetFlagEffect(tp,id)~=0 then return false end
return Duel.IsPlayerCanDraw(tp,2)
end
-- 注册连锁标志
Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.Draw(tp,2,REASON_EFFECT)==2 and c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(Card.IsCanOverlay,tp,LOCATION_HAND+LOCATION_ONFIELD,0,c)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=g:Select(tp,1,1,nil)
if #sg>0 then
local tc=sg:GetFirst()
-- 如果是超量怪兽且有超量素材,先将其超量素材送去墓地
if tc:IsType(TYPE_XYZ) and tc:GetOverlayCount()>0 then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
end
Duel.Overlay(c,sg)
end
end
end
end
-- ③效果 - 完全重写以避免协程错误
function s.rtcost(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
function s.rttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
-- 同一连锁上不能发动
if Duel.GetFlagEffect(tp,id)~=0 then return false end
-- 检查场上是否有可以返回卡组的卡
return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
-- 注册连锁标志
Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
end
function s.rtop(e,tp,eg,ep,ev,re,r,rp)
-- 选择场上1张卡返回卡组
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
-- 确保卡片表面向上放回卡组
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_DECKSHF)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
tc:RegisterEffect(e1)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(tp)
s.mark_as_faceup(tc)
end
end
\ No newline at end of file
--狂欢乱流舞者 浮
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,7,2,nil,nil,99)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCost(s.thcost)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(s.atkval)
c:RegisterEffect(e2)
--attach from grave or banish
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_LEAVE_GRAVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+o)
e3:SetTarget(s.attg)
e3:SetOperation(s.atop)
c:RegisterEffect(e3)
if not ConfirmCheck then
ConfirmCheck=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(s.regcon)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
-- 连锁结束时检查是否有表侧卡的条件
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsPosition,p,LOCATION_DECK,LOCATION_DECK,nil,POS_FACEUP_DEFENSE)>0
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsPosition,p,LOCATION_DECK,0,nil,POS_FACEUP_DEFENSE)
local g2=Duel.GetFieldGroup(p,LOCATION_EXTRA,0)
if #g2>0 then
Duel.ConfirmCards(p,g+g2,true)
end
end
end
function s.mark_as_faceup(c)
c:ReverseInDeck()
c:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
function s.thcost(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
function s.thfilter(c)
return c:IsSetCard(0x9225) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.atkval(e,c)
local g=Duel.GetMatchingGroup(Card.IsType,c:GetControler(),LOCATION_ONFIELD,LOCATION_ONFIELD,nil,TYPE_XYZ)
local atk=0
for tc in aux.Next(g) do
atk=atk+tc:GetOverlayCount()
end
return atk*200
end
function s.afilter(c)
return c:IsAbleToChangeControler() and not c:IsType(TYPE_TOKEN)
end
function s.attg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g1=Duel.GetMatchingGroup(s.afilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local g2=Duel.GetMatchingGroup(s.afilter,tp,0,LOCATION_GRAVE+LOCATION_REMOVED,nil)
return (g1:GetCount()>0 or g2:GetCount()>0)
and e:GetHandler():IsType(TYPE_XYZ)
end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,0,0)
end
function s.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g1=Duel.GetMatchingGroup(s.afilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local g2=Duel.GetMatchingGroup(s.afilter,tp,0,LOCATION_GRAVE+LOCATION_REMOVED,nil)
local g=Group.CreateGroup()
if #g1>0 then
g:Merge(g1)
end
if #g2>0 then
g:Merge(g2)
end
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=g:Select(tp,1,2,nil)
if #sg>0 then
Duel.Overlay(c,sg)
end
end
end
\ No newline at end of file
--极顶乱流舞者 索姆
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,7,3,nil,nil,99)
--return 1 card to deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(s.rtcost1)
e1:SetTarget(s.rttg1)
e1:SetOperation(s.rtop1)
c:RegisterEffect(e1)
--continuous effect: return detached materials to deck
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(s.rtcon2)
e2:SetOperation(s.rtop2)
c:RegisterEffect(e2)
--change effect
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id)
e3:SetCondition(s.chcon)
e3:SetCost(s.chcost)
e3:SetTarget(s.chtg)
e3:SetOperation(s.chop)
c:RegisterEffect(e3)
-- 添加全局效果处理表侧卡
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsPosition,p,LOCATION_DECK,0,nil,POS_FACEUP_DEFENSE)
local g2=Duel.GetFieldGroup(p,LOCATION_EXTRA,0)
if #g2>0 then
Duel.ConfirmCards(p,g+g2,true)
end
end
end
function s.rtcost1(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
function s.rttg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
end
function s.rtop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
-- 使用正确的方法将卡片表面向上放回卡组
local tc=g:GetFirst()
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(tp)
tc:ReverseInDeck()
tc:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
function s.rtcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_OVERLAY)
end
function s.rtop2(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(Card.IsPreviousLocation,nil,LOCATION_OVERLAY)
if #g>0 then
-- 将超量素材返回卡组(不表面向上)
for tc in aux.Next(g) do
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
Duel.ShuffleDeck(tp)
end
end
-- 修改③效果,参考于贝尔的幻影
function s.chcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP)
end
function s.chcost(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
function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function s.chop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,s.repop)
end
function s.repop(e,tp,eg,ep,ev,re,r,rp)
-- 双方各自从自身场上选1张卡回到卡组
local g1=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,0,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,nil)
if #g1>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg1=g1:Select(tp,1,1,nil)
if #sg1>0 then
-- 使用正确的方法将卡片表面向上放回卡组
local tc=sg1:GetFirst()
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(tp)
tc:ReverseInDeck()
tc:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
if #g2>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK)
local sg2=g2:Select(1-tp,1,1,nil)
if #sg2>0 then
-- 使用正确的方法将卡片表面向上放回卡组
local tc=sg2:GetFirst()
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(tp)
tc:ReverseInDeck()
tc:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
\ No newline at end of file
--乱流舞者起风
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--add to hand from deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_DECK)
e2:SetCountLimit(1,id)
e2:SetCondition(s.athcon)
e2:SetCost(s.athcost)
e2:SetTarget(s.athtg)
e2:SetOperation(s.athop)
c:RegisterEffect(e2)
if not ConfirmCheck then
ConfirmCheck=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(s.regcon)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
-- 连锁结束时检查是否有表侧卡的条件
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsPosition,p,LOCATION_DECK,LOCATION_DECK,nil,POS_FACEUP_DEFENSE)>0
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsPosition,p,LOCATION_DECK,0,nil,POS_FACEUP_DEFENSE)
local g2=Duel.GetFieldGroup(p,LOCATION_EXTRA,0)
if #g2>0 then
Duel.ConfirmCards(p,g+g2,true)
end
end
end
function s.mark_as_faceup(c)
c:ReverseInDeck()
c:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
function s.filter(c)
return c:IsSetCard(0x9225) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5 and
Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local dcount=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if dcount<5 then return end
Duel.ConfirmDecktop(tp,5)
local revealed = Duel.GetDecktopGroup(tp, 5)
local g=revealed:Filter(s.filter,nil)
local add_count = math.min(1, g:GetCount())
if add_count > 0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local add_group = g:Select(tp,1,add_count,nil)
if add_group:GetCount() > 0 then
Duel.DisableShuffleCheck()
Duel.SendtoHand(add_group,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,add_group)
revealed:Sub(add_group)
end
end
local return_count = revealed:GetCount()
if return_count > 0 then
Duel.SendtoDeck(revealed,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(tp)
for tc in aux.Next(revealed) do
s.mark_as_faceup(tc)
end
end
end
function s.athcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsPosition(POS_FACEUP_ATTACK) or c:IsPosition(POS_FACEUP_DEFENSE) then
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
local faceup_cards=Group.CreateGroup()
for tc in aux.Next(g) do
if tc:GetFlagEffect(id+1000)>0 then
faceup_cards:AddCard(tc)
end
end
if faceup_cards:GetCount()>0 then
Duel.ConfirmCards(tp,faceup_cards)
Duel.ConfirmCards(1-tp,faceup_cards)
end
return true
end
return false
end
function s.athcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
Duel.ConfirmCards(1-tp,tc)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_COST)
Duel.ShuffleDeck(tp)
s.mark_as_faceup(tc)
end
function s.athtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_SEARCH,e:GetHandler(),1,0,0)
end
function s.athop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
\ No newline at end of file
--乱流舞者鼓气登台
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--add to hand from deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_DECK)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.athcon)
e2:SetCost(s.athcost)
e2:SetTarget(s.athtg)
e2:SetOperation(s.athop)
c:RegisterEffect(e2)
if not ConfirmCheck then
ConfirmCheck=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(s.regcon)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
-- 连锁结束时检查是否有表侧卡的条件
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsPosition,p,LOCATION_DECK,LOCATION_DECK,nil,POS_FACEUP_DEFENSE)>0
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsPosition,p,LOCATION_DECK,0,nil,POS_FACEUP_DEFENSE)
local g2=Duel.GetFieldGroup(p,LOCATION_EXTRA,0)
if #g2>0 then
Duel.ConfirmCards(p,g+g2,true)
end
end
end
function s.mark_as_faceup(c)
c:ReverseInDeck()
c:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
function s.tgfilter(c)
return c:IsFaceup() and c:IsRank(7) and c:IsType(TYPE_XYZ)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x9225) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc) end
if chk==0 then
return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc or tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local sc=g:GetFirst()
if sc then
-- 检查目标怪兽是否可以作为超量素材
if not tc:IsCanBeXyzMaterial(sc) then return end
-- 转移超量素材
local mg=tc:GetOverlayGroup()
if mg:GetCount()>0 then
Duel.Overlay(sc,mg)
end
-- 将目标怪兽作为超量素材
Duel.Overlay(sc,tc)
-- 特殊召唤
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
function s.athcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsPosition(POS_FACEUP_ATTACK) or c:IsPosition(POS_FACEUP_DEFENSE) then
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
local faceup_cards=Group.CreateGroup()
for tc in aux.Next(g) do
if tc:GetFlagEffect(id+1000)>0 then
faceup_cards:AddCard(tc)
end
end
if faceup_cards:GetCount()>0 then
Duel.ConfirmCards(tp,faceup_cards)
Duel.ConfirmCards(1-tp,faceup_cards)
end
return true
end
return false
end
function s.athcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
Duel.ConfirmCards(1-tp,tc)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_COST)
Duel.ShuffleDeck(tp)
s.mark_as_faceup(tc)
end
function s.athtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_SEARCH,e:GetHandler(),1,0,0)
end
function s.athop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
\ No newline at end of file
--乱流舞者邀约
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--add to hand from deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_DECK)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.athcon)
e2:SetCost(s.athcost)
e2:SetTarget(s.athtg)
e2:SetOperation(s.athop)
c:RegisterEffect(e2)
-- 保留全局效果
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsPosition,p,LOCATION_DECK,0,nil,POS_FACEUP_DEFENSE)
local g2=Duel.GetFieldGroup(p,LOCATION_EXTRA,0)
if #g2>0 then
Duel.ConfirmCards(p,g+g2,true)
end
end
end
function s.mark_as_faceup(c)
if c:GetLocation()==LOCATION_DECK then
c:ReverseInDeck()
c:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
function s.filter1(c)
return c:IsFaceup() and c:IsSetCard(0x9225) and c:IsAbleToDeck()
end
function s.filter2(c)
return c:IsAbleToDeck()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then
return Duel.IsExistingTarget(s.filter1,tp,LOCATION_MZONE,0,1,nil) and
Duel.IsExistingTarget(s.filter2,tp,0,LOCATION_ONFIELD,1,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=Duel.SelectTarget(tp,s.filter1,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=Duel.SelectTarget(tp,s.filter2,tp,0,LOCATION_ONFIELD,1,2,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,g1:GetCount(),0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>0 then
local tc=sg:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_DECKSHF)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
tc:RegisterEffect(e1)
tc=sg:GetNext()
end
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(tp)
local tc=sg:GetFirst()
while tc do
s.mark_as_faceup(tc)
tc=sg:GetNext()
end
end
end
function s.athcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPosition(POS_FACEUP_ATTACK) or c:IsPosition(POS_FACEUP_DEFENSE)
end
function s.athcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.ConfirmCards(1-tp,tc)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_DECKSHF)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
tc:RegisterEffect(e1)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_COST)
Duel.ShuffleDeck(tp)
s.mark_as_faceup(tc)
end
end
function s.athtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_SEARCH,e:GetHandler(),1,0,0)
end
function s.athop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
\ No newline at end of file
--乱流舞者悠闲时间
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--ATK increase when "乱流舞者" card effect activates from deck
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_SZONE)
e1:SetOperation(s.atkop)
c:RegisterEffect(e1)
--Special Summon when Rank 7 Xyz Monster is Special Summoned
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--add to hand from deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_DECK)
e3:SetCountLimit(1,id+o)
e3:SetCondition(s.athcon)
e3:SetCost(s.athcost)
e3:SetTarget(s.athtg)
e3:SetOperation(s.athop)
c:RegisterEffect(e3)
if not ConfirmCheck then
ConfirmCheck=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(s.regcon)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
-- 连锁结束时检查是否有表侧卡的条件
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsPosition,p,LOCATION_DECK,LOCATION_DECK,nil,POS_FACEUP_DEFENSE)>0
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsPosition,p,LOCATION_DECK,0,nil,POS_FACEUP_DEFENSE)
local g2=Duel.GetFieldGroup(p,LOCATION_EXTRA,0)
if #g2>0 then
Duel.ConfirmCards(p,g+g2,true)
end
end
end
function s.mark_as_faceup(c)
c:ReverseInDeck()
c:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
if loc==LOCATION_DECK and re:GetHandler():IsSetCard(0x9225) then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
function s.spfilter(c,tp)
return c:IsType(TYPE_XYZ) and c:IsRank(7) and c:IsSummonType(SUMMON_TYPE_XYZ)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.spfilter,1,nil,tp)
end
function s.spfilter2(c,e,tp)
return c:IsSetCard(0x9225) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
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)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter2),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.athcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsPosition(POS_FACEUP_ATTACK) or c:IsPosition(POS_FACEUP_DEFENSE) then
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
local faceup_cards=Group.CreateGroup()
for tc in aux.Next(g) do
if tc:GetFlagEffect(id+1000)>0 then
faceup_cards:AddCard(tc)
end
end
if faceup_cards:GetCount()>0 then
Duel.ConfirmCards(tp,faceup_cards)
Duel.ConfirmCards(1-tp,faceup_cards)
end
return true
end
return false
end
function s.athcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
Duel.ConfirmCards(1-tp,tc)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_COST)
Duel.ShuffleDeck(tp)
s.mark_as_faceup(tc)
end
function s.athtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_SEARCH,e:GetHandler(),1,0,0)
end
function s.athop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
\ No newline at end of file
--乱流舞者聚风舞台
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetOperation(s.actop)
c:RegisterEffect(e0)
--search or special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_FZONE)
e1:SetCountLimit(1,id)
e1:SetCost(s.thcost)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--add to hand from deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_DECK)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.athcon)
e2:SetCost(s.athcost)
e2:SetTarget(s.athtg)
e2:SetOperation(s.athop)
c:RegisterEffect(e2)
if not ConfirmCheck then
ConfirmCheck=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(s.regcon)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
-- 连锁结束时检查是否有表侧卡的条件
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsPosition,p,LOCATION_DECK,LOCATION_DECK,nil,POS_FACEUP_DEFENSE)>0
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsPosition,p,LOCATION_DECK,0,nil,POS_FACEUP_DEFENSE)
local g2=Duel.GetFieldGroup(p,LOCATION_EXTRA,0)
if #g2>0 then
Duel.ConfirmCards(p,g+g2,true)
end
end
end
function s.mark_as_faceup(c)
c:ReverseInDeck()
c:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
function s.actop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local dcount=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if dcount<7 then return end
Duel.ConfirmDecktop(tp,7)
local revealed = Duel.GetDecktopGroup(tp, 7)
local return_count = revealed:GetCount()
if return_count > 0 then
Duel.SendtoDeck(revealed,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(tp)
for tc in aux.Next(revealed) do
s.mark_as_faceup(tc)
end
end
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
Duel.ConfirmCards(1-tp,tc)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_COST)
Duel.ShuffleDeck(tp)
s.mark_as_faceup(tc)
end
function s.filter(c,e,tp,ft)
return c:IsSetCard(0x9225) and c:IsType(TYPE_MONSTER) and
(c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,ft) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp,ft)
local tc=g:GetFirst()
if tc then
local b1=tc:IsAbleToHand()
local b2=ft>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))
elseif b1 then
op=0
else
op=1
end
if op==0 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 and tc:IsType(TYPE_XYZ) then
local dcount=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if dcount>=2 then
local mg=Duel.GetDecktopGroup(tp,2)
Duel.Overlay(tc,mg)
end
end
end
end
end
function s.athcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsPosition(POS_FACEUP_ATTACK) or c:IsPosition(POS_FACEUP_DEFENSE) then
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
local faceup_cards=Group.CreateGroup()
for tc in aux.Next(g) do
if tc:GetFlagEffect(id+1000)>0 then
faceup_cards:AddCard(tc)
end
end
if faceup_cards:GetCount()>0 then
Duel.ConfirmCards(tp,faceup_cards)
Duel.ConfirmCards(1-tp,faceup_cards)
end
return true
end
return false
end
function s.athcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
Duel.ConfirmCards(1-tp,tc)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_COST)
Duel.ShuffleDeck(tp)
s.mark_as_faceup(tc)
end
function s.athtg(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 s.athop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
\ No newline at end of file
--乱流舞者予你以星
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--negate and draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,id)
e1:SetCost(s.negcost)
e1:SetTarget(s.negtg)
e1:SetOperation(s.negop)
c:RegisterEffect(e1)
--return to deck during end phase
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.rtdtg)
e2:SetOperation(s.rtdop)
c:RegisterEffect(e2)
--add to hand from deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_DECK)
e3:SetCountLimit(1,id+o*2)
e3:SetCondition(s.athcon)
e3:SetCost(s.athcost)
e3:SetTarget(s.athtg)
e3:SetOperation(s.athop)
c:RegisterEffect(e3)
if not ConfirmCheck then
ConfirmCheck=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_END)
ge1:SetOperation(s.regcon)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
-- 连锁结束时检查是否有表侧卡的条件
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsPosition,p,LOCATION_DECK,LOCATION_DECK,nil,POS_FACEUP_DEFENSE)>0
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsPosition,p,LOCATION_DECK,0,nil,POS_FACEUP_DEFENSE)
local g2=Duel.GetFieldGroup(p,LOCATION_EXTRA,0)
if #g2>0 then
Duel.ConfirmCards(p,g+g2,true)
end
end
end
function s.mark_as_faceup(c)
c:ReverseInDeck()
c:RegisterFlagEffect(id+1000,RESET_EVENT+RESETS_STANDARD,0,1)
end
function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST) end
local g=Duel.GetMatchingGroup(Card.CheckRemoveOverlayCard,tp,LOCATION_MZONE,0,nil,tp,1,REASON_COST)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEATTACHFROM)
local tc=g:Select(tp,1,1,nil):GetFirst()
local og=tc:GetOverlayGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
local sg=og:Select(tp,1,1,nil)
local rc=sg:GetFirst()
Duel.SendtoGrave(rc,REASON_COST)
if rc:IsSetCard(0x9225) then
e:SetLabel(1)
else
e:SetLabel(0)
end
end
end
function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and aux.NegateAnyFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
if e:GetLabel()==1 then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
end
function s.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and not tc:IsDisabled() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
-- 添加选择是否抽卡的判断
if e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1) then
Duel.BreakEffect()
if Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
end
function s.rtdfilter(c)
return (c:IsSetCard(0x9225) or (c:IsType(TYPE_XYZ) and c:IsRank(7))) and c:IsAbleToDeck()
end
function s.rtdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.rtdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
local g=Duel.GetMatchingGroup(s.rtdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local ct=math.min(5,g:GetCount())
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,ct,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function s.rtdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.rtdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
if g:GetCount()==0 then return end
local ct=math.min(5,g:GetCount())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(tp,1,ct,nil)
if sg:GetCount()>0 then
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(tp)
for tc in aux.Next(sg) do
s.mark_as_faceup(tc)
end
end
end
function s.athcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsPosition(POS_FACEUP_ATTACK) or c:IsPosition(POS_FACEUP_DEFENSE) then
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
local faceup_cards=Group.CreateGroup()
for tc in aux.Next(g) do
if tc:GetFlagEffect(id+1000)>0 then
faceup_cards:AddCard(tc)
end
end
if faceup_cards:GetCount()>0 then
Duel.ConfirmCards(tp,faceup_cards)
Duel.ConfirmCards(1-tp,faceup_cards)
end
return true
end
return false
end
function s.athcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.ConfirmCards(1-tp,tc)
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_COST)
Duel.ShuffleDeck(tp)
s.mark_as_faceup(tc)
end
end
function s.athtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_SEARCH,e:GetHandler(),1,0,0)
end
function s.athop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
\ No newline at end of file
--深渊书库的管理者 莉贝尔
function c11771460.initial_effect(c)
c:EnableReviveLimit()
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_HANDES+CATEGORY_SPECIAL_SUMMON+CATEGORY_DICE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,11771460)
e1:SetCondition(c11771460.con1)
e1:SetCost(c11771460.cost)
e1:SetTarget(c11771460.tg)
e1:SetOperation(c11771460.op)
c:RegisterEffect(e1)
local e11=e1:Clone()
e11:SetType(EFFECT_TYPE_QUICK_O)
e11:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e11:SetCode(EVENT_FREE_CHAIN)
e11:SetCondition(c11771460.con2)
c:RegisterEffect(e11)
--
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_REMOVE+CATEGORY_DRAW+CATEGORY_DICE+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetTarget(c11771460.distg)
e2:SetOperation(c11771460.disop)
c:RegisterEffect(e2)
end
function c11771460.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c11771460.spfilter(c,e,tp)
return not c:IsCode(11771460) and c:IsType(TYPE_RITUAL)
and c:IsEffectProperty(aux.EffectPropertyFilter(EFFECT_FLAG_DICE))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true,POS_FACEUP)
end
function c11771460.disop(e,tp,eg,ep,ev,re,r,rp)
local dc=Duel.TossDice(tp,1)
local dc2=0
local ck=0
if not Duel.IsPlayerCanDraw(1-tp,1) or Duel.SelectYesNo(1-tp,aux.Stringid(11771460,0)) then
dc2=Duel.TossDice(1-tp,1)
else
ck=1
end
local p=-1
if dc>dc2 then p=tp elseif dc<dc2 then p=1-tp end
if p>=0 then
local b1=Duel.IsChainDisablable(ev) and Duel.GetFlagEffect(tp,11771460)==0
local b2=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,p,0,0xc,1,nil)
and Duel.GetFlagEffect(tp,11771460+1)==0
local b3=Duel.GetLocationCount(p,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c11771460.spfilter,p,0x13,0,1,nil,e,p)
and Duel.GetFlagEffect(tp,11771460+2)==0
local op=aux.SelectFromOptions(p,{b1,aux.Stringid(11771460,1)},{b2,aux.Stringid(11771460,2)},{b3,aux.Stringid(11771460,3)})
if op==1 then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
Duel.RegisterFlagEffect(tp,11771460,RESET_PHASE+PHASE_END,0,1)
elseif op==2 then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(p,Card.IsAbleToRemove,p,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
Duel.RegisterFlagEffect(tp,11771460+1,RESET_PHASE+PHASE_END,0,1)
elseif op==3 then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(p,aux.NecroValleyFilter(c11771460.spfilter),tp,0x13,0,1,1,nil,e,p)
if g:GetCount()>0 then
Duel.SpecialSummon(g,SUMMON_TYPE_RITUAL,p,p,false,true,POS_FACEUP)
g:GetFirst():CompleteProcedure()
end
Duel.RegisterFlagEffect(tp,11771460+2,RESET_PHASE+PHASE_END,0,1)
end
end
if ck==1 then
Duel.Draw(1-tp,1,0x40)
end
end
function c11771460.confilter(c)
return c:IsFaceup() and c:IsEffectProperty(aux.EffectPropertyFilter(EFFECT_FLAG_DICE))
end
function c11771460.con1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c11771460.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function c11771460.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c11771460.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function c11771460.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsPublic() end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
function c11771460.thfilter(c)
return c:IsCode(11771470) and c:IsAbleToHand()
end
function c11771460.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
local b2=Duel.IsExistingMatchingCard(c11771460.thfilter,tp,LOCATION_DECK,0,1,nil)
if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c11771460.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc==1 or dc==6 then
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
c:CompleteProcedure()
end
elseif dc>=2 or dc<=5 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c11771460.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
if g:GetFirst():IsLocation(LOCATION_HAND) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 then
Duel.BreakEffect()
Duel.ShuffleHand(tp)
Duel.DiscardHand(tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD,nil)
end
end
end
end
\ No newline at end of file
--煌龙 拉维亚
function c11771465.initial_effect(c)
c:EnableReviveLimit()
--negate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_REMOVE+CATEGORY_TODECK+CATEGORY_DICE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,11771465)
e1:SetCondition(c11771465.discon)
e1:SetTarget(c11771465.distg)
e1:SetOperation(c11771465.disop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DICE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,11771465+1)
e2:SetTarget(c11771465.sptg)
e2:SetOperation(c11771465.spop)
c:RegisterEffect(e2)
end
function c11771465.spfilter(c,e,tp)
return c:IsCode(11771460) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true,POS_FACEUP)
end
function c11771465.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c11771465.spfilter,tp,0x13,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0x13)
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c11771465.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DICE)
local ac=Duel.AnnounceNumber(tp,1,2,3,4,5,6)
local dc=Duel.TossDice(tp,1)
if ac==dc then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c11771465.spfilter),tp,0x13,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
g:GetFirst():CompleteProcedure()
end
end
end
function c11771465.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and Duel.IsChainDisablable(ev)
end
function c11771465.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,3)
end
function c11771465.disop(e,tp,eg,ep,ev,re,r,rp)
local ct1,ct2,ct3=Duel.TossDice(tp,3)
local dc=ct1+ct2+ct3
if dc>=6 then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
if dc>=12 then
local g=Duel.GetMatchingGroup(c11771465.tdfilter,tp,0,LOCATION_ONFIELD,nil)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
if dc==18 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c11771465.tdfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToDeck()
end
\ No newline at end of file
--自深渊的回归
local s,id,o=GetID()
function c11771470.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+1)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DICE+CATEGORY_TODECK+CATEGORY_DRAW+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+2)
e2:SetCost(c11771470.cost)
e2:SetTarget(c11771470.tg)
e2:SetOperation(c11771470.op)
c:RegisterEffect(e2)
end
function s.filter(c,e,tp)
return c:IsEffectProperty(aux.EffectPropertyFilter(EFFECT_FLAG_DICE))
end
function s.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_equal,chk)
if bit.band(c:GetType(),0x81)~=0x81 or (filter and not filter(c,e,tp,chk)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true,POS_FACEUP) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c):Filter(s.filter,nil)
if m2 then
mg:Merge(m2)
end
if c.mat_filter then
mg=mg:Filter(c.mat_filter,c,tp)
else
mg:RemoveCard(c)
end
local lv=level_function(c)
aux.GCheckAdditional=aux.RitualCheckAdditional(c,lv,greater_or_equal)
local res=mg:CheckSubGroup(aux.RitualCheck,1,lv,tp,c,lv,greater_or_equal)
aux.GCheckAdditional=nil
return res
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg1=Duel.GetRitualMaterial(tp)
return Duel.IsExistingMatchingCard(s.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,s.filter,e,tp,mg1,nil,Card.GetLevel,"Greater")
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
::cancel::
local mg1=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.RitualUltimateFilter),tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,s.filter,e,tp,mg1,nil,Card.GetLevel,"Greater")
local tc=g:GetFirst()
if tc then
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc):Filter(s.filter,nil)
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,true,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat then goto cancel end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c11771470.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),0x5,REASON_COST)
e:GetHandler():CreateEffectRelation(e)
end
function c11771470.tgfilter(c)
return c:IsAbleToHand()
end
function c11771470.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c11771470.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c11771470.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and (c:IsAbleToHand() or c:IsAbleToDeck()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c11771470.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c11771470.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc==1 or dc==3 or dc==5 then
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,1,0x40)>0 and c:IsLocation(0x1) then
Duel.Draw(tp,1,0x40)
end
elseif dc==2 or dc==4 or dc==6 then
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,0x40)
end
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,0x40)
end
end
end
\ No newline at end of file
local m=15006125
local cm=_G["c"..m]
cm.name="行吟的塞莱丝塔"
function cm.initial_effect(c)
aux.AddCodeList(c,15006126)
--
c:EnableReviveLimit()
--recover
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DAMAGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--draw count
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DRAW_COUNT)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0)
e2:SetCondition(cm.xcon)
e2:SetValue(2)
c:RegisterEffect(e2)
--extra summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e3:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e3:SetCondition(cm.xcon)
e3:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_MONSTER))
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_ONFIELD,0)
e4:SetCondition(cm.xcon)
e4:SetTarget(aux.TRUE)
e4:SetValue(1)
c:RegisterEffect(e4)
--atk up
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_UPDATE_ATTACK)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetCondition(cm.xcon)
e5:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_MONSTER))
e5:SetValue(aux.TargetBoolFunction(Card.GetBaseDefense))
c:RegisterEffect(e5)
--
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DAMAGE)
ge1:SetOperation(cm.regop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
return ep==tp and bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 and ((not re) or ((not re:GetHandler():IsCode(15006125)) and re~=e))
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
local val=Duel.Recover(tp,math.ceil(ev/2),REASON_EFFECT)
if val>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.RegisterFlagEffect(ep,m,0,0,1,ev)
local val=0
if Duel.GetFlagEffect(ep,m)~=0 then
for _,i in ipairs{Duel.GetFlagEffectLabel(ep,m)} do
val=val+i
end
end
if val>=8000 and not Duel.IsPlayerAffectedByEffect(ep,15006126) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(15006126)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,ep)
end
end
function cm.xcon(e)
local c=e:GetHandler()
local tp=c:GetControler()
return Duel.IsPlayerAffectedByEffect(tp,15006126)
end
\ No newline at end of file
local m=15006126
local cm=_G["c"..m]
cm.name="风的余音"
function cm.initial_effect(c)
local e1=aux.AddRitualProcGreaterCode(c,15006125,LOCATION_HAND+LOCATION_GRAVE,nil,nil,true,cm.extraop)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
end
function cm.extraop(e,tp,eg,ep,ev,re,r,rp,tc,mat)
if not tc then return end
if not mat then return end
local atk=mat:GetSum(Card.GetBaseAttack)
if atk>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.BreakEffect()
local val=Duel.Damage(tp,atk,REASON_EFFECT)
local ct=math.floor(val/1000)
if ct>3 then ct=3 end
local off=1
local ops={}
local opval={}
--battle ind
ops[off]=aux.Stringid(m,2)
opval[off]=1
off=off+1
--effect ind
ops[off]=aux.Stringid(m,3)
opval[off]=2
off=off+1
--target ind
ops[off]=aux.Stringid(m,4)
opval[off]=4
off=off+1
local ops_lp_equal={table.unpack(ops)}
local opval_lp_equal={table.unpack(opval)}
local op=0
local cct=0
while cct<ct do
local sel
local selval
sel=Duel.SelectOption(tp,table.unpack(ops))+1
selval=opval[sel]
if selval==0 then break end
table.remove(ops,sel)
table.remove(opval,sel)
table.remove(ops_lp_equal,sel)
table.remove(opval_lp_equal,sel)
op=op|selval
cct=cct+1
end
if op&1~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetDescription(aux.Stringid(m,2))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
end
if op&2~=0 then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetDescription(aux.Stringid(m,3))
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
end
if op&4~=0 then
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e3:SetDescription(aux.Stringid(m,4))
e3:SetRange(LOCATION_MZONE)
e3:SetLabel(tp)
e3:SetValue(cm.tgval)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3,true)
end
end
end
function cm.tgval(e,re,rp)
return rp==1-e:GetLabel()
end
\ No newline at end of file
--人理之诗 热砂狮身兽
function c22025230.initial_effect(c)
aux.AddCodeList(c,22025210)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetTarget(c22025230.target)
e1:SetOperation(c22025230.activate)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c22025230.atkcon)
e2:SetValue(4000)
c:RegisterEffect(e2)
--Activate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(22025230,0))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,22025230)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(c22025230.thtg)
e3:SetOperation(c22025230.thop)
c:RegisterEffect(e3)
end
function c22025230.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:IsCostChecked()
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,22025230,0xff1,TYPES_EFFECT_TRAP_MONSTER,0,4000,4,RACE_BEAST,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c22025230.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.IsPlayerCanSpecialSummonMonster(tp,22025230,0xff1,TYPES_EFFECT_TRAP_MONSTER,0,4000,4,RACE_BEAST,ATTRIBUTE_EARTH) then return end
c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)
end
function c22025230.atkfilter(c)
return c:IsFaceup() and c:IsCode(22025210)
end
function c22025230.atkcon(e)
local c=e:GetHandler()
return Duel.IsExistingMatchingCard(c22025230.atkfilter,c:GetControler(),LOCATION_ONFIELD,0,1,nil)
end
function c22025230.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsAbleToHand() and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c22025230.thop(e,tp,eg,ep,ev,re,r,rp)
local tc1=Duel.GetFirstTarget()
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
or not tc1:IsRelateToEffect(e) then return end
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0):RandomSelect(1-tp,1)
local tc=g:GetFirst()
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_CARDTYPE)
local op=Duel.AnnounceType(1-tp)
Duel.ConfirmCards(1-tp,tc)
Duel.ShuffleHand(tp)
if (op~=0 and tc:IsType(TYPE_MONSTER)) or (op~=1 and tc:IsType(TYPE_SPELL)) or (op~=2 and tc:IsType(TYPE_TRAP)) then
Duel.SendtoHand(tc1,nil,REASON_EFFECT)
end
end
......@@ -2,10 +2,9 @@
local s,id,o=GetID()
function s.initial_effect(c)
-- 作为这张卡的发动时的效果处理,可以从手卡把1只「蒸汽朋克」怪兽特殊召唤
-- 作为这张卡的发动时的效果处理,可以从卡组把「蒸汽朋克回响机关阵」以外的1张「蒸汽朋克」魔法·陷阱卡在自己场上盖放
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
......@@ -39,18 +38,17 @@ function s.initial_effect(c)
c:RegisterEffect(e3)
end
-- 作为这张卡的发动时的效果处理,可以从手卡把1只「蒸汽朋克」怪兽特殊召唤
function s.spfilter(c,e,tp)
return c:IsSetCard(0x666b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
-- 作为这张卡的发动时的效果处理,可以从卡组把「蒸汽朋克回响机关阵」以外的1张「蒸汽朋克」魔法·陷阱卡在自己场上盖放
function s.ssfilter(c,tp)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x666b) and not c:IsCode(id) and not c:IsForbidden() and c:IsSSetable()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
if #cg>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=cg:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
local g=Duel.GetMatchingGroup(s.ssfilter,tp,LOCATION_DECK,0,nil,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,1,1,nil)
Duel.SSet(tp,sg:GetFirst())
end
end
......
--典礼术
function c71500112.initial_effect(c)
aux.AddSetNameMonsterList(c,0x78f1)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DICE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,71500112+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c71500112.cost)
e1:SetTarget(c71500112.target)
e1:SetOperation(c71500112.activate)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c71500112.cttg)
e2:SetOperation(c71500112.ctop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(71500112,ACTIVITY_SPSUMMON,c71500112.counterfilter)
end
function c71500112.counterfilter(c)
return not c:IsSummonLocation(LOCATION_EXTRA)
end
function c71500112.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(71500112,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(function(e,c)
return c:IsLocation(LOCATION_EXTRA) end)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c71500112.filter(c,e,tp)
return true
end
function c71500112.rthfil(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c71500112.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
local mg2=nil
return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,c71500112.filter,e,tp,mg,mg2,Card.GetLevel,"Greater")
and Duel.IsExistingMatchingCard(c71500112.rthfil,tp,LOCATION_DECK,0,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c71500112.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
::cancel::
local mg=Duel.GetRitualMaterial(tp)
local mg2=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,c71500112.filter,e,tp,mg,mg2,Card.GetLevel,"Greater")
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if mg2 then
mg:Merge(mg2)
end
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,true,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat then goto cancel end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
Duel.BreakEffect()
local dc=Duel.TossDice(tp,1)
if dc and dc>0 and Duel.IsExistingMatchingCard(c71500112.rthfil,tp,LOCATION_DECK,0,1,nil) then
local sg=Duel.SelectMatchingCard(tp,c71500112.rthfil,tp,LOCATION_DECK,0,1,dc,nil)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
function c71500112.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
end
function c71500112.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsCanAddCounter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,0x78f1,1)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_COUNTER_PERMIT|0x78f1)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetRange(LOCATION_SZONE)
tc:RegisterEffect(e1)
tc:AddCounter(0x78f1,1)
tc=g:GetNext()
end
end
--预言术
function c71500115.initial_effect(c)
aux.AddSetNameMonsterList(c,0x78f1)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c71500115.cost)
e1:SetTarget(c71500115.target)
e1:SetOperation(c71500115.activate)
c:RegisterEffect(e1)
--sort decktop
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(c71500115.sdcost)
e2:SetTarget(c71500115.sdtg)
e2:SetOperation(c71500115.sdop)
c:RegisterEffect(e2)
end
function c71500115.counterfilter(c)
return not c:IsSummonLocation(LOCATION_EXTRA)
end
function c71500115.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(71500115,tp,ACTIVITY_SPSUMMON)==0 and Duel.IsCanRemoveCounter(tp,1,1,0x78f1,1,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x78f1,1,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(function(e,c)
return c:IsLocation(LOCATION_EXTRA) end)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c71500115.filter(c,e,tp)
return true
end
function c71500115.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
local mg2=nil
return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,c71500115.filter,e,tp,mg,mg2,Card.GetLevel,"Greater")
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c71500115.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
::cancel::
local mg=Duel.GetRitualMaterial(tp)
local mg2=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,c71500115.filter,e,tp,mg,mg2,Card.GetLevel,"Greater")
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if mg2 then
mg:Merge(mg2)
end
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,true,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat then goto cancel end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c71500115.thcon)
e1:SetOperation(c71500115.thop)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
end
function c71500115.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel()
end
function c71500115.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_CARD,0,71500115)
local code=Duel.AnnounceCard(tp)
local dc=Duel.TossDice(tp,1)
local g=Duel.GetDecktopGroup(tp,dc)
if g:GetCount()>=dc then
Duel.ConfirmDecktop(tp,dc)
if g:IsExists(Card.IsCode,1,nil,code) then
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function c71500115.sdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x78f1,1,REASON_COST) and aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,0) end
aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,1)
Duel.RemoveCounter(tp,1,1,0x78f1,1,REASON_COST)
end
function c71500115.sdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5 or Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>=5 end
end
function c71500115.sdop(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5
local b2=Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>=5
if not b1 and not b2 then return end
local op=nil
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(71500115,1),aux.Stringid(71500115,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(71500115,1))
else
op=Duel.SelectOption(tp,aux.Stringid(71500115,2))+1
end
local p=op==0 and tp or 1-tp
Duel.SortDecktop(tp,p,5)
end
--守护之风
function c71500118.initial_effect(c)
aux.AddSetNameMonsterList(c,0x78f1)
--act in h
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(71500109,0))
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e0:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCost(c71500118.aihcost)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,71500118+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c71500118.cost)
e1:SetTarget(c71500118.target)
e1:SetOperation(c71500118.activate)
c:RegisterEffect(e1)
--sort decktop
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(c71500118.thcost)
e2:SetTarget(c71500118.thtg)
e2:SetOperation(c71500118.thop)
c:RegisterEffect(e2)
end
function c71500118.pbfil(c)
return not c:IsPublic() and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)
end
function c71500118.aihcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71500118.pbfil,tp,LOCATION_HAND,0,1,nil) end
local pg=Duel.SelectMatchingCard(tp,c71500118.pbfil,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,pg)
Duel.ShuffleHand(tp)
end
function c71500118.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x78f1,3,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x78f1,3,REASON_COST)
end
function c71500118.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c71500118.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--half damage
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c71500118.damval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DAMAGE)
e1:SetCondition(c71500118.reccon)
e1:SetOperation(c71500118.recop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 then
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetTarget(function(e,c)
return c:GetCounter(0x78f1) end)
e2:SetValue(1)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
end
end
function c71500118.damval(e,re,val,r,rp,rc)
local c=e:GetHandler()
if bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 then
return val/2
end
return val
end
function c71500118.reccon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0
end
function c71500118.recop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_CARD,0,71500118)
Duel.Recover(tp,ev/2,REASON_EFFECT)
end
function c71500118.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x78f1,1,REASON_COST) and aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,0) end
aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,1)
Duel.RemoveCounter(tp,1,1,0x78f1,1,REASON_COST)
end
function c71500118.sthfil(c)
return c:IsAbleToHand() and (aux.IsSetNameMonsterListed(c,0x78f1) and c:IsType(TYPE_SPELL+TYPE_TRAP))
end
function c71500118.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71500118.sthfil,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c71500118.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.SelectMatchingCard(tp,c71500118.sthfil,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
......@@ -4,6 +4,13 @@ function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),5,true)
aux.AddContactFusionProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),LOCATION_GRAVE+LOCATION_REMOVED,0,aux.tdcfop(c)):SetValue(SUMMON_VALUE_SELF)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCondition(s.condition)
e0:SetOperation(s.regop)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
......@@ -13,4 +20,20 @@ function s.initial_effect(c)
end
function s.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(s.splimit1)
Duel.RegisterEffect(e1,tp)
end
function s.splimit1(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsCode(id) and bit.band(sumtype,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
\ No newline at end of file
--急袭猛禽-集群伯劳
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+id)
e2:SetCondition(s.lvcon)
e2:SetTarget(s.lvtg)
e2:SetOperation(s.lvop)
c:RegisterEffect(e2)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetOperation(aux.sumreg)
ge1:SetLabel(id)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
ge2:SetLabel(id)
Duel.RegisterEffect(ge2,0)
end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_MZONE,0,1,nil)
end
function s.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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function s.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(id)>0
end
function s.cfilter1(c)
return c:IsFacedown() or not c:IsSetCard(0xba)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xba)
end
function s.filter(c)
return c:IsFaceup() and c:GetLevel()>0 and c:IsSetCard(0xba)
end
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil)
local lg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(lg:GetCount())
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SET_AVAILABLE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(s.xyztg)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e2,tp)
end
function s.xyztg(e,c)
return not c:IsSetCard(0xba)
end
\ No newline at end of file
--暗黑能乐面具 希望之枭面
function c95101231.initial_effect(c)
--union
aux.EnableUnionAttribute(c,c95101231.unfilter)
--CoMETIK search
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,95101231)
e1:SetCost(c95101231.thcost)
e1:SetTarget(c95101231.thtg)
e1:SetOperation(c95101231.thop)
c:RegisterEffect(e1)
--reequip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(95101231,2))
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,95101231+1)
e2:SetCost(c95101231.recost)
e2:SetTarget(c95101231.retg)
e2:SetOperation(c95101231.reop)
c:RegisterEffect(e2)
end
function c95101231.unfilter(c)
return c:IsSetCard(0xbbb0) or c:IsCode(95101209)
end
function c95101231.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c95101231.thfilter(c)
return c:IsSetCard(0x3bb0) and c:IsAbleToHand()
end
function c95101231.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c95101231.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c95101231.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,c95101231.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if tg then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function c95101231.recost(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetEquipTarget()
e:SetLabelObject(tc)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c95101231.refilter(c,tc,tp,exclude_modern_count)
return aux.CheckUnionEquip(c,tc,exclude_modern_count) and c:CheckUnionTarget(tc) and c:IsSetCard(0xbbb0) and not c:IsCode(95101231) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end
function c95101231.retg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local c=e:GetHandler()
local exct=aux.IsUnionState(e) and 1 or 0
return c:GetEquipTarget()
and Duel.IsExistingMatchingCard(c95101231.refilter,tp,LOCATION_DECK,0,1,nil,c:GetEquipTarget(),tp,exct)
end
local tc=e:GetLabelObject()
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,tc,1,0,0)
end
function c95101231.reop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c95101231.refilter,tp,LOCATION_DECK,0,1,1,nil,tc,tp,nil)
local ec=g:GetFirst()
if ec and Duel.Equip(tp,ec,tc) then
aux.SetUnionState(ec)
end
end
end
--暗黑能乐面具舞者 秦心
function c95101233.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_PSYCHO),4,2)
c:EnableReviveLimit()
--change code
aux.EnableChangeCode(c,95101209,LOCATION_MZONE,c95101233.cccon)
--equip
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,95101233)
e1:SetTarget(c95101233.eqtg)
e1:SetOperation(c95101233.eqop)
c:RegisterEffect(e1)
--atk target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0x34,0x34)
e2:SetCondition(c95101233.effcon)
e2:SetTarget(c95101233.efftg)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
end
function c95101233.cccon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c95101233.eqfilter(c)
return c:IsAbleToChangeControler() and c:IsFaceup() and (c:GetOriginalType()&TYPE_MONSTER)==TYPE_MONSTER and not c:IsForbidden()
end
function c95101233.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c95101233.eqfilter,tp,0,LOCATION_ONFIELD,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,1-LOCATION_ONFIELD)
end
function c95101233.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc=Duel.SelectMatchingCard(tp,c95101233.eqfilter,tp,0,LOCATION_ONFIELD,1,1,nil,c):GetFirst()
if tc then
Duel.HintSelection(Group.FromCards(tc))
if not Duel.Equip(tp,tc,c) then return end
--Add Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c95101233.eqlimit)
tc:RegisterEffect(e1)
end
end
function c95101233.eqlimit(e,c)
return e:GetOwner()==c
end
function c95101233.effcon(e)
return e:GetHandler():GetEquipTarget()
end
function c95101233.efftg(e,c)
return c~=e:GetHandler()
end
--化龙祖师 政
function c95101234.initial_effect(c)
--spsummon
local se1=Effect.CreateEffect(c)
se1:SetType(EFFECT_TYPE_FIELD)
se1:SetCode(EFFECT_SPSUMMON_PROC)
se1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
se1:SetRange(LOCATION_HAND)
se1:SetCountLimit(1,95101234+EFFECT_COUNT_CODE_OATH)
se1:SetCondition(c95101234.sprcon)
se1:SetOperation(c95101234.sprop)
c:RegisterEffect(se1)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,95101234)
e1:SetCost(c95101234.spcost)
e1:SetTarget(c95101234.sptg)
e1:SetOperation(c95101234.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(95101234,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,95101234+1)
e3:SetCondition(c95101234.spscon)
e3:SetTarget(c95101234.spstg)
e3:SetOperation(c95101234.spsop)
c:RegisterEffect(e3)
--counter
Duel.AddCustomActivityCounter(95101234,ACTIVITY_SPSUMMON,c95101234.counterfilter)
end
function c95101234.counterfilter(c)
return c:IsSetCard(0x5bb0)
end
function c95101234.sprfilter(c)
return c:IsSetCard(0x5bb0) and c:IsAbleToGraveAsCost()
end
function c95101234.sprcon(e,c)
if c==nil then return true end
return Duel.GetMZoneCount(c:GetControler())>0
and Duel.IsExistingMatchingCard(c95101234.sprfilter,c:GetControler(),LOCATION_EXTRA,0,1,nil)
end
function c95101234.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c95101234.sprfilter,tp,LOCATION_EXTRA,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_COUNT_CODE_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(c95101234.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c95101234.splimit(e,c)
return not c:IsType(TYPE_SYNCHRO) and c:IsLocation(LOCATION_EXTRA)
end
function c95101234.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(95101234,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(c95101234.csplimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c95101234.csplimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x5bb0)
end
function c95101234.spfilter(c,e,tp,chk)
return c:IsSetCard(0x5bb0) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (chk==0 or aux.NecroValleyFilter()(c))
end
function c95101234.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(c95101234.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,0)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c95101234.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,c95101234.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,1):GetFirst()
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c95101234.chkfilter(c,tp)
return c:IsSummonPlayer(tp) and c:IsSetCard(0x5bb0) and c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c95101234.spscon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c95101234.chkfilter,1,nil,tp)
end
function c95101234.spstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c95101234.spsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--元祖地樱之化龙
function c95101236.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON),aux.NonTuner(c95101236.sfilter),1,1)
c:EnableReviveLimit()
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetValue(c95101236.synlimit)
c:RegisterEffect(e0)
--equip
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,95101236)
e1:SetCondition(c95101236.eqcon)
e1:SetCost(c95101236.cost)
e1:SetTarget(c95101236.eqtg)
e1:SetOperation(c95101236.eqop)
c:RegisterEffect(e1)
--to hand(equip)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(95101236,1))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,95101236+1)
e4:SetCondition(c95101236.thcon)
e4:SetCost(c95101236.cost)
e4:SetTarget(c95101236.thtg)
e4:SetOperation(c95101236.thop)
c:RegisterEffect(e4)
--draw
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(95101236,1))
e5:SetCategory(CATEGORY_DRAW)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCountLimit(1,95101236+2)
e5:SetCost(c95101236.cost)
e5:SetTarget(c95101236.drtg)
e5:SetOperation(c95101236.drop)
c:RegisterEffect(e5)
--counter
Duel.AddCustomActivityCounter(95101236,ACTIVITY_SPSUMMON,c95101236.counterfilter)
end
c95101236.material_type=TYPE_SYNCHRO
function c95101236.counterfilter(c)
return c:IsSetCard(0x5bb0)
end
function c95101236.sfilter(c)
return c:IsRace(RACE_DINOSAUR+RACE_SEASERPENT+RACE_WYRM) and c:IsType(TYPE_SYNCHRO)
end
function c95101236.synlimit(e,se,sp,st)
return st&SUMMON_TYPE_SYNCHRO==SUMMON_TYPE_SYNCHRO and not se
end
function c95101236.eqcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c95101236.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(95101236,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(c95101236.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c95101236.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x5bb0)
end
function c95101236.eqfilter(c,tp)
return c:IsSetCard(0x5bb0) and (c:IsFaceupEx() or c:IsLocation(LOCATION_EXTRA)) and c:IsType(TYPE_SYNCHRO) and not c:IsForbidden()
end
function c95101236.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(c95101236.eqfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e:GetHandler(),tp) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_EXTRA)
end
function c95101236.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 and c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc=Duel.SelectMatchingCard(tp,c95101236.eqfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil):GetFirst()
if tc then
Duel.HintSelection(Group.FromCards(tc))
if not Duel.Equip(tp,tc,c) then return end
--Add Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c95101236.eqlimit)
tc:RegisterEffect(e1)
end
end
function c95101236.eqlimit(e,c)
return e:GetOwner()==c
end
function c95101236.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetEquipTarget()
end
function c95101236.thfilter(c)
return c:IsSetCard(0x5bb0) and c:IsAbleToHand()
end
function c95101236.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c95101236.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c95101236.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c95101236.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c95101236.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c95101236.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--化龙神术
function c95101239.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
--e1:SetCountLimit(1,95101239+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c95101239.target)
e1:SetOperation(c95101239.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c95101239.setcon)
e2:SetTarget(c95101239.settg)
e2:SetOperation(c95101239.setop)
c:RegisterEffect(e2)
if not c95101239.global_check then
c95101239.global_check=true
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_BATTLED)
ge1:SetOperation(c95101239.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c95101239.tfilter(c,e,tp)
return c:IsSetCard(0x5bb0) and c:IsFaceup() and c:IsAbleToGrave()-- and c:GetEquipCount()~=0
and Duel.IsExistingMatchingCard(c95101239.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function c95101239.spfilter(c,e,tp,tc)
return c:IsSetCard(0x5bb0) and c:IsType(TYPE_SYNCHRO) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) and c:IsAttribute(tc:GetAttribute())
end
function c95101239.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c95101239.tfilter(chkc,e,tp) end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
--if e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsLocation(LOCATION_SZONE) then ft=ft-1 end
if chk==0 then return Duel.IsExistingTarget(c95101239.tfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c95101239.tfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c95101239.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) or not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,c95101239.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc):GetFirst()
if not sc or Duel.SpecialSummon(sc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)==0 then return end
sc:CompleteProcedure()
Duel.SendtoGrave(tc,REASON_EFFECT)
end
function c95101239.checkop(e,tp,eg,ep,ev,re,r,rp)
local ac,dc=Duel.GetBattleMonster(0)
if ac and ac:IsSetCard(0x5bb0) then
Duel.RegisterFlagEffect(ac:GetControler(),95101239,RESET_PHASE+PHASE_END,0,1)
end
if dc and dc:IsSetCard(0x5bb0) then
Duel.RegisterFlagEffect(dc:GetControler(),95101239,RESET_PHASE+PHASE_END,0,1)
end
end
function c95101239.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,95101239)~=0
end
function c95101239.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c95101239.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToChain() and aux.NecroValleyFilter()(c) then
Duel.SSet(tp,c)
end
end
--失控磁盘 双子星
function c95101240.initial_effect(c)
--position
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(95101240,0))
e1:SetCategory(CATEGORY_COIN+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c95101240.postg)
e1:SetOperation(c95101240.posop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--attack effect:spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(95101240,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c95101240.atkcon)
e3:SetTarget(c95101240.sptg)
e3:SetOperation(c95101240.spop)
e3:SetLabel(LOCATION_HAND)
c:RegisterEffect(e3)
--defense effect:spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(95101240,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c95101240.defcon)
e4:SetTarget(c95101240.sptg)
e4:SetOperation(c95101240.spop)
e4:SetLabel(LOCATION_GRAVE)
c:RegisterEffect(e4)
end
function c95101240.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c95101240.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local res=Duel.TossCoin(tp,1)
if res==1 then Duel.ChangePosition(c,POS_FACEUP_ATTACK)
else Duel.ChangePosition(c,POS_FACEUP_DEFENSE) end
end
function c95101240.atkcon(e)
return e:GetHandler():IsAttackPos()
end
function c95101240.defcon(e)
return e:GetHandler():IsDefensePos()
end
function c95101240.spfilter(c,e,tp,chk)
return c:IsSetCard(0x6bb0) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (chk==0 or aux.NecroValleyFilter()(c))
end
function c95101240.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local loc=e:GetLabel()
if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(c95101240.spfilter,tp,loc,0,1,nil,e,tp,0)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,loc)
end
function c95101240.spop(e,tp,eg,ep,ev,re,r,rp)
local loc=e:GetLabel()
if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,c95101240.spfilter,tp,loc,0,1,1,nil,e,tp,1):GetFirst()
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
--失控磁盘 斩裂者
function c95101241.initial_effect(c)
--position
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(95101241,0))
e1:SetCategory(CATEGORY_COIN+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c95101241.postg)
e1:SetOperation(c95101241.posop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--attack effect:to deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(95101241,1))
e3:SetCategory(CATEGORY_DICE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c95101241.atkcon)
e3:SetTarget(c95101241.tdtg)
e3:SetOperation(c95101241.tdop)
e3:SetLabel(1)
c:RegisterEffect(e3)
--defense effect:to deck
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(95101241,1))
e4:SetCategory(CATEGORY_DICE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c95101241.defcon)
e4:SetTarget(c95101241.tdtg)
e4:SetOperation(c95101241.tdop)
e4:SetLabel(2)
c:RegisterEffect(e4)
end
function c95101241.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c95101241.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local res=Duel.TossCoin(tp,1)
if res==1 then Duel.ChangePosition(c,POS_FACEUP_ATTACK)
else Duel.ChangePosition(c,POS_FACEUP_DEFENSE) end
end
function c95101241.atkcon(e)
return e:GetHandler():IsAttackPos()
end
function c95101241.defcon(e)
return e:GetHandler():IsDefensePos()
end
function c95101241.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c95101241.tdop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
local dc=Duel.TossDice(tp,1)
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
if e:GetLabel()==2 then g=g:Filter(Card.IsSetCard,nil,0x6bb0) end
if #g<dc then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(tp,dc,dc,nil)
for tc in aux.Next(sg) do
Duel.MoveSequence(tc,SEQ_DECKTOP)
end
Duel.SortDecktop(tp,tp,#sg)
if e:GetLabel()==1 then
for tc in aux.Next(sg) do
Duel.MoveSequence(tc,SEQ_DECKBOTTOM)
end
end
end
--失控磁盘爆破
function c95101242.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetHintTiming(TIMINGS_CHECK_MONSTER)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c95101242.target)
e1:SetOperation(c95101242.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(95101242,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c95101242.thtg)
e2:SetOperation(c95101242.thop)
c:RegisterEffect(e2)
end
function c95101242.tfilter(c,g)
return c:IsSetCard(0x6bb0) and c:IsFaceup() and (c:IsAttackPos() and g:IsExists(Card.IsLocation,1,nil,LOCATION_MZONE) or c:IsDefensePos() and g:IsExists(Card.IsType,1,nil,TYPE_SPELL+TYPE_TRAP))
end
function c95101242.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c95101242.tfilter(chkc,g) end
if chk==0 then return Duel.IsExistingTarget(c95101242.tfilter,tp,LOCATION_MZONE,0,1,nil,g) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c95101242.tfilter,tp,LOCATION_MZONE,0,1,1,nil,g)
end
function c95101242.cfilter(c,pos)
return c:IsSetCard(0x6bb0) and c:IsPosition(pos)
end
function c95101242.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local pos=tc:IsAttackPos() and POS_FACEUP_ATTACK or POS_FACEUP_DEFENSE
local ct=Duel.GetMatchingGroupCount(c95101242.cfilter,tp,LOCATION_MZONE,0,nil,pos)
local g=tc:IsAttackPos() and Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil) or Duel.GetMatchingGroup(Card.IsType,tp,0,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,ct,nil)
if #sg==0 then return end
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
function c95101242.thfilter(c)
return c:IsSetCard(0x6bb0) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c95101242.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c95101242.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c95101242.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,c95101242.thfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
--失控磁盘磁力结合
function c95101243.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,95101243+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c95101243.target)
e1:SetOperation(c95101243.activate)
c:RegisterEffect(e1)
end
function c95101243.filter0(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end
function c95101243.filter2(c,e,tp,m,f,chkf)
return c:IsSetCard(0x6bb0) and c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c95101243.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(c95101243.filter0,tp,LOCATION_DECK,0,nil)
local res=Duel.IsExistingMatchingCard(c95101243.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(c95101243.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c95101243.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetMatchingGroup(c95101243.filter0,tp,LOCATION_DECK,0,nil)
local sg1=Duel.GetMatchingGroup(c95101243.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c95101243.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c95101243.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c95101243.splimit(e,c)
return not c:IsSetCard(0x6bb0)
end
--失控磁盘协力
function c95101244.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetHintTiming(TIMINGS_CHECK_MONSTER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c95101244.target)
e1:SetOperation(c95101244.activate)
c:RegisterEffect(e1)
end
function c95101242.tfilter(c,e)
return c:IsSetCard(0x6bb0) and c:IsFaceup() and c:GetSequence()<=4 and c:IsCanBeEffectTarget(e)
end
function c95101244.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(c95101242.cfilter,tp,LOCATION_MZONE,0,nil,e)
if chk==0 then return g:CheckSubGroup(aux.gfcheck,2,2,Card.IsPosition,POS_ATTACK,POS_DEFENSE) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sg=g:SelectSubGroup(tp,aux.gfcheck,false,2,2,Card.IsPosition,POS_ATTACK,POS_DEFENSE)
Duel.SetTargetCard(sg)
end
function c95101244.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain()
if g:FilterCount(Card.IsFaceup,nil)~=2 then return end
local fid=e:GetHandler():GetFieldID()
for tc in aux.Next(g) do
tc:RegisterFlagEffect(95101244,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,fid,aux.Stringid(95101244,2))
end
g:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(0,LOCATION_ONFIELD)
e1:SetCondition(c95101244.discon)
e1:SetTarget(c95101244.distg)
e1:SetLabelObject(g)
e1:SetLabel(fid)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c95101244.ffilter(c,fid)
return c:GetFlagEffectLabel(95101244)==fid
end
function c95101244.discon(e)
local g=e:GetLabelObject()
return g:FilterCount(c95101244.ffilter,nil,fid)==2 and aux.gfcheck(g,Card.IsPosition,POS_ATTACK,POS_DEFENSE)
end
function c95101244.distg(e,c)
local g=e:GetLabelObject()
local seq1=aux.GetColumn(g:GetFirst(),e:GetHandlerPlayer())
local seq2=aux.GetColumn(g:GetNext(),e:GetHandlerPlayer())
if seq1>seq2 then seq1,seq2=seq2,seq1 end
local seq=aux.GetColumn(c,e:GetHandlerPlayer())
return seq>seq1 and seq<seq2
end
--失控磁盘游击
function c95101245.initial_effect(c)
--Activate(effect)
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE+CATEGORY_POSITION)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_CHAINING)
e0:SetTarget(c95101245.target)
e0:SetOperation(c95101245.activate)
c:RegisterEffect(e0)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_REMOVE+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(aux.NegateSummonCondition)
e1:SetTarget(c95101245.target2)
e1:SetOperation(c95101245.activate2)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
end
function c95101245.cfilter(c,pos)
return c:IsSetCard(0x6bb0) and c:IsPosition(pos) and c:IsCanChangePosition()
end
function c95101245.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c95101245.cfilter,tp,LOCATION_MZONE,0,nil,POS_FACEUP_DEFENSE)
if chk==0 then return aux.nbtg(e,tp,eg,ep,ev,re,r,rp,0) and #g>0 end
aux.nbtg(e,tp,eg,ep,ev,re,r,rp,1)
end
function c95101245.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c95101245.cfilter,tp,LOCATION_MZONE,0,nil,POS_FACEUP_DEFENSE)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)~=0 and #g~=0 then
Duel.BreakEffect()
Duel.ChangePosition(g,POS_FACEUP_ATTACK)
end
end
function c95101245.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanRemove(tp) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,eg:GetCount(),0,0)
end
function c95101245.activate2(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
local g=Duel.GetMatchingGroup(c95101245.cfilter,tp,LOCATION_MZONE,0,nil,POS_FACEUP_ATTACK)
if Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)==0 or #g==0 then return end
Duel.BreakEffect()
Duel.ChangePosition(g,POS_FACEUP_DEFENSE)
end
--终焉失控磁盘 分拣炼融磁核
function c95101246.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x6bb0),2,true)
--position
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(95101246,0))
e1:SetCategory(CATEGORY_COIN+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c95101246.postg)
e1:SetOperation(c95101246.posop)
c:RegisterEffect(e1)
--position
local e2=Effect.CreateEffect(c)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetDescription(aux.Stringid(95101246,0))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c95101246.poscon)
e2:SetTarget(c95101246.postg2)
e2:SetOperation(c95101246.posop2)
c:RegisterEffect(e2)
--attack effect:fusion
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(95101246,1))
e3:SetCategory(CATEGORY_FUSION_SUMMON+CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c95101246.fscon)
e3:SetTarget(c95101246.fstg)
e3:SetOperation(c95101246.fsop)
c:RegisterEffect(e3)
--defense effect:draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(95101246,2))
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c95101246.drcon)
e4:SetTarget(c95101246.drtg)
e4:SetOperation(c95101246.drop)
c:RegisterEffect(e4)
end
function c95101246.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c95101246.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local res=Duel.TossCoin(tp,1)
if res==1 then Duel.ChangePosition(c,POS_FACEUP_ATTACK)
else Duel.ChangePosition(c,POS_FACEUP_DEFENSE) end
end
function c95101246.poscon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2--Duel.IsMainPhase()
end
function c95101246.postg2(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c95101246.posop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local tc=Duel.SelectMatchingCard(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst()
if tc then
Duel.HintSelection(Group.FromCards(tc))
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end
function c95101246.fscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsAttackPos() and ep==1-tp
end
function c95101246.filter0(c)
return c:IsSetCard(0x6bb0) and c:IsOnField() and c:IsAbleToRemove()
end
function c95101246.filter1(c,e)
return c:IsSetCard(0x6bb0) and c:IsOnField() and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
function c95101246.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x6bb0) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c95101246.filter3(c)
return c:IsSetCard(0x6bb0) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function c95101246.fstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c95101246.filter0,nil)
local mg2=Duel.GetMatchingGroup(c95101246.filter3,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
local res=Duel.IsExistingMatchingCard(c95101246.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 mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c95101246.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE)
end
function c95101246.fsop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c95101246.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(c95101246.filter3,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
local sg1=Duel.GetMatchingGroup(c95101246.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c95101246.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function c95101246.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsDefensePos() and ep==1-tp
end
function c95101246.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c95101246.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--终焉失控磁盘 星球毁灭武装
function c95101247.initial_effect(c)
--fusion material
aux.AddFusionProcFunFun(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x6bb0),aux.FilterBoolFunction(Card.IsFusionType,TYPE_FUSION),2,true)
c:EnableReviveLimit()
--position
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(95101247,0))
e1:SetCategory(CATEGORY_COIN+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c95101247.postg)
e1:SetOperation(c95101247.posop)
c:RegisterEffect(e1)
--position
local e2=Effect.CreateEffect(c)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetDescription(aux.Stringid(95101247,0))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c95101247.poscon)
e2:SetTarget(c95101247.postg2)
e2:SetOperation(c95101247.posop2)
c:RegisterEffect(e2)
--attack effect:remove monster
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(95101247,1))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c95101247.rmcon1)
e3:SetTarget(c95101247.rmtg1)
e3:SetOperation(c95101247.rmop1)
c:RegisterEffect(e3)
--defense effect:remove spell
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(95101247,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c95101247.rmcon2)
e4:SetTarget(c95101247.rmtg2)
e4:SetOperation(c95101247.rmop2)
c:RegisterEffect(e4)
end
function c95101247.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c95101247.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local res=Duel.TossCoin(tp,1)
if res==1 then Duel.ChangePosition(c,POS_FACEUP_ATTACK)
else Duel.ChangePosition(c,POS_FACEUP_DEFENSE) end
end
function c95101247.poscon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2--Duel.IsMainPhase()
end
function c95101247.postg2(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c95101247.posop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local tc=Duel.SelectMatchingCard(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst()
if tc then
Duel.HintSelection(Group.FromCards(tc))
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end
function c95101247.rmcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsAttackPos() and ep==1-tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c95101247.rmfilter(c,tp,typ)
return c:IsType(typ) and c:IsAbleToRemove(tp,POS_FACEDOWN)
end
function c95101247.rmtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c95101247.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil,tp,TYPE_MONSTER)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c95101247.rmop1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c95101247.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil,tp,TYPE_MONSTER)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
end
function c95101247.rmcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsDefensePos() and ep==1-tp and re:IsActiveType(TYPE_MONSTER)
end
function c95101247.rmtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c95101247.rmfilter,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil,tp,TYPE_SPELL+TYPE_TRAP)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c95101247.rmop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c95101247.rmfilter,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil,tp,TYPE_SPELL+TYPE_TRAP)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
end
--终焉失控磁盘 死亡清道夫
function c95101248.initial_effect(c)
--fusion material
aux.AddFusionProcFunFun(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x6bb0),aux.FilterBoolFunction(Card.IsFusionType,TYPE_FUSION),1,true)
c:EnableReviveLimit()
--position
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(95101248,0))
e1:SetCategory(CATEGORY_COIN+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c95101248.postg)
e1:SetOperation(c95101248.posop)
c:RegisterEffect(e1)
--position
local e2=Effect.CreateEffect(c)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetDescription(aux.Stringid(95101248,0))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c95101248.poscon)
e2:SetTarget(c95101248.postg2)
e2:SetOperation(c95101248.posop2)
c:RegisterEffect(e2)
--attack effect:attack
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(95101248,2))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c95101248.atkcon)
e3:SetCost(c95101248.atkcost)
e3:SetOperation(c95101248.atkop)
c:RegisterEffect(e3)
--defense effect:pierce
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_PIERCE)
e4:SetCondition(c95101248.defcon)
e4:SetValue(DOUBLE_DAMAGE)
c:RegisterEffect(e4)
end
function c95101248.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c95101248.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local res=Duel.TossCoin(tp,1)
if res==1 then Duel.ChangePosition(c,POS_FACEUP_ATTACK)
else Duel.ChangePosition(c,POS_FACEUP_DEFENSE) end
end
function c95101248.poscon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2--Duel.IsMainPhase()
end
function c95101248.postg2(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c95101248.posop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local tc=Duel.SelectMatchingCard(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst()
if tc then
Duel.HintSelection(Group.FromCards(tc))
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end
function c95101248.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and aux.nzatk(bc) and bc:IsControler(1-tp) and c:IsAttackPos()
end
function c95101248.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(95101248)==0 end
e:GetHandler():RegisterFlagEffect(95101248,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end
function c95101248.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if c:IsFaceup() and c:IsRelateToBattle() and bc and bc:IsFaceup() and bc:IsRelateToBattle() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(bc:GetAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL)
c:RegisterEffect(e1)
end
end
function c95101248.defcon(e)
return e:GetHandler():IsDefensePos()
end
--悲剧处刑舞台装置
function c95101249.initial_effect(c)
c:SetSPSummonOnce(95101249)
--fusion material
aux.AddFusionProcFunFun(c,c95101249.mfilter,aux.FilterBoolFunction(Card.IsFusionType,TYPE_FUSION),1,true)
aux.AddContactFusionProcedure(c,Card.IsFaceup,LOCATION_REMOVED,0,Duel.SendtoGrave,REASON_RETURN+REASON_MATERIAL)
c:EnableReviveLimit()
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetValue(c95101249.splimit)
c:RegisterEffect(e0)
--fusion substitute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_FUSION_SUBSTITUTE)
e1:SetCondition(c95101249.subcon)
c:RegisterEffect(e1)
end
function c95101249.mfilter(c)
return c:IsRace(RACE_ILLUSION) and c:IsFusionAttribute(ATTRIBUTE_DARK)
end
function c95101249.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
function c95101249.subcon(e)
return e:GetHandler():IsLocation(LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE)
end
--幻想图书管理员
function c95101250.initial_effect(c)
--CoMETIK search
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,95101250)
e1:SetCost(c95101250.thcost)
e1:SetTarget(c95101250.thtg)
e1:SetOperation(c95101250.thop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(95101250,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,95101250+EFFECT_COUNT_CODE_DUEL)
e2:SetCondition(c95101250.spcon)
e2:SetTarget(c95101250.sptg)
e2:SetOperation(c95101250.spop)
c:RegisterEffect(e2)
end
function c95101250.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c95101250.thfilter(c)
return c:IsLevelBelow(4) and c:IsRace(RACE_ILLUSION) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToHand()
end
function c95101250.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c95101250.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c95101250.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,c95101250.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if tg then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function c95101250.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function c95101250.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c95101250.cfilter(c)
return c:IsRace(RACE_ILLUSION) and c:IsFaceup()
end
function c95101250.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.IsExistingMatchingCard(c95101250.cfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(95101250,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
--惑界蛇 弗朗西斯·里德尔
function c95101251.initial_effect(c)
--Synchro summon
aux.AddSynchroProcedure(c,nil,nil,1)
c:EnableReviveLimit()
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c95101251.atkval)
c:RegisterEffect(e1)
--nontuner
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_NONTUNER)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c95101251.tnval)
c:RegisterEffect(e2)
--cosplay
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(95101251,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c95101251.costg)
e3:SetOperation(c95101251.cosop)
c:RegisterEffect(e3)
end
function c95101251.atkval(e,c)
return Duel.GetMatchingGroupCount(Card.IsCode,0,LOCATION_GRAVE,LOCATION_GRAVE,nil,c:GetCode())*100
end
function c95101251.tnval(e,c)
return e:GetHandler():IsControler(c:GetControler())
end
function c95101251.costg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsLevelAbove(1) end
if chk==0 then return Duel.IsExistingTarget(Card.IsLevelAbove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,Card.IsLevelAbove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,1)
end
function c95101251.cosop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) then
local code=tc:GetCode()
local race=tc:GetRace()
local attr=tc:GetAttribute()
local lv=tc:GetLevel()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(code)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetValue(race)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e3:SetValue(attr)
c:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_CHANGE_LEVEL)
e4:SetValue(lv)
c:RegisterEffect(e4)
end
end
--疾驰之翼
function c95101252.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(95101252,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c95101252.damcost)
e1:SetTarget(c95101252.damtg)
e1:SetOperation(c95101252.damop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
c:RegisterEffect(e2)
end
function c95101252.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c95101252.damtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local at=Duel.GetAttacker()
if chkc then return chkc==at end
if chk==0 then return at:IsControler(1-tp) and at:IsRelateToBattle() and at:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(at)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,at:GetAttack())
end
function c95101252.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsRelateToEffect(e) and Duel.NegateAttack() and tc:GetAttack()~=0 then
Duel.Damage(1-tp,tc:GetAttack(),REASON_EFFECT)
end
end
--猎狼之红姬
function c95101253.initial_effect(c)
--spsummon-self
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(95101253,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,95101253)
e1:SetCondition(c95101253.spscon)
e1:SetTarget(c95101253.spstg)
e1:SetOperation(c95101253.spsop)
c:RegisterEffect(e1)
--spsummon-other
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(95101253,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,95101253+1)
e2:SetTarget(c95101253.sptg)
e2:SetOperation(c95101253.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c95101253.spscon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,1-tp)
end
function c95101253.spstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c95101253.spsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c95101253.spfilter(c,e,tp,chk)
return c:IsCode(95101253) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (chk==0 or aux.NecroValleyFilter()(c))
end
function c95101253.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(c95101253.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,0)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c95101253.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,c95101253.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,1):GetFirst()
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c95101253.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c95101253.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return (not c:IsType(TYPE_XYZ) or c:IsNonAttribute(ATTRIBUTE_DARK)) and c:IsLocation(LOCATION_EXTRA)
end
--深海惑妖
function c95101255.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_WATER),5,2)
c:EnableReviveLimit()
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(95101255,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,95101255)
e1:SetCost(c95101255.drcost)
e1:SetTarget(c95101255.drtg)
e1:SetOperation(c95101255.drop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(95101255,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,95101255+1)
e2:SetCondition(c95101255.discon)
e2:SetCost(c95101255.discost)
e2:SetTarget(c95101255.distg)
e2:SetOperation(c95101255.disop)
c:RegisterEffect(e2)
end
function c95101255.tgfilter(c)
return c:IsLevelBelow(4) and c:IsRace(RACE_SEASERPENT) and c:IsAbleToGraveAsCost()
end
function c95101255.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c95101255.tgfilter,tp,LOCATION_DECK,0,1,nil) and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c95101255.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c95101255.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c95101255.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c95101255.discon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return rp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c95101255.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c95101255.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c95101255.disop(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
--雪原漫步少女
function c95101257.initial_effect(c)
--position
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(95101257,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,95101257)
e1:SetCondition(c95101257.poscon)
e1:SetCost(c95101257.poscost)
e1:SetTarget(c95101257.postg)
e1:SetOperation(c95101257.posop)
c:RegisterEffect(e1)
end
function c95101257.poscon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp)
end
function c95101257.poscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c95101257.tfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c95101257.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c95101257.tfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c95101257.tfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c95101257.tfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c95101257.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() and Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
......@@ -1629,6 +1629,7 @@
!setname 0x8848 熵增焓减
#阿冉 3373982945 715 0x780-0x78f
!counter 0x78f1 环位指示物
#重坑交友王&林白虹 111&991 0x450-0x45f
!setname 0x3450 幻殇
......
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