Commit 5c913666 authored by Huangnan's avatar Huangnan

0902脚本更新

parent 59aa2303
--奇迹糕点 掉包作战
function c12000051.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,12000051)
e1:SetTarget(c12000051.target1)
e1:SetTarget(c12000051.target2)
e1:SetOperation(c12000051.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,12000151)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c12000051.thtg)
e2:SetOperation(c12000051.thop)
c:RegisterEffect(e2)
end
function c12000051.tgfilter1(c)
return c:IsSetCard(0xfbe) and c:IsAbleToGrave()
end
function c12000051.tgfilter2(c)
return c:IsSetCard(0xfbe) and c:IsAbleToDeck()
end
function c12000051.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12000051.tgfilter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c12000051.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12000051.tgfilter2,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
end
function c12000051.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c12000051.tgfilter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=Duel.SelectMatchingCard(tp,c12000051.tgfilter1,tp,LOCATION_GRAVE,0,1,1,nil)
if tg:GetCount()>0 then
Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)
end
end
function c12000051.filter1(c)
return c:IsFaceup() and c:IsSetCard(0xfbe)
end
function c12000051.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and c12000051.filter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(c12000051.filter2,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
Duel.SelectTarget(tp,c12000051.filter1,tp,LOCATION_REMOVED,0,1,1,nil)
end
function c12000051.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_RETURN)
end
end
\ No newline at end of file
--奇迹糕点 誓言皇后
function c12000052.initial_effect(c)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_EXTRA)
e1:SetCountLimit(1,12000052)
e1:SetCost(c12000052.spcost)
e1:SetTarget(c12000052.sptg)
e1:SetOperation(c12000052.spop)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,12000107)
e3:SetTarget(c12000052.destg)
e3:SetOperation(c12000052.desop)
c:RegisterEffect(e3)
end
function c12000052.cfilter(c)
return c:IsSetCard(0xfbe) and c:IsType(TYPE_SPELL) and c:IsAbleToGrave()
end
function c12000052.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12000052.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c12000052.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c12000052.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,true) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c12000052.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if c:IsRelateToEffect(e) then
local sp=Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP)
c:CompleteProcedure()
if sp~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and Duel.IsPlayerCanSpecialSummonMonster(tp,12000016,0xfbe,0x4011,300,300,1,RACE_PSYCHO,ATTRIBUTE_DARK) and Duel.SelectYesNo(tp,aux.Stringid(12000052,0)) then
Duel.BreakEffect()
if Duel.Destroy(c,REASON_EFFECT)==0 then return end
local token=Duel.CreateToken(tp,12000016)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
token:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetAbsoluteRange(tp,1,0)
e2:SetTarget(c12000052.splimit)
e2:SetReset(RESET_EVENT+0x1fe0000)
Duel.RegisterEffect(e2,tp)
end
end
end
function c12000052.splimit(e,c)
return not c:IsSetCard(0xfbe)
end
function c12000052.desfilter(c)
return c:IsSetCard(0xfbe) and c:IsType(TYPE_NORMAL)
end
function c12000052.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(c12000052.desfilter,tp,LOCATION_MZONE,0,1,nil) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c12000052.desfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c12000052.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) then
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--奇迹糕点 沾糖小姐
function c12000053.initial_effect(c)
--special summon
--summon with no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12000053,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c12000053.ntcon)
e1:SetValue(1)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12000053,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,12000053+EFFECT_COUNT_CODE_DUEL)
e3:SetCost(c12000053.cost)
e3:SetTarget(c12000053.target)
e3:SetOperation(c12000053.operation)
c:RegisterEffect(e3)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12000053,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c12000053.thgt)
e2:SetOperation(c12000053.thop)
c:RegisterEffect(e2)
local e4=e1:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end
function c12000053.tgfilter(c)
return c:IsSetCard(0xfbe) and c:IsAbleToGrave()
end
function c12000053.thgt(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12000053.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c12000053.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c12000053.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c12000053.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xfbe)
end
function c12000053.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c12000053.cfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function c12000053.costfilter(c)
return c:IsFaceup() and c:IsAbleToHandAsCost() and c:IsSetCard(0xfbe)
end
function c12000053.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then
if ft<0 then return false end
if ft==0 then
return Duel.IsExistingMatchingCard(c12000053.costfilter,tp,LOCATION_MZONE,0,1,nil)
else
return Duel.IsExistingMatchingCard(c12000053.costfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
if ft==0 then
local g=Duel.SelectMatchingCard(tp,c12000053.costfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_COST)
else
local g=Duel.SelectMatchingCard(tp,c12000053.costfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_COST)
end
end
function c12000053.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,700)
end
function c12000053.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Damage(tp,700,REASON_EFFECT)
end
end
\ No newline at end of file
--奇迹糕点 糕点回转
function c12000055.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--special Draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12000055,0))
e2:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCost(c12000055.spcost)
e2:SetTarget(c12000055.sptg)
e2:SetOperation(c12000055.spop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetCondition(c12000055.sumcon)
e3:SetTarget(c12000055.target)
e3:SetOperation(c12000055.activate)
c:RegisterEffect(e3)
end
function c12000055.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c12000055.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c12000055.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c12000055.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.Draw(tp,1,REASON_EFFECT)==0 then return end
local tc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-tp,tc)
if tc:IsSetCard(0xfbe) and tc:IsType(TYPE_MONSTER) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.GetMatchingGroup(c12000055.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(12000055,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
else
Duel.DiscardHand(tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD)
end
Duel.ShuffleHand(tp)
end
function c12000055.sumcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetActivityCount(Duel.GetTurnPlayer(),ACTIVITY_SPSUMMON)>=2
end
function c12000055.filter(c,e,tp)
return c:IsSetCard(0xfbe) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function c12000055.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c12000055.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c12000055.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,c12000055.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
\ No newline at end of file
...@@ -81,11 +81,14 @@ function c13254047.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -81,11 +81,14 @@ function c13254047.regop(e,tp,eg,ep,ev,re,r,rp)
e7:SetCode(EVENT_SPSUMMON_SUCCESS) e7:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e7) c:RegisterEffect(e7)
end end
function c13254047.costfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x3356)
end
function c13254047.cost2(e,tp,eg,ep,ev,re,r,rp,chk) function c13254047.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(c13254047.costfilter,tp,LOCATION_HAND,0,3,e:GetHandler()) end if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(c13254047.costfilter1,tp,LOCATION_HAND,0,3,e:GetHandler()) end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local cg=Duel.SelectMatchingCard(tp,c13254047.costfilter,tp,LOCATION_HAND,0,3,3,nil) local cg=Duel.SelectMatchingCard(tp,c13254047.costfilter1,tp,LOCATION_HAND,0,3,3,nil)
Duel.ConfirmCards(1-tp,cg) Duel.ConfirmCards(1-tp,cg)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
end end
--巨大机甲 影舞者
function c13257222.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c13257222.spcon)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--immune
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(c13257222.efilter)
c:RegisterEffect(e4)
--selfdes
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EFFECT_SELF_DESTROY)
e5:SetCondition(c13257222.sdcon)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(13257222,0))
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCode(EVENT_LEAVE_FIELD)
e6:SetCondition(c13257222.tkcon)
e6:SetTarget(c13257222.tktg)
e6:SetOperation(c13257222.tkop)
c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_MZONE)
e7:SetCode(EFFECT_ADD_SETCODE)
e7:SetValue(0x353)
c:RegisterEffect(e7)
local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e12:SetCode(EVENT_SUMMON_SUCCESS)
e12:SetOperation(c13257222.bgmop)
c:RegisterEffect(e12)
local e13=e12:Clone()
e13:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e13)
end
function c13257222.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end
function c13257222.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function c13257222.sdcon(e)
return Duel.GetTurnPlayer()~=e:GetOwnerPlayer() and Duel.GetCurrentPhase()==PHASE_END
end
function c13257222.tkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetLocation()~=LOCATION_DECK
end
function c13257222.tdfilter(c)
return c:IsRace(RACE_FIEND) and c:IsLevelAbove(5)
end
function c13257222.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c13257222.tdfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 end
end
function c13257222.tkop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(13257222,0))
local g=Duel.SelectMatchingCard(tp,c13257222.tdfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
Duel.ConfirmDecktop(tp,1)
end
end
function c13257222.bgmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(11,0,aux.Stringid(13257222,4))
end
--超时空能量胶囊
function c13257326.initial_effect(c)
xpcall(function() require("expansions/script/PowerCapsule") end,function() require("script/PowerCapsule") end)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE+TIMING_EQUIP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c13257326.target)
e1:SetOperation(c13257326.activate)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(13257326,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PREDRAW)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c13257326.thcon)
e2:SetTarget(c13257326.thtg)
e2:SetOperation(c13257326.thop)
c:RegisterEffect(e2)
end
function c13257326.filter(c)
if not c:IsSetCard(0x351) or c:IsFacedown() then return false end
local mt=getmetatable(c)
local PCe=mt[c]
return PCe:IsActivatable(PCe:GetOwnerPlayer())
end
function c13257326.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c13257326.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c13257326.filter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c13257326.filter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
end
function c13257326.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local tep=tc:GetControler()
local mt=getmetatable(tc)
local PCe=mt[tc]
if PCe and PCe:IsActivatable(PCe:GetOwnerPlayer()) then
local cost=PCe:GetCost()
local target=PCe:GetTarget()
local operation=PCe:GetOperation()
Duel.ClearTargetCard()
e:SetProperty(PCe:GetProperty())
tc:CreateEffectRelation(PCe)
if cost then cost(PCe,tep,eg,ep,ev,re,r,rp,1) end
if target then target(PCe,tep,eg,ep,ev,re,r,rp,1) end
if operation then operation(PCe,tep,eg,ep,ev,re,r,rp) end
tc:ReleaseEffectRelation(PCe)
end
end
end
function c13257326.thcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0
and Duel.GetDrawCount(tp)>0
end
function c13257326.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
local dt=Duel.GetDrawCount(tp)
if dt~=0 then
_replace_count=0
_replace_max=dt
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW)
e1:SetValue(0)
Duel.RegisterEffect(e1,tp)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c13257326.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
_replace_count=_replace_count+1
if _replace_count<=_replace_max and c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
--Error-56980
function c17060903.initial_effect(c)
--control
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0)
e1:SetCondition(c17060903.ctcon)
e1:SetTarget(c17060903.cttg)
e1:SetOperation(c17060903.ctop)
c:RegisterEffect(e1)
--activate
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetHintTiming(0,0x1c0)
e2:SetCost(aux.bfgcost)
e2:SetOperation(c17060903.downop)
c:RegisterEffect(e2)
end
function c17060903.IsDomovo_i(c)
local m=_G["c"..c:GetCode()]
return m and m.is_named_with_domovo_i
end
function c17060903.cfilter(c)
return c:IsFaceup() and c17060903.IsDomovo_i(c)
end
function c17060903.ctcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c17060903.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c17060903.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsControlerCanBeChanged() end
if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c17060903.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.GetControl(tc,tp,PHASE_END,1)
end
end
function c17060903.downop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(-800)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e1b=e1:Clone()
e1b:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e1b)
end
--礼装丘
function c17060904.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--attack thrice
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17060904,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,17060904)
e1:SetCondition(c17060904.atkcon)
e1:SetTarget(c17060904.atktg)
e1:SetOperation(c17060904.atkop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c17060904.distg)
e2:SetOperation(c17060904.disop)
c:RegisterEffect(e2)
local e2b=e2:Clone()
e2b:SetCondition(c17060904.discon)
e2b:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2b)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,17060904+100)
e3:SetTarget(c17060904.xyztg)
e3:SetOperation(c17060904.xyzop)
c:RegisterEffect(e3)
end
c17060904.is_named_with_Mercenary_Arthur=1
c17060904.is_named_with_Million_Arthur=1
function c17060904.Mercenary_Arthur(c)
local m=_G["c"..c:GetCode()]
return m and m.is_named_with_Mercenary_Arthur
end
function c17060904.IsMillion_Arthur(c)
local m=_G["c"..c:GetCode()]
return m and m.is_named_with_Million_Arthur
end
function c17060904.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function c17060904.atkfilter(c)
return c:IsFaceup() and c17060904.IsMillion_Arthur(c)
end
function c17060904.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c17060904.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c17060904.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c17060904.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c17060904.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e1:SetValue(2)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c17060904.discon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c17060904.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_SZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c17060904.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+0x47e0000)
e3:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e3,true)
Duel.SpecialSummonComplete()
end
end
function c17060904.xyzfilter(c,e,tp)
return c:IsType(TYPE_XYZ)
end
function c17060904.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c17060904.xyzfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c17060904.xyzfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c17060904.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c17060904.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
Duel.Overlay(tc,Group.FromCards(c))
end
\ No newline at end of file
--礼装富豪
function c17060905.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--eff
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,17060905)
e1:SetCondition(c17060905.effcon)
e1:SetOperation(c17060905.effop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,17060905+100)
e2:SetTarget(c17060905.destg)
e2:SetOperation(c17060905.desop)
c:RegisterEffect(e2)
local e2b=e2:Clone()
e2b:SetCode(EVENT_SPSUMMON_SUCCESS)
e2b:SetCondition(c17060905.descon)
c:RegisterEffect(e2b)
end
c17060905.is_named_with_Regal_Arthur=1
c17060905.is_named_with_Million_Arthur=1
function c17060905.IsRegal_Arthur(c)
local m=_G["c"..c:GetCode()]
return m and m.is_named_with_Regal_Arthur
end
function c17060905.IsMillion_Arthur(c)
local m=_G["c"..c:GetCode()]
return m and m.is_named_with_Million_Arthur
end
function c17060905.effcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c17060905.effop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstMatchingCard(nil,tp,LOCATION_PZONE,0,e:GetHandler())
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LSCALE)
e1:SetValue(4)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_RSCALE)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(tc)
e3:SetDescription(aux.Stringid(17060905,2))
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_PZONE)
e3:SetTarget(c17060905.reptg)
e3:SetValue(c17060905.repval)
e3:SetOperation(c17060905.repop)
tc:RegisterEffect(e3)
end
function c17060905.repfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsLocation(LOCATION_MZONE+LOCATION_PZONE)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE)
end
function c17060905.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetLeftScale()>=4 and eg:IsExists(c17060905.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c17060905.repval(e,c)
return c17060905.repfilter(c,e:GetHandlerPlayer())
end
function c17060905.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LSCALE)
e1:SetValue(-4)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_RSCALE)
c:RegisterEffect(e2)
end
function c17060905.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c17060905.filter(c)
return c:IsFaceup() and c17060905.IsMillion_Arthur(c)
end
function c17060905.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c17060905.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c17060905.filter,tp,LOCATION_EXTRA,0,1,1,nil)
local ag=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) and c:IsRelateToEffect(e) and ag:GetCount()>0then
Duel.HintSelection(ag)
Duel.Destroy(ag,REASON_EFFECT)
end
end
\ No newline at end of file
--宵月魔瑟
function c17060906.initial_effect(c)
--synchro summon
c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(c17060906.matfilter),1)
--pendulum summon
aux.EnablePendulumAttribute(c,false)
--ep effects
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17060906,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetCondition(c17060906.epcon)
e1:SetTarget(c17060906.eptg)
e1:SetOperation(c17060906.epop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17060906,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c17060906.spcon)
e2:SetTarget(c17060906.sptg)
e2:SetOperation(c17060906.spop)
c:RegisterEffect(e2)
--scale
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetTarget(c17060906.atktg)
e3:SetOperation(c17060906.atkop)
c:RegisterEffect(e3)
--pendulum
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(17060906,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(c17060906.pencon)
e4:SetTarget(c17060906.pentg)
e4:SetOperation(c17060906.penop)
c:RegisterEffect(e4)
end
c17060906.is_named_with_Magic_Factions=1
c17060906.is_named_with_Million_Arthur=1
function c17060906.IsMagic_Factions(c)
local m=_G["c"..c:GetCode()]
return m and m.is_named_with_Magic_Factions
end
function c17060906.IsMillion_Arthur(c)
local m=_G["c"..c:GetCode()]
return m and m.is_named_with_Million_Arthur
end
function c17060906.matfilter(c)
return c17060906.IsMillion_Arthur(c)
end
function c17060906.epcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c17060906.filter(c)
return c:IsControlerCanBeChanged() and c:IsFaceup()
end
function c17060906.eptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()==tp and c17060906.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c17060906.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c17060906.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c17060906.epop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.GetControl(tc,1-tp,nil,1)
end
end
function c17060906.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) or e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c17060906.spfilter(c)
return c:IsControlerCanBeChanged() and c:IsFaceup()
end
function c17060906.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c17060906.spfilter,tp,LOCATION_HAND,0,1,nil,e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c17060906.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,c17060906.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,0,tp,false,false)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c17060906.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_PZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_PZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,nil,tp,LOCATION_PZONE,0,1,1,nil)
end
function c17060906.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LSCALE)
e1:SetValue(3)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_RSCALE)
tc:RegisterEffect(e2)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
local bc=g:GetFirst()
local atk=tc:GetLeftScale()
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(math.ceil(atk*100))
e3:SetReset(RESET_EVENT+0x1fe0000)
bc:RegisterEffect(e3)
end
end
function c17060906.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function c17060906.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(1-tp,LOCATION_PZONE,0) or Duel.CheckLocation(1-tp,LOCATION_PZONE,1) end
end
function c17060906.penop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(1-tp,LOCATION_PZONE,0) and not Duel.CheckLocation(1-tp,LOCATION_PZONE,1) then return false end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,1-tp,1-tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
--Darkest 十字军
function c22230001.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22230001,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,22230001)
e1:SetTarget(c22230001.thtg)
e1:SetOperation(c22230001.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
e2:SetOperation(c22230001.flipop)
c:RegisterEffect(e2)
--change battle target
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22230001,2))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c22230001.cbcon)
e2:SetTarget(c22230001.cbtg)
e2:SetOperation(c22230001.cbop)
c:RegisterEffect(e2)
end
c22230001.named_with_Darkest_D=1
function c22230001.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22230001.filter(c)
return c22230001.IsDarkest(c) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_FLIP) and c:IsAbleToHand()
end
function c22230001.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c22230001.filter,tp,LOCATION_DECK,0,1,nil) end
if e:GetHandler():GetFlagEffect(22230001)~=0 then
e:SetLabel(1)
e:GetHandler():ResetFlagEffect(22230001)
else
e:SetLabel(0)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c22230001.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c22230001.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if e:GetLabel()==1 and g:GetFirst():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(22230001,1)) then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,g)
end
end
end
function c22230001.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(22230001,0,0,0)
end
function c22230001.cbcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()~=nil and Duel.GetAttackTarget():IsFacedown() and Duel.GetAttacker():IsCanTurnSet() and e:GetHandler():IsCanTurnSet()
end
function c22230001.cbtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c22230001.cbop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangePosition(Duel.GetAttacker(),POS_FACEDOWN_DEFENSE)
Duel.ChangePosition(e:GetHandler(),POS_FACEDOWN_DEFENSE)
end
\ No newline at end of file
--Darkest 强盗
function c22230002.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22230002,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,222300021)
e1:SetTarget(c22230002.postg)
e1:SetOperation(c22230002.posop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
e2:SetOperation(c22230002.flipop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(22230002,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,222300022)
e3:SetTarget(c22230002.target)
e3:SetOperation(c22230002.operation)
c:RegisterEffect(e3)
end
c22230002.named_with_Darkest_D=1
function c22230002.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22230002.filter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c22230002.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c22230002.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c22230002.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c22230002.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler())
if e:GetHandler():GetFlagEffect(22230002)~=0 then
e:SetLabel(1)
e:GetHandler():ResetFlagEffect(22230002)
else
e:SetLabel(0)
end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c22230002.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
if e:GetLabel()==1 and Duel.SelectYesNo(tp,aux.Stringid(22230002,1)) and e:GetHandler():IsCanTurnSet() then
Duel.ChangePosition(e:GetHandler(),POS_FACEDOWN_DEFENSE)
end
end
function c22230002.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(22230002,0,0,0)
end
function c22230002.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFacedown() end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) end
local g=Duel.SelectTarget(tp,Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c22230002.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not (tc:IsRelateToEffect(e) or tc:IsFacedown()) then return false end
local c=e:GetHandler()
if Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)>0 and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
end
end
\ No newline at end of file
--Darkest 圣职者
function c22230003.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22230003,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,222300031)
e1:SetTarget(c22230003.thtg)
e1:SetOperation(c22230003.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
e2:SetOperation(c22230003.flipop)
c:RegisterEffect(e2)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22230003,2))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,222300032)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c22230003.negcon)
e1:SetTarget(c22230003.negtg)
e1:SetOperation(c22230003.negop)
c:RegisterEffect(e1)
end
c22230003.named_with_Darkest_D=1
function c22230003.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22230003.filter(c)
return c22230003.IsDarkest(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:IsFaceup()
end
function c22230003.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c22230003.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
if e:GetHandler():GetFlagEffect(22230003)~=0 then
e:SetLabel(1)
e:GetHandler():ResetFlagEffect(22230003)
else
e:SetLabel(0)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c22230003.spfilter(c,e,tp)
return c22230003.IsDarkest(c) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_FLIP) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function c22230003.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c22230003.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if e:GetLabel()==1 and Duel.IsExistingMatchingCard(c22230003.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(22230003,1)) then
local g=Duel.SelectMatchingCard(tp,c22230003.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,g)
end
end
end
function c22230003.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(22230003,0,0,0)
end
function c22230003.cfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFacedown()
end
function c22230003.negcon(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(c22230003.cfilter,1,nil) and Duel.IsChainNegatable(ev)
end
function c22230003.negtg(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,POS_FACEDOWN_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c22230003.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and e:GetHandler():IsLocation(LOCATION_HAND) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,e:GetHandler())
end
end
--Darkest 赏金猎人
function c22230004.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22230004,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetTarget(c22230004.postg)
e1:SetOperation(c22230004.posop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
e2:SetOperation(c22230004.flipop)
c:RegisterEffect(e2)
--set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22230004,2))
e1:SetCategory(CATEGORY_POSITION+CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,22230004)
e1:SetTarget(c22230004.sptg)
e1:SetOperation(c22230004.spop)
c:RegisterEffect(e1)
end
c22230004.named_with_Darkest_D=1
function c22230004.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22230004.filter(c)
return c:IsFaceup() and c:IsCanTurnSet() and not (c:IsLocation(LOCATION_PZONE) and c:IsType(TYPE_PENDULUM))
end
function c22230004.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and c22230004.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c22230004.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c22230004.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil)
if e:GetHandler():GetFlagEffect(22230004)~=0 then
e:SetLabel(1)
e:GetHandler():ResetFlagEffect(22230004)
else
e:SetLabel(0)
end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c22230004.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsLocation(LOCATION_SZONE) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
if e:GetLabel()==1 and Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(22230004,1)) then
local dg=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil)
if dg then Duel.Destroy(dg,REASON_EFFECT) end
end
end
function c22230004.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(22230004,0,0,0)
end
function c22230004.spfilter(c)
return c:IsFaceup() and c:IsCanTurnSet() and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_FLIP) and c22230004.IsDarkest(c)
end
function c22230004.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c22230004.spfilter(chkc) end
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.IsExistingTarget(c22230004.spfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c22230004.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c22230004.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() then
if Duel.ChangePosition(tc,POS_FACEDOWN)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsLocation(LOCATION_GRAVE) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
end
end
end
\ No newline at end of file
--Darkest 神秘学者
function c22230005.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22230005,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,222300051)
e1:SetTarget(c22230005.thtg)
e1:SetOperation(c22230005.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
e2:SetOperation(c22230005.flipop)
c:RegisterEffect(e2)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(22230005,2))
e4:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_POSITION)
e4:SetCode(EVENT_CHAINING)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetCountLimit(1,222300052)
e4:SetCondition(c22230005.negcon)
e4:SetTarget(c22230005.negtg)
e4:SetOperation(c22230005.negop)
c:RegisterEffect(e4)
end
c22230005.named_with_Darkest_D=1
function c22230005.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22230005.filter(c)
return c22230005.IsDarkest(c) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c22230005.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c22230005.filter,tp,LOCATION_DECK,0,1,nil) end
if e:GetHandler():GetFlagEffect(22230005)~=0 then
e:SetLabel(1)
e:GetHandler():ResetFlagEffect(22230005)
else
e:SetLabel(0)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c22230005.sfilter(c)
return c22230005.IsDarkest(c) and c:IsType(TYPE_TRAP) and c:IsSSetable()
end
function c22230005.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c22230005.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if e:GetLabel()==1 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(c22230005.sfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(22230005,1)) then
local sg=Duel.SelectMatchingCard(tp,c22230005.sfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SSet(tp,sg)
Duel.ConfirmCards(1-tp,sg)
end
end
end
function c22230005.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(22230005,0,0,0)
end
function c22230005.negcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and rp~=tp
end
function c22230005.thfilter(c,tpe)
return c22230005.IsDarkest(c) and c:IsType(tpe) and c:IsSSetable()
end
function c22230005.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
local tpe=re:GetHandler():GetType()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(c22230005.thfilter,tp,LOCATION_GRAVE,0,1,nil,tpe) and e:GetHandler():IsCanTurnSet() end
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
function c22230005.negop(e,tp,eg,ep,ev,re,r,rp)
local tpe=re:GetHandler():GetType()
if not (Duel.GetLocationCount(tp,LOCATION_SZONE)>0 or Duel.IsExistingMatchingCard(c22230005.thfilter,tp,LOCATION_GRAVE,0,1,nil,tpe))then return false end
local sg=Duel.SelectMatchingCard(tp,c22230005.thfilter,tp,LOCATION_GRAVE,0,1,1,nil,tpe)
if sg then
if Duel.SSet(tp,sg)>0 then
Duel.ChangePosition(e:GetHandler(),POS_FACEDOWN_DEFENSE)
end
end
end
\ No newline at end of file
--Darkest 麻风病人
function c22230006.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22230006,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,222300061)
e1:SetTarget(c22230006.postg)
e1:SetOperation(c22230006.posop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
e2:SetOperation(c22230006.flipop)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(22230006,1))
e3:SetCategory(CATEGORY_POSITION+CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,222300062)
e3:SetCondition(c22230006.discon)
e3:SetTarget(c22230006.distg)
e3:SetOperation(c22230006.disop)
c:RegisterEffect(e3)
end
c22230006.named_with_Darkest_D=1
function c22230006.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22230006.filter(c)
return c:IsFaceup() and not c:IsDisabled()
end
function c22230006.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c22230006.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c22230006.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c22230006.filter,tp,0,LOCATION_MZONE,1,1,nil)
if e:GetHandler():GetFlagEffect(22230006)~=0 then
e:SetLabel(1)
e:GetHandler():ResetFlagEffect(22230006)
else
e:SetLabel(0)
end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c22230006.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
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+0x1fe0000)
tc:RegisterEffect(e2)
if e:GetLabel()==1 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE)
e1:SetCode(EFFECT_FORBIDDEN)
e1:SetTarget(c22230006.bantg)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetLabelObject(tc)
Duel.RegisterEffect(e1,tp)
end
end
end
function c22230006.bantg(e,c)
return c==e:GetLabelObject()
end
function c22230006.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(22230006,0,0,0)
end
function c22230006.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_HAND and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp~=tp and re:IsActiveType(TYPE_MONSTER)
end
function c22230006.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanTurnSet() end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
function c22230006.disop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.NegateEffect(ev) then return end
Duel.ChangePosition(e:GetHandler(),POS_FACEDOWN_DEFENSE)
end
\ No newline at end of file
--Darkest 死灵法师
function c22230121.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsType,TYPE_FLIP),3,2)
c:EnableReviveLimit()
--Overlay
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(22230121,0))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c22230121.olcon)
e4:SetOperation(c22230121.olop)
c:RegisterEffect(e4)
--pos
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(22230121,1))
e6:SetCategory(CATEGORY_POSITION)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetHintTiming(0,TIMING_MAIN_END)
e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1)
e6:SetCondition(c22230121.poscon)
e6:SetCost(c22230121.poscost)
e6:SetTarget(c22230121.postg)
e6:SetOperation(c22230121.posop)
c:RegisterEffect(e6)
--set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22230121,2))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetTarget(c22230121.sptg)
e1:SetOperation(c22230121.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
e2:SetOperation(c22230121.flipop)
c:RegisterEffect(e2)
end
c22230121.named_with_Darkest_D=1
function c22230121.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22230121.cfilter(c,tp)
return c22230121.IsDarkest(c) and c:IsType(TYPE_FLIP) and c:IsType(TYPE_MONSTER)
end
function c22230121.olcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c22230121.cfilter,1,nil,tp)
end
function c22230121.olop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=eg:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
Duel.Overlay(c,sg)
end
function c22230121.poscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c22230121.poscost(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 c22230121.posfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c22230121.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c22230121.posfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c22230121.posfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c22230121.posfilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_POSITION,0,2,0,0)
end
function c22230121.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
Duel.ChangePosition(e:GetHandler(),POS_FACEDOWN_DEFENSE)
end
function c22230121.spfilter(c)
return c22230121.IsDarkest(c) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_FLIP) and c:IsAbleToHand()
end
function c22230121.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetHandler():GetOverlayGroup()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:IsExists(c22230121.spfilter,1,nil) end
if e:GetHandler():GetFlagEffect(22230121)~=0 then
e:SetLabel(1)
e:GetHandler():ResetFlagEffect(22230121)
else
e:SetLabel(0)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
end
function c22230121.spop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetHandler():GetOverlayGroup():Filter(c22230121.spfilter,1,nil)
if g:GetCount()<1 then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
if sg:GetCount()>0 then
local sc=sg:GetFirst()
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
if e:GetLabel()==1 and sc:IsCanTurnSet() and Duel.SelectYesNo(tp,aux.Stringid(22230121,3)) then
Duel.ChangePosition(sc,POS_FACEDOWN_DEFENSE)
end
end
end
function c22230121.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(22230121,0,0,0)
end
--Darkest 先知
function c22230122.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsType,TYPE_FLIP),3,2)
c:EnableReviveLimit()
--pos
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(22230122,0))
e6:SetCategory(CATEGORY_POSITION+CATEGORY_TOHAND)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetHintTiming(0,TIMING_MAIN_END)
e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1)
e6:SetCondition(c22230122.poscon)
e6:SetCost(c22230122.poscost)
e6:SetTarget(c22230122.postg)
e6:SetOperation(c22230122.posop)
c:RegisterEffect(e6)
--ANNOUNCE
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22230122,1))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetTarget(c22230122.tdtg)
e1:SetOperation(c22230122.tdop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
e2:SetOperation(c22230122.flipop)
c:RegisterEffect(e2)
end
c22230122.named_with_Darkest_D=1
function c22230122.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22230122.poscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c22230122.poscost(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 c22230122.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsFacedown() and chkc:IsLocation(LOCATION_ONFIELD) end
if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and e:GetHandler():IsCanTurnSet() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
local g=Duel.SelectTarget(tp,Card.IsFacedown,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c22230122.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() then
if Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)>0 and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
end
function c22230122.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.Hint(HINT_SELECTMSG,tp,564)
c22230122.announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCardFilter(tp,table.unpack(c22230122.announce_filter))
Duel.SetTargetParam(ac)
if e:GetHandler():GetFlagEffect(22230122)~=0 then
Duel.SetChainLimit(aux.FALSE)
e:GetHandler():ResetFlagEffect(22230122)
end
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,ANNOUNCE_CARD)
end
function c22230122.tdop(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_HAND,nil,ac)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
function c22230122.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(22230122,0,0,0)
end
\ No newline at end of file
--Darkest 塞壬
function c22230123.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsType,TYPE_FLIP),3,2)
c:EnableReviveLimit()
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22230123,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_TOHAND+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c22230123.negcon)
e1:SetCost(c22230123.negcost)
e1:SetTarget(c22230123.negtg)
e1:SetOperation(c22230123.negop)
c:RegisterEffect(e1)
--getOverlay
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22230123,1))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,22230123)
e1:SetTarget(c22230123.tdtg)
e1:SetOperation(c22230123.tdop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
e2:SetOperation(c22230123.flipop)
c:RegisterEffect(e2)
end
c22230123.named_with_Darkest_D=1
function c22230123.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22230123.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
end
function c22230123.negcost(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 c22230123.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return re:GetHandler():IsAbleToRemove() and e:GetHandler():IsCanTurnSet() end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,eg,1,0,0)
end
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
function c22230123.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.ChangePosition(e:GetHandler(),POS_FACEDOWN_DEFENSE)>0 then
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.SendtoHand(eg,nil,REASON_EFFECT)
end
end
end
function c22230123.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsFacedown() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
Duel.SelectTarget(tp,Card.IsFacedown,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
if e:GetHandler():GetFlagEffect(22230123)~=0 then
e:SetLabel(1)
e:GetHandler():ResetFlagEffect(22230123)
else
e:SetLabel(0)
end
end
function c22230123.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFacedown() then
Duel.Overlay(e:GetHandler(),tc)
if e:GetLabel()==1 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_EFFECT) and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(22230123,2)) then
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c22230123.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(22230123,0,0,0)
end
--Darkest 巨炮
function c22230124.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsType,TYPE_FLIP),3,2)
c:EnableReviveLimit()
--pos change
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_POSITION)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c22230124.postg)
e3:SetOperation(c22230124.posop)
c:RegisterEffect(e3)
--pos
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22230124,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,22230124)
e1:SetCost(c22230124.tdcost)
e1:SetTarget(c22230124.tdtg)
e1:SetOperation(c22230124.tdop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
e2:SetOperation(c22230124.flipop)
c:RegisterEffect(e2)
end
c22230124.named_with_Darkest_D=1
function c22230124.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22230124.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsFaceup() and e:GetHandler():IsCanTurnSet() end
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
function c22230124.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsCanTurnSet() and c:IsRelateToEffect(e) then
Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)
end
end
function c22230124.tdcost(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 c22230124.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
if e:GetHandler():GetFlagEffect(22230121)~=0 then
Duel.SetChainLimit(aux.FALSE)
e:GetHandler():ResetFlagEffect(22230121)
end
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c22230124.mafilter(c,tp)
return c22230124.IsDarkest(c) and c:IsType(TYPE_MONSTER)
end
function c22230124.xyzfilter(c,tp)
return c22230124.IsDarkest(c) and c:IsType(TYPE_XYZ)
end
function c22230124.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.ChangePosition(g,POS_FACEUP_DEFENSE)
if g:IsExists(Card.IsType,1,nil,TYPE_FLIP) and Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(22230123,5)) then
Duel.BreakEffect()
local g=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.Destroy(g,REASON_EFFECT)
end
if g:IsExists(Card.IsType,1,nil,TYPE_SYNCHRO) and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(22230123,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
if g:IsExists(Card.IsType,1,nil,TYPE_FUSION) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(22230123,2)) then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
Duel.Remove(g:RandomSelect(tp,1),POS_FACEUP,REASON_EFFECT)
end
if g:IsExists(Card.IsType,1,nil,TYPE_PENDULUM) and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_PZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(22230123,3)) then
Duel.BreakEffect()
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_PZONE,1,1,nil)
local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
if g:IsExists(Card.IsType,1,nil,TYPE_XYZ) and Duel.IsExistingMatchingCard(c22230124.xyzfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(c22230124.mafilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(22230123,4)) then
Duel.BreakEffect()
local xyzg=Duel.GetMatchingGroup(c22230124.xyzfilter,tp,LOCATION_MZONE,0,nil)
local m=xyzg:GetCount()
local mag=Duel.SelectMatchingCard(tp,c22230124.mafilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,m,nil)
while mag:GetCount()>0 and xyzg:GetCount()>0 do
local tg=xyzg:Select(tp,1,1,nil)
local mg=mag:Select(tp,1,1,nil)
Duel.Overlay(tg:GetFirst(),mg:GetFirst())
xyzg:RemoveCard(tg:GetFirst())
mag:RemoveCard(mg:GetFirst())
end
end
end
function c22230124.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(22230124,0,0,0)
end
\ No newline at end of file
--Darkest 先祖
function c22230162.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_FLIP),2)
c:EnableReviveLimit()
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(22230162,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c22230162.thtg)
e3:SetOperation(c22230162.thop)
c:RegisterEffect(e3)
--atk
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_CHANGE_POS)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetCondition(c22230162.condition)
e3:SetOperation(c22230162.operation)
c:RegisterEffect(e3)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22230162,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c22230162.cost)
e1:SetTarget(c22230162.sptg)
e1:SetOperation(c22230162.spop)
c:RegisterEffect(e1)
end
c22230162.named_with_Darkest_D=1
function c22230162.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22230162.thfilter(c)
return c:IsFacedown() and c:IsAbleToHand()
end
function c22230162.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c22230162.thfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.SelectTarget(tp,c22230162.thfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,3,nil) then
Duel.SetChainLimit(aux.FALSE)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c22230162.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFacedown() then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c22230162.cfilter(c)
local np=c:GetPosition()
local pp=c:GetPreviousPosition()
return np~=pp
end
function c22230162.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c22230162.cfilter,1,nil)
end
function c22230162.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsAttackBelow(2500) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
function c22230162.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAttackAbove(1500) end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1ff0000)
e1:SetValue(-1500)
e:GetHandler():RegisterEffect(e1)
end
function c22230162.filter(c,e,tp,zone)
return c22230162.IsDarkest(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c22230162.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local zone=e:GetHandler():GetLinkedZone()
return zone~=0 and Duel.IsExistingMatchingCard(c22230162.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,zone)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c22230162.spop(e,tp,eg,ep,ev,re,r,rp)
local zone=e:GetHandler():GetLinkedZone()
if zone==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c22230162.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,zone)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP,zone)
end
end
\ No newline at end of file
--Darkest 先祖的遗嘱
function c22231001.initial_effect(c)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TODECK+CATEGORY_TOHAND)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,22231001+EFFECT_COUNT_CODE_OATH)
e3:SetTarget(c22231001.target)
e3:SetOperation(c22231001.operation)
c:RegisterEffect(e3)
--pos
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22231001,0))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetCost(c22231001.poscost)
e2:SetTarget(c22231001.postg)
e2:SetOperation(c22231001.posop)
c:RegisterEffect(e2)
end
c22231001.named_with_Darkest_D=1
function c22231001.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22231001.tgfilter(c)
return c:IsFacedown() and c:IsAbleToDeck()
end
function c22231001.thfilter(c)
return c22231001.IsDarkest(c) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function c22231001.spfilter(c,e,tp)
return c22231001.IsDarkest(c) and c:IsType(TYPE_FLIP) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function c22231001.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFacedown() end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(c22231001.tgfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(c22231001.thfilter,tp,LOCATION_DECK,0,2,nil) end
local g=Duel.SelectTarget(tp,c22231001.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c22231001.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not (tc:IsRelateToEffect(e) or tc:IsFacedown()) then return false end
local c=e:GetHandler()
if Duel.SendtoDeck(tc,nil,2,REASON_EFFECT) then
local g=Duel.SelectMatchingCard(tp,c22231001.thfilter,tp,LOCATION_DECK,0,2,2,nil)
if g:GetCount()>1 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if tc:IsLocation(LOCATION_EXTRA) and Duel.IsExistingMatchingCard(c22231001.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(22231001,0)) then
local sg=Duel.SelectMatchingCard(tp,c22231001.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,sg)
end
end
end
end
end
function c22231001.poscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c22231001.posfilter(c)
return c22231001.IsDarkest(c) and c:IsFaceup() and c:IsCanTurnSet()
end
function c22231001.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c22231001.posfilter,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.GetMatchingGroup(c22231001.posfilter,tp,LOCATION_MZONE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c22231001.posop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c22231001.posfilter,tp,LOCATION_MZONE,0,nil)
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
\ No newline at end of file
--Darkest 不详的采掘
function c22231002.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,222310021+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c22231002.target)
e1:SetOperation(c22231002.activate)
c:RegisterEffect(e1)
--todeck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22231002,0))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,222310022)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetTarget(c22231002.tdtg)
e2:SetOperation(c22231002.tdop)
c:RegisterEffect(e2)
end
c22231002.named_with_Darkest_D=1
function c22231002.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22231002.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 end
end
function c22231002.filter(c)
return c22231002.IsDarkest(c)
end
function c22231002.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<3 then return false end
Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3)
if g:IsExists(c22231002.filter,1,nil) then
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
g:RemoveCard(sg:GetFirst())
Duel.SendtoGrave(g,REASON_EFFECT)
else
Duel.ShuffleDeck(tp)
end
end
function c22231002.filter(c)
return c22231002.IsDarkest(c) and c:IsAbleToDeck() and c:IsFaceup()
end
function c22231002.tdtg(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 c22231002.filter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c22231002.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c22231002.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,2,2,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,0,g:GetCount()+1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c22231002.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=2 then return end
if not c:IsRelateToEffect(e) then return end
local sg=Group.FromCards(c,tg:GetFirst(),tg:GetNext())
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
--Darkest 相似的我们
function c22231003.initial_effect(c)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,22231003)
e3:SetTarget(c22231003.target)
e3:SetOperation(c22231003.operation)
c:RegisterEffect(e3)
--self destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1,22231003)
e2:SetRange(LOCATION_HAND)
e2:SetCost(c22231003.thcost)
e2:SetTarget(c22231003.thtg)
e2:SetOperation(c22231003.thop)
c:RegisterEffect(e2)
end
c22231003.named_with_Darkest_D=1
function c22231003.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22231003.spfilter(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,true,true,POS_FACEDOWN_DEFENSE)
end
function c22231003.tgfilter(c,e,tp)
local code=c:GetCode()
return c22231003.IsDarkest(c) and c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsType(TYPE_FLIP) and Duel.IsExistingMatchingCard(c22231003.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,code)
end
function c22231003.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsControler(tp) and chkc:IsFaceup() and chkc:IsLocation(LOCATION_MZONE) and c23581825.tgfilter1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c22231003.tgfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) and Duel.GetLocationCountFromEx(tp)>0 end
local g=Duel.SelectTarget(tp,c22231003.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c22231003.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<1 then return false end
local tc=Duel.GetFirstTarget()
local co=tc:GetCode()
local g=Duel.SelectMatchingCard(tp,c22231003.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,co)
if g:GetCount()>0 then
local tc=g:GetFirst()
if Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,true,true,POS_FACEDOWN_DEFENSE)>0 then
tc:CompleteProcedure()
e:GetHandler():CancelToGrave()
Duel.Overlay(tc,e:GetHandler())
Duel.BreakEffect()
local turnp=Duel.GetTurnPlayer()
local tph=Duel.GetCurrentPhase()
Duel.SkipPhase(turnp,tph,RESET_PHASE+PHASE_END,1)
end
end
end
function c22231003.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c22231003.hfilter(c)
local code=c:GetCode()
return c22231003.IsDarkest(c) and c:IsType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(c22231003.thfilter,tp,LOCATION_DECK,0,1,nil,code)
end
function c22231003.thfilter(c,code)
return c22231003.IsDarkest(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:IsCode(code)
end
function c22231003.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c22231003.hfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,nil,tp,LOCATION_DECK)
end
function c22231003.thop(e,tp,eg,ep,ev,re,r,rp,chk)
local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.ConfirmCards(1-tp,hg)
local g=Duel.SelectMatchingCard(tp,c22231003.hfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
local code=g:GetFirst():GetCode()
local thg=Duel.GetMatchingGroup(c22231003.thfilter,tp,LOCATION_DECK,0,nil,code)
if thg:GetCount()>0 then
Duel.SendtoHand(thg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,thg)
end
end
end
--Darkest 危机或危机
function c22231101.initial_effect(c)
--pos
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_POSITION)
e6:SetType(EFFECT_TYPE_ACTIVATE)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetCountLimit(1,22231101)
e6:SetTarget(c22231101.postg)
e6:SetOperation(c22231101.posop)
c:RegisterEffect(e6)
--pos
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_POSITION)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_GRAVE)
e6:SetCountLimit(1,22231101)
e6:SetCondition(aux.exccon)
e6:SetTarget(c22231101.settg)
e6:SetOperation(c22231101.setop)
c:RegisterEffect(e6)
end
c22231101.named_with_Darkest_D=1
function c22231101.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22231101.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsFacedown() and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
local g=Duel.SelectTarget(tp,Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c22231101.posfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c22231101.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() and tc:IsRelateToEffect(e) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
if c22231101.IsDarkest(tc) and Duel.IsExistingMatchingCard(c22231101.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,tc) and Duel.SelectYesNo(tp,aux.Stringid(22231101,0)) then
local g=Duel.SelectMatchingCard(tp,c22231101.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,tc)
if g:GetCount()>0 then
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
end
end
end
function c22231101.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsFacedown() and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil) and e:GetHandler():IsSSetable() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
local g=Duel.SelectTarget(tp,Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c22231101.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() and tc:IsRelateToEffect(e) then
if Duel.ChangePosition(tc,0x1,0x1,0x4,0x4,true)>0 and c:IsSSetable() then
Duel.SSet(tp,c)
Duel.ConfirmCards(1-tp,c)
end
end
end
\ No newline at end of file
--Darkest 纷乱的墓地
function c22231201.initial_effect(c)
c:SetUniqueOnField(1,0,22231201)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atk
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_CHANGE_POS)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetCondition(c22231201.condition)
e3:SetOperation(c22231201.operation)
c:RegisterEffect(e3)
--pos
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_SPECIAL_SUMMON)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_SZONE)
e6:SetCountLimit(1,22231201)
e6:SetCondition(c22231201.spcon)
e6:SetCost(c22231201.spcost)
e6:SetTarget(c22231201.sptg)
e6:SetOperation(c22231201.spop)
c:RegisterEffect(e6)
end
c22231201.named_with_Darkest_D=1
function c22231201.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22231201.cfilter(c)
local np=c:GetPosition()
local pp=c:GetPreviousPosition()
return np~=pp
end
function c22231201.confilter(c)
return c:IsFaceup() and c22231201.IsDarkest(c)
end
function c22231201.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c22231201.cfilter,1,nil) and Duel.IsExistingMatchingCard(c22231201.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function c22231201.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return false end
local tc=Duel.GetFieldCard(1-tp,LOCATION_GRAVE,Duel.GetFieldGroupCount(1-tp,LOCATION_GRAVE,0)-1)
if tc then
if Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT)>0 then
Duel.RegisterFlagEffect(tp,22231201,0,0,0)
local flag=Duel.GetFlagEffect(tp,22231201)
if flag%5==0 then Duel.Destroy(e:GetHandler(),REASON_EFFECT) end
end
end
end
function c22231201.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c22231201.spcost(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 c22231201.filter(c,e,tp)
return c22231201.IsDarkest(c) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c22231201.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc:IsCanBeSpecialSummoned(e,0,tp,false,false) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.IsExistingTarget(c22231201.filter,tp,LOCATION_GRAVE,0,2,nil,e,tp) and not Duel.IsPlayerAffectedByEffect(tp,59822133) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c22231201.filter,tp,LOCATION_GRAVE,0,2,2,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end
function c22231201.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=1 then return false end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return false end
local tc1=sg:GetFirst()
local tc2=sg:GetNext()
Duel.SpecialSummonStep(tc1,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonStep(tc2,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc1:RegisterEffect(e1)
local e2=e1:Clone()
tc2:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetReset(RESET_EVENT+0x1fe0000)
tc1:RegisterEffect(e3)
local e4=e3:Clone()
tc2:RegisterEffect(e4)
Duel.SpecialSummonComplete()
end
--Darkest 沉寂的古镇
function c22231202.initial_effect(c)
c:SetUniqueOnField(1,0,22231202)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--pos
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_POSITION)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_SZONE)
e6:SetCountLimit(1)
e6:SetTarget(c22231202.postg)
e6:SetOperation(c22231202.posop)
c:RegisterEffect(e6)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_SZONE)
e2:SetTarget(c22231202.reptg)
e2:SetValue(c22231202.repval)
e2:SetOperation(c22231202.repop)
c:RegisterEffect(e2)
end
c22231202.named_with_Darkest_D=1
function c22231202.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22231202.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFacedown() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
local g=Duel.SelectTarget(tp,Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DRAW,0,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c22231202.posop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return false end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFacedown() then
if Duel.ChangePosition(tc,POS_FACEUP_DEFENSE) then
if c22231202.IsDarkest(tc) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
end
function c22231202.repfilter(c,tp)
return c:IsFacedown() and c:IsLocation(LOCATION_ONFIELD) and c:IsControler(tp) and c:IsReason(REASON_EFFECT)
end
function c22231202.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDestructable() and eg:IsExists(c22231202.repfilter,1,nil,tp) end
return Duel.SelectYesNo(tp,aux.Stringid(22231202,0))
end
function c22231202.repval(e,c)
return c22231202.repfilter(c,e:GetHandlerPlayer())
end
function c22231202.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
\ No newline at end of file
--Darkest 黑暗的地牢
function c22231501.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--tograve
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(22231501,0))
e6:SetCategory(CATEGORY_TOGRAVE)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_FZONE)
e6:SetCountLimit(1)
e6:SetTarget(c22231501.tgtg)
e6:SetOperation(c22231501.tgop)
c:RegisterEffect(e6)
--Draw
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(22231501,2))
e6:SetCategory(CATEGORY_POSITION+CATEGORY_DRAW)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_FZONE)
e6:SetCountLimit(1)
e6:SetTarget(c22231501.dtg)
e6:SetOperation(c22231501.dop)
c:RegisterEffect(e6)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_FZONE)
e3:SetCondition(c22231501.econ)
e3:SetValue(c22231501.efilter)
c:RegisterEffect(e3)
end
c22231501.named_with_Darkest_D=1
function c22231501.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22231501.tgfilter(c)
return c:IsFacedown() and c:IsAbleToGrave()
end
function c22231501.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and c22231501.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c22231501.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
local g=Duel.SelectTarget(tp,c22231501.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c22231501.setfilter(c)
return c22231501.IsDarkest(c) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c22231501.tgop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return false end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFacedown() then
if Duel.SendtoGrave(tc,REASON_EFFECT) and tc:IsControler(tp) and Duel.IsExistingMatchingCard(c22231501.setfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(22231501,1)) then
local g=Duel.SelectMatchingCard(tp,c22231501.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g)
Duel.ConfirmCards(1-tp,g)
end
end
end
end
function c22231501.posfilter(c)
return c22231501.IsDarkest(c) and c:IsType(TYPE_MONSTER) and c:IsCanTurnSet() and c:IsFaceup()
end
function c22231501.dtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c22231501.posfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c22231501.posfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c22231501.posfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c22231501.dop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return false end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsCanTurnSet() then
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c22231501.econ(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,3,nil)
end
function c22231501.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
\ No newline at end of file
--Darkest 降临的灾难
function c22232001.initial_effect(c)
--pos
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_POSITION)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetType(EFFECT_TYPE_ACTIVATE)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetCountLimit(1,22232001+EFFECT_COUNT_CODE_OATH)
e6:SetTarget(c22232001.postg)
e6:SetOperation(c22232001.posop)
c:RegisterEffect(e6)
--ppos
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c22232001.spcon)
e1:SetTarget(c22232001.sptg)
e1:SetOperation(c22232001.spop)
c:RegisterEffect(e1)
end
c22232001.named_with_Darkest_D=1
function c22232001.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22232001.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFacedown() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
local g=Duel.SelectTarget(tp,Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c22232001.spfilter(c,e,tp,code)
return c22232001.IsDarkest(c) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(code)
end
function c22232001.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local code=tc:GetCode()
if tc:IsRelateToEffect(e) and tc:IsFacedown() then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
if c22232001.IsDarkest(tc) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c22232001.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,code) then
local sg=Duel.SelectMatchingCard(tp,c22232001.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,code)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
function c22232001.posfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c22232001.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():IsReason(REASON_EFFECT)
end
function c22232001.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c22232001.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,0,0,0)
end
function c22232001.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c22232001.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
\ No newline at end of file
--Darkest 幽魂的劝返
function c22232101.initial_effect(c)
--negate
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_TODECK)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_CHAINING)
e2:SetCountLimit(1,22232101+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(c22232101.negcon)
e2:SetTarget(c22232101.negtg)
e2:SetOperation(c22232101.negop)
c:RegisterEffect(e2)
--ind
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22232101,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(aux.exccon)
e2:SetCost(c22232101.damcost)
e2:SetOperation(c22232101.damop)
c:RegisterEffect(e2)
end
c22232101.named_with_Darkest_D=1
function c22232101.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22232101.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsPosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,POS_FACEDOWN_DEFENSE) and rp~=tp and (re:GetActivateLocation()==LOCATION_GRAVE or re:GetActivateLocation()==LOCATION_REMOVED) and Duel.IsChainNegatable(ev)
end
function c22232101.negtg(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():IsAbleToDeck() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_TODECK,eg,1,0,0)
end
end
function c22232101.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) then
local g=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_GRAVE,nil,eg:GetFirst():GetCode())
Duel.SendtoDeck(g,nil,1,REASON_EFFECT)
end
end
function c22232101.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c22232101.damop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTarget(c22232101.tg)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(c22232101.efilter)
Duel.RegisterEffect(e1,tp)
end
function c22232101.tg(e,c)
return c22232101.IsDarkest(c) and c:IsFaceup()
end
function c22232101.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetHandlerPlayer() and re:IsActiveType(TYPE_MONSTER)
end
\ No newline at end of file
--Darkest 往复的古道
function c22232201.initial_effect(c)
c:SetUniqueOnField(1,0,22232201)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--pos
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_POSITION)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_SZONE)
e6:SetCountLimit(1)
e6:SetTarget(c22232201.postg)
e6:SetOperation(c22232201.posop)
c:RegisterEffect(e6)
--Immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_SZONE)
e1:SetValue(c22232201.tgvalue)
c:RegisterEffect(e1)
--selfdes
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_SZONE)
e7:SetCode(EFFECT_SELF_DESTROY)
e7:SetCondition(c22232201.descon)
c:RegisterEffect(e7)
end
c22232201.named_with_Darkest_D=1
function c22232201.IsDarkest(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Darkest_D
end
function c22232201.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFacedown() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN)
local g=Duel.SelectTarget(tp,Card.IsFacedown,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c22232201.setfilter(c)
return c:IsFaceup() and c:IsLocation(LOCATION_SZONE) and c:IsCanTurnSet() and not c:IsLocation(LOCATION_PZONE)
end
function c22232201.posop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return false end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFacedown() then
if Duel.ChangePosition(tc,POS_FACEUP_DEFENSE) then
if e:GetHandler():IsRelateToEffect(e) and c22232201.IsDarkest(tc) and Duel.IsExistingMatchingCard(c22232201.setfilter,tp,0,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(22232201,0)) then
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT,nil)
local g=Duel.SelectMatchingCard(tp,c22232201.setfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(1)
tc:RegisterEffect(e1)
end
end
end
end
end
function c22232201.tgvalue(e,re,rp)
return rp~=e:GetHandlerPlayer()
end
function c22232201.dfilter(c)
return c:IsPosition(POS_FACEDOWN_DEFENSE)
end
function c22232201.descon(e)
return not Duel.IsExistingMatchingCard(c22232201.dfilter,tp,LOCATION_MZONE,0,1,nil)
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment