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
This diff is collapsed.
......@@ -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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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