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))
......
......@@ -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))
......@@ -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
......
......@@ -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))
......
......@@ -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)
......
......@@ -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)
......
......@@ -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
local q1=Duel.IsExistingMatchingCard(cm.nfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
if q1 then
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
typ=typ|bit.band(fc:GetType(),0x7)
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 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()
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
\ 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
\ No newline at end of file
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
......
......@@ -13,7 +13,7 @@ function cm.initial_effect(c)
--sp
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_DRAW)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetRange(LOCATION_HAND)
......@@ -65,7 +65,7 @@ function cm.check0(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.tbfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsFaceup()
return c:IsFaceup() and c:IsType(TYPE_RITUAL)
end
function cm.ttcon(e,c,minc)
if c==nil then return true end
......@@ -95,6 +95,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,ct,tp,LOCATION_HAND)
end
function cm.acfilter(c,tp,eg,ep,ev,re,r,rp)
if not c:IsSetCard(0x6978) then return end
......@@ -125,10 +126,12 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,ct,REASON_EFFECT)>0 then
local g=Duel.GetOperatedGroup()
Duel.ConfirmCards(tp,g)
local sg=g:Filter(cm.acfilter,nil,tp,eg,ep,ev,re,r,rp)
if #sg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,4)) then
local sg=Duel.GetFieldGroup(tp,LOCATION_HAND,0):Filter(cm.acfilter,nil,tp,eg,ep,ev,re,r,rp)
if #sg>0 then --and Duel.SelectYesNo(tp,aux.Stringid(m,4)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local c=sg:Select(tp,1,1,nil):GetFirst()
local cg=sg:CancelableSelect(tp,1,1,nil)
if cg and #cg>0 then
local c=cg:GetFirst()
g:RemoveCard(c)
local b1,b2=false,false
if c:IsType(TYPE_SPELL+TYPE_TRAP) and ((c:CheckActivateEffect(false,false,false)~=nil and c:GetActivateEffect():GetCode()~=EVENT_CHAINING and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) or (c:IsType(TYPE_CONTINUOUS) and c:GetActivateEffect():IsActivatable(tp)) or (c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true))) then b1=true end
......@@ -243,6 +246,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
end
g=g:Filter(Card.IsControler,nil,tp):Filter(Card.IsLocation,nil,LOCATION_HAND)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
......
--血雳强袭队·勿忘我
local cm,m=GetID()
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e1:SetHintTiming(TIMING_END_PHASE+TIMING_BATTLE_END+TIMING_STANDBY_PHASE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.stg)
e1:SetOperation(cm.sop)
c:RegisterEffect(e1)
--move
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+6)
e2:SetCondition(cm.mcon)
e2:SetTarget(cm.mtg)
e2:SetOperation(cm.mop)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(cm.eftg)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function cm.eftg(e,c)
return e:GetHandler():GetEquipTarget()==c
end
function cm.spfilter(c,e,tp,link)
return c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsLink(link)
end
function cm.stg(e,tp,eg,ep,ev,re,r,rp,chk)
local link=math.ceil((Duel.GetCurrentChain()+1)/2)
local tg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp,link)
if chk==0 then return #tg>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cm.sop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lk=math.ceil(Duel.GetCurrentChain()/2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.spfilter,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
Duel.Equip(tp,c,tc)
--equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(cm.eqlimit)
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)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(cm.discon)
e3:SetOperation(cm.disop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3,true)
tc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,3))
end
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local lc=e:GetHandler()
local p,loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CONTROLER,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
if loc&LOCATION_ONFIELD==0 or rp==tp then return false end
local x=seq
local y=0
if p==tp then
if loc&LOCATION_MZONE>0 and x<=4 then y=1
elseif loc&LOCATION_MZONE>0 and x==5 then x,y=1,2
elseif loc&LOCATION_MZONE>0 and x==6 then x,y=3,2
elseif loc&LOCATION_SZONE>0 and x<=4 then y=0
else x,y=-1,0.5 end
elseif p==1-tp then
if loc&LOCATION_MZONE>0 and x<=4 then x,y=4-x,3
elseif loc&LOCATION_MZONE>0 and x==5 then x,y=3,2
elseif loc&LOCATION_MZONE>0 and x==6 then x,y=1,2
elseif loc&LOCATION_SZONE>0 and x<=4 then x,y=4-x,4
else x,y=5,3.5 end
end
return cm.islinkdir(lc,x,y,tp)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function cm.xylabel(c,tp)
local x=c:GetSequence()
local y=0
if c:GetControler()==tp then
if c:IsLocation(LOCATION_MZONE) and x<=4 then y=1
elseif c:IsLocation(LOCATION_MZONE) and x==5 then x,y=1,2
elseif c:IsLocation(LOCATION_MZONE) and x==6 then x,y=3,2
elseif c:IsLocation(LOCATION_SZONE) and x<=4 then y=0
else x,y=-1,0.5 end
elseif c:GetControler()==1-tp then
if c:IsLocation(LOCATION_MZONE) and x<=4 then x,y=4-x,3
elseif c:IsLocation(LOCATION_MZONE) and x==5 then x,y=3,2
elseif c:IsLocation(LOCATION_MZONE) and x==6 then x,y=1,2
elseif c:IsLocation(LOCATION_SZONE) and x<=4 then x,y=4-x,4
else x,y=5,3.5 end
end
return x,y
end
function cm.gradient(y,x)
if y>0 and x==0 then return math.pi/2 end
if y<0 and x==0 then return math.pi*3/2 end
if y>=0 and x>0 then return math.atan(y/x) end
if x<0 then return math.pi+math.atan(y/x) end
if y<0 and x>0 then return 2*math.pi+math.atan(y/x) end
return 1000
end
function cm.fieldline(x1,y1,x2,y2,...)
for _,k in pairs({...}) do
if cm.gradient(y2-y1,x2-x1)==k then return true end
end
return false
end
function cm.willbelinkdir(c,lc,x0,y0,tp,tgp)
if tp~=tgp then x0,y0=4-x0,4-y0 end
local x,y=cm.xylabel(c,tgp)
local list={5/4,3/2,7/4,1,1000,0,3/4,1/2,1/4}
for i=0,8 do
if lc:IsLinkMarker(1<<i) and cm.fieldline(x0,y0,x,y,list[i+1]*math.pi) then return true end
end
return false
end
function cm.islinkdir(lc,x,y,tp)
if lc:IsControler(1-tp) then x,y=4-x,4-y end
local x0,y0=cm.xylabel(lc,lc:GetControler())
local list={5/4,3/2,7/4,1,1000,0,3/4,1/2,1/4}
for i=0,8 do
if lc:IsLinkMarker(1<<i) and cm.fieldline(x0,y0,x,y,list[i+1]*math.pi) then return true end
end
return false
end
function cm.eqlimit(e,c)
return e:GetLabelObject()==c
end
function cm.mcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1
end
function cm.nfilter(c)
return c:GetType()==TYPE_TRAP 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_EQUIP)
end
function cm.mtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local seq=c: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 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
end
function cm.mop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
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)
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 q2=bool and Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)>0
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 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()
tc:CreateEffectRelation(te)
if cost then cost(te,tp,ceg,cep,cev,cre,cr,crp,1) end
if not tc:IsType(TYPE_EQUIP) and not tc:IsHasEffect(EFFECT_REMAIN_FIELD) then tc:CancelToGrave(false) 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)
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 q2=bool and Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)>0
if q2 then
Duel.BreakEffect()
local flag=0
if b1 then flag=bit.replace(flag,0x1,seq-1) end
if b2 then flag=bit.replace(flag,0x1,seq+1) end
if b3 then if seq==5 then flag=flag|0x2 else flag=flag|0x8 end end
if b4 then if seq==1 then flag=flag|0x20 else flag=flag|0x40 end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s&0xff,2)
Duel.MoveSequence(c,nseq)
end
elseif opt==2 then
local flag=0
if b1 then flag=bit.replace(flag,0x1,seq-1) end
if b2 then flag=bit.replace(flag,0x1,seq+1) end
if b3 then if seq==5 then flag=flag|0x2 else flag=flag|0x8 end end
if b4 then if seq==1 then flag=flag|0x20 else flag=flag|0x40 end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s&0xff,2)
Duel.MoveSequence(c,nseq)
local q1=Duel.IsExistingMatchingCard(cm.nfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
if q1 then
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
--秘计螺旋 扩容
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
--磐石架势
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,23410101)
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,cm.mfilter1,cm.mfilter2,true)
--code
aux.EnableChangeCode(c,23410101,LOCATION_MZONE)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetValue(1)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.thcon1)
e1:SetTarget(cm.thtg1)
e1:SetOperation(cm.thop1)
c:RegisterEffect(e1)
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)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+10000000)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
function cm.mfilter1(c)
return c:IsRace(RACE_ILLUSION) and c:IsAttribute(ATTRIBUTE_FIRE)
end
function cm.mfilter2(c)
return c:IsRace(RACE_ILLUSION) and not c:IsAttribute(ATTRIBUTE_FIRE)
end
function cm.mfilter3(c)
return c:IsFacedown()
end
function cm.mfilter4(c)
return c:IsOriginalCodeRule(23410101) and c:IsReleasable() and c:IsCanBeFusionMaterial()
end
function cm.spcon(e,c)
local tp=e:GetHandlerPlayer()
if c==nil then return true end
return Duel.IsExistingMatchingCard(cm.mfilter3,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(cm.mfilter4,tp,LOCATION_MZONE,0,1,nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(cm.mfilter4,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=g:Select(tp,1,1,nil)
if not Duel.Release(sg,REASON_COST) then return end
c:SetMaterial(sg)
end
function cm.thcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function cm.thfilter1(c)
return aux.IsCodeListed(c,23410101) and c:IsType(TYPE_SPELL) and c:IsType(TYPE_QUICKPLAY) and c:IsAbleToHand()
end
function cm.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter1,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
function cm.indtg(e,c)
local tc=e:GetHandler()
return c==tc or c==tc:GetBattleTarget()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
if Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT,nil) and c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(2000)
c:RegisterEffect(e1)
if Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_ONFIELD,0,2,nil) and Duel.IsExistingMatchingCard(cm.fil5,tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.fil5,tp,LOCATION_GRAVE,0,1,1,nil)
if Duel.SSet(tp,g)~=0 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)
g:GetFirst():RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
g:GetFirst():RegisterEffect(e2)
end
end
end
end
function cm.fil5(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() and aux.IsCodeListed(c,23410101)
end
--觉醒·季沧海
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,23410101)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.atkcon)
e1:SetCost(cm.atkcost1)
e1:SetTarget(cm.atktg)
e1:SetOperation(cm.atkop1)
c:RegisterEffect(e1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,23410101)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(23410101)
e2:SetTargetRange(1,0)
Duel.RegisterEffect(e2,tp)
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
return aux.dscon and Duel.GetCurrentChain()>1
end
function cm.atkcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.atkfilter(c)
return c:IsFaceup() and c:IsRace(RACE_ILLUSION)
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function cm.atkop1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e3:SetValue(1)
tc:RegisterEffect(e3)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
if g then Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE) end
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_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
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.spfilter(c,e,tp)
return c:IsCode(23410101) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
-- ① 效果处理
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=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
-- 直接盖放
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEDOWN,true)
c:CancelToGrave()
else
-- 支付LP强化
local lp=Duel.GetLP(tp)
if Duel.PayLPCost(tp,math.floor(lp/2)) then
-- 攻击力提升
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsCode,23410101))
e1:SetValue(math.floor(lp/2))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
-- 效果抗性
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsCode,23410101))
e2:SetValue(s.efilter)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
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.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetOwnerPlayer()
end
\ No newline at end of file
--迅烈如火
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,23410101)
c:EnableReviveLimit()
--fusion material
aux.AddFusionProcFunRep(c,cm.ffilter,6,true)
--code
aux.EnableChangeCode(c,23410101,LOCATION_MZONE)
--special summon rule
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 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)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_DUEL)
e1:SetOperation(cm.top)
c:RegisterEffect(e1)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(aux.bdcon)
e1:SetOperation(cm.flagop)
c:RegisterEffect(e1)
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)
--attack all
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_ATTACK_ALL)
e4:SetValue(1)
e4:SetCondition(cm.oxcon)
c:RegisterEffect(e4)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e3:SetCondition(cm.atkcon)
e3:SetCost(cm.atkcost)
e3:SetOperation(cm.atkop)
c:RegisterEffect(e3)
end
function cm.ffilter(c)
return c:IsRace(RACE_ILLUSION)
end
function cm.m(c)
return c:IsRace(RACE_ILLUSION) and c:IsAbleToGraveAsCost()
end
function cm.mm(card)
if card:IsCode(23410101) then
return 2
else
return 1
end
end
function cm.mmm(mg,fc)
local tp=fc:GetControler()
local x=0
for tc in aux.Next(mg) do
x = x + cm.mm(tc)
if x>=6 then break end
end
return x>=6 and Duel.GetLocationCountFromEx(tp,tp,mg,fc)>0
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(cm.m,tp,LOCATION_MZONE,0,nil)
if chk==0 then return mg:CheckSubGroup(cm.mmm,3,6,e:GetHandler()) and Duel.GetLocationCountFromEx(tp,tp,mg,e:GetHandler())>0
and rp==1-tp end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(cm.m,tp,LOCATION_MZONE,0,nil)
if not mg:CheckSubGroup(cm.mmm,3,6,c) then return end
if not Duel.SelectYesNo(tp,aux.Stringid(m,0)) then return end
local sg=Group.CreateGroup()
while #sg<6 do
local button=false
local cg=mg:Filter(cm.m,sg,c)
if #cg==0 then break end
local cancel_group=sg:Clone()
if gc then cancel_group:RemoveCard(gc) end
if cm.mmm(sg,c) then button=true end
local og=mg:Filter(Card.IsLocation,nil,LOCATION_MZONE)
if #og>0 and #sg==5 and Duel.GetLocationCountFromEx(tp,tp,sg,c)==0 then
cg=og
end
Duel.Hint(3,tp,HINTMSG_FMATERIAL)
local tc=cg:SelectUnselect(cancel_group,tp,button,false,3,6)
if not tc then break end
if sg:IsContains(tc) then
sg:RemoveCard(tc)
else
sg:AddCard(tc)
end
end
c:SetMaterial(sg)
if sg:IsExists(Card.IsFacedown,1,nil) then
Duel.ConfirmCards(1,sg:Filter(Card.IsFacedown,nil))
Duel.ConfirmCards(0,sg:Filter(Card.IsFacedown,nil))
end
if sg and Duel.SendtoGrave(sg,REASON_MATERIAL)~=0 then
Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP)
end
end
function cm.indtg(e,c)
local tc=e:GetHandler()
return c==tc or c==tc:GetBattleTarget()
end
function cm.top(e,tp,eg,ep,ev,re,r,rp,c)
Duel.SkipPhase(1-tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(1-tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,1-tp)
Duel.SkipPhase(tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
end
function cm.flagcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)==0
end
function cm.flagop(e,tp,eg,ep,ev,re,r,rp,c)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
end
function cm.tttcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(e:GetHandlerPlayer(),23410101) and e:GetHandler():GetFlagEffect(m)~=0
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
function cm.oxcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)~=0
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and c:GetFlagEffect(m)~=0 and not bc:IsType(TYPE_LINK) and not bc:IsPosition(POS_FACEDOWN_DEFENSE)
end
function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(m+10000000)==0 end
c:RegisterFlagEffect(m+10000000,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if c:IsRelateToBattle() and bc:IsRelateToBattle() and c:GetFlagEffect(m)~=0 and not bc:IsType(TYPE_LINK) and not bc:IsPosition(POS_FACEDOWN_DEFENSE) then
Duel.ChangePosition(bc,POS_FACEDOWN_DEFENSE)
end
end
......@@ -14,7 +14,7 @@ function c28314946.initial_effect(c)
--recover
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(28314946,1))
e2:SetCategory(CATEGORY_RECOVER+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetCategory(CATEGORY_RECOVER+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DELAY)
......@@ -54,14 +54,14 @@ function c28314946.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function c28314946.thfilter(c)
return c:IsSetCard(0x283) and c:IsLevel(4) and c:IsAbleToHand()
return c:IsSetCard(0x283) and c:IsLevel(4) and c:IsAbleToHand() and aux.NecroValleyFilter()(c)
end
function c28314946.recop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,1000,REASON_EFFECT)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetClassCount(Card.GetAttribute)>=3 and Duel.IsExistingMatchingCard(c28314946.thfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(28314946,2)) then
if g:GetClassCount(Card.GetAttribute)>=3 and Duel.IsExistingMatchingCard(c28314946.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(28314946,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,c28314946.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local tg=Duel.SelectMatchingCard(tp,c28314946.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
......
--冷面杀手
function c28326245.initial_effect(c)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c28326245.atkval)
c:RegisterEffect(e1)
--be target
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(28326245,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_F)
e2:SetCode(EVENT_BECOME_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c28326245.thcon)
e2:SetTarget(c28326245.thtg)
e2:SetOperation(c28326245.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_BE_BATTLE_TARGET)
c:RegisterEffect(e3)
end
function c28326245.atkfilter(c,atk)
return c:IsFaceup() and c:IsAttackBelow(atk-1)
end
function c28326245.atkval(e,c)
return Duel.GetMatchingGroup(c28326245.atkfilter,c:GetControler(),0,LOCATION_MZONE,nil,c:GetBaseAttack())*1000
end
function c28326245.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler())
end
function c28326245.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c28326245.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
......@@ -18,13 +18,6 @@ function c28361833.initial_effect(c)
e0:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x286))
e0:SetLabelObject(ge0)
c:RegisterEffect(e0)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(aux.synlimit)
c:RegisterEffect(e1)
--hokura power
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
......@@ -38,15 +31,6 @@ function c28361833.initial_effect(c)
e3:SetOperation(c28361833.regop)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c28361833.thtg)
e4:SetOperation(c28361833.thop)
c:RegisterEffect(e4)
c28361833.shinycounter=true
end
function c28361833.cfilter(c)
......@@ -69,6 +53,19 @@ end
function c28361833.regop(e,tp,eg,ep,ev,re,r,rp)
local vt=e:GetLabelObject():GetLabel()
local c=e:GetHandler()
if vt>=2 then
--to hand
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e0:SetType(EFFECT_TYPE_IGNITION)
e0:SetRange(LOCATION_MZONE)
e0:SetCountLimit(1)
e0:SetTarget(c28361833.thtg)
e0:SetOperation(c28361833.thop)
e0:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e0)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(28361833,5))
end
if vt>=3 then
--battle indes
local e1=Effect.CreateEffect(c)
......
......@@ -59,7 +59,7 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(3000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
if Duel.GetFlagEffect(tp,m)>1 then
if Duel.GetFlagEffect(tp,m)>1 or c:GetOverlayGroup():IsExists(Card.IsCode,1,nil,40020005) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
......
......@@ -54,7 +54,7 @@ end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and aux.NegateAnyFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
if Duel.GetFlagEffect(tp,m)>1 then
if Duel.GetFlagEffect(tp,m)>1 or c:GetOverlayGroup():IsExists(Card.IsCode,1,nil,40020005) then
ct=3
else
ct=1
......
......@@ -65,7 +65,7 @@ function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,cm.mtfilter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,1,e:GetHandler(),e)
if g:GetCount()>0 then
Duel.Overlay(c,g)
if Duel.GetFlagEffect(tp,m)>1 and e:GetHandler():IsAttackable() then
if (Duel.GetFlagEffect(tp,m)>1 or c:GetOverlayGroup():IsExists(Card.IsCode,1,nil,40020005)) and e:GetHandler():IsAttackable() then
if not c:IsAttackable() or not c:IsRelateToEffect(e) then return end
value=c:GetAttack()
ef=c:IsHasEffect(EFFECT_DEFENSE_ATTACK)
......
......@@ -69,7 +69,7 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local gh=Duel.GetDecktopGroup(tp,1)
local gc=gh:GetFirst()
local type=bit.band(gc:GetType(),0x7)
if Duel.GetFlagEffect(tp,m)>1 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 and gc:IsAbleToHand() then
if (Duel.GetFlagEffect(tp,m)>1 or c:GetOverlayGroup():IsExists(Card.IsCode,1,nil,40020005) ) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 and gc:IsAbleToHand() then
Duel.BreakEffect()
--Duel.ConfirmDecktop(p,2)
if Duel.SendtoHand(gc,nil,REASON_EFFECT)~=0 then
......
......@@ -78,7 +78,7 @@ function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
rct=rct+1
loc=loc+LOCATION_HAND
end
if Duel.GetFlagEffect(tp,m)>1 then
if Duel.GetFlagEffect(tp,m)>1 or c:GetOverlayGroup():IsExists(Card.IsCode,1,nil,40020005) then
Duel.SetChainLimit(cm.chlimit)
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
......
--朱斯贝克·反抗黎骑·晃临
local m=40020000
local cm=_G["c"..m]
cm.named_with_Rebellionform=1
cm.named_with_Youthberk=1
function cm.initial_effect(c)
aux.AddCodeList(c,40010499)
-- 【基础设置】允许XYZ召唤,素材为3只8星怪兽
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,8,3)
-- 【①效果】这张卡XYZ召唤成功时发动
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.xcon) -- 仅XYZ召唤时发动
e1:SetCost(cm.xcost) -- 取除素材
e1:SetTarget(cm.xtg) -- 设置效果
e1:SetOperation(cm.xop) -- 执行效果
c:RegisterEffect(e1)
-- 【②效果】这张卡作为素材时被送去墓地,不送去墓地而除外
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(cm.rmcon) -- 仅当是素材状态
e2:SetValue(LOCATION_REMOVED) -- 改为除外
c:RegisterEffect(e2)
end
--【①效果条件】XYZ召唤的场合才发动
function cm.xcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
--【①效果成本】取除素材,同时判断可发动的效果数量
function cm.xcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetHandler():GetOverlayCount()
if chk==0 then return ct>0 end
local maxct=math.min(3,ct)
-- 先移除1张素材
Duel.RemoveOverlayCard(tp,tp,1,1,REASON_COST)
-- 检查除外区是否存在同名卡,决定效果次数
local ex_ct=0
local g=Duel.GetMatchingGroup(aux.FilterFaceupFunction(Card.IsCode,m),tp,LOCATION_REMOVED,0,nil)
if #g>0 then
ex_ct=maxct -- 有同名卡 → 可发动取除数量个效果
else
ex_ct=1 -- 否则只选1个效果
end
e:SetLabel(ex_ct) -- 保存可选效果次数
end
--【检索可特召的怪兽】烈光之骑士 朱斯或记述它的卡
function cm.spfilter(c,e,tp)
return (c:IsCode(40010499) or aux.IsCodeListed(c,40010499))
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
--【①效果目标设置】(这里只是通用处理)
function cm.xtg(e,tp,eg,ep,ev,re,r,rp,chk)
local opt=e:GetLabel()
if chk==0 then return true end
Duel.SetOperationInfo(0,0,nil,opt,0,0) -- 表示会发动 opt 次效果
end
--【①效果操作】
function cm.xop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
local options={}
-- 效果1:破坏场上卡
if Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then
table.insert(options,1)
end
-- 效果2:特召烈光之骑士 朱斯或记述其卡
if Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK,0,1,nil,e,tp) then
table.insert(options,2)
end
-- 效果3:倍伤(无条件可用)
table.insert(options,3)
-- 连续选ct次效果
for i=1,ct do
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,4))
local sel=Duel.AnnounceNumber(tp,table.unpack(options))
if sel==1 then
-- 选择并破坏场上卡
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
elseif sel==2 then
-- 特召指定卡
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
elseif sel==3 then
-- 倍伤效果
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(function(e,re,val,r,rp,rc) return val*2 end)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
-- 倍效果伤害
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e2:SetCondition(function(e,re,val,r,rp,rc) return true end)
Duel.RegisterEffect(e2,tp)
end
end
end
--【②效果条件】必须是作为素材状态时
function cm.rmcon(e)
return e:GetHandler():IsLocation(LOCATION_OVERLAY)
end
--朱斯贝克·天坠黎骑·再锻
local m=40020005
local cm=_G["c"..m]
cm.named_with_Youthberk=1
function cm.Rebellionform(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Rebellionform
end
function cm.Skyform(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Skyform
end
function cm.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,cm.mfilter,cm.xyzcheck,2,2)
--code
aux.EnableChangeCode(c,40010501,LOCATION_MZONE+LOCATION_GRAVE)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_SPSUMMON,TIMING_BATTLE_START)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.mfilter(c,xyzc)
return c:IsLevelAbove(2) and not c:IsLevel(1,3,5,7,9,11)
end
function cm.xyzcheck(g)
return g:GetClassCount(Card.GetLevel)==1
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
if Duel.GetTurnPlayer()==1-tp then
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
else
return (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
end
end
function cm.spfilter(c,e,tp,mc)
return (cm.Rebellionform(c) or cm.Skyform(c)) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local sc=g:GetFirst()
if sc then
local mg=c:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(c))
Duel.Overlay(sc,Group.FromCards(c))
if Duel.SpecialSummonStep(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)~=0 then
sc:CompleteProcedure()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.op1con)
e1:SetOperation(cm.op1op)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY)
e1:SetLabelObject(c)
sc:RegisterEffect(e1)
end
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
Duel.SpecialSummonComplete()
end
end
end
function cm.op1con(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetFlagEffect(m)>0
end
function cm.op1op(e,tp,eg,ep,ev,re,r,rp)
local sc=e:GetLabelObject()
local c=e:GetHandler()
if not c:GetOverlayGroup():IsContains(sc) then return end
if Duel.SendtoDeck(sc,tp,0,REASON_EFFECT)>0 and sc:IsLocation(LOCATION_EXTRA) then
if not aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if not (c:IsFaceup() and not c:IsImmuneToEffect(e)) then return end
local mg=c:GetOverlayGroup()
if mg:GetCount()>0 then Duel.Overlay(sc,mg) end
sc:SetMaterial(Group.FromCards(c))
Duel.Overlay(sc,Group.FromCards(c))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
--忧愁之烈光 朱斯
local m=40020007
local cm=_G["c"..m]
function cm.initial_effect(c)
-- 指定记述卡:「烈光之骑士 朱斯」
aux.AddCodeList(c,40010499)
--①:手卡特召或重叠为素材
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--②:召唤/特召成功时 → 立即进行超量召唤
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m+1) -- 与①效果分开计数
e2:SetTarget(cm.xytg)
e2:SetOperation(cm.xyop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--③:作为超量素材送墓 → 检索魔陷
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,m+2)
e4:SetCondition(cm.thcon)
e4:SetTarget(cm.thtg)
e4:SetOperation(cm.thop)
c:RegisterEffect(e4)
end
--①效果:场上有超量怪兽存在才能发动
function cm.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
-- 可选择:特召 or 重叠
if chk==0 then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
or Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_MZONE,0,1,nil,TYPE_XYZ)
end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
local b2=Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_MZONE,0,1,nil,TYPE_XYZ)
if not (b1 or b2) then return end
local opt=0
if b1 and b2 then
opt=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4)) -- 选1:特召,2:重叠
elseif b1 then
opt=0
else
opt=1
end
if opt==0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,Card.IsType,tp,LOCATION_MZONE,0,1,1,nil,TYPE_XYZ)
if #g>0 then
Duel.Overlay(g:GetFirst(),Group.FromCards(c))
end
end
end
--②效果:召唤/特召成功时 → 用场上的怪兽进行XYZ召唤
function cm.xytg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(aux.XyzSummonableMonsterFilter(nil,nil),tp,LOCATION_EXTRA,0,1,nil,nil,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.xyop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.GetMatchingGroup(aux.XyzSummonableMonsterFilter(nil,nil),tp,LOCATION_EXTRA,0,nil,nil,tp)
if #g==0 then return end
local xyz=g:Select(tp,1,1,nil):GetFirst()
if xyz then
Duel.XyzSummon(tp,xyz,nil)
end
end
--③效果:超量素材送墓 → 检索记述“烈光之骑士 朱斯”的魔陷
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_COST+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_OVERLAY)
end
function cm.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
and aux.IsCodeListed(c,40010499)
and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--冰刃血解
local m=40020015
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DAMAGE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetOperation(cm.endop)
c:RegisterEffect(e3)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and bit.band(r,REASON_EFFECT)~=0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ph=Duel.GetCurrentPhase()
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
local ph=Duel.GetCurrentPhase()
if tp~=Duel.GetTurnPlayer() and ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,m,nil,TYPES_EFFECT_TRAP_MONSTER,2000,2000,4,RACE_MACHINE,ATTRIBUTE_LIGHT,POS_FACEUP) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
c:AddMonsterAttribute(TYPE_EFFECT)
Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,true,false,POS_FACEUP)
end
end
function cm.endop(e,tp,eg,ep,ev,re,r,rp)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1)
end
\ No newline at end of file
--翼神机 辉煌沃登
local m=40020016
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m)
e3:SetCode(EVENT_CHAINING)
e3:SetCondition(cm.discon)
e3:SetTarget(cm.distg)
e3:SetOperation(cm.disop)
c:RegisterEffect(e3)
--disable attack
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m+1)
e4:SetCondition(cm.atkcon)
e4:SetTarget(cm.atktg)
e4:SetOperation(cm.atkop)
c:RegisterEffect(e4)
end
function cm.spfilter(c,tp)
return c:IsRace(RACE_MACHINE) and c:IsLevelAbove(5)
and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.CheckReleaseGroupEx(tp,cm.spfilter,1,REASON_SPSUMMON,false,nil,tp)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetReleaseGroup(tp,false,REASON_SPSUMMON):Filter(cm.spfilter,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Release(g,REASON_SPSUMMON)
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and ep~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetAttacker()
if chkc then return chkc==tc end
if chk==0 then return tc:IsLocation(LOCATION_MZONE) and tc:IsAttackPos()
and tc:IsCanChangePosition() and tc:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tc)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsRelateToEffect(e) and Duel.NegateAttack() and Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--终焉之骑神 拉古纳罗克
local m=40020019
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--material
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsRace,RACE_MACHINE),aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_WIND),true)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--②
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+1)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function cm.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(cm.thfilter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.thfilter,tp,0,LOCATION_ONFIELD,nil)
local ct=Duel.SendtoHand(g,nil,REASON_EFFECT)
local c=e:GetHandler()
if ct>0 and c:GetMaterial():IsExists(Card.IsCode,1,nil,40020021) then
Duel.BreakEffect()
Duel.Draw(tp,ct,REASON_EFFECT)
end
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,math.min(3,ft),nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--铁骑皇 伊格德拉西尔
local m=40020021
local cm=_G["c"..m]
function cm.initial_effect(c)
--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_GRAVE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetRange(LOCATION_HAND+LOCATION_MZONE)
e2:SetCountLimit(1,m+1)
e2:SetCost(cm.xncost)
e2:SetOperation(cm.xnop)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,m+2)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
function cm.spfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsDiscardable()
end
function cm.spcon(e,c)
if c==nil then return true end
if c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
local tp=c:GetControler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND,0,nil)
if not c:IsAbleToGraveAsCost() or Duel.IsPlayerAffectedByEffect(tp,EFFECT_NECRO_VALLEY) then
g:RemoveCard(c)
end
return g:CheckWithSumGreater(Card.GetLevel,5)
end
function cm.fselect(g)
Duel.SetSelectedCard(g)
return g:CheckWithSumGreater(Card.GetLevel,5)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND,0,nil)
if not c:IsAbleToGraveAsCost() or Duel.IsPlayerAffectedByEffect(tp,EFFECT_NECRO_VALLEY) then
g:RemoveCard(c)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local sg=g:SelectSubGroup(tp,cm.fselect,true,1,g:GetCount())
if sg then
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 sg=e:GetLabelObject()
Duel.SendtoGrave(sg,REASON_SPSUMMON+REASON_DISCARD)
sg:DeleteGroup()
end
function cm.xncost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.xnop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_MACHINE))
e1:SetValue(cm.efilter)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
end
function cm.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer() and re:IsActivated()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
\ No newline at end of file
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
local custom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,id,{EVENT_SUMMON_SUCCESS,EVENT_SPSUMMON_SUCCESS})
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(custom_code)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.con)
e1:SetCost(s.cost)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
s.zero_seal_effect=e1
SNNM.zero_seal_check(id,e1)
end
function s.filter(c,tp)
return c:IsAttackAbove(2000) and c:IsSummonPlayer(tp)
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.filter,1,nil,1-tp)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() end
if Duel.SendtoGrave(c,REASON_COST)>0 and c:IsLocation(LOCATION_GRAVE) then c:RegisterFlagEffect(53797644,RESET_EVENT+RESETS_STANDARD,0,1) end
end
function s.tdfilter(c)
return c:IsFaceup() and not c:IsStatus(STATUS_LEAVE_CONFIRMED)
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.tdfilter,tp,0,LOCATION_ONFIELD,nil)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 and eg:IsExists(s.filter,1,nil,1-tp) and #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id)<=0 then
Duel.RegisterFlagEffect(tp,id,0,0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(1-tp,s.tdfilter,1-tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,2,REASON_RULE)
end
e:GetHandler():SetFlagEffectLabel(53797644,1)
end
end
s.category=CATEGORY_RECOVER
function s.extg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,1-tp,2000)
end
function s.exop(e,tp)
Duel.Recover(1-tp,2000,REASON_EFFECT)
end
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
local custom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,id,{EVENT_SUMMON,EVENT_SPSUMMON})
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(custom_code)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.con)
e1:SetCost(s.cost)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
s.zero_seal_effect=e1
SNNM.zero_seal_check(id,e1,2)
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep and #eg==1 and aux.NegateSummonCondition()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() end
if Duel.SendtoGrave(c,REASON_COST)>0 and c:IsLocation(LOCATION_GRAVE) then c:RegisterFlagEffect(53797644,RESET_EVENT+RESETS_STANDARD,0,1) end
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 and Duel.IsPlayerCanRemove(tp) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,eg:GetCount(),0,0)
end
function s.filter(c,e,tp,att)
return c:GetAttribute()~=att and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id)<=0 then
Duel.RegisterFlagEffect(tp,id,0,0,0)
local att=eg:GetFirst():GetAttribute()
Duel.NegateSummon(eg)
if Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)>0 and eg:GetFirst():IsLocation(LOCATION_REMOVED) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp,att) and Duel.SelectYesNo(1-tp,aux.Stringid(id,4)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(1-tp,s.spfilter,1-tp,LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,1-tp,1-tp,false,false,POS_FACEUP)
end
e:GetHandler():SetFlagEffectLabel(53797644,1)
end
end
s.category=CATEGORY_DAMAGE
function s.extg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,2000)
end
function s.exop(e,tp)
Duel.Damage(tp,2000,REASON_EFFECT)
end
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
local custom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,id,EVENT_SPSUMMON_SUCCESS)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(custom_code)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.con)
e1:SetCost(s.cost)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
s.zero_seal_effect=e1
SNNM.zero_seal_check(id,e1,2)
end
function s.cfilter(c,e,tp)
local se,sp=c:GetSpecialSummonInfo(SUMMON_INFO_REASON_EFFECT,SUMMON_INFO_REASON_PLAYER)
return se and sp~=tp and se:IsActivated() and e:GetOwnerPlayer()~=se:GetOwnerPlayer()
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,e,tp)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() end
if Duel.SendtoGrave(c,REASON_COST)>0 and c:IsLocation(LOCATION_GRAVE) then c:RegisterFlagEffect(53797644,RESET_EVENT+RESETS_STANDARD,0,1) end
end
function s.filter(c,tp)
return c:IsControler(1-tp) and c:IsControlerCanBeChanged()
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(s.filter,1,nil,tp) end
local g=eg:Filter(s.filter,nil,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,#g,0,0)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id)<=0 then
Duel.RegisterFlagEffect(tp,id,0,0,0)
local tc=SNNM.Select_1(Duel.GetTargetsRelateToChain():Filter(Card.IsControler,nil,1-tp),tp,HINTMSG_CONTROL)
Duel.NegateSummon(eg)
if tc then Duel.GetControl(tc,tp,PHASE_END,1) end
e:GetHandler():SetFlagEffectLabel(53797644,1)
end
end
s.category=CATEGORY_DESTROY
function s.extg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_HAND)
end
function s.exop(e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,1,nil)
if #g>0 then Duel.Destroy(g,REASON_EFFECT) end
end
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.con)
e1:SetCost(s.cost)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
s.zero_seal_effect=e1
SNNM.zero_seal_check(id,e1,3)
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() end
if Duel.SendtoGrave(c,REASON_COST)>0 and c:IsLocation(LOCATION_GRAVE) then c:RegisterFlagEffect(53797644,RESET_EVENT+RESETS_STANDARD,0,1) end
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id)<=0 then
Duel.RegisterFlagEffect(tp,id,0,0,0)
local c=e:GetHandler()
local g=Group.CreateGroup()
g:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_MOVE)
e1:SetCondition(s.regcon)
e1:SetOperation(s.regop)
e1:SetLabelObject(g)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetCondition(s.tgcon)
e2:SetOperation(s.tgop)
e2:SetLabelObject(g)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
e:GetHandler():SetFlagEffectLabel(53797644,1)
end
end
function s.cfilter(c)
return c:IsPreviousLocation(LOCATION_DECK) and not c:IsLocation(LOCATION_DECK+LOCATION_GRAVE)
end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(s.cfilter,nil)
g:ForEach(Card.RegisterFlagEffect,id+500,RESET_EVENT+RESETS_STANDARD,0,1)
e:GetLabelObject():Merge(g)
end
function s.filter(c)
return c:GetFlagEffect(id+500)>0 and c:IsAbleToGrave()
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():FilterCount(s.filter,nil)>0
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local sg=g:Filter(s.filter,nil)
if #sg==0 then return end
Duel.Hint(HINT_CARD,0,id)
Duel.SendtoGrave(sg,REASON_EFFECT)
g:DeleteGroup()
end
s.category=CATEGORY_RELEASE
function s.rlfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsReleasableByEffect()
end
function s.extg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.rlfilter,tp,LOCATION_HAND,0,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,g,1,0,0)
end
function s.exop(e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,s.rlfilter,tp,LOCATION_HAND,0,1,1,nil)
if #g>0 then Duel.Release(g,REASON_EFFECT) end
end
......@@ -67,7 +67,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetCategory(CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetLabel(Duel.GetCurrentChain())
e1:SetLabel(Duel.GetCurrentChain()-1)
e1:SetOperation(cm.op)
Duel.RegisterEffect(e1,tp)
end
......
--永夜抄 月见草
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetCondition(cm.handcon)
c:RegisterEffect(e2)
end
function cm.filter(c)
return c:IsSetCard(0x3620) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
--Debug.Message("1")
if e:GetLabel()==2 then
--Debug.Message("2")
local cg=e:GetLabelObject()
if cg then Duel.Destroy(cg,REASON_EFFECT) end
--Duel.ConfirmCards(tp,cg)
end
end
end
function cm.handcon(e)
return Duel.IsExistingMatchingCard(cm.hcfil,e:GetHandlerPlayer(),LOCATION_HAND,0,1,nil)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetTurnPlayer()==tp or Duel.IsExistingMatchingCard(cm.hcfil,tp,LOCATION_HAND,0,1,nil) end
if Duel.GetTurnPlayer()==tp then
e:SetLabel(1)
else
e:SetLabel(2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.GetMatchingGroup(cm.hcfil,tp,LOCATION_HAND,0,nil):Select(tp,1,1,nil)
if g then
e:SetLabelObject(g)
g:KeepAlive()
Duel.ConfirmCards(1-tp,g)
end
end
end
function cm.hcfil(c)
return c:IsSetCard(0x3620) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
\ No newline at end of file
......@@ -60,11 +60,12 @@ function s.setfilter(c)
return c:IsSetCard(0x836) and c:IsSSetable()
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.setfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_GRAVE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local ct=math.min((Duel.GetLocationCount(tp,LOCATION_SZONE)),2)
local g=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,ct,nil)
local g=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,ct,c)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -20,7 +20,7 @@ function c67201135.initial_effect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK+CATEGORY_DRAW)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CUSTOM+67201135)
e3:SetCode(EVENT_DRAW)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(c67201135.opcon)
......@@ -94,7 +94,7 @@ end
--
function c67201135.opcon(e,tp,eg,ep,ev,re,r,rp)
return (ev==PLAYER_ALL or ev==tp or ev==1-tp) and not eg:IsContains(e:GetHandler())
return not eg:IsContains(e:GetHandler())
end
function c67201135.filter2(c)
return c:IsAbleToDeck()
......
......@@ -23,6 +23,17 @@ function c71000171.initial_effect(c)
e12:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e12:SetCondition(c71000171.spcon)
c:RegisterEffect(e12)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetAbsoluteRange(tp,1,0)
e4:SetTarget(c71000171.splimit)
c:RegisterEffect(e4)
end
function c71000171.splimit(e,c)
return not c:IsRace(RACE_SPELLCASTER)
end
function c71000171.f(c)
return c:IsAbleToHand() and c:IsSetCard(0xe73)
......
......@@ -26,7 +26,7 @@ function c71000173.initial_effect(c)
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(1,0)
e4:SetAbsoluteRange(tp,1,0)
e4:SetTarget(c71000173.splimit)
c:RegisterEffect(e4)
end
......
function c71000174.initial_effect(c)
c:SetSPSummonOnce(71000174)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c71000174.mfilter,1,1)
--效果②
......@@ -14,9 +14,11 @@ function c71000174.initial_effect(c)
e2:SetTarget(c71000174.drtg)
e2:SetOperation(c71000174.drop)
c:RegisterEffect(e2)
--get effect
end
--get effect
--===== 效果①处理 =====--
function c71000174.mfilter(c)
return c:IsLinkSetCard(0xe73)
......
......@@ -25,6 +25,17 @@ function c71000175.initial_effect(c)
e3:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetAbsoluteRange(tp,1,0)
e4:SetTarget(c71000175.splimit)
c:RegisterEffect(e4)
end
function c71000175.splimit(e,c)
return not c:IsRace(RACE_SPELLCASTER)
end
--===== 效果①处理 =====--
......
......@@ -13,12 +13,19 @@ function c71000176.initial_effect(c)
e1:SetOperation(c71000176.op)
c:RegisterEffect(e1)
--2
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,LOCATION_MZONE)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c71000176.target)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e4:SetValue(c71000176.atklimit)
c:RegisterEffect(e4)
--3
local e12=Effect.CreateEffect(c)
......@@ -30,9 +37,21 @@ function c71000176.initial_effect(c)
e12:SetRange(LOCATION_GRAVE)
e12:SetCondition(c71000176.spcon)
c:RegisterEffect(e12)
local e41=Effect.CreateEffect(c)
e41:SetType(EFFECT_TYPE_FIELD)
e41:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e41:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e41:SetRange(LOCATION_MZONE)
e41:SetAbsoluteRange(tp,1,0)
e41:SetTarget(c71000176.splimit)
c:RegisterEffect(e41)
end
function c71000176.splimit(e,c)
return not c:IsRace(RACE_SPELLCASTER)
end
--1
function c71000176.f(c)
return c:IsAbleToHand() and c:IsSetCard(0xe73)
end
......@@ -49,9 +68,10 @@ function c71000176.op(e,tp,eg,ep,ev,re,r,rp)
end
end
--2
function c71000176.atklimit(e,c)
return c:IsFaceup() and not c:IsCode(71000176) and c:IsRace(RACE_SPELLCASTER)
function c71000176.target(e,c)
return c:IsCode(71000100) and c:IsFaceup()
end
--3
function c71000176.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xe73) and c:IsType(TYPE_MONSTER)
......
--七仟陌
local s,id,o=GetID()
function s.initial_effect(c)
function c71000177.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),7,3,s.ovfilter,aux.Stringid(id,0),3,s.xyzop)
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),7,3,c71000177.ovfilter,aux.Stringid(id,0),3,c71000177.xyzop)
c:EnableReviveLimit()
--macro cosmos
local e22=Effect.CreateEffect(c)
......@@ -10,52 +9,63 @@ function s.initial_effect(c)
e22:SetType(EFFECT_TYPE_IGNITION)
e22:SetRange(LOCATION_MZONE)
e22:SetCountLimit(1)
e22:SetCost(s.cost)
e22:SetTarget(s.tg)
e22:SetOperation(s.op)
e22:SetCost(c71000177.cost)
e22:SetTarget(c71000177.tg)
e22:SetOperation(c71000177.op)
c:RegisterEffect(e22)
--material
aux.EnableChangeCode(c,71000100,LOCATION_MZONE)
--remove
--
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,c71000177.chainfilter)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetAbsoluteRange(tp,1,0)
e4:SetTarget(c71000177.splimit)
c:RegisterEffect(e4)
end
function s.chainfilter(re,tp,cid)
function c71000177.splimit(e,c)
return not c:IsRace(RACE_SPELLCASTER)
end
function c71000177.chainfilter(re,tp,cid)
return not re:GetHandler():IsCode(71000175)
end
function s.ovfilter(c)
function c71000177.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0xe73)
end
function s.xyzop(e,tp,chk)
function c71000177.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0
and (Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)>0
or Duel.GetCustomActivityCount(id,1-tp,ACTIVITY_CHAIN)>0) end
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
function c71000177.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
local rt=Duel.GetFieldGroupCount(tp,LOCATION_GRAVE+LOCATION_REMOVED,0)
local ct=c:RemoveOverlayCard(tp,1,rt,REASON_COST)
e:SetLabel(ct)
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c71000177.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,e:GetLabel(),0,0)
end
function s.stfilter(c)
function c71000177.stfilter(c)
return c:IsSetCard(0xe73) and c:IsSSetable()
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
function c71000177.op(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,ct,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,CATEGORY_TODECK,REASON_EFFECT)
local st=Duel.GetMatchingGroup(s.stfilter,tp,LOCATION_DECK,0,nil)
local st=Duel.GetMatchingGroup(c71000177.stfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
......
......@@ -16,7 +16,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_DECK)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
......@@ -27,7 +27,8 @@ function s.initial_effect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
--e2:SetCode(EVENT_TO_GRAVE)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_REMOVED)
e2:SetCountLimit(1,id+o)
......@@ -61,8 +62,12 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function s.desfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsType,1,nil,TYPE_MONSTER)
--return eg:IsExists(Card.IsType,1,nil,TYPE_MONSTER)
return eg:IsExists(s.desfilter,1,nil)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) end
......
......@@ -12,7 +12,7 @@ function s.initial_effect(c)
--disable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_NEGATE)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
......@@ -48,21 +48,24 @@ end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.tfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.tfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsChainDisablable(ev) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.tfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,s.tfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if Duel.NegateEffect(ev) and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
Duel.BreakEffect()
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
--[[local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,10))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_DECKBOT)
tc:RegisterEffect(e1)
tc:RegisterEffect(e1)]]
end
end
function s.cfilter(c)
......@@ -70,20 +73,20 @@ function s.cfilter(c)
end
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.cfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.cfilter,tp,LOCATION_MZONE,0,1,nil) end
if chk==0 then return Duel.IsExistingTarget(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SelectTarget(tp,s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,9))
e1:SetDescription(aux.Stringid(id,10))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_HAND)
e1:SetValue(LOCATION_DECKBOT)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -116,7 +119,7 @@ function s.regop(e,tp,eg,ep,ev,re,r,rp)
for _,te in pairs(rde) do
f=te:GetValue()
end
if not (bit.band(f,LOCATION_HAND+LOCATION_EXTRA)~=0 --tc:IsLocation(LOCATION_HAND+LOCATION_EXTRA)
if not (bit.band(f,LOCATION_HAND|LOCATION_DECKBOT|LOCATION_EXTRA|LOCATION_DECK|LOCATION_DECKSHF)~=0 --tc:IsLocation(LOCATION_HAND+LOCATION_EXTRA)
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)) then return end
Duel.RegisterFlagEffect(0,id,0,0,1)
Duel.Hint(HINT_CARD,0,id)
......
......@@ -37,7 +37,9 @@ function s.initial_effect(c)
c:RegisterEffect(e3)
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
local loc=e:GetHandler():GetPreviousLocation()
return loc&(LOCATION_DECK)==0
--return not e:GetHandler():IsReason(REASON_DRAW)
end
function s.tgfilter(c)
return s.ArtlienWorm(c) and c:IsAbleToGrave()
......
......@@ -14,7 +14,7 @@ function s.initial_effect(c)
e1:SetHintTiming(TIMING_END_PHASE,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetDescription(aux.Stringid(id,0))
--e1:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
......@@ -40,20 +40,20 @@ end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.tgfilter(chkc) end
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGrave() and Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
if chk==0 then return --and Duel.IsPlayerCanDraw(tp,1) and
Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tc=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst()
--Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,Group.FromCards(tc,c),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,Group.FromCards(tc,c),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
--Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.spfilter(c,e,tp)
return s.ArtlienWorm(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (c:IsLocation(LOCATION_DECK) and Duel.GetMZoneCount(tp)>0 or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,1,REASON_EFFECT)==0 then return end
--if Duel.Draw(tp,1,REASON_EFFECT)==0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local g=Group.FromCards(tc,c)
......
......@@ -25,7 +25,7 @@ function s.initial_effect(c)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetType(EFFECT_TYPE_QUICK_F)
e2:SetCode(EVENT_BECOME_TARGET)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
......@@ -62,14 +62,16 @@ function s.thfilter(c)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
if chk==0 then return true
--Duel.IsExistingTarget(s.thfilter,tp,LOCATION_REMOVED,0,1,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
if tc and tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,7))
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -171,7 +173,7 @@ function s.LExtraMaterialCount(mg,lc,tp)
local le={tc:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL,tp)}
local Not_LExtra=true
for _,te in pairs(le) do
local sg=mg:Filter(aux.TRUE,tc)
local sg=mg:Filter(s.TRUE,tc)
local f=te:GetValue()
local related,valid=f(te,lc,sg,tc,tp)
if related and valid then
......
......@@ -164,7 +164,7 @@ function s.LExtraMaterialCount(mg,lc,tp)
local le={tc:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL,tp)}
local Not_LExtra=true
for _,te in pairs(le) do
local sg=mg:Filter(aux.TRUE,tc)
local sg=mg:Filter(s.TRUE,tc)
local f=te:GetValue()
local related,valid=f(te,lc,sg,tc,tp)
if related and valid then
......
......@@ -12,7 +12,7 @@ function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--to grave&public
--[[--to grave&public
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
......@@ -22,8 +22,8 @@ function s.initial_effect(c)
e1:SetCost(s.tgcost)
e1:SetTarget(s.tgtg)
e1:SetOperation(s.tgop)
c:RegisterEffect(e1)
--to hand
c:RegisterEffect(e1)]]
--[[--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
......@@ -34,8 +34,149 @@ function s.initial_effect(c)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)]]
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCost(s.cost)
e1:SetTarget(s.remtg)
e1:SetOperation(s.remop)
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)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_CUSTOM+id)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
--
if not s.global_effect then
s.global_effect=true
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetCondition(s.trcon)
e3:SetOperation(s.trop)
Duel.RegisterEffect(e3,0)
end
end
function s.rmcfilter(c)
return s.ArtlienWorm(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.rmcfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.rmcfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,LOCATION_HAND)
end
function s.remop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0)
if g:GetCount()==0 or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local rs=g:RandomSelect(1-tp,1)
if Duel.Remove(rs,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local fid=c:GetFieldID()
local og=Duel.GetOperatedGroup()
local oc=og:GetFirst()
while oc do
oc:RegisterFlagEffect(id+o,RESET_EVENT+RESETS_STANDARD,0,1,fid)
oc=og:GetNext()
end
c:RegisterFlagEffect(id+o,RESET_EVENT+RESET_TURN_SET+RESET_OVERLAY+RESET_TOFIELD,0,1,fid)
og:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetLabel(fid)
e1:SetLabelObject(og)
e1:SetCondition(s.retcon)
e1:SetOperation(s.retop)
Duel.RegisterEffect(e1,tp)
end
end
function s.retfilter(c,fid)
return c:GetFlagEffectLabel(id+o)==fid
end
function s.retcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetOwner()
--Debug.Message("0")
if not s.retfilter(c,e:GetLabel()) then
e:Reset()
--Debug.Message("1")
return false
end
return eg:IsContains(c)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local rg=e:GetLabelObject()
--Debug.Message("2")
if #rg>0 and s.retfilter(rg:GetFirst(),e:GetLabel()) then
local rc=rg:GetFirst()
--Debug.Message("3")
Duel.SendtoHand(rc,rc:GetPreviousControler(),REASON_EFFECT)
end
e:Reset()
end
function s.efilter(e,re)
if e:GetHandlerPlayer()~=re:GetOwnerPlayer() and re:IsActivated() then
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,4))
return true
end
return false
end
function s.efilter2(c)
return c:GetFlagEffect(id)>0
end
function s.trcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.efilter2,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function s.trop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.efilter2,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #g>0 then
for tc in aux.Next(g) do
tc:ResetFlagEffect(id)
Duel.RaiseSingleEvent(tc,EVENT_CUSTOM+id,e,0,0,0,0)
end
end
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 true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(Group.FromCards(tc,e:GetHandler()),REASON_EFFECT)
end
end
--
function s.tgfilter(c)
return s.ArtlienWorm(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
......
--迷途罪械 定罪者 S.O.D.A.
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(1168)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_MAIN_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.rcon)
e1:SetTarget(Auxiliary.RitualUltimateTarget(s.filter,Card.GetLevel,"Greater",LOCATION_HAND+LOCATION_GRAVE,nil,nil,s.extraop))
e1:SetOperation(Auxiliary.RitualUltimateOperation(s.filter,Card.GetLevel,"Greater",LOCATION_HAND+LOCATION_GRAVE,nil,nil,s.extraop))
e1:SetCountLimit(1,id)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetDescription(1118)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+1)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetLabel(id)
ge1:SetOperation(aux.sumreg)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
end
end
function s.rcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsMainPhase() and e:GetHandler():GetFlagEffect(id)>0
end
function s.filter(c,e,tp)
return c:IsRace(RACE_MACHINE)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x9a12) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.extraop(e,tp,eg,ep,ev,re,r,rp,tc,mat)
if not tc then return end
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if #g>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.cfilter1(c,tp)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_DARK) and Duel.GetMZoneCount(tp,c)>0 and (c:IsFaceup() or c:IsControler(tp))
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,s.cfilter1,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,s.cfilter1,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
\ No newline at end of file
--迷途罪械 展示者 T.S.U.
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(1191)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_RELEASE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sgtg)
e1:SetOperation(s.sgop)
c:RegisterEffect(e1)
--to hand or set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetCountLimit(1,id+1)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
local e2=e3:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function s.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() and c:IsSetCard(0x9a12)
end
function s.sgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.sgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function s.thfilter(c)
return (c:IsAbleToHand() or c:IsAbleToGrave()) and c:IsSetCard(0x9a12) and (c:IsType(TYPE_QUICKPLAY) or c:IsType(TYPE_TRAP))
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,0))
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if tc:IsAbleToHand() and (not tc:IsAbleToGrave() or Duel.SelectOption(tp,1190,1191)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
end
\ No newline at end of file
--迷途罪械 哀亡者 A.P.R
local s,id=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg1)
e1:SetOperation(s.thop1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(1110)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,id+1)
e3:SetTarget(s.gytg)
e3:SetOperation(s.gyop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(1113)
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE)
e4:SetHintTiming(TIMING_DAMAGE_STEP)
e4:SetCountLimit(1,id+2)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_CARD_TARGET)
e4:SetCost(aux.bfgcost)
e4:SetTarget(s.atktg)
e4:SetOperation(s.atkop)
c:RegisterEffect(e4)
end
function s.thfilter(c)
return c:IsSetCard(0x9a12) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function s.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.gyfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_DARK)
and not c:IsCode(id) and c:IsAbleToHand()
end
function s.gytg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.gyfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function s.gyop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.gyfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
if Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,tc)
if tc and tc:IsLocation(LOCATION_HAND)
and e:GetHandler():IsReason(REASON_RELEASE)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsFaceup() and chkc:IsLocation(LOCATION_MZONE) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1600)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_LEVEL)
e2:SetValue(4)
tc:RegisterEffect(e2)
end
end
\ No newline at end of file
--迷途罪械 指控者 T.T.W
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(1131)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(s.distg)
e1:SetOperation(s.disop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(1118)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_RELEASE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+1)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and aux.NegateAnyFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(s.tgcon)
e1:SetOperation(s.tgop)
Duel.RegisterEffect(e1,tp)
end
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(id)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(e:GetLabelObject(),REASON_EFFECT)
end
function s.cfilter(c,tp)
return c:IsRace(RACE_MACHINE)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x9a12) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--迷途罪械的迭代
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(1118)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,id)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(1153)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+1)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function s.filter(c,e,tp)
return c:IsSetCard(0x9a12) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
if Duel.GetFlagEffect(tp,id)==0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetTarget(s.efilter)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
end
end
function s.efilter(e,c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_DARK)
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) and Duel.SSet(tp,c) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--迷途罪械的有罪推定
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(1118)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(1118)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,id)
e4:SetCost(aux.bfgcost)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(function(c) return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_DARK) end,tp,LOCATION_MZONE,0,1,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(sg)
local tc=sg:GetFirst()
if tc and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_REMOVED) then
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e1:SetTarget(s.distg1)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetCondition(s.discon)
e2:SetOperation(s.disop)
e2:SetLabelObject(tc)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(s.distg2)
e3:SetLabelObject(tc)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
end
function s.distg1(e,c)
local tc=e:GetLabelObject()
if c:IsType(TYPE_SPELL+TYPE_TRAP) then
return c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
else
return c:IsOriginalCodeRule(tc:GetOriginalCodeRule()) and (c:IsType(TYPE_EFFECT) or c:GetOriginalType()&TYPE_EFFECT~=0)
end
end
function s.distg2(e,c)
local tc=e:GetLabelObject()
return c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return re:GetHandler():IsOriginalCodeRule(tc:GetOriginalCodeRule())
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x9a12) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
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_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.rcon)
e1:SetTarget(s.RitualUltimateTarget(s.filter,Card.GetLevel,"Greater",LOCATION_GRAVE,nil,nil,s.extraop))
e1:SetOperation(s.RitualUltimateOperation(s.filter,Card.GetLevel,"Greater",LOCATION_GRAVE,nil,nil,s.extraop))
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+1)
e2:SetCost(aux.bfgcost)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,s.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(1)
tc:RegisterEffect(e2)
end
end)
c:RegisterEffect(e2)
end
function s.atkfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
end
function s.rcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsMainPhase()
end
function s.filter(c,e,tp)
return c:IsRace(RACE_MACHINE)
end
function s.RitualUltimateTarget(filter,level_function,greater_or_equal,summon_location,grave_filter,mat_filter,extra_target)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsRace,nil,RACE_MACHINE)
if mat_filter then mg=mg:Filter(mat_filter,nil,e,tp,true) end
local exg=nil
if grave_filter then
exg=Duel.GetMatchingGroup(Auxiliary.RitualExtraFilter,tp,LOCATION_GRAVE,0,nil,grave_filter)
end
return Duel.IsExistingMatchingCard(Auxiliary.RitualUltimateFilter,tp,summon_location,0,1,nil,filter,e,tp,mg,exg,level_function,greater_or_equal,true)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,summon_location)
if grave_filter then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,tp,LOCATION_GRAVE)
end
if extra_target then
extra_target(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function s.RitualUltimateOperation(filter,level_function,greater_or_equal,summon_location,grave_filter,mat_filter,extra_operation)
return function(e,tp,eg,ep,ev,re,r,rp)
::RitualUltimateSelectStart::
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsRace,nil,RACE_MACHINE)
if mat_filter then mg=mg:Filter(mat_filter,nil,e,tp) end
local exg=nil
if grave_filter then
exg=Duel.GetMatchingGroup(Auxiliary.RitualExtraFilter,tp,LOCATION_GRAVE,0,nil,grave_filter)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,Auxiliary.NecroValleyFilter(Auxiliary.RitualUltimateFilter),tp,summon_location,0,1,1,nil,filter,e,tp,mg,exg,level_function,greater_or_equal)
local tc=tg:GetFirst()
local mat
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if exg then
mg:Merge(exg)
end
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local lv=level_function(tc)
Auxiliary.GCheckAdditional=Auxiliary.RitualCheckAdditional(tc,lv,greater_or_equal)
mat=mg:SelectSubGroup(tp,Auxiliary.RitualCheck,true,1,lv,tp,tc,lv,greater_or_equal)
Auxiliary.GCheckAdditional=nil
if not mat then goto RitualUltimateSelectStart end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
if extra_operation then
extra_operation(e,tp,eg,ep,ev,re,r,rp,tc,mat)
end
end
end
function s.extraop(e,tp,eg,ep,ev,re,r,rp,tc,mat)
if not tc then return end
local ct=mat:GetCount()
local g=Duel.GetMatchingGroup(function(c) return c:IsAbleToHand() and c:IsSetCard(0x9a12) and c:IsType(TYPE_MONSTER) end,tp,LOCATION_GRAVE,0,nil)
if #g>=ct and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,ct,ct,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
\ No newline at end of file
--迷途罪械 行刑者 N.N.Z.J
local s,id=GetID()
function s.initial_effect(c)
--spsummon rule
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,1))
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetRange(LOCATION_HAND)
e0:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e0:SetCondition(s.sprcon)
e0:SetTarget(s.sprtg)
e0:SetOperation(s.sprop)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_RELEASE+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetTarget(s.drtg)
e1:SetOperation(s.drop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(1190)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_RELEASE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+1)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
function s.cfilter(c,tp,f)
return f(c) and Duel.GetMZoneCount(tp,c)>0 and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_DARK)
end
function s.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,c,tp,Card.IsReleasable)
end
function s.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c,tp,Card.IsReleasable)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function s.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_SPSUMMON+REASON_RELEASE)
end
function s.drfilter(c)
return c:IsReleasable() and c:IsFaceup()
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and chkc~=e:GetHandler() and s.drfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.drfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectTarget(tp,s.drfilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_RELEASE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Release(tc,REASON_EFFECT)>0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function s.thfilter(c)
return c:GetType()==0x82 and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ 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_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c,e,tp)
return c:IsRace(RACE_MACHINE)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x9a12) and c:IsType(TYPE_MONSTER) and c:IsLevelAbove(1)
end
function s.mfilter(c)
return c:GetLevel()>0 and c:IsRace(RACE_MACHINE) and c:IsAbleToDeck()
end
function s.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_equal,chk)
local spg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil)
if spg then
spg=spg:Filter(Card.IsCanBeRitualMaterial,c,c)
end
if bit.band(c:GetType(),0x81)~=0x81 or (filter and not filter(c,e,tp,chk))
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
if m2 then
mg:Merge(m2)
end
if c.mat_filter then
mg=mg:Filter(c.mat_filter,c,tp)
else
mg:RemoveCard(c)
end
local lv=level_function(c)
local res=false
local tc=spg:GetFirst()
Auxiliary.GCheckAdditional=Auxiliary.RitualCheckAdditional(c,lv,greater_or_equal)
if not tc then
res=mg:CheckSubGroup(Auxiliary.RitualCheck,1,lv,tp,c,lv,greater_or_equal)
else
while tc do
mg:AddCard(tc)
if mg:CheckSubGroup(Auxiliary.RitualCheck,1,lv,tp,c,lv,greater_or_equal) then
return true
else
mg:RemoveCard(tc)
end
tc=spg:GetNext()
end
end
Auxiliary.GCheckAdditional=nil
return res
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(s.mfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
return Duel.IsExistingMatchingCard(s.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,s.filter,e,tp,mg1,mg2,s.GetLevel2,"Greater")
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,tp,LOCATION_GRAVE)
end
function s.GetLevel2(c)
return c:GetLevel()*2
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
::cancel::
local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.mfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,s.filter,e,tp,mg1,mg2,s.GetLevel2,"Greater")
local tc=g:GetFirst()
if tc then
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
mg:Merge(mg2)
local spg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil)
if spg then
spg=spg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
mg:Merge(spg)
end
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,s.GetLevel2(tc),"Greater")
local mat=mg:SelectSubGroup(tp,s.RitualCheck,true,1,s.GetLevel2(tc),tp,tc,s.GetLevel2(tc),"Greater")
aux.GCheckAdditional=nil
if not mat then goto cancel end
tc:SetMaterial(mat)
local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_GRAVE+LOCATION_REMOVED):Filter(Card.IsRace,nil,RACE_MACHINE)
if #mat2>0 then
Duel.HintSelection(mat2)
end
local mat3=mat:Filter(Card.IsLocation,nil,LOCATION_DECK)
if #mat3>0 then
Duel.HintSelection(mat3)
end
mat:Sub(mat2)
mat:Sub(mat3)
Duel.ReleaseRitualMaterial(mat)
Duel.SendtoGrave(mat3,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL+REASON_RELEASE)
Duel.SendtoDeck(mat2,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function s.RitualCheck(g,tp,c,lv,greater_or_equal)
local res=true
local tc=g:GetFirst()
local count=0
while tc do
if tc:IsLocation(LOCATION_DECK) then
count=count+1
end
if count>1 then
res=false
break
end
tc=g:GetNext()
end
return Auxiliary["RitualCheck"..greater_or_equal](g,c,lv)
and Duel.GetMZoneCount(tp,g,tp)>0 and (not c.mat_group_check or c.mat_group_check(g,tp))
and (not Auxiliary.RCheckAdditional or Auxiliary.RCheckAdditional(tp,g,c))
and res
end
--迷途罪械 被否决者 R.S.H.L
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--can only control 1
c:SetUniqueOnField(1,0,id)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_RELEASE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(s.negcon)
e4:SetTarget(s.negtg)
e4:SetOperation(s.negop)
c:RegisterEffect(e4)
--destroy all
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,1))
e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_MZONE)
e5:SetCost(s.descost)
e5:SetTarget(s.destg)
e5:SetOperation(s.desop)
c:RegisterEffect(e5)
end
function s.limitcon(e)
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,id),e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function s.limit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsCode(id)
end
function s.negcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp and Duel.IsChainNegatable(ev)
end
function s.negfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsReleasable()
end
function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
local exres=Duel.GetFlagEffect(tp,id)*2
if chk==0 then return Duel.IsExistingMatchingCard(s.negfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,exres+1,nil) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,exres+1,tp,LOCATION_HAND+LOCATION_MZONE)
end
function s.negop(e,tp,eg,ep,ev,re,r,rp)
local exres=Duel.GetFlagEffect(tp,id)*2
if not Duel.IsExistingMatchingCard(s.negfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,exres+1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,s.negfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,exres+1,nil)
if #g>0 and Duel.Release(g,REASON_EFFECT)>0 then
Duel.NegateActivation(ev)
Duel.RegisterFlagEffect(tp,id,RESET_EVENT+RESET_PHASE+PHASE_END,0,1)
end
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--零鸟姬 冰枪兵
function c98920776.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98920776,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,98920776)
e1:SetCost(c98920776.spcost)
e1:SetCondition(c98920776.spcon)
e1:SetTarget(c98920776.sptg)
e1:SetOperation(c98920776.spop)
c:RegisterEffect(e1)
--xyzlv
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_XYZ_LEVEL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c98920776.xyzlv)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(98920776,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetCondition(c98920776.atkcon)
e2:SetCost(c98920776.atkcost)
e2:SetOperation(c98920776.atkop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(98920776,ACTIVITY_SPSUMMON,c98920776.counterfilter)
end
function c98920776.xyzlv(e,c,rc)
return 0x50000+e:GetHandler():GetLevel()
end
function c98920776.counterfilter(c)
return not c:IsSummonLocation(LOCATION_EXTRA) or (c:IsType(TYPE_XYZ) and c:IsAttribute(ATTRIBUTE_WATER))
end
function c98920776.filter(c,e,tp)
return c:IsRace(RACE_WINDBEAST) and c:IsAttribute(ATTRIBUTE_WATER) and not c:IsCode(98920776) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c98920776.cfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER)
end
function c98920776.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c98920776.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c98920776.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(98920776,tp,ACTIVITY_SPSUMMON)==0 end
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:SetTargetRange(1,0)
e1:SetTarget(c98920776.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c98920776.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsAttribute(ATTRIBUTE_WATER) and c:IsType(TYPE_XYZ)) and c:IsLocation(LOCATION_EXTRA)
end
function c98920776.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c98920776.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function c98920776.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c98920776.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
g:AddCard(e:GetHandler())
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c98920776.atkcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
if ph~=PHASE_DAMAGE or Duel.IsDamageCalculated() then return false end
local tc=Duel.GetAttacker()
if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end
e:SetLabelObject(tc)
return tc and tc:IsFaceup() and tc:IsSummonLocation(LOCATION_EXTRA) and tc:IsAttribute(ATTRIBUTE_WATER) and tc:IsRelateToBattle() and Duel.GetAttackTarget()~=nil
end
function c98920776.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c98920776.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:IsRelateToBattle() and tc:IsFaceup() and tc:IsControler(tp) then
local atk=tc:GetBaseAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
--水灵术解放
function c98920865.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(c98920865.condition1)
e1:SetTarget(c98920865.target1)
e1:SetOperation(c98920865.activate1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
--act in hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(98920865,0))
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e4:SetCondition(c98920865.handcon)
c:RegisterEffect(e4)
--SSet
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_CHAINING)
e2:SetCountLimit(1,98920865)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c98920865.setcon)
e2:SetTarget(c98920865.settg)
e2:SetOperation(c98920865.setop)
c:RegisterEffect(e2)
end
function c98920865.cfilter(c)
return c:IsFaceup() and (c:IsSetCard(0xbf) or c:IsSetCard(0x10c0)) and c:IsType(TYPE_MONSTER)
end
function c98920865.condition1(e,tp,eg,ep,ev,re,r,rp)
return aux.NegateSummonCondition() and Duel.IsExistingMatchingCard(c98920865.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c98920865.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function c98920865.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
function c98920865.filter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER)
end
function c98920865.handcon(e)
return Duel.IsExistingMatchingCard(c98920865.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c98920865.setcon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp and re:IsActivated() and re:GetHandler():IsSetCard(0x514c) and not re:GetHandler():IsCode(98920865)
end
function c98920865.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c98920865.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SSet(tp,c)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--火灵术解放
function c98920867.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,98920867+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCondition(c98920867.condition1)
e1:SetTarget(c98920867.target)
e1:SetOperation(c98920867.activate)
c:RegisterEffect(e1)
--act in hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(98920867,0))
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e4:SetCondition(c98920867.handcon)
c:RegisterEffect(e4)
--SSet
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_CHAINING)
e2:SetCountLimit(1,98920867)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c98920867.setcon)
e2:SetTarget(c98920867.settg)
e2:SetOperation(c98920867.setop)
c:RegisterEffect(e2)
end
function c98920867.cfilter(c)
return c:IsFaceup() and (c:IsSetCard(0xbf) or c:IsSetCard(0x10c0)) and c:IsType(TYPE_MONSTER)
end
function c98920867.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c98920867.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c98920867.filter(c,e,tp)
return c:IsFaceupEx() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c98920867.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c98920867.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c98920867.filter,tp,0,LOCATION_GRAVE+LOCATION_REMOVED,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c98920867.filter,tp,0,LOCATION_GRAVE+LOCATION_REMOVED,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c98920867.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and aux.NecroValleyFilter()(tc) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local g=tc:GetColumnGroup():Filter(aux.AND(Card.IsFaceup,Card.IsControler),nil,1-tp)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.Destroy(g,REASON_EFFECT)
end
end
end
function c98920867.filters(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_FIRE)
end
function c98920867.handcon(e)
return Duel.IsExistingMatchingCard(c98920867.filters,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c98920867.setcon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp and re:IsActivated() and re:GetHandler():IsSetCard(0x614c) and not re:GetHandler():IsCode(98920867)
end
function c98920867.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c98920867.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SSet(tp,c)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--大薰风疾苍鹰
local s,id,o=GetID()
function c98920876.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsSetCard,0x10),1)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c98920876.efilter)
c:RegisterEffect(e1)
--reduce
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(98920876,0))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,98930876)
e2:SetCondition(c98920876.condition)
e2:SetTarget(c98920876.target)
e2:SetOperation(c98920876.operation)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x10) and not c:IsType(TYPE_SYNCHRO)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and aux.NecroValleyFilter()(tc) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c98920876.efilter(e,re)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsAttribute(ATTRIBUTE_WIND)
end
function c98920876.condition(e,tp,eg,ep,ev,re,r,rp)
if eg:GetCount()~=1 then return false end
local tc=eg:GetFirst()
return tc~=e:GetHandler() and tc:IsFaceup() and tc:IsSummonPlayer(tp) and tc:IsSetCard(0x10)
end
function c98920876.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=eg:GetFirst()
local xuanhua_table_effect=c98920876.geteffect(tc)
local te=table.unpack(xuanhua_table_effect)
Duel.ClearTargetCard()
tc:CreateEffectRelation(e)
e:SetProperty(te:GetProperty())
e:SetLabel(te:GetLabel())
e:SetLabelObject(te:GetLabelObject())
local tg=te:GetTarget()
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
te:SetLabel(e:GetLabel())
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(tc)
Duel.ClearOperationInfo(0)
end
function c98920876.geteffect(c)
cregister=Card.RegisterEffect
table_effect={}
Card.RegisterEffect=function(card,effect,flag)
if effect and effect:GetCode()==(EVENT_TO_GRAVE) then
local eff=effect:Clone()
table.insert(table_effect,eff)
end
return
end
table_effect={}
Duel.CreateToken(0,c:GetOriginalCode())
Card.RegisterEffect=cregister
return table_effect
end
function c98920876.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local xunfeng_table_effect=c98920876.geteffect(tc)
local te=table.unpack(xunfeng_table_effect)
if tc and tc:IsRelateToEffect(e) then
e:SetLabel(te:GetLabel())
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
te:SetLabel(e:GetLabel())
te:SetLabelObject(e:GetLabelObject())
end
end
\ No newline at end of file
--电子化古典芭蕾短裙
local s,id,o=GetID()
function c98920889.initial_effect(c)
--effect
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetCountLimit(1,id+o*2)
e3:SetTarget(s.tg)
e3:SetOperation(s.op)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end
function s.schfilter(c)
return c:IsSetCard(0x93) and c:IsRace(RACE_FAIRY) and c:IsAbleToHand()
end
function s.desfilter(c,e,tp)
return c:IsSetCard(0x93) and c:IsRace(RACE_WARRIOR) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c98920889.cfilter(c,rit)
return c:IsSetCard(0x124) and c:IsType(TYPE_SPELL)
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.schfilter,tp,LOCATION_DECK,0,1,nil)
or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_DECK,0,1,nil,e,tp)) end
local sel=0
local ac=0
if Duel.IsExistingMatchingCard(s.schfilter,tp,LOCATION_DECK,0,1,nil) then sel=sel+1 end
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_DECK,0,1,nil,e,tp) then sel=sel+2 end
if sel==1 then
ac=Duel.SelectOption(tp,aux.Stringid(98920889,0))
elseif sel==2 then
ac=Duel.SelectOption(tp,aux.Stringid(98920889,1))+1
elseif Duel.IsExistingMatchingCard(c98920889.cfilter,tp,LOCATION_GRAVE,0,1,nil,true) then
ac=Duel.SelectOption(tp,aux.Stringid(98920889,0),aux.Stringid(98920889,1),aux.Stringid(98920889,2))
else
ac=Duel.SelectOption(tp,aux.Stringid(98920889,0),aux.Stringid(98920889,1))
end
e:SetLabel(ac)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local ac=e:GetLabel()
if ac==0 or ac==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.schfilter,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
if ac==1 or ac==2 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
\ No newline at end of file
......@@ -71,7 +71,7 @@ function c98921065.tdop(e,tp,eg,ep,ev,re,r,rp)
and Duel.GetMatchingGroup(c98921065.xfilter,tp,LOCATION_GRAVE,0,nil):GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(98921065,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local ssg=Duel.GetMatchingGroup(c98921065.xfilter,tp,LOCATION_GRAVE,0,nil)
local ssg=Duel.GetMatchingGroup(c98921065.xfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,nil)
local sg=Duel.SelectMatchingCard(tp,c98921065.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
local tc=sg:GetFirst()
......
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