Commit 6856ee1a authored by mercury233's avatar mercury233 Committed by DailyShana

new cards MACR (#769)

parent baf35955
--幻煌龍の螺旋波
function c1197847.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c1197847.target)
e1:SetOperation(c1197847.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(c1197847.eqlimit)
c:RegisterEffect(e2)
--indestructable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e3:SetCountLimit(1)
e3:SetValue(c1197847.valcon)
c:RegisterEffect(e3)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(1197847,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_BATTLE)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,1197847)
e4:SetCondition(c1197847.spcon)
e4:SetTarget(c1197847.sptg)
e4:SetOperation(c1197847.spop)
c:RegisterEffect(e4)
end
function c1197847.eqlimit(e,c)
return c:IsType(TYPE_NORMAL)
end
function c1197847.filter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL)
end
function c1197847.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c1197847.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c1197847.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c1197847.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c1197847.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
end
end
function c1197847.valcon(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
function c1197847.spcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
return ec and ec:GetBattledGroupCount()>0
end
function c1197847.spfilter(c,e,tp)
return c:IsCode(56649609) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c1197847.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c1197847.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 then
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1)
end
end
function c1197847.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c1197847.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Equip(tp,c,tc)
Duel.SpecialSummonComplete()
if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 then
Duel.BreakEffect()
Duel.DiscardHand(1-tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
end
end
end
end
--幻影騎士団カースド・ジャベリン
function c12219047.initial_effect(c)
aux.AddXyzProcedure(c,nil,2,2)
--disable and reduce ATK
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12219047,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,12219047)
e1:SetCondition(c12219047.condition1)
e1:SetCost(c12219047.cost)
e1:SetTarget(c12219047.target)
e1:SetOperation(c12219047.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetHintTiming(TIMING_DAMAGE_STEP,0x21e0)
e2:SetCondition(c12219047.condition2)
c:RegisterEffect(e2)
end
function c12219047.condition1(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():GetOverlayGroup():IsExists(Card.IsSetCard,1,nil,0x10db)
end
function c12219047.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 c12219047.filter(c)
return c:IsFaceup() and not (c:GetAttack()==0 and c:IsDisabled())
end
function c12219047.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 c12219047.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c12219047.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c12219047.filter,tp,0,LOCATION_MZONE,1,1,nil)
end
function c12219047.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e3:SetValue(0)
tc:RegisterEffect(e3)
if tc:IsType(TYPE_TRAPMONSTER) then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e4)
end
end
end
function c12219047.condition2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsSetCard,1,nil,0x10db)
and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated())
end
--EMスカイ・ピューピル
function c122520.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(122520,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,122520)
e1:SetCost(c122520.spcost)
e1:SetTarget(c122520.sptg)
e1:SetOperation(c122520.spop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetTarget(c122520.distg)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(122520,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_CONFIRM)
e3:SetCondition(c122520.descon)
e3:SetTarget(c122520.destg)
e3:SetOperation(c122520.desop)
c:RegisterEffect(e3)
end
function c122520.spcfilter(c)
return c:IsFaceup() and c:IsSetCard(0x9f) and c:IsLevelAbove(5) and c:IsAbleToHandAsCost()
end
function c122520.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c122520.spcfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c122520.spcfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_COST)
end
function c122520.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c122520.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.GetLocationCount(tp,LOCATION_MZONE)<=0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SendtoGrave(c,REASON_RULE)
end
end
function c122520.distg(e,c)
return c==e:GetHandler():GetBattleTarget()
end
function c122520.descfilter(c)
return c:IsFaceup() and c:IsSetCard(0x9f)
end
function c122520.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c122520.descfilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
end
function c122520.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local t=Duel.GetAttackTarget()
if chk==0 then return Duel.GetAttacker()==e:GetHandler() and t~=nil end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,t,1,0,0)
end
function c122520.desop(e,tp,eg,ep,ev,re,r,rp)
local t=Duel.GetAttackTarget()
if t~=nil and t:IsRelateToBattle() then
Duel.Destroy(t,REASON_EFFECT)
end
end
--ドラゴニックD
function c13035077.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atk&def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xf9))
e2:SetValue(300)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetTarget(c13035077.indtg)
e4:SetValue(c13035077.indct)
c:RegisterEffect(e4)
--destroy
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(13035077,0))
e5:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_FZONE)
e5:SetCountLimit(1)
e5:SetTarget(c13035077.destg)
e5:SetOperation(c13035077.desop)
c:RegisterEffect(e5)
end
function c13035077.indtg(e,c)
return bit.band(c:GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE and c:IsSetCard(0xf9)
end
function c13035077.indct(e,re,r,rp)
if bit.band(r,REASON_BATTLE)~=0 then
return 1
else return 0 end
end
function c13035077.thfilter(c)
return c:IsSetCard(0xf9) and c:IsAbleToHand()
end
function c13035077.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler())
and Duel.IsExistingMatchingCard(c13035077.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c13035077.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,e:GetHandler())
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c13035077.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 c13331639.initial_effect(c)
c:EnableReviveLimit()
--aux.AddFusionProcFunMulti(c,false,c13331639.filters)
aux.EnablePendulumAttribute(c,false)
--fusion procedure
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_FUSION_MATERIAL)
e0:SetCondition(c13331639.fuscon)
e0:SetOperation(c13331639.fusop)
c:RegisterEffect(e0)
--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)
--act limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_PZONE)
e2:SetTargetRange(0,1)
e2:SetValue(c13331639.limval)
c:RegisterEffect(e2)
--destroy drawn
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(13331639,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_HAND)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1)
e3:SetCondition(c13331639.ddcon)
e3:SetTarget(c13331639.ddtg)
e3:SetOperation(c13331639.ddop)
c:RegisterEffect(e3)
--destroy all
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(13331639,1))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetTarget(c13331639.destg)
e4:SetOperation(c13331639.desop)
c:RegisterEffect(e4)
--Immune
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetValue(aux.tgoval)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e6:SetValue(c13331639.tgvalue)
c:RegisterEffect(e6)
--special summon
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(13331639,2))
e7:SetCategory(CATEGORY_SPECIAL_SUMMON)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e7:SetCode(EVENT_BATTLE_DESTROYING)
e7:SetCondition(aux.bdocon)
e7:SetTarget(c13331639.sptg)
e7:SetOperation(c13331639.spop)
c:RegisterEffect(e7)
--pendulum
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(13331639,3))
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e8:SetCode(EVENT_DESTROYED)
e8:SetProperty(EFFECT_FLAG_DELAY)
e8:SetCondition(c13331639.pencon)
e8:SetTarget(c13331639.pentg)
e8:SetOperation(c13331639.penop)
c:RegisterEffect(e8)
end
c13331639.miracle_synchro_fusion=true
function c13331639.fusfilter1(c)
return c:IsRace(RACE_DRAGON) and c:IsFusionType(TYPE_FUSION)
end
function c13331639.fusfilter2(c)
return c:IsRace(RACE_DRAGON) and c:IsFusionType(TYPE_SYNCHRO)
end
function c13331639.fusfilter3(c)
return c:IsRace(RACE_DRAGON) and c:IsFusionType(TYPE_XYZ)
end
function c13331639.fusfilter4(c)
return c:IsRace(RACE_DRAGON) and c:IsFusionType(TYPE_PENDULUM)
end
c13331639.filters={c13331639.fusfilter1,c13331639.fusfilter2,c13331639.fusfilter3,c13331639.fusfilter4}
-- TO BE REMOVED ONCE THE UTILITIES ARE UPDATED
function c13331639.FConditionFilterMultiOr(c,funs,n)
for i=1,n do
if funs[i](c) then return true end
end
return false
end
function c13331639.FConditionFilterMulti(c,mg,funs,n,tbt)
for i=1,n do
local tp=2^(i-1)
if bit.band(tbt,tp)~=0 and funs[i](c) then
local t2=tbt-tp
if t2==0 then return true end
local mg2=mg:Clone()
mg2:RemoveCard(c)
if mg2:IsExists(c13331639.FConditionFilterMulti,1,nil,mg2,funs,n,t2) then return true end
end
end
return false
end
function c13331639.CloneTable(g)
local ng={}
for i=1,#g do
local sg=g[i]:Clone()
table.insert(ng,sg)
end
return ng
end
function c13331639.FConditionFilterMulti2(c,gr)
local gr2=c13331639.CloneTable(gr)
for i=1,#gr2 do
gr2[i]:RemoveCard(c)
end
table.remove(gr2,1)
if #gr2==1 then
return gr2[1]:IsExists(aux.TRUE,1,nil)
else
return gr2[1]:IsExists(c13331639.FConditionFilterMulti2,1,nil,gr2)
end
end
function c13331639.FConditionFilterMultiSelect(c,funs,n,mg,sg)
local valid=c13331639.FConditionFilterMultiValid(sg,funs,n)
if not valid then valid={0} end
local all = (2^n)-1
for k,v in pairs(valid) do
v=bit.bxor(all,v)
if c13331639.FConditionFilterMulti(c,mg,funs,n,v) then return true end
end
return false
end
function c13331639.FConditionFilterMultiValid(g,funs,n)
local tp={}
local tc=g:GetFirst()
while tc do
local tp1={}
for i=1,n do
if funs[i](tc) then table.insert(tp1,2^(i-1)) end
end
table.insert(tp,tp1)
tc=g:GetNext()
end
return c13331639.FConditionMultiGenerateValids(tp,n)
end
function c13331639.FConditionMultiGenerateValids(vs,n)
local c=2
while #vs > 1 do
local v1=vs[1]
table.remove(vs,1)
local v2=vs[1]
table.remove(vs,1)
table.insert(vs,1,c13331639.FConditionMultiCombine(v1,v2,n,c))
c=c+1
end
return vs[1]
end
function c13331639.FConditionMultiCombine(t1,t2,n,c)
local res={}
for k1,v1 in pairs(t1) do
for k2,v2 in pairs(t2) do
table.insert(res,bit.bor(v1,v2))
end
end
res=c13331639.FConditionMultiCheckCount(res,n)
return c13331639.FConditionFilterMultiClean(res)
end
function c13331639.FConditionMultiCheckCount(vals,n)
local res={} local flags={}
for k,v in pairs(vals) do
local c=0
for i=1,n do
if bit.band(v,2^(i-1))~=0 then c=c+1 end
end
if not flags[c] then
res[c] = {v}
flags[c] = true
else
table.insert(res[c],v)
end
end
local mk=0
for k,v in pairs(flags) do
if k>mk then mk=k end
end
return res[mk]
end
function c13331639.FConditionFilterMultiClean(vals)
local res={} local flags={}
for k,v in pairs(vals) do
if not flags[v] then
table.insert(res,v)
flags[v] = true
end
end
return res
end
function c13331639.fuscon(e,g,gc,chkfnf)
local c=e:GetHandler()
if g==nil then return true end
if c:IsFaceup() then return false end
local chkf=bit.band(chkfnf,0xff)
local funs=c13331639.filters
local n=4
local mg=g:Filter(Card.IsCanBeFusionMaterial,nil,c):Filter(c13331639.FConditionFilterMultiOr,nil,funs,n)
if gc then
if not gc:IsCanBeFusionMaterial(c) then return false end
local check_tot=(2^n)-1
local mg2=mg:Clone()
mg2:RemoveCard(gc)
for i=1,n do
if funs[i](gc) then
local tbt=check_tot-2^(i-1)
if mg2:IsExists(c13331639.FConditionFilterMulti,1,nil,mg2,funs,n,tbt) then return true end
end
end
return false
end
local fs=false
local groups={}
for i=1,n do
table.insert(groups,Group.CreateGroup())
end
local tc=mg:GetFirst()
while tc do
for i=1,n do
if funs[i](tc) then
groups[i]:AddCard(tc)
if Auxiliary.FConditionCheckF(tc,chkf) then fs=true end
end
end
tc=mg:GetNext()
end
local gr2=c13331639.CloneTable(groups)
if chkf~=PLAYER_NONE then
return fs and gr2[1]:IsExists(c13331639.FConditionFilterMulti2,1,nil,gr2)
else
return gr2[1]:IsExists(c13331639.FConditionFilterMulti2,1,nil,gr2)
end
end
function c13331639.fusop(e,tp,eg,ep,ev,re,r,rp,gc,chkfnf)
local c=e:GetHandler()
local chkf=bit.band(chkfnf,0xff)
local funs=c13331639.filters
local n=4
local g=eg:Filter(Card.IsCanBeFusionMaterial,nil,c):Filter(c13331639.FConditionFilterMultiOr,nil,funs,n)
if gc then
local sg=Group.FromCards(gc)
local mg=g:Clone()
mg:RemoveCard(gc)
for i=1,n-1 do
local mg2=mg:Filter(c13331639.FConditionFilterMultiSelect,nil,funs,n,mg,sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg2=mg2:Select(tp,1,1,nil)
sg:AddCard(sg2:GetFirst())
mg:RemoveCard(sg2:GetFirst())
end
Duel.SetFusionMaterial(sg)
return
end
local sg=Group.CreateGroup()
local mg=g:Clone()
for i=1,n do
local mg2=mg:Filter(c13331639.FConditionFilterMultiSelect,nil,funs,n,mg,sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg2=nil
if i==1 and chkf~=PLAYER_NONE then
sg2=mg2:FilterSelect(tp,Auxiliary.FConditionCheckF,1,1,nil,chkf)
else
sg2=mg2:Select(tp,1,1,nil)
end
sg:AddCard(sg2:GetFirst())
mg:RemoveCard(sg2:GetFirst())
end
Duel.SetFusionMaterial(sg)
end
-- END SECTION TO BE REMOVED
function c13331639.check_fusion_material_48144509(g,chkf)
local fs=false
local mg=g:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_MZONE)
local funs=c13331639.filters
local groups={}
for i=1,4 do
table.insert(groups,Group.CreateGroup())
end
local tc=mg:GetFirst()
while tc do
for i=1,4 do
if funs[i](tc) then
groups[i]:AddCard(tc)
if Auxiliary.FConditionCheckF(tc,chkf) then fs=true end
end
end
tc=mg:GetNext()
end
local gr2=c13331639.CloneTable(groups)
if chkf~=PLAYER_NONE then
return fs and gr2[1]:IsExists(c13331639.FConditionFilterMulti2,1,nil,gr2)
else
return gr2[1]:IsExists(c13331639.FConditionFilterMulti2,1,nil,gr2)
end
end
function c13331639.select_fusion_material_48144509(tp,g,chkf)
local mg=g:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_MZONE)
local sg=Group.CreateGroup()
local funs=c13331639.filters
for i=1,4 do
local mg2=mg:Filter(c13331639.FConditionFilterMultiSelect,nil,funs,4,mg,sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg2=nil
if i==1 and chkf~=PLAYER_NONE then
sg2=mg2:FilterSelect(tp,Auxiliary.FConditionCheckF,1,1,nil,chkf)
else
sg2=mg2:Select(tp,1,1,nil)
end
sg:AddCard(sg2:GetFirst())
mg:RemoveCard(sg2:GetFirst())
end
Duel.SetFusionMaterial(sg)
return sg
end
function c13331639.limval(e,re,rp)
local rc=re:GetHandler()
return rc:IsLocation(LOCATION_MZONE) and re:IsActiveType(TYPE_MONSTER)
and rc:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ) and not rc:IsImmuneToEffect(e)
end
function c13331639.ddcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DRAW
end
function c13331639.ddfilter(c,tp)
return c:IsControler(1-tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function c13331639.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=nil
if eg then g=eg:Filter(c13331639.ddfilter,nil,tp) end
if chk==0 then return g and g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c13331639.ddop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=eg:Filter(c13331639.ddfilter,nil,tp)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
function c13331639.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c13331639.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
function c13331639.tgvalue(e,re,rp)
return rp~=e:GetHandlerPlayer()
end
function c13331639.spfilter(c,e,tp)
return c:IsSetCard(0x20f8) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c13331639.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c13331639.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,e,tp)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c13331639.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c13331639.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c13331639.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function c13331639.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_SZONE,6) or Duel.CheckLocation(tp,LOCATION_SZONE,7) end
end
function c13331639.penop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_SZONE,6) and not Duel.CheckLocation(tp,LOCATION_SZONE,7) then return false end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
--魔術師の左手
function c13758665.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:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c13758665.negcon)
e2:SetOperation(c13758665.negop)
c:RegisterEffect(e2)
end
function c13758665.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER)
end
function c13758665.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c13758665.cfilter,tp,LOCATION_MZONE,0,1,nil)
and rp~=tp and re:IsActiveType(TYPE_TRAP) and Duel.IsChainDisablable(ev)
end
function c13758665.negop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
--灰流うらら
function c14558127.initial_effect(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,14558127)
e1:SetCondition(c14558127.discon)
e1:SetCost(c14558127.discost)
e1:SetTarget(c14558127.distg)
e1:SetOperation(c14558127.disop)
c:RegisterEffect(e1)
end
function c14558127.discon(e,tp,eg,ep,ev,re,r,rp)
local ex1,g1,gc1,dp1,dv1=Duel.GetOperationInfo(ev,CATEGORY_TOHAND)
local ex2,g2,gc2,dp2,dv2=Duel.GetOperationInfo(ev,CATEGORY_SPECIAL_SUMMON)
local ex3,g3,gc3,dp3,dv3=Duel.GetOperationInfo(ev,CATEGORY_TOGRAVE)
local ex4=re:IsHasCategory(CATEGORY_DRAW)
local ex5=re:IsHasCategory(CATEGORY_SEARCH)
local ex6=re:IsHasCategory(CATEGORY_DECKDES)
return ((ex1 and bit.band(dv1,LOCATION_DECK)==LOCATION_DECK)
or (ex2 and bit.band(dv2,LOCATION_DECK)==LOCATION_DECK)
or (ex3 and bit.band(dv3,LOCATION_DECK)==LOCATION_DECK)
or ex4 or ex5 or ex6) and Duel.IsChainDisablable(ev)
end
function c14558127.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c14558127.distg(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 c14558127.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
--十二獣ハマーコング
function c14970113.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,3,c14970113.ovfilter,aux.Stringid(14970113,0),5,c14970113.xyzop)
c:EnableReviveLimit()
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c14970113.atkval)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(c14970113.defval)
c:RegisterEffect(e2)
--Cannot be effect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c14970113.efftg)
e3:SetCondition(c14970113.effcon)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--remove material
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(14970113,1))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c14970113.rmtg)
e4:SetOperation(c14970113.rmop)
c:RegisterEffect(e4)
end
function c14970113.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0xf1) and not c:IsCode(14970113)
end
function c14970113.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,14970113)==0 end
Duel.RegisterFlagEffect(tp,14970113,RESET_PHASE+PHASE_END,0,1)
end
function c14970113.atkfilter(c)
return c:IsSetCard(0xf1) and c:GetAttack()>=0
end
function c14970113.atkval(e,c)
local g=e:GetHandler():GetOverlayGroup():Filter(c14970113.atkfilter,nil)
return g:GetSum(Card.GetAttack)
end
function c14970113.deffilter(c)
return c:IsSetCard(0xf1) and c:GetDefense()>=0
end
function c14970113.defval(e,c)
local g=e:GetHandler():GetOverlayGroup():Filter(c14970113.deffilter,nil)
return g:GetSum(Card.GetDefense)
end
function c14970113.efftg(e,c)
return c:IsSetCard(0xf1) and c~=e:GetHandler()
end
function c14970113.effcon(e)
return e:GetHandler():GetOverlayCount()>0
end
function c14970113.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c14970113.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetOverlayCount()>0 then
c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)
end
end
--RR-エトランゼ・ファルコン
function c15092394.initial_effect(c)
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,5,2)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(15092394,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c15092394.descon)
e1:SetCost(c15092394.descost)
e1:SetTarget(c15092394.destg)
e1:SetOperation(c15092394.desop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(15092394,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c15092394.spcon)
e2:SetTarget(c15092394.sptg)
e2:SetOperation(c15092394.spop)
c:RegisterEffect(e2)
end
function c15092394.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsType,1,nil,TYPE_XYZ)
end
function c15092394.descost(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 c15092394.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetFirst():GetBaseAttack())
end
function c15092394.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,tc:GetBaseAttack(),REASON_EFFECT)
end
end
function c15092394.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetPreviousControler()==tp and rp==1-tp and c:IsReason(REASON_DESTROY)
end
function c15092394.spfilter(c,e,tp)
return c:IsType(TYPE_XYZ) and c:IsSetCard(0xba) and not c:IsCode(15092394) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c15092394.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c15092394.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c15092394.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c15092394.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c15092394.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 and c:IsRelateToEffect(e) then
Duel.Overlay(tc,Group.FromCards(c))
end
end
--ペンデュラムーチョ
function c18210764.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c,false)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(1160)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c18210764.reg)
c:RegisterEffect(e1)
--toextra
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(18210764,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetCondition(c18210764.tecon)
e2:SetTarget(c18210764.tetg)
e2:SetOperation(c18210764.teop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(18210764,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetTarget(c18210764.sptg)
e3:SetOperation(c18210764.spop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end
function c18210764.reg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:GetHandler():RegisterFlagEffect(18210764,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c18210764.tecon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(18210764)>0
end
function c18210764.tefilter(c)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsType(TYPE_PENDULUM)
and not c:IsCode(18210764) and not c:IsForbidden()
end
function c18210764.tetg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and c18210764.tefilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c18210764.tefilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(18210764,1))
local g=Duel.SelectTarget(tp,c18210764.tefilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetFirst():IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
end
function c18210764.teop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoExtraP(tc,tp,REASON_EFFECT)
end
end
function c18210764.spfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:GetLevel()==1
and not c:IsCode(18210764) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c18210764.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c18210764.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c18210764.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,c18210764.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x47e0000)
e1:SetValue(LOCATION_REMOVED)
g:GetFirst():RegisterEffect(e1,true)
end
end
--十二獣クックル
function c20155904.initial_effect(c)
--shuffle
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(20155904,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DESTROYED)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(c20155904.tdcon)
e1:SetTarget(c20155904.tdtg)
e1:SetOperation(c20155904.tdop)
c:RegisterEffect(e1)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(20155904,1))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(c20155904.discon)
e2:SetCost(c20155904.discost)
e2:SetTarget(c20155904.distg)
e2:SetOperation(c20155904.disop)
c:RegisterEffect(e2)
end
function c20155904.tdcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c20155904.tdfilter(c)
return c:IsSetCard(0xf1) and not c:IsCode(20155904) and c:IsAbleToDeck()
end
function c20155904.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c20155904.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c20155904.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c20155904.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c20155904.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
function c20155904.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetOriginalRace()==RACE_BEASTWARRIOR
and not c:IsStatus(STATUS_BATTLE_DESTROYED) and ep==1-tp
and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET)
and Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS):IsContains(c)
end
function c20155904.discost(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 c20155904.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c20155904.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
--真竜剣皇マスターP
function c21377582.initial_effect(c)
--summon with s & t
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21377582,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c21377582.otcon)
e1:SetOperation(c21377582.otop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
--tribute check
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(c21377582.valcheck)
c:RegisterEffect(e2)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(c21377582.efilter)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(21377582,2))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetHintTiming(0,0x1e0)
e4:SetCondition(c21377582.descon)
e4:SetCost(c21377582.descost)
e4:SetTarget(c21377582.destg)
e4:SetOperation(c21377582.desop)
c:RegisterEffect(e4)
end
function c21377582.otfilter(c)
return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()
end
function c21377582.otcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c21377582.otfilter,tp,LOCATION_ONFIELD,0,nil)
return (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and mg:GetCount()>=2)
or (Duel.CheckTribute(c,1) and mg:GetCount()>=1)
end
function c21377582.otop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c21377582.otfilter,tp,LOCATION_ONFIELD,0,nil)
local ct=2
local g=Group.CreateGroup()
if Duel.GetTributeCount(c)<ct then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g2=mg:Select(tp,ct-Duel.GetTributeCount(c),ct-Duel.GetTributeCount(c),nil)
g:Merge(g2)
mg:Sub(g2)
ct=ct-g2:GetCount()
end
if ct>0 and Duel.GetTributeCount(c)>=ct and mg:GetCount()>0
and (g:GetCount()==0 or Duel.SelectYesNo(tp,aux.Stringid(21377582,1))) then
local ect=ct
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then ect=ect-1 end
ect=math.min(mg:GetCount(),ect)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g3=mg:Select(tp,1,ect,nil)
g:Merge(g3)
ct=ct-g3:GetCount()
end
if ct>0 then
local g4=Duel.SelectTribute(tp,c,ct,ct)
g:Merge(g4)
end
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c21377582.valcheck(e,c)
local g=c:GetMaterial()
local typ=0
local tc=g:GetFirst()
while tc do
typ=bit.bor(typ,bit.band(tc:GetOriginalType(),0x7))
tc=g:GetNext()
end
e:SetLabel(typ)
if bit.band(typ,TYPE_MONSTER)~=0 then
c:RegisterFlagEffect(0,RESET_EVENT+0xfe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(21377582,3))
end
if bit.band(typ,TYPE_SPELL)~=0 then
c:RegisterFlagEffect(0,RESET_EVENT+0xfe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(21377582,4))
end
if bit.band(typ,TYPE_TRAP)~=0 then
c:RegisterFlagEffect(0,RESET_EVENT+0xfe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(21377582,5))
end
end
function c21377582.efilter(e,te)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE
and te:IsActiveType(e:GetLabelObject():GetLabel()) and te:GetOwner()~=e:GetOwner()
end
function c21377582.descon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE
end
function c21377582.costfilter(c)
return c:IsType(TYPE_CONTINUOUS) and c:IsAbleToRemoveAsCost()
end
function c21377582.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21377582.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c21377582.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c21377582.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c21377582.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 c22211622.initial_effect(c)
aux.EnablePendulumAttribute(c)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_PZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetTargetRange(1,0)
e1:SetCondition(c22211622.splimcon)
e1:SetTarget(c22211622.splimit)
c:RegisterEffect(e1)
--gain lp
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22211622,0))
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_PLAYER_TARGET)
e2:SetCondition(c22211622.rccon)
e2:SetTarget(c22211622.rctg)
e2:SetOperation(c22211622.rcop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(22211622,1))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetTarget(c22211622.sptg)
e3:SetOperation(c22211622.spop)
c:RegisterEffect(e3)
--pendulum
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(22211622,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(c22211622.pencon)
e4:SetTarget(c22211622.pentg)
e4:SetOperation(c22211622.penop)
c:RegisterEffect(e4)
end
function c22211622.splimcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)>0
end
function c22211622.splimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function c22211622.rccfilter(c)
return c:IsFaceup() and c:IsCode(13331639)
end
function c22211622.rccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c22211622.rccfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c22211622.rcfilter(c)
return c:IsFaceup() and c:GetAttack()>0
end
function c22211622.rctg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c22211622.rcfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c22211622.rcfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c22211622.rcfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetAttack())
end
function c22211622.rcop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Recover(p,tc:GetAttack(),REASON_EFFECT)
end
end
function c22211622.spfilter(c,e,tp)
return c:IsType(TYPE_XYZ+TYPE_PENDULUM) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c22211622.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(tp) and chkc:IsFaceup() and chkc~=c end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,c)
and Duel.IsExistingMatchingCard(c22211622.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,1,c)
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c22211622.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) then return end
local dg=Group.FromCards(c,tc)
if Duel.Destroy(dg,REASON_EFFECT)==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c22211622.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()==0 then return end
local sc=g:GetFirst()
if Duel.SpecialSummonStep(sc,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+0x1fe0000)
sc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
sc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetValue(0)
e3:SetReset(RESET_EVENT+0x1fe0000)
sc:RegisterEffect(e3,true)
local e4=e3:Clone()
e4:SetCode(EFFECT_SET_DEFENSE_FINAL)
sc:RegisterEffect(e4,true)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e5:SetValue(1)
sc:RegisterEffect(e5,true)
local e6=e5:Clone()
e6:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
sc:RegisterEffect(e6,true)
end
Duel.SpecialSummonComplete()
end
end
function c22211622.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function c22211622.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_SZONE,6) or Duel.CheckLocation(tp,LOCATION_SZONE,7) end
end
function c22211622.penop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_SZONE,6) and not Duel.CheckLocation(tp,LOCATION_SZONE,7) then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
--真竜戦士イグニスH
function c22499034.initial_effect(c)
--summon with 1 tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22499034,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c22499034.otcon)
e1:SetOperation(c22499034.otop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22499034,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c22499034.thcon)
e2:SetTarget(c22499034.thtg)
e2:SetOperation(c22499034.thop)
c:RegisterEffect(e2)
end
function c22499034.otfilter(c)
return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()
end
function c22499034.otcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
return c:GetLevel()>4 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c22499034.otfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c22499034.otop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=Duel.SelectMatchingCard(tp,c22499034.otfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end
function c22499034.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE and rp~=tp
end
function c22499034.thfilter(c,tp)
return c:IsSetCard(0xf9) and c:GetType()==0x20002
and (c:IsAbleToHand() or (c:GetActivateEffect():IsActivatable(tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0))
end
function c22499034.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c22499034.thfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c22499034.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(22499034,3))
local g=Duel.SelectMatchingCard(tp,c22499034.thfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
local tc=g:GetFirst()
if tc then
local b1=tc:IsAbleToHand()
local b2=tc:GetActivateEffect():IsActivatable(tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
if b1 and (not b2 or Duel.SelectYesNo(tp,aux.Stringid(22499034,2))) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
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,EVENT_CHAIN_SOLVED,te,0,tp,tp,Duel.GetCurrentChain())
end
end
end
--幽麗なる幻滝
function c23068051.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23068051,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c23068051.target)
e1:SetOperation(c23068051.activate)
c:RegisterEffect(e1)
--Activate2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(23068051,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCost(c23068051.cost)
e2:SetTarget(c23068051.target2)
e2:SetOperation(c23068051.activate2)
c:RegisterEffect(e2)
end
function c23068051.filter(c)
return c:IsRace(RACE_WYRM) and c:IsAbleToHand()
end
function c23068051.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c23068051.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c23068051.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c23068051.filter,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 c23068051.filter2(c)
return c:IsRace(RACE_WYRM) and c:IsAbleToGraveAsCost()
end
function c23068051.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c23068051.filter2,tp,LOCATION_MZONE+LOCATION_HAND,0,1,nil) end
local ft=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
local g=Duel.GetMatchingGroup(c23068051.filter2,tp,LOCATION_MZONE+LOCATION_HAND,0,nil)
local ct=math.min(ft-1,g:GetCount()+1)
local sg=g:Select(tp,1,ct,nil)
e:SetLabel(sg:GetCount()+1)
Duel.SendtoGrave(sg,REASON_COST)
end
function c23068051.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,e:GetLabel())
end
function c23068051.activate2(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 c2819435.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(c2819435.thcon)
e2:SetCost(c2819435.cost)
e2:SetTarget(c2819435.thtg)
e2:SetOperation(c2819435.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--token
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetRange(LOCATION_FZONE)
e4:SetOperation(aux.chainreg)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_CHAIN_SOLVED)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetRange(LOCATION_FZONE)
e5:SetCondition(c2819435.spcon)
e5:SetCost(c2819435.cost)
e5:SetTarget(c2819435.sptg)
e5:SetOperation(c2819435.spop)
c:RegisterEffect(e5)
--
Duel.AddCustomActivityCounter(2819435,ACTIVITY_SUMMON,c2819435.counterfilter)
Duel.AddCustomActivityCounter(2819435,ACTIVITY_SPSUMMON,c2819435.counterfilter)
end
function c2819435.counterfilter(c)
return not c:IsType(TYPE_EFFECT)
end
function c2819435.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(2819435,tp,ACTIVITY_SUMMON)==0
and Duel.GetCustomActivityCount(2819435,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c2819435.splimit)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e2,tp)
end
function c2819435.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsType(TYPE_EFFECT)
end
function c2819435.thcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return eg:GetCount()==1 and tc:GetSummonPlayer()==tp and tc:IsFaceup() and tc:IsType(TYPE_NORMAL)
end
function c2819435.thfilter(c)
return c:IsSetCard(0xfa) and c:IsAbleToHand()
end
function c2819435.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c2819435.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c2819435.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 c2819435.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_MZONE,0,1,nil,TYPE_TOKEN) and e:GetHandler():GetFlagEffect(1)>0
end
function c2819435.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,2819436,0xfa,0x4011,2000,2000,6,RACE_WYRM,ATTRIBUTE_WATER)
and not e:GetHandler():IsStatus(STATUS_CHAINING) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c2819435.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,2819436,0xfa,0x4011,2000,2000,6,RACE_WYRM,ATTRIBUTE_WATER) then return end
local token=Duel.CreateToken(tp,2819436)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
--智天の神星龍
function c29432356.initial_effect(c)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c)
--change scale
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29432356,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,29432356)
e1:SetTarget(c29432356.sctg)
e1:SetOperation(c29432356.scop)
c:RegisterEffect(e1)
--spsummon condition
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_EXTRA)
e3:SetCondition(c29432356.hspcon)
e3:SetOperation(c29432356.hspop)
c:RegisterEffect(e3)
--pendulum
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetOperation(c29432356.penop)
c:RegisterEffect(e4)
--special summon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(29432356,3))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCost(c29432356.spcost)
e5:SetTarget(c29432356.sptg)
e5:SetOperation(c29432356.spop)
c:RegisterEffect(e5)
end
function c29432356.scfilter(c,pc)
return c:IsType(TYPE_PENDULUM) and c:IsSetCard(0xc4) and not c:IsForbidden()
and ((pc:GetSequence()==6 and c:GetLeftScale()~=pc:GetLeftScale())
or (pc:GetSequence()==7 and c:GetRightScale()~=pc:GetRightScale()))
end
function c29432356.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29432356.scfilter,tp,LOCATION_DECK,0,1,nil,e:GetHandler()) end
end
function c29432356.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(29432356,1))
local g=Duel.SelectMatchingCard(tp,c29432356.scfilter,tp,LOCATION_DECK,0,1,1,nil,c)
local tc=g:GetFirst()
if tc and Duel.SendtoExtraP(tc,tp,REASON_EFFECT)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LSCALE)
e1:SetValue(tc:GetLeftScale())
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_RSCALE)
e2:SetValue(tc:GetRightScale())
c:RegisterEffect(e2)
end
end
function c29432356.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local rg=Duel.GetReleaseGroup(tp)
return (g:GetCount()>0 or rg:GetCount()>0) and g:FilterCount(Card.IsReleasable,nil)==g:GetCount()
and g:FilterCount(Card.IsSetCard,nil,0xc4)>=3
end
function c29432356.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetReleaseGroup(tp)
Duel.Release(g,REASON_COST)
end
function c29432356.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetOperation(c29432356.checkop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
c29432356.checkop(e,tp)
local olpz=Duel.GetFieldCard(1-tp,LOCATION_SZONE,6)
local orpz=Duel.GetFieldCard(1-tp,LOCATION_SZONE,7)
if olpz~=nil and orpz~=nil and olpz:GetFlagEffectLabel(31531170)==orpz:GetFieldID()
and orpz:GetFlagEffectLabel(31531170)==olpz:GetFieldID() then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(29432356,2))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC_G)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_BOTH_SIDE)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,29432356)
e2:SetCondition(c29432356.pencon2)
e2:SetOperation(c29432356.penop2)
e2:SetValue(SUMMON_TYPE_PENDULUM)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
olpz:RegisterEffect(e2)
olpz:RegisterFlagEffect(29432356,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
function c29432356.checkop(e,tp)
local lpz=Duel.GetFieldCard(tp,LOCATION_SZONE,6)
if lpz==nil or lpz:GetFlagEffect(29432356)>0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(29432356,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC_G)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,29432356)
e1:SetCondition(c29432356.pencon1)
e1:SetOperation(c29432356.penop1)
e1:SetValue(SUMMON_TYPE_PENDULUM)
e1:SetReset(RESET_PHASE+PHASE_END)
lpz:RegisterEffect(e1)
lpz:RegisterFlagEffect(29432356,RESET_PHASE+PHASE_END,0,1)
end
function c29432356.penfilter(c,e,tp,lscale,rscale)
local lv=0
if c.pendulum_level then
lv=c.pendulum_level
else
lv=c:GetLevel()
end
return (c:IsLocation(LOCATION_HAND) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM)))
and lv>lscale and lv<rscale and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_PENDULUM,tp,false,false)
and not c:IsForbidden() and c:IsSetCard(0xc4)
end
function c29432356.pencon1(e,c,og)
if c==nil then return true end
local tp=c:GetControler()
if c:GetSequence()~=6 then return false end
local rpz=Duel.GetFieldCard(tp,LOCATION_SZONE,7)
if rpz==nil then return false end
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return false end
if og then
return og:IsExists(c29432356.penfilter,1,nil,e,tp,lscale,rscale)
else
return Duel.IsExistingMatchingCard(c29432356.penfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,nil,e,tp,lscale,rscale)
end
end
function c29432356.penop1(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
Duel.Hint(HINT_CARD,0,29432356)
local rpz=Duel.GetFieldCard(tp,LOCATION_SZONE,7)
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local tg=nil
if og then
tg=og:Filter(tp,c29432356.penfilter,nil,e,tp,lscale,rscale)
else
tg=Duel.GetMatchingGroup(c29432356.penfilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,e,tp,lscale,rscale)
end
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
if ect and (ect<=0 or ect>ft) then ect=nil end
if ect==nil or tg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)<=ect then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:Select(tp,1,ft,nil)
sg:Merge(g)
else
repeat
local ct=math.min(ft,ect)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:Select(tp,1,ct,nil)
tg:Sub(g)
sg:Merge(g)
ft=ft-g:GetCount()
ect=ect-g:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)
until ft==0 or ect==0 or not Duel.SelectYesNo(tp,210)
local hg=tg:Filter(Card.IsLocation,nil,LOCATION_HAND)
if ft>0 and ect==0 and hg:GetCount()>0 and Duel.SelectYesNo(tp,210) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=hg:Select(tp,1,ft,nil)
sg:Merge(g)
end
end
Duel.HintSelection(Group.FromCards(c))
Duel.HintSelection(Group.FromCards(rpz))
end
function c29432356.pencon2(e,c,og)
if c==nil then return true end
local tp=e:GetOwnerPlayer()
local rpz=Duel.GetFieldCard(1-tp,LOCATION_SZONE,7)
if rpz==nil or rpz:GetFieldID()~=c:GetFlagEffectLabel(31531170) then return false end
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return false end
if og then
return og:IsExists(c29432356.penfilter,1,nil,e,tp,lscale,rscale)
else
return Duel.IsExistingMatchingCard(c29432356.penfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,lscale,rscale)
end
end
function c29432356.penop2(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
Duel.Hint(HINT_CARD,0,31531170)
Duel.Hint(HINT_CARD,0,29432356)
local tp=e:GetOwnerPlayer()
local rpz=Duel.GetFieldCard(1-tp,LOCATION_SZONE,7)
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local tg=nil
if og then
tg=og:Filter(tp,c29432356.penfilter,nil,e,tp,lscale,rscale)
else
tg=Duel.GetMatchingGroup(c29432356.penfilter,tp,LOCATION_EXTRA,0,nil,e,tp,lscale,rscale)
end
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
if ect and (ect<=0 or ect>ft) then ect=nil end
if ect==nil or tg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)<=ect then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:Select(tp,1,ft,nil)
sg:Merge(g)
else
repeat
local ct=math.min(ft,ect)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:Select(tp,1,ct,nil)
tg:Sub(g)
sg:Merge(g)
ft=ft-g:GetCount()
ect=ect-g:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)
until ft==0 or ect==0 or not Duel.SelectYesNo(tp,210)
local hg=tg:Filter(Card.IsLocation,nil,LOCATION_HAND)
if ft>0 and ect==0 and hg:GetCount()>0 and Duel.SelectYesNo(tp,210) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=hg:Select(tp,1,ft,nil)
sg:Merge(g)
end
end
Duel.HintSelection(Group.FromCards(c))
Duel.HintSelection(Group.FromCards(rpz))
end
function c29432356.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) end
local sg=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
Duel.Release(sg,REASON_COST)
end
function c29432356.spfilter(c,e,tp)
return c:IsSetCard(0xc4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c29432356.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c29432356.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c29432356.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,c29432356.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--破壊剣士の揺籃
function c33280639.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,33280639+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCost(c33280639.cost)
e1:SetTarget(c33280639.target)
e1:SetOperation(c33280639.activate)
c:RegisterEffect(e1)
--Protect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(c33280639.immcost)
e2:SetOperation(c33280639.immop)
c:RegisterEffect(e2)
end
function c33280639.cfilter1(c,tp)
return c:IsSetCard(0xd6) and not c:IsCode(33280639) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c33280639.cfilter2,tp,LOCATION_DECK,0,1,c)
end
function c33280639.cfilter2(c)
return c:IsSetCard(0xd7) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c33280639.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33280639.cfilter1,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,c33280639.cfilter1,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(tp,c33280639.cfilter2,tp,LOCATION_DECK,0,1,1,g1:GetFirst())
g1:Merge(g2)
Duel.SendtoGrave(g1,REASON_COST)
end
function c33280639.filter(c,e,tp)
return c:IsCode(11790356) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c33280639.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c33280639.filter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c33280639.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c33280639.filter),tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
tc:RegisterFlagEffect(33280639,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,2)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCondition(c33280639.descon)
e1:SetOperation(c33280639.desop)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetLabelObject(tc)
Duel.RegisterEffect(e1,tp)
Duel.SpecialSummonComplete()
end
end
function c33280639.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return Duel.GetTurnCount()~=e:GetLabel() and tc:GetFlagEffect(33280639)~=0
end
function c33280639.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT)
end
function c33280639.immcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c33280639.immop(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_INDESTRUCTABLE_EFFECT)
e1:SetValue(1)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xd6))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
Duel.RegisterEffect(e2,tp)
end
--DDゴースト
function c33334269.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33334269,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c33334269.tgtg)
e1:SetOperation(c33334269.tgop)
c:RegisterEffect(e1)
--return
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33334269,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c33334269.rtgtg)
e2:SetOperation(c33334269.rtgop)
c:RegisterEffect(e2)
end
function c33334269.tgfilter1(c,tp)
return ((c:IsSetCard(0xaf) and c:IsType(TYPE_MONSTER) and not c:IsCode(33334269)) or c:IsSetCard(0xae))
and Duel.IsExistingMatchingCard(c33334269.tgfilter2,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function c33334269.tgfilter2(c,cd)
return c:IsCode(cd) and c:IsAbleToGrave()
end
function c33334269.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc:IsCode(e:GetLabel()) end
if chk==0 then return Duel.IsExistingTarget(c33334269.tgfilter1,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c33334269.tgfilter1,tp,LOCATION_GRAVE,0,1,1,nil,tp)
e:SetLabel(g:GetFirst():GetCode())
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c33334269.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c33334269.tgfilter2,tp,LOCATION_DECK,0,1,1,nil,tc:GetCode())
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
function c33334269.rtgfilter(c)
return c:IsFaceup() and ((c:IsSetCard(0xaf) and c:IsType(TYPE_MONSTER) and not c:IsCode(33334269)) or c:IsSetCard(0xae))
end
function c33334269.rtgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c33334269.rtgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c33334269.rtgfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c33334269.rtgfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c33334269.rtgop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_RETURN)
end
end
--幻煌龍の戦禍
function c34302287.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,0x1e0)
e1:SetCondition(c34302287.condition)
e1:SetTarget(c34302287.target)
e1:SetOperation(c34302287.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c34302287.handcon)
c:RegisterEffect(e2)
--equip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(34302287,0))
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(c34302287.eqcost)
e3:SetTarget(c34302287.eqtg)
e3:SetOperation(c34302287.eqop)
c:RegisterEffect(e3)
end
function c34302287.cfilter(c)
return c:IsFacedown() or not c:IsType(TYPE_NORMAL)
end
function c34302287.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0
and not Duel.IsExistingMatchingCard(c34302287.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c34302287.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end
if chk==0 then return 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,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c34302287.activate(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 c34302287.filter(c)
return c:IsFaceup() and c:IsCode(22702055)
end
function c34302287.handcon(e)
return Duel.IsExistingMatchingCard(c34302287.filter,e:GetHandlerPlayer(),LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
or Duel.IsEnvironment(22702055)
end
function c34302287.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c34302287.efilter(c,e)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsCanBeEffectTarget(e)
end
function c34302287.eqfilter(c,g)
return c:IsFaceup() and c:IsType(TYPE_EQUIP) and c:IsSetCard(0xfa) and g:IsExists(c34302287.eqcheck,1,nil,c)
end
function c34302287.eqcheck(c,ec)
return ec:CheckEquipTarget(c)
end
function c34302287.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c34302287.efilter,tp,LOCATION_MZONE,0,nil,e)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c34302287.efilter(chkc,e) end
if chk==0 then return g:GetCount()>0 and Duel.IsExistingMatchingCard(c34302287.eqfilter,tp,LOCATION_SZONE,0,1,nil,g) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c34302287.efilter,tp,LOCATION_MZONE,0,1,1,nil,e)
end
function c34302287.eqop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=tg:GetFirst()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c34302287.eqfilter,tp,LOCATION_SZONE,0,nil,tg)
local eq=g:GetFirst()
while eq do
Duel.Equip(tp,eq,tc,true,true)
eq=g:GetNext()
end
Duel.EquipComplete()
end
--LL-コバルト・スパロー
function c34550857.initial_effect(c)
--Search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(34550857,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,34550857)
e1:SetTarget(c34550857.thtg)
e1:SetOperation(c34550857.thop)
c:RegisterEffect(e1)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c34550857.efcon)
e2:SetOperation(c34550857.efop)
c:RegisterEffect(e2)
end
function c34550857.thfilter(c)
return c:IsRace(RACE_WINDBEAST) and c:GetLevel()==1 and c:IsAbleToHand()
end
function c34550857.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c34550857.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c34550857.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c34550857.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 c34550857.efcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return r==REASON_XYZ and c:GetReasonCard():IsAttribute(ATTRIBUTE_WIND)
end
function c34550857.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local p=rc:GetControler()
local e1=Effect.CreateEffect(rc)
e1:SetDescription(aux.Stringid(34550857,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(aux.tgoval)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e2,true)
end
end
--真竜皇の復活
function c35125879.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c35125879.target)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(35125879,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,35125879)
e2:SetCost(c35125879.cost)
e2:SetTarget(c35125879.sptg)
e2:SetOperation(c35125879.spop)
c:RegisterEffect(e2)
--tribute summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(35125879,1))
e3:SetCategory(CATEGORY_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_MAIN_END)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,35125880)
e3:SetCondition(c35125879.sumcon)
e3:SetCost(c35125879.cost)
e3:SetTarget(c35125879.sumtg)
e3:SetOperation(c35125879.sumop)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(35125879,2))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,35125881)
e4:SetCondition(c35125879.descon)
e4:SetTarget(c35125879.destg)
e4:SetOperation(c35125879.desop)
c:RegisterEffect(e4)
end
function c35125879.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c35125879.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then return true end
local b1=c35125879.sptg(e,tp,eg,ep,ev,re,r,rp,0)
local b2=c35125879.sumcon(e,tp,eg,ep,ev,re,r,rp) and c35125879.sumtg(e,tp,eg,ep,ev,re,r,rp,0)
if (b1 or b2) and Duel.SelectYesNo(tp,94) then
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(35125879,0),aux.Stringid(35125879,1))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(35125879,0))
else op=Duel.SelectOption(tp,aux.Stringid(35125879,1))+1 end
if op==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c35125879.spop)
c35125879.sptg(e,tp,eg,ep,ev,re,r,rp,1)
else
e:SetCategory(CATEGORY_SUMMON)
e:SetProperty(0)
e:SetOperation(c35125879.sumop)
c35125879.sumtg(e,tp,eg,ep,ev,re,r,rp,1)
end
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c35125879.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) end
end
function c35125879.spfilter(c,e,tp)
return c:IsSetCard(0xf9) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c35125879.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c35125879.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c35125879.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetFlagEffect(tp,35125879)==0 end
Duel.RegisterFlagEffect(tp,35125879,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c35125879.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c35125879.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
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:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
end
function c35125879.sumcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function c35125879.sumfilter(c)
return c:IsSetCard(0xf9) and c:IsSummonable(true,nil,1)
end
function c35125879.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c35125879.sumfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.GetFlagEffect(tp,35125880)==0 end
Duel.RegisterFlagEffect(tp,35125880,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c35125879.sumop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c35125879.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil,1)
end
end
function c35125879.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_SZONE)
end
function c35125879.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c35125879.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 c35272499.initial_effect(c)
--summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(35272499,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,35272499)
e1:SetCost(c35272499.spcost)
e1:SetTarget(c35272499.sptg)
e1:SetOperation(c35272499.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function c35272499.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c35272499.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c35272499.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c35272499.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c35272499.spfilter(c,e,tp)
return c:IsSetCard(0x10f3) and not c:IsCode(35272499) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c35272499.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c35272499.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c35272499.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c35272499.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--SRビードロ・ドクロ
function c35494087.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(35494087,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1)
e1:SetCondition(c35494087.spcon)
e1:SetTarget(c35494087.sptg)
e1:SetOperation(c35494087.spop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(c35494087.indval)
c:RegisterEffect(e2)
--battle damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
e3:SetValue(1)
c:RegisterEffect(e3)
--self destroy
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_SELF_DESTROY)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c35494087.sdcon)
c:RegisterEffect(e4)
end
function c35494087.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.FilterEqualFunction(Card.GetSummonLocation,LOCATION_EXTRA),tp,0,LOCATION_MZONE,1,nil)
end
function c35494087.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 c35494087.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.GetLocationCount(tp,LOCATION_MZONE)<=0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SendtoGrave(c,REASON_RULE)
end
end
function c35494087.indval(e,c)
return bit.band(c:GetSummonType(),SUMMON_TYPE_NORMAL)~=0
end
function c35494087.sdfilter(c)
return c:IsFaceup() and not c:IsSetCard(0x2016)
end
function c35494087.sdcon(e)
return Duel.IsExistingMatchingCard(c35494087.sdfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
--幻影騎士団ロスト・ヴァンブレイズ
function c36247316.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(c36247316.condition)
e1:SetCost(c36247316.cost)
e1:SetTarget(c36247316.target)
e1:SetOperation(c36247316.activate)
c:RegisterEffect(e1)
end
function c36247316.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c36247316.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c36247316.filter(c)
return c:GetLevel()>0 and c:IsFaceup()
end
function c36247316.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c36247316.filter(chkc) end
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,36247316,0x10db,0x11,600,0,2,RACE_WARRIOR,ATTRIBUTE_DARK)
and Duel.IsExistingTarget(c36247316.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c36247316.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c36247316.activate(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_UPDATE_ATTACK)
e1:SetValue(-600)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetValue(2)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c36247316.indtarget)
e3:SetValue(1)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,36247316,0x10db,0x11,600,0,2,RACE_WARRIOR,ATTRIBUTE_DARK) then
Duel.BreakEffect()
c:AddMonsterAttribute(TYPE_NORMAL)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP_DEFENSE)
c:AddMonsterAttributeComplete()
Duel.SpecialSummonComplete()
end
end
end
function c36247316.indtarget(e,c)
return c:IsFaceup() and c:IsSetCard(0x10db)
end
--EMレビュー・ダンサー
function c36527535.initial_effect(c)
--special summon rule
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:SetCondition(c36527535.sprcon)
c:RegisterEffect(e1)
--double tribute
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DOUBLE_TRIBUTE)
e2:SetValue(c36527535.dtcon)
c:RegisterEffect(e2)
end
function c36527535.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function c36527535.dtcon(e,c)
return c:IsSetCard(0x9f)
end
--デュエリスト・アドベント
function c37469904.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,37469904+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c37469904.condition)
e1:SetTarget(c37469904.target)
e1:SetOperation(c37469904.activate)
c:RegisterEffect(e1)
end
function c37469904.cfilter(c)
return c:GetSequence()==6 or c:GetSequence()==7
end
function c37469904.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c37469904.cfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil)
end
function c37469904.filter(c)
return c:IsSetCard(0xf2) and c:IsType(TYPE_PENDULUM+TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c37469904.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c37469904.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c37469904.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c37469904.filter,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 c40252269.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(40252269,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_NO_TURN_RESET)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetTarget(c40252269.sptg)
e2:SetOperation(c40252269.spop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(40252269,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:SetTarget(c40252269.thtg)
e3:SetOperation(c40252269.thop)
c:RegisterEffect(e3)
end
function c40252269.spfilter(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsLevelBelow(3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c40252269.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c40252269.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c40252269.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c40252269.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c40252269.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c40252269.thfilter(c)
return c:IsSetCard(0x98) and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and not c:IsCode(40252269) and c:IsAbleToHand()
end
function c40252269.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c40252269.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c40252269.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c40252269.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 c40542825.initial_effect(c)
--special summon proc
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND+LOCATION_DECK)
e1:SetCondition(c40542825.spcon)
e1:SetOperation(c40542825.spop)
e1:SetValue(1)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(40542825,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c40542825.condition)
e2:SetTarget(c40542825.thtg)
e2:SetOperation(c40542825.thop)
c:RegisterEffect(e2)
--pierce
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_PIERCE)
e3:SetCondition(c40542825.condition)
c:RegisterEffect(e3)
end
function c40542825.spfilter1(c,tp)
return c:IsFaceup() and c:IsCode(73318863) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c40542825.spfilter2,tp,LOCATION_MZONE,0,1,c)
end
function c40542825.spfilter2(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToGraveAsCost()
end
function c40542825.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c40542825.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp)
end
function c40542825.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,c40542825.spfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(tp,c40542825.spfilter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst())
g1:Merge(g2)
Duel.SendtoGrave(g1,REASON_COST)
end
function c40542825.thfilter(c)
return c:GetDefense()==1500 and c:IsRace(RACE_SPELLCASTER) and not c:IsCode(40542825) and c:IsAbleToHand()
end
function c40542825.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
end
function c40542825.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c40542825.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c40542825.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c40542825.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 c41375811.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2,c41375811.ovfilter,aux.Stringid(41375811,0),5,c41375811.xyzop)
c:EnableReviveLimit()
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c41375811.atkval)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(c41375811.defval)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(41375811,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetCost(c41375811.spcost)
e3:SetTarget(c41375811.sptg)
e3:SetOperation(c41375811.spop)
c:RegisterEffect(e3)
end
function c41375811.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0xf1) and not c:IsCode(41375811)
end
function c41375811.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,41375811)==0 end
Duel.RegisterFlagEffect(tp,41375811,RESET_PHASE+PHASE_END,0,1)
end
function c41375811.atkfilter(c)
return c:IsSetCard(0xf1) and c:GetAttack()>=0
end
function c41375811.atkval(e,c)
local g=e:GetHandler():GetOverlayGroup():Filter(c41375811.atkfilter,nil)
return g:GetSum(Card.GetAttack)
end
function c41375811.deffilter(c)
return c:IsSetCard(0xf1) and c:GetDefense()>=0
end
function c41375811.defval(e,c)
local g=e:GetHandler():GetOverlayGroup():Filter(c41375811.deffilter,nil)
return g:GetSum(Card.GetDefense)
end
function c41375811.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 c41375811.spfilter(c,e,tp)
return c:IsSetCard(0xf1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c41375811.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c41375811.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c41375811.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c41375811.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c41375811.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
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+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e3:SetValue(1)
tc:RegisterEffect(e3)
Duel.SpecialSummonComplete()
end
end
--光虫信号
function c47185546.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:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c47185546.target)
e1:SetOperation(c47185546.activate)
c:RegisterEffect(e1)
end
function c47185546.filter1(c,e,tp)
local rk=c:GetRank()
return c:IsFaceup() and c:IsRace(RACE_INSECT) and c:IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c47185546.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk)
end
function c47185546.filter2(c,e,tp,mc,rk)
return (c:GetRank()==rk+2 or c:GetRank()==rk-2) and c:IsRace(RACE_INSECT) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c47185546.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c47185546.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c47185546.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c47185546.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c47185546.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c47185546.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank())
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
--幻煌龍の螺旋突
function c48308134.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(c48308134.target)
e1:SetOperation(c48308134.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(c48308134.eqlimit)
c:RegisterEffect(e2)
--pierce
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(48308134,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLE_DAMAGE)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,48308134)
e4:SetCondition(c48308134.spcon)
e4:SetTarget(c48308134.sptg)
e4:SetOperation(c48308134.spop)
c:RegisterEffect(e4)
end
function c48308134.eqlimit(e,c)
return c:IsType(TYPE_NORMAL)
end
function c48308134.filter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL)
end
function c48308134.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and c48308134.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c48308134.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c48308134.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c48308134.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
end
end
function c48308134.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and eg:GetFirst()==e:GetHandler():GetEquipTarget()
end
function c48308134.spfilter(c,e,tp)
return c:IsCode(56649609) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c48308134.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c48308134.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function c48308134.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c48308134.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Equip(tp,c,tc)
Duel.SpecialSummonComplete()
local g=Duel.GetMatchingGroup(Card.IsPosition,tp,0,LOCATION_MZONE,nil,POS_ATTACK)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(48308134,1)) then
Duel.BreakEffect()
local sg=g:Select(tp,1,1,nil)
Duel.ChangePosition(sg,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,0,0)
end
end
end
end
--LL-アセンブリー・ナイチンゲール
function c48608796.initial_effect(c)
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,1,2,nil,nil,5)
--ATK Up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c48608796.atkval)
c:RegisterEffect(e1)
--Direct Attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
c:RegisterEffect(e2)
--multi attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EXTRA_ATTACK)
e3:SetValue(c48608796.raval)
c:RegisterEffect(e3)
--Protection
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(48608796,0))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCost(c48608796.indcost)
e4:SetOperation(c48608796.indop)
c:RegisterEffect(e4)
end
function c48608796.atkval(e,c)
return c:GetOverlayCount()*200
end
function c48608796.raval(e,c)
local oc=e:GetHandler():GetOverlayCount()
return math.max(0,oc-1)
end
function c48608796.indcost(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 c48608796.indop(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_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xf7))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetValue(1)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
--真竜の継承
function c49430782.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(49430782,0))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,49430782)
e2:SetCondition(c49430782.drcon)
e2:SetTarget(c49430782.drtg)
e2:SetOperation(c49430782.drop)
c:RegisterEffect(e2)
--tribute summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(49430782,1))
e3:SetCategory(CATEGORY_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,49430783)
e3:SetTarget(c49430782.sumtg)
e3:SetOperation(c49430782.sumop)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(49430782,2))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,49430784)
e4:SetCondition(c49430782.descon)
e4:SetTarget(c49430782.destg)
e4:SetOperation(c49430782.desop)
c:RegisterEffect(e4)
if c49430782.counter==nil then
c49430782.counter=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge1:SetCode(EVENT_TO_GRAVE)
ge1:SetOperation(c49430782.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c49430782.clearop)
Duel.RegisterEffect(ge2,0)
end
end
function c49430782.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsPreviousLocation(LOCATION_ONFIELD) and tc:IsSetCard(0xf9) then
local typ=bit.band(tc:GetOriginalType(),0x7)
if (typ==TYPE_MONSTER and Duel.GetFlagEffect(0,49430782)==0)
or (typ==TYPE_SPELL and Duel.GetFlagEffect(0,49430783)==0)
or (typ==TYPE_TRAP and Duel.GetFlagEffect(0,49430784)==0) then
c49430782.counter=c49430782.counter+1
if typ==TYPE_MONSTER then
Duel.RegisterFlagEffect(0,49430782,RESET_PHASE+PHASE_END,0,1)
elseif typ==TYPE_SPELL then
Duel.RegisterFlagEffect(0,49430783,RESET_PHASE+PHASE_END,0,1)
else
Duel.RegisterFlagEffect(0,49430784,RESET_PHASE+PHASE_END,0,1)
end
end
end
tc=eg:GetNext()
end
end
function c49430782.clearop(e,tp,eg,ep,ev,re,r,rp)
c49430782.counter=0
end
function c49430782.drcon(e,tp,eg,ep,ev,re,r,rp)
return c49430782.counter>0
end
function c49430782.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,c49430782.counter) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,c49430782.counter)
end
function c49430782.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Draw(tp,c49430782.counter,REASON_EFFECT)
end
function c49430782.sumfilter(c)
return c:IsSetCard(0xf9) and c:IsSummonable(true,nil,1)
end
function c49430782.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c49430782.sumfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c49430782.sumop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c49430782.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil,1)
end
end
function c49430782.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_SZONE)
end
function c49430782.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsType(TYPE_SPELL+TYPE_TRAP) end
if chk==0 then return Duel.IsExistingTarget(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,TYPE_SPELL+TYPE_TRAP)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c49430782.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
--EMガトリングール
function c49820233.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x9f),aux.FilterBoolFunction(c49820233.ffilter),true)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(49820233,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,49820233)
e1:SetCondition(c49820233.damcon)
e1:SetTarget(c49820233.damtg)
e1:SetOperation(c49820233.damop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(c49820233.valcheck)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end
function c49820233.ffilter(c)
return c:IsFusionAttribute(ATTRIBUTE_DARK) and c:IsLevelAbove(5)
end
function c49820233.damcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
function c49820233.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)>0 end
local ct=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
Duel.SetTargetPlayer(1-tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*200)
if e:GetLabel()==1 then
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
end
function c49820233.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
if ct>0 and Duel.Damage(p,ct*200,REASON_EFFECT)~=0 and e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.HintSelection(g)
if Duel.Destroy(g,REASON_EFFECT)~=0 then
local dam=g:GetFirst():GetBaseAttack()
Duel.Damage(p,dam,REASON_EFFECT)
end
end
end
end
function c49820233.valcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(Card.IsType,1,nil,TYPE_PENDULUM) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
--DDD磐石王ダリウス
function c51497409.initial_effect(c)
c:EnableReviveLimit()
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),3,2)
--Destroy and Draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(51497409,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c51497409.cost)
e1:SetTarget(c51497409.ddtg)
e1:SetOperation(c51497409.ddop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(51497409,1))
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2:SetCondition(c51497409.incon)
e2:SetCost(c51497409.cost)
e2:SetOperation(c51497409.inop)
c:RegisterEffect(e2)
end
function c51497409.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 c51497409.ddfilter(c)
return c:IsFaceup() and c:IsSetCard(0xae)
end
function c51497409.ddtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c51497409.ddfilter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c51497409.ddfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c51497409.ddfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c51497409.ddop(e,tp,eg,ep,ev,re,r,rp)
local g,p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
g=g:Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)>0 then
Duel.Draw(p,d,REASON_EFFECT)
end
end
function c51497409.incon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsControler(1-tp)
end
function c51497409.inop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLED)
e2:SetOperation(c51497409.desop)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE)
c:RegisterEffect(e2)
end
end
function c51497409.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dc=c:GetBattleTarget()
if dc and Duel.Destroy(dc,REASON_EFFECT)>0 then
Duel.Damage(1-tp,500,REASON_EFFECT)
end
end
--バオバブーン
function c55705473.initial_effect(c)
--draw and replace
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(55705473,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(c55705473.drtg)
e1:SetOperation(c55705473.drop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(55705473,3))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCondition(c55705473.spcon)
e3:SetTarget(c55705473.sptg)
e3:SetOperation(c55705473.spop)
c:RegisterEffect(e3)
end
function c55705473.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 c55705473.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)<1 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()
if Duel.SelectOption(tp,aux.Stringid(55705473,1),aux.Stringid(55705473,2))==0 then
Duel.SendtoDeck(g,nil,0,REASON_EFFECT)
else
Duel.SendtoDeck(g,nil,1,REASON_EFFECT)
end
end
end
function c55705473.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c55705473.spfilter(c,e,tp)
return c:IsCode(55705473) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c55705473.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c55705473.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c55705473.spop(e,tp,eg,ep,ev,re,r,rp)
local ct=2
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
ct=math.min(ct,Duel.GetLocationCount(tp,LOCATION_MZONE))
if ct<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c55705473.spfilter,tp,LOCATION_DECK,0,1,ct,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--影霊衣の巫女 エリアル
function c56827051.initial_effect(c)
--level change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(56827051,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c56827051.lvcost)
e1:SetOperation(c56827051.lvop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(56827051,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_RELEASE)
e2:SetCountLimit(1,56827051)
e2:SetCondition(c56827051.thcon)
e2:SetTarget(c56827051.thtg)
e2:SetOperation(c56827051.thop)
c:RegisterEffect(e2)
end
function c56827051.cfilter(c)
return c:IsSetCard(0xb4) and not c:IsPublic()
end
function c56827051.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c56827051.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c56827051.cfilter,tp,LOCATION_HAND,0,1,63,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
e:SetLabel(g:GetCount())
end
function c56827051.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
local ct=e:GetLabel()
local sel=nil
if c:GetLevel()==1 then
sel=Duel.SelectOption(tp,aux.Stringid(56827051,2))
else
sel=Duel.SelectOption(tp,aux.Stringid(56827051,2),aux.Stringid(56827051,3))
end
if sel==1 then
ct=ct*-1
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(ct)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
function c56827051.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0
end
function c56827051.filter(c)
return c:IsSetCard(0xb4) and c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_RITUAL) and c:IsAbleToHand()
end
function c56827051.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c56827051.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c56827051.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c56827051.filter,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 c57761191.initial_effect(c)
--summon with 3 tribute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_LIMIT_SUMMON_PROC)
e1:SetCondition(c57761191.ttcon)
e1:SetOperation(c57761191.ttop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LIMIT_SET_PROC)
e2:SetCondition(c57761191.setcon)
c:RegisterEffect(e2)
--tribute check
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_MATERIAL_CHECK)
e3:SetValue(c57761191.valcheck)
c:RegisterEffect(e3)
--immune
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(c57761191.efilter)
e4:SetLabelObject(e3)
c:RegisterEffect(e4)
--special summon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(57761191,1))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_DESTROYED)
e5:SetCondition(c57761191.spcon)
e5:SetTarget(c57761191.sptg)
e5:SetOperation(c57761191.spop)
c:RegisterEffect(e5)
end
function c57761191.otfilter(c)
return c:IsType(TYPE_CONTINUOUS) and not c:IsType(TYPE_MONSTER) and c:IsReleasable()
end
function c57761191.ttcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c57761191.otfilter,tp,LOCATION_ONFIELD,0,nil)
return (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and mg:GetCount()>=3)
or (Duel.CheckTribute(c,1) and mg:GetCount()>=2)
or (Duel.CheckTribute(c,2) and mg:GetCount()>=1)
or (Duel.CheckTribute(c,3))
end
function c57761191.ttop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c57761191.otfilter,tp,LOCATION_ONFIELD,0,nil)
local ct=3
local g=Group.CreateGroup()
if Duel.GetTributeCount(c)<ct then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g2=mg:Select(tp,ct-Duel.GetTributeCount(c),ct-Duel.GetTributeCount(c),nil)
g:Merge(g2)
mg:Sub(g2)
ct=ct-g2:GetCount()
end
if ct>0 and Duel.GetTributeCount(c)>=ct and mg:GetCount()>0
and Duel.SelectYesNo(tp,aux.Stringid(57761191,0)) then
local ect=ct
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then ect=ect-1 end
ect=math.min(mg:GetCount(),ect)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g3=mg:Select(tp,1,ect,nil)
g:Merge(g3)
ct=ct-g3:GetCount()
end
if ct>0 then
local g4=Duel.SelectTribute(tp,c,ct,ct)
g:Merge(g4)
end
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c57761191.setcon(e,c,minc)
if not c then return true end
return false
end
function c57761191.valcheck(e,c)
local g=c:GetMaterial()
local typ=0
local tc=g:GetFirst()
while tc do
typ=bit.bor(typ,bit.band(tc:GetOriginalType(),0x7))
tc=g:GetNext()
end
e:SetLabel(typ)
if bit.band(typ,TYPE_MONSTER)~=0 then
c:RegisterFlagEffect(0,RESET_EVENT+0xfe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(57761191,2))
end
if bit.band(typ,TYPE_SPELL)~=0 then
c:RegisterFlagEffect(0,RESET_EVENT+0xfe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(57761191,3))
end
if bit.band(typ,TYPE_TRAP)~=0 then
c:RegisterFlagEffect(0,RESET_EVENT+0xfe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(57761191,4))
end
end
function c57761191.efilter(e,te)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE
and te:IsActiveType(e:GetLabelObject():GetLabel()) and te:GetOwner()~=e:GetOwner()
end
function c57761191.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and bit.band(c:GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE
end
function c57761191.spfilter(c,e,tp)
return c:IsAttribute(0xf) and c:IsType(0x802040) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c57761191.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c57761191.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c57761191.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,c57761191.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--真竜機士ダイナマイトK
function c58984738.initial_effect(c)
--summon with 1 tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(58984738,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c58984738.otcon)
e1:SetOperation(c58984738.otop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(58984738,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c58984738.thcon)
e2:SetTarget(c58984738.thtg)
e2:SetOperation(c58984738.thop)
c:RegisterEffect(e2)
end
function c58984738.otfilter(c)
return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()
end
function c58984738.otcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
return c:GetLevel()>4 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c58984738.otfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c58984738.otop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=Duel.SelectMatchingCard(tp,c58984738.otfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end
function c58984738.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE and rp~=tp
end
function c58984738.thfilter(c,tp)
return c:IsSetCard(0xf9) and c:GetType()==0x20004
and (c:IsAbleToHand() or (c:GetActivateEffect():IsActivatable(tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0))
end
function c58984738.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c58984738.thfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c58984738.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(58984738,3))
local g=Duel.SelectMatchingCard(tp,c58984738.thfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
local tc=g:GetFirst()
if tc then
local b1=tc:IsAbleToHand()
local b2=tc:GetActivateEffect():IsActivatable(tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
if b1 and (not b2 or Duel.SelectYesNo(tp,aux.Stringid(58984738,2))) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
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,EVENT_CHAIN_SOLVED,te,0,tp,tp,Duel.GetCurrentChain())
end
end
end
--ダイナミスト・ハウリング
function c60675348.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetOperation(c60675348.activate)
c:RegisterEffect(e1)
--return
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60675348,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,0x1e0)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_SZONE)
e2:SetCost(c60675348.thcost)
e2:SetTarget(c60675348.thtg)
e2:SetOperation(c60675348.thop)
c:RegisterEffect(e2)
end
function c60675348.filter(c)
return c:IsType(TYPE_PENDULUM) and c:IsSetCard(0xd8) and not c:IsForbidden()
end
function c60675348.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c60675348.filter,tp,LOCATION_DECK,0,nil)
local ct=0
if Duel.CheckLocation(tp,LOCATION_SZONE,6) then ct=ct+1 end
if Duel.CheckLocation(tp,LOCATION_SZONE,7) then ct=ct+1 end
if ct>0 and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(60675348,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sg=g:Select(tp,1,ct,nil)
local sc=sg:GetFirst()
while sc do
Duel.MoveToField(sc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
sc=sg:GetNext()
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c60675348.splimit)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
end
function c60675348.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0xd8) and bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function c60675348.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0xd8) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,nil,0xd8)
Duel.Release(g,REASON_COST)
end
function c60675348.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c60675348.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--ダブル・リゾネーター
function c60832978.initial_effect(c)
--tuner (summon)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetTarget(c60832978.target1)
e1:SetOperation(c60832978.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--tuner (banish)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,60832978)
e3:SetCost(c60832978.cost)
e3:SetTarget(c60832978.target2)
e3:SetOperation(c60832978.operation)
c:RegisterEffect(e3)
end
function c60832978.filter1(c)
return c:IsFaceup() and not c:IsType(TYPE_TUNER)
end
function c60832978.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c60832978.filter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(c60832978.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c60832978.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c60832978.operation(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_ADD_TYPE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(TYPE_TUNER)
tc:RegisterEffect(e1)
end
end
function c60832978.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c60832978.filter2(c)
return c60832978.filter1(c) and c:IsRace(RACE_FIEND)
end
function c60832978.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c60832978.filter2(chkc) end
if chk==0 then return Duel.IsExistingTarget(c60832978.filter2,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c60832978.filter2,tp,LOCATION_MZONE,0,1,1,nil)
end
--LL-サファイア・スワロー
function c60954556.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(60954556,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,60954556)
e1:SetCondition(c60954556.spcon)
e1:SetTarget(c60954556.sptg)
e1:SetOperation(c60954556.spop)
c:RegisterEffect(e1)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c60954556.efcon)
e2:SetOperation(c60954556.efop)
c:RegisterEffect(e2)
end
function c60954556.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_WINDBEAST)
end
function c60954556.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c60954556.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c60954556.spfilter(c,e,tp)
return c:IsRace(RACE_WINDBEAST) and c:GetLevel()==1 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c60954556.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c60954556.spfilter,tp,LOCATION_HAND,0,1,c,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND)
end
function c60954556.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 c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c60954556.spfilter,tp,LOCATION_HAND,0,1,1,c,e,tp)
if g:GetCount()>0 then
g:AddCard(c)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c60954556.efcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return r==REASON_XYZ and c:GetReasonCard():IsAttribute(ATTRIBUTE_WIND)
end
function c60954556.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local p=rc:GetControler()
local e1=Effect.CreateEffect(rc)
e1:SetDescription(aux.Stringid(60954556,1))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(c60954556.xyzcon)
e1:SetTarget(c60954556.xyztg)
e1:SetOperation(c60954556.xyzop)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e2,true)
end
end
function c60954556.xyzcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_XYZ)==SUMMON_TYPE_XYZ
end
function c60954556.xyzfilter(c)
return c:IsSetCard(0xf7) and c:IsType(TYPE_MONSTER)
end
function c60954556.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c60954556.xyzfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c60954556.xyzfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c60954556.xyzfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function c60954556.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
Duel.Overlay(c,Group.FromCards(tc))
end
end
--幻煌龍の浸禍
function c61397885.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE+CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP+0x1c0)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c61397885.condition)
e1:SetTarget(c61397885.target)
e1:SetOperation(c61397885.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c61397885.handcon)
c:RegisterEffect(e2)
--equip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(61397885,0))
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(c61397885.eqcost)
e3:SetTarget(c61397885.eqtg)
e3:SetOperation(c61397885.eqop)
c:RegisterEffect(e3)
end
function c61397885.cfilter(c)
return c:IsFacedown() or not c:IsType(TYPE_NORMAL)
end
function c61397885.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0
and not Duel.IsExistingMatchingCard(c61397885.cfilter,tp,LOCATION_MZONE,0,1,nil)
and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated())
end
function c61397885.mfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end
function c61397885.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c61397885.mfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c61397885.mfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c61397885.mfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c61397885.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(-1000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_DISABLE_EFFECT)
e4:SetValue(RESET_TURN_SET)
e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e4)
end
end
function c61397885.filter(c)
return c:IsFaceup() and c:IsCode(22702055)
end
function c61397885.handcon(e)
return Duel.IsExistingMatchingCard(c61397885.filter,e:GetHandlerPlayer(),LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
or Duel.IsEnvironment(22702055)
end
function c61397885.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c61397885.efilter(c,e)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsCanBeEffectTarget(e)
end
function c61397885.eqfilter(c,g)
return c:IsType(TYPE_EQUIP) and c:IsSetCard(0xfa) and g:IsExists(c61397885.eqcheck,1,nil,c)
end
function c61397885.eqcheck(c,ec)
return ec:CheckEquipTarget(c)
end
function c61397885.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c61397885.efilter,tp,LOCATION_MZONE,0,nil,e)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c61397885.efilter(chkc,e) end
if chk==0 then return g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c61397885.eqfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,g) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c61397885.efilter,tp,LOCATION_MZONE,0,1,1,nil,e)
end
function c61397885.eqop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=tg:GetFirst()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c61397885.eqfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,tg)
local eq=g:GetFirst()
if eq then
Duel.Equip(tp,eq,tc,true)
end
end
--真竜の黙示録
function c61529473.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c61529473.target)
c:RegisterEffect(e1)
--destory and atk & def down
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(61529473,0))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP+TIMING_END_PHASE)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,61529473)
e2:SetCondition(c61529473.atkcon)
e2:SetCost(c61529473.cost)
e2:SetTarget(c61529473.atktg)
e2:SetOperation(c61529473.atkop)
c:RegisterEffect(e2)
--tribute summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(61529473,1))
e3:SetCategory(CATEGORY_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_MAIN_END)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,61529474)
e3:SetCondition(c61529473.sumcon)
e3:SetCost(c61529473.cost)
e3:SetTarget(c61529473.sumtg)
e3:SetOperation(c61529473.sumop)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(61529473,2))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,61529475)
e4:SetCondition(c61529473.descon)
e4:SetTarget(c61529473.destg)
e4:SetOperation(c61529473.desop)
c:RegisterEffect(e4)
end
function c61529473.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c61529473.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then return true end
local b1=c61529473.atkcon(e,tp,eg,ep,ev,re,r,rp) and c61529473.atktg(e,tp,eg,ep,ev,re,r,rp,0)
local b2=c61529473.sumcon(e,tp,eg,ep,ev,re,r,rp) and c61529473.sumtg(e,tp,eg,ep,ev,re,r,rp,0)
if (b1 or b2) and Duel.SelectYesNo(tp,94) then
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(61529473,0),aux.Stringid(61529473,1))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(61529473,0))
else op=Duel.SelectOption(tp,aux.Stringid(61529473,1))+1 end
if op==0 then
e:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c61529473.atkop)
c61529473.atktg(e,tp,eg,ep,ev,re,r,rp,1)
else
e:SetCategory(CATEGORY_SUMMON)
e:SetProperty(0)
e:SetOperation(c61529473.sumop)
c61529473.sumtg(e,tp,eg,ep,ev,re,r,rp,1)
end
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c61529473.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c61529473.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) end
end
function c61529473.tgfilter(c)
return c:IsFaceup() and c:IsSetCard(0xf9)
end
function c61529473.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(tp) and c61529473.tgfilter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(c61529473.tgfilter,tp,LOCATION_ONFIELD,0,1,c)
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil)
and Duel.GetFlagEffect(tp,61529473)==0 end
Duel.RegisterFlagEffect(tp,61529473,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c61529473.tgfilter,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c61529473.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc2=g:GetFirst()
while tc2 do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(math.ceil(tc2:GetAttack()/2))
e1:SetReset(RESET_EVENT+0x1fe0000)
tc2:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(math.ceil(tc2:GetDefense()/2))
tc2:RegisterEffect(e2)
tc2=g:GetNext()
end
end
end
function c61529473.sumcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function c61529473.sumfilter(c)
return c:IsSetCard(0xf9) and c:IsSummonable(true,nil,1)
end
function c61529473.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c61529473.sumfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.GetFlagEffect(tp,61529474)==0 end
Duel.RegisterFlagEffect(tp,61529474,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c61529473.sumop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c61529473.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil,1)
end
end
function c61529473.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_SZONE)
end
function c61529473.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c61529473.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 c61677004.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(61677004,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,61677004+EFFECT_COUNT_CODE_DUEL)
e1:SetCondition(c61677004.thcon)
e1:SetTarget(c61677004.thtg)
e1:SetOperation(c61677004.thop)
c:RegisterEffect(e1)
end
function c61677004.thcon(e,tp,eg,ep,ev,re,r,rp)
return re and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsSetCard(0x10f3)
end
function c61677004.thfilter(c)
return c:IsSetCard(0x46) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c61677004.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c61677004.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c61677004.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c61677004.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 c62645025.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c62645025.condition)
e1:SetTarget(c62645025.target)
e1:SetOperation(c62645025.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c62645025.drcon)
e2:SetCost(c62645025.drcost)
e2:SetTarget(c62645025.drtg)
e2:SetOperation(c62645025.drop)
c:RegisterEffect(e1)
end
function c62645025.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function c62645025.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,62645025,0x10db,0x21,0,0,2,RACE_WARRIOR,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c62645025.activate(e,tp,eg,ep,ev,re,r,rp)
if not Duel.NegateAttack() then return end
Duel.BreakEffect()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if not c:IsRelateToEffect(e)
or not Duel.IsPlayerCanSpecialSummonMonster(tp,62645025,0x10db,0x21,0,0,2,RACE_WARRIOR,ATTRIBUTE_DARK) then return end
c:AddMonsterAttribute(TYPE_EFFECT)
Duel.SpecialSummonStep(c,1,tp,tp,true,false,POS_FACEUP_ATTACK)
c:AddMonsterAttributeComplete()
Duel.SpecialSummonComplete()
end
function c62645025.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
end
function c62645025.cfilter(c)
if c:IsFacedown() or not c:IsAbleToGraveAsCost() then return false end
return (c:IsSetCard(0x10db) and c:IsType(TYPE_MONSTER))
or (c:IsSetCard(0xdb) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsType(TYPE_CONTINUOUS))
end
function c62645025.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c62645025.cfilter,tp,LOCATION_ONFIELD,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c62645025.cfilter,tp,LOCATION_ONFIELD,0,1,1,c)
g:AddCard(c)
Duel.SendtoGrave(g,REASON_COST)
end
function c62645025.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)
end
function c62645025.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
--SRアクマグネ
function c62899696.initial_effect(c)
--cannot be synchro
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCondition(c62899696.smcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--synchro summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(62899696,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCondition(c62899696.spcon)
e2:SetTarget(c62899696.sptg)
e2:SetOperation(c62899696.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c62899696.smcon(e)
return e:GetHandler():GetFlagEffect(62899696)==0
end
function c62899696.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
and bit.band(Duel.GetCurrentPhase(),PHASE_MAIN1+PHASE_MAIN2)>0
end
function c62899696.filter(tc,c,tp)
if not tc:IsFaceup() or not tc:IsCanBeSynchroMaterial() then return false end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_MATERIAL)
tc:RegisterEffect(e1)
local mg=Group.FromCards(c,tc)
local res=Duel.IsExistingMatchingCard(c62899696.synfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
e1:Reset()
return res
end
function c62899696.synfilter(c,mg)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsSynchroSummonable(nil,mg)
end
function c62899696.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
c:RegisterFlagEffect(62899696,0,0,1)
if chkc then
local res=chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c62899696.filter(chkc,c,tp)
c:ResetFlagEffect(62899696)
return res
end
if chk==0 then
local res=Duel.IsExistingTarget(c62899696.filter,tp,0,LOCATION_MZONE,1,nil,c,tp)
c:ResetFlagEffect(62899696)
return res
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c62899696.filter,tp,0,LOCATION_MZONE,1,1,nil,c,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
c:ResetFlagEffect(62899696)
end
function c62899696.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
c:RegisterFlagEffect(62899696,0,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_MATERIAL)
tc:RegisterEffect(e1)
local mg=Group.FromCards(c,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c62899696.synfilter,tp,LOCATION_EXTRA,0,1,1,nil,mg)
local sc=g:GetFirst()
if sc then
Duel.SynchroSummon(tp,sc,nil,mg)
end
c:ResetFlagEffect(62899696)
e1:Reset()
end
end
--醒めない悪夢
function c69452756.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE+TIMING_EQUIP)
e1:SetTarget(c69452756.target1)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(36970611,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE+TIMING_EQUIP)
e2:SetCost(c69452756.cost2)
e2:SetTarget(c69452756.target2)
e2:SetOperation(c69452756.operation)
c:RegisterEffect(e2)
end
function c69452756.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c69452756.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c69452756.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then return true end
if c69452756.cost2(e,tp,eg,ep,ev,re,r,rp,0) and c69452756.target2(e,tp,eg,ep,ev,re,r,rp,0,chkc)
and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_DESTROY)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c69452756.operation)
c69452756.cost2(e,tp,eg,ep,ev,re,r,rp,1)
c69452756.target2(e,tp,eg,ep,ev,re,r,rp,1,chkc)
else
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c69452756.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) and e:GetHandler():GetFlagEffect(69452756)==0 end
Duel.PayLPCost(tp,1000)
e:GetHandler():RegisterFlagEffect(69452756,RESET_CHAIN,0,1)
end
function c69452756.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c69452756.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c69452756.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c69452756.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c69452756.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--覇王眷竜ダークヴルム
function c69610326.initial_effect(c)
aux.EnablePendulumAttribute(c)
--pendulum set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(69610326,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetCondition(c69610326.pccon)
e1:SetTarget(c69610326.pctg)
e1:SetOperation(c69610326.pcop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(69610326,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,69610326)
e2:SetTarget(c69610326.thtg)
e2:SetOperation(c69610326.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(69610326,2))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,69610327)
e4:SetCondition(c69610326.pccon)
e4:SetTarget(c69610326.sptg)
e4:SetOperation(c69610326.spop)
c:RegisterEffect(e4)
end
function c69610326.pccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c69610326.pcfilter(c)
return c:IsSetCard(0x10f8) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
function c69610326.pctg(e,tp,eg,ep,ev,re,r,rp,chk)
local seq=e:GetHandler():GetSequence()
if chk==0 then return Duel.CheckLocation(tp,LOCATION_SZONE,13-seq)
and Duel.IsExistingMatchingCard(c69610326.pcfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c69610326.pcop(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_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c69610326.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if not c:IsRelateToEffect(e) then return end
local seq=c:GetSequence()
if not Duel.CheckLocation(tp,LOCATION_SZONE,13-seq) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,c69610326.pcfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
function c69610326.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsAttribute(ATTRIBUTE_DARK) and bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function c69610326.thfilter(c)
return c:IsSetCard(0x10f8) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c69610326.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c69610326.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c69610326.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c69610326.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 c69610326.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 c69610326.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--捕食植物コーディセップス
function c7161742.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(7161742,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c7161742.spcon)
e1:SetCost(c7161742.spcost)
e1:SetTarget(c7161742.sptg)
e1:SetOperation(c7161742.spop)
c:RegisterEffect(e1)
end
function c7161742.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c7161742.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c7161742.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x10f3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c7161742.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c7161742.filter(chkc,e,tp) end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingTarget(c7161742.filter,tp,LOCATION_GRAVE,0,2,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c7161742.filter,tp,LOCATION_GRAVE,0,2,2,e:GetHandler(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function c7161742.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if ft>0 and (g:GetCount()>0 or (g:GetCount()>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
if g:GetCount()>ft then g=g:Select(tp,ft,ft,nil) end
Duel.SpecialSummon(g,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:SetTarget(c7161742.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
end
function c7161742.splimit(e,c)
return not c:IsType(TYPE_FUSION)
end
--盆回し
function c73468603.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c73468603.target)
e1:SetOperation(c73468603.operation)
c:RegisterEffect(e1)
end
function c73468603.filter(c)
return c:IsType(TYPE_FIELD) and c:IsSSetable()
end
function c73468603.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c73468603.filter,tp,LOCATION_DECK,0,nil)
if chk==0 then return g:GetClassCount(Card.GetCode)>1 end
end
function c73468603.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c73468603.filter,tp,LOCATION_DECK,0,nil)
if g:GetClassCount(Card.GetCode)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(73468603,0))
local tg1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,tg1:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(73468603,1))
local tg2=g:Select(tp,1,1,nil)
local fc1=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc1 then
Duel.SendtoGrave(fc1,REASON_RULE)
Duel.BreakEffect()
end
Duel.SSet(tp,tg1)
local fc2=Duel.GetFieldCard(1-tp,LOCATION_SZONE,5)
if fc2 then
Duel.SendtoGrave(fc2,REASON_RULE)
Duel.BreakEffect()
end
Duel.SSet(1-tp,tg2)
tg1:GetFirst():RegisterFlagEffect(73468603,RESET_EVENT+0x1fe0000,0,1)
tg2:GetFirst():RegisterFlagEffect(73468603,RESET_EVENT+0x1fe0000,0,1)
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,1)
e1:SetCondition(c73468603.con)
e1:SetValue(c73468603.actlimit)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SSET)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetCondition(c73468603.con)
e2:SetTarget(c73468603.setlimit)
Duel.RegisterEffect(e2,tp)
end
function c73468603.cfilter(c)
return c:GetSequence()==5 and c:IsFacedown() and c:GetFlagEffect(73468603)~=0
end
function c73468603.con(e)
return Duel.IsExistingMatchingCard(c73468603.cfilter,e:GetHandlerPlayer(),LOCATION_SZONE,LOCATION_SZONE,1,nil)
end
function c73468603.actlimit(e,re,tp)
return re:IsActiveType(TYPE_FIELD) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():GetFlagEffect(73468603)==0
end
function c73468603.setlimit(e,c,tp)
return c:IsType(TYPE_FIELD) and c:GetFlagEffect(73468603)==0
end
--EMユーゴーレム
function c73511233.initial_effect(c)
aux.EnablePendulumAttribute(c)
--salvage
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1)
e1:SetCondition(c73511233.thcon)
e1:SetTarget(c73511233.thtg)
e1:SetOperation(c73511233.thop)
c:RegisterEffect(e1)
--reg
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(c73511233.effcon)
e2:SetOperation(c73511233.regop)
c:RegisterEffect(e2)
--fusion
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c73511233.spcon)
e3:SetTarget(c73511233.sptg)
e3:SetOperation(c73511233.spop)
c:RegisterEffect(e3)
end
function c73511233.thcfilter(c,tp)
return c:IsControler(tp) and bit.band(c:GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
function c73511233.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg and eg:IsExists(c73511233.thcfilter,1,nil,tp)
end
function c73511233.thfilter(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and (c:IsSetCard(0x98) or c:IsSetCard(0x99) or c:IsSetCard(0x9f))
and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c73511233.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c73511233.thfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_EXTRA)
end
function c73511233.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c73511233.thfilter),tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c73511233.effcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function c73511233.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(73511233,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c73511233.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(73511233)~=0
end
function c73511233.spfilter0(c)
return c:IsRace(RACE_DRAGON) and c:IsOnField()
end
function c73511233.spfilter1(c,e)
return c73511233.spfilter0(c) and not c:IsImmuneToEffect(e)
end
function c73511233.spfilter2(c,e,tp,m,f,gc)
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,gc)
end
function c73511233.spfilter3(c)
return c:IsCanBeFusionMaterial() and c:IsRace(RACE_DRAGON)
end
function c73511233.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local mg1=Duel.GetFusionMaterial(tp):Filter(c73511233.spfilter0,c)
local res=Duel.IsExistingMatchingCard(c73511233.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp):Filter(c73511233.spfilter3,nil)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c73511233.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c73511233.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or c:IsControler(1-tp) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(c73511233.spfilter1,c,e)
local sg1=Duel.GetMatchingGroup(c73511233.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp):Filter(c73511233.spfilter3,nil)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c73511233.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c)
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 mat1=Duel.SelectFusionMaterial(tp,tc,mg1,c)
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,c)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
--EMスカイ・マジシャン
function c73734821.initial_effect(c)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(aux.chainreg)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(73734821,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c73734821.atkcon)
e2:SetCost(c73734821.atkcost)
e2:SetOperation(c73734821.atkop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(73734821,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,73734821)
e3:SetTarget(c73734821.thtg)
e3:SetOperation(c73734821.thop)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(73734821,3))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetCondition(c73734821.descon)
e4:SetTarget(c73734821.destg)
e4:SetOperation(c73734821.desop)
c:RegisterEffect(e4)
end
function c73734821.atkcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and rp==tp and e:GetHandler():GetFlagEffect(1)>0
end
function c73734821.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(73734821)==0 end
e:GetHandler():RegisterFlagEffect(73734821,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c73734821.atkop(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_ATTACK)
e1:SetValue(300)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
function c73734821.thfilter(c)
return c:IsFaceup() and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and c:IsAbleToHand()
end
function c73734821.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c73734821.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c73734821.thfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c73734821.thfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c73734821.tffilter(c,tp)
return c:IsSetCard(0x98) and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and c:GetActivateEffect():IsActivatable(tp)
end
function c73734821.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 then
local g=Duel.GetMatchingGroup(c73734821.tffilter,tp,LOCATION_HAND,0,nil,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(73734821,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sc=g:Select(tp,1,1,nil):GetFirst()
Duel.MoveToField(sc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=sc:GetActivateEffect()
local tep=sc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(sc,EVENT_CHAIN_SOLVED,te,0,tp,tp,Duel.GetCurrentChain())
end
end
end
function c73734821.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function c73734821.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 c73734821.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 c74580251.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,74580251+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c74580251.target)
e1:SetOperation(c74580251.activate)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetTarget(c74580251.reptg)
e2:SetValue(c74580251.repval)
e2:SetOperation(c74580251.repop)
c:RegisterEffect(e2)
end
function c74580251.filter(c)
return c:IsSetCard(0xc4) and not c:IsCode(74580251) and c:IsAbleToHand()
end
function c74580251.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74580251.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74580251.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74580251.filter,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 c74580251.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xc4) and c:IsLocation(LOCATION_ONFIELD)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE)
end
function c74580251.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and aux.exccon(e) and eg:IsExists(c74580251.repfilter,1,nil,tp) end
return Duel.SelectYesNo(tp,aux.Stringid(74580251,0))
end
function c74580251.repval(e,c)
return c74580251.repfilter(c,e:GetHandlerPlayer())
end
function c74580251.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
--真竜凰の使徒
function c75425320.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(75425320,0))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,75425320)
e2:SetTarget(c75425320.drtg)
e2:SetOperation(c75425320.drop)
c:RegisterEffect(e2)
--tribute summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(75425320,1))
e3:SetCategory(CATEGORY_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,75425321)
e3:SetTarget(c75425320.sumtg)
e3:SetOperation(c75425320.sumop)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(75425320,2))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,75425322)
e4:SetCondition(c75425320.descon)
e4:SetTarget(c75425320.destg)
e4:SetOperation(c75425320.desop)
c:RegisterEffect(e4)
end
function c75425320.tdfilter(c)
return c:IsSetCard(0xf9) and c:IsAbleToDeck()
end
function c75425320.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c75425320.tdfilter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c75425320.tdfilter,tp,LOCATION_GRAVE,0,3,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c75425320.tdfilter,tp,LOCATION_GRAVE,0,3,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c75425320.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()<=0 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct>0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c75425320.sumfilter(c)
return c:IsSetCard(0xf9) and c:IsSummonable(true,nil,1)
end
function c75425320.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c75425320.sumfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c75425320.sumop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c75425320.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil,1)
end
end
function c75425320.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_SZONE)
end
function c75425320.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsType(TYPE_SPELL+TYPE_TRAP) end
if chk==0 then return Duel.IsExistingTarget(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,TYPE_SPELL+TYPE_TRAP)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c75425320.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 c75702749.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(c75702749.target)
e1:SetOperation(c75702749.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(c75702749.eqlimit)
c:RegisterEffect(e2)
--Atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(500)
c:RegisterEffect(e3)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(75702749,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLE_DESTROYING)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,75702749)
e4:SetCondition(c75702749.spcon)
e4:SetTarget(c75702749.sptg)
e4:SetOperation(c75702749.spop)
c:RegisterEffect(e4)
end
function c75702749.eqlimit(e,c)
return c:IsType(TYPE_NORMAL)
end
function c75702749.filter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL)
end
function c75702749.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c75702749.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c75702749.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c75702749.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c75702749.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
end
end
function c75702749.spcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
return ec and eg:IsContains(ec)
end
function c75702749.spfilter(c,e,tp)
return c:IsCode(56649609) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c75702749.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c75702749.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
end
function c75702749.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c75702749.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Equip(tp,c,tc)
Duel.SpecialSummonComplete()
Duel.BreakEffect()
Duel.Damage(1-tp,1000,REASON_EFFECT)
end
end
end
--超越融合
function c76647978.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(76647978,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c76647978.cost)
e1:SetTarget(c76647978.target)
e1:SetOperation(c76647978.activate)
c:RegisterEffect(e1)
--Summon Materials
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(76647978,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCost(c76647978.spcost)
e2:SetTarget(c76647978.sptg)
e2:SetOperation(c76647978.spop)
c:RegisterEffect(e2)
end
function c76647978.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000) end
Duel.PayLPCost(tp,2000)
end
function c76647978.filter0(c,e,tp,mg)
return mg:IsExists(c76647978.filter1,1,nil,e,tp,c)
end
function c76647978.filter1(c,e,tp,mc)
local mg=Group.FromCards(c,mc)
return Duel.IsExistingMatchingCard(c76647978.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg)
end
function c76647978.filter2(c,e,tp,mg)
return c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(mg,nil)
end
function c76647978.target(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and mg:IsExists(c76647978.filter0,1,nil,e,tp,mg) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(aux.FALSE)
end
end
function c76647978.filter3(c,e,tp,mg)
return not c:IsImmuneToEffect(e) and mg:IsExists(c76647978.filter4,1,c,e,tp,c)
end
function c76647978.filter4(c,e,tp,mc)
local mg=Group.FromCards(c,mc)
return not c:IsImmuneToEffect(e) and Duel.IsExistingMatchingCard(c76647978.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg)
end
function c76647978.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<-1 then return end
local mg=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=mg:FilterSelect(tp,c76647978.filter3,1,1,nil,e,tp,mg)
if g1:GetCount()==0 then return end
local tc1=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g2=mg:FilterSelect(tp,c76647978.filter4,1,1,tc1,e,tp,tc1)
g1:Merge(g2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c76647978.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,g1)
local tc=sg:GetFirst()
tc:SetMaterial(g1)
Duel.SendtoGrave(g1,REASON_MATERIAL+REASON_FUSION+REASON_EFFECT)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(76647978,RESET_EVENT+0x1fe0000,0,1)
tc:CompleteProcedure()
end
function c76647978.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c76647978.mgfilter(c,e,tp,fusc,mg)
return not c:IsControler(tp) or not c:IsLocation(LOCATION_GRAVE)
or bit.band(c:GetReason(),0x40008)~=0x40008 or c:GetReasonCard()~=fusc
or not c:IsCanBeSpecialSummoned(e,0,tp,false,false) or c:IsHasEffect(EFFECT_NECRO_VALLEY)
or not fusc:CheckFusionMaterial(mg,c)
end
function c76647978.spfilter(c,e,tp,lc)
if c:IsFaceup() and c:GetFlagEffect(76647978)~=0 then
local mg=c:GetMaterial()
return mg:GetCount()>0 and mg:GetCount()<=lc
and not mg:IsExists(c76647978.mgfilter,1,nil,e,tp,c,mg)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
else return false end
end
function c76647978.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local lc=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c76647978.spfilter(chkc,e,tp,lc) end
if chk==0 then return Duel.IsExistingTarget(c76647978.spfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp,lc) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c76647978.spfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp,lc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE)
end
function c76647978.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local mg=tc:GetMaterial()
if mg:GetCount()>0 and mg:GetCount()<=Duel.GetLocationCount(tp,LOCATION_MZONE)
and not mg:IsExists(c76647978.mgfilter,1,nil,e,tp,tc) and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
local sc=mg:GetFirst()
while sc do
if Duel.SpecialSummonStep(sc,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+0x1fe0000)
sc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
sc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetValue(0)
e3:SetReset(RESET_EVENT+0x1fe0000)
sc:RegisterEffect(e3,true)
local e4=e3:Clone()
e4:SetCode(EFFECT_SET_DEFENSE_FINAL)
sc:RegisterEffect(e4,true)
end
sc=mg:GetNext()
end
Duel.SpecialSummonComplete()
end
end
--LL-インディペンデント・ナイチンゲール
function c76815942.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,48608796,aux.FilterBoolFunction(Card.IsFusionSetCard,0xf7),1,true,true)
--increase level
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(76815942,0))
e1:SetCategory(CATEGORY_LVCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(c76815942.lvcon)
e1:SetOperation(c76815942.lvop)
c:RegisterEffect(e1)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_MATERIAL_CHECK)
e0:SetValue(c76815942.valcheck)
e0:SetLabelObject(e1)
c:RegisterEffect(e0)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c76815942.efilter)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(c76815942.atkval)
c:RegisterEffect(e3)
--damage
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(76815942,1))
e4:SetCategory(CATEGORY_DAMAGE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCountLimit(1)
e4:SetTarget(c76815942.damtg)
e4:SetOperation(c76815942.damop)
c:RegisterEffect(e4)
end
function c76815942.matval(c)
if c:IsOriginalSetCard(0xf7) and c:IsType(TYPE_XYZ) then
return c:GetOverlayCount()
end
return 0
end
function c76815942.valcheck(e,c)
local val=c:GetMaterial():GetSum(c76815942.matval)
e:GetLabelObject():SetLabel(val)
end
function c76815942.lvcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION and e:GetLabel()>0
end
function c76815942.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
function c76815942.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function c76815942.atkval(e,c)
return c:GetLevel()*500
end
function c76815942.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,e:GetHandler():GetLevel()*500)
end
function c76815942.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Damage(p,c:GetLevel()*500,REASON_EFFECT)
end
end
--ファイヤークラッカー
function c81109178.initial_effect(c)
c:EnableCounterPermit(0x42)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(81109178,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,81109178)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c81109178.damcost1)
e1:SetTarget(c81109178.damtg1)
e1:SetOperation(c81109178.damop1)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_DAMAGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c81109178.ctcon)
e2:SetOperation(c81109178.ctop)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(81109178,1))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c81109178.damtg2)
e3:SetOperation(c81109178.damop2)
c:RegisterEffect(e3)
end
function c81109178.damcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c81109178.damtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
end
function c81109178.damop1(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Damage(p,d,REASON_EFFECT)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_SKIP_DP)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
end
end
function c81109178.ctcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and bit.band(r,REASON_EFFECT)~=0
end
function c81109178.ctop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x42,1)
end
function c81109178.damtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=e:GetHandler():GetCounter(0x42)
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct)
end
function c81109178.damop2(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local c=e:GetHandler()
local ct=c:GetCounter(0x42)
if ct>0 then
c:RemoveCounter(tp,0x42,ct,REASON_EFFECT)
Duel.Damage(p,ct*300,REASON_EFFECT)
end
end
--巨大戦艦 ビッグ・コアMk-Ⅲ
function c82821760.initial_effect(c)
c:EnableCounterPermit(0x1f)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetTargetRange(POS_FACEUP_DEFENSE,0)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c82821760.sprcon)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(82821760,0))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c82821760.cttg)
e2:SetOperation(c82821760.ctop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetValue(1)
c:RegisterEffect(e4)
--remove counter
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(82821760,1))
e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_DAMAGE_STEP_END)
e5:SetTarget(c82821760.rcttg)
e5:SetOperation(c82821760.rctop)
c:RegisterEffect(e5)
--to deck
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(82821760,2))
e6:SetCategory(CATEGORY_TODECK)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_GRAVE)
e6:SetCost(c82821760.tdcost)
e6:SetTarget(c82821760.tdtg)
e6:SetOperation(c82821760.tdop)
c:RegisterEffect(e6)
end
function c82821760.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function c82821760.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,3,0,0x1f)
end
function c82821760.ctop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x1f,3)
end
end
function c82821760.rcttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetHandler():IsCanRemoveCounter(tp,0x1f,1,REASON_EFFECT) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
end
function c82821760.rctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
if c:IsCanRemoveCounter(tp,0x1f,1,REASON_EFFECT) then
c:RemoveCounter(tp,0x1f,1,REASON_EFFECT)
else
Duel.Destroy(c,REASON_EFFECT)
end
end
end
function c82821760.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c82821760.tdfilter(c)
return c:IsSetCard(0x15) and c:IsAbleToDeck()
end
function c82821760.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c82821760.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.GetMatchingGroup(c82821760.tdfilter,tp,LOCATION_GRAVE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c82821760.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c82821760.tdfilter,tp,LOCATION_GRAVE,0,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
--SR56プレーン
function c8284390.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(8284390,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,8284390)
e1:SetCondition(c8284390.spcon)
e1:SetTarget(c8284390.sptg)
e1:SetOperation(c8284390.spop)
c:RegisterEffect(e1)
--atk down
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(8284390,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c8284390.atktg)
e2:SetOperation(c8284390.atkop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c8284390.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,tp)
end
function c8284390.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 c8284390.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SendtoGrave(c,REASON_RULE)
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(c8284390.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c8284390.splimit(e,c,tp,sumtp,sumpos)
return not c:IsAttribute(ATTRIBUTE_WIND)
end
function c8284390.atktg(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_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,1,0,0)
end
function c8284390.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(-600)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
--電子光虫-LEDバグ
function c83048208.initial_effect(c)
--xyzlimit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetValue(c83048208.xyzlimit)
c:RegisterEffect(e0)
--Search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(83048208,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CHANGE_POS)
e1:SetCountLimit(1)
e1:SetCondition(c83048208.thcon)
e1:SetTarget(c83048208.thtg)
e1:SetOperation(c83048208.thop)
c:RegisterEffect(e1)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c83048208.efcon)
e2:SetOperation(c83048208.efop)
c:RegisterEffect(e2)
end
function c83048208.xyzlimit(e,c)
if not c then return false end
return not c:IsRace(RACE_INSECT)
end
function c83048208.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return not c:IsStatus(STATUS_CONTINUOUS_POS) and c:IsPosition(POS_FACEUP_DEFENSE) and c:IsPreviousPosition(POS_FACEUP_ATTACK)
end
function c83048208.thfilter(c)
return c:IsRace(RACE_INSECT) and c:GetLevel()==3 and c:IsAbleToHand()
end
function c83048208.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c83048208.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c83048208.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c83048208.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 c83048208.efcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_XYZ
end
function c83048208.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetDescription(aux.Stringid(83048208,1))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetOperation(c83048208.drop)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e2,true)
end
end
function c83048208.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,83048208)
Duel.Draw(tp,1,REASON_EFFECT)
end
--妖精伝姫-カグヤ
function c86937530.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86937530,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c86937530.target)
e1:SetOperation(c86937530.operation)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(86937530,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetHintTiming(0,0x1e0)
e2:SetTarget(c86937530.thtg)
e2:SetOperation(c86937530.thop)
c:RegisterEffect(e2)
end
function c86937530.filter(c)
return c:GetAttack()==1850 and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand()
end
function c86937530.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c86937530.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c86937530.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c86937530.filter,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 c86937530.thfilter(c)
return c:IsFaceup() and c:IsAbleToHand()
end
function c86937530.thtg(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:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(c86937530.thfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c86937530.thfilter,tp,0,LOCATION_MZONE,1,1,nil)
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,2,0,0)
end
function c86937530.cfilter(c,code)
return c:IsCode(code) and c:IsAbleToGraveAsCost()
end
function c86937530.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if Duel.IsChainDisablable(0) then
local sel=1
local g=Duel.GetMatchingGroup(c86937530.cfilter,tp,0,LOCATION_DECK+LOCATION_EXTRA,nil,tc:GetCode())
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(86937530,2))
if g:GetCount()>0 then
sel=Duel.SelectOption(1-tp,1213,1214)
else
sel=Duel.SelectOption(1-tp,1214)+1
end
if sel==0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local sg=g:Select(1-tp,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.NegateEffect(0)
return
end
end
if tc:IsRelateToEffect(e) then
local rg=Group.FromCards(c,tc)
Duel.SendtoHand(rg,nil,REASON_EFFECT)
end
end
--魔術師の右手
function c87769556.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:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c87769556.negcon)
e2:SetOperation(c87769556.negop)
c:RegisterEffect(e2)
end
function c87769556.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER)
end
function c87769556.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c87769556.cfilter,tp,LOCATION_MZONE,0,1,nil)
and rp~=tp and re:IsActiveType(TYPE_SPELL) and Duel.IsChainDisablable(ev)
end
function c87769556.negop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
--真竜皇V.F.D
function c88581108.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,9,2,nil,nil,5)
c:EnableReviveLimit()
--attribute change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88581108,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetHintTiming(0,TIMING_DRAW_PHASE)
e1:SetCost(c88581108.atcost)
e1:SetTarget(c88581108.attg)
e1:SetOperation(c88581108.atop)
c:RegisterEffect(e1)
--true king destruction
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(88581108)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
end
function c88581108.atcost(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 c88581108.attg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,562)
local rc=Duel.AnnounceAttribute(tp,1,0xffff)
e:SetLabel(rc)
end
function c88581108.atop(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_CHANGE_ATTRIBUTE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetTargetRange(0,1)
e2:SetLabel(e:GetLabel())
e2:SetValue(c88581108.aclimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_ATTACK)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetLabel(e:GetLabel())
e3:SetTarget(c88581108.atktarget)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function c88581108.aclimit(e,re,tp)
local c=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and c:IsAttribute(e:GetLabel()) and not c:IsImmuneToEffect(e)
end
function c88581108.atktarget(e,c)
return c:IsAttribute(e:GetLabel())
end
--EM小判竜
function c9000988.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9000988,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(c9000988.condition)
e1:SetTarget(c9000988.target)
e1:SetOperation(c9000988.operation)
c:RegisterEffect(e1)
--atk up
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:SetTarget(c9000988.atktg)
e2:SetValue(500)
c:RegisterEffect(e2)
--indes
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetValue(1)
c:RegisterEffect(e3)
end
function c9000988.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function c9000988.filter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:GetSummonLocation()==LOCATION_EXTRA
end
function c9000988.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c9000988.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c9000988.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c9000988.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c9000988.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLED)
e1:SetOwnerPlayer(tp)
e1:SetCondition(c9000988.rmcon)
e1:SetOperation(c9000988.rmop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1,true)
end
end
function c9000988.rmcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
return tp==e:GetOwnerPlayer() and tc and tc:IsControler(1-tp)
end
function c9000988.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
function c9000988.atktg(e,c)
return c:IsRace(RACE_DRAGON) and c~=e:GetHandler()
end
--常闇の契約書
function c9030160.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_DRAW_PHASE)
c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(c9030160.condition)
e2:SetValue(c9030160.evalue)
c:RegisterEffect(e2)
--cannot release
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EFFECT_UNRELEASABLE_SUM)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetCondition(c9030160.condition)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
c:RegisterEffect(e5)
local e6=e3:Clone()
e6:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e6)
local e7=e3:Clone()
e7:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e7)
--damage
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(9030160,0))
e8:SetCategory(CATEGORY_DAMAGE)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e8:SetCode(EVENT_PHASE+PHASE_STANDBY)
e8:SetRange(LOCATION_SZONE)
e8:SetCountLimit(1)
e8:SetCondition(c9030160.damcon)
e8:SetTarget(c9030160.damtg)
e8:SetOperation(c9030160.damop)
c:RegisterEffect(e8)
end
function c9030160.condition(e)
local tp=e:GetHandlerPlayer()
local pc1=Duel.GetFieldCard(tp,LOCATION_SZONE,6)
local pc2=Duel.GetFieldCard(tp,LOCATION_SZONE,7)
return pc1 and pc2 and pc1:IsSetCard(0xaf) and pc2:IsSetCard(0xaf)
end
function c9030160.evalue(e,re,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and rp~=e:GetHandlerPlayer()
end
function c9030160.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c9030160.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,tp,1000)
end
function c9030160.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
--真竜凰マリアムネ
function c94160895.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(94160895,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,94160895)
e1:SetTarget(c94160895.sptg)
e1:SetOperation(c94160895.spop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(94160895,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,94160896)
e2:SetCondition(c94160895.thcon)
e2:SetTarget(c94160895.thtg)
e2:SetOperation(c94160895.thop)
c:RegisterEffect(e2)
end
function c94160895.desfilter(c)
return c:IsType(TYPE_MONSTER) and ((c:IsLocation(LOCATION_MZONE) and c:IsFaceup()) or c:IsLocation(LOCATION_HAND))
end
function c94160895.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local loc=LOCATION_MZONE+LOCATION_HAND
if ft<0 then loc=LOCATION_MZONE end
local loc2=0
if Duel.IsPlayerAffectedByEffect(tp,88581108) then loc2=LOCATION_MZONE end
local g=Duel.GetMatchingGroup(c94160895.desfilter,tp,loc,loc2,c)
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and g:GetCount()>=2 and g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WIND)
and (ft>0 or g:IsExists(Card.IsLocation,-ft+1,nil,LOCATION_MZONE)) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,2,tp,loc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c94160895.rmfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove(tp)
end
function c94160895.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local loc=LOCATION_MZONE+LOCATION_HAND
if ft<0 then loc=LOCATION_MZONE end
local loc2=0
if Duel.IsPlayerAffectedByEffect(tp,88581108) then loc2=LOCATION_MZONE end
local g=Duel.GetMatchingGroup(c94160895.desfilter,tp,loc,loc2,c)
if g:GetCount()<2 or not g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WIND) then return end
local g1=nil local g2=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
if ft<1 then
g1=g:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_MZONE)
else
g1=g:Select(tp,1,1,nil)
end
g:RemoveCard(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
if g1:GetFirst():IsAttribute(ATTRIBUTE_WIND) then
g2=g:Select(tp,1,1,nil)
else
g2=g:FilterSelect(tp,Card.IsAttribute,1,1,nil,ATTRIBUTE_WIND)
end
g1:Merge(g2)
local rm=g1:IsExists(Card.IsAttribute,2,nil,ATTRIBUTE_WIND)
if Duel.Destroy(g1,REASON_EFFECT)==2 then
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SendtoGrave(c,REASON_RULE)
return
end
local rg=Duel.GetDecktopGroup(1-tp,4)
if rm and rg:GetCount()>0 and rg:FilterCount(Card.IsAbleToRemove,nil)==4
and Duel.SelectYesNo(tp,aux.Stringid(94160895,2)) then
Duel.DisableShuffleCheck()
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
end
end
function c94160895.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function c94160895.thfilter(c)
return c:GetAttribute()~=ATTRIBUTE_WIND and c:IsRace(RACE_WYRM) and c:IsAbleToHand()
end
function c94160895.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c94160895.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c94160895.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c94160895.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 c94982447.initial_effect(c)
--summon with 1 tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22499034,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c94982447.otcon)
e1:SetOperation(c94982447.otop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(c94982447.spcon)
e2:SetTarget(c94982447.sptg)
e2:SetOperation(c94982447.spop)
c:RegisterEffect(e2)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c94982447.tgtg)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--indes
local e4=e3:Clone()
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetValue(c94982447.indval)
c:RegisterEffect(e4)
end
function c94982447.otfilter(c)
return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()
end
function c94982447.otcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
return c:GetLevel()>4 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c94982447.otfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c94982447.otop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=Duel.SelectMatchingCard(tp,c94982447.otfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end
function c94982447.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and
bit.band(c:GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE
end
function c94982447.spfilter(c,e,tp)
return c:IsSetCard(0xf9) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c94982447.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c94982447.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c94982447.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,c94982447.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function c94982447.tgtg(e,c)
return c:IsSetCard(0xf9) and c~=e:GetHandler()
end
function c94982447.indval(e,re,rp)
return rp~=e:GetHandlerPlayer()
end
--真竜導士マジェスティM
function c95004025.initial_effect(c)
--summon with 1 tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(95004025,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c95004025.otcon)
e1:SetOperation(c95004025.otop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(95004025,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c95004025.thcon)
e2:SetTarget(c95004025.thtg)
e2:SetOperation(c95004025.thop)
c:RegisterEffect(e2)
end
function c95004025.otfilter(c)
return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()
end
function c95004025.otcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
return c:GetLevel()>4 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c95004025.otfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c95004025.otop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=Duel.SelectMatchingCard(tp,c95004025.otfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end
function c95004025.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE and rp~=tp
end
function c95004025.thfilter(c)
return c:IsSetCard(0xf9) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c95004025.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c95004025.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c95004025.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c95004025.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 c96073342.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,96073342+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,0x1e0)
e1:SetTarget(c96073342.target)
e1:SetOperation(c96073342.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c96073342.handcon)
c:RegisterEffect(e2)
end
function c96073342.filter(c)
return c:IsFaceup() and c:IsSetCard(0xc4)
end
function c96073342.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(c96073342.filter,tp,LOCATION_ONFIELD,0,1,c)
and Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c96073342.filter,tp,LOCATION_ONFIELD,0,1,1,c)
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)
end
function c96073342.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
function c96073342.handcon(e)
local tp=e:GetHandlerPlayer()
local tc1=Duel.GetFieldCard(tp,LOCATION_SZONE,6)
local tc2=Duel.GetFieldCard(tp,LOCATION_SZONE,7)
return tc1 and tc1:IsSetCard(0xc4) and tc2 and tc2:IsSetCard(0xc4)
end
--覇王門零
function c96227613.initial_effect(c)
aux.EnablePendulumAttribute(c)
--avoid damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_AVAILABLE_BD)
e1:SetTargetRange(1,0)
e1:SetCondition(c96227613.ndcon)
e1:SetValue(0)
c:RegisterEffect(e1)
local e0=e1:Clone()
e0:SetCode(EFFECT_NO_EFFECT_DAMAGE)
c:RegisterEffect(e0)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(96227613,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1)
e2:SetCondition(c96227613.thcon)
e2:SetTarget(c96227613.thtg)
e2:SetOperation(c96227613.thop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(96227613,1))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetTarget(c96227613.sptg)
e3:SetOperation(c96227613.spop)
c:RegisterEffect(e3)
--pendulum
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(96227613,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(c96227613.pencon)
e4:SetTarget(c96227613.pentg)
e4:SetOperation(c96227613.penop)
c:RegisterEffect(e4)
end
function c96227613.ndcfilter(c)
return c:IsFaceup() and c:IsCode(13331639)
end
function c96227613.ndcon(e)
return Duel.IsExistingMatchingCard(c96227613.ndcfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function c96227613.thcon(e,tp,eg,ep,ev,re,r,rp)
local seq=e:GetHandler():GetSequence()
local pc=Duel.GetFieldCard(tp,LOCATION_SZONE,13-seq)
return pc and pc:IsCode(22211622)
end
function c96227613.thfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x46) and c:IsAbleToHand()
end
function c96227613.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c96227613.thfilter,tp,LOCATION_DECK,0,1,nil) end
local c=e:GetHandler()
local pc=Duel.GetFieldCard(tp,LOCATION_SZONE,13-c:GetSequence())
local g=Group.FromCards(c,pc)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c96227613.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local pc=Duel.GetFieldCard(tp,LOCATION_SZONE,13-c:GetSequence())
if not pc then return end
local g=Group.FromCards(c,pc)
if Duel.Destroy(g,REASON_EFFECT)==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,c96227613.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
function c96227613.spfilter(c,e,tp)
return c:IsType(TYPE_FUSION+TYPE_SYNCHRO) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c96227613.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and chkc:IsFaceup() and chkc~=c end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,c)
and Duel.IsExistingMatchingCard(c96227613.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,1,c)
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c96227613.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) then return end
local dg=Group.FromCards(c,tc)
if Duel.Destroy(dg,REASON_EFFECT)==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c96227613.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()==0 then return end
local sc=g:GetFirst()
if Duel.SpecialSummonStep(sc,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+0x1fe0000)
sc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
sc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetValue(0)
e3:SetReset(RESET_EVENT+0x1fe0000)
sc:RegisterEffect(e3,true)
local e4=e3:Clone()
e4:SetCode(EFFECT_SET_DEFENSE_FINAL)
sc:RegisterEffect(e4,true)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e5:SetValue(1)
sc:RegisterEffect(e5,true)
local e6=e5:Clone()
e6:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
sc:RegisterEffect(e6,true)
end
Duel.SpecialSummonComplete()
end
end
function c96227613.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function c96227613.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_SZONE,6) or Duel.CheckLocation(tp,LOCATION_SZONE,7) end
end
function c96227613.penop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_SZONE,6) and not Duel.CheckLocation(tp,LOCATION_SZONE,7) then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
--ダイヤモンドダストン
function c96857854.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_DESTROYED)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1)
e1:SetCondition(c96857854.condition)
e1:SetTarget(c96857854.target)
e1:SetOperation(c96857854.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(96857854,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCost(c96857854.spcost)
e2:SetTarget(c96857854.sptg)
e2:SetOperation(c96857854.spop)
c:RegisterEffect(e2)
end
function c96857854.cfilter(c)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c96857854.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c96857854.cfilter,1,nil)
end
function c96857854.filter(c,e,tp)
return c:IsSetCard(0x80) and (c:IsCanBeSpecialSummoned(e,0,tp,false,false)
or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp))
end
function c96857854.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=eg:GetCount()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)+Duel.GetLocationCount(1-tp,LOCATION_MZONE)
if chk==0 then return (not Duel.IsPlayerAffectedByEffect(tp,59822133) or ct==1) and ft>=ct
and Duel.IsExistingMatchingCard(c96857854.filter,tp,LOCATION_DECK+LOCATION_HAND,0,ct,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ct,tp,LOCATION_DECK+LOCATION_HAND)
end
function c96857854.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=eg:GetCount()
if Duel.IsPlayerAffectedByEffect(tp,59822133) and ct>1 then return end
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
if ft1<=0 and ft2<=0 then return end
if ft1+ft2<ct then return end
local g=Duel.GetMatchingGroup(c96857854.filter,tp,LOCATION_HAND+LOCATION_DECK,0,nil,e,tp)
if ct>g:GetCount() then return end
if ft2>ct then ft2=ct end
local ct2=ct-ft1
local tc=nil
if ft2>0 and (ct2>0 or Duel.SelectYesNo(tp,aux.Stringid(96857854,0))) then
if ct2<=0 then ct2=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=g:FilterSelect(tp,Card.IsCanBeSpecialSummoned,ct2,ft2,nil,e,0,tp,false,false,POS_FACEUP,1-tp)
tc=sg1:GetFirst()
g:Sub(sg1)
ct=ct-sg1:GetCount()
while tc do
Duel.SpecialSummonStep(tc,0,tp,1-tp,false,false,POS_FACEUP)
tc=sg1:GetNext()
end
end
if ct>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=g:Select(tp,ct,ct,nil)
tc=sg2:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
tc=sg2:GetNext()
end
end
Duel.SpecialSummonComplete()
end
function c96857854.spfilter(c)
return c:IsSetCard(0x80) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c96857854.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c96857854.spfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c96857854.spfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c96857854.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,96857854,0,0x11,0,1000,1,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP_DEFENSE,1-tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c96857854.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e)
and Duel.IsPlayerCanSpecialSummonMonster(tp,96857854,0,0x11,0,1000,1,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP_DEFENSE,1-tp) then
c:AddMonsterAttribute(TYPE_NORMAL)
Duel.SpecialSummonStep(c,0,tp,1-tp,true,false,POS_FACEUP_DEFENSE)
c:AddMonsterAttributeComplete()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3,true)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e4,true)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e5,true)
Duel.SpecialSummonComplete()
end
end
--巨大要塞ゼロス
function c975299.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:SetOperation(c975299.activate)
c:RegisterEffect(e1)
--atk/def up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x15))
e2:SetValue(500)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x15))
e4:SetValue(c975299.indval)
c:RegisterEffect(e4)
--cannot be target
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e5:SetRange(LOCATION_FZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x15))
e5:SetValue(aux.tgoval)
c:RegisterEffect(e5)
--spsummon
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(975299,1))
e6:SetCategory(CATEGORY_SPECIAL_SUMMON)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_FZONE)
e6:SetCountLimit(1)
e6:SetTarget(c975299.sptg)
e6:SetOperation(c975299.spop)
c:RegisterEffect(e6)
--counter
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(975299,2))
e7:SetCategory(CATEGORY_COUNTER)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e7:SetCode(EVENT_SUMMON_SUCCESS)
e7:SetRange(LOCATION_FZONE)
e7:SetCondition(c975299.ctcon)
e7:SetTarget(c975299.cttg)
e7:SetOperation(c975299.ctop)
c:RegisterEffect(e7)
local e8=e7:Clone()
e8:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e8)
end
function c975299.thfilter(c)
return c:IsCode(66947414) and c:IsAbleToHand()
end
function c975299.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c975299.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(975299,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 c975299.indval(e,re,rp)
return rp~=e:GetHandlerPlayer()
end
function c975299.spfilter(c,e,tp)
return c:IsSetCard(0x15) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c975299.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c975299.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c975299.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c975299.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 c975299.ctfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x15) and c:IsControler(tp)
end
function c975299.ctcon(e,tp,eg,ep,ev,re,r,rp)
return eg and eg:IsExists(c975299.ctfilter,1,nil,tp)
end
function c975299.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ec=eg:FilterCount(c975299.ctfilter,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,ec,0,0x1f)
end
function c975299.ctop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=eg:Filter(c975299.ctfilter,nil,tp)
local tc=g:GetFirst()
while tc do
tc:AddCounter(0x1f,1)
tc=g:GetNext()
end
end
--幻煌龍の天渦
function c97795930.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c97795930.target)
e1:SetOperation(c97795930.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c97795930.handcon)
c:RegisterEffect(e2)
--destroy replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_GRAVE)
e3:SetTarget(c97795930.reptg)
e3:SetValue(c97795930.repval)
e3:SetOperation(c97795930.repop)
c:RegisterEffect(e3)
end
function c97795930.filter(c)
return c:IsFaceup() and c:IsCode(56649609)
end
function c97795930.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c97795930.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c97795930.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c97795930.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c97795930.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c97795930.wincon)
e1:SetOperation(c97795930.winop)
e1:SetOwnerPlayer(tp)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
function c97795930.winfilter(c)
return c:IsSetCard(0xfa) and c:IsType(TYPE_EQUIP)
end
function c97795930.wincon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetEquipGroup():Filter(c97795930.winfilter,nil)
return aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and g:GetClassCount(Card.GetCode)>2 and c:GetBattleTarget():IsType(TYPE_EFFECT)
and c:GetControler()==e:GetOwnerPlayer()
end
function c97795930.winop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(97795930,RESET_EVENT+0x1fe0000,0,0)
if c:GetFlagEffect(97795930)>2 then
local WIN_REASON_CELESTIAL_WHIRLPOOL=0x1c
Duel.Win(tp,WIN_REASON_CELESTIAL_WHIRLPOOL)
end
end
function c97795930.cfilter(c)
return c:IsFaceup() and c:IsCode(22702055)
end
function c97795930.handcon(e)
return Duel.IsExistingMatchingCard(c97795930.filter,e:GetHandlerPlayer(),LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
or Duel.IsEnvironment(22702055)
end
function c97795930.repfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsLocation(LOCATION_MZONE)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE)
end
function c97795930.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(c97795930.repfilter,1,nil,tp) end
return Duel.SelectYesNo(tp,aux.Stringid(97795930,0))
end
function c97795930.repval(e,c)
return c97795930.repfilter(c,e:GetHandlerPlayer())
end
function c97795930.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
--LL-ターコイズ・ワーブラー
function c97949165.initial_effect(c)
--special summon (self)
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:SetCondition(c97949165.hspcon)
c:RegisterEffect(e1)
--special summon (LL)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(97949165,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetCountLimit(1,97949165)
e2:SetCondition(c97949165.spcon)
e2:SetTarget(c97949165.sptg)
e2:SetOperation(c97949165.spop)
c:RegisterEffect(e2)
end
function c97949165.hspcon(e,c)
if c==nil then return true end
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c97949165.spfilter(c,e,tp)
return c:IsSetCard(0xf7) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c97949165.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function c97949165.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c97949165.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 c97949165.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c97949165.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--決別
function c9852718.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c9852718.condition)
e1:SetCost(c9852718.cost)
e1:SetOperation(c9852718.activate)
c:RegisterEffect(e1)
end
function c9852718.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE)
end
function c9852718.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost()
end
function c9852718.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9852718.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c9852718.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c9852718.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE,1)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
--十二獣の相剋
function c98918572.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--remove overlay replace
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(98918572,0))
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_OVERLAY_REMOVE_REPLACE)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,98918572)
e2:SetCondition(c98918572.rcon)
e2:SetOperation(c98918572.rop)
c:RegisterEffect(e2)
--attach
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(c98918572.xyzcost)
e3:SetTarget(c98918572.xyztg)
e3:SetOperation(c98918572.xyzop)
c:RegisterEffect(e3)
end
function c98918572.rfilter(c,oc)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
and c:CheckRemoveOverlayCard(tp,oc,REASON_COST)
end
function c98918572.rcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return bit.band(r,REASON_COST)~=0 and re:IsHasType(0x7e0)
and re:IsActiveType(TYPE_XYZ) and ep==e:GetOwnerPlayer() and rc:IsSetCard(0xf1)
and Duel.IsExistingMatchingCard(c98918572.rfilter,tp,LOCATION_MZONE,0,1,rc,ev)
end
function c98918572.rop(e,tp,eg,ep,ev,re,r,rp)
local ct=bit.band(ev,0xffff)
local rc=re:GetHandler()
local tg=Duel.SelectMatchingCard(tp,c98918572.rfilter,tp,LOCATION_MZONE,0,1,1,rc,ct)
tg:GetFirst():RemoveOverlayCard(tp,ct,ct,REASON_COST)
end
function c98918572.xyzcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c98918572.xyzfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0xf1)
end
function c98918572.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c98918572.xyzfilter,tp,LOCATION_MZONE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(98918572,1))
local g1=Duel.SelectTarget(tp,c98918572.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil)
e:SetLabelObject(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(98918572,2))
local g2=Duel.SelectTarget(tp,c98918572.xyzfilter,tp,LOCATION_MZONE,0,1,1,g1:GetFirst())
end
function c98918572.xyzop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()~=2 or not e:GetHandler():IsRelateToEffect(e) then return end
local tc=g:GetFirst()
local xc=g:GetNext()
if xc==e:GetLabelObject() then tc,xc=xc,tc end
Duel.Overlay(tc,Group.FromCards(xc))
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