Commit 31392a50 authored by mercury233's avatar mercury233

add scripts PHRA

parent 55d2088a
--ワーニングポイント
function c11429811.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c11429811.target)
e1:SetOperation(c11429811.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c11429811.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(Card.IsFaceup,1,nil) end
local g=eg:Filter(Card.IsFaceup,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
end
function c11429811.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e):Filter(Card.IsFaceup,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if not c:IsDisabled() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetValue(RESET_TURN_SET)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e4:SetRange(LOCATION_MZONE)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e4:SetValue(1)
tc:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e5:SetValue(c11429811.fuslimit)
tc:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
tc:RegisterEffect(e6)
local e7=e4:Clone()
e7:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
tc:RegisterEffect(e7)
tc=g:GetNext()
end
end
function c11429811.fuslimit(e,c,sumtype)
return sumtype==SUMMON_TYPE_FUSION
end
--U.A.リベロスパイカー
function c11637481.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11637481,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,11637481+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c11637481.spcon)
e1:SetOperation(c11637481.spop)
c:RegisterEffect(e1)
--special summon from deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11637481,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,11637482)
e2:SetCondition(c11637481.spcon2)
e2:SetTarget(c11637481.sptg2)
e2:SetOperation(c11637481.spop2)
c:RegisterEffect(e2)
end
function c11637481.spfilter(c,ft)
return c:IsFaceup() and c:IsSetCard(0xb2) and not c:IsCode(11637481) and c:IsAbleToHandAsCost()
and (ft>0 or c:GetSequence()<5)
end
function c11637481.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(c11637481.spfilter,tp,LOCATION_MZONE,0,1,nil,ft)
end
function c11637481.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c11637481.spfilter,tp,LOCATION_MZONE,0,1,1,nil,ft)
Duel.SendtoHand(g,nil,REASON_COST)
end
function c11637481.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c11637481.spfilter1(c,e,tp)
return c:IsSetCard(0xb2) and c:IsLevelAbove(5) and c:IsAbleToDeck()
and Duel.IsExistingMatchingCard(c11637481.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,c)
end
function c11637481.spfilter2(c,e,tp,tc)
return c:IsSetCard(0xb2) and not c:IsCode(tc:GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11637481.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsAbleToHand()
and Duel.IsExistingMatchingCard(c11637481.spfilter1,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c11637481.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=Duel.GetMatchingGroup(c11637481.spfilter1,tp,LOCATION_HAND,0,nil,e,tp)
if g1:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg1=g1:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,tg1)
if Duel.SendtoDeck(tg1,nil,2,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,c11637481.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,tg1:GetFirst())
if Duel.SpecialSummon(g2,0,tp,tp,false,false,POS_FACEUP) and e:GetHandler():IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
end
--双天脚の鴻鵠
function c11759079.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11759079,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DESTROYED)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,11759079)
e1:SetCondition(c11759079.spcon)
e1:SetTarget(c11759079.sptg)
e1:SetOperation(c11759079.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11759079,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,11759080)
e2:SetTarget(c11759079.thtg)
e2:SetOperation(c11759079.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c11759079.spfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousSetCard(0x14f) and c:GetPreviousCodeOnField()~=11759079
and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
end
function c11759079.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c11759079.spfilter,1,nil,tp) and Duel.GetTurnPlayer()~=tp
end
function c11759079.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,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c11759079.desfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x14f)
and Duel.IsExistingMatchingCard(c11759079.sffilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function c11759079.sffilter(c,e,tp,tc)
return c:IsSetCard(0x14f) and c:IsType(TYPE_FUSION)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,tc,c)>0
end
function c11759079.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0
and Duel.IsExistingMatchingCard(c11759079.desfilter,tp,LOCATION_MZONE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(11759079,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c11759079.desfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.HintSelection(g)
if Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c11759079.sffilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,nil)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
function c11759079.thfilter(c)
return c:IsSetCard(0x14f) and c:IsType(TYPE_TRAP) and c:IsAbleToHand()
end
function c11759079.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11759079.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c11759079.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c11759079.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--アルカナリーディング
function c11819473.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11819473,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,11819473)
e1:SetTarget(c11819473.target)
e1:SetOperation(c11819473.activate)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11819473,1))
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,11819474)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c11819473.sumtg)
e2:SetOperation(c11819473.sumop)
c:RegisterEffect(e2)
end
c11819473.toss_coin=true
function c11819473.thfilter1(c)
return not c:IsCode(11819473) and c.toss_coin and c:IsAbleToHand()
end
function c11819473.thfilter2(c,p)
return c:IsAbleToHand(p)
end
function c11819473.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11819473.thfilter1,tp,LOCATION_DECK,0,1,nil)
or Duel.IsExistingMatchingCard(c11819473.thfilter2,tp,0,LOCATION_DECK,1,nil,1-tp) end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,PLAYER_ALL,LOCATION_DECK)
end
function c11819473.activate(e,tp,eg,ep,ev,re,r,rp)
local res
if Duel.IsEnvironment(73206827,tp,LOCATION_FZONE) then
local off=1
local ops={}
local opval={}
if Duel.IsExistingMatchingCard(c11819473.thfilter1,tp,LOCATION_DECK,0,1,nil) then
ops[off]=aux.Stringid(11819473,2)
opval[off-1]=0
off=off+1
end
if Duel.IsExistingMatchingCard(c11819473.thfilter2,tp,0,LOCATION_DECK,1,nil,1-tp) then
ops[off]=aux.Stringid(11819473,3)
opval[off-1]=1
off=off+1
end
if off==1 then return end
local op=Duel.SelectOption(tp,table.unpack(ops))
res=opval[op]
else
res=1-Duel.TossCoin(tp,1)
end
if res==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c11819473.thfilter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
else
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(1-tp,c11819473.thfilter2,1-tp,LOCATION_DECK,0,1,1,nil,1-tp)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
end
function c11819473.sumfilter(c)
return c:IsSetCard(0x5) and c:IsSummonable(true,nil)
end
function c11819473.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11819473.sumfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c11819473.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c11819473.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
--インフェルニティ・サプレッション
function c12541409.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12541409,0))
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,12541409+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c12541409.condition)
e1:SetTarget(c12541409.target)
e1:SetOperation(c12541409.activate)
c:RegisterEffect(e1)
--act in set turn
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetCondition(c12541409.actcon)
c:RegisterEffect(e2)
end
function c12541409.confilter(c)
return c:IsFaceup() and c:IsSetCard(0xb)
end
function c12541409.condition(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(c12541409.confilter,tp,LOCATION_MZONE,0,1,nil) then return end
return ep==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
end
function c12541409.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c12541409.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) and re:GetHandler():IsLevelAbove(1) and Duel.SelectYesNo(tp,aux.Stringid(12541409,1)) then
Duel.BreakEffect()
Duel.Damage(1-tp,re:GetHandler():GetLevel()*100,REASON_EFFECT)
end
end
function c12541409.actcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)==0
end
--電脳堺豸-豸々
function c12571621.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12571621,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,12571621)
e1:SetTarget(c12571621.sptg)
e1:SetOperation(c12571621.spop)
c:RegisterEffect(e1)
end
function c12571621.tfilter(c,tp)
local type1=c:GetType()&0x7
return c:IsSetCard(0x14e) and c:IsFaceup() and Duel.IsExistingMatchingCard(c12571621.tgfilter,tp,LOCATION_DECK,0,1,nil,type1)
end
function c12571621.tgfilter(c,type1)
return not c:IsType(type1) and c:IsSetCard(0x14e) and c:IsAbleToGrave()
end
function c12571621.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c12571621.tfilter(chkc,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c12571621.tfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c12571621.tfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c12571621.spop(e,tp,eg,ep,ev,re,r,rp)
local c,tc=e:GetHandler(),Duel.GetFirstTarget()
local type1=tc:GetType()&0x7
if tc:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c12571621.tgfilter,tp,LOCATION_DECK,0,1,1,nil,type1)
local tgc=g:GetFirst()
if tgc and Duel.SendtoGrave(tgc,REASON_EFFECT)~=0 and tgc:IsLocation(LOCATION_GRAVE) and c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetCondition(c12571621.thcon)
e1:SetOperation(c12571621.thop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c12571621.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c12571621.splimit(e,c)
return not (c:IsLevelAbove(3) or c:IsRankAbove(3))
end
function c12571621.thfilter(c)
return c:IsSetCard(0x14e) and c:IsType(TYPE_MONSTER) and not c:IsCode(12571621) and c:IsAbleToHand()
end
function c12571621.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c12571621.thfilter),tp,LOCATION_GRAVE,0,1,nil)
end
function c12571621.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(12571621,1)) then
Duel.Hint(HINT_CARD,0,12571621)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c12571621.thfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
--U.A.ハイパー・スタジアム
function c12931061.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCountLimit(1,12931061+EFFECT_COUNT_CODE_OATH)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c12931061.target)
e1:SetOperation(c12931061.activate)
c:RegisterEffect(e1)
--extra summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12931061,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCost(c12931061.excost)
e2:SetTarget(c12931061.extg)
e2:SetOperation(c12931061.exop)
c:RegisterEffect(e2)
end
function c12931061.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c12931061.thfilter(c)
if not c:IsAbleToHand() then return false end
return c:IsLocation(LOCATION_DECK) and c:IsSetCard(0xb2,0x107) and c:IsType(TYPE_MONSTER)
or c:IsLocation(LOCATION_GRAVE) and c:IsCode(19814508)
end
function c12931061.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c12931061.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
local sel=1
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(12931061,0))
if g:GetCount()>0 then
sel=Duel.SelectOption(tp,1213,1214)
else
sel=Duel.SelectOption(tp,1214)+1
end
if sel==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c12931061.cfilter(c)
return c:IsType(TYPE_FIELD) and not c:IsPublic()
end
function c12931061.excost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12931061.cfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.CheckLPCost(tp,1000)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c12931061.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
Duel.PayLPCost(tp,1000)
end
function c12931061.extg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,12931061)==0
and Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) end
end
function c12931061.exop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(12931061,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetTarget(c12931061.estg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,12931061,RESET_PHASE+PHASE_END,0,1)
end
function c12931061.estg(e,c)
return c:IsSetCard(0xb2,0x107)
end
--電脳堺門-朱雀
function c13364097.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(13364097,0))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TODECK)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,13364097)
e2:SetTarget(c13364097.target)
e2:SetOperation(c13364097.operation)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(13364097,1))
e3:SetCategory(CATEGORY_LVCHANGE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,13364098)
e3:SetCondition(c13364097.lvcon)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c13364097.lvtg)
e3:SetOperation(c13364097.lvop)
c:RegisterEffect(e3)
end
function c13364097.tdfilter(c)
return c:IsSetCard(0x14e) and c:IsAbleToDeck() and c:IsFaceup()
end
function c13364097.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c13364097.tdfilter,tp,LOCATION_REMOVED,0,nil)
if chkc then return chkc:IsOnField() and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and g:CheckSubGroup(aux.dncheck,2,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tg=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_REMOVED)
end
function c13364097.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
local g=Duel.GetMatchingGroup(c13364097.tdfilter,tp,LOCATION_REMOVED,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,2,2)
if sg then
if Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)~=0 and sg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA)
and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
function c13364097.lvcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c13364097.lvfilter(c)
return c:IsSetCard(0x14e) and c:IsType(TYPE_MONSTER) and c:IsFaceup() and (c:GetLevel()>0 or c:GetRank()>0)
end
function c13364097.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c13364097.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c13364097.lvfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c13364097.lvfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c13364097.lvop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local lvl=3
local sel=Duel.SelectOption(tp,aux.Stringid(13364097,2),aux.Stringid(13364097,3))
if sel==1 then
lvl=-3
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(lvl)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_RANK)
e2:SetValue(lvl)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
--RR-ファントム・クロー
function c13486638.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,13486638)
e1:SetCondition(c13486638.condition)
e1:SetCost(c13486638.cost)
e1:SetTarget(c13486638.target)
e1:SetOperation(c13486638.operation)
c:RegisterEffect(e1)
end
function c13486638.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function c13486638.cfilter(c,tp)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_XYZ)
and c:CheckRemoveOverlayCard(tp,1,REASON_COST)
end
function c13486638.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c13486638.cfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEATTACHFROM)
local c=Duel.SelectMatchingCard(tp,c13486638.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp):GetFirst()
c:RemoveOverlayCard(tp,1,1,REASON_COST)
local tc=Duel.GetOperatedGroup():GetFirst()
if tc:IsSetCard(0xba,0x10db,0x2073) then
e:SetLabel(1)
else
e:SetLabel(0)
end
end
function c13486638.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c13486638.tgfilter(c)
return c:IsFaceup() and c:IsSetCard(0xba) and c:IsType(TYPE_XYZ)
end
function c13486638.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)>0 and e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local g=Duel.SelectMatchingCard(tp,c13486638.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.HintSelection(g)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(eg:GetFirst():GetBaseAttack())
tc:RegisterEffect(e1)
end
end
end
--教導の神徒
function c13694209.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(13694209,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,13694209)
e1:SetCondition(c13694209.spcon)
e1:SetTarget(c13694209.sptg)
e1:SetOperation(c13694209.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(13694209,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,13694210)
e2:SetCondition(c13694209.thcon)
e2:SetTarget(c13694209.thtg)
e2:SetOperation(c13694209.thop)
c:RegisterEffect(e2)
--atk
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(13694209,2))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,13694211)
e3:SetCondition(c13694209.atkcon)
e3:SetTarget(c13694209.atktg)
e3:SetOperation(c13694209.atkop)
c:RegisterEffect(e3)
end
function c13694209.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsType,1,nil,TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK)
end
function c13694209.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,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c13694209.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c13694209.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function c13694209.thfilter(c)
return c:IsSetCard(0x145) and not c:IsCode(13694209) and c:IsAbleToHand()
end
function c13694209.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c13694209.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c13694209.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c13694209.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c13694209.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c13694209.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function c13694209.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x145)
end
function c13694209.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c13694209.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function c13694209.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c13694209.atkfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(500)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--阿吽の呼吸
function c13764602.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,13764602+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c13764602.activate)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(13764602,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,13764602)
e2:SetCondition(c13764602.spcon)
e2:SetTarget(c13764602.sptg)
e2:SetOperation(c13764602.spop)
c:RegisterEffect(e2)
end
function c13764602.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x14f) and c:IsAbleToHand()
end
function c13764602.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c13764602.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(13764602,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c13764602.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsSetCard(0x14f)
end
function c13764602.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c13764602.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c13764602.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c13764602.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,87669905,0x14f,0x4011,0,0,2,RACE_WARRIOR,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
end
function c13764602.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,87669905,0x14f,0x4011,0,0,2,RACE_WARRIOR,ATTRIBUTE_LIGHT) then
local token=Duel.CreateToken(tp,13764603)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c13764602.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c13764602.splimit(e,c)
return not c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_EXTRA)
end
--エクシーズ・インポート
function c14602126.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,14602126+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c14602126.target)
e1:SetOperation(c14602126.activate)
c:RegisterEffect(e1)
end
function c14602126.xyzfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
and Duel.IsExistingTarget(c14602126.matfilter,tp,0,LOCATION_MZONE,1,nil,c:GetAttack())
end
function c14602126.matfilter(c,atk)
return c:IsFaceup() and c:IsAttackBelow(atk) and c:IsCanOverlay()
end
function c14602126.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c14602126.xyzfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c14602126.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
local tc=g:GetFirst()
e:SetLabelObject(tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c14602126.matfilter,tp,0,LOCATION_MZONE,1,1,nil,tc:GetAttack())
end
function c14602126.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local lc=tg:GetFirst()
if lc==tc then lc=tg:GetNext() end
if tc:IsRelateToEffect(e) and tc:IsControler(tp) and lc:IsRelateToEffect(e) and lc:IsControler(1-tp) and not lc:IsImmuneToEffect(e) then
local og=lc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(tc,Group.FromCards(lc))
end
end
--鉄獣戦線 ナーベル
function c14816857.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(14816857,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,14816857)
e1:SetCost(c14816857.spcost)
e1:SetTarget(c14816857.sptg)
e1:SetOperation(c14816857.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(14816857,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,14816858)
e2:SetTarget(c14816857.thtg)
e2:SetOperation(c14816857.thop)
c:RegisterEffect(e2)
end
function c14816857.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function c14816857.cfilter(c)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsAbleToRemoveAsCost()
end
function c14816857.fselect(g,tg)
return tg:IsExists(Card.IsLink,1,nil,#g)
end
function c14816857.spfilter(c,e,tp)
return c:IsType(TYPE_LINK) and c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c14816857.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local cg=Duel.GetMatchingGroup(c14816857.cfilter,tp,LOCATION_GRAVE,0,nil)
local tg=Duel.GetMatchingGroup(c14816857.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
local _,maxlink=tg:GetMaxGroup(Card.GetLink)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
if #tg==0 then return false end
return cg:CheckSubGroup(c14816857.fselect,1,maxlink,tg)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=cg:SelectSubGroup(tp,c14816857.fselect,false,1,maxlink,tg)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
e:SetLabel(rg:GetCount())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c14816857.spfilter1(c,e,tp,lk)
return c14816857.spfilter(c,e,tp) and c:IsLink(lk)
end
function c14816857.spop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(0xff,0xff)
e1:SetTarget(aux.NOT(aux.TargetBoolFunction(Card.IsRace,RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)))
e1:SetValue(c14816857.sumlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local lk=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c14816857.spfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lk)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c14816857.sumlimit(e,c)
if not c then return false end
return c:IsControler(e:GetHandlerPlayer())
end
function c14816857.thfilter(c)
return c:IsSetCard(0x14d) and c:IsType(TYPE_MONSTER) and not c:IsCode(14816857) and c:IsAbleToHand()
end
function c14816857.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c14816857.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c14816857.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c14816857.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--電脳堺都-九竜
function c14886190.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(14886190,0))
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_TOGRAVE+CATEGORY_ATKCHANGE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,14886190+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c14886190.target)
e1:SetOperation(c14886190.activate)
c:RegisterEffect(e1)
end
function c14886190.tffilter(c,tp)
return c:IsSetCard(0x114e) and not c:IsType(TYPE_FIELD+TYPE_MONSTER) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function c14886190.gtfilter(c)
return c:IsSetCard(0x114e) and c:IsFaceup()
end
function c14886190.spfilter(c,e,tp)
return c:IsSetCard(0x14e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c14886190.exfilter1(c)
return c:IsFacedown() and c:IsType(TYPE_XYZ+TYPE_SYNCHRO+TYPE_FUSION)
end
function c14886190.exfilter2(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) or c:IsFacedown() and c:IsType(TYPE_LINK)
end
function c14886190.fselect(g,ft1,ft2,ect,ft)
return aux.dncheck(g) and #g<=ft and #g<=ect
and g:FilterCount(c14886190.exfilter1,nil)<=ft1
and g:FilterCount(c14886190.exfilter2,nil)<=ft2
end
function c14886190.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsLocation(LOCATION_SZONE) then ft=ft-1 end
return ft>0 and Duel.IsExistingMatchingCard(c14886190.tffilter,tp,LOCATION_DECK,0,1,nil,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_EXTRA)
end
function c14886190.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,c14886190.tffilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then
if Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local gc=Duel.GetMatchingGroupCount(c14886190.gtfilter,tp,LOCATION_ONFIELD,0,nil)
if gc>=2 and Duel.SelectYesNo(tp,aux.Stringid(14886190,1)) then
Duel.BreakEffect()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x14e))
e1:SetValue(200)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
if gc>=3 and Duel.IsPlayerCanDiscardDeck(tp,3) and Duel.SelectYesNo(tp,aux.Stringid(14886190,2)) then
Duel.BreakEffect()
Duel.DiscardDeck(tp,3,REASON_EFFECT)
end
if gc==4 and Duel.IsExistingMatchingCard(c14886190.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) then
local ft1=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_XYZ+TYPE_SYNCHRO+TYPE_FUSION)
local ft2=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM+TYPE_LINK)
local ft=Duel.GetUsableMZoneCount(tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if ft1>0 then ft1=1 end
if ft2>0 then ft2=1 end
if ft>0 then ft=1 end
end
local ect=(c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]) or ft
if ect>0 and (ft1>0 or ft2>0) and Duel.SelectYesNo(tp,aux.Stringid(14886190,3)) then
Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(c14886190.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local rg=sg:SelectSubGroup(tp,c14886190.fselect,false,1,4,ft1,ft2,ect,ft)
Duel.SpecialSummon(rg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
end
......@@ -23,7 +23,7 @@ function c17382973.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,17382974)
e2:SetCost(c17382973.thcost)
e2:SetCost(c17382973.thcost2)
e2:SetTarget(c17382973.thtg2)
e2:SetOperation(c17382973.thop2)
c:RegisterEffect(e2)
......@@ -46,18 +46,48 @@ function c17382973.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function c17382973.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
function c17382973.excostfilter(c,tp)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsAbleToRemoveAsCost() and c:IsHasEffect(25725326,tp)
end
function c17382973.thfilter2(c,e,tp)
function c17382973.costfilter(c,tp,g)
local tg=g:Clone()
tg:RemoveCard(c)
return tg:GetClassCount(Card.GetCode)>=2
end
function c17382973.thcost2(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(0)
local g=Duel.GetMatchingGroup(c17382973.excostfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil,tp)
local tg=Duel.GetMatchingGroup(c17382973.thfilter2,tp,LOCATION_GRAVE,0,nil,e)
if e:GetHandler():IsReleasable() then g:AddCard(e:GetHandler()) end
if chk==0 then
e:SetLabel(100)
return g:IsExists(c17382973.costfilter,1,nil,tp,tg)
end
local cg=g:Filter(c17382973.costfilter,nil,tp,tg)
local tc
if #cg>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25725326,0))
tc=cg:Select(tp,1,1,nil):GetFirst()
else
tc=cg:GetFirst()
end
local te=tc:IsHasEffect(25725326,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_COST+REASON_REPLACE)
else
Duel.Release(tc,REASON_COST)
end
end
function c17382973.thfilter2(c,e)
return c:IsSetCard(0x120) and not c:IsType(TYPE_LINK)
and c:IsCanBeEffectTarget(e) and c:IsAbleToHand()
end
function c17382973.thtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(c17382973.thfilter2,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return g:GetClassCount(Card.GetCode)>=2 end
if chk==0 then return e:GetLabel()==100 end
e:SetLabel(0)
local g=Duel.GetMatchingGroup(c17382973.thfilter2,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=g:SelectSubGroup(tp,aux.dncheck,false,2,2)
Duel.SetTargetCard(g1)
......
......@@ -48,9 +48,38 @@ function c18514525.atkop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e2)
end
end
function c18514525.excostfilter(c,tp)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsAbleToRemoveAsCost() and c:IsHasEffect(25725326,tp)
end
function c18514525.costfilter(c,tp,g)
local tg=g:Clone()
tg:RemoveCard(c)
return Duel.GetMZoneCount(tp,c)>1 and tg:GetClassCount(Card.GetCode)>=2
end
function c18514525.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
e:SetLabel(0)
local g=Duel.GetMatchingGroup(c18514525.excostfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil,tp)
local tg=Duel.GetMatchingGroup(c18514525.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if e:GetHandler():IsReleasable() then g:AddCard(e:GetHandler()) end
if chk==0 then
e:SetLabel(100)
return not Duel.IsPlayerAffectedByEffect(tp,59822133) and g:IsExists(c18514525.costfilter,1,nil,tp,tg)
end
local cg=g:Filter(c18514525.costfilter,nil,tp,tg)
local tc
if #cg>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25725326,0))
tc=cg:Select(tp,1,1,nil):GetFirst()
else
tc=cg:GetFirst()
end
local te=tc:IsHasEffect(25725326,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_COST+REASON_REPLACE)
else
Duel.Release(tc,REASON_COST)
end
end
function c18514525.spfilter(c,e,tp)
return c:IsSetCard(0x120) and not c:IsType(TYPE_FUSION)
......@@ -58,9 +87,9 @@ function c18514525.spfilter(c,e,tp)
end
function c18514525.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return e:GetLabel()==100 end
e:SetLabel(0)
local g=Duel.GetMatchingGroup(c18514525.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and g:GetClassCount(Card.GetCode)>=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=g:SelectSubGroup(tp,aux.dncheck,false,2,2)
Duel.SetTargetCard(g1)
......
--幻影騎士団ティアースケイル
function c25538345.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(25538345,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,25538345)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c25538345.sgcost)
e1:SetTarget(c25538345.sgtg)
e1:SetOperation(c25538345.sgop)
c:RegisterEffect(e1)
--tograve
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(25538345,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,25538346)
e2:SetCondition(c25538345.sscon)
e2:SetTarget(c25538345.sstg)
e2:SetOperation(c25538345.ssop)
c:RegisterEffect(e2)
end
function c25538345.sgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c25538345.filter(c)
return not c:IsCode(25538345) and ((c:IsSetCard(0x10db) and c:IsType(TYPE_MONSTER)) or (c:IsSetCard(0xdb) and c:IsType(TYPE_SPELL+TYPE_TRAP)))
and c:IsAbleToGrave()
end
function c25538345.sgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c25538345.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c25538345.sgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c25538345.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c25538345.cfilter(c,tp)
return c:IsPreviousLocation(LOCATION_GRAVE) and c:GetPreviousControler()==tp
and ((c:IsSetCard(0x10db) and c:IsType(TYPE_MONSTER)) or (c:IsSetCard(0xdb) and c:IsType(TYPE_SPELL+TYPE_TRAP)))
end
function c25538345.sscon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c25538345.cfilter,1,nil,tp)
end
function c25538345.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c25538345.ssop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
--プランキッズ・ミュー
function c25725326.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c25725326.mfilter,1,1)
c:EnableReviveLimit()
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c25725326.regcon)
e1:SetOperation(c25725326.regop)
c:RegisterEffect(e1)
--release replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(25725326)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2:SetCountLimit(1,25725326)
e2:SetCondition(c25725326.repcon)
c:RegisterEffect(e2)
end
function c25725326.mfilter(c)
return c:IsLevelBelow(4) and c:IsLinkSetCard(0x120)
end
function c25725326.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c25725326.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c25725326.splimit)
Duel.RegisterEffect(e1,tp)
end
function c25725326.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsCode(25725326) and bit.band(sumtype,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function c25725326.repcon(e)
return Duel.GetTurnPlayer()==1-e:GetHandlerPlayer()
end
--鉄獣の戦線
function c25908748.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--disable spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(c25908748.splimit)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(25908748,0))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,25908748)
e3:SetCost(c25908748.srcost)
e3:SetTarget(c25908748.srtg)
e3:SetOperation(c25908748.srop)
c:RegisterEffect(e3)
--attacklimit
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(25908748,1))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_DESTROYED)
e4:SetCondition(c25908748.limcon)
e4:SetOperation(c25908748.limop)
c:RegisterEffect(e4)
end
function c25908748.splimit(e,c)
return c:IsLocation(LOCATION_EXTRA) and not c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)
end
function c25908748.cfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c25908748.srfilter,tp,LOCATION_DECK,0,1,nil,c:GetOriginalRace())
end
function c25908748.srfilter(c,race)
return c:IsSetCard(0x14d) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:GetOriginalRace()~=race
end
function c25908748.srcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function c25908748.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c25908748.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,tp)
end
local g=Duel.SelectMatchingCard(tp,c25908748.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,tp)
e:SetLabel(g:GetFirst():GetOriginalRace())
Duel.SendtoGrave(g,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c25908748.srop(e,tp,eg,ep,ev,re,r,rp)
local race=e:GetLabel()
if race==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c25908748.srfilter,tp,LOCATION_DECK,0,1,1,nil,race)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c25908748.limcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_SZONE)
and Duel.GetTurnPlayer()==1-tp and aux.bpcon()
end
function c25908748.limop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
--鉄獣戦線 徒花のフェリジット
function c26847978.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST),2,2)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(26847978,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,26847978)
e1:SetTarget(c26847978.sptg)
e1:SetOperation(c26847978.spop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(26847978,1))
e2:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,26847979)
e2:SetTarget(c26847978.drtg)
e2:SetOperation(c26847978.drop)
c:RegisterEffect(e2)
end
function c26847978.spfilter(c,e,tp)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c26847978.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c26847978.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c26847978.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c26847978.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(0xff,0xff)
e1:SetTarget(aux.NOT(aux.TargetBoolFunction(Card.IsRace,RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)))
e1:SetValue(c26847978.sumlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c26847978.sumlimit(e,c)
if not c then return false end
return c:IsControler(e:GetHandlerPlayer())
end
function c26847978.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,tp,1)
end
function c26847978.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoDeck(g,nil,1,REASON_EFFECT)
end
end
--電脳堺凰-凰々
function c27069566.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,6,2,nil,nil,99)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(27069566,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c27069566.rmcost)
e1:SetTarget(c27069566.rmtg)
e1:SetOperation(c27069566.rmop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(27069566,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,27069566)
e2:SetCondition(c27069566.spcon)
e2:SetTarget(c27069566.sptg)
e2:SetOperation(c27069566.spop)
c:RegisterEffect(e2)
end
function c27069566.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c27069566.rmfilter(c)
return c:IsFaceup() and c:IsAbleToRemove()
end
function c27069566.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c27069566.rmfilter,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectTarget(tp,c27069566.rmfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g1,g1:GetCount(),0,0)
end
function c27069566.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
function c27069566.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetPreviousControler()==tp and c:IsSummonType(SUMMON_TYPE_XYZ) and c:IsPreviousLocation(LOCATION_MZONE)
and (c:IsReason(REASON_EFFECT) and rp==1-tp or c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp))
end
function c27069566.spfilter(c,e,tp)
return c:IsSetCard(0x14e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c27069566.fselect(g)
return g:GetClassCount(Card.GetRace)==1
and g:GetClassCount(Card.GetAttribute)==1
end
function c27069566.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(c27069566.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and g:CheckSubGroup(c27069566.fselect,2,2) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c27069566.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2
or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
local g=Duel.GetMatchingGroup(c27069566.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c27069566.fselect,false,2,2)
if sg then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
--レイダーズ・ナイト
function c28781003.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),4,2)
c:EnableReviveLimit()
--rank up/down
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(28781003,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,28781003)
e1:SetCost(c28781003.cost)
e1:SetTarget(c28781003.target)
e1:SetOperation(c28781003.operation)
c:RegisterEffect(e1)
end
function c28781003.cost(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 c28781003.filter(c,e,tp,mc)
return c:IsRank(mc:GetRank()+1,mc:GetRank()-1) and c:IsSetCard(0x10db,0xba,0x2073) and c:IsType(TYPE_XYZ)
and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c28781003.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c28781003.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c28781003.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c28781003.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local tc=g:GetFirst()
if tc then
local mg=c:GetOverlayGroup()
if mg:GetCount()>0 then
Duel.Overlay(tc,mg)
end
tc:SetMaterial(Group.FromCards(c))
Duel.Overlay(tc,Group.FromCards(c))
if Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)~=0 then
tc:CompleteProcedure()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabelObject(tc)
e1:SetCondition(c28781003.descon)
e1:SetOperation(c28781003.desop)
if Duel.GetTurnPlayer()==1-tp and Duel.GetCurrentPhase()==PHASE_END then
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,2)
e1:SetLabel(Duel.GetTurnCount())
tc:RegisterFlagEffect(28781003,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,0,2)
else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e1:SetLabel(0)
tc:RegisterFlagEffect(28781003,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,0,1)
end
Duel.RegisterEffect(e1,tp)
end
end
end
end
function c28781003.descon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp or Duel.GetTurnCount()==e:GetLabel() then return false end
return e:GetLabelObject():GetFlagEffect(28781003)>0
end
function c28781003.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetLabelObject(),REASON_EFFECT)
end
--双天将 金剛
function c33026283.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,85360035,aux.FilterBoolFunction(Card.IsFusionSetCard,0x14f),2,true,false)
--actlimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,1)
e1:SetValue(1)
e1:SetCondition(c33026283.actcon)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33026283,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BATTLED)
e2:SetCondition(c33026283.thcon)
e2:SetTarget(c33026283.thtg)
e2:SetOperation(c33026283.thop)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(33026283,1))
e3:SetCategory(CATEGORY_NEGATE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,33026283)
e3:SetCondition(c33026283.discon)
e3:SetTarget(c33026283.distg)
e3:SetOperation(c33026283.disop)
c:RegisterEffect(e3)
end
function c33026283.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
function c33026283.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler()
end
function c33026283.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,0,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c33026283.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_MZONE,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
function c33026283.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION)
end
function c33026283.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if rp~=1-tp or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) or c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and tg:IsContains(c) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev) and Duel.IsExistingMatchingCard(c33026283.cfilter,tp,LOCATION_MZONE,0,2,nil)
end
function c33026283.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c33026283.disop(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.NegateActivation(ev) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsRelateToEffect(re) then
Duel.SendtoGrave(eg,REASON_EFFECT)
end
end
--痕喰竜ブリガンド
function c34848821.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,68468459,aux.FilterBoolFunction(Card.IsLevelAbove,8),1,true,true)
--indes battle
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c34848821.imcon)
e2:SetOperation(c34848821.imop)
c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetOperation(c34848821.regop)
c:RegisterEffect(e3)
--to hand/spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(34848821,0))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,34848821)
e4:SetCondition(c34848821.thcon)
e4:SetTarget(c34848821.thtg)
e4:SetOperation(c34848821.thop)
c:RegisterEffect(e4)
end
function c34848821.imcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c34848821.imop(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_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c34848821.imval)
e1:SetValue(c34848821.imfilter)
c:RegisterEffect(e1)
end
function c34848821.imval(e,c)
return c~=e:GetHandler()
end
function c34848821.imfilter(e,re,rp)
return aux.tgoval(e,re,rp) and re:IsActiveType(TYPE_MONSTER)
end
function c34848821.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(34848821,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c34848821.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(34848821)>0
end
function c34848821.thfilter(c,e,tp)
if not (c:IsSetCard(0x14d) and c:IsType(TYPE_MONSTER) or c:IsCode(68468459)) then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
function c34848821.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c34848821.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_DECK)
end
function c34848821.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c34848821.thfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tc=g:GetFirst()
if tc then
if tc:IsAbleToHand() and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) or ft<=0 or Duel.SelectOption(tp,1190,1152)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--コウ・キューピット
function c35960413.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(35960413,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,35960413)
e1:SetCondition(c35960413.spcon)
e1:SetTarget(c35960413.sptg)
e1:SetOperation(c35960413.spop)
c:RegisterEffect(e1)
--lv
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(35960413,1))
e2:SetCategory(CATEGORY_LVCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,35960414)
e2:SetCost(c35960413.lvcost)
e2:SetTarget(c35960413.lvtg)
e2:SetOperation(c35960413.lvop)
c:RegisterEffect(e2)
end
function c35960413.filter(c)
return c:IsFaceup() and c:IsDefense(600)
end
function c35960413.spcon(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(c35960413.filter,tp,LOCATION_MZONE,0,1,nil)
return ct>0 and ct==Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
end
function c35960413.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,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c35960413.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c35960413.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,nil)
end
function c35960413.lvfilter(c,tp)
return c:IsFaceup() and c:IsLevelAbove(1) and c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_LIGHT)
and Duel.IsExistingTarget(c35960413.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c:GetLevel())
end
function c35960413.cfilter(c,lv)
return c:IsFaceup() and c:IsLevelAbove(1) and not c:IsLevel(lv)
end
function c35960413.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c35960413.lvfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c35960413.lvfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
local tc=g:GetFirst()
e:SetLabelObject(tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c35960413.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,tc,tc:GetLevel())
end
function c35960413.lvop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local lc=tg:GetFirst()
if lc==tc then lc=tg:GetNext() end
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(tp) and lc:IsRelateToEffect(e) and lc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(lc:GetLevel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--巌帯の美技-ゼノギタム
function c36187051.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(36187051,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,36187051)
e1:SetTarget(c36187051.thtg)
e1:SetOperation(c36187051.thop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(36187051,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,36187052)
e2:SetCondition(c36187051.tgcon)
e2:SetTarget(c36187051.tgtg)
e2:SetOperation(c36187051.tgop)
c:RegisterEffect(e2)
end
function c36187051.thfilter(c)
return c:IsRace(RACE_ROCK) and not c:IsCode(36187051) and c:IsAbleToHand()
end
function c36187051.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c36187051.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c36187051.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c36187051.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function c36187051.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
if Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) then
Duel.BreakEffect()
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoDeck(g,nil,0,REASON_EFFECT)
end
end
end
function c36187051.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD+LOCATION_GRAVE)
end
function c36187051.tgfilter(c)
return c:IsRace(RACE_ROCK) and c:IsAbleToGrave()
end
function c36187051.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c36187051.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c36187051.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c36187051.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--インフェルニティ・ヘル・デーモン
function c38904695.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--disable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(38904695,0))
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c38904695.distg)
e1:SetOperation(c38904695.disop)
c:RegisterEffect(e1)
--double battle damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e2:SetCondition(c38904695.damcon)
e2:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE))
c:RegisterEffect(e2)
--extra attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e3:SetCondition(c38904695.exacon)
e3:SetOperation(c38904695.exaop)
c:RegisterEffect(e3)
end
function c38904695.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and aux.disfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c38904695.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsDisabled() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 and Duel.SelectYesNo(tp,aux.Stringid(38904695,1)) then
Duel.BreakEffect()
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
function c38904695.damcon(e)
return e:GetHandler():GetBattleTarget()~=nil and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)==0
end
function c38904695.exacon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO and e:GetHandler():GetReasonCard():IsAttribute(ATTRIBUTE_DARK)
end
function c38904695.exaop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(38904695,2))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
end
--鉄獣の抗戦
function c40975243.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,40975243+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c40975243.target)
e1:SetOperation(c40975243.activate)
c:RegisterEffect(e1)
end
function c40975243.spfilter(c,e,tp)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
function c40975243.fselect(g,tp)
return Duel.IsExistingMatchingCard(c40975243.lkfilter,tp,LOCATION_EXTRA,0,1,nil,g)
end
function c40975243.lkfilter(c,g)
return c:IsSetCard(0x14d) and c:IsLinkSummonable(g,nil,g:GetCount(),g:GetCount())
end
function c40975243.chkfilter(c,tp)
return c:IsType(TYPE_LINK) and c:IsSetCard(0x14d) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c40975243.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if not Duel.IsPlayerCanSpecialSummonCount(tp,2) then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return false end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local cg=Duel.GetMatchingGroup(c40975243.chkfilter,tp,LOCATION_EXTRA,0,nil,tp)
if #cg==0 then return false end
local _,maxlink=cg:GetMaxGroup(Card.GetLink)
if maxlink>ft then maxlink=ft end
local g=Duel.GetMatchingGroup(c40975243.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
return g:CheckSubGroup(c40975243.fselect,1,maxlink,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c40975243.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c40975243.spfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
local cg=Duel.GetMatchingGroup(c40975243.chkfilter,tp,LOCATION_EXTRA,0,nil,tp)
local _,maxlink=cg:GetMaxGroup(Card.GetLink)
if ft>0 and maxlink then
if maxlink>ft then maxlink=ft end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c40975243.fselect,false,1,maxlink,tp)
if not sg then return end
local tc=sg:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,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+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e2)
tc=sg:GetNext()
end
Duel.SpecialSummonComplete()
local og=Duel.GetOperatedGroup()
local tg=Duel.GetMatchingGroup(c40975243.lkfilter,tp,LOCATION_EXTRA,0,nil,og)
if og:GetCount()==sg:GetCount() and tg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local rg=tg:Select(tp,1,1,nil)
Duel.LinkSummon(tp,rg:GetFirst(),og,nil,#og,#og)
end
end
end
--憑依覚醒-ラセンリュウ
function c410904.initial_effect(c)
--spsummon proc
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_DECK)
e1:SetCondition(c410904.spcon)
e1:SetOperation(c410904.spop)
e1:SetValue(SUMMON_VALUE_SELF)
c:RegisterEffect(e1)
--return to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(410904,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,410904)
e2:SetCondition(c410904.condition)
e2:SetTarget(c410904.rthtg)
e2:SetOperation(c410904.rthop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(410904,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,410905)
e3:SetCondition(c410904.thcon)
e3:SetTarget(c410904.thtg)
e3:SetOperation(c410904.thop)
c:RegisterEffect(e3)
end
function c410904.spfilter1(c,tp)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c410904.spfilter2,tp,LOCATION_MZONE,0,1,c)
end
function c410904.spfilter2(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToGraveAsCost() and c:IsLevelBelow(4)
end
function c410904.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c410904.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp)
end
function c410904.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,c410904.spfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(tp,c410904.spfilter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst())
g1:Merge(g2)
Duel.SendtoGrave(g1,REASON_COST)
end
function c410904.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF
end
function c410904.rthtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,1-tp,LOCATION_ONFIELD)
end
function c410904.rthop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
function c410904.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c410904.thfilter(c)
return ((c:IsSetCard(0xc0) and c:IsType(TYPE_SPELL+TYPE_TRAP)) or c:IsSetCard(0x914c)) and c:IsAbleToHand()
end
function c410904.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c410904.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c410904.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c410904.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
......@@ -34,9 +34,38 @@ end
function c43886072.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function c43886072.excostfilter(c,tp)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsAbleToRemoveAsCost() and c:IsHasEffect(25725326,tp)
end
function c43886072.costfilter(c,tp,g)
local tg=g:Clone()
tg:RemoveCard(c)
return tg:GetClassCount(Card.GetCode)>=2
end
function c43886072.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
e:SetLabel(0)
local g=Duel.GetMatchingGroup(c43886072.excostfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil,tp)
local tg=Duel.GetMatchingGroup(c43886072.thfilter,tp,LOCATION_GRAVE,0,nil,e)
if e:GetHandler():IsReleasable() then g:AddCard(e:GetHandler()) end
if chk==0 then
e:SetLabel(100)
return g:IsExists(c43886072.costfilter,1,nil,tp,tg)
end
local cg=g:Filter(c43886072.costfilter,nil,tp,tg)
local tc
if #cg>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25725326,0))
tc=cg:Select(tp,1,1,nil):GetFirst()
else
tc=cg:GetFirst()
end
local te=tc:IsHasEffect(25725326,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_COST+REASON_REPLACE)
else
Duel.Release(tc,REASON_COST)
end
end
function c43886072.thfilter(c,e)
return c:IsSetCard(0x120) and not c:IsType(TYPE_LINK)
......@@ -44,8 +73,9 @@ function c43886072.thfilter(c,e)
end
function c43886072.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return e:GetLabel()==100 end
e:SetLabel(0)
local g=Duel.GetMatchingGroup(c43886072.thfilter,tp,LOCATION_GRAVE,0,nil,e)
if chk==0 then return g:GetClassCount(Card.GetCode)>=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,2,2)
Duel.SetTargetCard(sg)
......
......@@ -36,9 +36,38 @@ end
function c44509529.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c44509529.excostfilter(c,tp)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsAbleToRemoveAsCost() and c:IsHasEffect(25725326,tp)
end
function c44509529.costfilter(c,tp,g)
local tg=g:Clone()
tg:RemoveCard(c)
return Duel.GetMZoneCount(tp,c)>1 and tg:GetClassCount(Card.GetCode)>=2
end
function c44509529.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
e:SetLabel(0)
local g=Duel.GetMatchingGroup(c44509529.excostfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil,tp)
local tg=Duel.GetMatchingGroup(c44509529.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if e:GetHandler():IsReleasable() then g:AddCard(e:GetHandler()) end
if chk==0 then
e:SetLabel(100)
return not Duel.IsPlayerAffectedByEffect(tp,59822133) and g:IsExists(c44509529.costfilter,1,nil,tp,tg)
end
local cg=g:Filter(c44509529.costfilter,nil,tp,tg)
local tc
if #cg>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25725326,0))
tc=cg:Select(tp,1,1,nil):GetFirst()
else
tc=cg:GetFirst()
end
local te=tc:IsHasEffect(25725326,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_COST+REASON_REPLACE)
else
Duel.Release(tc,REASON_COST)
end
end
function c44509529.spfilter(c,e,tp)
return c:IsSetCard(0x120) and not c:IsType(TYPE_FUSION)
......@@ -46,9 +75,9 @@ function c44509529.spfilter(c,e,tp)
end
function c44509529.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return e:GetLabel()==100 end
e:SetLabel(0)
local g=Duel.GetMatchingGroup(c44509529.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and g:GetClassCount(Card.GetCode)>=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=g:SelectSubGroup(tp,aux.dncheck,false,2,2)
Duel.SetTargetCard(g1)
......
--機巧牙-御神尊真神
function c46809548.initial_effect(c)
--summon with no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(46809548,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c46809548.ntcon)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(46809548,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,46809548)
e2:SetCost(c46809548.thcost)
e2:SetTarget(c46809548.thtg)
e2:SetOperation(c46809548.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--to deck
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(46809548,2))
e4:SetCategory(CATEGORY_TODECK)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,46809549)
e4:SetCondition(c46809548.tdcon)
e4:SetTarget(c46809548.tdtg)
e4:SetOperation(c46809548.tdop)
c:RegisterEffect(e4)
end
function c46809548.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(nil,c:GetControler(),LOCATION_REMOVED,0,6,nil)
end
function c46809548.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsDiscardable()
end
function c46809548.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c46809548.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c46809548.costfilter,1,1,REASON_COST+REASON_DISCARD,nil)
end
function c46809548.thfilter(c)
return c:GetTextAttack()>=0 and c:GetAttack()==c:GetDefense() and not c:IsCode(46809548) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c46809548.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c46809548.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c46809548.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c46809548.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c46809548.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c46809548.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,6,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,6,tp,LOCATION_REMOVED)
end
function c46809548.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,6,6,nil)
if #g==6 then
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end
--U.A.プレイングマネージャー
function c47021196.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(47021196,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,47021196)
e1:SetCondition(c47021196.spcon)
e1:SetTarget(c47021196.sptg)
e1:SetOperation(c47021196.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--destroy/disable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,47021197)
e3:SetTarget(c47021196.target)
e3:SetOperation(c47021196.operation)
c:RegisterEffect(e3)
end
function c47021196.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xb2) and c:GetSummonPlayer()==tp
end
function c47021196.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c47021196.cfilter,1,nil,tp)
end
function c47021196.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,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c47021196.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c47021196.negfilter(c)
return aux.disfilter1(c) and not c:IsSetCard(0xb2)
end
function c47021196.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
local b1=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local b2=Duel.GetMatchingGroup(c47021196.negfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then return #b1>0 or #b2>0 end
local off=1
local ops={}
local opval={}
if #b1>0 then
ops[off]=aux.Stringid(47021196,1)
opval[off]=0
off=off+1
end
if #b2>0 then
ops[off]=aux.Stringid(47021196,2)
opval[off]=1
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))+1
local sel=opval[op]
e:SetLabel(sel)
if sel==0 then
e:SetCategory(CATEGORY_DESTROY)
e:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
else
e:SetCategory(CATEGORY_DISABLE)
e:SetProperty(EFFECT_FLAG_DELAY)
end
end
function c47021196.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
else
local c=e:GetHandler()
local b2=Duel.GetMatchingGroup(c47021196.negfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local nc=b2:GetFirst()
while nc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
nc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
nc:RegisterEffect(e2)
nc=b2:GetNext()
end
end
end
--インフェルニティ・コンジュラー
function c48144778.initial_effect(c)
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(-800)
e1:SetCondition(c48144778.atkcon)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(48144778,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,48144778)
e2:SetCondition(c48144778.spcon)
e2:SetTarget(c48144778.sptg)
e2:SetOperation(c48144778.spop)
c:RegisterEffect(e2)
end
function c48144778.atkcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)==0
end
function c48144778.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c48144778.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,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c48144778.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
--新風の空牙団
function c48214588.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetLabel(0)
e1:SetCountLimit(1,48214588+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c48214588.cost)
e1:SetTarget(c48214588.target)
e1:SetOperation(c48214588.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(48214588,ACTIVITY_ATTACK,c48214588.counterfilter)
end
function c48214588.counterfilter(c)
return c:IsSetCard(0x114)
end
function c48214588.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return Duel.GetCustomActivityCount(48214588,tp,ACTIVITY_ATTACK)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OATH)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c48214588.atktg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c48214588.atktg(e,c)
return not c:IsSetCard(0x114)
end
function c48214588.cfilter(c,e,tp)
local lv=c:GetLevel()
return lv>0 and (c:IsControler(tp) or c:IsFaceup()) and Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c48214588.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,lv,e,tp)
end
function c48214588.spfilter(c,lv,e,tp)
return c:IsLevel(lv+1,lv-1) and c:IsSetCard(0x114) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c48214588.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,c48214588.cfilter,1,nil,e,tp)
end
local g=Duel.SelectReleaseGroup(tp,c48214588.cfilter,1,1,nil,e,tp)
e:SetLabel(g:GetFirst():GetLevel())
Duel.Release(g,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c48214588.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local lv=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c48214588.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,lv,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--U.A.マン・オブ・ザ・マッチ
function c48636108.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(48636108,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BATTLED)
e1:SetCountLimit(1,48636108+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c48636108.spcon)
e1:SetTarget(c48636108.sptg)
e1:SetOperation(c48636108.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(48636108,1))
e2:SetCondition(c48636108.spcon2)
e2:SetCode(EVENT_BATTLE_DAMAGE)
c:RegisterEffect(e2)
end
function c48636108.filter(c)
return c:IsSetCard(0xb2,0x107) and c:IsType(TYPE_MONSTER)
end
function c48636108.spfilter(c,e,tp)
return c48636108.filter(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c48636108.spcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if not d then return false end
if d:IsControler(tp) then a,d=d,a end
return c48636108.filter(a) and d:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c48636108.spcon2(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return ep~=tp and tc:IsControler(tp) and c48636108.filter(tc)
end
function c48636108.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c48636108.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c48636108.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c48636108.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
if ft<=0 or g:GetCount()==0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ft)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
--魔獣の大餌
function c48814566.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(c48814566.target)
e1:SetOperation(c48814566.activate)
c:RegisterEffect(e1)
end
function c48814566.rmfilter(c)
return c:IsFacedown() and c:IsAbleToRemove()
end
function c48814566.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_EXTRA,0,1,nil,tp,POS_FACEDOWN)
and Duel.IsExistingMatchingCard(c48814566.rmfilter,tp,0,LOCATION_EXTRA,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,PLAYER_ALL,LOCATION_EXTRA)
end
function c48814566.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_EXTRA,0,nil,tp,POS_FACEDOWN)
local g2=Duel.GetMatchingGroup(c48814566.rmfilter,tp,0,LOCATION_EXTRA,nil)
if #g1>0 and #g2>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg1=g1:Select(tp,1,#g2,nil)
if Duel.Remove(sg1,POS_FACEDOWN,REASON_EFFECT)~=0 and sg1:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED) then
local og1=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
local sg2=g2:RandomSelect(tp,#og1)
if Duel.Remove(sg2,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0 and sg2:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED) then
local c=e:GetHandler()
local og2=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
local tc=og2:GetFirst()
while tc do
tc:RegisterFlagEffect(48814566,RESET_EVENT+RESETS_STANDARD,0,1)
tc=og2:GetNext()
end
og2:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(og2)
e1:SetCountLimit(1)
e1:SetCondition(c48814566.retcon)
e1:SetOperation(c48814566.retop)
Duel.RegisterEffect(e1,tp)
end
end
end
end
function c48814566.retfilter(c)
return c:GetFlagEffect(48814566)~=0
end
function c48814566.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():IsExists(c48814566.retfilter,1,nil)
end
function c48814566.retop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c48814566.retfilter,nil,e:GetLabel())
Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)
g:DeleteGroup()
end
--電脳堺媛-瑞々
function c49088914.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(49088914,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,49088914)
e1:SetTarget(c49088914.sptg)
e1:SetOperation(c49088914.spop)
c:RegisterEffect(e1)
end
function c49088914.tfilter(c,tp)
local type1=c:GetType()&0x7
return c:IsSetCard(0x14e) and c:IsFaceup() and Duel.IsExistingMatchingCard(c49088914.tgfilter,tp,LOCATION_DECK,0,1,nil,type1)
end
function c49088914.tgfilter(c,type1)
return not c:IsType(type1) and c:IsSetCard(0x14e) and c:IsAbleToGrave()
end
function c49088914.thfilter(c,type1)
return not c:IsType(type1) and c:IsSetCard(0x14e) and not c:IsCode(49088914) and c:IsAbleToHand()
end
function c49088914.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c49088914.tfilter(chkc,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c49088914.tfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c49088914.tfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c49088914.spop(e,tp,eg,ep,ev,re,r,rp)
local c,tc=e:GetHandler(),Duel.GetFirstTarget()
local type1=tc:GetType()&0x7
if tc:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c49088914.tgfilter,tp,LOCATION_DECK,0,1,1,nil,type1)
local tgc=g:GetFirst()
if tgc and Duel.SendtoGrave(tgc,REASON_EFFECT)~=0 and tgc:IsLocation(LOCATION_GRAVE) and c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local type1=tgc:GetType()&0x7|type1
local sg=Duel.GetMatchingGroup(c49088914.thfilter,tp,LOCATION_DECK,0,nil,type1)
if #sg>0 and Duel.SelectYesNo(tp,aux.Stringid(49088914,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=sg:Select(tp,1,1,nil)
if #hg>0 then
Duel.SendtoHand(hg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,hg)
end
end
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c49088914.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c49088914.splimit(e,c)
return not (c:IsLevelAbove(3) or c:IsRankAbove(3))
end
--双天の調伏
function c49158617.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW+CATEGORY_REMOVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,75157704+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c49158617.target)
e1:SetOperation(c49158617.activate)
c:RegisterEffect(e1)
end
function c49158617.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x14f)
end
function c49158617.ffilter(c,tp)
return c:IsPreviousSetCard(0x14f) and c:GetPreviousControler()==tp and c:GetPreviousTypeOnField()&TYPE_FUSION~=0
and c:IsPreviousPosition(POS_FACEUP)
end
function c49158617.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c49158617.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c49158617.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_GRAVE)
end
function c49158617.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then
Duel.Destroy(tg,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
if og:IsExists(c49158617.ffilter,1,nil,tp) and Duel.SelectYesNo(tp,aux.Stringid(49158617,2)) then
local b1=Duel.IsPlayerCanDraw(tp,1)
local b2=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil)
local sel=0
if b1 and b2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPTION)
sel=Duel.SelectOption(tp,aux.Stringid(49158617,0),aux.Stringid(49158617,1))+1
elseif b1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPTION)
sel=Duel.SelectOption(tp,aux.Stringid(49158617,0))+1
elseif b2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPTION)
sel=Duel.SelectOption(tp,aux.Stringid(49158617,1))+2
end
if sel==1 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
elseif sel==2 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToRemove),tp,0,LOCATION_GRAVE,1,1,nil)
if #g>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
end
end
--双天の再来
function c49752795.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,49752795+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c49752795.target)
e1:SetOperation(c49752795.activate)
c:RegisterEffect(e1)
end
function c49752795.filter(c,e,tp)
return c:IsSetCard(0x14f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c49752795.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c49752795.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c49752795.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c49752795.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
local tc=g:GetFirst()
if tc:GetOriginalLevel()<=4 then
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
end
end
function c49752795.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 and tc:GetOriginalLevel()<=4 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,87669905,0x14f,0x4011,0,0,2,RACE_WARRIOR,ATTRIBUTE_LIGHT) and Duel.SelectYesNo(tp,aux.Stringid(49752795,0)) then
Duel.BreakEffect()
local token=Duel.CreateToken(tp,49752796)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--U.A.ロッカールーム
function c49936169.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_RECOVER+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,49936169+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c49936169.target)
e1:SetOperation(c49936169.activate)
c:RegisterEffect(e1)
end
function c49936169.filter(c)
return c:IsSetCard(0xb2,0x107) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
end
function c49936169.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and c49936169.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c49936169.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c49936169.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,500)
end
function c49936169.cfilter(c)
return c:IsSetCard(0xb2,0x107) and c:IsType(TYPE_MONSTER) and not c:IsPublic() and c:IsAbleToDeck()
end
function c49936169.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
if Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND) then
local d=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if Duel.Recover(tp,d,REASON_EFFECT)<=0 then return end
local tg=Duel.GetMatchingGroup(c49936169.cfilter,tp,LOCATION_HAND,0,nil)
if #tg<=0 or not Duel.IsPlayerCanDraw(tp) or not Duel.SelectYesNo(tp,aux.Stringid(49936169,0)) then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c49936169.cfilter,tp,LOCATION_HAND,0,1,63,nil)
if g:GetCount()==0 then return end
Duel.ConfirmCards(1-tp,g)
local ct=Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
Duel.ShuffleDeck(tp)
if ct>0 then
Duel.BreakEffect()
Duel.Draw(tp,ct,REASON_EFFECT)
end
end
end
--電脳堺麟-麟々
function c49966326.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(49966326,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,49966326)
e1:SetTarget(c49966326.sptg)
e1:SetOperation(c49966326.spop)
c:RegisterEffect(e1)
end
function c49966326.tfilter(c,tp)
local type1=c:GetType()&0x7
return c:IsSetCard(0x14e) and c:IsFaceup() and Duel.IsExistingMatchingCard(c49966326.tgfilter,tp,LOCATION_DECK,0,1,nil,type1)
end
function c49966326.tgfilter(c,type1)
return not c:IsType(type1) and c:IsSetCard(0x14e) and c:IsAbleToGrave()
end
function c49966326.thfilter(c,type1)
return not c:IsType(type1) and c:IsSetCard(0x14e) and not c:IsCode(49966326) and c:IsAbleToGrave()
end
function c49966326.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c49966326.tfilter(chkc,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c49966326.tfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c49966326.tfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c49966326.spop(e,tp,eg,ep,ev,re,r,rp)
local c,tc=e:GetHandler(),Duel.GetFirstTarget()
local type1=tc:GetType()&0x7
if tc:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c49966326.tgfilter,tp,LOCATION_DECK,0,1,1,nil,type1)
local tgc=g:GetFirst()
if tgc and Duel.SendtoGrave(tgc,REASON_EFFECT)~=0 and tgc:IsLocation(LOCATION_GRAVE) and c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local type1=tgc:GetType()&0x7|type1
local sg=Duel.GetMatchingGroup(c49966326.tgfilter,tp,LOCATION_DECK,0,nil,type1)
if #sg>0 and Duel.SelectYesNo(tp,aux.Stringid(49966326,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=sg:Select(tp,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c49966326.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c49966326.splimit(e,c)
return not (c:IsLevelAbove(3) or c:IsRankAbove(3))
end
--電脳堺門-青龍
function c50275295.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50275295,0))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,50275295)
e2:SetCost(c50275295.discost)
e2:SetTarget(c50275295.distg)
e2:SetOperation(c50275295.disop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(50275295,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_HANDES)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,50275296)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c50275295.thtg)
e3:SetOperation(c50275295.thop)
c:RegisterEffect(e3)
end
function c50275295.cfilter(c)
return c:IsSetCard(0x14e) and c:IsAbleToRemoveAsCost()
end
function c50275295.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50275295.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c50275295.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c50275295.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and aux.disfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.disfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c50275295.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
function c50275295.thfilter(c)
return c:IsSetCard(0x14e) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c50275295.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50275295.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c50275295.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c50275295.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
Duel.BreakEffect()
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT)
end
end
--鉄獣戦線 ケラス
function c50810455.initial_effect(c)
--special summon from hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50810455,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,50810455)
e1:SetCost(c50810455.spcost)
e1:SetTarget(c50810455.sptg)
e1:SetOperation(c50810455.spop)
c:RegisterEffect(e1)
--special summon from extra
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50810455,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,50810456)
e2:SetCost(c50810455.spcost1)
e2:SetTarget(c50810455.sptg1)
e2:SetOperation(c50810455.spop1)
c:RegisterEffect(e2)
end
function c50810455.cfilter(c)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsDiscardable()
end
function c50810455.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50810455.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c50810455.cfilter,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
end
function c50810455.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,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c50810455.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c50810455.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function c50810455.cfilter1(c)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsAbleToRemoveAsCost()
end
function c50810455.fselect(g,tg)
return tg:IsExists(Card.IsLink,1,nil,#g)
end
function c50810455.spfilter(c,e,tp)
return c:IsType(TYPE_LINK) and c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c50810455.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
local cg=Duel.GetMatchingGroup(c50810455.cfilter1,tp,LOCATION_GRAVE,0,nil)
local tg=Duel.GetMatchingGroup(c50810455.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
local _,maxlink=tg:GetMaxGroup(Card.GetLink)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
if #tg==0 then return false end
return cg:CheckSubGroup(c50810455.fselect,1,maxlink,tg)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=cg:SelectSubGroup(tp,c50810455.fselect,false,1,maxlink,tg)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
e:SetLabel(rg:GetCount())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c50810455.spfilter1(c,e,tp,lk)
return c50810455.spfilter(c,e,tp) and c:IsLink(lk)
end
function c50810455.spop1(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(0xff,0xff)
e1:SetTarget(aux.NOT(aux.TargetBoolFunction(Card.IsRace,RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)))
e1:SetValue(c50810455.sumlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local lk=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c50810455.spfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lk)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c50810455.sumlimit(e,c)
if not c then return false end
return c:IsControler(e:GetHandlerPlayer())
end
--鉄獣の凶襲
function c51097887.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,51097887+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c51097887.sptg)
e1:SetOperation(c51097887.spop)
c:RegisterEffect(e1)
end
function c51097887.spfilter1(c,e,tp)
return c:IsFaceup() and c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)
and Duel.IsExistingMatchingCard(c51097887.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetAttack(),c:GetRace())
end
function c51097887.spfilter2(c,e,tp,atk,race)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsAttackBelow(atk) and not c:IsRace(race)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c51097887.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c51097887.spfilter1(chkc,e,tp) end
if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(c51097887.spfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c51097887.spfilter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c51097887.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c51097887.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetAttack(),tc:GetRace())
local tc=g:GetFirst()
if tc then
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c51097887.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c51097887.splimit(e,c)
return not c:IsType(TYPE_LINK) and c:IsLocation(LOCATION_EXTRA)
end
--ジャック・イン・ザ・ハンド
function c51697825.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,51697825+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c51697825.target)
e1:SetOperation(c51697825.activate)
c:RegisterEffect(e1)
end
function c51697825.thfilter(c,tp)
return c:IsLevel(1) and c:IsAbleToHand() and c:IsAbleToHand(1-tp)
end
function c51697825.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c51697825.thfilter,tp,LOCATION_DECK,0,nil,tp)
if chk==0 then return g:GetClassCount(Card.GetCode)>=3 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,PLAYER_ALL,LOCATION_DECK)
end
function c51697825.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c51697825.thfilter,tp,LOCATION_DECK,0,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,3,3)
if sg then
Duel.ConfirmCards(1-tp,sg)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local oc=sg:Select(1-tp,1,1,nil):GetFirst()
if Duel.SendtoHand(oc,1-tp,REASON_EFFECT)~=0 and oc:IsLocation(LOCATION_HAND) then
sg:RemoveCard(oc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sc=sg:Select(tp,1,1,nil):GetFirst()
Duel.SendtoHand(sc,tp,REASON_EFFECT)
end
end
end
--RR-ヒール・イーグル
function c51933043.initial_effect(c)
--self ss
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(51933043,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,51933043)
e1:SetCondition(c51933043.sscon)
e1:SetTarget(c51933043.sstg)
e1:SetOperation(c51933043.ssop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,51933044)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c51933043.thtg)
e2:SetOperation(c51933043.thop)
c:RegisterEffect(e2)
end
function c51933043.ssfilter(c)
return not c:IsSetCard(0xba) or c:IsFacedown()
end
function c51933043.sscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0
and not Duel.IsExistingMatchingCard(c51933043.ssfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c51933043.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c51933043.ssop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c51933043.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0xba) and c:IsAbleToHand()
end
function c51933043.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c51933043.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c51933043.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c51933043.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c51933043.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--転晶のコーディネラル
function c52119435.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2)
--indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c52119435.indtg)
e1:SetValue(aux.indoval)
c:RegisterEffect(e1)
--swap control
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(52119435,0))
e2:SetCategory(CATEGORY_CONTROL)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,52119435)
e2:SetTarget(c52119435.cttg)
e2:SetOperation(c52119435.ctop)
c:RegisterEffect(e2)
end
function c52119435.indtg(e,tc)
local c=e:GetHandler()
return c:IsLinkState() and tc==c or c:GetLinkedGroup():IsContains(tc)
end
function c52119435.ctfilter(c,tp)
return c:IsControler(tp) and c:IsAbleToChangeControler() and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0
end
function c52119435.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetHandler():GetLinkedGroup()
if chk==0 then return #g==2 and g:IsExists(c52119435.ctfilter,1,nil,tp) and g:IsExists(c52119435.ctfilter,1,nil,1-tp) end
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,2,0,0)
end
function c52119435.ctop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local a=g:GetFirst()
local b=g:GetNext()
if a and b then
Duel.SwapControl(a,b)
end
end
--レイダーズ・ウィング
function c52159691.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(52159691,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,52159691)
e1:SetCost(c52159691.spcost)
e1:SetTarget(c52159691.sptg)
e1:SetOperation(c52159691.spop)
c:RegisterEffect(e1)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_XMATERIAL)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetCondition(c52159691.xmatcon)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
end
function c52159691.cfilter(c,tp)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_XYZ)
and c:CheckRemoveOverlayCard(tp,1,REASON_COST)
end
function c52159691.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c52159691.cfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEATTACHFROM)
local c=Duel.SelectMatchingCard(tp,c52159691.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp):GetFirst()
c:RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c52159691.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c52159691.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
c:RegisterEffect(e1,true)
end
end
function c52159691.xmatcon(e)
return e:GetHandler():GetOriginalAttribute()==ATTRIBUTE_DARK
end
--鉄獣戦線 銀弾のルガル
function c52331012.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST),2,3)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(52331012,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,52331012)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCondition(c52331012.spcon)
e1:SetTarget(c52331012.sptg)
e1:SetOperation(c52331012.spop)
c:RegisterEffect(e1)
--atkchange
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(52331012,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,52331013)
e2:SetTarget(c52331012.atktg)
e2:SetOperation(c52331012.atkop)
c:RegisterEffect(e2)
end
function c52331012.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c52331012.spfilter(c,e,tp)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c52331012.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c52331012.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c52331012.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c52331012.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(52331012,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetLabel(fid)
e3:SetLabelObject(tc)
e3:SetCondition(c52331012.thcon)
e3:SetOperation(c52331012.thop)
Duel.RegisterEffect(e3,tp)
end
end
function c52331012.thcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(52331012)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c52331012.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetLabelObject(),nil,REASON_EFFECT)
end
function c52331012.atkfilter(c)
return c:IsFaceup() and c:GetRace()~=0
end
function c52331012.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c52331012.atkfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end
function c52331012.atkop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetMatchingGroup(c52331012.atkfilter,tp,LOCATION_MZONE,0,nil)
local ct=tg:GetClassCount(Card.GetRace)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-ct*300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--わくわくメルフィーズ
function c53054164.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_BEAST),2,2,nil,nil,99)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(53054164,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c53054164.dacon)
e1:SetCost(c53054164.dacost)
e1:SetTarget(c53054164.datg)
e1:SetOperation(c53054164.daop)
c:RegisterEffect(e1)
--to extra
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(53054164,1))
e2:SetCategory(CATEGORY_TOEXTRA+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,53054164)
e2:SetCondition(c53054164.tecon)
e2:SetTarget(c53054164.tetg)
e2:SetOperation(c53054164.teop)
c:RegisterEffect(e2)
end
function c53054164.dacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function c53054164.dacost(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 c53054164.datg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,53054164)==0 end
end
function c53054164.daop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x146))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,53054164,RESET_PHASE+PHASE_END,0,1)
end
function c53054164.tecon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function c53054164.tefilter(c)
return c:IsFaceup() and c:IsRace(RACE_BEAST) and c:IsType(TYPE_XYZ) and c:IsAbleToExtra()
end
function c53054164.tetg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c53054164.tefilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c53054164.tefilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c53054164.tefilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_GRAVE)
end
function c53054164.spfilter(c,e,tp)
return c:IsLevelBelow(2) and c:IsRace(RACE_BEAST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c53054164.teop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local ct=tc:GetOverlayCount()
if Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_EXTRA)
and ct>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c53054164.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(53054164,2)) then
Duel.BreakEffect()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
ct=math.min(ct,ft)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c53054164.spfilter),tp,LOCATION_GRAVE,0,1,ct,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--混沌幻魔アーミタイル-虚無幻影羅生悶
function c60110982.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode3(c,6007213,32491822,69890967,true,true)
--change name
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(43378048)
c:RegisterEffect(e1)
--control
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60110982,0))
e2:SetCategory(CATEGORY_CONTROL)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c60110982.cttg)
e2:SetOperation(c60110982.ctop)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CONTROL_CHANGED)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetOperation(c60110982.regop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(60110982,1))
e4:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c60110982.rmcon)
e4:SetTarget(c60110982.rmtg)
e4:SetOperation(c60110982.rmop)
c:RegisterEffect(e4)
end
function c60110982.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsControlerCanBeChanged() end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0)
end
function c60110982.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.GetControl(c,1-tp)
end
end
function c60110982.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(60110982,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c60110982.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(60110982)>0
end
function c60110982.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,0,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,e:GetHandler():GetOwner(),LOCATION_EXTRA)
end
function c60110982.spfilter(c,e,p)
return c:IsCode(43378048) and c:IsCanBeSpecialSummoned(e,0,p,true,false) and Duel.GetLocationCountFromEx(p,p,nil,c)>0
end
function c60110982.rmop(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandler():GetOwner()
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,0,nil)
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 and g:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED)
and Duel.IsExistingMatchingCard(c60110982.spfilter,p,LOCATION_EXTRA,0,1,nil,e,p) and Duel.SelectYesNo(p,aux.Stringid(60110982,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(p,c60110982.spfilter,p,LOCATION_EXTRA,0,1,1,nil,e,p)
Duel.SpecialSummon(sg,0,p,p,true,false,POS_FACEUP)
end
end
--双天拳 鎧阿
function c60237530.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x14f),2,true)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(60237530,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,60237530)
e1:SetTarget(c60237530.target)
e1:SetOperation(c60237530.operation)
c:RegisterEffect(e1)
--atk & def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(c60237530.adcon)
e2:SetTarget(c60237530.ffilter)
e2:SetValue(300)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
end
function c60237530.target(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:IsAttackPos() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAttackPos,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsAttackPos,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c60237530.operation(e,tp,eg,ep,ev,re,r,rp)
local tc,c=Duel.GetFirstTarget(),e:GetHandler()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
function c60237530.ffilter(e,c)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x14f)
end
function c60237530.fmfilter(c)
local mg=c:GetMaterial()
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x14f) and c:IsFaceup() and mg and mg:IsExists(Card.IsType,1,nil,TYPE_EFFECT)
end
function c60237530.adcon(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(c60237530.fmfilter,tp,LOCATION_MZONE,0,1,nil)
end
--アーク・リベリオン・エクシーズ・ドラゴン
function c64276752.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,5,3)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetCondition(c64276752.indcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(64276752,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,64276752)
e2:SetCost(c64276752.cost)
e2:SetTarget(c64276752.target)
e2:SetOperation(c64276752.operation)
c:RegisterEffect(e2)
end
function c64276752.indcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c64276752.cost(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 c64276752.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler()):GetSum(Card.GetBaseAttack)>0 end
end
function c64276752.mgfilter(c)
return c:IsType(TYPE_XYZ) and c:IsAttribute(ATTRIBUTE_DARK)
end
function c64276752.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,c):GetSum(Card.GetBaseAttack)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(atk)
c:RegisterEffect(e1)
local mg=c:GetOverlayGroup()
if mg:IsExists(c64276752.mgfilter,1,nil) then
local g=Duel.GetMatchingGroup(aux.disfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,c)
if #g>0 then Duel.BreakEffect() end
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
end
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_CANNOT_ATTACK)
e0:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetTargetRange(LOCATION_MZONE,0)
e0:SetTarget(c64276752.ftarget)
e0:SetLabel(c:GetFieldID())
e0:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e0,tp)
end
function c64276752.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
--焔聖騎士将-オリヴィエ
function c65398390.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(65398390,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(c65398390.descon)
e1:SetTarget(c65398390.destg)
e1:SetOperation(c65398390.desop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(65398390,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,65398390)
e2:SetCondition(aux.exccon)
e2:SetTarget(c65398390.sptg)
e2:SetOperation(c65398390.spop)
c:RegisterEffect(e2)
end
function c65398390.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetEquipCount()>0
end
function c65398390.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c65398390.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c65398390.eqfilter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR)
end
function c65398390.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c65398390.eqfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c65398390.eqfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c65398390.eqfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c65398390.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) then
local res=Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)
if res then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(TYPE_TUNER)
c:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
if res and tc:IsRelateToEffect(e) and tc:IsControler(tp) then
if not Duel.Equip(tp,tc,c,false) then return end
--equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetLabelObject(c)
e2:SetValue(c65398390.eqlimit)
tc:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(tc)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(500)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
end
end
function c65398390.eqlimit(e,c)
return c==e:GetLabelObject()
end
......@@ -35,9 +35,27 @@ function c70875686.initial_effect(c)
e2:SetOperation(c70875686.thop)
c:RegisterEffect(e2)
end
function c70875686.excostfilter(c,tp)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsAbleToRemoveAsCost() and c:IsHasEffect(25725326,tp)
end
function c70875686.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
local g=Duel.GetMatchingGroup(c70875686.excostfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil,tp)
if e:GetHandler():IsReleasable() then g:AddCard(e:GetHandler()) end
if chk==0 then return #g>0 end
local tc
if #g>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25725326,0))
tc=g:Select(tp,1,1,nil):GetFirst()
else
tc=g:GetFirst()
end
local te=tc:IsHasEffect(25725326,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_COST+REASON_REPLACE)
else
Duel.Release(tc,REASON_COST)
end
end
function c70875686.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
......
--禰須三破鳴比
function c71459017.initial_effect(c)
c:EnableCounterPermit(0x58)
--cannot be material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e1:SetValue(c71459017.fuslimit)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e4)
--add counter
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(71459017,0))
e5:SetCategory(CATEGORY_COUNTER)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_SUMMON_SUCCESS)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetOperation(c71459017.countop)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e6)
--control
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(71459017,1))
e7:SetCategory(CATEGORY_CONTROL)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e7:SetCode(EVENT_PHASE+PHASE_END)
e7:SetRange(LOCATION_MZONE)
e7:SetCountLimit(1)
e7:SetCondition(c71459017.ctrcon)
e7:SetTarget(c71459017.ctrtg)
e7:SetOperation(c71459017.ctrop)
c:RegisterEffect(e7)
--dice
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(71459017,2))
e8:SetCategory(CATEGORY_DICE+CATEGORY_DESTROY+CATEGORY_DAMAGE)
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e8:SetCode(EVENT_CONTROL_CHANGED)
e8:SetCountLimit(1)
e8:SetCondition(c71459017.dicecon)
e8:SetTarget(c71459017.dicetg)
e8:SetOperation(c71459017.diceop)
c:RegisterEffect(e8)
end
c71459017.toss_dice=true
function c71459017.fuslimit(e,c,sumtype)
return sumtype&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION
end
function c71459017.countop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
c:AddCounter(0x58,6)
end
end
function c71459017.ctrcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c71459017.ctrtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0)
end
function c71459017.ctrop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.GetControl(c,1-tp)
end
end
function c71459017.dicecon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0x58)>0
end
function c71459017.dicetg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c71459017.diceop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and c:IsCanRemoveCounter(tp,0x58,1,REASON_EFFECT) then
local dc=Duel.TossDice(tp,1)
if dc>c:GetCounter(0x58) then dc=c:GetCounter(0x58) end
c:RemoveCounter(tp,0x58,dc,REASON_EFFECT)
if c:GetCounter(0x58)==0 and Duel.Destroy(c,REASON_EFFECT)~=0 then
Duel.Damage(tp,2000,REASON_EFFECT)
end
end
end
--魔導闇商人
function c72171665.initial_effect(c)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetCondition(c72171665.indcon)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(72171665,0))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCountLimit(1,72171665)
e3:SetCondition(c72171665.drcon)
e3:SetCost(c72171665.drcost)
e3:SetTarget(c72171665.drtg)
e3:SetOperation(c72171665.drop)
c:RegisterEffect(e3)
end
function c72171665.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_CONTINUOUS)
end
function c72171665.indcon(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(c72171665.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c72171665.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function c72171665.drfilter(c)
return c72171665.cfilter(c) and c:IsAbleToGraveAsCost()
end
function c72171665.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c72171665.drfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c72171665.drfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c72171665.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c72171665.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--獣王アルファ
function c73304257.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c73304257.sprcon)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(73304257,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,73304257)
e2:SetTarget(c73304257.thtg)
e2:SetOperation(c73304257.thop)
c:RegisterEffect(e2)
end
function c73304257.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g1=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local g2=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
return g1:GetSum(Card.GetAttack)<g2:GetSum(Card.GetAttack)
end
function c73304257.thfilter(c)
return c:IsFaceup() and c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsAbleToHand()
end
function c73304257.thfilter1(c,e)
return c73304257.thfilter(c) and c:IsCanBeEffectTarget(e)
end
function c73304257.thfilter2(c)
return c:IsFaceup() and c:IsAbleToHand()
end
function c73304257.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c73304257.thfilter(chkc) end
local ct1=Duel.GetMatchingGroupCount(c73304257.thfilter1,tp,LOCATION_MZONE,0,nil,e)
local ct2=Duel.GetMatchingGroupCount(c73304257.thfilter2,tp,0,LOCATION_MZONE,nil)
if chk==0 then return ct1>0 and ct2>0 end
local ct=math.min(ct1,ct2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c73304257.thfilter,tp,LOCATION_MZONE,0,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0)
end
function c73304257.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
local og=Duel.GetOperatedGroup()
local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_HAND)
if ct>0 and Duel.IsExistingMatchingCard(c73304257.thfilter2,tp,0,LOCATION_MZONE,ct,nil) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local hg=Duel.SelectMatchingCard(tp,c73304257.thfilter2,tp,0,LOCATION_MZONE,ct,ct,nil)
Duel.HintSelection(hg)
Duel.SendtoHand(hg,nil,REASON_EFFECT)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsCode,73304257))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
--インフェルニティ・ワイルドキャット
function c74148483.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,74148483+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c74148483.spcon)
e1:SetOperation(c74148483.spop)
c:RegisterEffect(e1)
--lv
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74148483,0))
e2:SetCategory(CATEGORY_LVCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,74148484)
e2:SetCondition(c74148483.lvcon)
e2:SetCost(c74148483.lvcost)
e2:SetTarget(c74148483.lvtg)
e2:SetOperation(c74148483.lvop)
c:RegisterEffect(e2)
end
function c74148483.spfilter(c)
return c:IsSetCard(0xb) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c74148483.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
return Duel.IsExistingMatchingCard(c74148483.spfilter,tp,LOCATION_HAND,0,1,c)
end
function c74148483.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c74148483.spfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST)
end
function c74148483.lvcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c74148483.costfilter(c)
return c:IsSetCard(0xb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c74148483.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74148483.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c74148483.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c74148483.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsLevelAbove(1) end
end
function c74148483.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local opt=Duel.SelectOption(tp,aux.Stringid(74148483,1),aux.Stringid(74148483,2))
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
if opt==0 then
e1:SetValue(1)
else
e1:SetValue(-1)
end
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--一か八か
function c74202664.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,74202664+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c74202664.condition)
e1:SetTarget(c74202664.target)
e1:SetOperation(c74202664.activate)
c:RegisterEffect(e1)
end
function c74202664.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<Duel.GetLP(1-tp)
end
function c74202664.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
if chk==0 then return #g>0 and (Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummon(tp) and not Duel.IsPlayerAffectedByEffect(tp,63060238)
or g:IsExists(Card.IsAbleToHand,1,nil)) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_DECK)
end
function c74202664.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
if #g<=0 then return end
Duel.ConfirmDecktop(tp,1)
local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
if tc:IsType(TYPE_MONSTER) and (tc:IsLevel(1) or tc:IsLevel(8)) then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if not tc:IsAbleToHand() and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) or ft<=0) then return end
if tc:IsAbleToHand() and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) or ft<=0 or Duel.SelectOption(tp,1190,1152)==0) then
Duel.DisableShuffleCheck()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ShuffleHand(tp)
else
Duel.DisableShuffleCheck()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
else
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local p=c:GetControler()
local b1=Duel.GetLP(p)~=1000
local ea=Duel.IsPlayerAffectedByEffect(1-p,EFFECT_REVERSE_DAMAGE)
local eb=Duel.IsPlayerAffectedByEffect(1-p,EFFECT_REVERSE_RECOVER)
local b2=Duel.GetLP(1-p)<8000 and (ea or not eb)
local b3=true
local off=0
local ops={}
local opval={}
off=1
if b1 then
ops[off]=aux.Stringid(74202664,0)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(74202664,1)
opval[off-1]=2
off=off+1
end
if b3 then
ops[off]=aux.Stringid(74202664,2)
opval[off-1]=3
off=off+1
end
local op=Duel.SelectOption(1-tp,table.unpack(ops))
if opval[op]==1 then
Duel.SetLP(p,1000)
elseif opval[op]==2 then
Duel.Recover(1-p,8000-Duel.GetLP(1-p),REASON_EFFECT)
else return end
end
end
--憑依覚醒-ガギゴバイト
function c74426895.initial_effect(c)
--spsummon proc
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_DECK)
e1:SetCondition(c74426895.spcon)
e1:SetOperation(c74426895.spop)
e1:SetValue(SUMMON_VALUE_SELF)
c:RegisterEffect(e1)
--discard & draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74426895,0))
e2:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,74426895)
e2:SetCondition(c74426895.condition)
e2:SetTarget(c74426895.hdtg)
e2:SetOperation(c74426895.hdop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74426895,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,74426896)
e3:SetCondition(c74426895.thcon)
e3:SetTarget(c74426895.thtg)
e3:SetOperation(c74426895.thop)
c:RegisterEffect(e3)
end
function c74426895.spfilter1(c,tp)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c74426895.spfilter2,tp,LOCATION_MZONE,0,1,c)
end
function c74426895.spfilter2(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost() and c:IsLevelBelow(4)
end
function c74426895.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c74426895.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp)
end
function c74426895.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,c74426895.spfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(tp,c74426895.spfilter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst())
g1:Merge(g2)
Duel.SendtoGrave(g1,REASON_COST)
end
function c74426895.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF
end
function c74426895.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0
and Duel.IsPlayerCanDraw(tp,1) and Duel.IsPlayerCanDraw(1-tp,1) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1)
end
function c74426895.hdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()==0 then return end
local sg=g:RandomSelect(tp,1)
if Duel.SendtoGrave(sg,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
Duel.Draw(1-tp,1,REASON_EFFECT)
end
end
function c74426895.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c74426895.thfilter(c)
return ((c:IsSetCard(0xc0) and c:IsType(TYPE_SPELL+TYPE_TRAP)) or c:IsSetCard(0x514c)) and c:IsAbleToHand()
end
function c74426895.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74426895.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74426895.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74426895.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--魍魎跋扈
function c75025112.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCondition(c75025112.condition)
e1:SetTarget(c75025112.target)
e1:SetOperation(c75025112.activate)
c:RegisterEffect(e1)
end
function c75025112.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c75025112.filter(c)
return c:IsSummonable(true,nil) or c:IsMSetable(true,nil)
end
function c75025112.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c75025112.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c75025112.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c75025112.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if tc:IsSummonable(true,nil) and (not tc:IsMSetable(true,nil)
or Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) then
Duel.Summon(tp,tc,true,nil)
else Duel.MSet(tp,tc,true,nil) end
end
end
--双天の使命
function c75157704.initial_effect(c)
--copy spell
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,75157704+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(TIMING_MAIN_END)
e1:SetCondition(c75157704.condition)
e1:SetCost(c75157704.cost)
e1:SetTarget(c75157704.target)
e1:SetOperation(c75157704.operation)
c:RegisterEffect(e1)
end
function c75157704.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c75157704.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c75157704.filter(c)
return c:IsSetCard(0x14f) and not c:IsCode(75157704) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:CheckActivateEffect(false,true,false)~=nil
end
function c75157704.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c75157704.filter,tp,LOCATION_GRAVE,0,1,nil)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c75157704.filter,tp,LOCATION_GRAVE,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true)
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
end
function c75157704.operation(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
--双天脚 鎧吽
function c7631534.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x14f),2,true)
--destroy replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c7631534.reptg)
e1:SetValue(c7631534.repval)
e1:SetOperation(c7631534.repop)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(7631534,0))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMING_MAIN_END)
e2:SetCountLimit(1,7631534)
e2:SetCondition(c7631534.discon)
e2:SetTarget(c7631534.distg)
e2:SetOperation(c7631534.disop)
c:RegisterEffect(e2)
end
function c7631534.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x14f) and c:IsType(TYPE_FUSION) and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c7631534.desfilter(c,e,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x14f)
and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_BATTLE_DESTROYED)
end
function c7631534.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c7631534.repfilter,1,nil,tp)
and Duel.IsExistingMatchingCard(c7631534.desfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectMatchingCard(tp,c7631534.desfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
e:SetLabelObject(g:GetFirst())
g:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED,true)
return true
end
return false
end
function c7631534.repval(e,c)
return c7631534.repfilter(c,e:GetHandlerPlayer())
end
function c7631534.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,7631534)
local tc=e:GetLabelObject()
tc:SetStatus(STATUS_DESTROY_CONFIRMED,false)
Duel.Destroy(tc,REASON_EFFECT+REASON_REPLACE)
end
function c7631534.fmfilter(c)
local mg=c:GetMaterial()
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x14f) and c:IsFaceup() and mg and mg:IsExists(Card.IsType,1,nil,TYPE_EFFECT)
end
function c7631534.discon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
and Duel.IsExistingMatchingCard(c7631534.fmfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c7631534.disfilter(c)
return aux.disfilter1(c) and c:GetSummonLocation()==LOCATION_EXTRA
end
function c7631534.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c7631534.disfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c7631534.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c7631534.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c7631534.disop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
......@@ -35,9 +35,27 @@ function c81997228.initial_effect(c)
e2:SetOperation(c81997228.spop)
c:RegisterEffect(e2)
end
function c81997228.excostfilter(c,tp)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsAbleToRemoveAsCost() and c:IsHasEffect(25725326,tp)
end
function c81997228.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
local g=Duel.GetMatchingGroup(c81997228.excostfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil,tp)
if e:GetHandler():IsReleasable() then g:AddCard(e:GetHandler()) end
if chk==0 then return #g>0 end
local tc
if #g>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25725326,0))
tc=g:Select(tp,1,1,nil):GetFirst()
else
tc=g:GetFirst()
end
local te=tc:IsHasEffect(25725326,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_COST+REASON_REPLACE)
else
Duel.Release(tc,REASON_COST)
end
end
function c81997228.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
......
--ネフティスの繋ぎ手
function c8454126.initial_effect(c)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(8454126,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,8454126)
e1:SetCondition(c8454126.spcon)
e1:SetTarget(c8454126.sptg)
e1:SetOperation(c8454126.spop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(8454126,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_RELEASE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,8454127)
e2:SetCondition(c8454126.descon)
e2:SetOperation(c8454126.desop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_DESTROYED)
c:RegisterEffect(e3)
end
function c8454126.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c8454126.spfilter(c,e,tp)
return c:IsSetCard(0x11f) and c:IsType(TYPE_RITUAL) and not c:IsCode(8454126) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
end
function c8454126.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c8454126.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c8454126.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,c8454126.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
tc:SetMaterial(nil)
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c8454126.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT) and re:GetHandler():IsSetCard(0x11f)
end
function c8454126.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
if Duel.GetCurrentPhase()==PHASE_STANDBY then
e1:SetLabel(Duel.GetTurnCount())
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
else
e1:SetLabel(0)
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
end
e1:SetCondition(c8454126.descon2)
e1:SetTarget(c8454126.destg2)
e1:SetOperation(c8454126.desop2)
Duel.RegisterEffect(e1,tp)
end
function c8454126.descon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel()
end
function c8454126.desfilter(c)
return not (c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)) and c:IsSetCard(0x11f) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND+LOCATION_DECK))
end
function c8454126.destg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c8454126.desfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil) end
end
function c8454126.fselect(g)
return g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)<=1
and g:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<=1
and g:FilterCount(Card.IsLocation,nil,LOCATION_ONFIELD)<=1
end
function c8454126.desop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,8454126)
local g=Duel.GetMatchingGroup(c8454126.desfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:SelectSubGroup(tp,c8454126.fselect,false,1,3)
Duel.Destroy(sg,REASON_EFFECT)
end
--暗黒界の援軍
function c85325774.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,85325774+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c85325774.target)
e1:SetOperation(c85325774.activate)
c:RegisterEffect(e1)
end
function c85325774.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_FIEND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c85325774.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c85325774.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c85325774.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_HAND,0,1,nil,RACE_FIEND) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c85325774.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,1,tp,1)
end
function c85325774.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
Duel.DiscardHand(tp,Card.IsRace,1,1,REASON_EFFECT+REASON_DISCARD,nil,RACE_FIEND)
end
end
--双天拳の熊羆
function c85360035.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(85360035,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,85360035)
e1:SetTarget(c85360035.target)
e1:SetOperation(c85360035.operation)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(85360035,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,85360036)
e2:SetCondition(c85360035.thcon)
e2:SetTarget(c85360035.thtg)
e2:SetOperation(c85360035.thop)
c:RegisterEffect(e2)
end
function c85360035.desfilter(c)
return c:IsFaceup() and c:IsSetCard(0x14f)
end
function c85360035.thfilter(c)
return c:IsSetCard(0x14f) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c85360035.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c85360035.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c85360035.desfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c85360035.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c85360035.desfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c85360035.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c85360035.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function c85360035.thfilter1(c,tp)
local mg=c:GetMaterial()
return mg and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp
and c:GetPreviousTypeOnField()&TYPE_FUSION~=0 and mg:IsExists(Card.IsType,1,nil,TYPE_EFFECT)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c85360035.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c85360035.thfilter1,1,nil,tp)
end
function c85360035.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function c85360035.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
--貪食魚グリーディス
function c8576764.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(8576764,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,8576764)
e1:SetTarget(c8576764.sptg)
e1:SetOperation(c8576764.spop)
c:RegisterEffect(e1)
--chk
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_BE_MATERIAL)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCondition(c8576764.atkcon)
e0:SetOperation(c8576764.chkop)
c:RegisterEffect(e0)
--atk/def
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(8576764,1))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c8576764.atkcon)
e2:SetTarget(c8576764.atktg)
e2:SetOperation(c8576764.atkop)
c:RegisterEffect(e2)
e0:SetLabelObject(e2)
end
function c8576764.spfilter(c,e,tp,lv)
return c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA) and c:IsLevelBelow(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c8576764.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local lv=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c8576764.spfilter(chkc,e,tp,lv) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c8576764.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,lv) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c8576764.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,lv)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c8576764.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
function c8576764.chkop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():GetReasonCard():CreateEffectRelation(e:GetLabelObject())
end
function c8576764.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
end
function c8576764.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=e:GetHandler():GetReasonCard()
if chk==0 then return rc:IsRelateToEffect(e) and rc:IsFaceup() and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
end
function c8576764.atkop(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler():GetReasonCard()
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if rc:IsRelateToEffect(e) and rc:IsFaceup() and ct>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(ct*200)
rc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
rc:RegisterEffect(e2)
end
end
--鉄獣の血盟
function c86379342.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,86379342)
e1:SetTarget(c86379342.sptg)
e1:SetOperation(c86379342.spop)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(86379342,0))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e2:SetCountLimit(1,86379342)
e2:SetCondition(c86379342.negcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c86379342.negtg)
e2:SetOperation(c86379342.negop)
c:RegisterEffect(e2)
end
function c86379342.spfilter1(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_LINK) and Duel.IsExistingMatchingCard(c86379342.spfilter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,c:GetRace())
end
function c86379342.spfilter2(c,e,tp,race)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and not c:IsRace(race) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c86379342.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c86379342.spfilter1(chkc,e,tp) end
if chk==0 then return Duel.GetMZoneCount(tp)>0 and Duel.IsExistingTarget(c86379342.spfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c86379342.spfilter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c86379342.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c86379342.spfilter2),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,tc:GetRace())
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c86379342.cfilter(c,tp)
return c:IsRace(RACE_BEAST) and c:IsFaceup()
and Duel.IsExistingMatchingCard(c86379342.cfilter1,tp,LOCATION_MZONE,0,1,c,c,tp)
end
function c86379342.cfilter1(c,c1,tp)
return c:IsRace(RACE_BEASTWARRIOR) and c:IsFaceup()
and Duel.IsExistingMatchingCard(c86379342.cfilter2,tp,LOCATION_MZONE,0,1,Group.FromCards(c,c1))
end
function c86379342.cfilter2(c)
return c:IsRace(RACE_WINDBEAST) and c:IsFaceup()
end
function c86379342.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c86379342.cfilter,tp,LOCATION_MZONE,0,1,nil,tp)
end
function c86379342.negfilter(c)
return aux.disfilter1(c) and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c86379342.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c86379342.negfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c86379342.negfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
Duel.SelectTarget(tp,c86379342.negfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
end
function c86379342.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsDisabled() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=e1:Clone()
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
tc:RegisterEffect(e3)
end
end
end
--電脳堺悟-老々
function c86483512.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86483512,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_GRAVE_ACTION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,86483512)
e1:SetTarget(c86483512.sptg)
e1:SetOperation(c86483512.spop)
c:RegisterEffect(e1)
end
function c86483512.tfilter(c,tp)
local type1=c:GetType()&0x7
return c:IsSetCard(0x14e) and c:IsFaceup() and Duel.IsExistingMatchingCard(c86483512.tgfilter,tp,LOCATION_DECK,0,1,nil,type1)
end
function c86483512.tgfilter(c,type1)
return not c:IsType(type1) and c:IsSetCard(0x14e) and c:IsAbleToGrave()
end
function c86483512.spfilter(c,e,tp,code1)
return c:IsSetCard(0x14e) and not c:IsCode(code1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c86483512.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c86483512.tfilter(chkc,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c86483512.tfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c86483512.tfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c86483512.spop(e,tp,eg,ep,ev,re,r,rp)
local c,tc=e:GetHandler(),Duel.GetFirstTarget()
local type1=tc:GetType()&0x7
if tc:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c86483512.tgfilter,tp,LOCATION_DECK,0,1,1,nil,type1)
local tgc=g:GetFirst()
if tgc and Duel.SendtoGrave(tgc,REASON_EFFECT)~=0 and tgc:IsLocation(LOCATION_GRAVE) and c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local code1=tgc:GetCode()
local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c86483512.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp,code1)
if #sg>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(86483512,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=sg:Select(tp,1,1,nil):GetFirst()
Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
end
end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetTargetRange(1,0)
e3:SetTarget(c86483512.splimit)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function c86483512.splimit(e,c)
return not (c:IsLevelAbove(3) or c:IsRankAbove(3))
end
--インフェルニティ・パラノイア
function c86547356.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86547356,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,86547356+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c86547356.cost)
e1:SetTarget(c86547356.target)
e1:SetOperation(c86547356.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(86547356,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c86547356.thtg)
e2:SetOperation(c86547356.thop)
c:RegisterEffect(e2)
end
function c86547356.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100,0,0)
return true
end
function c86547356.costfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsLevelAbove(1) and Duel.GetMZoneCount(tp,c)>0 and (c:IsFaceup() or c:IsControler(tp))
and Duel.IsExistingMatchingCard(c86547356.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,c:GetCode(),c:GetLevel())
end
function c86547356.spfilter(c,e,tp,code,lv)
return c:IsSetCard(0xb) and not c:IsCode(code) and c:IsLevel(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c86547356.target(e,tp,eg,ep,ev,re,r,rp,chk)
local check,code,lv=e:GetLabel()
if chk==0 then
if check~=100 then return false end
e:SetLabel(0,0,0)
return Duel.CheckReleaseGroup(tp,c86547356.costfilter,1,nil,e,tp)
end
local tc=Duel.SelectReleaseGroup(tp,c86547356.costfilter,1,1,nil,e,tp):GetFirst()
e:SetLabel(0,tc:GetCode(),tc:GetLevel())
Duel.Release(tc,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c86547356.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local check,code,lv=e:GetLabel()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c86547356.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp,code,lv)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
function c86547356.thfilter(c)
return c:IsSetCard(0xb) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c86547356.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c86547356.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c86547356.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c86547356.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c86547356.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--レイダーズ・アンブレイカブル・マインド
function c87091930.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetDescription(aux.Stringid(87091930,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,87091930)
e2:SetCondition(c87091930.descon)
e2:SetTarget(c87091930.destg)
e2:SetOperation(c87091930.desop)
c:RegisterEffect(e2)
--sset
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(87091930,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,87091931)
e3:SetCondition(c87091930.ssetcon)
e3:SetTarget(c87091930.ssettg)
e3:SetOperation(c87091930.ssetop)
c:RegisterEffect(e3)
end
function c87091930.descfilter2(c)
return c:IsType(TYPE_XYZ) and c:IsAttribute(ATTRIBUTE_DARK)
end
function c87091930.descfilter(c,tp)
return c:IsSummonType(SUMMON_TYPE_XYZ) and c:GetSummonPlayer()==tp
and c:GetMaterial():IsExists(c87091930.descfilter2,1,nil)
end
function c87091930.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c87091930.descfilter,1,nil,tp)
end
function c87091930.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c87091930.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c87091930.ssetcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousPosition(POS_FACEUP)
and e:GetHandler():IsPreviousLocation(LOCATION_SZONE)
and e:GetHandler():IsReason(REASON_EFFECT)
end
function c87091930.ssetfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x95) and c:IsSSetable()
end
function c87091930.ssettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87091930.ssetfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil) end
end
function c87091930.ssetop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c87091930.ssetfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil)
if g then
Duel.SSet(tp,g)
end
end
--鉄獣戦線 フラクトール
function c87209160.initial_effect(c)
--to gy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(87209160,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetCountLimit(1,87209160)
e1:SetCost(c87209160.tgcost)
e1:SetTarget(c87209160.tgtg)
e1:SetOperation(c87209160.tgop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(87209160,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,87209161)
e2:SetCost(c87209160.spcost)
e2:SetTarget(c87209160.sptg)
e2:SetOperation(c87209160.spop)
c:RegisterEffect(e2)
end
function c87209160.tgfilter(c)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsLevelBelow(3) and c:IsAbleToGrave()
end
function c87209160.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() end
Duel.SendtoGrave(c,REASON_COST)
end
function c87209160.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87209160.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c87209160.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c87209160.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c87209160.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function c87209160.cfilter(c)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsAbleToRemoveAsCost()
end
function c87209160.fselect(g,tg)
return tg:IsExists(Card.IsLink,1,nil,#g)
end
function c87209160.spfilter(c,e,tp)
return c:IsType(TYPE_LINK) and c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c87209160.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local cg=Duel.GetMatchingGroup(c87209160.cfilter,tp,LOCATION_GRAVE,0,nil)
local tg=Duel.GetMatchingGroup(c87209160.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
local _,maxlink=tg:GetMaxGroup(Card.GetLink)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
if #tg==0 then return false end
return cg:CheckSubGroup(c87209160.fselect,1,maxlink,tg)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=cg:SelectSubGroup(tp,c87209160.fselect,false,1,maxlink,tg)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
e:SetLabel(rg:GetCount())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c87209160.spfilter1(c,e,tp,lk)
return c87209160.spfilter(c,e,tp) and c:IsLink(lk)
end
function c87209160.spop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(0xff,0xff)
e1:SetTarget(aux.NOT(aux.TargetBoolFunction(Card.IsRace,RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)))
e1:SetValue(c87209160.sumlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local lk=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c87209160.spfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lk)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c87209160.sumlimit(e,c)
if not c then return false end
return c:IsControler(e:GetHandlerPlayer())
end
--RR-ストラングル・レイニアス
function c87321742.initial_effect(c)
--self ss
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(87321742,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,87321742)
e1:SetCondition(c87321742.sscon)
e1:SetTarget(c87321742.sstg)
e1:SetOperation(c87321742.ssop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(87321742,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,87321743)
e2:SetCondition(c87321742.spcon)
e2:SetTarget(c87321742.sptg)
e2:SetOperation(c87321742.spop)
c:RegisterEffect(e2)
end
function c87321742.ssfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsFaceup()
end
function c87321742.sscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c87321742.ssfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c87321742.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c87321742.ssop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c87321742.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c87321742.splimit(e,c)
return not c:IsAttribute(ATTRIBUTE_DARK)
end
function c87321742.tgfilter(c,e,tp)
return c:IsSetCard(0xba) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c87321742.mfilter(c)
return c:IsType(TYPE_XYZ) and c:IsAttribute(ATTRIBUTE_DARK)
end
function c87321742.ffilter(c)
return c:IsType(TYPE_XYZ) and c:GetOverlayGroup():IsExists(c87321742.mfilter,1,nil)
end
function c87321742.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c87321742.ffilter,tp,LOCATION_MZONE,0,1,nil)
end
function c87321742.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c87321742.tgfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c87321742.tgfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c87321742.tgfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c87321742.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
--教導神理
function c87481592.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetTarget(c87481592.target)
e1:SetOperation(c87481592.operation)
c:RegisterEffect(e1)
--atk up/down
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(c87481592.atkval)
c:RegisterEffect(e2)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(87481592,0))
e4:SetCategory(CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,87481592)
e4:SetCondition(c87481592.tgcon)
e4:SetTarget(c87481592.tgtg)
e4:SetOperation(c87481592.tgop)
c:RegisterEffect(e4)
--Equip limit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_EQUIP_LIMIT)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetValue(1)
c:RegisterEffect(e5)
end
function c87481592.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c87481592.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c87481592.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x145)
end
function c87481592.atkval(e,c)
if c:IsSetCard(0x145) then
return c:GetLevel()*100
else
return Duel.GetMatchingGroupCount(c87481592.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)*-200
end
end
function c87481592.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget()
return ec and c:IsReason(REASON_LOST_TARGET) and ec:IsReason(REASON_DESTROY)
end
function c87481592.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
end
function c87481592.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_EXTRA,0,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--双天招来
function c87669904.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN+CATEGORY_HANDES+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,87669904+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c87669904.target)
e1:SetOperation(c87669904.activate)
c:RegisterEffect(e1)
end
function c87669904.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c87669904.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x14f) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c87669904.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler(),REASON_EFFECT) and ft>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,87669905,0x14f,0x4011,0,0,2,RACE_WARRIOR,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ft,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,ft,0,0)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c87669904.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local count=0
if Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD,nil,REASON_EFFECT)~=0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,87669905,0x14f,0x4011,0,0,2,RACE_WARRIOR,ATTRIBUTE_LIGHT) then
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
for i=1,ft do
local token=Duel.CreateToken(tp,87669905)
if Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)~=0 and count==0 then
count=2
end
end
Duel.SpecialSummonComplete()
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(c87669904.desop)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UNRELEASABLE_SUM)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetValue(1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_UNRELEASABLE_NONSUM)
Duel.RegisterEffect(e3,tp)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetTargetRange(1,0)
e4:SetTarget(c87669904.splimit)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
while count>0 do
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c87669904.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c87669904.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c87669904.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if (sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0)) and Duel.SelectYesNo(tp,aux.Stringid(87669904,0)) then
Duel.BreakEffect()
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
count=count-1
else
count=0
end
end
end
function c87669904.desop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_MZONE,0,nil,TYPE_TOKEN)
Duel.Destroy(tg,REASON_EFFECT)
end
function c87669904.splimit(e,c)
return not c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_EXTRA)
end
--RUM-ファントム・フォース
function c88504133.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,88504133)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCondition(c88504133.condition)
e1:SetCost(c88504133.cost)
e1:SetTarget(c88504133.target)
e1:SetOperation(c88504133.activate)
c:RegisterEffect(e1)
end
function c88504133.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c88504133.cgfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToRemoveAsCost()
end
function c88504133.cefilter(c,tc,ct,e,tp)
if not c:IsType(TYPE_XYZ) then return false end
local r=c:GetRank()-tc:GetRank()
return c:IsSetCard(0xba,0x10db,0x2073)
and tc:IsCanBeXyzMaterial(c) and r>0 and ct>=r
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,tc,c)>0
end
function c88504133.cfilter(c,e,tp)
local ct=Duel.GetMatchingGroupCount(c88504133.cgfilter,tp,LOCATION_GRAVE,0,nil)
return c:IsType(TYPE_XYZ) and c:IsAttribute(ATTRIBUTE_DARK)
and c:IsCanBeEffectTarget(e)
and Duel.IsExistingMatchingCard(c88504133.cefilter,tp,LOCATION_EXTRA,0,1,nil,c,ct,e,tp)
end
function c88504133.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local avail={}
local availbool={}
local ct=Duel.GetMatchingGroupCount(c88504133.cgfilter,tp,LOCATION_GRAVE,0,nil)
local gfield=Duel.GetMatchingGroup(c88504133.cfilter,tp,LOCATION_MZONE,0,nil,e,tp)
for tc in aux.Next(gfield) do
local gextra=Duel.GetMatchingGroup(c88504133.cefilter,tp,LOCATION_EXTRA,0,nil,tc,ct,e,tp)
for ex in aux.Next(gextra) do
local r=ex:GetRank()-tc:GetRank()
if not availbool[r] then
availbool[r]=true
table.insert(avail,r)
end
end
end
local num=Duel.AnnounceNumber(tp,table.unpack(avail))
e:SetLabel(num)
local cost=Duel.SelectMatchingCard(tp,c88504133.cgfilter,tp,LOCATION_GRAVE,0,num,num,nil)
Duel.Remove(cost,POS_FACEUP,REASON_COST)
end
function c88504133.tgefilter(c,tc,e,tp,rank)
if not c:IsType(TYPE_XYZ) then return false end
local r=c:GetRank()-tc:GetRank()
return c:IsSetCard(0xba,0x10db,0x2073)
and tc:IsCanBeXyzMaterial(c) and r==rank
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,tc,c)>0
end
function c88504133.tgfilter(c,e,tp,rank)
return c:IsType(TYPE_XYZ) and c:IsAttribute(ATTRIBUTE_DARK)
and Duel.IsExistingMatchingCard(c88504133.tgefilter,tp,LOCATION_EXTRA,0,1,nil,c,e,tp,rank)
end
function c88504133.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c88504133.cfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c88504133.cfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c88504133.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp,e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c88504133.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) and tc:IsFaceup()
and tc:IsRelateToEffect(e) and tc:IsControler(tp) and not tc:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c88504133.tgefilter,tp,LOCATION_EXTRA,0,1,1,nil,tc,e,tp,e:GetLabel())
local sc=g:GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c88504133.splimit)
Duel.RegisterEffect(e1,tp)
end
function c88504133.splimit(e,c)
return not c:IsType(TYPE_XYZ) and c:IsLocation(LOCATION_EXTRA)
end
--幻影騎士団ステンドグリーブ
function c88544390.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88544390,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,88544390)
e1:SetCondition(c88544390.spcon)
e1:SetTarget(c88544390.sptg)
e1:SetOperation(c88544390.spop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetDescription(aux.Stringid(88544390,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,88544391)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c88544390.sptarget)
e2:SetOperation(c88544390.spoperation)
c:RegisterEffect(e2)
end
function c88544390.spfilter(c,tp)
return c:IsControler(tp) and c:IsSetCard(0x10db) and c:IsFaceup()
end
function c88544390.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c88544390.spfilter,1,nil,tp)
end
function c88544390.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,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c88544390.spop(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 and Duel.SelectYesNo(tp,aux.Stringid(88544390,2)) then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(1)
c:RegisterEffect(e1)
end
end
function c88544390.filter(c,e,tp)
return c:IsSetCard(0x10db) and not c:IsCode(88544390) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c88544390.sptarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c88544390.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c88544390.spoperation(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,c88544390.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.SelectYesNo(tp,aux.Stringid(88544390,2)) then
Duel.BreakEffect()
local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1)
tc:RegisterEffect(e1)
end
end
--天霆號アーゼウス
function c90448279.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,12,2,c90448279.ovfilter,aux.Stringid(90448279,0),2,c90448279.xyzop)
c:EnableReviveLimit()
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(90448279,1))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(c90448279.tgcost)
e1:SetTarget(c90448279.tgtg)
e1:SetOperation(c90448279.tgop)
c:RegisterEffect(e1)
--overlay
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(90448279,2))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c90448279.ovcon)
e2:SetTarget(c90448279.ovtg)
e2:SetOperation(c90448279.ovop)
c:RegisterEffect(e2)
if not c90448279.global_check then
c90448279.global_check=true
local ge1=Effect.GlobalEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_BATTLED)
ge1:SetOperation(c90448279.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c90448279.ovfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c90448279.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,90448279)>0 and Duel.GetFlagEffect(tp,90448280)==0 end
Duel.RegisterFlagEffect(tp,90448280,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c90448279.check(c)
return c and c:IsType(TYPE_XYZ)
end
function c90448279.checkop(e,tp,eg,ep,ev,re,r,rp)
if c90448279.check(Duel.GetAttacker()) or c90448279.check(Duel.GetAttackTarget()) then
Duel.RegisterFlagEffect(tp,90448279,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(1-tp,90448279,RESET_PHASE+PHASE_END,0,1)
end
end
function c90448279.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c90448279.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0)
end
function c90448279.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c90448279.cfilter(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD) and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c90448279.ovcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c90448279.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c90448279.ofilter(c,e)
return c:IsCanOverlay() and (not e or not c:IsImmuneToEffect(e))
end
function c90448279.ovtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(c90448279.ofilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,0,1,nil) end
end
function c90448279.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c90448279.ofilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e)
local tc=g:GetFirst()
if tc then
Duel.Overlay(c,tc)
end
end
end
--電脳堺甲-甲々
function c90664857.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,3,2,nil,nil,99)
--indes
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(90664857,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c90664857.cost)
e1:SetTarget(c90664857.target)
e1:SetOperation(c90664857.operation)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(90664857,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLED)
e2:SetCountLimit(1)
e2:SetCondition(c90664857.rmcon)
e2:SetTarget(c90664857.rmtg)
e2:SetOperation(c90664857.rmop)
c:RegisterEffect(e2)
end
function c90664857.cost(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 c90664857.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function c90664857.operation(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_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e1)
end
end
function c90664857.rmfilter(c,g)
return g:IsExists(c90664857.rmfilter2,1,c,c)
end
function c90664857.rmfilter2(c,tc)
return c:GetOriginalRace()&tc:GetOriginalRace()~=0
and c:GetOriginalAttribute()&tc:GetOriginalAttribute()~=0
end
function c90664857.rmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
e:SetLabelObject(bc)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)
return bc and bc:IsStatus(STATUS_OPPO_BATTLE) and bc:IsRelateToBattle() and g:IsExists(c90664857.rmfilter,1,nil,g)
end
function c90664857.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetLabelObject()
if chk==0 then return bc:IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,bc,1,0,0)
end
function c90664857.rmop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetLabelObject()
if bc:IsRelateToBattle() and bc:IsControler(1-tp) then
Duel.Remove(bc,POS_FACEUP,REASON_EFFECT)
end
end
--ペンギン勇者
function c91397409.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(91397409,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,91397409)
e1:SetCondition(c91397409.spcon)
e1:SetTarget(c91397409.sptg)
e1:SetOperation(c91397409.spop)
c:RegisterEffect(e1)
--can not be effect target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsPosition,POS_FACEDOWN_DEFENSE))
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
--position
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(91397409,0))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,91397410)
e3:SetCondition(c91397409.poscon)
e3:SetTarget(c91397409.postg)
e3:SetOperation(c91397409.posop)
c:RegisterEffect(e3)
end
function c91397409.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c91397409.spfilter(c,e,tp)
return c:IsSetCard(0x5a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function c91397409.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c91397409.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c91397409.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,c91397409.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,g)
end
end
function c91397409.poscon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp and re:IsActiveType(TYPE_MONSTER)
end
function c91397409.posfilter(c)
return c:IsPosition(POS_FACEDOWN_DEFENSE) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsCanChangePosition()
end
function c91397409.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c91397409.posfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function c91397409.posop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectMatchingCard(tp,c91397409.posfilter,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.ChangePosition(g,POS_FACEUP_DEFENSE)
end
end
--電脳堺狐-仙々
function c92519087.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--remove
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1)
--return
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(92519087,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,92519087)
e2:SetCondition(c92519087.rtcon)
e2:SetTarget(c92519087.rttg)
e2:SetOperation(c92519087.rtop)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(92519087,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,92519088)
e3:SetCondition(aux.exccon)
e3:SetCost(c92519087.spcost)
e3:SetTarget(c92519087.sptg)
e3:SetOperation(c92519087.spop)
c:RegisterEffect(e3)
end
function c92519087.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
function c92519087.rtcon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at and at:IsControler(tp)
end
function c92519087.rttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c92519087.tgfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,PLAYER_ALL,LOCATION_REMOVED)
end
function c92519087.rtop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c92519087.tgfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT+REASON_RETURN)
end
end
function c92519087.fselect(g)
return g:GetClassCount(Card.GetOriginalRace)==g:GetCount()
and g:GetClassCount(Card.GetOriginalAttribute)==g:GetCount()
end
function c92519087.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c92519087.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c92519087.costfilter,tp,LOCATION_GRAVE,0,e:GetHandler())
if chk==0 then return g:CheckSubGroup(c92519087.fselect,2,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g:SelectSubGroup(tp,c92519087.fselect,false,2,2)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
function c92519087.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c92519087.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--奇采のプルフィネス
function c9798352.initial_effect(c)
--level change(summon/special summon success)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9798352,0))
e1:SetCategory(CATEGORY_LVCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,9798352)
e1:SetCost(c9798352.lvcost)
e1:SetTarget(c9798352.lvtg)
e1:SetOperation(c9798352.lvop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--level change(ignition)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(9798352,1))
e3:SetCategory(CATEGORY_REMOVE+CATEGORY_LVCHANGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,9798353)
e3:SetTarget(c9798352.lvtg2)
e3:SetOperation(c9798352.lvop2)
c:RegisterEffect(e3)
--set
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(9798352,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,9798354)
e4:SetCondition(c9798352.setcon)
e4:SetTarget(c9798352.settg)
e4:SetOperation(c9798352.setop)
c:RegisterEffect(e4)
end
function c9798352.costfilter(c)
return c:IsType(TYPE_TRAP) and c:IsAbleToRemoveAsCost()
end
function c9798352.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9798352.costfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c9798352.costfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c9798352.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsRelateToEffect(e) and c:IsLevelAbove(1) end
end
function c9798352.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
function c9798352.lvfilter(c)
return c:IsType(TYPE_TRAP) and c:IsAbleToRemove()
end
function c9798352.lvtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c9798352.lvfilter(chkc) end
local c=e:GetHandler()
if chk==0 then return c:IsLevelAbove(1) and Duel.IsExistingTarget(c9798352.lvfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c9798352.lvfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c9798352.lvop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_REMOVED)
and c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
function c9798352.setcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function c9798352.setfilter(c)
return c:IsFaceup() and c:GetType()==TYPE_TRAP and c:IsSSetable()
end
function c9798352.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9798352.setfilter,tp,LOCATION_REMOVED,0,1,nil) end
end
function c9798352.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c9798352.setfilter,tp,LOCATION_REMOVED,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.SSet(tp,tc)
end
end
--鉄獣戦線 凶鳥のシュライグ
function c99726621.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST),2,4)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(99726621,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,99726621)
e1:SetTarget(c99726621.rmtg)
e1:SetOperation(c99726621.rmop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c99726621.rmcon)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(99726621,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,99726622)
e3:SetTarget(c99726621.thtg)
e3:SetOperation(c99726621.thop)
c:RegisterEffect(e3)
end
function c99726621.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c99726621.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function c99726621.cfilter(c,tp)
return c:IsFaceup() and c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsControler(tp)
end
function c99726621.rmcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c99726621.cfilter,1,nil,tp)
end
function c99726621.rfilter(c)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsFaceup()
end
function c99726621.thfilter(c,lv)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsAbleToHand() and c:IsLevelBelow(lv)
end
function c99726621.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=Duel.GetMatchingGroupCount(c99726621.rfilter,tp,LOCATION_REMOVED,0,nil)
return ct>0 and Duel.IsExistingMatchingCard(c99726621.thfilter,tp,LOCATION_DECK,0,1,nil,ct)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c99726621.thop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(c99726621.rfilter,tp,LOCATION_REMOVED,0,nil)
if ct<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c99726621.thfilter,tp,LOCATION_DECK,0,1,1,nil,ct)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment