Commit 9e14e4fb authored by POLYMER's avatar POLYMER

fix

parent 4c307b2b
No preview for this file type
...@@ -49,7 +49,7 @@ function cm.initial_effect(c) ...@@ -49,7 +49,7 @@ function cm.initial_effect(c)
local temp_f=Duel[fname] local temp_f=Duel[fname]
Duel[fname]=function(p,c,...) Duel[fname]=function(p,c,...)
temp_f(p,c,...) temp_f(p,c,...)
c:RegisterFlagEffect(11451905,RESET_CHAIN,0,1) if Duel.GetCurrentChain()==1 then c:RegisterFlagEffect(11451905,RESET_CHAIN,0,1) end
end end
end end
end end
......
...@@ -71,8 +71,7 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -71,8 +71,7 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
--c:IsCanBeSpecialSummoned(e,0,tp,false,false) or if chk==0 then return (c:IsCanBeSpecialSummoned(e,0,tp,false,false) or 1==1) and (c:IsSummonable(true,nil) or (c:IsAbleToHand() and c:IsLocation(LOCATION_MZONE))) end
if chk==0 then return (1==1) and (c:IsSummonable(true,nil) or (c:IsAbleToHand() and c:IsLocation(LOCATION_MZONE))) end
if c:IsLocation(LOCATION_HAND) then if c:IsLocation(LOCATION_HAND) then
Duel.SetOperationInfo(0,CATEGORY_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SUMMON,e:GetHandler(),1,0,0)
elseif c:IsLocation(LOCATION_MZONE) then elseif c:IsLocation(LOCATION_MZONE) then
......
...@@ -126,7 +126,6 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -126,7 +126,6 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
--local eset={e:GetHandler():GetActivateEffect()} --local eset={e:GetHandler():GetActivateEffect()}
--Debug.Message(eset[3]:IsActivatable(tp,false,true)) --Debug.Message(eset[3]:IsActivatable(tp,false,true))
--local se=e:GetHandler():CheckActivateEffect(true,true,true) --local se=e:GetHandler():CheckActivateEffect(true,true,true)
--Debug.Message(Duel.GetFlagEffect(0,11451901))
return (Duel.GetFlagEffect(0,11451901)>0 or Duel.CheckEvent(EVENT_CUSTOM+11451902)) and ft>0 and Duel.GetFlagEffect(tp,11451902)>0 return (Duel.GetFlagEffect(0,11451901)>0 or Duel.CheckEvent(EVENT_CUSTOM+11451902)) and ft>0 and Duel.GetFlagEffect(tp,11451902)>0
end end
Duel.ResetFlagEffect(tp,11451902) Duel.ResetFlagEffect(tp,11451902)
...@@ -264,6 +263,7 @@ function cm.spcfilter(c,e,tp) ...@@ -264,6 +263,7 @@ function cm.spcfilter(c,e,tp)
end end
function cm.spcon(e,c) function cm.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler()
local bg=Duel.GetMatchingGroup(cm.spcfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,0,c,e,tp) local bg=Duel.GetMatchingGroup(cm.spcfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,0,c,e,tp)
return #bg>0 and c:IsAbleToRemoveAsCost() return #bg>0 and c:IsAbleToRemoveAsCost()
end end
......
...@@ -121,7 +121,7 @@ function cm.initial_effect(c) ...@@ -121,7 +121,7 @@ function cm.initial_effect(c)
local temp_f=Duel[fname] local temp_f=Duel[fname]
Duel[fname]=function(p,c,...) Duel[fname]=function(p,c,...)
temp_f(p,c,...) temp_f(p,c,...)
c:RegisterFlagEffect(11451905,RESET_CHAIN,0,1) if Duel.GetCurrentChain()==1 then c:RegisterFlagEffect(11451905,RESET_CHAIN,0,1) end
end end
end end
end end
...@@ -263,7 +263,7 @@ function cm.reg(e,tp,eg,ep,ev,re,r,rp) ...@@ -263,7 +263,7 @@ function cm.reg(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(0,m,0,0,1) Duel.RegisterFlagEffect(0,m,0,0,1)
end end
function cm.clear(e,tp,eg,ep,ev,re,r,rp) function cm.clear(e,tp,eg,ep,ev,re,r,rp)
Duel.ResetFlagEffect(0,m) --Duel.ResetFlagEffect(0,m)
end end
function cm.condition2(e,tp,eg,ep,ev,re,r,rp) function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(0,m)>0 and Duel.GetCurrentChain()==1 and e:GetHandler():GetFlagEffect(m+1)==0 return Duel.GetFlagEffect(0,m)>0 and Duel.GetCurrentChain()==1 and e:GetHandler():GetFlagEffect(m+1)==0
...@@ -272,6 +272,7 @@ function cm.filter11(c) ...@@ -272,6 +272,7 @@ function cm.filter11(c)
return c:IsSetCard(0xc976) and c:GetFlagEffect(11451905)==0 return c:IsSetCard(0xc976) and c:GetFlagEffect(11451905)==0
end end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp) function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
Duel.ResetFlagEffect(0,m)
local c=e:GetHandler() local c=e:GetHandler()
local hg=Duel.GetMatchingGroup(cm.filter11,tp,LOCATION_HAND,0,nil) local hg=Duel.GetMatchingGroup(cm.filter11,tp,LOCATION_HAND,0,nil)
if c:IsLocation(LOCATION_HAND) then if c:IsLocation(LOCATION_HAND) then
......
...@@ -61,8 +61,8 @@ function cm.ret(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,8 +61,8 @@ function cm.ret(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local dc=g:Select(tp,1,1,nil):GetFirst() local dc=g:Select(tp,1,1,nil):GetFirst()
local code,code2=dc:GetCode() local code,code2=dc:GetCode()
c:RegisterFlagEffect(m+code+0xffffff,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,aux.Stringid(code,8)) c:RegisterFlagEffect(m+code+0xffffff,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(code,8))
if code2 then c:RegisterFlagEffect(m+code2+0xffffff,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,aux.Stringid(code2,8)) end if code2 then c:RegisterFlagEffect(m+code2+0xffffff,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(code2,8)) end
Duel.SendtoHand(dc,nil,REASON_EFFECT) Duel.SendtoHand(dc,nil,REASON_EFFECT)
g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil,c) g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil,c)
if c:GetFlagEffect(m)>0 and #g==0 then Duel.Readjust() end if c:GetFlagEffect(m)>0 and #g==0 then Duel.Readjust() end
......
...@@ -3,10 +3,12 @@ local cm,m,o=GetID() ...@@ -3,10 +3,12 @@ local cm,m,o=GetID()
function cm.initial_effect(c) function cm.initial_effect(c)
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD) e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_CANNOT_TRIGGER) --要用 EFFECT_CANNOT_TRIGGER e0:SetCode(EFFECT_CANNOT_ACTIVATE) --要用 EFFECT_CANNOT_ACTIVATE
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetRange(LOCATION_MZONE) e0:SetRange(LOCATION_MZONE)
e0:SetTargetRange(0,LOCATION_ONFIELD) e0:SetTargetRange(0,1)
e0:SetTarget(cm.desfilther1) --直接使用 cm.desfilther1 即可 e0:SetCondition(cm.atkcon)
e0:SetValue(cm.desfilther2) --直接使用 cm.desfilther1 即可
c:RegisterEffect(e0) c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -37,6 +39,17 @@ local e5=Effect.CreateEffect(c) ...@@ -37,6 +39,17 @@ local e5=Effect.CreateEffect(c)
e5:SetValue(cm.efilter) e5:SetValue(cm.efilter)
c:RegisterEffect(e5) c:RegisterEffect(e5)
end end
function cm.atkcon(e)
return Duel.GetTurnPlayer()==e:GetHandlerPlayer()
end
function cm.desfilther2(e,re,tp) --写反了,第一个参数是效果,第二个是卡
local seq=e:GetHandler():GetSequence()
local sseq=re:GetHandler():GetSequence()
if not re:GetHandler():IsLocation(LOCATION_ONFIELD) then
return false
end
return (seq<5 and sseq<5 and math.abs(4-sseq-seq)<=1) or (seq<5 and sseq==5 and seq>1) or (seq<3 and sseq==6) or (seq==6 and sseq<3) or (seq==5 and sseq>1 and sseq<5)
end
function cm.desfilther1(e,c) --写反了,第一个参数是效果,第二个是卡 function cm.desfilther1(e,c) --写反了,第一个参数是效果,第二个是卡
local seq=c:GetSequence() local seq=c:GetSequence()
local sseq=e:GetHandler():GetSequence() local sseq=e:GetHandler():GetSequence()
......
...@@ -70,7 +70,7 @@ function c50218103.stg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -70,7 +70,7 @@ function c50218103.stg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c50218103.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end if chk==0 then return Duel.IsExistingMatchingCard(c50218103.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_HAND)
end end
function c50218103.sop(e,tp,eg,ep,ev,re,r,rp) function c50218103.sop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -70,7 +70,7 @@ function c50218106.stg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -70,7 +70,7 @@ function c50218106.stg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c50218106.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end if chk==0 then return Duel.IsExistingMatchingCard(c50218106.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_HAND)
end end
function c50218106.sop(e,tp,eg,ep,ev,re,r,rp) function c50218106.sop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -92,7 +92,7 @@ function c50218109.stg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -92,7 +92,7 @@ function c50218109.stg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c50218109.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end if chk==0 then return Duel.IsExistingMatchingCard(c50218109.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_HAND)
end end
function c50218109.sop(e,tp,eg,ep,ev,re,r,rp) function c50218109.sop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -53,7 +53,7 @@ function c50218112.stg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -53,7 +53,7 @@ function c50218112.stg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c50218112.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end if chk==0 then return Duel.IsExistingMatchingCard(c50218112.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_HAND)
end end
function c50218112.sop(e,tp,eg,ep,ev,re,r,rp) function c50218112.sop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -67,7 +67,7 @@ function c50218115.stg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -67,7 +67,7 @@ function c50218115.stg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c50218115.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end if chk==0 then return Duel.IsExistingMatchingCard(c50218115.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_HAND)
end end
function c50218115.sop(e,tp,eg,ep,ev,re,r,rp) function c50218115.sop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -72,7 +72,7 @@ function c50218118.stg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -72,7 +72,7 @@ function c50218118.stg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c50218118.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end if chk==0 then return Duel.IsExistingMatchingCard(c50218118.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_HAND)
end end
function c50218118.sop(e,tp,eg,ep,ev,re,r,rp) function c50218118.sop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -76,7 +76,7 @@ function c50218121.stg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -76,7 +76,7 @@ function c50218121.stg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c50218121.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end if chk==0 then return Duel.IsExistingMatchingCard(c50218121.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_HAND)
end end
function c50218121.sop(e,tp,eg,ep,ev,re,r,rp) function c50218121.sop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -92,7 +92,7 @@ function c50218124.stg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -92,7 +92,7 @@ function c50218124.stg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c50218124.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end if chk==0 then return Duel.IsExistingMatchingCard(c50218124.sfilter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,LOCATION_HAND)
end end
function c50218124.sop(e,tp,eg,ep,ev,re,r,rp) function c50218124.sop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -340,10 +340,13 @@ function MerlinTC.con3(e,c) ...@@ -340,10 +340,13 @@ function MerlinTC.con3(e,c)
ub=1 ub=1
end end
local tp=c:GetControler() local tp=c:GetControler()
local g=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_ONFIELD,0,nil,60002113) local g=Duel.GetMatchingGroup(MerlinTC.csfil,tp,LOCATION_ONFIELD,0,nil)
return Duel.GetMZoneCount(tp,g)>0 return Duel.GetMZoneCount(tp,g)>0
and g:GetCount()>=ub and g:GetCount()>=ub
end end
function MerlinTC.csfil(c)
return c:IsCode(60002113) and c:IsAbleToGraveAsCost()
end
function MerlinTC.op3(e,tp,eg,ep,ev,re,r,rp,c) function MerlinTC.op3(e,tp,eg,ep,ev,re,r,rp,c)
local loc=e:GetHandler():GetLocation() local loc=e:GetHandler():GetLocation()
local ub=2 local ub=2
...@@ -351,7 +354,7 @@ function MerlinTC.op3(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -351,7 +354,7 @@ function MerlinTC.op3(e,tp,eg,ep,ev,re,r,rp,c)
ub=1 ub=1
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_ONFIELD,0,ub,ub,nil,60002113) local g=Duel.SelectMatchingCard(tp,MerlinTC.csfil,tp,LOCATION_ONFIELD,0,ub,ub,nil)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
if loc~=LOCATION_HAND then if loc~=LOCATION_HAND then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
......
--奇幻士兵
local cm,m,o=GetID()
function cm.initial_effect(c)
--cannot release
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e5:SetRange(LOCATION_MZONE)
e5:SetValue(1)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e6)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetOperation(cm.op)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:GetCode()==m then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),m,RESET_PHASE+PHASE_END,0,1000)
end
tc=eg:GetNext()
end
end
\ No newline at end of file
--神秘皇后·梅迪
Duel.LoadScript("c60000000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60002113)
MerlinTC.ChessSPSummon(c,m)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(60002113)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(MerlinTC.lc1)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(54631665,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(MerlinTC.lc3)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
--summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SET_SUMMON_COUNT_LIMIT)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(MerlinTC.lc5)
e1:SetTargetRange(1,0)
e1:SetValue(3)
e1:SetTarget(aux.TargetBoolFunction(cm.fil))
c:RegisterEffect(e1)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,60002113) and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_DECK,0,1,nil,60002115) and Duel.GetMZoneCount(tp,g)>0 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,Card.IsCode,tp,LOCATION_DECK,0,1,1,nil,60002115)
local g2=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,60002113)
if g:GetCount()>0 and g2:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.SpecialSummon(g2,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function cm.fil(c)
return c:IsCode(60002113) or c:IsCodeListed(60002113)
end
\ No newline at end of file
--奇幻战略
Duel.LoadScript("c60000000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60002113)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--spsummon limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.sumlimit)
c:RegisterEffect(e2)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(60002113)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(MerlinTC.lc1)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(54631665,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(MerlinTC.lc3)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
--damage
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(MerlinTC.lc5)
e2:SetCountLimit(1)
e2:SetOperation(cm.bkop)
c:RegisterEffect(e2)
end
function cm.spfilter(c,e,tp)
return c:IsCode(m-2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ut=1
if Duel.GetFlagEffect(tp,60002113)>=8 then
ut=2
end
if chk==0 then return Duel.IsPlayerCanDraw(tp,ut) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=ut and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,ut,nil,e,tp) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ut)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ut)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ut,tp,LOCATION_GRAVE+LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local ut=1
if Duel.GetFlagEffect(tp,60002113)>=8 then
ut=2
end
if Duel.GetLocationCount(tp,LOCATION_MZONE)>=ut then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,ut,ut,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsOnField() and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function cm.bkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
--奇幻城堡
Duel.LoadScript("c60000000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60002113)
MerlinTC.ChessSPSummon(c,m)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(60002113)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(MerlinTC.lc1)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(54631665,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(MerlinTC.lc3)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
--avoid damage
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CHANGE_DAMAGE)
e4:SetTargetRange(1,0)
e4:SetRange(LOCATION_MZONE)
e3:SetCondition(MerlinTC.lc5)
e4:SetValue(cm.damval)
c:RegisterEffect(e4)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e4:SetTargetRange(1,0)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(MerlinTC.lc5)
e4:SetValue(cm.damval)
c:RegisterEffect(e4)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,60002113) and Duel.GetMZoneCount(tp,g)>0 end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,60002113)
if g2:GetCount()>0 then
Duel.SpecialSummon(g2,0,tp,tp,false,false,POS_FACEUP)
end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
function cm.damval(e,re,val,r,rp,rc)
if bit.band(r,REASON_EFFECT)~=0 then return 0 end
return val
end
\ No newline at end of file
--奇幻骑士
Duel.LoadScript("c60000000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60002113)
MerlinTC.ChessSPSummon(c,m)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(60002113)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(MerlinTC.lc1)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(54631665,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(MerlinTC.lc3)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCondition(MerlinTC.lc5)
e1:SetTarget(cm.datg)
c:RegisterEffect(e1)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,60002113) and Duel.GetMZoneCount(tp,g)>0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,60002113)
if g2:GetCount()>0 then
Duel.SpecialSummon(g2,0,tp,tp,false,false,POS_FACEUP)
end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function cm.datg(e,c)
return c:IsPosition(POS_FACEUP)
end
\ No newline at end of file
--神秘国王
Duel.LoadScript("c60000000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60002113)
--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+LOCATION_DECK+LOCATION_GRAVE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(60002113)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(MerlinTC.lc1)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(MerlinTC.lc3)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
--Atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(MerlinTC.lc5)
e2:SetValue(1000)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(MerlinTC.lc5)
e2:SetValue(1000)
c:RegisterEffect(e2)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,2,nil,60002113) and Duel.GetMZoneCount(tp,g)>1 end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,2,2,nil,60002113)
if g2:GetCount()>0 then
Duel.SpecialSummon(g2,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,g)>0 end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local token=Duel.CreateToken(tp,60002113)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local num=13
if Duel.IsPlayerAffectedByEffect(tp,60002113) then
num=12
end
local nume=math.max(0,num-Duel.GetFlagEffect(tp,60002113))
return (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and num==0) or Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,0,nume,c,60002113)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
\ No newline at end of file
--将军!
Duel.LoadScript("c60000000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60002113)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--spsummon limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.sumlimit)
c:RegisterEffect(e2)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(60002113)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(MerlinTC.lc1)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(54631665,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(MerlinTC.lc3)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
--damage
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(MerlinTC.lc5)
e2:SetCountLimit(1)
e2:SetOperation(cm.bkop)
c:RegisterEffect(e2)
end
function cm.spfilter(c,e,tp)
return c:IsCode(60002113) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ut=1
if chk==0 then return Duel.IsPlayerCanDraw(tp,ut) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=ut and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,ut,nil,e,tp) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ut)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ut)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ut,tp,LOCATION_GRAVE+LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local ut=1
if Duel.GetLocationCount(tp,LOCATION_MZONE)>=ut then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,ut,ut,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
local p=tp
Duel.ConfirmDecktop(p,4)
local g=Duel.GetDecktopGroup(p,4)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
local sg=g:Select(p,1,1,nil)
if sg:GetFirst():IsAbleToHand() then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-p,sg)
Duel.ShuffleHand(p)
else
Duel.SendtoGrave(sg,REASON_RULE)
end
Duel.ShuffleDeck(p)
end
end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA)
end
function cm.bkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,0,1,nil) then return end
local g1=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
local tc=g1:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(500)
tc:RegisterEffect(e1)
tc=g1:GetNext()
end
end
\ No newline at end of file
--超快棋
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60002113)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCountLimit(1)
e2:SetOperation(cm.damop)
c:RegisterEffect(e2)
end
function cm.spfilter(c,e,tp)
return c:IsCode(60002113) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>=1
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK)
end
function cm.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,cm.spfilter,tp,LOCATION_GRAVE+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
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
\ No newline at end of file
--奇幻主教
Duel.LoadScript("c60000000.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60002113)
MerlinTC.ChessSPSummon(c,m)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(60002113)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(MerlinTC.lc1)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(54631665,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(MerlinTC.lc3)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
--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:SetCondition(MerlinTC.lc5)
e2:SetValue(cm.efilter)
c:RegisterEffect(e2)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,60002113) and Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_GRAVE,0,1,nil,RACE_CYBERSE) and Duel.GetMZoneCount(tp,g)>0 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,Card.IsRace,tp,LOCATION_GRAVE,0,1,1,nil,RACE_CYBERSE)
local g2=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,60002113)
if g:GetCount()>0 and g2:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.SpecialSummon(g2,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.filter(c)
return c:IsAbleToDeck()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_REMOVED,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_REMOVED,0,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=2 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
end
function cm.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment