Commit 19bb0f68 authored by Nemo Ma's avatar Nemo Ma

0208 wd

parent 75c53578
......@@ -41,6 +41,16 @@
130002004 0
130002005 0
#WILD, I say WILD, WAHAHA
47320241 0
47320242 0
47320243 0
47320244 0
47320245 0
47320246 0
47320247 0
47320248 0
47320249 0
47320250 0
12847200 0
17339110 0
17339120 0
......
No preview for this file type
-- 神明的祭品 茉莉亚
local s,id=GetID()
function s.initial_effect(c)
s.sprule(c)
s.spsummon(c)
s.active(c)
end
function s.sprule(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.sprcon)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SET_AVAILABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_DECK)
e2:SetCondition(s.sprcon2)
e2:SetOperation(s.sprop)
c:RegisterEffect(e2)
end
function s.sprfilter(c)
return c:IsFaceup() and c:IsCode(47320242)
end
function s.sprcon(e,c)
if c==nil then return true end
if c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.sprfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.sprcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetFlagEffect(tp,47320248)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil)
end
function s.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.ResetFlagEffect(tp,47320248)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function s.spsummon(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCondition(s.spcon)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)==0
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id)~=0 then return end
Duel.Hint(HINT_CARD,0,id)
Duel.RegisterFlagEffect(tp,id,0,0,1)
Duel.RegisterFlagEffect(tp,47320242,0,0,1)
end
function s.active(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(s.accon)
e1:SetOperation(s.acop)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
function s.accon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id-1000)==0 and Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0
end
function s.acop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id-1000)~=0 then return end
Duel.Hint(HINT_CARD,0,id)
Duel.RegisterFlagEffect(tp,id-1000,RESET_PHASE+PHASE_END,0,1)
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_CANNOT_ACTIVATE)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetTargetRange(1,0)
e0:SetValue(s.aclimit)
e0:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e0,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetTargetRange(LOCATION_SZONE,0)
e1:SetCountLimit(1)
e1:SetCondition(s.actcon)
e1:SetTarget(s.acttg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER)
end
function s.filter(c)
return c:IsCode(47320242) and c:IsFaceup()
end
function s.actcon(e)
return Duel.IsExistingMatchingCard(s.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function s.acttg(e,c)
return c:GetType()&TYPE_TRAP~=0
end
\ No newline at end of file
-- 无貌之神 安怯
local s,id=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,47320241)
c:SetUniqueOnField(1,0,47320242)
s.sprule(c)
s.bindes(c)
s.cnbbt(c)
s.eindes(c)
s.cnremove(c)
end
function s.sprule(c)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK)
e1:SetCondition(s.sprcon)
e1:SetTarget(s.sprtg)
e1:SetOperation(s.sprop)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
Duel.AddCustomActivityCounter(id-1000,ACTIVITY_SUMMON,s.counterfilter)
end
function s.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
function s.counterfilter(c)
return c:IsCode(47320241)
end
function s.spfilter1(c)
return c:IsCode(47320241) and c:IsAbleToGraveAsCost()
end
function s.spfilter2(c)
return aux.IsCodeListed(c,47320241) and c:IsAbleToGraveAsCost()
end
function s.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
if Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)~=0 or Duel.GetCustomActivityCount(id-1000,tp,ACTIVITY_CHAIN)~=0 then return false end
if c:IsLocation(LOCATION_DECK) and Duel.GetFlagEffect(tp,47320242)==0 then return false end
local g1=Duel.GetMatchingGroup(s.spfilter1,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(s.spfilter2,tp,LOCATION_HAND+LOCATION_DECK,0,c)
return #g1>0 and #g2>0
end
function s.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,s.spfilter1,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil)
local g2=Duel.SelectMatchingCard(tp,s.spfilter2,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,c)
g1:Merge(g2)
if g1 then
g1:KeepAlive()
e:SetLabelObject(g1)
return true
else return false end
end
function s.sprop(e,tp,eg,ep,ev,re,r,rp,c)
if c:IsLocation(LOCATION_DECK) then
Duel.ResetFlagEffect(tp,47320242)
end
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_SPSUMMON)
g:DeleteGroup()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(s.sumlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetTargetRange(1,0)
e2:SetValue(s.aclimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function s.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsCode(47320241)
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER)
end
function s.bindes(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(s.indtg)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function s.indtg(e,c)
local tc=e:GetHandler()
return c==tc or c==tc:GetBattleTarget()
end
function s.cnbbt(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(s.atlimit)
c:RegisterEffect(e1)
end
function s.atlimit(e,c)
return c:IsFaceup() and c:IsCode(47320241)
end
function s.eindes(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(s.efftg)
e1:SetValue(1)
c:RegisterEffect(e1)
end
function s.efftg(e,c)
return c==e:GetHandler() or c:IsLocation(LOCATION_SZONE)
end
function s.cnremove(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_REMOVE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,1)
e1:SetTarget(s.efilter)
e1:SetValue(1)
c:RegisterEffect(e1)
end
function s.efilter(e,c,rp,r,re)
local tp=e:GetHandlerPlayer()
return (c==e:GetHandler() or (c:IsLocation(LOCATION_SZONE) and c:IsControler(tp) and c:GetSequence()<5))
and r&REASON_EFFECT>0 and r&REASON_REDIRECT==0
end
\ No newline at end of file
-- 招祭的仪式场
local s,id=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,47320241)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
s.tohand(c)
s.draw(c)
s.place(c)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
function s.tohand(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_HANDES)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,id)
e2:SetCost(s.cost)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER)
end
function s.thfilter(c)
return (c:IsCode(47320241) or aux.IsCodeListed(c,47320241)) 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)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 and g:GetFirst():IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
Duel.BreakEffect()
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
end
end
function s.draw(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,id-1000)
e3:SetCost(s.cost)
e3:SetTarget(s.drtg)
e3:SetOperation(s.drop)
c:RegisterEffect(e3)
end
function s.cfilter(c,tp)
return c:IsCode(47320242) and c:IsControler(tp) and c:IsFaceup()
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(s.cfilter,nil,tp)
if chk==0 then return #g>0 and g:IsExists(Card.IsAbleToGrave,1,nil) and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(s.cfilter,nil,tp):Filter(Card.IsAbleToGrave,nil)
if #g==0 then return end
local tc=g:GetFirst()
if #g>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
tc=g:Select(tp,1,1,nil):GetFirst()
end
if Duel.SendtoGrave(tc,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_GRAVE) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function s.place(c)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,id-2000)
e4:SetCondition(s.tfcon)
e4:SetCost(s.cost)
e4:SetTarget(s.tftg)
e4:SetOperation(s.tfop)
c:RegisterEffect(e4)
end
function s.tfcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND+LOCATION_DECK)
end
function s.tftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function s.tfop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(c,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
end
end
-- 为毁灭异族发起的献祭
local s,id=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,47320241,47320242)
s.activate1(c)
s.activate2(c)
s.reset(c)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
function s.activate1(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.con1)
e1:SetTarget(s.tg1)
e1:SetOperation(s.op1)
c:RegisterEffect(e1)
end
function s.cfilter1(c)
return c:IsFaceup() and c:IsCode(47320242)
end
function s.con1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.spfilter1(c)
return c:IsCode(47320241) and c:IsAbleToGrave()
end
function s.spfilter2(c,e,tp)
return c:IsCode(47320242) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function s.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter1,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.op1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,s.spfilter1,tp,LOCATION_DECK,0,1,1,nil)
if #g1==0 then return end
if Duel.SendtoGrave(g1,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,s.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
end
function s.activate2(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(s.con2)
e2:SetTarget(s.tg2)
e2:SetOperation(s.op2)
c:RegisterEffect(e2)
end
function s.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=2
and Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_ONFIELD)
end
function s.op2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,2)
Duel.DisableShuffleCheck()
if Duel.SendtoGrave(g,REASON_EFFECT)>0 then
local ct=g:FilterCount(function(c) return c:IsType(TYPE_TRAP) and c:IsLocation(LOCATION_GRAVE) end,nil)
if ct>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,ct,nil)
if #dg>0 then
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
end
function s.reset(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetCondition(s.rscon)
e3:SetTarget(s.rstg)
e3:SetOperation(s.rsop)
c:RegisterEffect(e3)
end
function s.rsfilter(c)
return (c:IsCode(47320241) or c:IsType(TYPE_TRAP)) and c:IsAbleToDeck()
end
function s.rscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0
end
function s.rstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.rsfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and e:GetHandler():IsSSetable()
and Duel.IsExistingTarget(s.rsfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=Duel.SelectTarget(tp,s.rsfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function s.rsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SSet(tp,c)~=0 then
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
-- 落入尸骨潭的少女
local s,id=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,47320241,47320242)
s.activate1(c)
s.activate2(c)
s.reset(c)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
function s.activate1(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.con1)
e1:SetTarget(s.tg1)
e1:SetOperation(s.op1)
c:RegisterEffect(e1)
end
function s.cfilter1(c)
return c:IsFaceup() and c:IsCode(47320241)
end
function s.con1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.spfilter(c,e,tp)
return c:IsCode(47320241) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.drfilter(c)
return c:IsCode(47320242) and c:IsFaceup()
end
function s.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
if Duel.IsExistingMatchingCard(s.drfilter,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
end
function s.op1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
if Duel.IsExistingMatchingCard(s.drfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsPlayerCanDraw(tp,1) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function s.activate2(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(s.con2)
e2:SetTarget(s.tg2)
e2:SetOperation(s.op2)
c:RegisterEffect(e2)
end
function s.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.disfilter(c,e)
return c:IsFaceup() and c:IsCanBeDisabledByEffect(e)
end
function s.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=2
and Duel.IsExistingMatchingCard(s.disfilter,tp,0,LOCATION_ONFIELD,1,nil,e) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_DECK)
end
function s.op2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,2)
Duel.DisableShuffleCheck()
if Duel.SendtoGrave(g,REASON_EFFECT)>0 then
local ct=g:FilterCount(function(c) return c:IsType(TYPE_TRAP) and c:IsLocation(LOCATION_GRAVE) end,nil)
if ct>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local dg=Duel.SelectMatchingCard(tp,s.disfilter,tp,0,LOCATION_ONFIELD,1,ct,nil,e)
Duel.HintSelection(dg)
for tc in aux.Next(dg) do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(e:GetHandler())
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=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=e1:Clone()
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
tc:RegisterEffect(e3)
end
end
end
end
end
function s.reset(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetCondition(s.rscon)
e3:SetTarget(s.rstg)
e3:SetOperation(s.rsop)
c:RegisterEffect(e3)
end
function s.rsfilter(c)
return (c:IsCode(47320241) or c:IsType(TYPE_TRAP)) and c:IsAbleToDeck()
end
function s.rscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0
end
function s.rstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.rsfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and e:GetHandler():IsSSetable()
and Duel.IsExistingTarget(s.rsfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=Duel.SelectTarget(tp,s.rsfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function s.rsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SSet(tp,c)~=0 then
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
-- 似是而非的神降
local s,id=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,47320241,47320242)
s.activate1(c)
s.activate2(c)
s.reset(c)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
function s.activate1(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(s.con1)
e1:SetTarget(s.tg1)
e1:SetOperation(s.op1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e2)
end
function s.cfilter1(c)
return c:IsFaceup() and c:IsCode(47320242)
end
function s.con1(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep and Duel.GetCurrentChain()==0
and Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,#eg,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,#eg,0,0)
end
function s.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
function s.activate2(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(s.con2)
e2:SetTarget(s.tg2)
e2:SetOperation(s.op2)
c:RegisterEffect(e2)
end
function s.cfilter2(c)
return c:IsFaceup() and c:IsCode(47320241)
end
function s.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_ONFIELD,0,1,nil)
and re:IsHasCategory(CATEGORY_SPECIAL_SUMMON) and Duel.IsChainDisablable(ev)
end
function s.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.op2(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function s.reset(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetCondition(s.rscon)
e3:SetTarget(s.rstg)
e3:SetOperation(s.rsop)
c:RegisterEffect(e3)
end
function s.rsfilter(c)
return (c:IsCode(47320241) or c:IsType(TYPE_TRAP)) and c:IsAbleToDeck()
end
function s.rscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0
end
function s.rstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.rsfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and e:GetHandler():IsSSetable()
and Duel.IsExistingTarget(s.rsfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=Duel.SelectTarget(tp,s.rsfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function s.rsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SSet(tp,c)~=0 then
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
-- 出于怜悯的契约
local s,id=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,47320241,47320248)
s.activate1(c)
s.activate2(c)
s.reset(c)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
function s.activate1(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.con1)
e1:SetTarget(s.tg1)
e1:SetOperation(s.op1)
c:RegisterEffect(e1)
end
function s.cfilter1(c)
return c:IsFaceup() and c:IsCode(47320241)
end
function s.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=2 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_DECK)
end
function s.setfilter(c)
return c:IsType(TYPE_TRAP) and c:IsSSetable()
end
function s.op1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,2)
Duel.DisableShuffleCheck()
if Duel.SendtoGrave(g,REASON_EFFECT)>0 then
local ct=g:FilterCount(function(c) return c:IsType(TYPE_TRAP) and c:IsLocation(LOCATION_GRAVE) end,nil)
if ct>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,ct,nil)
if #sg>0 then
Duel.SSet(tp,sg)
end
end
end
end
function s.activate2(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(s.con2)
e2:SetTarget(s.tg2)
e2:SetOperation(s.op2)
c:RegisterEffect(e2)
end
function s.cfilter2(c)
return c:IsFaceup() and c:IsCode(47320248)
end
function s.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_ONFIELD,0,nil)
if chk==0 then return ct>0 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_GRAVE)
end
function s.op2(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_ONFIELD,0,nil)
if ct>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,ct,nil)
if #g>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
function s.reset(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetCondition(s.rscon)
e3:SetTarget(s.rstg)
e3:SetOperation(s.rsop)
c:RegisterEffect(e3)
end
function s.rsfilter(c)
return (c:IsCode(47320241) or c:IsType(TYPE_TRAP)) and c:IsAbleToDeck()
end
function s.rscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0
end
function s.rstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.rsfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and e:GetHandler():IsSSetable()
and Duel.IsExistingTarget(s.rsfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=Duel.SelectTarget(tp,s.rsfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function s.rsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SSet(tp,c)~=0 then
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
-- 禁神的契者 茉莉亚
local s,id=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcMix(c,true,true,47320241,47320242)
local e0=aux.AddContactFusionProcedure(c,aux.FilterBoolFunction(Card.IsReleasable,REASON_SPSUMMON),LOCATION_ONFIELD,0,Duel.Release,REASON_SPSUMMON+REASON_MATERIAL)
e0:SetDescription(aux.Stringid(id,0))
aux.AddCodeList(c,47320241,47320242)
s.sprule(c)
s.eff1(c)
s.eff2(c)
s.eff3(c)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
function s.sprule(c)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetRange(LOCATION_EXTRA)
e0:SetValue(aux.fuslimit)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(s.hspcon)
e1:SetTarget(s.hsptg)
e1:SetOperation(s.hspop)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsReleasable()
end
function s.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,0,3,nil)
end
function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_ONFIELD,0,3,3,nil)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function s.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Release(g,REASON_SPSUMMON+REASON_MATERIAL)
g:DeleteGroup()
end
function s.eff1(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(s.con)
e1:SetOperation(s.op1)
c:RegisterEffect(e1)
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 and Duel.GetFlagEffect(tp,id-1000)==0
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER)
end
function s.spfilter(c,e,tp)
return c:IsCode(47320241) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.op1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id-1000)~=0 then return end
Duel.Hint(HINT_CARD,0,id)
Duel.RegisterFlagEffect(tp,id-1000,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(tp,47320248,RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.eff2(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(s.cost2)
e1:SetCountLimit(1,id)
c:RegisterEffect(e1)
end
function s.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.eff3(c)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.con3)
e3:SetOperation(s.op3)
c:RegisterEffect(e3)
end
function s.con3(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return Duel.GetFlagEffect(tp,id-2000)==0 and rp==tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_TRAP)
and rc:GetType()&TYPE_TRAP~=0 and rc:IsRelateToEffect(re) and rc:IsCanTurnSet() and rc:IsStatus(STATUS_LEAVE_CONFIRMED)
end
function s.op3(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if Duel.GetFlagEffect(tp,id-2000)==0 and Duel.SelectEffectYesNo(tp,rc,aux.Stringid(id,3)) then
rc:CancelToGrave()
Duel.ChangePosition(rc,POS_FACEDOWN)
Duel.RaiseEvent(rc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
Duel.RegisterFlagEffect(tp,id-2000,RESET_PHASE+PHASE_END,0,0)
end
end
-- 禁神与契约少女
local s,id=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,47320241,47320242,47320248)
s.activate1(c)
s.activate2(c)
s.reset(c)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
function s.activate1(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.con1)
e1:SetCost(s.cost)
e1:SetTarget(s.tg1)
e1:SetOperation(s.op1)
c:RegisterEffect(e1)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER)
end
function s.cfilter1(c)
return c:IsFaceup() and c:IsCode(47320242)
end
function s.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)>=3 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_EXTRA)
end
function s.filter(c)
return c:IsCode(47320248) and c:IsFaceup()
end
function s.op1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
if #g<3 then return end
local rg=g:RandomSelect(tp,3)
Duel.ConfirmCards(tp,rg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=rg:Select(tp,1,1,nil)
local ct=1
if Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,0,1,nil) then
ct=2
end
if ct>1 and #rg>1 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg2=rg:Select(tp,1,1,tg:GetFirst())
tg:Merge(tg2)
end
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
Duel.ShuffleExtra(1-tp)
end
function s.activate2(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(s.con2)
e2:SetCost(s.cost)
e2:SetTarget(s.tg2)
e2:SetOperation(s.op2)
c:RegisterEffect(e2)
end
function s.cfilter2(c)
return c:IsFaceup() and c:IsCode(47320248)
end
function s.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
if chk==0 then return ct>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_DECK)
end
function s.op2(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
if ct>0 then
local g=Duel.GetDecktopGroup(1-tp,ct)
if #g>0 then
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
if Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_ONFIELD,0,1,nil) then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
for tc in aux.Next(g) do
if tc:IsType(TYPE_MONSTER) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(aux.tgoval)
tc:RegisterEffect(e1)
end
end
end
end
function s.reset(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,id-1000)
e3:SetCost(s.cost)
e3:SetTarget(s.rstg)
e3:SetOperation(s.rsop)
c:RegisterEffect(e3)
end
function s.rsfilter(c)
return (c:IsCode(47320241) or aux.IsCodeListed(c,47320241)) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and (c:IsAbleToHand() or c:IsAbleToDeck())
end
function s.rstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and s.rsfilter(chkc) end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(s.rsfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil)
and (c:IsAbleToHand() or c:IsAbleToDeck()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tg=Duel.SelectTarget(tp,s.rsfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,1,0,0)
end
function s.rsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local g=Group.FromCards(c,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=g:FilterSelect(tp,Card.IsAbleToHand,1,1,nil)
if #hg>0 then
Duel.SendtoHand(hg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,hg)
g:Sub(hg)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
-- 禁断的狩人
local s,id=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,47320241,47320242)
s.activate(c)
s.reset(c)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
function s.activate(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.con)
e1:SetCost(s.cost)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and Duel.IsChainNegatable(ev)
end
function s.cfilter(c)
return c:IsCode(47320241) and c:IsAbleToGraveAsCost()
end
function s.filter(c)
return c:IsCode(47320242) and c:IsFaceup()
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
if Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
end
function s.thfilter(c)
return aux.IsCodeListed(c,47320241) and c:IsAbleToHand()
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
if Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.BreakEffect()
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function s.reset(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,id-1000)
e3:SetCost(s.cost2)
e3:SetTarget(s.rstg)
e3:SetOperation(s.rsop)
c:RegisterEffect(e3)
end
function s.rscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0
end
function s.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.rsfilter(c)
return c:IsType(TYPE_TRAP) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and (c:IsAbleToHand() or c:IsAbleToDeck())
end
function s.rstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and s.rsfilter(chkc) end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(s.rsfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,e:GetHandler())
and (c:IsAbleToHand() or c:IsAbleToDeck()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tg=Duel.SelectTarget(tp,s.rsfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,1,0,0)
end
function s.rsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local g=Group.FromCards(c,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=g:Select(tp,1,1,nil)
if #hg>0 then
Duel.SendtoHand(hg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,hg)
g:Sub(hg)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
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