Commit 698222a0 authored by Nemo Ma's avatar Nemo Ma

0420

parent 7d98f991
No preview for this file type
expansions/pics/89390100.jpg

68 KB | W: | H:

expansions/pics/89390100.jpg

85.8 KB | W: | H:

expansions/pics/89390100.jpg
expansions/pics/89390100.jpg
expansions/pics/89390100.jpg
expansions/pics/89390100.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89390101.jpg

68.6 KB | W: | H:

expansions/pics/89390101.jpg

79.7 KB | W: | H:

expansions/pics/89390101.jpg
expansions/pics/89390101.jpg
expansions/pics/89390101.jpg
expansions/pics/89390101.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89390102.jpg

58.8 KB | W: | H:

expansions/pics/89390102.jpg

76.9 KB | W: | H:

expansions/pics/89390102.jpg
expansions/pics/89390102.jpg
expansions/pics/89390102.jpg
expansions/pics/89390102.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89390103.jpg

65 KB | W: | H:

expansions/pics/89390103.jpg

78.1 KB | W: | H:

expansions/pics/89390103.jpg
expansions/pics/89390103.jpg
expansions/pics/89390103.jpg
expansions/pics/89390103.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89390104.jpg

67.7 KB | W: | H:

expansions/pics/89390104.jpg

81 KB | W: | H:

expansions/pics/89390104.jpg
expansions/pics/89390104.jpg
expansions/pics/89390104.jpg
expansions/pics/89390104.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89390105.jpg

65.7 KB | W: | H:

expansions/pics/89390105.jpg

80.2 KB | W: | H:

expansions/pics/89390105.jpg
expansions/pics/89390105.jpg
expansions/pics/89390105.jpg
expansions/pics/89390105.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89390106.jpg

59.7 KB | W: | H:

expansions/pics/89390106.jpg

77.7 KB | W: | H:

expansions/pics/89390106.jpg
expansions/pics/89390106.jpg
expansions/pics/89390106.jpg
expansions/pics/89390106.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89390107.jpg

76.9 KB | W: | H:

expansions/pics/89390107.jpg

87.9 KB | W: | H:

expansions/pics/89390107.jpg
expansions/pics/89390107.jpg
expansions/pics/89390107.jpg
expansions/pics/89390107.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89390108.jpg

48.9 KB | W: | H:

expansions/pics/89390108.jpg

66.9 KB | W: | H:

expansions/pics/89390108.jpg
expansions/pics/89390108.jpg
expansions/pics/89390108.jpg
expansions/pics/89390108.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89390109.jpg

70.4 KB | W: | H:

expansions/pics/89390109.jpg

83.5 KB | W: | H:

expansions/pics/89390109.jpg
expansions/pics/89390109.jpg
expansions/pics/89390109.jpg
expansions/pics/89390109.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/89390110.jpg

65.8 KB | W: | H:

expansions/pics/89390110.jpg

79.6 KB | W: | H:

expansions/pics/89390110.jpg
expansions/pics/89390110.jpg
expansions/pics/89390110.jpg
expansions/pics/89390110.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/98920334.jpg

54.8 KB | W: | H:

expansions/pics/98920334.jpg

30.8 KB | W: | H:

expansions/pics/98920334.jpg
expansions/pics/98920334.jpg
expansions/pics/98920334.jpg
expansions/pics/98920334.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/98921065.jpg

77.2 KB | W: | H:

expansions/pics/98921065.jpg

74.2 KB | W: | H:

expansions/pics/98921065.jpg
expansions/pics/98921065.jpg
expansions/pics/98921065.jpg
expansions/pics/98921065.jpg
  • 2-up
  • Swipe
  • Onion skin
-- 棉花糖与棉花球
function c10200024.initial_effect(c)
-- Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCategory(CATEGORY_DRAW)
e1:SetTarget(c10200024.tg1)
e1:SetOperation(c10200024.op1)
c:RegisterEffect(e1)
end
function c10200024.filter1(sg)
return sg:GetClassCount(function(c) return c:GetCode() end)==1 and sg:GetClassCount(function(c) return c:GetOriginalCode() end)==2
end
function c10200024.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
return Duel.IsPlayerCanDraw(tp,2)
and g:CheckSubGroup(function(sg)
return sg:GetClassCount(function(c) return c:GetCode() end)==1
and sg:GetClassCount(function(c) return c:GetOriginalCode() end)==2
end,2,2)
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c10200024.op1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=g:SelectSubGroup(tp,c10200024.filter1,false,2,2)
if sg and sg:GetCount()==2 then
Duel.ConfirmCards(1-tp,sg)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -23,7 +23,7 @@ function cm.initial_effect(c)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(TIMING_ATTACK,0x11e0)
e3:SetCountLimit(1,m-40)
e3:SetCondition(function(e,tp) return Duel.GetTurnPlayer()==tp end)
--e3:SetCondition(function(e,tp) return Duel.GetTurnPlayer()==tp end)
e3:SetCost(cm.spcost)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
......@@ -49,7 +49,7 @@ function cm.filter3(c,e,tp)
return c:IsSetCard(0x97a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.filter4(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_TUNER)
return c:IsAttribute(ATTRIBUTE_DARK) --and c:IsType(TYPE_TUNER)
end
function cm.filter5(c)
return Duel.IsPlayerAffectedByEffect(c:GetControler(),11451461) and ((c:IsOnField() and c:IsStatus(STATUS_EFFECT_ENABLED)) or c:IsLocation(LOCATION_HAND))
......@@ -191,7 +191,7 @@ function cm.SelectSubGroup(g,tp,f,cancelable,min,max,...)
end
end
end
if check then return false end
if check then return false end
--classification is essential for efficiency, and this part is only for backup
else
iter={1}
......@@ -392,7 +392,7 @@ function cm.returntofield(tc)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
return
return
end
if tc:GetPreviousTypeOnField()&TYPE_EQUIP>0 then
Duel.SendtoGrave(tc,REASON_RULE+REASON_RETURN)
......
......@@ -21,7 +21,7 @@ function cm.initial_effect(c)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(TIMING_ATTACK,0x11e0)
e3:SetCountLimit(1,m-40)
e3:SetCondition(function(e,tp) return Duel.GetTurnPlayer()==tp end)
--e3:SetCondition(function(e,tp) return Duel.GetTurnPlayer()==tp end)
e3:SetCost(cm.spcost)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
......@@ -47,7 +47,7 @@ function cm.filter3(c,e,tp)
return c:IsSetCard(0x97a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.filter4(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsType(TYPE_TUNER)
return c:IsAttribute(ATTRIBUTE_WATER) --and c:IsType(TYPE_TUNER)
end
function cm.filter5(c)
return Duel.IsPlayerAffectedByEffect(c:GetControler(),11451461) and ((c:IsOnField() and c:IsStatus(STATUS_EFFECT_ENABLED)) or c:IsLocation(LOCATION_HAND))
......@@ -187,7 +187,7 @@ function cm.SelectSubGroup(g,tp,f,cancelable,min,max,...)
end
end
end
if check then return false end
if check then return false end
--classification is essential for efficiency, and this part is only for backup
else
iter={1}
......@@ -275,7 +275,7 @@ function cm.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_HAND+LOCATION_GRAVE+LOCATION_ONFIELD,nil)
local mg=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_ONFIELD,0,nil)
local sg=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_DECK,0,nil,e,tp)
local tg=Group.CreateGroup()
for sc in aux.Next(sg) do
......@@ -288,12 +288,12 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
return false
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,PLAYER_ALL,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(cm.filter22,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_HAND+LOCATION_GRAVE+LOCATION_ONFIELD,nil,e)
local mg=Duel.GetMatchingGroup(cm.filter22,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_ONFIELD,0,nil,e)
local sg=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_DECK,0,nil,e,tp)
local tg=Group.CreateGroup()
for sc in aux.Next(sg) do
......@@ -373,7 +373,7 @@ function cm.returntofield(tc)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
return
return
end
if tc:GetPreviousTypeOnField()&TYPE_EQUIP>0 then
Duel.SendtoGrave(tc,REASON_RULE+REASON_RETURN)
......
......@@ -82,7 +82,7 @@ function cm.filter3(c,e,tp)
return c:IsSetCard(0x97a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.filter4(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsType(TYPE_TUNER)
return c:IsAttribute(ATTRIBUTE_WIND) --and c:IsType(TYPE_TUNER)
end
function cm.filter5(c)
return Duel.IsPlayerAffectedByEffect(c:GetControler(),11451461) and ((c:IsOnField() and c:IsStatus(STATUS_EFFECT_ENABLED)) or c:IsLocation(LOCATION_HAND))
......
......@@ -66,7 +66,7 @@ function cm.filter3(c,e,tp)
return c:IsSetCard(0x97a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.filter4(c)
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsType(TYPE_TUNER)
return c:IsAttribute(ATTRIBUTE_EARTH) --and c:IsType(TYPE_TUNER)
end
function cm.filter5(c)
return Duel.IsPlayerAffectedByEffect(c:GetControler(),11451461) and ((c:IsOnField() and c:IsStatus(STATUS_EFFECT_ENABLED)) or c:IsLocation(LOCATION_HAND))
......@@ -206,7 +206,7 @@ function cm.SelectSubGroup(g,tp,f,cancelable,min,max,...)
end
end
end
if check then return false end
if check then return false end
--classification is essential for efficiency, and this part is only for backup
else
iter={1}
......
......@@ -69,7 +69,7 @@ function cm.filter3(c,e,tp)
return c:IsSetCard(0x97a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.filter4(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsType(TYPE_TUNER)
return c:IsAttribute(ATTRIBUTE_FIRE) --and c:IsType(TYPE_TUNER)
end
function cm.filter5(c)
return Duel.IsPlayerAffectedByEffect(c:GetControler(),11451461) and ((c:IsOnField() and c:IsStatus(STATUS_EFFECT_ENABLED)) or c:IsLocation(LOCATION_HAND))
......@@ -78,9 +78,9 @@ function cm.filter6(c,e)
return c:GetFlagEffectLabel(m)==e:GetLabel()
end
function cm.fselect(g,ng,goal,tp)
if not (g:IsExists(cm.filter4,1,nil) and g:GetSum(cm.lvplus)>=goal) then
if g:GetSum(cm.lvplus)<goal then
return false
elseif g:GetSum(cm.lvplus)==goal and Duel.GetMZoneCount(tp,g)>0 then
elseif g:IsExists(cm.filter4,1,nil) and g:GetSum(cm.lvplus)==goal and Duel.GetMZoneCount(tp,g)>0 then
return true
end
local _SubGroupParams=cm.SubGroupParams
......@@ -93,7 +93,7 @@ function cm.fselect(g,ng,goal,tp)
return tc
end
function cm.fselect3(g,g1,lv,tp)
return g:GetSum(cm.lvplus)==lv and Duel.GetMZoneCount(tp,g+g1)>0
return g:GetSum(cm.lvplus)==lv and Duel.GetMZoneCount(tp,g+g1)>0 and (g+g1):IsExists(cm.filter4,1,nil)
end
function cm.hspgcheck(ng,goal,tp)
return function(g,c,mg)
......@@ -226,7 +226,7 @@ function cm.SelectSubGroup(g,tp,f,cancelable,min,max,...)
end
end
end
if check then return false end
if check then return false end
--classification is essential for efficiency, and this part is only for backup
else
iter={1}
......@@ -426,7 +426,7 @@ function cm.returntofield(tc)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
return
return
end
if tc:GetPreviousTypeOnField()&TYPE_EQUIP>0 then
Duel.SendtoGrave(tc,REASON_RULE+REASON_RETURN)
......
......@@ -72,7 +72,7 @@ function cm.filter3(c,e,tp)
return c:IsSetCard(0x97a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.filter4(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsType(TYPE_TUNER)
return c:IsAttribute(ATTRIBUTE_LIGHT) --and c:IsType(TYPE_TUNER)
end
function cm.filter5(c)
return Duel.IsPlayerAffectedByEffect(c:GetControler(),11451461) and ((c:IsOnField() and c:IsStatus(STATUS_EFFECT_ENABLED)) or c:IsLocation(LOCATION_HAND))
......@@ -81,9 +81,9 @@ function cm.filter6(c,e)
return c:GetFlagEffectLabel(m)==e:GetLabel()
end
function cm.fselect(g,ng,goal,tp)
if not (g:IsExists(cm.filter4,1,nil) and g:GetSum(cm.lvplus)>=goal) then
if g:GetSum(cm.lvplus)<goal then
return false
elseif g:GetSum(cm.lvplus)==goal and Duel.GetMZoneCount(tp,g)>0 then
elseif g:IsExists(cm.filter4,1,nil) and g:GetSum(cm.lvplus)==goal and Duel.GetMZoneCount(tp,g)>0 then
return true
end
local _SubGroupParams=cm.SubGroupParams
......@@ -96,7 +96,7 @@ function cm.fselect(g,ng,goal,tp)
return tc
end
function cm.fselect3(g,g1,lv,tp)
return g:GetSum(cm.lvplus)==lv and Duel.GetMZoneCount(tp,g+g1)>0
return g:GetSum(cm.lvplus)==lv and Duel.GetMZoneCount(tp,g+g1)>0 and (g+g1):IsExists(cm.filter4,1,nil)
end
function cm.hspgcheck(ng,goal,tp)
return function(g,c,mg)
......@@ -229,7 +229,7 @@ function cm.SelectSubGroup(g,tp,f,cancelable,min,max,...)
end
end
end
if check then return false end
if check then return false end
--classification is essential for efficiency, and this part is only for backup
else
iter={1}
......@@ -466,7 +466,7 @@ function cm.returntofield(tc)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
return
return
end
if tc:GetPreviousTypeOnField()&TYPE_EQUIP>0 then
Duel.SendtoGrave(tc,REASON_RULE+REASON_RETURN)
......
......@@ -14,6 +14,7 @@ function cm.initial_effect(c)
e5:SetDescription(aux.Stringid(m,0))
e5:SetRange(LOCATION_DECK)
e5:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e5:SetCondition(function(e,tp) return Duel.GetTurnPlayer()==tp end)
e5:SetCost(cm.cost)
c:RegisterEffect(e5)
local e4=Effect.CreateEffect(c)
......@@ -101,10 +102,10 @@ function cm.drop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCondition(cm.drcon1)
e1:SetOperation(cm.drop1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--Duel.RegisterEffect(e1,tp)
local e10=e1:Clone()
e10:SetCode(EVENT_SUMMON_SUCCESS)
Duel.RegisterEffect(e10,tp)
--Duel.RegisterEffect(e10,tp)
--sp_summon effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
......@@ -112,7 +113,7 @@ function cm.drop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCondition(cm.regcon)
e2:SetOperation(cm.regop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
--Duel.RegisterEffect(e2,tp)
local e20=e2:Clone()
e20:SetCode(EVENT_SUMMON_SUCCESS)
--Duel.RegisterEffect(e20,tp)
......@@ -142,14 +143,14 @@ end
function cm.drcon2(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return (bit.band(loc,LOCATION_MZONE)~=0 and rc:IsSetCard(0x12e)) or Duel.GetFlagEffect(tp,m)>0
return ev==1 and rc:IsSetCard(0x12e) --(bit.band(loc,LOCATION_MZONE)~=0 and rc:IsSetCard(0x12e)) or Duel.GetFlagEffect(tp,m)>0
end
function cm.drop2(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
local n=Duel.GetFlagEffect(tp,m)
local n=1 --Duel.GetFlagEffect(tp,m)
Duel.ResetFlagEffect(tp,m)
if bit.band(loc,LOCATION_MZONE)~=0 and rc:IsSetCard(0x12e) then n=n+1 end
--if bit.band(loc,LOCATION_MZONE)~=0 and rc:IsSetCard(0x12e) then n=n+1 end
Duel.Draw(tp,n,REASON_EFFECT)
end
function cm.drcon3(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -16,7 +16,6 @@ function cm.initial_effect(c)
--move
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
......@@ -154,6 +153,14 @@ function cm.sop(e,tp,eg,ep,ev,re,r,rp)
e1:SetLabelObject(tc)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
--type
local e2=Effect.CreateEffect(c)
e2:SetCode(EFFECT_CHANGE_TYPE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e2:SetValue(TYPE_EQUIP+TYPE_TRAP)
c:RegisterEffect(e2)
--aclimit
local ge0=Effect.CreateEffect(tc)
ge0:SetType(EFFECT_TYPE_FIELD)
......@@ -208,18 +215,11 @@ end
function cm.mcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1
end
function cm.nfilter(c,lc,tp,bool)
if not c:IsFaceup() then return false,false end
if cm.islinkdirstate(c) then return true,true end
if not bool then return false,false end
local seq=lc:GetSequence()
local b1=seq>0 and seq<5 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1)
local b2=seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1)
local b3=(seq==5 and Duel.CheckLocation(tp,LOCATION_MZONE,1)) or (seq==6 and Duel.CheckLocation(tp,LOCATION_MZONE,3))
local b4=(seq==1 and Duel.CheckLocation(tp,LOCATION_MZONE,5)) or (seq==3 and Duel.CheckLocation(tp,LOCATION_MZONE,6))
local x0,y0=cm.xylabel(lc,0)
if (b1 and cm.willbelinkdir(c,x0-1,y0,tp)) or (b2 and cm.willbelinkdir(c,x0+1,y0,tp)) or (b3 and cm.willbelinkdir(c,x0,y0-1,tp)) or (b4 and cm.willbelinkdir(c,x0,y0+1,tp)) then return true,false end
return false,false
function cm.nfilter(c)
return c:IsType(TYPE_EQUIP) and c:IsOriginalEffectProperty(cm.sp_filter) and c:CheckActivateEffect(false,false,false)~=nil
end
function cm.sp_filter(e)
return e:IsActivated() and e:IsHasCategory(CATEGORY_SPECIAL_SUMMON)
end
function cm.mtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -228,16 +228,8 @@ function cm.mtg(e,tp,eg,ep,ev,re,r,rp,chk)
local b2=seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1)
local b3=(seq==5 and Duel.CheckLocation(tp,LOCATION_MZONE,1)) or (seq==6 and Duel.CheckLocation(tp,LOCATION_MZONE,3))
local b4=(seq==1 and Duel.CheckLocation(tp,LOCATION_MZONE,5)) or (seq==3 and Duel.CheckLocation(tp,LOCATION_MZONE,6))
local g=Duel.GetMatchingGroup(cm.nfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,c,tp,false)
local typ=0
for fc in aux.Next(g) do
typ=typ|bit.band(fc:GetType(),0x7)
end
local ct=0
for i=0,2 do if typ&(1<<i)>0 then ct=ct+1 end end
local q1=#g>0 and Duel.IsPlayerCanDraw(tp,ct)
local q1=Duel.IsExistingMatchingCard(cm.nfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)>0 or q1 end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function cm.mop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -248,20 +240,50 @@ function cm.mop(e,tp,eg,ep,ev,re,r,rp)
local b3=(seq==5 and Duel.CheckLocation(tp,LOCATION_MZONE,1)) or (seq==6 and Duel.CheckLocation(tp,LOCATION_MZONE,3))
local b4=(seq==1 and Duel.CheckLocation(tp,LOCATION_MZONE,5)) or (seq==3 and Duel.CheckLocation(tp,LOCATION_MZONE,6))
local q2=bool and Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)>0
local g=Duel.GetMatchingGroup(cm.nfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,c,tp,false)
local typ=0
for fc in aux.Next(g) do
typ=typ|bit.band(fc:GetType(),0x7)
end
local ct=0
for i=0,2 do if typ&(1<<i)>0 then ct=ct+1 end end
local q1=#g>0 and Duel.IsPlayerCanDraw(tp,ct)
local q1=Duel.IsExistingMatchingCard(cm.nfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
if not q1 and not q2 then return end
local opt=aux.SelectFromOptions(tp,{q1,aux.Stringid(m,1)},{q2,aux.Stringid(m,2)})
if opt==1 then
local d=Duel.Draw(tp,ct,REASON_EFFECT)
Duel.ShuffleHand(tp)
Duel.DiscardHand(tp,nil,d-1,d-1,REASON_EFFECT+REASON_DISCARD)
local g=Duel.GetMatchingGroup(cm.nfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg=g:Select(tp,1,1,nil)
if #sg>0 then
local tc=sg:GetFirst()
local te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(false,false,true)
local zones=0xff
if te:IsHasProperty(EFFECT_FLAG_LIMIT_ZONE) then
local val=te:GetValue()
zones=val(te,tp,ceg,cep,cev,cre,cr,crp)
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true,zones)
Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
te:UseCountLimit(tp,1,true)
local cost=te:GetCost()
local target=te:GetTarget()
local operation=te:GetOperation()
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty())
Duel.ClearTargetCard()
if not tc:IsType(TYPE_EQUIP) then tc:CancelToGrave(false) end
tc:CreateEffectRelation(te)
if cost then cost(te,tp,ceg,cep,cev,cre,cr,crp,1) end
if target then target(te,tp,ceg,cep,cev,cre,cr,crp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g then
for fc in aux.Next(g) do
fc:CreateEffectRelation(te)
end
end
if operation then
operation(te,tp,ceg,cep,cev,cre,cr,crp)
end
tc:ReleaseEffectRelation(te)
if g then
for fc in aux.Next(g) do
fc:ReleaseEffectRelation(te)
end
end
end
local bool=c:IsRelateToEffect(e) and c:IsControler(tp) and c:IsFaceup()
local seq=c:GetSequence()
local b1=seq>0 and seq<5 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1)
......@@ -291,19 +313,48 @@ function cm.mop(e,tp,eg,ep,ev,re,r,rp)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s&0xff,2)
Duel.MoveSequence(c,nseq)
local g=Duel.GetMatchingGroup(cm.nfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,c,tp,false)
local typ=0
for fc in aux.Next(g) do
typ=typ|bit.band(fc:GetType(),0x7)
end
local ct=0
for i=0,2 do if typ&(1<<i)>0 then ct=ct+1 end end
local q1=#g>0 and Duel.IsPlayerCanDraw(tp,ct)
local q1=Duel.IsExistingMatchingCard(cm.nfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
if q1 then
Duel.BreakEffect()
local d=Duel.Draw(tp,ct,REASON_EFFECT)
Duel.ShuffleHand(tp)
Duel.DiscardHand(tp,nil,d-1,d-1,REASON_EFFECT+REASON_DISCARD)
local g=Duel.GetMatchingGroup(cm.nfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg=g:Select(tp,1,1,nil)
if #sg>0 then
local tc=sg:GetFirst()
local te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(false,false,true)
local zones=0xff
if te:IsHasProperty(EFFECT_FLAG_LIMIT_ZONE) then
local val=te:GetValue()
zones=val(te,tp,ceg,cep,cev,cre,cr,crp)
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true,zones)
Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
te:UseCountLimit(tp,1,true)
local cost=te:GetCost()
local target=te:GetTarget()
local operation=te:GetOperation()
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty())
Duel.ClearTargetCard()
if not tc:IsType(TYPE_EQUIP) then tc:CancelToGrave(false) end
tc:CreateEffectRelation(te)
if cost then cost(te,tp,ceg,cep,cev,cre,cr,crp,1) end
if target then target(te,tp,ceg,cep,cev,cre,cr,crp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g then
for fc in aux.Next(g) do
fc:CreateEffectRelation(te)
end
end
if operation then
operation(te,tp,ceg,cep,cev,cre,cr,crp)
end
tc:ReleaseEffectRelation(te)
if g then
for fc in aux.Next(g) do
fc:ReleaseEffectRelation(te)
end
end
end
end
end
end
\ No newline at end of file
......@@ -16,7 +16,7 @@ function cm.initial_effect(c)
--move
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
......@@ -160,14 +160,6 @@ function cm.sop(e,tp,eg,ep,ev,re,r,rp)
e1:SetLabelObject(tc)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
--type
local e2=Effect.CreateEffect(c)
e2:SetCode(EFFECT_CHANGE_TYPE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e2:SetValue(TYPE_EQUIP+TYPE_TRAP)
c:RegisterEffect(e2)
end
end
function cm.eqlimit(e,c)
......@@ -177,7 +169,7 @@ function cm.mcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1
end
function cm.nfilter(c,lc,tp,bool)
--if not c:IsFaceup() then return false,false end
if not c:IsFaceup() then return false,false end
if cm.islinkdirstate(c) then return true,true end
if not bool then return false,false end
local seq=lc:GetSequence()
......@@ -197,8 +189,15 @@ function cm.mtg(e,tp,eg,ep,ev,re,r,rp,chk)
local b3=(seq==5 and Duel.CheckLocation(tp,LOCATION_MZONE,1)) or (seq==6 and Duel.CheckLocation(tp,LOCATION_MZONE,3))
local b4=(seq==1 and Duel.CheckLocation(tp,LOCATION_MZONE,5)) or (seq==3 and Duel.CheckLocation(tp,LOCATION_MZONE,6))
local g=Duel.GetMatchingGroup(cm.nfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,c,tp,false)
local q1=#g>0
local typ=0
for fc in aux.Next(g) do
typ=typ|bit.band(fc:GetType(),0x7)
end
local ct=0
for i=0,2 do if typ&(1<<i)>0 then ct=ct+1 end end
local q1=#g>0 and Duel.IsPlayerCanDraw(tp,ct)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)>0 or q1 end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function cm.mop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -210,33 +209,19 @@ function cm.mop(e,tp,eg,ep,ev,re,r,rp)
local b4=(seq==1 and Duel.CheckLocation(tp,LOCATION_MZONE,5)) or (seq==3 and Duel.CheckLocation(tp,LOCATION_MZONE,6))
local q2=bool and Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)>0
local g=Duel.GetMatchingGroup(cm.nfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,c,tp,false)
local q1=#g>0
local typ=0
for fc in aux.Next(g) do
typ=typ|bit.band(fc:GetType(),0x7)
end
local ct=0
for i=0,2 do if typ&(1<<i)>0 then ct=ct+1 end end
local q1=#g>0 and Duel.IsPlayerCanDraw(tp,ct)
if not q1 and not q2 then return end
local opt=aux.SelectFromOptions(tp,{q1,aux.Stringid(m,1)},{q2,aux.Stringid(m,2)})
if opt==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc then
local fid=tc:GetRealFieldID()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,fid,aux.Stringid(m,3))
--disable
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_ACTIVATE_COST)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,1)
e4:SetLabel(fid)
e4:SetTarget(cm.actarget)
e4:SetOperation(cm.costop)
Duel.RegisterEffect(e4,tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetLabel(fid)
e1:SetCondition(cm.discon)
e1:SetOperation(cm.disop)
Duel.RegisterEffect(e1,tp)
end
local d=Duel.Draw(tp,ct,REASON_EFFECT)
Duel.ShuffleHand(tp)
Duel.DiscardHand(tp,nil,d-1,d-1,REASON_EFFECT+REASON_DISCARD)
local bool=c:IsRelateToEffect(e) and c:IsControler(tp) and c:IsFaceup()
local seq=c:GetSequence()
local b1=seq>0 and seq<5 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1)
......@@ -267,47 +252,18 @@ function cm.mop(e,tp,eg,ep,ev,re,r,rp)
local nseq=math.log(s&0xff,2)
Duel.MoveSequence(c,nseq)
local g=Duel.GetMatchingGroup(cm.nfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,c,tp,false)
local q1=#g>0
local typ=0
for fc in aux.Next(g) do
typ=typ|bit.band(fc:GetType(),0x7)
end
local ct=0
for i=0,2 do if typ&(1<<i)>0 then ct=ct+1 end end
local q1=#g>0 and Duel.IsPlayerCanDraw(tp,ct)
if q1 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc then
Duel.HintSelection(Group.FromCards(tc))
local fid=tc:GetRealFieldID()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,fid,aux.Stringid(m,3))
--disable
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_ACTIVATE_COST)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,1)
e4:SetLabel(fid)
e4:SetTarget(cm.actarget)
e4:SetOperation(cm.costop)
Duel.RegisterEffect(e4,tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetLabel(fid)
e1:SetCondition(cm.discon)
e1:SetOperation(cm.disop)
Duel.RegisterEffect(e1,tp)
end
local d=Duel.Draw(tp,ct,REASON_EFFECT)
Duel.ShuffleHand(tp)
Duel.DiscardHand(tp,nil,d-1,d-1,REASON_EFFECT+REASON_DISCARD)
end
end
end
function cm.actarget(e,te,tp)
e:SetLabelObject(te)
return te:GetHandler():GetFlagEffectLabel(m)==e:GetLabel()
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():GetHandler():RegisterFlagEffect(m,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,fid,aux.Stringid(m,3))
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return re:GetHandler():GetFlagEffectLabel(m)==e:GetLabel() and loc&LOCATION_ONFIELD~=0
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
\ No newline at end of file
......@@ -16,7 +16,7 @@ function cm.initial_effect(c)
--move
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
......@@ -177,7 +177,7 @@ function cm.mcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1
end
function cm.nfilter(c,lc,tp,bool)
if not c:IsAbleToHand() then return false,false end
--if not c:IsAbleToHand() then return false,false end
if cm.islinkdirstate(c) then return true,true end
if not bool then return false,false end
local seq=lc:GetSequence()
......@@ -214,9 +214,9 @@ function cm.mop(e,tp,eg,ep,ev,re,r,rp)
if not q1 and not q2 then return end
local opt=aux.SelectFromOptions(tp,{q1,aux.Stringid(m,1)},{q2,aux.Stringid(m,2)})
if opt==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc then Duel.SendtoHand(tc,nil,REASON_EFFECT) end
if tc and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then Duel.SendtoHand(tc,nil,REASON_EFFECT) elseif tc then Duel.Destroy(tc,REASON_EFFECT) end
local bool=c:IsRelateToEffect(e) and c:IsControler(tp) and c:IsFaceup()
local seq=c:GetSequence()
local b1=seq>0 and seq<5 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1)
......@@ -250,9 +250,9 @@ function cm.mop(e,tp,eg,ep,ev,re,r,rp)
local q1=#g>0
if q1 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc then Duel.SendtoHand(tc,nil,REASON_EFFECT) end
if tc and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then Duel.SendtoHand(tc,nil,REASON_EFFECT) elseif tc then Duel.Destroy(tc,REASON_EFFECT) end
end
end
end
\ No newline at end of file
......@@ -5,7 +5,7 @@ function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.thcost)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
......@@ -42,7 +42,7 @@ end
function cm.chkop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:IsReason(REASON_DISCARD) then
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451742,0))
c:RegisterFlagEffect(0,RESET_EVENT+0x1f20000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451742,0))
end
end
function cm.limit(e,tp,eg,ep,ev,re,r,rp)
......@@ -101,30 +101,29 @@ function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetDescription(aux.Stringid(11451731,ct))
e1:SetLabel(flag)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(0x20000000+11451731)
e1:SetCode(EFFECT_FLAG_EFFECT+11451731)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x6977) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(m)
function cm.thfilter(c)
return c:IsSetCard(0x6977) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return ft>-1 and c:IsAbleToHand() and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_GRAVE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #sg>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
end
......
......@@ -5,7 +5,7 @@ function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.thcost)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
......@@ -42,7 +42,7 @@ end
function cm.chkop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:IsReason(REASON_DISCARD) then
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451742,0))
c:RegisterFlagEffect(0,RESET_EVENT+0x1f20000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(11451742,0))
end
end
function cm.limit(e,tp,eg,ep,ev,re,r,rp)
......@@ -101,29 +101,30 @@ function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetDescription(aux.Stringid(11451731,ct))
e1:SetLabel(flag)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(0x20000000+11451731)
e1:SetCode(EFFECT_FLAG_EFFECT+11451731)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.thfilter(c)
return c:IsSetCard(0x6977) and c:IsAbleToHand() and not c:IsCode(m)
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x6977) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(m)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_GRAVE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return ft>-1 and c:IsAbleToHand() and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #sg>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
......
......@@ -162,7 +162,7 @@ function cm.sop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
if og:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local lk=math.ceil(og:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)/2)
local lk=math.ceil(#og/2) --:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)/2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lk):GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 and c:IsRelateToEffect(e) and tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() then
......
......@@ -56,13 +56,13 @@ function cm.initial_effect(c)
end
end
function cm.etg(e,c)
return c:GetFlagEffect(m+0xffffff+e:GetFieldID())==0
return c:GetFlagEffect(m)==0
end
function cm.eval(e,te,c)
local res=c:GetFlagEffect(m+0xffffff+e:GetFieldID())==0 and te:IsActivated() --and te:GetOwner()~=e:GetOwnerPlayer()
local res=c:GetFlagEffect(m)==0 and te:IsActivated() --and te:GetOwner()~=e:GetOwnerPlayer()
if res then
Duel.Hint(HINT_CARD,0,m)
c:RegisterFlagEffect(m+0xffffff+e:GetFieldID(),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
end
return res
end
......
This diff is collapsed.
This diff is collapsed.
--秘计螺旋 扩容
local cm,m=GetID()
function cm.initial_effect(c)
c:SetSPSummonOnce(11451971)
--spsummon condition
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
......@@ -12,7 +13,7 @@ function cm.initial_effect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
--e3:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e3:SetRange(LOCATION_EXTRA)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
......@@ -118,10 +119,12 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
function cm.adop(e,tp,eg,ep,ev,re,r,rp)
if DEFECT_ORAL_COUNT==3 and Duel.IsPlayerAffectedByEffect(0,m) then
DEFECT_ORAL_COUNT=5
elseif DEFECT_ORAL_COUNT==5 and not Duel.IsPlayerAffectedByEffect(0,m) then
DEFECT_ORAL_COUNT=3
DEFECT_ORAL_COUNT=DEFECT_ORAL_COUNT or 3
local ct=3+2*#{Duel.IsPlayerAffectedByEffect(0,11451971)}-#{Duel.IsPlayerAffectedByEffect(0,11451973)}
if DEFECT_ORAL_COUNT<ct then
DEFECT_ORAL_COUNT=ct
elseif DEFECT_ORAL_COUNT>ct then
DEFECT_ORAL_COUNT=ct
for tp=0,1 do
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_FLAG_EFFECT+11451961)}
while #eset>DEFECT_ORAL_COUNT do
......
--秘计螺旋 耗尽
local cm,m=GetID()
function cm.initial_effect(c)
c:SetSPSummonOnce(11451971)
--spsummon condition
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_EXTRA)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(cm.destg)
e1:SetOperation(cm.desop)
c:RegisterEffect(e1)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(m)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(1,1)
c:RegisterEffect(e4)
if not cm.global_check then
cm.global_check=true
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_ADJUST)
ge2:SetOperation(cm.adop)
Duel.RegisterEffect(ge2,0)
end
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
function cm.tgfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGraveAsCost()
end
function cm.thfilter(c)
return c:IsFacedown() and c:IsAbleToHandAsCost()
end
function cm.fselect(g)
return g:GetFirst():GetType()&(TYPE_SPELL+TYPE_TRAP)~=g:GetNext():GetType()&(TYPE_SPELL+TYPE_TRAP)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_HAND,0,nil)
local hg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_ONFIELD,0,nil)
return #hg>0 and g:CheckSubGroup(cm.fselect,2,2)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_HAND,0,nil)
local hg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,cm.fselect,true,2,2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local sg2=hg:Select(tp,1,1,nil)
if #sg>0 and #sg2>0 then
sg:Merge(sg2)
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
local sg=g:Filter(Card.IsOnField,nil)
Duel.SendtoGrave(g-sg,REASON_SPSUMMON+REASON_COST)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
g:DeleteGroup()
end
function cm.adop(e,tp,eg,ep,ev,re,r,rp)
DEFECT_ORAL_COUNT=DEFECT_ORAL_COUNT or 3
local ct=3+2*#{Duel.IsPlayerAffectedByEffect(0,11451971)}-#{Duel.IsPlayerAffectedByEffect(0,11451973)}
if DEFECT_ORAL_COUNT<ct then
DEFECT_ORAL_COUNT=ct
elseif DEFECT_ORAL_COUNT>ct then
DEFECT_ORAL_COUNT=ct
for tp=0,1 do
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_FLAG_EFFECT+11451961)}
while #eset>DEFECT_ORAL_COUNT do
local de=eset[#eset]
local ce=de:GetLabelObject()
if ce and aux.GetValueType(ce)=="Effect" then
local tc=ce:GetHandler()
local eset2={tc:IsHasEffect(EFFECT_FLAG_EFFECT+11451961)}
local res=false
for _,te in pairs(eset2) do
if te:GetLabel()==de:GetLabel() then res=true break end
end
if res then
Duel.RaiseEvent(tc,EVENT_CUSTOM+11451961,e,0,0,0,0)
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(tc:GetOriginalCode(),3))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(tc:GetOriginalCode(),3))
end
ce:Reset()
end
de:Reset()
eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_FLAG_EFFECT+11451961)}
end
end
end
end
\ No newline at end of file
--Undercover
function c19209564.initial_effect(c)
aux.AddCodeList(c,19209511)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,19209564)
e1:SetTarget(c19209564.target)
e1:SetOperation(c19209564.activate)
c:RegisterEffect(e1)
--kksk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e2:SetCountLimit(1,19209565)
e2:SetCondition(c19209564.chkcon)
e2:SetCost(c19209564.chkcost)
e2:SetTarget(c19209564.chktg)
e2:SetOperation(c19209564.chkop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(19209564,ACTIVITY_CHAIN,aux.FilterBoolFunction(aux.NOT(Effect.IsActiveType),TYPE_MONSTER))
end
function c19209564.thfilter(c)
return c:IsSetCard(0x3b50) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c19209564.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c19209564.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function c19209564.activate(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(c19209564.thfilter,tp,LOCATION_DECK,0,1,nil) then return end
local g=Duel.GetMatchingGroup(c19209564.thfilter,tp,LOCATION_DECK,0,nil)
local dcount=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
local seq=-1
local sc=nil
for tc in aux.Next(g) do
if tc:GetSequence()>seq then
seq=tc:GetSequence()
sc=tc
end
end
if seq==-1 then
Duel.ConfirmDecktop(tp,dcount)
Duel.ShuffleDeck(tp)
return
end
Duel.ConfirmDecktop(tp,dcount-seq)
Duel.DisableShuffleCheck(true)
Duel.SendtoHand(sc,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sc)
if sc:IsLocation(LOCATION_HAND) and Duel.GetCustomActivityCount(19209564,1-tp,ACTIVITY_CHAIN)~=0 and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetMZoneCount(tp)>0 and Duel.SelectYesNo(tp,aux.Stringid(19209564,0)) then
Duel.BreakEffect()
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c19209564.chkfilter(c)
return c:IsCode(19209511) and c:IsFaceup()
end
function c19209564.chkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c19209564.chkfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c19209564.chkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function c19209564.chktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
end
function c19209564.chkop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if ct==0 then return end
local ac=1
if ct>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(19209564,1))
ac=Duel.AnnounceNumber(tp,1,2)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,ac)
Duel.ConfirmCards(tp,g)
end
--直面我等罪孽 ES
function c19209566.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,99,c19209566.lcheck)
c:EnableReviveLimit()
--to deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(19209566,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,19209566)
e1:SetTarget(c19209566.tdtg)
e1:SetOperation(c19209566.tdop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(19209566,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,19209567)
e2:SetCondition(c19209566.spcon)
e2:SetTarget(c19209566.sptg)
e2:SetOperation(c19209566.spop)
c:RegisterEffect(e2)
end
function c19209566.lcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0xb50)
end
function c19209566.tdfilter(c)
return c:IsSetCard(0xb50,0xb51) and c:IsFaceupEx() and c:IsAbleToDeck()
end
function c19209566.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c19209566.tdfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,3,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c19209566.tdfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,3,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c19209566.cfilter(c)
return c:IsSetCard(0x3b50) and c:IsFaceupEx() and c:IsType(TYPE_PENDULUM) and aux.NecroValleyFilter()(c)
end
function c19209566.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain()
if #g==0 or Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)==0 then return end
local og=Duel.GetOperatedGroup()
if og:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) and Duel.IsExistingMatchingCard(c19209566.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(19209566,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,c19209566.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,nil):GetFirst()
Duel.HintSelection(Group.FromCards(tc))
if (not tc:IsAbleToRemove() or Duel.SelectOption(tp,aux.Stringid(19209566,3),1192)==0) then
Duel.SendtoExtraP(tc,nil,REASON_EFFECT)
else
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
end
function c19209566.spcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c19209566.spfilter(c,e,tp)
return c:IsSetCard(0xb50) and c:IsFaceupEx() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c19209566.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(c19209566.spfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_REMOVED)
end
function c19209566.spop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_REMOVE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetTarget(c19209566.efilter)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c19209566.spfilter),tp,LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp):GetFirst()
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c19209566.efilter(e,c,rp,r,re)
local tp=e:GetHandlerPlayer()
return c:IsControler(tp) and c:IsOnField() and re and r&REASON_EFFECT>0 and rp==1-tp
end
--超能力防御
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.target)
e1:SetOperation(s.prop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(s.con2)
e2:SetOperation(s.prop2)
c:RegisterEffect(e2)
end
function s.posfilter(c)
return c:IsFaceup() and c:IsCanChangePosition()
end
function s.filter(c)
return c:IsFaceup() and c:IsAbleToHand() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.posfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
Duel.SelectTarget(tp,s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function s.prop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
if Duel.GetMatchingGroupCount(s.filter01,tp,LOCATION_REMOVED,0,nil)>=3 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RESOLVECARD)
local g2=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SendtoHand(g2,nil,REASON_EFFECT)
end
end
end
function s.con2(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetHandler():IsSetCard(0x603) and re:GetHandler():IsType(TYPE_MONSTER) and bit.band(r,REASON_EFFECT)>0
end
function s.prop2(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE_CAL+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--艳彩之星///堀裕子
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE)
e1:SetCountLimit(1,id)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.prop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_REMOVED)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.con2)
e2:SetTarget(s.target2)
e2:SetOperation(s.prop2)
c:RegisterEffect(e2)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
Duel.Remove(c,POS_FACEUP,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and chkc:IsAbleToRemove() end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.prop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 then
Duel.BreakEffect()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,3))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1)
e2:SetLabel(Duel.GetTurnCount())
e2:SetCondition(s.spcon)
e2:SetOperation(s.spop)
if Duel.GetCurrentPhase()<=PHASE_STANDBY then
e2:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
else
e2:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
end
Duel.RegisterEffect(e2,tp)
end
end
function s.spfilter(c)
return c:IsAbleToGrave()
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
return tp==Duel.GetTurnPlayer() and Duel.GetTurnCount()~=e:GetLabel() and g:GetCount()>=1
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local result = Duel.SelectYesNo(tp,aux.Stringid(id,2))
if not result then return end
Duel.Hint(HINT_CARD,0,id)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,99,nil)
if g:GetCount()>0 then
Duel.ConfirmCards(1-tp,g)
if Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
local num = g:GetCount()
num=math.floor(num/2)
if num<1 then return end
Duel.Draw(tp,num,REASON_EFFECT)
end
end
end
function s.cfilter(c,tp,rp)
local bc=c:GetBattleTarget()
return c:IsPreviousPosition(POS_FACEUP) and c:IsSetCard(0x605) and c:IsType(TYPE_MONSTER) and ((c:IsReason(REASON_BATTLE) and bc:IsControler(1-tp)) or (rp==1-tp and c:IsReason(REASON_EFFECT))) and c:IsControler(tp)
end
function s.con2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp,rp) and not eg:IsContains(e:GetHandler())
end
function s.filter4(c)
return c:IsFaceup()
end
function s.target2(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.prop2(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,tp,REASON_EFFECT)>0 and Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local cg=Duel.SelectMatchingCard(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if cg:GetCount()>0 then
Duel.BreakEffect()
Duel.HintSelection(cg)
Duel.ChangePosition(cg:GetFirst(),POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end
end
\ No newline at end of file
--超能力转化
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.prop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_LEAVE_GRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id)
e2:SetCondition(s.con2)
e2:SetOperation(s.prop2)
c:RegisterEffect(e2)
end
function s.filter01(c)
return c:IsSetCard(0x603) and c:IsLocation(LOCATION_REMOVED) and c:IsFaceup()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp)
and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function s.prop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(p,Card.IsAbleToDeck,p,LOCATION_HAND,0,1,1,nil)
if g:GetCount()==0 then return end
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(p)
if Duel.Draw(p,g:GetCount(),REASON_EFFECT)~=0 and Duel.GetMatchingGroupCount(s.filter01,tp,LOCATION_REMOVED,0,nil)>=1 and Duel.IsPlayerCanDraw(tp)
and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,e:GetHandler()) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local g2=Duel.SelectMatchingCard(p,Card.IsAbleToDeck,p,LOCATION_HAND,0,1,1,nil)
if g2:GetCount()==0 then return end
Duel.SendtoDeck(g2,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(p)
if Duel.Draw(p,g2:GetCount(),REASON_EFFECT)~=0 and Duel.GetMatchingGroupCount(s.filter01,tp,LOCATION_REMOVED,0,nil)>=3 and Duel.IsPlayerCanDraw(tp)
and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,e:GetHandler()) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local g3=Duel.SelectMatchingCard(p,Card.IsAbleToDeck,p,LOCATION_HAND,0,1,1,nil)
if g3:GetCount()==0 then return end
Duel.SendtoDeck(g3,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(p)
Duel.Draw(p,g3:GetCount(),REASON_EFFECT)
end
end
end
function s.con2(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetHandler():IsSetCard(0x603) and re:GetHandler():IsType(TYPE_MONSTER) and bit.band(r,REASON_EFFECT)>0
end
function s.prop2(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,6))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1)
e2:SetLabel(Duel.GetTurnCount())
e2:SetCondition(s.spcon)
e2:SetOperation(s.spop)
if Duel.GetCurrentPhase()<=PHASE_STANDBY then
e2:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
else
e2:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
end
Duel.RegisterEffect(e2,tp)
end
function s.filter22(c)
return c:IsSetCard(0x603) and c:IsAbleToHand() and c:IsFaceupEx()
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and Duel.GetTurnCount()~=e:GetLabel() and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.filter22),tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local result = Duel.SelectYesNo(tp,aux.Stringid(id,5))
if not result then return end
Duel.Hint(HINT_CARD,0,id)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter22),tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,nil)
if g2:GetCount()>0 then
Duel.SendtoHand(g2,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g2)
end
end
\ No newline at end of file
--魔导礼 稿鞂
local s,id,o=GetID()
function s.initial_effect(c)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
--ns limit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CANNOT_SUMMON)
e0:SetCondition(s.excon)
c:RegisterEffect(e0)
local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_SINGLE)
e00:SetCode(EFFECT_SUMMON_COST)
e00:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e00:SetOperation(s.nsoath)
c:RegisterEffect(e00)
--summon self
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spscon)
e1:SetTarget(s.spstg)
e1:SetOperation(s.spsop)
c:RegisterEffect(e1)
--book of moon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_POSITION+CATEGORY_TOGRAVE+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+10000)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(s.coscon)
e2:SetTarget(s.costg)
e2:SetOperation(s.cosop)
c:RegisterEffect(e2)
end
function s.coscon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function s.tgfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function s.graveflt(c)
return c:IsSetCard(0xcd70) and c:IsType(TYPE_SPELL) and c:IsAbleToGrave()
end
function s.handflt(c)
return c:IsCode(14087893) and c:IsAbleToHand()
end
function s.costg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and (Duel.IsExistingMatchingCard(s.graveflt,tp,LOCATION_DECK,0,1,nil) or Duel.IsExistingMatchingCard(s.handflt,tp,LOCATION_DECK,0,1,nil) )
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function s.cosop(e,tp,eg,ep,ev,re,r,rp)
local gg = Duel.GetMatchingGroup(s.graveflt,tp,LOCATION_DECK,0,nil)
local gflg = (#gg>0)
local hg = Duel.GetMatchingGroup(s.handflt,tp,LOCATION_DECK,0,nil)
local hflg = (#hg>0)
local op=aux.SelectFromOptions(tp,{gflg,aux.Stringid(id,2)},{hflg,aux.Stringid(id,3)})
if op==1 then
local g = Duel.SelectMatchingCard(tp,s.graveflt,tp,LOCATION_DECK,0,1,1,nil)
if Duel.SendtoGrave(g,REASON_EFFECT) <= 0 then
return
end
elseif op==2 then
local g = Duel.SelectMatchingCard(tp,s.handflt,tp,LOCATION_DECK,0,1,1,nil)
if Duel.SendtoHand(g,nil,REASON_EFFECT) <= 0 then
return
else
Duel.ConfirmCards(1-tp,g)
end
else
return
end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
function s.spscon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function s.filter(c,tp)
return c:IsType(TYPE_QUICKPLAY) and c:IsSSetable()
end
function s.spstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,c,tp)
--Debug.Message(c:IsSummonable(true,nil))
--Debug.Message(#g)
if chk==0 then return #g>0 and c:IsSummonable(true,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,c,1,0,0)
end
function s.spsop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g)
else
return
end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Summon(tp,c,true,nil)
end
function s.nscost(e,te_or_c,tp)
local ct=Duel.GetFlagEffect(tp,79323590)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0
end
function s.counterfilter(c)
return c:IsType(TYPE_FUSION)
end
function s.splimit(e,c)
return not c:IsType(TYPE_FUSION)
end
function s.excon(e)
local c = e:GetHandler()
--Debug.Message(Duel.GetCustomActivityCount(id,c:GetControler(),ACTIVITY_SPSUMMON))
return Duel.GetCustomActivityCount(id,c:GetControler(),ACTIVITY_SPSUMMON)~=0
end
function s.nsoath(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--魔导礼 玄酒
local s,id,o=GetID()
function s.initial_effect(c)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
--ns limit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CANNOT_SUMMON)
e0:SetCondition(s.excon)
c:RegisterEffect(e0)
local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_SINGLE)
e00:SetCode(EFFECT_SUMMON_COST)
e00:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e00:SetOperation(s.nsoath)
c:RegisterEffect(e00)
--summon self
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spscon)
e1:SetTarget(s.spstg)
e1:SetOperation(s.spsop)
c:RegisterEffect(e1)
--Forbidden Chalice
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DISABLE+CATEGORY_TOGRAVE+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+10000)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCondition(s.coscon)
e2:SetTarget(s.costg)
e2:SetOperation(s.cosop)
c:RegisterEffect(e2)
end
function s.coscon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and aux.dscon(e,tp,eg,ep,ev,re,r,rp)
end
function s.graveflt(c)
return c:IsSetCard(0xcd70) and c:IsType(TYPE_SPELL) and c:IsAbleToGrave()
end
function s.handflt(c)
return c:IsCode(25789292) and c:IsAbleToHand()
end
function s.costg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and (Duel.IsExistingMatchingCard(s.graveflt,tp,LOCATION_DECK,0,1,nil) or Duel.IsExistingMatchingCard(s.handflt,tp,LOCATION_DECK,0,1,nil) )
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function s.cosop(e,tp,eg,ep,ev,re,r,rp)
local gg = Duel.GetMatchingGroup(s.graveflt,tp,LOCATION_DECK,0,nil)
local gflg = (#gg>0)
local hg = Duel.GetMatchingGroup(s.handflt,tp,LOCATION_DECK,0,nil)
local hflg = (#hg>0)
local op=aux.SelectFromOptions(tp,{gflg,aux.Stringid(id,2)},{hflg,aux.Stringid(id,3)})
if op==1 then
local g = Duel.SelectMatchingCard(tp,s.graveflt,tp,LOCATION_DECK,0,1,1,nil)
if Duel.SendtoGrave(g,REASON_EFFECT) <= 0 then
return
end
elseif op==2 then
local g = Duel.SelectMatchingCard(tp,s.handflt,tp,LOCATION_DECK,0,1,1,nil)
if Duel.SendtoHand(g,nil,REASON_EFFECT) <= 0 then
return
else
Duel.ConfirmCards(1-tp,g)
end
else
return
end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(400)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetValue(RESET_TURN_SET)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
function s.spscon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function s.filter(c,tp)
return c:IsType(TYPE_QUICKPLAY) and c:IsSSetable()
end
function s.spstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,c,tp)
--Debug.Message(c:IsSummonable(true,nil))
--Debug.Message(#g)
if chk==0 then return #g>0 and c:IsSummonable(true,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,c,1,0,0)
end
function s.spsop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g)
else
return
end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Summon(tp,c,true,nil)
end
function s.nscost(e,te_or_c,tp)
local ct=Duel.GetFlagEffect(tp,79323590)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0
end
function s.counterfilter(c)
return c:IsType(TYPE_FUSION)
end
function s.splimit(e,c)
return not c:IsType(TYPE_FUSION)
end
function s.excon(e)
local c = e:GetHandler()
--Debug.Message(Duel.GetCustomActivityCount(id,c:GetControler(),ACTIVITY_SPSUMMON))
return Duel.GetCustomActivityCount(id,c:GetControler(),ACTIVITY_SPSUMMON)~=0
end
function s.nsoath(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--魔导礼 鸾刀
local s,id,o=GetID()
function s.initial_effect(c)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
--ns limit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CANNOT_SUMMON)
e0:SetCondition(s.excon)
c:RegisterEffect(e0)
local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_SINGLE)
e00:SetCode(EFFECT_SUMMON_COST)
e00:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e00:SetOperation(s.nsoath)
c:RegisterEffect(e00)
--summon self
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spscon)
e1:SetTarget(s.spstg)
e1:SetOperation(s.spsop)
c:RegisterEffect(e1)
--Typhoon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TOGRAVE+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+10000)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(s.coscon)
e2:SetTarget(s.costg)
e2:SetOperation(s.cosop)
c:RegisterEffect(e2)
end
function s.coscon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function s.tgfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function s.graveflt(c)
return c:IsSetCard(0xcd70) and c:IsType(TYPE_SPELL) and c:IsAbleToGrave()
end
function s.handflt(c)
return c:IsCode(5318639) and c:IsAbleToHand()
end
function s.costg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and s.tgfilter(chkc) end
if chk==0 then
local b1 = Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local b2 = Duel.IsExistingMatchingCard(s.graveflt,tp,LOCATION_DECK,0,1,nil)
local b3 = Duel.IsExistingMatchingCard(s.handflt,tp,LOCATION_DECK,0,1,nil)
--Debug.Message("luandao:"..tostring(b1)..tostring(b2)..tostring(b3))
return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and (Duel.IsExistingMatchingCard(s.graveflt,tp,LOCATION_DECK,0,1,nil) or Duel.IsExistingMatchingCard(s.handflt,tp,LOCATION_DECK,0,1,nil) )
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.cosop(e,tp,eg,ep,ev,re,r,rp)
local gg = Duel.GetMatchingGroup(s.graveflt,tp,LOCATION_DECK,0,nil)
local gflg = (#gg>0)
local hg = Duel.GetMatchingGroup(s.handflt,tp,LOCATION_DECK,0,nil)
local hflg = (#hg>0)
local op=aux.SelectFromOptions(tp,{gflg,aux.Stringid(id,2)},{hflg,aux.Stringid(id,3)})
if op==1 then
local g = Duel.SelectMatchingCard(tp,s.graveflt,tp,LOCATION_DECK,0,1,1,nil)
if Duel.SendtoGrave(g,REASON_EFFECT) <= 0 then
return
end
elseif op==2 then
local g = Duel.SelectMatchingCard(tp,s.handflt,tp,LOCATION_DECK,0,1,1,nil)
if Duel.SendtoHand(g,nil,REASON_EFFECT) <= 0 then
return
else
Duel.ConfirmCards(1-tp,g)
end
else
return
end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function s.spscon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function s.filter(c,tp)
return c:IsType(TYPE_QUICKPLAY) and c:IsSSetable()
end
function s.spstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,c,tp)
--Debug.Message(c:IsSummonable(true,nil))
--Debug.Message(#g)
if chk==0 then return #g>0 and c:IsSummonable(true,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,c,1,0,0)
end
function s.spsop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g)
else
return
end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Summon(tp,c,true,nil)
end
function s.nscost(e,te_or_c,tp)
local ct=Duel.GetFlagEffect(tp,79323590)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0
end
function s.counterfilter(c)
return c:IsType(TYPE_FUSION)
end
function s.splimit(e,c)
return not c:IsType(TYPE_FUSION)
end
function s.excon(e)
local c = e:GetHandler()
--Debug.Message(Duel.GetCustomActivityCount(id,c:GetControler(),ACTIVITY_SPSUMMON))
return Duel.GetCustomActivityCount(id,c:GetControler(),ACTIVITY_SPSUMMON)~=0
end
function s.nsoath(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--魔导礼记
local s,id,o=GetID()
function s.initial_effect(c)
--Debug.Message(o)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+10000)
e2:SetCost(s.bfgcost)
e2:SetTarget(s.tgtg)
e2:SetOperation(s.tgop)
c:RegisterEffect(e2)
end
function s.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1 = e:GetHandler():IsAbleToRemoveAsCost()
--Debug.Message("liji mudi cost:"..tostring(b1))
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function s.tgfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGrave()
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1 = Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,nil)
--Debug.Message("liji mudi:"..tostring(b1))
if chk==0 then
return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,99,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
local gg = g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
gg = gg:Filter(Card.IsType,nil,TYPE_QUICKPLAY)
if #gg>0 and Duel.IsPlayerCanDraw(tp,#gg) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Draw(tp,#gg,REASON_EFFECT)
end
end
end
function s.filter(c)
return c:IsSetCard(0xcd70) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local b1 = Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil)
--Debug.Message("liji fadong:"..tostring(b1))
return 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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--魔导礼记 逸
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--recycle
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,3))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,id+10000)
e3:SetCondition(s.rccon)
e3:SetTarget(s.rctg)
e3:SetOperation(s.rcop)
c:RegisterEffect(e3)
end
function s.tgfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGrave()
end
function s.rccon(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(Duel.GetLocationCount(tp,LOCATION_SZONE))
return Duel.GetLocationCount(tp,LOCATION_SZONE)==0
end
function s.rctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetHandler():IsAbleToHand() then
return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
return e:GetHandler():IsSSetable(true) and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_SZONE,0,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_ONFIELD)
end
function s.rcop(e,tp,eg,ep,ev,re,r,rp)
local tg = nil
local c=e:GetHandler()
if c:IsAbleToHand()
and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_ONFIELD,0,1,nil)
then
tg = Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_ONFIELD,0,1,99,nil)
elseif c:IsSSetable(true) and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_SZONE,0,1,nil)
then
tg = Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_SZONE,0,1,1,nil)
if Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_ONFIELD,0,1,tg) then
local tmp = Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_ONFIELD,0,0,99,tg)
if #tmp>0 then tg.Merge(tmp) end
end
end
if #tg>0 and Duel.SendtoGrave(tg,REASON_EFFECT)>0 and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_GRAVE) then
local hflg = c:IsAbleToHand()
local sflg = c:IsSSetable()
local op=aux.SelectFromOptions(tp,{sflg,aux.Stringid(id,4)},{hflg,aux.Stringid(id,5)})
if op == 1 then
Duel.SSet(tp,c)
elseif op == 2 then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end
end
function s.filter(c,e,tp)
return c:IsType(TYPE_QUICKPLAY) and c:IsAbleToGrave()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5):Filter(s.filter,nil,e,tp)
local tc = nil
if g:GetCount()>0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil)
if Duel.SendtoGrave(sg,REASON_EFFECT)>0 then
tc = sg:GetFirst()
end
end
Duel.ShuffleDeck(tp)
if tc and tc:CheckActivateEffect(false,true,false)~=nil
and Duel.SelectYesNo(tp,aux.Stringid(id,2))
then
Duel.BreakEffect()
local te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(true,true,true)
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
Duel.ClearOperationInfo(0)
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
end
\ No newline at end of file
--先王之魔导礼
local s,id,o=GetID()
function s.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode3(c,21401210,21401211,21401212,true,true)
aux.AddContactFusionProcedure(c,s.futionflt, LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,aux.tdcfop(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(s.splimit)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(s.efilter)
c:RegisterEffect(e2)
--update atk,def
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(s.val)
c:RegisterEffect(e4)
local e3=e4:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--set
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,0))
e5:SetCategory(CATEGORY_REMOVE)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,id)
e5:SetHintTiming(TIMINGS_CHECK_MONSTER)
e5:SetCondition(aux.dscon)
e5:SetCost(s.setcost)
e5:SetTarget(s.settg)
e5:SetOperation(s.setop)
c:RegisterEffect(e5)
end
function s.futionflt(c)
return c:IsAbleToDeckOrExtraAsCost() and not(c:IsLocation(LOCATION_REMOVED) and c:IsPosition(POS_FACEDOWN))
end
function s.tgfilter(c)
return c:IsType(TYPE_QUICKPLAY) and c:IsSSetable()
end
function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil,tp) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,nil,tp)
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemove() and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:GetOriginalCode()==id then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(c)
e1:SetCountLimit(1)
e1:SetOperation(s.retop)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
local tc = g:GetFirst()
if Duel.SSet(tp,tc) >0 then
local ch=Duel.GetCurrentChain()
if ch>1 then
local p,code=Duel.GetChainInfo(ch-1,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_CODE)
if p==1-tp then
if tc:CheckActivateEffect(false,true,false)~=nil
and Duel.SelectYesNo(tp,aux.Stringid(id,1))
then
Duel.BreakEffect()
local te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(true,true,true)
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
Duel.ClearOperationInfo(0)
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
end
end
end
end
end
end
function s.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function s.efilter(e,te)
return te:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function s.val(e,c)
return Duel.GetMatchingGroupCount(Card.IsType,e:GetHandlerPlayer(),LOCATION_ONFIELD,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)*500
end
--季沧海
local cm,m,o=GetID()
function cm.initial_effect(c)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(cm.indtg)
e3:SetValue(1)
c:RegisterEffect(e3)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon1)
c:RegisterEffect(e1)
local ce1=e1:Clone()
ce1:SetRange(LOCATION_DECK)
ce1:SetCountLimit(1,m)
ce1:SetCondition(cm.spcon2)
c:RegisterEffect(ce1)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_DRAW+CATEGORY_LEAVE_GRAVE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,m+10000000)
e4:SetTarget(cm.target)
e4:SetOperation(cm.operation)
c:RegisterEffect(e4)
local ce2=Effect.CreateEffect(c)
ce2:SetType(EFFECT_TYPE_SINGLE)
ce2:SetCode(EFFECT_UPDATE_ATTACK)
ce2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
ce2:SetRange(LOCATION_MZONE)
ce2:SetCondition(cm.tttcon)
ce2:SetValue(1000)
c:RegisterEffect(ce2)
local ce3=ce2:Clone()
ce3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(ce3)
local ce4=Effect.CreateEffect(c)
ce4:SetType(EFFECT_TYPE_SINGLE)
ce4:SetCode(EFFECT_PIERCE)
ce4:SetValue(DOUBLE_DAMAGE)
ce4:SetCondition(cm.tttcon)
c:RegisterEffect(ce4)
--search
local ce5=Effect.CreateEffect(c)
ce5:SetDescription(aux.Stringid(23410107,2))
ce5:SetCategory(CATEGORY_DESTROY)
ce5:SetType(EFFECT_TYPE_QUICK_O)
ce5:SetCode(EVENT_FREE_CHAIN)
ce5:SetRange(LOCATION_MZONE)
ce5:SetCountLimit(1)
ce5:SetCost(cm.dcost)
ce5:SetCondition(cm.tttcon)
ce5:SetTarget(cm.dtg)
ce5:SetOperation(cm.dop)
c:RegisterEffect(ce5)
end
function cm.indtg(e,c)
local tc=e:GetHandler()
return c==tc or c==tc:GetBattleTarget()
end
function cm.spcon1(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_ONFIELD,0,1,nil)
end
function cm.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerAffectedByEffect(e:GetHandlerPlayer(),m)
and Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_ONFIELD,0,1,nil)
end
function cm.fil(c)
return c:IsType(TYPE_FUSION) and c:IsFaceup()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,c)
if chk==0 then return e:GetHandler():IsAbleToHand() end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
if Duel.SendtoHand(c,nil,REASON_EFFECT)~=0 and (Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_ONFIELD,0,1,nil) or Duel.IsExistingMatchingCard(cm.fil,tp,LOCATION_MZONE,0,1,nil)) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function cm.tttcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(e:GetHandlerPlayer(),m)
end
function cm.dcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function cm.dtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
end
function cm.dop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
if Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil):Select(tp,1,1,nil)
Duel.Destroy(g,REASON_EFFECT)
end
end
\ No newline at end of file
--崩山斩
local s,id=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,23410101)
-- ① 主要效果
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
-- ② 墓地回收效果
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,id+10000000)
e2:SetCondition(s.setcon)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
end
-- ① 目标选择
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
-- ① 效果处理
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then
-- 检查是否是盖放发动
if not e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then
local op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))
if op==0 then
-- 丢弃抽卡效果
local g=Duel.SelectMatchingCard(tp,s.disfilter,tp,LOCATION_HAND,0,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
Duel.Draw(tp,2,REASON_EFFECT)
end
else
-- 盖放魔法陷阱
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_HAND,0,1,1,nil)
if #g>0 then
local sc=g:GetFirst()
if Duel.SSet(tp,sc) then -- 确保盖放成功
-- 允许当回合发动
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1)
end
end
end
end
end
end
-- ② 条件判断
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
-- ② 目标设置
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
-- ② 效果处理
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SSet(tp,c) then -- 确保盖放成功
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_ONFIELD,0,1,nil,23410101)
and Duel.IsPlayerCanDraw(tp,1) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
-- 过滤器(保持不变)
function s.disfilter(c)
return aux.IsCodeListed(c,23410101) and c:IsDiscardable()
end
function s.setfilter(c)
return aux.IsCodeListed(c,23410101) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
\ No newline at end of file
--燎原劲
local s,id=GetID()
function s.initial_effect(c)
-- 添加卡名记述
aux.AddCodeList(c,23410101)
-- 速攻魔法盖放回合可发动
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e0:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
c:RegisterEffect(e0)
-- ① 主要效果
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:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.tdtg)
e1:SetOperation(s.tdop)
c:RegisterEffect(e1)
-- ② 墓地回收效果
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,id+10000000)
e2:SetCondition(s.setcon)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
end
-- ① 目标选择
function s.tdfilter(c)
return c:IsFacedown() and c:IsAbleToDeck()
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(s.tdfilter,tp,0,LOCATION_ONFIELD,2,nil)
end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,1-tp,LOCATION_ONFIELD)
end
-- ① 效果处理
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.tdfilter,tp,0,LOCATION_ONFIELD,nil)
if #g>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(tp,2,2,nil)
local tc1=sg:GetFirst()
local tc2=sg:GetNext()
Duel.SendtoDeck(tc2,nil,SEQ_DECKTOP,REASON_EFFECT)
Duel.SendtoDeck(tc1,nil,SEQ_DECKTOP,REASON_EFFECT)
end
end
-- ② 条件判断
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
-- ② 目标设置
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
-- ② 效果处理
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SSet(tp,c) then
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_ONFIELD,0,1,nil,23410103)
and Duel.IsPlayerCanDraw(tp,1) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
\ No newline at end of file
--蓄力·振刀
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,23410101)
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,23410101,cm.mfilter,1,true,true)
--sp fusion
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(cm.uop)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetCondition(cm.discon)
e3:SetOperation(cm.disop)
Duel.RegisterEffect(e3,0)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TODECK+CATEGORY_LEAVE_GRAVE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(cm.target)
e4:SetOperation(cm.operation)
c:RegisterEffect(e4)
end
function cm.mfilter(c,fc,sub,mg,sg)
local tf=false
if not sg or sg:FilterCount(aux.TRUE,c)==0 then tf=true
elseif sg:GetFirst():GetColumnGroup():IsExists(Card.IsFacedown,1,nil) then tf=true end
return c:IsLocation(LOCATION_MZONE) and tf
end
function cm.uop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e3:SetValue(cm.efilter)
c:RegisterEffect(e3)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tp=e:GetHandlerPlayer()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(cm.mfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,re:GetHandler()) and c:CheckFusionMaterial(nil,re:GetHandler()) and rp~=tp end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local fc=Duel.SelectMatchingCard(tp,cm.mfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,re:GetHandler()):GetFirst()
local fg=Group.FromCards(re:GetHandler(),fc)
c:SetMaterial(fg)
if fg:IsExists(Card.IsFacedown,1,nil) then
Duel.ConfirmCards(1,fg:Filter(Card.IsFacedown,nil))
Duel.ConfirmCards(0,fg:Filter(Card.IsFacedown,nil))
end
if re:GetHandler():IsFaceup() and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
local a=Duel.ChangePosition(re:GetHandler(),POS_FACEDOWN_DEFENSE)
local b=Duel.SendtoGrave(fc,REASON_SPSUMMON)
if a+b==2 then Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP) end
elseif Duel.SendtoGrave(fg,REASON_SPSUMMON)==2 then Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP) end
end
end
function cm.mfilter2(c,tc)
return c:IsLocation(LOCATION_MZONE) and tc:IsLocation(LOCATION_MZONE)
and #Group.FromCards(c,tc):Filter(Card.IsCode,nil,23410101)>0 and #Group.FromCards(c,tc):Filter(cm.mfilter3,nil)>0
end
function cm.mfilter3(c)
return Duel.IsExistingMatchingCard(cm.mfilter4,1,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,c)
end
function cm.mfilter4(c,tc)
return c:GetColumnGroup():IsContains(tc) and (c:IsFacedown() or tc:IsFacedown())
end
function cm.disfilter(c)
return c:IsFaceup() and c:IsOriginalCodeRule(m) and not c:IsStatus(STATUS_BATTLE_DESTROYED) and not c:IsDisabled()
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsFacedown()
and Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function cm.filter(c)
return aux.IsCodeListed(c,23410101) and c:IsType(TYPE_SPELL) and c:IsSSetable()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,c)
if chk==0 then return e:GetHandler():IsAbleToExtra() end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
Duel.SendtoDeck(c,nil,0,REASON_EFFECT)
if c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil):Select(tp,1,1,nil)
if #sg>0 then Duel.SSet(tp,sg:GetFirst()) end
end
end
-- 旋风斩
local s,id=GetID()
function s.initial_effect(c)
-- 添加卡名记述
aux.AddCodeList(c,23410101)
-- ① 主要效果
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.postg)
e1:SetOperation(s.posop)
c:RegisterEffect(e1)
-- ② 墓地回收效果
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,id+10000000)
e2:SetCondition(s.setcon)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
end
-- ① 目标选择
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(Card.IsCanTurnSet,tp,0,LOCATION_MZONE,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,1-tp,LOCATION_MZONE)
end
-- ① 效果处理
function s.posop(e,tp,eg,ep,ev,re,r,rp)
-- 基本效果
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectMatchingCard(tp,Card.IsCanTurnSet,tp,0,LOCATION_MZONE,1,1,nil)
if #g>0 and Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)>0 then
-- 盖放发动的追加效果
local c=e:GetHandler()
if not e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then
local op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))
if op==0 then
-- 丢弃并翻转其他怪兽
local dg=Duel.SelectMatchingCard(tp,s.disfilter,tp,LOCATION_HAND,0,1,1,nil)
if #dg>0 and Duel.SendtoGrave(dg,REASON_EFFECT+REASON_DISCARD)>0 then
local tg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
Duel.ChangePosition(tg,POS_FACEDOWN_DEFENSE)
end
else
-- 盖放魔法陷阱
local sg=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_HAND,0,1,1,nil)
if #sg>0 then
local tc=sg:GetFirst()
if Duel.SSet(tp,tc) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
end
end
end
-- ② 条件判断
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
-- ② 目标设置
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
-- ② 效果处理
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SSet(tp,c) then
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_ONFIELD,0,1,nil,23410101)
and Duel.IsPlayerCanDraw(tp,1) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
-- 过滤器
function s.disfilter(c)
return aux.IsCodeListed(c,23410101) and c:IsDiscardable()
end
function s.setfilter(c)
return aux.IsCodeListed(c,23410101) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
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.
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