Commit b51ee939 authored by POLYMER's avatar POLYMER

fix

parent dd676b25
No preview for this file type
...@@ -123,7 +123,7 @@ function cm.xyzop(e,tp,eg,ep,ev,re,r,rp) ...@@ -123,7 +123,7 @@ function cm.xyzop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.xfilter(c,tp,g) function cm.xfilter(c,tp,g)
return c:IsFaceup() and c:IsControler(tp) and g:IsExists(Card.IsAttribute,1,nil,c:GetAttribute()) return c:IsFaceup() and c:IsControler(tp) and g:IsExists(Card.IsAttribute,1,c,c:GetAttribute())
end end
function cm.descon(e,tp,eg,ep,ev,re,r,rp) function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
local m=60002234 local m=60002234
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit()
--to hand --to hand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE) e1:SetCategory(CATEGORY_DAMAGE)
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
local m=60002235 local m=60002235
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit()
--to hand --to hand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE) e1:SetCategory(CATEGORY_DAMAGE)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
local m=60002236 local m=60002236
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit()
--immune --immune
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
local m=60002237 local m=60002237
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit()
--to hand --to hand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW) e1:SetCategory(CATEGORY_DRAW)
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
local m=60002238 local m=60002238
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit()
--to hand --to hand
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW) e2:SetCategory(CATEGORY_DRAW)
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
local m=60002239 local m=60002239
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit()
--negate --negate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
local m=60002240 local m=60002240
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit()
--to hand --to hand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
local m=60002241 local m=60002241
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit()
--to hand --to hand
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW) e2:SetCategory(CATEGORY_DRAW)
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
local m=60002246 local m=60002246
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit()
--to hand --to hand
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW) e2:SetCategory(CATEGORY_DRAW)
......
--冰结界的极冰龙 三叉龙
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Cannot SP Sum self
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(aux.FALSE)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(2)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,id)
e2:SetCondition(s.spcon)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(19814508,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+1)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetTarget(s.target)
e3:SetOperation(s.operation)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonLocation(LOCATION_EXTRA) or
(c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelAbove(9) and c:IsRace(RACE_DRAGON))
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x2f)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
return ct>0 and ct==Duel.GetMatchingGroupCount(s.cfilter,tp,LOCATION_MZONE,0,nil)
end
function s.costfilter(c)
return c:IsSetCard(0x2f) and c:IsType(TYPE_MONSTER) and c:IsAttack(2700) and c:IsDefense(2000) and c:IsAbleToGraveAsCost()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 and Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_EXTRA,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsLocation(LOCATION_EXTRA) and not (c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelAbove(9) and c:IsRace(RACE_DRAGON))
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.fselect(g)
return g:GetClassCount(Card.GetLocation)>1
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
if Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)~=0
and (#g1>0 or #g2>0) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
local rg=nil
if #g1>0 and #g2>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
rg=g2:SelectSubGroup(tp,s.fselect,false,1,2)
if Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
local sg=g1:RandomSelect(tp,1)
rg:Merge(sg)
end
elseif #g1>0 and #g2==0 then
rg=g1:RandomSelect(tp,1)
elseif #g2>0 and #g1==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
rg=g2:SelectSubGroup(tp,s.fselect,false,1,2)
end
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
end
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x2f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
end
function s.thfilter(c)
return c:IsLevelBelow(6) and c:IsSetCard(0x2f) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
if chk==0 then return tc:IsSetCard(0x2f) and Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)==0 then return end
local sg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
local tg=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
if #sg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sum=sg:Select(tp,1,1,nil)
if Duel.SpecialSummon(sum,0,tp,1-tp,false,false,POS_FACEUP)~=0 and #tg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tohand=tg:Select(tp,1,1,nil)
Duel.SendtoHand(tohand,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tohand)
end
end
end
\ No newline at end of file
--溯洄 机械师-刻度修正
local s,id,o=GetID()
function s.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_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.spcon)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--swap2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_POSITION+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id)
e2:SetTarget(s.postg)
e2:SetOperation(s.posop)
c:RegisterEffect(e2)
--spsummon cost
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SPSUMMON_COST)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCost(s.spcost)
e3:SetOperation(s.spcop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonType(SUMMON_TYPE_LINK)
end
function s.spcost(e,c,tp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0
end
function s.spcop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.hsplimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.hsplimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function s.hspfilter(c)
return c:IsLevel(6,7) and c:IsSetCard(0x8183) and c:IsFaceup()
end
function s.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,c)
and Duel.IsExistingMatchingCard(s.hspfilter,c:GetControler(),LOCATION_MZONE,0,1,c)
end
function s.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
function s.thfilter(c)
return c:IsSetCard(0x8183) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsCanChangePosition() end
if chk==0 then return Duel.IsExistingTarget(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local tg=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
if tc:IsRelateToEffect(e) and #tg>0 and Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=tg:Select(tp,1,1,nil)
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
\ No newline at end of file
--溯洄 入殓师-“盲区”
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_POSITION+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,71200004)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--swap2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_POSITION+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,71200005)
e2:SetTarget(s.postg)
e2:SetOperation(s.posop)
c:RegisterEffect(e2)
--spsummon cost
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SPSUMMON_COST)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCost(s.spcost)
e3:SetOperation(s.spcop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonType(SUMMON_TYPE_LINK)
end
function s.spcost(e,c,tp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0
end
function s.spcop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.hsplimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.hsplimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function s.posfilter(c)
return c:IsFaceup() and c:IsSetCard(0x8183) and c:IsLevel(6,7) and c:IsCanChangePosition()
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.posfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.posfilter,tp,LOCATION_MZONE,0,1,nil)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,s.posfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)~=0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function s.setfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x8183) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.setfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local tg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
if tc:IsRelateToEffect(e) and #tg>0 and Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=tg:Select(tp,1,1,nil)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--溯洄 大副-起航日
local s,id,o=GetID()
function s.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_HAND)
e1:SetCountLimit(1,71200009+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.spcon)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--swap2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_POSITION+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,71200010)
e2:SetTarget(s.postg)
e2:SetOperation(s.posop)
c:RegisterEffect(e2)
--spsummon cost
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SPSUMMON_COST)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCost(s.spcost)
e3:SetOperation(s.spcop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonType(SUMMON_TYPE_LINK)
end
function s.spcost(e,c,tp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0
end
function s.spcop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.hsplimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.hsplimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function s.hspfilter(c)
return c:IsLevel(6,7) and c:IsSetCard(0x8183) and c:IsFaceup()
end
function s.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,c)
and Duel.IsExistingMatchingCard(s.hspfilter,c:GetControler(),LOCATION_MZONE,0,1,c)
end
function s.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
function s.spfilter(c,e,tp)
return c:IsSetCard(0x8183) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and aux.NegateAnyFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local tg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsCanBeDisabledByEffect(e,false) and #tg>0 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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=tg:Select(tp,1,1,nil)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--溯洄 守墓人-墓志铭
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_POSITION+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,71200012)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--level
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DECKDES+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,71200013)
e2:SetTarget(s.lvtg)
e2:SetOperation(s.lvop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonType(SUMMON_TYPE_LINK)
end
function s.spcost(e,c,tp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0
end
function s.spcop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.hsplimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.hsplimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function s.posfilter(c)
return c:IsFaceup() and c:IsSetCard(0x8183) and c:IsLevel(6,7) and c:IsCanChangePosition()
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.posfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.posfilter,tp,LOCATION_MZONE,0,1,nil)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,s.posfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)~=0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function s.lvfilter(c)
return c:IsFaceup() and c:GetLevel()>0
end
function s.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x8183) and c:IsAbleToGrave()
end
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil)end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local tg=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_DECK,0,nil)
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(3)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=tg:Select(tp,1,1,nil)
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
\ No newline at end of file
--溯洄 医生-痊愈
local s,id,o=GetID()
function s.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_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.spcon)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--swap2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_POSITION+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id)
e2:SetTarget(s.rectg)
e2:SetOperation(s.recop)
c:RegisterEffect(e2)
--spsummon cost
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SPSUMMON_COST)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCost(s.spcost)
e3:SetOperation(s.spcop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonType(SUMMON_TYPE_LINK)
end
function s.spcost(e,c,tp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0
end
function s.spcop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.hsplimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.hsplimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function s.hspfilter(c)
return c:IsLevel(6,7) and c:IsSetCard(0x8183) and c:IsFaceup()
end
function s.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,c)
and Duel.IsExistingMatchingCard(s.hspfilter,c:GetControler(),LOCATION_MZONE,0,1,c)
end
function s.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
function s.spfilter(c,e,tp)
return c:IsSetCard(0x8183) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.recfilter(c)
return c:IsFaceup() and c:GetAttack()>0
end
function s.rectg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.recfilter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(s.recfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.recfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetAttack())
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.recop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>0 and Duel.Recover(p,tc:GetAttack(),REASON_EFFECT)~=0 then
Duel.Draw(p,d,REASON_EFFECT)
end
end
\ No newline at end of file
--溯洄 疯眼-测量者
local s,id,o=GetID()
function s.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_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.hspcon)
e1:SetOperation(s.hspop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetTarget(s.target)
e2:SetOperation(s.activate)
c:RegisterEffect(e2)
--spsummon cost
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SPSUMMON_COST)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCost(s.hspcost)
e3:SetOperation(s.hspcop)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLE_START)
e4:SetRange(LOCATION_GRAVE+LOCATION_HAND)
e4:SetCondition(s.spcon)
e4:SetCost(s.spcost)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonType(SUMMON_TYPE_LINK)
end
function s.hspcost(e,c,tp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0
end
function s.hspcop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.hsplimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.hsplimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,PLAYER_NONE,0)>0 end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=Duel.SelectDisableField(tp,1,0,LOCATION_ONFIELD,0)
Duel.Hint(HINT_ZONE,tp,zone)
if tp==1 then
zone=((zone&0xffff)<<16)|((zone>>16)&0xffff)
end
--disable field
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE_FIELD)
e3:SetValue(zone)
e3:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e3,tp)
end
function s.hspfilter(c,ft)
return c:IsFaceup() and c:IsAbleToGraveAsCost() and (ft>0 or c:GetSequence()<5)
end
function s.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(s.hspfilter,tp,LOCATION_MZONE,0,1,nil,ft)
end
function s.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.hspfilter,tp,LOCATION_MZONE,0,1,1,nil,ft)
Duel.SendtoGrave(g,REASON_COST)
end
function s.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x8183) and c:IsLevel(3,4) and c:IsAbleToRemoveAsCost()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end
e:SetLabelObject(tc)
return tc and tc:IsFaceup()
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetLabelObject()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,bc,1,0,0)
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()
local bc=e:GetLabelObject()
if bc:IsRelateToBattle() and bc:IsControler(tp) and Duel.Destroy(bc,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,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)
--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:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.hspcon)
e1:SetOperation(s.hspop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetTarget(s.target)
e2:SetOperation(s.activate)
c:RegisterEffect(e2)
--spsummon cost
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SPSUMMON_COST)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCost(s.hspcost)
e3:SetOperation(s.hspcop)
c:RegisterEffect(e3)
--set
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetRange(LOCATION_GRAVE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e4:SetCondition(s.spcon)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonType(SUMMON_TYPE_LINK)
end
function s.hspcost(e,c,tp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0
end
function s.hspcop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.hsplimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.hsplimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function s.hspfilter(c,ft)
return c:IsFaceup() and c:IsAbleToGraveAsCost() and (ft>0 or c:GetSequence()<5)
end
function s.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(s.hspfilter,tp,LOCATION_MZONE,0,1,nil,ft)
end
function s.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.hspfilter,tp,LOCATION_MZONE,0,1,1,nil,ft)
Duel.SendtoGrave(g,REASON_COST)
end
function s.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x8183) and c:IsLevel(3,4) and c:IsAbleToRemoveAsCost()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.cfilter(c,tp,rp)
return c:IsPreviousControler(tp) and bit.band(c:GetPreviousTypeOnField(),TYPE_MONSTER)~=0
and (rp==1-tp and c:IsReason(REASON_EFFECT))
end
function s.spcon(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.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local tg=eg:Filter(s.cfilter,nil,tp,rp)
return #tg>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,0)
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()
local tg=eg:Filter(s.cfilter,nil,tp,rp)
if #tg>0 and Duel.SendtoHand(tg,nil,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.ConfirmCards(1-tp,tg)
Duel.SpecialSummon(c,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)
--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:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.hspcon)
e1:SetOperation(s.hspop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(s.activate)
c:RegisterEffect(e2)
--spsummon cost
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SPSUMMON_COST)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCost(s.hspcost)
e3:SetOperation(s.hspcop)
c:RegisterEffect(e3)
--Activate
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_HANDES+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e4:SetRange(LOCATION_GRAVE)
e4:SetCode(EVENT_TO_HAND)
e4:SetCondition(s.spcon)
e4:SetCost(s.spcost)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonType(SUMMON_TYPE_LINK)
end
function s.hspcost(e,c,tp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0
end
function s.hspcop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.hsplimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.hsplimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
function s.hspfilter(c,ft)
return c:IsFaceup() and c:IsAbleToGraveAsCost() and (ft>0 or c:GetSequence()<5)
end
function s.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(s.hspfilter,tp,LOCATION_MZONE,0,1,nil,ft)
end
function s.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.hspfilter,tp,LOCATION_MZONE,0,1,1,nil,ft)
Duel.SendtoGrave(g,REASON_COST)
end
function s.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x8183) and c:IsLevel(3,4) and c:IsAbleToRemoveAsCost()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.cfilter(c,tp)
return c:IsControler(tp) and not c:IsReason(REASON_DRAW)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,1-tp)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
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
if Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD)~=0 then
Duel.SpecialSummon(c,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)
--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:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.hspcon)
e1:SetOperation(s.hspop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--spsummon cost
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SPSUMMON_COST)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCost(s.hspcost)
e3:SetOperation(s.hspcop)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(4810828,0))
e4:SetCategory(CATEGORY_NEGATE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_GRAVE)
e4:SetCondition(s.spcon)
e4:SetCost(s.spcost)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonType(SUMMON_TYPE_LINK)
end
function s.hspcost(e,c,tp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0
end
function s.hspcop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.hsplimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.hsplimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function s.thfilter(c)
return c:IsSetCard(0x8183) 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:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.hspfilter(c,ft)
return c:IsFaceup() and c:IsAbleToGraveAsCost() and (ft>0 or c:GetSequence()<5)
end
function s.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(s.hspfilter,tp,LOCATION_MZONE,0,1,nil,ft)
end
function s.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.hspfilter,tp,LOCATION_MZONE,0,1,1,nil,ft)
Duel.SendtoGrave(g,REASON_COST)
end
function s.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x8183) and c:IsLevel(3,4) and c:IsAbleToRemoveAsCost()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.cfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
if not (re:IsHasProperty(EFFECT_FLAG_CARD_TARGET)) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:IsExists(s.cfilter,1,nil,tp) and Duel.IsChainNegatable(ev)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
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
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT) then
Duel.SpecialSummon(c,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)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_HANDES+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(6616912,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetCondition(s.ntcon)
c:RegisterEffect(e2)
--spsummon cost
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SPSUMMON_COST)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCost(s.hspcost)
e3:SetOperation(s.hspcop)
c:RegisterEffect(e3)
--tograve
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(s.condition)
e4:SetCountLimit(10,id+1)
e4:SetTarget(s.target)
e4:SetOperation(s.operation)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e5)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonType(SUMMON_TYPE_LINK)
end
function s.hspcost(e,c,tp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0
end
function s.hspcop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.hsplimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.hsplimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function s.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5)
and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function s.thfilter(c)
return c:IsLevel(3,4) and c:IsSetCard(0x8183) and c:IsAbleToHand()
end
function s.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) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
if #sg>0 and Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=sg:Select(tp,1,1,nil)
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
function s.cfilter(c,tp)
return c:IsSummonPlayer(1-tp)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(s.cfilter,1,nil,tp)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_EXTRA)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local sg=eg:Filter(s.cfilter,nil,tp)
if chk==0 then return #sg>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=eg:Filter(s.cfilter,nil,tp)
local tc=sg:GetFirst()
while tc do
if not tc:IsLocation(LOCATION_MZONE) then
sg:RemoveCard(tc)
end
tc=sg:GetNext()
end
Duel.Destroy(sg,REASON_EFFECT)
end
\ No newline at end of file
--溯洄 小提琴家-魔音回响
local s,id,o=GetID()
function s.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_HANDES+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(6616912,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetCondition(s.ntcon)
c:RegisterEffect(e2)
--spsummon cost
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SPSUMMON_COST)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCost(s.hspcost)
e3:SetOperation(s.hspcop)
c:RegisterEffect(e3)
--disable
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(66425726,1))
e5:SetCategory(CATEGORY_DISABLE)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_CHAINING)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,id+1)
e5:SetCondition(s.discon)
e5:SetTarget(s.distg)
e5:SetOperation(s.disop)
c:RegisterEffect(e5)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonType(SUMMON_TYPE_LINK)
end
function s.hspcost(e,c,tp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0
end
function s.hspcop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.hsplimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.hsplimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function s.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5)
and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function s.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x8183) and c:IsAbleToHand()
end
function s.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) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
if #sg>0 and Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=sg:Select(tp,1,1,nil)
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp and re:IsActiveType(TYPE_SPELL) and Duel.IsChainDisablable(ev)
and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.nbcon(tp,re) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
if re:GetActivateLocation()==LOCATION_GRAVE then
e:SetCategory(e:GetCategory()|CATEGORY_GRAVE_ACTION)
else
e:SetCategory(e:GetCategory()&~CATEGORY_GRAVE_ACTION)
end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re)
and Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)~=0 then
Duel.Damage(p,d,REASON_EFFECT)
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_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(s.drcon)
e2:SetTarget(s.drtg)
e2:SetOperation(s.drop)
c:RegisterEffect(e2)
end
function s.ccfilter(c)
return c:IsFaceup() and c:IsLevel(3,4) and c:IsSetCard(0x8183)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local dg=Duel.GetMatchingGroup(s.ccfilter,tp,LOCATION_MZONE,0,nil)
return #dg==0
end
function s.filter(c)
return c:IsFaceupEx() and c:IsLevel(3,4) and c:IsSetCard(0x8183) and c:IsAbleToHand()
end
function s.chekfilter(c)
return c:IsLevel(7,8) and c:IsSetCard(0x8183) and c:IsFaceup()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
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+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
local check=Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if check and #dg>0 and Duel.SelectYesNo(tp,aux.Stringid(25955749,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dc=dg:Select(tp,1,1,nil)
Duel.Destroy(dc,REASON_EFFECT)
end
end
end
function s.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp)
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local sg=eg:Filter(s.cfilter,nil,tp)
local tg=sg:Filter(Card.IsAbleToHand,nil)
if chk==0 then return c:IsAbleToHand() end
tg:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tg,#tg,0,0)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=eg:Filter(s.cfilter,nil,tp)
local tg=sg:Filter(Card.IsAbleToHand,nil)
if e:GetHandler():IsRelateToEffect(e) then
tg:AddCard(c)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
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_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(s.drcon)
e2:SetTarget(s.drtg)
e2:SetOperation(s.drop)
c:RegisterEffect(e2)
end
function s.ccfilter(c)
return c:IsFaceup() and c:IsLevel(6,7) and c:IsSetCard(0x8183)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local dg=Duel.GetMatchingGroup(s.ccfilter,tp,LOCATION_MZONE,0,nil)
return #dg==0
end
function s.filter(c,e,tp)
return c:IsLevel(6,7) and c:IsSetCard(0x8183) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.chkfilter(c)
return c:IsLevel(3,4) and c:IsSetCard(0x8183) and c:IsFaceup()
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 return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local check=Duel.IsExistingMatchingCard(s.chkfilter,tp,LOCATION_MZONE,0,1,nil)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if check and Duel.SelectYesNo(tp,aux.Stringid(2857636,1)) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function s.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp)
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local sg=eg:Filter(s.cfilter,nil,tp)
local tg=sg:Filter(Card.IsAbleToHand,nil)
if chk==0 then return c:IsAbleToHand() end
tg:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tg,#tg,0,0)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=eg:Filter(s.cfilter,nil,tp)
local tg=sg:Filter(Card.IsAbleToHand,nil)
if e:GetHandler():IsRelateToEffect(e) then
tg:AddCard(c)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
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:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atk & def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x8183))
e2:SetValue(500)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--destroy replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1)
e4:SetTarget(s.reptg)
e4:SetValue(s.repval)
e4:SetOperation(s.repop)
c:RegisterEffect(e4)
--to hand
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCountLimit(1,id)
e5:SetTarget(s.thtg)
e5:SetOperation(s.thop)
c:RegisterEffect(e5)
end
function s.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
and c:IsSetCard(0x8183) and c:IsReason(REASON_EFFECT) and c:GetFlagEffect(id)==0 and not c:IsReason(REASON_REPLACE)
end
function s.desfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x8183)
and c:IsAbleToRemove() and not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_BATTLE_DESTROYED)
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_GRAVE,0,1,nil,tp)
and eg:IsExists(s.repfilter,1,nil,tp) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
local g=eg:Filter(s.repfilter,nil,tp)
if g:GetCount()==1 then
e:SetLabelObject(g:GetFirst())
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local cg=g:Select(tp,1,1,nil)
e:SetLabelObject(cg:GetFirst())
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local tg=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
Duel.SetTargetCard(tg)
tg:GetFirst():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
tg:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED,true)
return true
else return false end
end
function s.repval(e,c)
return c==e:GetLabelObject()
end
function s.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
local tc=Duel.GetFirstTarget()
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
function s.thfilter(c)
return c:IsSetCard(0x8183) and c:IsAbleToHand() and not c:IsCode(id)
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: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)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--deckdes
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(13171876,0))
e1:SetCategory(CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(s.ddcon)
e1:SetTarget(s.ddtg)
e1:SetOperation(s.ddop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+1)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.ddcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function s.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
end
function s.ddop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(tp,3,REASON_EFFECT)
end
function s.costfilter(c,e,tp)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE,0,1,c,e,tp)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.costfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,e:GetHandler(),e,tp)
if chk==0 then return g:CheckSubGroup(aux.gfcheck,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,aux.gfcheck,false,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function s.filter(c,e,tp)
return c:IsCode(13171876) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
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,aux.NecroValleyFilter(s.filter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--铁兽战线 施莱格
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(14816857,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCountLimit(1,id+1)
e2:SetCondition(s.hspcon)
e2:SetTarget(s.hsptg)
e2:SetOperation(s.hspop)
c:RegisterEffect(e2)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function s.cfilter(c)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsAbleToRemoveAsCost()
end
function s.fselect(g,tg)
return tg:IsExists(Card.IsLink,1,nil,#g)
end
function s.spfilter(c,e,tp)
return c:IsType(TYPE_LINK) and c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local cg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_GRAVE,0,nil)
local tg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
local _,maxlink=tg:GetMaxGroup(Card.GetLink)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
if #tg==0 then return false end
return cg:CheckSubGroup(s.fselect,1,maxlink,tg)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=cg:SelectSubGroup(tp,s.fselect,false,1,maxlink,tg)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
e:SetLabel(rg:GetCount())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.spfilter1(c,e,tp,lk)
return s.spfilter(c,e,tp) and c:IsLink(lk)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(0xff,0xff)
e1:SetTarget(aux.NOT(aux.TargetBoolFunction(Card.IsRace,RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)))
e1:SetValue(s.sumlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local lk=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lk)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.sumlimit(e,c)
if not c then return false end
return c:IsControler(e:GetHandlerPlayer())
end
function s.hcfilter(c)
return c:IsFaceup() and c:IsSetCard(0x14d)
end
function s.hspcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.hcfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.hspop(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
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
\ No newline at end of file
--铁兽式强袭机动兵装改“MI-TB”战损
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--material
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST),3,99,s.spchk)
--splimit
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(s.splimit)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1735088,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,id)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--cannot target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.tgcon)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(s.tgcon)
e4:SetValue(aux.indoval)
c:RegisterEffect(e4)
--token
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_RECOVER)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_SUMMON_SUCCESS)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,id+1)
e5:SetTarget(s.rmtg)
e5:SetOperation(s.rmop)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e6)
end
function s.cfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x14d)
end
function s.spchk(g,lc,tp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,3,nil)
end
function s.splimit(e,se,sp,st,pos,tp)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
or Duel.IsExistingMatchingCard(s.cfilter,sp,LOCATION_GRAVE,0,3,nil)
end
function s.tgcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function s.thfilter(c)
return c:IsSetCard(0x14d) and c:IsType(TYPE_SPELL+TYPE_TRAP) 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:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.spcfilter(c,tp)
return c:IsSummonPlayer(tp) and c:IsAbleToRemove()
end
function s.rmfilter(c)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsAbleToRemove()
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp) and
Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_GRAVE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_GRAVE,0,1,1,nil)
local ag=Group.CreateGroup()
local bg=eg:Filter(s.spcfilter,nil,1-tp)
local tc=bg:GetFirst()
while tc do
if tc:IsLocation(LOCATION_MZONE) then
ag:AddCard(tc)
end
tc=g:GetNext()
end
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 and #ag>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Remove(ag,POS_FACEUP,REASON_EFFECT)
end
end
--铁兽的集结
local s,id,o=GetID()
function s.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:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--atk & def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST))
e2:SetValue(s.atkval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--counter
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetRange(LOCATION_FZONE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,id+1)
e4:SetCondition(s.condition)
e4:SetCost(s.cost)
e4:SetOperation(s.operation)
c:RegisterEffect(e4)
end
function s.filter(c)
return c:IsSetCard(0x14d) and c:IsAbleToGrave()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function s.activate(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+LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function s.atkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER)
end
function s.atkval(e,c)
local g=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
return g:GetClassCount(Card.GetRace)*100
end
function s.cfilter(c,tp)
return c:IsSetCard(0x14d) and c:IsSummonType(SUMMON_TYPE_LINK) and c:IsFaceup()
and c:IsSummonPlayer(tp)
end
function s.cost(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 s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetReset(RESET_PHASE+PHASE_END,2)
e2:SetTarget(s.ptfilter)
e2:SetValue(1)
Duel.RegisterEffect(e2,tp)
end
function s.ptfilter(e,c)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)
end
--铁兽的合力
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
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(78474168,0))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,id)
e2:SetCondition(s.discon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.distg)
e2:SetOperation(s.disop)
c:RegisterEffect(e2)
end
function s.atkfilter(c)
return c:IsSetCard(0x14d) and c:IsType(TYPE_LINK) and c:IsLinkAbove(1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.atkfilter(chkc) end
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
if chk==0 then return Duel.IsExistingTarget(s.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and #dg>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc,c=Duel.GetFirstTarget(),e:GetHandler()
local lt=tc:GetLink()
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
if tc:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,lt,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.chkfilter,tp,LOCATION_MZONE,0,nil)
local ct=g:GetClassCount(Card.GetRace)
return ct==3
end
function s.chkfilter(c)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsType(TYPE_MONSTER)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and aux.NegateEffectMonsterFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
Duel.SelectTarget(tp,aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,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:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(1-tp) and tc:IsType(TYPE_EFFECT) and tc:IsCanBeDisabledByEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
\ No newline at end of file
--维萨斯-阿特摩卡拉卡
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,56099748)
--change name
aux.EnableChangeCode(c,56099748,LOCATION_MZONE+LOCATION_GRAVE)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function s.filter(c)
return (aux.IsCodeListed(c,56099748) or c:IsCode(56099748,821049,14391625,17272964,27015862,44760562,53776969,65815684,80621253,90465153))and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then 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.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
local check=tc:IsType(TYPE_TUNER)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if c:IsLocation(LOCATION_MZONE) and not check then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
end
\ No newline at end of file
--维萨斯-阿啰他
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,56099748)
--xyz summon
aux.AddXyzProcedure(c,nil,8,2)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(68300121,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetCost(s.thcost)
e1:SetCondition(s.thcon)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--material
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+1)
e2:SetCost(s.xcost)
e2:SetTarget(s.target)
e2:SetOperation(s.operation)
c:RegisterEffect(e2)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.thfilter(c)
return (aux.IsCodeListed(c,56099748) or c:IsCode(821049,14391625,17272964,27015862,44760562,53776969,65815684,80621253,90465153)) and c:IsAbleToHand() and not c:IsType(TYPE_FIELD)
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:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.xcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
local og=Duel.GetOperatedGroup()
local tc=og:GetFirst()
e:SetLabel(0)
if aux.IsCodeListed(tc,56099748) or tc:IsCode(821049,14391625,17272964,27015862,44760562,53776969,65815684,80621253,90465153) then
e:SetLabel(100)
end
end
function s.filter(c)
return c:IsCanOverlay()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) and chkc~=e:GetHandler() end
local loc=LOCATION_GRAVE
if e:GetLabel()~=0 then loc=LOCATION_GRAVE+LOCATION_ONFIELD end
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ)
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,loc,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,loc,1,1,e:GetHandler())
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(c,Group.FromCards(tc))
end
end
\ No newline at end of file
--世坏转心
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,56099748)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND)
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)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+1)
e2:SetTarget(s.reptg)
e2:SetValue(s.repval)
e2:SetOperation(s.repop)
c:RegisterEffect(e2)
end
function s.chcfilter(c)
return c:IsCode(56099748) and c:IsFaceup()
end
function s.thfilter(c)
return c:IsSetCard(0x198) and c:IsAbleToHand()
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x198) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.desfilter(c,e,tp,check)
return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) or
(check and Duel.GetMZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(s.chcfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp))
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local check=Duel.IsExistingMatchingCard(s.chcfilter,tp,LOCATION_ONFIELD,0,1,nil)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and s.desfilter(chkc,e,tp,check) end
if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_ONFIELD,0,1,c,e,tp,check) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_ONFIELD,0,1,1,c,e,tp,check)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local check=Duel.IsExistingMatchingCard(s.chcfilter,tp,LOCATION_ONFIELD,0,1,nil)
local b1=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_GRAVE,0,nil)
local b2=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
local off=1
local ops={}
local opval={}
if b1 then
ops[off]=1190
opval[off-1]=1
off=off+1
end
if b2 and check then
ops[off]=1152
opval[off-1]=2
off=off+1
end
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and opval[Duel.SelectOption(tp,table.unpack(ops))]==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
th=b1:Select(tp,1,1,nil)
Duel.SendtoHand(th,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,th)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sp=b1:Select(tp,1,1,nil)
Duel.SpecialSummon(sp,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.repfilter(c,tp)
return not c:IsReason(REASON_REPLACE) and c:IsFaceup() and c:IsSummonLocation(LOCATION_EXTRA) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsReason(REASON_EFFECT)
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(s.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function s.repval(e,c)
return s.repfilter(c,e:GetHandlerPlayer())
end
function s.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment