Commit 504b7917 authored by mercury233's avatar mercury233

add cards DP23

parent 4f68468c
--ジャンク・コンバーター
function c11069680.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11069680,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,11069680)
e1:SetCost(c11069680.thcost)
e1:SetTarget(c11069680.thtg)
e1:SetOperation(c11069680.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11069680,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,11069681)
e2:SetCondition(c11069680.spcon)
e2:SetTarget(c11069680.sptg)
e2:SetOperation(c11069680.spop)
c:RegisterEffect(e2)
end
function c11069680.dfilter(c)
return c:IsType(TYPE_TUNER) and c:IsDiscardable()
end
function c11069680.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable()
and Duel.IsExistingMatchingCard(c11069680.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c11069680.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c11069680.thfilter(c)
return c:IsSetCard(0x1017) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c11069680.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11069680.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c11069680.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c11069680.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 c11069680.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
end
function c11069680.spfilter(c,e,tp)
return c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c11069680.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c11069680.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c11069680.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c11069680.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c11069680.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_DEFENSE) 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
--EMポップアップ
function c11481610.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,11481610+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c11481610.cost)
e1:SetTarget(c11481610.target)
e1:SetOperation(c11481610.activate)
c:RegisterEffect(e1)
end
function c11481610.cfilter(c,e,tp,lsc,rsc)
local lv=c:GetLevel()
return (c:IsSetCard(0x9f,0x99) or (c:IsSetCard(0x98) and c:IsType(TYPE_PENDULUM))) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and lv>0 and lv>lsc and lv<rsc
end
function c11481610.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,e:GetHandler())
if chk==0 then return g:GetCount()>0 end
local ct=1
for i=2,3 do
if Duel.IsPlayerCanDraw(tp,i) then ct=i end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,ct,nil)
e:SetLabel(Duel.SendtoGrave(sg,REASON_COST))
end
function c11481610.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
local ct=e:GetLabel()
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_HAND)
end
function c11481610.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local ct=Duel.Draw(p,d,REASON_EFFECT)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local res=false
local lc=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local rc=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if ct>0 and ft>0 and lc and rc then
local lsc=lc:GetLeftScale()
local rsc=rc:GetRightScale()
if lsc>rsc then lsc,rsc=rsc,lsc end
if Duel.IsExistingMatchingCard(c11481610.cfilter,tp,LOCATION_HAND,0,1,nil,e,tp,lsc,rsc) and Duel.SelectYesNo(tp,aux.Stringid(11481610,0)) then
Duel.BreakEffect()
ct=math.min(ct,ft)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
local g=Duel.GetMatchingGroup(c11481610.cfilter,tp,LOCATION_HAND,0,nil,e,tp,lsc,rsc)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ct)
res=Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
if not res then
local lp=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
Duel.SetLP(tp,Duel.GetLP(tp)-lp*1000)
end
end
--フェイバリット・ヒーロー
function c11881272.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)
e1:SetTarget(c11881272.target)
e1:SetOperation(c11881272.operation)
c:RegisterEffect(e1)
--equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(c11881272.eqlimit)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(c11881272.atkval)
e3:SetCondition(c11881272.atkcon)
c:RegisterEffect(e3)
--effect target
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetValue(aux.tgoval)
e4:SetCondition(c11881272.atkcon)
c:RegisterEffect(e4)
--activate field
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(11881272,0))
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e5:SetRange(LOCATION_SZONE)
e5:SetCountLimit(1,11881272)
e5:SetTarget(c11881272.acttg)
e5:SetOperation(c11881272.actop)
c:RegisterEffect(e5)
--chain atk
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(11881272,1))
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_BATTLE_DESTROYING)
e6:SetRange(LOCATION_SZONE)
e6:SetCondition(c11881272.chacon)
e6:SetCost(c11881272.chacost)
e6:SetOperation(c11881272.chaop)
c:RegisterEffect(e6)
end
function c11881272.eqfilter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and c:IsSetCard(0x8)
end
function c11881272.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c11881272.eqfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c11881272.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c11881272.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c11881272.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and c11881272.eqfilter(tc) then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c11881272.eqlimit(e,c)
return c:IsLevelAbove(5) and c:IsSetCard(0x8)
end
function c11881272.atkval(e,c)
return e:GetHandler():GetEquipTarget():GetBaseDefense()
end
function c11881272.atkcon(e)
return Duel.IsExistingMatchingCard(aux.TRUE,e:GetHandlerPlayer(),LOCATION_FZONE,0,1,nil)
end
function c11881272.actfilter(c,tp)
return c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function c11881272.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11881272.actfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,tp) end
if not Duel.CheckPhaseActivity() then e:SetLabel(1) else e:SetLabel(0) end
end
function c11881272.actop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11881272,2))
if e:GetLabel()==1 then Duel.RegisterFlagEffect(tp,11881272,RESET_CHAIN,0,1) end
local g=Duel.SelectMatchingCard(tp,c11881272.actfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,tp)
Duel.ResetFlagEffect(tp,11881272)
local tc=g:GetFirst()
if tc then
local te=tc:GetActivateEffect()
if e:GetLabel()==1 then Duel.RegisterFlagEffect(tp,11881272,RESET_CHAIN,0,1) end
local b=te:IsActivatable(tp,true,true)
if b then
Duel.ResetFlagEffect(tp,11881272)
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
end
function c11881272.chacon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
return Duel.GetAttacker()==ec and ec:IsRelateToBattle() and ec:IsStatus(STATUS_OPPO_BATTLE) and ec:IsChainAttackable()
end
function c11881272.chacost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c11881272.chaop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
end
--フューチャー・ドライブ
function c12508268.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:SetCountLimit(1,12508268+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c12508268.target)
e1:SetOperation(c12508268.activate)
c:RegisterEffect(e1)
end
function c12508268.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x207f)
end
function c12508268.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c12508268.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c12508268.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c12508268.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c12508268.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ATTACK_ALL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_START)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetOperation(c12508268.disop)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e3:SetTarget(c12508268.distg)
tc:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_BATTLE_DESTROYING)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e5:SetCondition(aux.bdocon)
e5:SetOperation(c12508268.damop)
tc:RegisterEffect(e5)
end
function c12508268.disop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
if not bc then return end
bc:RegisterFlagEffect(12508268,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE,0,1)
end
function c12508268.distg(e,c)
return c:GetFlagEffect(12508268)~=0
end
function c12508268.damop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
if not bc then return end
local dam=math.max(bc:GetBaseAttack(),0)
if dam>0 then
Duel.Hint(HINT_CARD,0,12508268)
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
end
--E・HERO サンライザー
function c22908820.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c22908820.ffilter,2,true)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.fuslimit)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22908820,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,22908820)
e2:SetTarget(c22908820.srtg)
e2:SetOperation(c22908820.srop)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetValue(c22908820.val)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(22908820,1))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,22908821)
e4:SetCondition(c22908820.descon)
e4:SetTarget(c22908820.destg)
e4:SetOperation(c22908820.desop)
c:RegisterEffect(e4)
end
function c22908820.ffilter(c,fc,sub,mg,sg)
return c:IsFusionSetCard(0x8) and (not sg or not sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute()))
end
function c22908820.srfilter(c)
return c:IsCode(45906428) and c:IsAbleToHand()
end
function c22908820.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c22908820.srfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c22908820.srop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c22908820.srfilter,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 c22908820.atkfilter(c)
return c:IsFaceup() and c:GetAttribute()~=0
end
function c22908820.val(e,c)
local g=Duel.GetMatchingGroup(c22908820.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)
local att=0
local tc=g:GetFirst()
while tc do
att=bit.bor(att,tc:GetAttribute())
tc=g:GetNext()
end
local ct=0
while att~=0 do
if bit.band(att,0x1)~=0 then ct=ct+1 end
att=bit.rshift(att,1)
end
return ct*200
end
function c22908820.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=Duel.GetAttacker()
local tc=Duel.GetAttackTarget()
if not ac:IsControler(tp) then ac,tc=tc,ac end
return ac and ac:IsControler(tp) and ac:IsFaceup() and ac:IsSetCard(0x8) and ac~=c
end
function c22908820.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) 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 c22908820.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 c23020408.initial_effect(c)
aux.AddCodeList(c,46986414,38033121)
--set top
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23020408,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c23020408.target)
e1:SetOperation(c23020408.activate)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(23020408,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,23020408)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c23020408.drtg)
e2:SetOperation(c23020408.drop)
c:RegisterEffect(e2)
end
function c23020408.filter(c)
return (aux.IsCodeListed(c,46986414) or aux.IsCodeListed(c,38033121) or c:IsCode(46986414)) and not c:IsCode(23020408)
and (c:IsAbleToDeck() or c:IsLocation(LOCATION_DECK))
end
function c23020408.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c23020408.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c23020408.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(23020408,2))
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c23020408.filter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if tc:IsLocation(LOCATION_DECK) then
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
else
Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)
end
if tc:IsLocation(LOCATION_DECK) then
Duel.ConfirmDecktop(tp,1)
end
end
end
function c23020408.cfilter(c)
return (c:IsCode(46986414,38033121) or (c:IsSetCard(0x139) and c:IsType(TYPE_MONSTER))) and c:IsFaceup()
end
function c23020408.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c23020408.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
local ct=g:GetClassCount(Card.GetCode)
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function c23020408.drop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetMatchingGroup(c23020408.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
local ct=g:GetClassCount(Card.GetCode)
Duel.Draw(p,ct,REASON_EFFECT)
end
--シンクロ・チェイス
function c23442438.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(23442438,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
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,23442438)
e2:SetCondition(c23442438.spcon)
e2:SetTarget(c23442438.sptg)
e2:SetOperation(c23442438.spop)
c:RegisterEffect(e2)
--can not chain
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_SZONE)
e3:SetOperation(c23442438.ccop)
c:RegisterEffect(e3)
end
function c23442438.cfilter(c)
return c:IsSummonType(SUMMON_TYPE_SYNCHRO) and c:IsType(TYPE_SYNCHRO) and c:IsSetCard(0x66,0x1017,0xa3)
end
function c23442438.spfilter(c,e,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c23442438.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c23442438.cfilter,1,nil) and rp==tp
end
function c23442438.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local mg=eg:Filter(c23442438.cfilter,nil):GetFirst():GetMaterial()
if chkc then return mg:IsContains(chkc) and c23442438.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and mg:IsExists(c23442438.spfilter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=mg:FilterSelect(tp,c23442438.spfilter,1,1,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c23442438.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function c23442438.ccop(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler()
if ep==tp and re:IsActiveType(TYPE_MONSTER) and tc:IsType(TYPE_SYNCHRO) and tc:IsOriginalSetCard(0x66,0x1017,0xa3) then
Duel.SetChainLimit(c23442438.chainlm)
end
end
function c23442438.chainlm(e,rp,tp)
return tp==rp
end
--ズバババンチョー-GC
function c23720856.initial_effect(c)
--spsummon1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23720856,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,23720856)
e1:SetCondition(c23720856.spcon1)
e1:SetTarget(c23720856.sptg1)
e1:SetOperation(c23720856.spop1)
c:RegisterEffect(e1)
--spsummon2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(23720856,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,23720857)
e2:SetTarget(c23720856.sptg2)
e2:SetOperation(c23720856.spop2)
c:RegisterEffect(e2)
end
function c23720856.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x8f,0x54) and not c:IsCode(23720856)
end
function c23720856.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c23720856.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c23720856.sptg1(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 c23720856.spop1(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 c23720856.spfilter(c,e,tp)
return c:IsSetCard(0x59,0x82) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c23720856.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c23720856.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c23720856.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c23720856.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c23720856.spop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
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(c23720856.splimit)
Duel.RegisterEffect(e1,tp)
end
function c23720856.splimit(e,c)
return not c:IsType(TYPE_XYZ) and c:IsLocation(LOCATION_EXTRA)
end
--スマイル・アクション
function c47870325.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c47870325.target)
e1:SetOperation(c47870325.activate)
c:RegisterEffect(e1)
--disable attack
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_HANDES)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_FZONE)
e2:SetTarget(c47870325.atktg)
e2:SetOperation(c47870325.atkop)
c:RegisterEffect(e2)
local ng=Group.CreateGroup()
ng:KeepAlive()
e1:SetLabelObject(ng)
e2:SetLabelObject(ng)
end
function c47870325.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,PLAYER_ALL,LOCATION_GRAVE)
end
function c47870325.rmfilter(c,tp)
return c:IsType(TYPE_SPELL) and c:IsAbleToRemove(tp)
end
function c47870325.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Group.CreateGroup()
local g1=Duel.GetMatchingGroup(aux.NecroValleyFilter(c47870325.rmfilter),tp,LOCATION_GRAVE,0,nil,tp)
local g2=Duel.GetMatchingGroup(aux.NecroValleyFilter(c47870325.rmfilter),tp,0,LOCATION_GRAVE,nil,1-tp)
if g1:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(47870325,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg1=g1:Select(tp,1,5,nil)
g:Merge(sg1)
end
if g2:GetCount()>0 and Duel.SelectYesNo(1-tp,aux.Stringid(47870325,0)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local sg2=g2:Select(1-tp,1,5,nil)
g:Merge(sg2)
end
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
if og:GetCount()==0 then return end
local sg=e:GetLabelObject()
if c:GetFlagEffect(47870325)==0 then
sg:Clear()
c:RegisterFlagEffect(47870325,RESET_EVENT+RESETS_STANDARD,0,1)
end
local tc=og:GetFirst()
while tc do
if tc:IsLocation(LOCATION_REMOVED) then
sg:AddCard(tc)
tc:CreateRelation(c,RESET_EVENT+RESETS_STANDARD)
end
tc=og:GetNext()
end
else
local sg=e:GetLabelObject()
if sg:GetCount()>0 then
sg:Clear()
end
end
end
function c47870325.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local p=1-ep
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,p,LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,1,p,LOCATION_HAND)
end
function c47870325.thfilter(c,rc,p)
return c:IsRelateToCard(rc) and c:IsControler(p) and c:IsAbleToHand()
end
function c47870325.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(47870325)==0 then return end
local p=1-ep
local g=e:GetLabelObject():Filter(c47870325.thfilter,nil,c,p)
if g:GetCount()>0 and Duel.SelectYesNo(p,aux.Stringid(47870325,1)) then
local res=false
local sg=g:RandomSelect(1-p,1)
local tc=sg:GetFirst()
if Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-p,tc)
if tc:IsControler(p) and tc:IsDiscardable(REASON_EFFECT) and Duel.SelectYesNo(p,aux.Stringid(47870325,2)) then
Duel.BreakEffect()
if Duel.SendtoGrave(tc,REASON_EFFECT+REASON_DISCARD)~=0 then
res=true
Duel.NegateAttack()
end
end
end
if not res then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c47870325.damval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,p)
end
end
end
function c47870325.damval(e,re,dam,r,rp,rc)
if bit.band(r,REASON_BATTLE)~=0 then
return dam*2
else return dam end
end
--超魔導師-ブラック・マジシャンズ
function c50237654.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,{46986414,38033121},aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),1,true,true)
--draw
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c50237654.drcon)
e1:SetTarget(c50237654.drtg)
e1:SetOperation(c50237654.drop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(c50237654.sptg)
e2:SetOperation(c50237654.spop)
c:RegisterEffect(e2)
end
function c50237654.drcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and e:GetHandler():GetFlagEffect(1)>0
end
function c50237654.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c50237654.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.Draw(tp,1,REASON_EFFECT)~=0 then
local dc=Duel.GetOperatedGroup():GetFirst()
if dc:IsType(TYPE_SPELL+TYPE_TRAP) and dc:IsSSetable()
and Duel.SelectYesNo(tp,aux.Stringid(50237654,0)) then
Duel.BreakEffect()
Duel.SSet(tp,dc)
if dc:IsType(TYPE_QUICKPLAY) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
dc:RegisterEffect(e1)
end
if dc:IsType(TYPE_TRAP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
dc:RegisterEffect(e1)
end
end
end
end
function c50237654.spfilter1(c,e,tp)
return c:IsCode(46986414) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c50237654.spfilter2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,c,e,tp)
end
function c50237654.spfilter2(c,e,tp)
return c:IsCode(38033121) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c50237654.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50237654.spfilter1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and not Duel.IsPlayerAffectedByEffect(tp,59822133) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function c50237654.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c50237654.spfilter1),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c50237654.spfilter2),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,g1:GetFirst(),e,tp)
g1:Merge(g2)
if g1:GetCount()==2 then
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
end
end
--くず鉄のシグナル
function c50947142.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,50947142+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c50947142.condition)
e1:SetTarget(c50947142.target)
e1:SetOperation(c50947142.activate)
c:RegisterEffect(e1)
end
function c50947142.filter(c)
return c:IsType(TYPE_SYNCHRO) and aux.IsMaterialListType(c,TYPE_SYNCHRO) and c:IsFaceup()
end
function c50947142.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c50947142.filter,tp,LOCATION_MZONE,0,1,nil)
and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev) and rp==1-tp
end
function c50947142.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)
end
function c50947142.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsCanTurnSet() then
Duel.BreakEffect()
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
--サテライト・シンクロン
function c57458399.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(57458399,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,57458399)
e1:SetCondition(c57458399.spcon)
e1:SetTarget(c57458399.sptg)
e1:SetOperation(c57458399.spop)
c:RegisterEffect(e1)
--level
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(57458399,1))
e2:SetCategory(CATEGORY_LVCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,57458400)
e2:SetCondition(c57458399.lvcon)
e2:SetTarget(c57458399.lvtg)
e2:SetOperation(c57458399.lvop)
c:RegisterEffect(e2)
end
function c57458399.spfilter(c,tp)
return c:GetSummonLocation()==LOCATION_GRAVE and c:GetPreviousControler()==tp
end
function c57458399.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c57458399.spfilter,1,nil,tp)
end
function c57458399.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 c57458399.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 c57458399.lvfilter(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsOriginalSetCard(0x66,0x1017,0xa3) and c:IsType(TYPE_SYNCHRO)
end
function c57458399.lvcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c57458399.lvfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil)
end
function c57458399.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsLevelAbove(1) and not c:IsLevel(4) end
end
function c57458399.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_CHANGE_LEVEL)
e1:SetValue(4)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--EM天空の魔術師
function c58092907.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(58092907,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DESTROYED)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,58092907)
e1:SetCondition(c58092907.spcon)
e1:SetTarget(c58092907.sptg)
e1:SetOperation(c58092907.spop)
c:RegisterEffect(e1)
--monster effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(58092907,1))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,58092908)
e2:SetCondition(c58092907.mecon)
e2:SetTarget(c58092907.metg)
e2:SetOperation(c58092907.meop)
c:RegisterEffect(e2)
if not c58092907.global_check then
c58092907.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetLabel(58092907)
ge1:SetOperation(aux.sumreg)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
ge2:SetLabel(58092907)
Duel.RegisterEffect(ge2,0)
end
end
function c58092907.spfilter(c,tp,rp)
return (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and rp==1-tp)) and c:IsPreviousLocation(LOCATION_MZONE)
and c:GetPreviousControler()==tp and c:GetSummonLocation()==LOCATION_EXTRA
and bit.band(c:GetPreviousTypeOnField(),TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)~=0 and c:IsPreviousPosition(POS_FACEUP)
end
function c58092907.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()==1 and eg:IsExists(c58092907.spfilter,1,nil,tp,rp)
end
function c58092907.spfilter2(c,e,tp)
if c:IsLocation(LOCATION_HAND+LOCATION_DECK) or (not c:IsLocation(LOCATION_GRAVE) and c:IsFacedown())
or not c:IsCanBeSpecialSummoned(e,0,tp,false,false) or c:IsControler(1-tp) then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if c:IsLocation(LOCATION_EXTRA) then
ft=Duel.GetLocationCountFromEx(tp)
end
return ft>0
end
function c58092907.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ec=eg:GetFirst()
if chk==0 then return c58092907.spfilter2(ec,e,tp) end
Duel.SetTargetCard(ec)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,ec,1,0,0)
end
function c58092907.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=Duel.GetFirstTarget()
if ec:IsRelateToEffect(e) and Duel.SpecialSummon(ec,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.BreakEffect()
Duel.Destroy(c,REASON_EFFECT)
end
end
function c58092907.mefilter1(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
end
function c58092907.mefilter2(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM)
end
function c58092907.thfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c58092907.mecon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(58092907)>0
end
function c58092907.metg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c58092907.mefilter1,tp,LOCATION_MZONE,0,1,e:GetHandler())
or (Duel.IsExistingMatchingCard(c58092907.mefilter2,tp,LOCATION_MZONE,0,1,e:GetHandler())
and Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_DECK,0,1,nil,TYPE_PENDULUM)) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c58092907.cfilter(c,type)
return c:IsFaceup() and c:IsType(type)
end
function c58092907.meop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c58092907.mefilter1,tp,LOCATION_MZONE,0,c)
local b1=c:IsRelateToEffect(e) and g:IsExists(c58092907.cfilter,1,c,TYPE_FUSION)
local b2=g:IsExists(c58092907.cfilter,1,c,TYPE_SYNCHRO)
local b3=c:IsRelateToEffect(e) and c:IsFaceup() and g:IsExists(c58092907.cfilter,1,c,TYPE_XYZ)
local b4=Duel.IsExistingMatchingCard(c58092907.mefilter2,tp,LOCATION_MZONE,0,1,e:GetHandler())
and Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_DECK,0,1,nil,TYPE_PENDULUM)
if b1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
if b2 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetValue(c58092907.actlimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
if b3 then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetValue(c:GetBaseAttack()*2)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
end
if b4 then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetCountLimit(1)
e4:SetCondition(c58092907.thcon)
e4:SetOperation(c58092907.thop)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
end
function c58092907.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER)
end
function c58092907.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c58092907.thfilter,tp,LOCATION_DECK,0,1,nil)
end
function c58092907.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,58092907)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c58092907.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 c58270977.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE)
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,58270977+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c58270977.cost)
e1:SetTarget(c58270977.target)
e1:SetOperation(c58270977.activate)
c:RegisterEffect(e1)
end
function c58270977.cfilter(c,tp)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsSetCard(0x8) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function c58270977.spfilter(c,e,tp)
return c:IsSetCard(0x8) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c58270977.fselect(g,e,tp)
return Duel.IsExistingTarget(c58270977.spfilter,tp,LOCATION_GRAVE,0,1,g,e,tp)
end
function c58270977.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c58270977.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil,tp)
if chk==0 then return g:CheckSubGroup(c58270977.fselect,4,4,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,c58270977.fselect,false,4,4,e,tp)
local b1=sg:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_EARTH)
local b2=sg:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WATER)
local b3=sg:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_FIRE)
local b4=sg:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WIND)
if b1 and b2 and b3 and b4 then
e:SetLabel(1)
else
e:SetLabel(0)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c58270977.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c58270977.spfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c58270977.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c58270977.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c58270977.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)~=0 and e:GetLabel()==1 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(tc:GetBaseAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)
local gc=g:GetFirst()
while gc do
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
gc:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
gc:RegisterEffect(e3)
gc=g:GetNext()
end
end
end
--E・HERO リキッドマン
function c59392529.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(59392529,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,59392529)
e1:SetTarget(c59392529.target)
e1:SetOperation(c59392529.operation)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(59392529,1))
e2:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCountLimit(1,59392529)
e2:SetCondition(c59392529.drcon)
e2:SetTarget(c59392529.drtg)
e2:SetOperation(c59392529.drop)
c:RegisterEffect(e2)
end
function c59392529.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x8) and not c:IsCode(59392529) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c59392529.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c59392529.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c59392529.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c59392529.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c59392529.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c59392529.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and r==REASON_FUSION and c:GetReasonCard():IsSetCard(0x8)
end
function c59392529.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function c59392529.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)==2 then
Duel.ShuffleHand(p)
Duel.BreakEffect()
Duel.DiscardHand(p,nil,1,1,REASON_EFFECT+REASON_DISCARD)
end
end
--黒魔術の秘儀
function c59514116.initial_effect(c)
aux.AddCodeList(c,46986414,38033121)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(c59514116.target)
e1:SetOperation(c59514116.activate)
c:RegisterEffect(e1)
end
function c59514116.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c59514116.filter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c59514116.fcheck(tp,sg,fc)
return sg:IsExists(Card.IsFusionCode,1,nil,46986414,38033121)
end
function c59514116.rcheck(tp,g,c)
return g:IsExists(Card.IsCode,1,nil,46986414,38033121)
end
function c59514116.target(e,tp,eg,ep,ev,re,r,rp,chk)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
aux.FCheckAdditional=c59514116.fcheck
local res1=Duel.IsExistingMatchingCard(c59514116.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res1 then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res1=Duel.IsExistingMatchingCard(c59514116.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
local mg3=Duel.GetRitualMaterial(tp)
aux.RCheckAdditional=c59514116.rcheck
local res2=mg3:IsExists(Card.IsCode,1,nil,46986414,38033121)
and Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,aux.TRUE,e,tp,mg3,nil,Card.GetLevel,"Greater")
aux.RCheckAdditional=nil
if chk==0 then return res1 or res2 end
local s=0
if res1 and not res2 then
s=Duel.SelectOption(tp,aux.Stringid(59514116,0))
end
if not res1 and res2 then
s=Duel.SelectOption(tp,aux.Stringid(59514116,1))+1
end
if res1 and res2 then
s=Duel.SelectOption(tp,aux.Stringid(59514116,0),aux.Stringid(59514116,1))
end
e:SetLabel(s)
if s==0 then
local cat=e:GetCategory()
e:SetCategory(bit.bor(cat,CATEGORY_FUSION_SUMMON))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
if s==1 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
end
function c59514116.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c59514116.filter1,nil,e)
aux.FCheckAdditional=c59514116.fcheck
local sg1=Duel.GetMatchingGroup(c59514116.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(c59514116.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
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 mat=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat)
Duel.SendtoGrave(mat,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()
end
aux.FCheckAdditional=nil
elseif e:GetLabel()==1 then
local mg=Duel.GetRitualMaterial(tp)
aux.RCheckAdditional=c59514116.rcheck
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,aux.TRUE,e,tp,mg,nil,Card.GetLevel,"Greater")
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then
aux.RCheckAdditional=nil
return
end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
aux.RCheckAdditional=nil
end
end
--ドドドドワーフ-GG
function c59724555.initial_effect(c)
--spsummon1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(59724555,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,59724555)
e1:SetTarget(c59724555.sptg1)
e1:SetOperation(c59724555.spop1)
c:RegisterEffect(e1)
--spsummon2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(59724555,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,59724556)
e2:SetCondition(c59724555.spcon2)
e2:SetTarget(c59724555.sptg2)
e2:SetOperation(c59724555.spop2)
c:RegisterEffect(e2)
end
function c59724555.spfilter(c,e,tp)
return c:IsSetCard(0x8f,0x54) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c59724555.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c59724555.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c59724555.spop1(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,c59724555.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
function c59724555.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x59,0x82) and not c:IsCode(59724555)
end
function c59724555.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c59724555.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c59724555.sptg2(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 c59724555.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) 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)
Duel.SpecialSummonComplete()
end
end
--ペンデュラム・ディメンション
function c84274024.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(84274024,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c84274024.effcon)
e2:SetTarget(c84274024.sptg)
e2:SetOperation(c84274024.spop)
e2:SetLabel(TYPE_FUSION)
c:RegisterEffect(e2)
--to hand
local e3=e2:Clone()
e3:SetDescription(aux.Stringid(84274024,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetTarget(c84274024.thtg1)
e3:SetOperation(c84274024.thop1)
e3:SetLabel(TYPE_SYNCHRO)
c:RegisterEffect(e3)
--to hand
local e4=e2:Clone()
e4:SetDescription(aux.Stringid(84274024,2))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetTarget(c84274024.thtg2)
e4:SetOperation(c84274024.thop2)
e4:SetLabel(TYPE_XYZ)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE)
e5:SetRange(LOCATION_SZONE)
e5:SetCode(EFFECT_MATERIAL_CHECK)
e5:SetValue(c84274024.valcheck)
c:RegisterEffect(e5)
end
function c84274024.valcheck(e,c)
if c:GetMaterial():IsExists(Card.IsType,1,nil,TYPE_PENDULUM) then
c:RegisterFlagEffect(84274024,RESET_EVENT+0x4fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
function c84274024.effcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()==1 and eg:GetFirst():IsFaceup() and eg:GetFirst():IsType(e:GetLabel()) and eg:GetFirst():GetFlagEffect(84274024)~=0
end
function c84274024.spfilter(c,e,tp,lv)
local lvl=c:GetOriginalLevel()
return lvl>0 and lvl==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c84274024.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84274024.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,eg:GetFirst():GetOriginalLevel())
and Duel.GetFlagEffect(tp,84274024)==0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c84274024.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,84274024)~=0 then return end
local c=e:GetHandler()
if eg:GetFirst():IsFaceup() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local g=Duel.SelectMatchingCard(tp,c84274024.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,eg:GetFirst():GetOriginalLevel())
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
end
Duel.RegisterFlagEffect(tp,84274024,RESET_PHASE+PHASE_END,0,1)
end
function c84274024.thfilter1(c)
return c:IsCode(24094653) and c:IsAbleToHand()
end
function c84274024.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84274024.thfilter1,tp,LOCATION_DECK,0,1,nil)
and Duel.GetFlagEffect(tp,84274025)==0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c84274024.thop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,84274025)~=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c84274024.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
Duel.RegisterFlagEffect(tp,84274025,RESET_PHASE+PHASE_END,0,1)
end
function c84274024.thfilter2(c,e,tp,ft,rk)
return c:IsLevelBelow(rk) and c:IsType(TYPE_TUNER) and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function c84274024.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return Duel.IsExistingMatchingCard(c84274024.thfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,ft,eg:GetFirst():GetRank())
and Duel.GetFlagEffect(tp,84274026)==0 end
end
function c84274024.thop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,84274026)~=0 or eg:GetFirst():IsFacedown() then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c84274024.thfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,ft,eg:GetFirst():GetRank())
local tc=g:GetFirst()
if tc then
if ft>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (not tc:IsAbleToHand() or Duel.SelectOption(tp,1190,1152)==1) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
Duel.RegisterFlagEffect(tp,84274026,RESET_PHASE+PHASE_END,0,1)
end
--サテライト・ウォリアー
function c84664085.initial_effect(c)
--synchro summon
c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsSynchroType,TYPE_SYNCHRO),1)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(84664085,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,84664085)
e1:SetCondition(c84664085.descon)
e1:SetTarget(c84664085.destg)
e1:SetOperation(c84664085.desop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(84664085,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,84664086)
e2:SetCondition(c84664085.spcon)
e2:SetTarget(c84664085.sptg)
e2:SetOperation(c84664085.spop)
c:RegisterEffect(e2)
end
c84664085.material_type=TYPE_SYNCHRO
function c84664085.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c84664085.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ct=Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SYNCHRO)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) end
if chk==0 then return ct>0 and Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c84664085.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local ct=Duel.Destroy(tg,REASON_EFFECT)
if ct~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct*1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
function c84664085.spfilter(c,e,tp)
return c:IsLevelBelow(8) and c:IsSetCard(0x66,0x1017,0xa3) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c84664085.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c84664085.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c84664085.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_GRAVE)
end
function c84664085.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c84664085.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 or g:GetCount()<=0 then return end
local ct=math.min(ft,3)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ct)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
--オノマト選択
function c85119159.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,85119159+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c85119159.activate)
c:RegisterEffect(e1)
--level
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(85119159,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,85119160)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c85119159.target)
e2:SetOperation(c85119159.operation)
c:RegisterEffect(e2)
end
function c85119159.filter(c)
return c:IsAbleToHand() and (c:IsSetCard(0x13a) or c:IsCode(8512558)) and not c:IsCode(85119159)
end
function c85119159.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c85119159.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(85119159,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 c85119159.filter1(c)
return c:IsFaceup() and c:IsSetCard(0x8f,0x54,0x59,0x82)
end
function c85119159.filter2(c)
return c:IsFaceup() and c:GetLevel()>0
end
function c85119159.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c85119159.filter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(c85119159.filter1,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c85119159.filter2,tp,LOCATION_MZONE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c85119159.filter1,tp,LOCATION_MZONE,0,1,1,nil)
end
function c85119159.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local g=Duel.GetMatchingGroup(c85119159.filter2,tp,LOCATION_MZONE,0,tc)
local lc=g:GetFirst()
local lv=tc:GetLevel()
while lc do
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetValue(lv)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
lc:RegisterEffect(e2)
lc=g:GetNext()
end
end
end
--オッドアイズ・ウィザード・ドラゴン
function c85497611.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(85497611,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c85497611.spcost)
e1:SetTarget(c85497611.sptg)
e1:SetOperation(c85497611.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(85497611,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCost(c85497611.thcon)
e2:SetTarget(c85497611.thtg)
e2:SetOperation(c85497611.thop)
c:RegisterEffect(e2)
end
function c85497611.cfilter(c,tp)
return c:IsAttribute(ATTRIBUTE_DARK)
and Duel.IsExistingMatchingCard(c85497611.filter1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_MZONE,0,1,c,tp,c)
end
function c85497611.filter1(c,tp,mc)
local g=Group.FromCards(c)
if mc then g:AddCard(mc) end
return (c:IsLocation(LOCATION_HAND+LOCATION_DECK) or c:IsFaceup()) and c:IsCode(53025096) and c:IsAbleToGrave() and Duel.GetMZoneCount(tp,g)>0
end
function c85497611.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c85497611.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c85497611.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c85497611.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c85497611.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c85497611.filter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 and g:GetFirst():IsLocation(LOCATION_GRAVE) and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c85497611.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY) and rp==1-tp
end
function c85497611.spfilter(c,e,tp)
return c:IsSetCard(0x99) and not c:IsCode(85497611) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c85497611.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c85497611.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c85497611.thfilter(c)
return c:IsCode(82768499) and c:IsAbleToHand()
end
function c85497611.thop(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,aux.NecroValleyFilter(c85497611.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0
and Duel.IsExistingMatchingCard(c85497611.thfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(85497611,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,c85497611.thfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
end
--ジェネレーション・ネクスト
function c85787173.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,85787173+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c85787173.condition)
e1:SetTarget(c85787173.target)
e1:SetOperation(c85787173.activate)
c:RegisterEffect(e1)
end
function c85787173.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<Duel.GetLP(1-tp)
end
function c85787173.thfilter(c,e,tp,ft,atk)
return c:IsSetCard(0x3008,0xa4,0x1f) and c:IsAttackBelow(atk) and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function c85787173.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local atk=math.abs(Duel.GetLP(0)-Duel.GetLP(1))
if chk==0 then return Duel.IsExistingMatchingCard(c85787173.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,ft,atk) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c85787173.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local atk=math.abs(Duel.GetLP(0)-Duel.GetLP(1))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c85787173.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp,ft,atk)
local tc=g:GetFirst()
if tc then
local res=nil
if ft>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (not tc:IsAbleToHand() or Duel.SelectOption(tp,1190,1152)==1) then
res=Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
res=Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
if res~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c85787173.aclimit)
e1:SetLabel(tc:GetCode())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function c85787173.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel())
end
--ガガガガマジシャン
function c86331741.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,4,2)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86331741,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,86331741)
e1:SetCost(c86331741.spcost)
e1:SetTarget(c86331741.sptg)
e1:SetOperation(c86331741.spop)
c:RegisterEffect(e1)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(86331741,1))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(c86331741.atkcon)
e2:SetCost(c86331741.atkcost)
e2:SetTarget(c86331741.atktg)
e2:SetOperation(c86331741.atkop)
c:RegisterEffect(e2)
end
function c86331741.spcost(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 c86331741.spfilter(c,e,tp)
return c:IsType(TYPE_XYZ) and not c:IsCode(86331741) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c86331741.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c86331741.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c86331741.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c86331741.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c86331741.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:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
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)
tc:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
end
function c86331741.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSetCard(0x207f) and c:IsType(TYPE_XYZ)
end
function c86331741.atkcost(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 c86331741.atkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and (not c:IsAttack(4000) or aux.disfilter1(c))
end
function c86331741.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c86331741.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c86331741.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c86331741.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c86331741.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(4000)
tc:RegisterEffect(e1)
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:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
--マジシャンズ・コンビネーション
function c86509711.initial_effect(c)
aux.AddCodeList(c,46986414,38033121)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86509711,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(86509711,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_CHAINING)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetCondition(c86509711.spcon)
e2:SetCost(c86509711.spcost)
e2:SetTarget(c86509711.sptg)
e2:SetOperation(c86509711.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(c86509711.descon)
e4:SetTarget(c86509711.destg)
e4:SetOperation(c86509711.desop)
c:RegisterEffect(e4)
end
function c86509711.cfilter(c,e,tp)
return c:IsCode(46986414,38033121) and c:IsReleasable() and Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c86509711.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,c:GetCode())
end
function c86509711.spfilter(c,e,tp,code)
return not c:IsCode(code) and c:IsCode(46986414,38033121) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c86509711.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainDisablable(ev)
end
function c86509711.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function c86509711.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c86509711.cfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) and c:GetFlagEffect(86509711)==0
end
c:RegisterFlagEffect(86509711,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c86509711.cfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
e:SetLabel(g:GetFirst():GetCode())
Duel.Release(g,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c86509711.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c86509711.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,e:GetLabel())
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.NegateEffect(ev)
end
end
function c86509711.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_SZONE)
end
function c86509711.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c86509711.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
--マジシャンズ・ソウルズ
function c97631303.initial_effect(c)
aux.AddCodeList(c,46986414,38033121)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,97631303)
e1:SetCost(c97631303.spcost)
e1:SetTarget(c97631303.sptg)
e1:SetOperation(c97631303.spop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,97631304)
e2:SetCost(c97631303.drcost)
e2:SetTarget(c97631303.drtg)
e2:SetOperation(c97631303.drop)
c:RegisterEffect(e2)
end
function c97631303.cfilter(c)
return c:IsLevelAbove(6) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToGraveAsCost()
end
function c97631303.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c97631303.cfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c97631303.cfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c97631303.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b2=c:IsAbleToGrave()
if chk==0 then return b1 or b2 end
local s=0
if b1 and not b2 then
s=Duel.SelectOption(tp,aux.Stringid(97631303,0))
elseif not b1 and b2 then
s=Duel.SelectOption(tp,aux.Stringid(97631303,1))+1
elseif b1 and b2 then
s=Duel.SelectOption(tp,aux.Stringid(97631303,0),aux.Stringid(97631303,1))
end
e:SetLabel(s)
if s==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
end
function c97631303.spfilter(c,e,tp)
return c:IsCode(46986414,38033121) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c97631303.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
if e:GetLabel()==1 and c:IsRelateToEffect(e)
and Duel.SendtoGrave(c,REASON_EFFECT)>0 and c:IsLocation(LOCATION_GRAVE)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c97631303.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(97631303,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c97631303.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c97631303.drfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGraveAsCost()
end
function c97631303.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c97631303.drfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
local ct=1
if Duel.IsPlayerCanDraw(tp,2) then ct=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c97631303.drfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,ct,nil)
e:SetLabel(Duel.SendtoGrave(g,REASON_COST))
end
function c97631303.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
local ct=e:GetLabel()
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function c97631303.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
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