Commit e5968fe2 authored by mercury233's avatar mercury233

new cards SOFU

parent 16243ca8
--転生炎獣の聖域
function c1295111.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--extra material
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1295111,0))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c1295111.linkcon)
e2:SetOperation(c1295111.linkop)
e2:SetValue(SUMMON_TYPE_LINK)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(LOCATION_EXTRA,0)
e3:SetTarget(c1295111.mattg)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--recover
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(1295111,1))
e4:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_RECOVER)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_FZONE)
e4:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e4:SetCountLimit(1,1295111)
e4:SetCondition(c1295111.atkcon)
e4:SetTarget(c1295111.atktg)
e4:SetOperation(c1295111.atkop)
c:RegisterEffect(e4)
end
function c1295111.lmfilter(c,lc)
return c:IsFaceup() and c:IsCanBeLinkMaterial(lc) and c:IsCode(lc:GetCode())
end
function c1295111.linkcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c1295111.lmfilter,tp,LOCATION_MZONE,0,1,nil,c)
and Duel.GetFlagEffect(tp,1295111)==0
end
function c1295111.linkop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.SelectMatchingCard(tp,c1295111.lmfilter,tp,LOCATION_MZONE,0,1,1,nil,c)
c:SetMaterial(mg)
Duel.SendtoGrave(mg,REASON_LINK)
Duel.RegisterFlagEffect(tp,1295111,RESET_PHASE+PHASE_END,0,1)
end
function c1295111.mattg(e,c)
return c:IsSetCard(0x119) and c:IsType(TYPE_LINK)
end
function c1295111.atkcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
if a:IsControler(1-tp) then a=Duel.GetAttackTarget() end
return a
end
function c1295111.atkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK) and not c:IsAttack(0)
end
function c1295111.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c1295111.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c1295111.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c1295111.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
local rec=g:GetFirst():GetBaseAttack()
Duel.SetTargetParam(rec)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
end
function c1295111.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
Duel.Recover(tp,tc:GetBaseAttack(),REASON_EFFECT)
end
end
--超雷龍-サンダー・ドラゴン
function c15291624.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,31786629,aux.FilterBoolFunction(Card.IsRace,RACE_THUNDER),1,true,true)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.fuslimit)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c15291624.spcon)
e2:SetOperation(c15291624.spop)
c:RegisterEffect(e2)
--disable search
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_TO_HAND)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(0,1)
e3:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
c:RegisterEffect(e3)
--destroy replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetTarget(c15291624.reptg)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(15291624,ACTIVITY_CHAIN,c15291624.chainfilter)
end
function c15291624.chainfilter(re,tp,cid)
return not (re:GetHandler():IsRace(RACE_THUNDER) and re:IsActiveType(TYPE_MONSTER)
and Duel.GetChainInfo(cid,CHAININFO_TRIGGERING_LOCATION)==LOCATION_HAND)
end
function c15291624.spfilter(c,fc,tp)
return c:IsRace(RACE_THUNDER) and c:IsType(TYPE_EFFECT) and not c:IsType(TYPE_FUSION)
and c:IsReleasable() and Duel.GetLocationCountFromEx(tp,tp,c,fc)>0
end
function c15291624.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetCustomActivityCount(15291624,tp,ACTIVITY_CHAIN)~=0
and Duel.CheckReleaseGroup(tp,c15291624.spfilter,1,nil,c,tp)
end
function c15291624.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,c15291624.spfilter,1,1,nil,c,tp)
c:SetMaterial(g)
Duel.Release(g,REASON_COST)
end
function c15291624.repfilter(c)
return c:IsRace(RACE_THUNDER) and c:IsAbleToRemove()
end
function c15291624.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
and Duel.IsExistingMatchingCard(c15291624.repfilter,tp,LOCATION_GRAVE,0,1,nil) end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectMatchingCard(tp,c15291624.repfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
return true
else return false end
end
--転生炎獣エメラルド・イーグル
function c16313112.initial_effect(c)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16313112,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c16313112.descon)
e1:SetTarget(c16313112.destg)
e1:SetOperation(c16313112.desop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(c16313112.valcheck)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--eff gain
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16313112,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c16313112.effcost)
e3:SetOperation(c16313112.effop)
c:RegisterEffect(e3)
end
function c16313112.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) and e:GetLabel()==1
end
function c16313112.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSummonType,tp,0,LOCATION_MZONE,1,nil,SUMMON_TYPE_SPECIAL) end
local g=Duel.GetMatchingGroup(Card.IsSummonType,tp,0,LOCATION_MZONE,nil,SUMMON_TYPE_SPECIAL)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c16313112.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsSummonType,tp,0,LOCATION_MZONE,nil,SUMMON_TYPE_SPECIAL)
Duel.Destroy(g,REASON_EFFECT)
end
function c16313112.valfilter(c,tp)
return c:IsCode(16313112) and c:IsLocation(LOCATION_ONFIELD) and c:IsControler(tp)
end
function c16313112.valcheck(e,c)
local g=c:GetMaterial()
local tp=c:GetControler()
if g:IsExists(c16313112.valfilter,1,nil,tp) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
function c16313112.cfilter(c)
return c:IsSetCard(0x119) and c:IsType(TYPE_LINK)
end
function c16313112.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c16313112.cfilter,1,nil) end
local g=Duel.SelectReleaseGroup(tp,c16313112.cfilter,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c16313112.effop(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:SetDescription(aux.Stringid(16313112,2))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_START)
e1:SetCondition(c16313112.descon2)
e1:SetTarget(c16313112.destg2)
e1:SetOperation(c16313112.desop2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c16313112.descon2(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
if d==e:GetHandler() then d=Duel.GetAttacker() end
e:SetLabelObject(d)
return d~=nil
end
function c16313112.destg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local d=e:GetLabelObject()
Duel.SetOperationInfo(0,CATEGORY_DESTROY,d,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,d:GetBaseAttack())
end
function c16313112.desop2(e,tp,eg,ep,ev,re,r,rp)
local d=e:GetLabelObject()
local dam=d:GetBaseAttack()
if d:IsRelateToBattle() and Duel.Destroy(d,REASON_EFFECT)~=0 and dam>0 then
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
end
--光の精霊 ディアーナ
function c17257342.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c17257342.spcon)
e1:SetOperation(c17257342.spop)
c:RegisterEffect(e1)
--recover
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c17257342.reccon)
e2:SetTarget(c17257342.rectg)
e2:SetOperation(c17257342.recop)
c:RegisterEffect(e2)
end
function c17257342.spfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToRemoveAsCost()
end
function c17257342.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c17257342.spfilter,tp,LOCATION_GRAVE,0,1,nil)
end
function c17257342.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c17257342.spfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c17257342.reccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c17257342.rectg(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_RECOVER,nil,0,tp,1000)
end
function c17257342.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
--一色即発
function c17509503.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,17509503+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c17509503.target)
e1:SetOperation(c17509503.activate)
c:RegisterEffect(e1)
end
function c17509503.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c17509503.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c17509503.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c17509503.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(c17509503.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
local ft=math.min(Duel.GetLocationCount(tp,LOCATION_MZONE),g:GetCount(),ct)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,ft,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
--ゴキポール
function c17535764.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17535764,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,17535764)
e1:SetTarget(c17535764.thtg)
e1:SetOperation(c17535764.tgop)
c:RegisterEffect(e1)
end
function c17535764.thfilter(c)
return c:IsLevel(4) and c:IsRace(RACE_INSECT) and c:IsAbleToHand()
end
function c17535764.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17535764.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c17535764.desfilter(c,atk)
return c:IsFaceup() and c:IsAttackAbove(atk)
end
function c17535764.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,c17535764.thfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
if tc:IsType(TYPE_NORMAL) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.SelectYesNo(tp,aux.Stringid(17535764,1)) then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(c17535764.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tc:GetAttack())
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 and g:GetCount()>0
and Duel.SelectYesNo(tp,aux.Stringid(17535764,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tc2=g:Select(tp,1,1,nil)
Duel.Destroy(tc2,REASON_EFFECT)
end
end
end
end
--インヴィンシブル・ヘイロー
function c17722185.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Activate
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e2:SetCountLimit(1)
e2:SetCost(c17722185.cost)
e2:SetOperation(c17722185.operation)
c:RegisterEffect(e2)
end
function c17722185.cfilter(c)
return c:IsFaceup() and c:IsType(0x58020C0) and c:IsAbleToRemoveAsCost()
end
function c17722185.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17722185.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectMatchingCard(tp,c17722185.cfilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
Duel.Remove(tc,POS_FACEUP,REASON_COST)
local flag=0
if tc:IsType(TYPE_RITUAL) then flag=bit.bor(flag,TYPE_RITUAL) end
if tc:IsType(TYPE_FUSION) then flag=bit.bor(flag,TYPE_FUSION) end
if tc:IsType(TYPE_SYNCHRO) then flag=bit.bor(flag,TYPE_SYNCHRO) end
if tc:IsType(TYPE_XYZ) then flag=bit.bor(flag,TYPE_XYZ) end
if tc:IsType(TYPE_PENDULUM) then flag=bit.bor(flag,TYPE_PENDULUM) end
if tc:IsType(TYPE_LINK) then flag=bit.bor(flag,TYPE_LINK) end
e:SetLabel(flag)
end
function c17722185.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local ct=e:GetLabel()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c17722185.distg)
e1:SetLabel(ct)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
function c17722185.distg(e,c)
return c:IsType(e:GetLabel())
end
--雷龍放電
function c18444733.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--inactivatable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_INACTIVATE)
e2:SetRange(LOCATION_SZONE)
e2:SetValue(c18444733.efilter)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(18444733,0))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCondition(c18444733.descon)
e3:SetTarget(c18444733.destg)
e3:SetOperation(c18444733.desop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end
function c18444733.efilter(e,ct)
local p=e:GetHandlerPlayer()
local te,tp=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
return p==tp and te:IsActiveType(TYPE_MONSTER) and te:GetHandler():IsRace(RACE_THUNDER)
end
function c18444733.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x11c) and c:IsControler(tp)
end
function c18444733.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c18444733.cfilter,1,nil,tp)
end
function c18444733.rmfilter(c)
return c:IsRace(RACE_THUNDER) and c:IsAbleToRemove()
end
function c18444733.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsIsOnField() 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)
and Duel.IsExistingMatchingCard(c18444733.rmfilter,tp,LOCATION_DECK,0,1,nil) 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)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c18444733.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c18444733.rmfilter,tp,LOCATION_DECK,0,1,1,nil)
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 and g:GetFirst():IsLocation(LOCATION_REMOVED) and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--魔神儀-ブックストーン
function c18474999.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(18474999,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,18474999)
e1:SetCost(c18474999.spcost)
e1:SetTarget(c18474999.sptg)
e1:SetOperation(c18474999.spop)
c:RegisterEffect(e1)
--effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(18474999,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,18474999)
e2:SetCondition(c18474999.thcon)
e2:SetTarget(c18474999.thtg)
e2:SetOperation(c18474999.thop)
c:RegisterEffect(e2)
--spsummon limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(c18474999.sumlimit)
c:RegisterEffect(e3)
end
function c18474999.filter(c,e,tp)
return c:IsSetCard(0x117) and not c:IsCode(18474999) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c18474999.costfilter(c)
return bit.band(c:GetType(),0x82)==0x82 and not c:IsPublic()
end
function c18474999.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c18474999.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c18474999.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function c18474999.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c18474999.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function c18474999.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c18474999.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
g:AddCard(e:GetHandler())
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c18474999.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK)
end
function c18474999.thfilter(c)
return bit.band(c:GetType(),0x82)==0x82 and c:IsAbleToHand()
end
function c18474999.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c18474999.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c18474999.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c18474999.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c18474999.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c18474999.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsLocation(LOCATION_EXTRA)
end
--雷源龍-サンダー・ドラゴン
function c20318029.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(20318029,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(TIMING_DAMAGE_STEP+TIMING_END_PHASE)
e1:SetCountLimit(1,20318029)
e1:SetCondition(c20318029.atkcon)
e1:SetCost(c20318029.atkcost)
e1:SetTarget(c20318029.atktg)
e1:SetOperation(c20318029.atkop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(20318029,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,20318029)
e2:SetTarget(c20318029.thtg)
e2:SetOperation(c20318029.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c20318029.thcon)
c:RegisterEffect(e3)
end
function c20318029.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c20318029.atkcost(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 c20318029.atkfilter(c)
return c:IsFaceup() and c:IsRace(RACE_THUNDER)
end
function c20318029.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c20318029.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c20318029.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c20318029.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c20318029.atkop(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function c20318029.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c20318029.thfilter(c)
return c:IsCode(20318029) and c:IsAbleToHand()
end
function c20318029.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20318029.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c20318029.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c20318029.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 c20501450.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
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(c20501450.condition)
e1:SetCost(c20501450.cost)
e1:SetTarget(c20501450.target)
e1:SetOperation(c20501450.activate)
c:RegisterEffect(e1)
if not c20501450.global_check then
c20501450.global_check=true
c20501450[0]=0
c20501450[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetOperation(c20501450.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c20501450.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c20501450.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:GetFlagEffect(20501450)==0 then
c20501450[ep]=c20501450[ep]+1
tc:RegisterFlagEffect(20501450,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function c20501450.clear(e,tp,eg,ep,ev,re,r,rp)
c20501450[0]=0
c20501450[1]=0
end
function c20501450.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c20501450.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c20501450[tp]<2 end
end
function c20501450.filter(c,tp)
return c:IsFaceup() and c:IsDefenseAbove(1) and (c20501450[tp]==0 or c:GetFlagEffect(20501450)~=0)
end
function c20501450.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and c20501450.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c20501450.filter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c20501450.filter,tp,LOCATION_MZONE,0,1,1,nil,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c20501450.ftarget)
e1:SetLabel(g:GetFirst():GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c20501450.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c20501450.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(tc:GetDefense())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--転生炎獣ファルコ
function c20618081.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(20618081,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,20618081)
e1:SetTarget(c20618081.settg)
e1:SetOperation(c20618081.setop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(20618081,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,20618081)
e2:SetTarget(c20618081.sptg)
e2:SetOperation(c20618081.spop)
c:RegisterEffect(e2)
end
function c20618081.filter(c)
return c:IsSetCard(0x119) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c20618081.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c20618081.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c20618081.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,c20618081.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function c20618081.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsSSetable() then
Duel.SSet(tp,tc)
Duel.ConfirmCards(1-tp,tc)
end
end
function c20618081.thfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x119) and not c:IsCode(20618081) and c:IsAbleToHand() and Duel.GetMZoneCount(tp,c)
end
function c20618081.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c20618081.thfilter(chkc,tp) end
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c20618081.thfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c20618081.thfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c20618081.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--サラマングレイト・ギフト
function c20788863.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--draw (to grave)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(20788863,0))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,20788863)
e2:SetCost(c20788863.cost)
e2:SetTarget(c20788863.drtg1)
e2:SetOperation(c20788863.drop1)
c:RegisterEffect(e2)
--draw (link)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(20788863,1))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,20788863)
e3:SetCondition(c20788863.drcon)
e3:SetCost(c20788863.cost)
e3:SetTarget(c20788863.drtg2)
e3:SetOperation(c20788863.drop2)
c:RegisterEffect(e3)
end
function c20788863.cfilter(c)
return c:IsSetCard(0x119) and c:IsType(TYPE_MONSTER) and c:IsDiscardable()
end
function c20788863.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20788863.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c20788863.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c20788863.filter(c)
return c:IsSetCard(0x119) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c20788863.drtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingMatchingCard(c20788863.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c20788863.drop1(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c20788863.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 and g:GetFirst():IsLocation(LOCATION_GRAVE) then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c20788863.lfilter(c)
if not c:IsSummonType(SUMMON_TYPE_LINK) then return false end
local mat=c:GetMaterial()
return c:IsFaceup() and c:IsSetCard(0x119) and mat:IsExists(Card.IsLinkCode,1,nil,c:GetCode())
end
function c20788863.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c20788863.lfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c20788863.drtg2(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 c20788863.drop2(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.Draw(p,d,REASON_EFFECT)
end
--オルフェゴール・スケルツォン
function c21441617.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21441617,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,21441617)
e1:SetCost(aux.bfgcost)
e1:SetCondition(c21441617.spcon1)
e1:SetTarget(c21441617.sptg)
e1:SetOperation(c21441617.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCondition(c21441617.spcon2)
c:RegisterEffect(e2)
end
function c21441617.spcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,90351981)
end
function c21441617.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,90351981)
end
function c21441617.spfilter(c,e,tp)
return c:IsSetCard(0x11b) and not c:IsCode(21441617) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c21441617.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c21441617.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c21441617.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c21441617.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c21441617.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c21441617.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c21441617.splimit(e,c)
return not c:IsAttribute(ATTRIBUTE_DARK)
end
--閃刀術式-ベクタードブラスト
function c21623008.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c21623008.condition)
e1:SetTarget(c21623008.target)
e1:SetOperation(c21623008.operation)
c:RegisterEffect(e1)
end
function c21623008.cfilter(c)
return c:GetSequence()<5
end
function c21623008.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c21623008.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c21623008.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,2) and Duel.IsPlayerCanDiscardDeck(1-tp,2) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,0,0,PLAYER_ALL,2)
if Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3 then
e:SetCategory(CATEGORY_DECKDES+CATEGORY_TOEXTRA)
end
end
function c21623008.filter(c,tp)
return c:GetSequence()>=5 and c:IsControler(1-tp) and c:IsAbleToDeck()
end
function c21623008.operation(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetDecktopGroup(tp,2)
local g2=Duel.GetDecktopGroup(1-tp,2)
g1:Merge(g2)
if Duel.SendtoGrave(g1,REASON_EFFECT)~=0
and Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3
and Duel.IsExistingMatchingCard(c21623008.filter,tp,0,LOCATION_MZONE,1,nil,tp)
and Duel.SelectYesNo(tp,aux.Stringid(21623008,0)) then
local g=Duel.GetMatchingGroup(c21623008.filter,tp,0,LOCATION_MZONE,nil,tp)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end
--墓守の神職
function c21663205.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21663205,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,21663205)
e1:SetTarget(c21663205.sptg)
e1:SetOperation(c21663205.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--immune to necro valley
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_NECRO_VALLEY_IM)
c:RegisterEffect(e4)
end
function c21663205.filter(c,e,tp)
return c:IsLevel(4) and c:IsSetCard(0x2e) and (c:IsCanBeSpecialSummoned(e,0,tp,false,false)
or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE))
end
function c21663205.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c21663205.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c21663205.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c21663205.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c21663205.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local spos=0
if tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) then spos=spos+POS_FACEUP_ATTACK end
if tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) then spos=spos+POS_FACEDOWN_DEFENSE end
if spos~=0 then Duel.SpecialSummon(tc,0,tp,tp,false,false,spos) end
end
end
--クロック・ワイバーン
function c21830679.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21830679,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,21830679)
e1:SetTarget(c21830679.target)
e1:SetOperation(c21830679.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function c21830679.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,21830680,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_WIND) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0)
end
function c21830679.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and not c:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(math.ceil(c:GetAttack()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
if not c:IsHasEffect(EFFECT_REVERSE_UPDATE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,21830680,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_WIND) then
local token=Duel.CreateToken(tp,21830680)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--竜絶蘭
function c2411269.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.NOT(aux.FilterBoolFunction(Card.IsLinkType,TYPE_TOKEN)),2)
--apply effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(2411269,0))
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_RECOVER+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,2411269)
e1:SetCondition(c2411269.condition)
e1:SetTarget(c2411269.target)
e1:SetOperation(c2411269.operation)
c:RegisterEffect(e1)
end
function c2411269.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c2411269.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsRace,tp,LOCATION_GRAVE,0,nil,RACE_DRAGON+RACE_DINOSAUR+RACE_SEASERPENT+RACE_WYRM)
if chk==0 then return #g>0 and (g:FilterCount(Card.IsRace,nil,RACE_SEASERPENT)<#g or Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil)) end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:FilterCount(Card.IsRace,nil,RACE_DRAGON)*100)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:FilterCount(Card.IsRace,nil,RACE_WYRM)*400)
end
function c2411269.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsRace,tp,LOCATION_GRAVE,0,nil,RACE_DRAGON+RACE_DINOSAUR+RACE_SEASERPENT+RACE_WYRM)
if #g==0 then return end
local c=e:GetHandler()
local ct1=g:FilterCount(Card.IsRace,nil,RACE_DRAGON)
local ct2=g:FilterCount(Card.IsRace,nil,RACE_DINOSAUR)
local ct3=g:FilterCount(Card.IsRace,nil,RACE_SEASERPENT)
local ct4=g:FilterCount(Card.IsRace,nil,RACE_WYRM)
if ct1>0 then
Duel.Damage(1-tp,ct1*100,REASON_EFFECT)
end
if ct2>0 and c:IsFaceup() and c:IsRelateToEffect(e) then
if ct1>0 then Duel.BreakEffect() end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct2*200)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
local og=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if ct3>0 and #og>0 then
if ct1>0 or ct2>0 then Duel.BreakEffect() end
for tc in aux.Next(og) do
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(ct3*-300)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
if ct4>0 then
if ct1>0 or ct2>0 or ct3>0 then Duel.BreakEffect() end
Duel.Recover(tp,ct4*400,REASON_EFFECT)
end
end
--オルフェゴール・プライム
function c26845680.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,26845680+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c26845680.cost)
e1:SetTarget(c26845680.target)
e1:SetOperation(c26845680.activate)
c:RegisterEffect(e1)
end
function c26845680.costfilter(c)
return (c:IsSetCard(0xfe) or c:IsSetCard(0x11b)) and c:IsType(TYPE_MONSTER) and (c:IsFaceup() or not c:IsLocation(LOCATION_MZONE)) and c:IsAbleToGraveAsCost()
end
function c26845680.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c26845680.costfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c26845680.costfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c26845680.target(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 c26845680.activate(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 c28770951.initial_effect(c)
--material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(28770951,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,28770951)
e1:SetTarget(c28770951.mattg)
e1:SetOperation(c28770951.matop)
c:RegisterEffect(e1)
--shuffle & draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(28770951,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,28770951)
e2:SetTarget(c28770951.drtg)
e2:SetOperation(c28770951.drop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c28770951.matfilter(c)
return c:IsFaceup() and (c:IsSetCard(0x55) or c:IsSetCard(0x7b)) and c:IsType(TYPE_XYZ)
end
function c28770951.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c28770951.matfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c28770951.matfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c28770951.matfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c28770951.matop(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 not tc:IsImmuneToEffect(e) then
Duel.Overlay(tc,Group.FromCards(c))
end
end
function c28770951.filter(c,e)
return (c:IsSetCard(0x55) or c:IsSetCard(0x7b)) and c:IsAbleToDeck() and c:IsCanBeEffectTarget(e)
end
function c28770951.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c28770951.filter(chkc,e) end
local g=Duel.GetMatchingGroup(c28770951.filter,tp,LOCATION_GRAVE,0,nil,e)
if chk==0 then return g:GetClassCount(Card.GetCode)>=5 and Duel.IsPlayerCanDraw(tp,2) end
local sg=Group.CreateGroup()
for i=1,5 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc then
sg:AddCard(tc)
g:Remove(Card.IsCode,nil,tc:GetCode())
end
end
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,sg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c28770951.drop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=5 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,2,REASON_EFFECT)
end
end
--雷獣龍-サンダー・ドラゴン
function c29596581.initial_effect(c)
--recycle
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29596581,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,29596581)
e1:SetCost(c29596581.cost)
e1:SetTarget(c29596581.target)
e1:SetOperation(c29596581.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29596581,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,29596581)
e2:SetTarget(c29596581.sptg)
e2:SetOperation(c29596581.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c29596581.spcon)
c:RegisterEffect(e3)
end
function c29596581.cost(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 c29596581.filter(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(0x11c) and not c:IsCode(29596581) and c:IsAbleToHand()
end
function c29596581.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c29596581.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c29596581.operation(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29596581.filter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c29596581.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c29596581.spfilter(c,e,tp)
return c:IsSetCard(0x11c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c29596581.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c29596581.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c29596581.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 tc=Duel.SelectMatchingCard(tp,c29596581.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(29596581,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c29596581.thcon)
e1:SetOperation(c29596581.thop)
Duel.RegisterEffect(e1,tp)
end
end
function c29596581.thcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(29596581)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c29596581.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetLabelObject(),nil,REASON_EFFECT)
end
--オルフェゴール・アタック
function c29666221.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCost(c29666221.cost)
e1:SetTarget(c29666221.target)
e1:SetOperation(c29666221.activate)
c:RegisterEffect(e1)
end
function c29666221.cfilter(c)
return c:IsSetCard(0xfe) or c:IsSetCard(0x11b)
end
function c29666221.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c29666221.cfilter,1,nil) end
local g=Duel.SelectReleaseGroup(tp,c29666221.cfilter,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c29666221.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c29666221.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--ダイナレスラー・カポエラプトル
function c29996433.initial_effect(c)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetCondition(c29996433.indcon)
c:RegisterEffect(e1)
--position
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetCondition(c29996433.poscon)
e2:SetOperation(c29996433.posop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29996433,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,29996433)
e3:SetCondition(c29996433.spcon)
e3:SetTarget(c29996433.sptg)
e3:SetOperation(c29996433.spop)
c:RegisterEffect(e3)
end
function c29996433.indcon(e)
return e:GetHandler():IsAttackPos()
end
function c29996433.poscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttackTarget() and e:GetHandler():IsRelateToBattle()
end
function c29996433.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAttackPos() then
Duel.ChangePosition(c,POS_FACEUP_DEFENSE)
end
end
function c29996433.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsDefensePos()
end
function c29996433.spfilter(c,e,tp)
return c:IsCode(29996433) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c29996433.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c29996433.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c29996433.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,c29996433.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 c30741503.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2,c30741503.lcheck)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetCondition(c30741503.indcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--todeck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(30741503,0))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,30741503)
e2:SetCondition(c30741503.tdcon1)
e2:SetTarget(c30741503.tdtg)
e2:SetOperation(c30741503.tdop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCondition(c30741503.tdcon2)
c:RegisterEffect(e3)
end
function c30741503.lcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x11b)
end
function c30741503.indcon(e)
return e:GetHandler():IsLinkState()
end
function c30741503.tdcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,90351981)
end
function c30741503.tdcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,90351981)
end
function c30741503.tdfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAbleToDeck()
end
function c30741503.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c30741503.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c30741503.tdfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c30741503.tdfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c30741503.setfilter(c)
return c:IsSetCard(0x11b) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c30741503.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then
local g=Duel.GetMatchingGroup(c30741503.setfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(30741503,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sg=g:Select(tp,1,1,nil)
Duel.SSet(tp,sg)
Duel.ConfirmCards(1-tp,sg)
end
end
end
--オルフェゴール・オーケストリオン
function c3134857.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,99,c3134857.lcheck)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetCondition(c3134857.indcon)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
--todeck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(3134857,0))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,3134857)
e3:SetCondition(c3134857.tdcon1)
e3:SetTarget(c3134857.tdtg)
e3:SetOperation(c3134857.tdop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP+TIMINGS_CHECK_MONSTER)
e4:SetCondition(c3134857.tdcon2)
c:RegisterEffect(e4)
end
function c3134857.lcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x11b)
end
function c3134857.indcon(e)
return e:GetHandler():IsLinkState()
end
function c3134857.tdcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,90351981)
end
function c3134857.tdcon2(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()) and Duel.IsPlayerAffectedByEffect(tp,90351981)
end
function c3134857.tdfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAbleToDeck()
end
function c3134857.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c3134857.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c3134857.tdfilter,tp,LOCATION_REMOVED,0,3,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c3134857.tdfilter,tp,LOCATION_REMOVED,0,3,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,3,0,0)
end
function c3134857.atkfilter(c)
return c:IsLinkState() and c:IsFaceup()
end
function c3134857.tdop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 and Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)~=0 and tg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) then
local g=Duel.GetMatchingGroup(c3134857.atkfilter,tp,0,LOCATION_MZONE,nil)
local c=e:GetHandler()
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(0)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_DISABLE_EFFECT)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4)
tc=g:GetNext()
end
end
end
--銀河眼の煌星竜
function c3356494.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkAttribute,ATTRIBUTE_LIGHT),2,2,c3356494.lcheck)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(3356494,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,3356494)
e1:SetCondition(c3356494.thcon)
e1:SetTarget(c3356494.thtg)
e1:SetOperation(c3356494.thop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(3356494,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,3356495)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(c3356494.descon)
e2:SetCost(c3356494.descost)
e2:SetTarget(c3356494.destg)
e2:SetOperation(c3356494.desop)
c:RegisterEffect(e2)
end
function c3356494.lcheck(g,lc)
return g:IsExists(Card.IsAttackAbove,1,nil,2000)
end
function c3356494.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c3356494.thfilter(c)
return (c:IsSetCard(0x55) or c:IsSetCard(0x7b)) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c3356494.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c3356494.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c3356494.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c3356494.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c3356494.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c3356494.descon(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 c3356494.cfilter1(c)
return c:IsCode(93717133) and c:IsDiscardable()
end
function c3356494.cfilter2(c)
return (c:IsSetCard(0x55) or c:IsSetCard(0x7b)) and c:IsDiscardable()
end
function c3356494.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c3356494.cfilter1,tp,LOCATION_HAND,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c3356494.cfilter2,tp,LOCATION_HAND,0,2,nil)
if chk==0 then return b1 or b2 end
if b1 and (not b2 or Duel.SelectYesNo(tp,aux.Stringid(3356494,2))) then
Duel.DiscardHand(tp,c3356494.cfilter1,1,1,REASON_COST+REASON_DISCARD,nil)
else
Duel.DiscardHand(tp,c3356494.cfilter2,2,2,REASON_COST+REASON_DISCARD,nil)
end
end
function c3356494.destg(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:IsSummonType(SUMMON_TYPE_SPECIAL) end
if chk==0 then return Duel.IsExistingTarget(Card.IsSummonType,tp,0,LOCATION_MZONE,1,nil,SUMMON_TYPE_SPECIAL) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsSummonType,tp,0,LOCATION_MZONE,1,1,nil,SUMMON_TYPE_SPECIAL)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c3356494.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 c37561138.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,37561138+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c37561138.target)
e1:SetOperation(c37561138.activate)
c:RegisterEffect(e1)
end
function c37561138.thfilter(c)
return c:IsSetCard(0x2e) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c37561138.filter(c)
return c:IsSetCard(0x2e) and c:IsSummonable(true,nil)
end
function c37561138.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c37561138.thfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c37561138.filter,tp,LOCATION_HAND,0,1,nil)
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(37561138,0),aux.Stringid(37561138,1))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(37561138,0))
else
op=Duel.SelectOption(tp,aux.Stringid(37561138,1))+1
end
e:SetLabel(op)
if op==0 then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
else
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
end
function c37561138.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c37561138.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
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c37561138.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
end
--常夏のカミナリサマー
function c38406364.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_THUNDER),2,2)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetDescription(aux.Stringid(38406364,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c38406364.spcon)
e1:SetCost(c38406364.spcost)
e1:SetTarget(c38406364.sptg)
e1:SetOperation(c38406364.spop)
c:RegisterEffect(e1)
end
function c38406364.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c38406364.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c38406364.filter(c,e,tp,zone)
return c:IsRace(RACE_THUNDER) and not c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c38406364.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=bit.band(e:GetHandler():GetLinkedZone(tp),0x1f)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c38406364.filter(chkc,e,tp,zone) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c38406364.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c38406364.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,zone)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c38406364.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local zone=bit.band(e:GetHandler():GetLinkedZone(tp),0x1f)
if tc:IsRelateToEffect(e) and zone~=0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)
end
end
--転生炎獣の降臨
function c38784726.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:SetTarget(c38784726.target)
e1:SetOperation(c38784726.activate)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c38784726.spcon)
e2:SetTarget(c38784726.sptg)
e2:SetOperation(c38784726.spop)
c:RegisterEffect(e2)
end
c38784726.fit_monster={1613112}
function c38784726.filter(c,e,tp,m,m2,ft)
if not c:IsSetCard(0x119) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
mg:Merge(m2)
if ft>0 then
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
else
return mg:IsExists(c38784726.filterF,1,nil,tp,mg,c)
end
end
function c38784726.filterF(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end
function c38784726.mfilter(c)
return c:GetLevel()>0 and c:IsSetCard(0x119) and c:IsAbleToDeck()
end
function c38784726.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK) and c:IsAttribute(ATTRIBUTE_FIRE)
end
function c38784726.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
local mg2=Group.CreateGroup()
if Duel.IsExistingMatchingCard(c38784726.cfilter,tp,LOCATION_MZONE,0,1,nil) then
mg2=Duel.GetMatchingGroup(c38784726.mfilter,tp,LOCATION_GRAVE,0,nil)
end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(c38784726.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,mg2,ft)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c38784726.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp)
local mg2=Group.CreateGroup()
if Duel.IsExistingMatchingCard(c38784726.cfilter,tp,LOCATION_MZONE,0,1,nil) then
mg2=Duel.GetMatchingGroup(c38784726.mfilter,tp,LOCATION_GRAVE,0,nil)
end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c38784726.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,mg2,ft)
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
mg:Merge(mg2)
local mat=nil
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,c38784726.filterF,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
mat:Merge(mat2)
end
tc:SetMaterial(mat)
local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
mat:Sub(mat2)
Duel.ReleaseRitualMaterial(mat)
Duel.SendtoDeck(mat2,nil,2,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c38784726.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp
end
function c38784726.spfilter(c,e,tp)
return c:IsCode(1613112) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c38784726.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c38784726.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c38784726.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,c38784726.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
--ヴェルスパーダ・パラディオン
function c39528955.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,99,c39528955.matcheck)
--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(c39528955.atkval)
c:RegisterEffect(e1)
--cannot attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c39528955.atklimit)
c:RegisterEffect(e2)
--move
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(39528955,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c39528955.seqcon)
e3:SetTarget(c39528955.seqtg)
e3:SetOperation(c39528955.seqop)
c:RegisterEffect(e3)
end
function c39528955.matcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x116)
end
function c39528955.atkval(e,c)
local g=e:GetHandler():GetLinkedGroup():Filter(Card.IsFaceup,nil)
return g:GetSum(Card.GetBaseAttack)
end
function c39528955.atklimit(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function c39528955.seqcfilter(c,tp,lg)
return c:IsType(TYPE_EFFECT) and lg:IsContains(c)
end
function c39528955.seqcon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup()
return eg:IsExists(c39528955.seqcfilter,1,nil,tp,lg)
end
function c39528955.seqfilter(c)
local tp=c:GetControler()
return c:IsFaceup() and c:GetSequence()<5 and Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)>0
end
function c39528955.seqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c39528955.seqfilter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(c39528955.seqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(39528955,1))
Duel.SelectTarget(tp,c39528955.seqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c)
end
function c39528955.seqop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local ttp=tc:GetControler()
if not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) or Duel.GetLocationCount(ttp,LOCATION_MZONE,ttp,LOCATION_REASON_CONTROL)<=0 then return end
local p1,p2
if tc:IsControler(tp) then
p1=LOCATION_MZONE
p2=0
else
p1=0
p2=LOCATION_MZONE
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local seq=math.log(Duel.SelectDisableField(tp,1,p1,p2,0),2)
if tc:IsControler(1-tp) then seq=seq-16 end
Duel.MoveSequence(tc,seq)
end
--転生炎獣ヒートライオ
function c41463181.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c41463181.matfilter,2)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(41463181,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCondition(c41463181.tdcon)
e1:SetTarget(c41463181.tdtg)
e1:SetOperation(c41463181.tdop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c41463181.condition)
e2:SetOperation(c41463181.operation)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_MATERIAL_CHECK)
e3:SetValue(c41463181.valcheck)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c41463181.matfilter(c)
return c:IsLinkType(TYPE_EFFECT) and c:IsLinkAttribute(ATTRIBUTE_FIRE)
end
function c41463181.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c41463181.tdfilter(c)
return c:GetSequence()<5 and c:IsAbleToDeck()
end
function c41463181.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c41463181.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c41463181.tdfilter,tp,0,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c41463181.tdfilter,tp,0,LOCATION_SZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c41463181.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 c41463181.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and e:GetLabel()==1
end
function c41463181.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(41463181,1))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c41463181.atktg)
e1:SetOperation(c41463181.atkop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
function c41463181.atkfilter1(c,tp)
return c:IsFaceup() and Duel.IsExistingTarget(c41463181.atkfilter2,tp,LOCATION_GRAVE,0,1,nil,c)
end
function c41463181.atkfilter2(c,tc)
return c:IsType(TYPE_MONSTER) and c:GetAttack()~=tc:GetAttack()
end
function c41463181.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c41463181.atkfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c41463181.atkfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
e:SetLabelObject(g:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c41463181.atkfilter2,tp,LOCATION_GRAVE,0,1,1,nil,g:GetFirst())
end
function c41463181.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sc=g:GetFirst()
if sc==tc then sc=g:GetNext() end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or not sc:IsRelateToEffect(e) then return end
local ac=e:GetLabelObject()
if tc==ac then tc=sc end
local atk=tc:GetAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ac:RegisterEffect(e1)
end
function c41463181.valcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(Card.IsLinkCode,1,nil,41463181) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
--雷神龍-サンダー・ドラゴン
function c41685633.initial_effect(c)
--fusion summon
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x11c),3,true)
--special summon 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)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c41685633.sprcon)
e2:SetOperation(c41685633.sprop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(41685633,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c41685633.descon)
e3:SetTarget(c41685633.destg)
e3:SetOperation(c41685633.desop)
c:RegisterEffect(e3)
--destroy replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetTarget(c41685633.desreptg)
c:RegisterEffect(e4)
end
function c41685633.sprfilter1(c)
return c:IsRace(RACE_THUNDER) and c:IsAbleToRemoveAsCost()
end
function c41685633.sprfilter2(c,tp,sc)
return c:IsRace(RACE_THUNDER) and c:IsType(TYPE_FUSION) and not c:IsCode(41685633) and c:IsAbleToRemoveAsCost() and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0
end
function c41685633.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c41685633.sprfilter1,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c41685633.sprfilter2,tp,LOCATION_MZONE,0,1,nil,tp,c)
end
function c41685633.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c41685633.sprfilter1,tp,LOCATION_HAND,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c41685633.sprfilter2,tp,LOCATION_MZONE,0,1,1,nil,tp,c)
g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
end
function c41685633.descon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return bit.band(loc,LOCATION_HAND)~=0 and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsRace(RACE_THUNDER)
end
function c41685633.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c41685633.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
end
function c41685633.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_EFFECT)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,0,2,nil) end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
return true
else return false end
end
--サイバース・クロック・ドラゴン
function c42717221.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFunRep(c,21830679,aux.FilterBoolFunction(Card.IsFusionType,TYPE_LINK),1,63,true,true)
--mill + atk
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(42717221,0))
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c42717221.atkcon)
e1:SetTarget(c42717221.atktg)
e1:SetOperation(c42717221.atkop)
c:RegisterEffect(e1)
--target/atk protection
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetCondition(c42717221.atcon)
e2:SetValue(c42717221.atlimit)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(c42717221.atcon)
e3:SetTarget(c42717221.tglimit)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(42717221,1))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c42717221.thcon)
e4:SetTarget(c42717221.thtg)
e4:SetOperation(c42717221.thop)
c:RegisterEffect(e4)
end
function c42717221.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c42717221.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=e:GetHandler():GetMaterial():Filter(Card.IsType,nil,TYPE_LINK)
local ct=0
for tc in aux.Next(mg) do
ct=ct+tc:GetLink()
end
if chk==0 then return ct>0 and Duel.IsPlayerCanDiscardDeck(tp,ct) end
e:SetLabel(ct)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,ct)
end
function c42717221.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.DiscardDeck(tp,e:GetLabel(),REASON_EFFECT)~=0 then
local ct=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_GRAVE):GetCount()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c42717221.ftarget)
e1:SetLabel(c:GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if ct>0 and c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct*1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e1)
end
end
end
function c42717221.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c42717221.atcon(e)
return Duel.IsExistingMatchingCard(Card.IsType,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil,TYPE_LINK)
end
function c42717221.atlimit(e,c)
return c~=e:GetHandler()
end
function c42717221.tglimit(e,c)
return c~=e:GetHandler()
end
function c42717221.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsSummonType(SUMMON_TYPE_FUSION) and c:GetPreviousControler()==tp
end
function c42717221.thfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c42717221.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c42717221.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c42717221.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c42717221.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 c43534808.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(43534808,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,43534808)
e1:SetCondition(c43534808.spcon)
e1:SetTarget(c43534808.sptg)
e1:SetOperation(c43534808.spop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(43534808,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c43534808.destg)
e2:SetOperation(c43534808.desop)
c:RegisterEffect(e2)
--can't spsummon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetTarget(c43534808.sumlimit)
c:RegisterEffect(e3)
end
function c43534808.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsType,1,nil,TYPE_TOKEN)
end
function c43534808.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 c43534808.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c43534808.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_MZONE,LOCATION_MZONE,nil,TYPE_TOKEN)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c43534808.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_MZONE,LOCATION_MZONE,nil,TYPE_TOKEN)
local ct=Duel.Destroy(sg,REASON_EFFECT)
if ct>0 and c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct*400)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c43534808.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsType(TYPE_TOKEN)
end
--素早きは三文の徳
function c43994202.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,43994202)
e1:SetCondition(c43994202.condition)
e1:SetTarget(c43994202.target)
e1:SetOperation(c43994202.activate)
c:RegisterEffect(e1)
end
function c43994202.cfilter(c)
return c:IsFaceup() and not c:IsType(TYPE_TOKEN)
end
function c43994202.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
return #g==3 and g:FilterCount(c43994202.cfilter,nil)==3
and g:GetClassCount(Card.GetCode)==1
end
function c43994202.filter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
and Duel.IsExistingMatchingCard(c43994202.filter2,tp,LOCATION_DECK,0,2,c,c:GetCode())
end
function c43994202.filter2(c,code)
return c:IsType(TYPE_MONSTER) and c:IsCode(code) and c:IsAbleToHand()
end
function c43994202.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c43994202.filter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,3,tp,LOCATION_DECK)
end
function c43994202.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=Duel.SelectMatchingCard(tp,c43994202.filter,tp,LOCATION_DECK,1,1,nil,tp)
if g1:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,c43994202.filter2,tp,LOCATION_DECK,2,2,g1,g1:GetFirst():GetCode())
g1:Merge(g2)
if Duel.SendtoHand(g1,nil,REASON_EFFECT)>0 then
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local tc=sg:GetFirst()
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetCode(EFFECT_CANNOT_ACTIVATE)
e0:SetTargetRange(1,0)
e0:SetValue(c43994202.aclimit)
e0:SetLabelObject(tc)
e0:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e0,tp)
local e1=e0:Clone()
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTarget(c43994202.splimit)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SET)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e33,tp)
end
end
function c43994202.aclimit(e,re,tp)
local tc=e:GetLabelObject()
return re:GetHandler():IsCode(tc:GetCode()) and re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsImmuneToEffect(e)
end
function c43994202.splimit(e,c,sump,sumtype,sumpos,targetp)
local tc=e:GetLabelObject()
return not c:IsCode(tc:GetCode())
end
--失楽の魔女
function c44656450.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(44656450,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,44656450)
e1:SetTarget(c44656450.thtg)
e1:SetOperation(c44656450.thop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(44656450,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,44656451)
e2:SetCondition(c44656450.spcon)
e2:SetCost(c44656450.spcost)
e2:SetTarget(c44656450.sptg)
e2:SetOperation(c44656450.spop)
c:RegisterEffect(e2)
end
function c44656450.thfilter(c)
return c:IsSetCard(0x11d) and c:IsType(TYPE_QUICKPLAY) and c:IsAbleToHand()
end
function c44656450.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c44656450.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function c44656450.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c44656450.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 c44656450.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c44656450.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c44656450.spfilter(c,e,tp)
return c:IsLevel(4) and c:IsRace(RACE_FAIRY) and not c:IsCode(44656450) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c44656450.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(c44656450.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c44656450.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,c44656450.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 c44716890.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--attack cost
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ATTACK_COST)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetCost(c44716890.atcost)
e2:SetOperation(c44716890.atop)
c:RegisterEffect(e2)
end
function c44716890.atcost(e,c,tp)
return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil)
end
function c44716890.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
--クロック・スパルトイ
function c4478086.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_CYBERSE),2,2)
c:EnableReviveLimit()
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(4478086,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,4478086)
e1:SetCondition(c4478086.thcon)
e1:SetTarget(c4478086.thtg)
e1:SetOperation(c4478086.thop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(4478086,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,4478087)
e2:SetCondition(c4478086.spcon)
e2:SetTarget(c4478086.sptg)
e2:SetOperation(c4478086.spop)
c:RegisterEffect(e2)
end
function c4478086.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c4478086.thfilter(c)
return c:IsCode(65801012) and c:IsAbleToHand()
end
function c4478086.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c4478086.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c4478086.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c4478086.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 c4478086.cfilter(c,lg)
return lg:IsContains(c)
end
function c4478086.spcon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup()
return eg:IsExists(c4478086.cfilter,1,nil,lg)
end
function c4478086.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c4478086.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c4478086.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c4478086.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c4478086.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c4478086.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(c4478086.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c4478086.splimit(e,c)
return not c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_EXTRA)
end
--オルフェゴール・コア
function c55051920.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(55051920,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetCost(c55051920.tgcost)
e2:SetTarget(c55051920.tgtg)
e2:SetOperation(c55051920.tgop)
c:RegisterEffect(e2)
--replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_SZONE)
e3:SetTarget(c55051920.reptg)
e3:SetValue(c55051920.repval)
e3:SetOperation(c55051920.repop)
c:RegisterEffect(e3)
end
function c55051920.costfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
and Duel.IsExistingTarget(c55051920.tgfilter,tp,LOCATION_ONFIELD,0,1,c)
end
function c55051920.tgfilter(c)
return c:IsFaceup() and (c:IsSetCard(0xfe) or c:IsSetCard(0x11b)) and not c:IsCode(55051920)
end
function c55051920.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c55051920.costfilter,tp,LOCATION_GRAVE+LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local cg=Duel.SelectMatchingCard(tp,c55051920.costfilter,tp,LOCATION_GRAVE+LOCATION_MZONE,0,1,1,nil,tp)
Duel.Remove(cg,POS_FACEUP,REASON_COST)
end
function c55051920.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c55051920.tgfilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c55051920.tgfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
end
function c55051920.tgop(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)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c55051920.repfilter(c,tp)
return c:IsFaceup() and (c:IsSetCard(0xfe) or c:IsSetCard(0x11b)) and c:IsControler(tp) and c:IsOnField()
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c55051920.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c55051920.repfilter,1,e:GetHandler(),tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c55051920.repval(e,c)
return c55051920.repfilter(c,e:GetHandlerPlayer())
end
function c55051920.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
--銀河剣聖
function c55168550.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(55168550,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,55168550)
e1:SetCost(c55168550.spcost)
e1:SetTarget(c55168550.sptg)
e1:SetOperation(c55168550.spop)
c:RegisterEffect(e1)
--atk/def
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(55168550,1))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,55168551)
e2:SetTarget(c55168550.atktg)
e2:SetOperation(c55168550.atkop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c55168550.cfilter(c)
return c:IsSetCard(0x55) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function c55168550.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c55168550.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c55168550.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
e:SetLabel(g:GetFirst():GetLevel())
end
function c55168550.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 c55168550.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local lv=e:GetLabel()
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)~=0 and c:GetLevel()~=lv then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
function c55168550.filter(c)
return c:IsSetCard(0x7b) and c:IsType(TYPE_MONSTER)
end
function c55168550.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c55168550.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c55168550.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c55168550.filter,tp,LOCATION_GRAVE,0,1,1,nil)
end
function c55168550.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not (c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e)) then return end
local atk=tc:GetAttack()
local def=tc:GetDefense()
if atk>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
if def>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(def)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e2)
end
end
--雷劫龍-サンダー・ドラゴン
function c55591586.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(55591586,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c55591586.spcon)
e1:SetOperation(c55591586.spop)
c:RegisterEffect(e1)
--atk
--atk up
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(55591586,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c55591586.atkcon)
e2:SetOperation(c55591586.atkop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(55591586,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetCondition(aux.bdocon)
e3:SetCost(c55591586.cost)
e3:SetTarget(c55591586.target)
e3:SetOperation(c55591586.operation)
c:RegisterEffect(e3)
--to deck
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(55591586,3))
e4:SetCategory(CATEGORY_TODECK)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetCountLimit(1)
e4:SetCondition(c55591586.tdcon)
e4:SetTarget(c55591586.tdtg)
e4:SetOperation(c55591586.tdop)
c:RegisterEffect(e4)
end
function c55591586.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end
function c55591586.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c55591586.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_LIGHT)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c55591586.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
if Duel.GetMZoneCount(tp)<=0 then return false end
local g=Duel.GetMatchingGroup(c55591586.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
return g:IsExists(c55591586.spcost_selector,1,nil,tp,g,sg,1)
end
function c55591586.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c55591586.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
for i=1,2 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:FilterSelect(tp,c55591586.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c55591586.atkcon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return re:IsActiveType(TYPE_MONSTER) and loc==LOCATION_HAND and e:GetHandler():GetFlagEffect(1)>0
end
function c55591586.atkop(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_ATTACK)
e1:SetValue(300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c55591586.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c55591586.filter(c)
return c:IsRace(RACE_THUNDER) and c:IsAbleToHand()
end
function c55591586.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c55591586.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c55591586.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c55591586.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 c55591586.tdcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function c55591586.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,1,0,0)
end
function c55591586.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local opt=Duel.SelectOption(tp,aux.Stringid(55591586,4),aux.Stringid(55591586,5))
Duel.SendtoDeck(tc,nil,opt,REASON_EFFECT)
end
end
--クローラー・パラディオン
function c55838342.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:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c55838342.target)
e1:SetOperation(c55838342.activate)
c:RegisterEffect(e1)
end
function c55838342.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,55838342,0,0x21,300,2100,2,RACE_INSECT,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c55838342.activate(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
or not Duel.IsPlayerCanSpecialSummonMonster(tp,55838342,0,0x21,300,2100,2,RACE_INSECT,ATTRIBUTE_EARTH) then return end
c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP)
Duel.SpecialSummonStep(c,1,tp,tp,true,false,POS_FACEUP)
c:AddMonsterAttributeComplete()
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(55838342,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c55838342.thcon)
e1:SetTarget(c55838342.thtg)
e1:SetOperation(c55838342.thop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1,true)
Duel.SpecialSummonComplete()
end
function c55838342.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetSummonType()~=SUMMON_TYPE_SPECIAL+1 then return false end
local lg1=Duel.GetLinkedGroup(tp,1,1)
local lg2=Duel.GetLinkedGroup(1-tp,1,1)
return (lg1 and lg1:IsContains(c)) or (lg2 and lg2:IsContains(c))
end
function c55838342.filter(c)
return c:IsSetCard(0xfe) and c:IsAbleToHand()
end
function c55838342.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c55838342.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c55838342.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c55838342.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 c55878038.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(55878038,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c55878038.spcon)
e1:SetOperation(c55878038.spop)
e1:SetValue(1)
c:RegisterEffect(e1)
--Destroy/Shuffle/Special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,55878038)
e2:SetCondition(c55878038.descon)
e2:SetTarget(c55878038.destg)
e2:SetOperation(c55878038.desop)
c:RegisterEffect(e2)
end
function c55878038.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end
function c55878038.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
if Duel.GetMZoneCount(tp)<=0 then return false end
return Duel.IsExistingMatchingCard(c55878038.spcostfilter,tp,LOCATION_GRAVE,0,3,nil)
end
function c55878038.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c55878038.spcostfilter,tp,LOCATION_GRAVE,0,3,3,nil)
local label=0
if g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_LIGHT) then
label=label+1
end
if g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_DARK) then
label=label+2
end
c:RegisterFlagEffect(55878038,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1,label)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c55878038.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL+1)
end
function c55878038.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c55878038.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local label=e:GetHandler():GetFlagEffectLabel(55878038)
if chk==0 then
if label==1 then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c55878038.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
elseif label==2 then
return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0
else
return true
end
end
if label==1 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(55878038,1))
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
elseif label==2 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(55878038,2))
e:SetCategory(CATEGORY_TODECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,1-tp,LOCATION_HAND)
else
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(55878038,3))
e:SetCategory(CATEGORY_DESTROY)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
end
function c55878038.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local label=c:GetFlagEffectLabel(55878038)
if label==1 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c55878038.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g1:GetCount()>0 then
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
elseif label==2 then
if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)<=0 then return end
local g2=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,1)
Duel.SendtoDeck(g2,nil,2,REASON_EFFECT)
else
local g3=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g3:GetCount()>0 then
local ct=math.min(g3:GetCount(),2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g3:Select(tp,1,ct,nil)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
end
end
--転生炎獣Jジャガー
function c56003780.initial_effect(c)
--pierce
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(56003780,0))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,56003780)
e2:SetCondition(c56003780.spcon)
e2:SetTarget(c56003780.sptg)
e2:SetOperation(c56003780.spop)
c:RegisterEffect(e2)
end
function c56003780.filter(c)
return c:IsFaceup() and c:IsSetCard(0x119) and c:IsType(TYPE_LINK)
end
function c56003780.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c56003780.filter,tp,LOCATION_MZONE,0,1,nil)
end
function c56003780.tdfilter(c)
return c:IsSetCard(0x119) and c:IsType(TYPE_MONSTER) and not c:IsCode(56003780) and c:IsAbleToDeck()
end
function c56003780.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c56003780.tdfilter(chkc) end
local g=Duel.GetMatchingGroup(c56003780.filter,tp,LOCATION_MZONE,0,nil)
if g:GetCount()<=0 then return false end
local zone=0
for tc in aux.Next(g) do
zone=bit.bor(zone,tc:GetLinkedZone(tp))
end
zone=bit.band(zone,0x1f)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
and Duel.IsExistingTarget(c56003780.tdfilter,tp,LOCATION_GRAVE,0,1,nil)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectTarget(tp,c56003780.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c56003780.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) and e:GetHandler():IsRelateToEffect(e) then
local g=Duel.GetMatchingGroup(c56003780.filter,tp,LOCATION_MZONE,0,nil)
if g:GetCount()<=0 then return end
local zone=0
for tc in aux.Next(g) do
zone=bit.bor(zone,tc:GetLinkedZone(tp))
end
zone=bit.band(zone,0x1f)
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP,zone)
end
end
--雷電龍-サンダー・ドラゴン
function c56713174.initial_effect(c)
--search itself
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(56713174,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,56713174)
e1:SetCost(c56713174.cost)
e1:SetTarget(c56713174.target)
e1:SetOperation(c56713174.operation)
c:RegisterEffect(e1)
--search thunder dragon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(56713174,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,56713174)
e2:SetTarget(c56713174.thtg)
e2:SetOperation(c56713174.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c56713174.thcon)
c:RegisterEffect(e3)
end
function c56713174.cost(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 c56713174.filter(c)
return c:IsCode(56713174) and c:IsAbleToHand()
end
function c56713174.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c56713174.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c56713174.operation(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c56713174.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 c56713174.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c56713174.thfilter(c)
return c:IsSetCard(0x11c) and not c:IsCode(56713174) and c:IsAbleToHand()
end
function c56713174.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c56713174.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c56713174.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c56713174.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 c56773577.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(c56773577.condition)
c:RegisterEffect(e1)
--atk down
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCondition(c56773577.atkcon)
e2:SetValue(-500)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--activate Necrovalley
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(56773577,0))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1)
e4:SetCondition(c56773577.accon)
e4:SetTarget(c56773577.actg)
e4:SetOperation(c56773577.acop)
c:RegisterEffect(e4)
--set
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(56773577,1))
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCondition(c56773577.setcon)
e5:SetTarget(c56773577.settg)
e5:SetOperation(c56773577.setop)
c:RegisterEffect(e5)
end
function c56773577.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c56773577.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x2e)
end
function c56773577.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c56773577.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.IsEnvironment(47355498)
end
function c56773577.accon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
and not Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_FZONE,0,1,nil)
end
function c56773577.filter(c,tp)
return c:IsCode(47355498) and c:GetActivateEffect() and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function c56773577.actg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c56773577.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,tp) end
end
function c56773577.acop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c56773577.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
function c56773577.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsReason(REASON_DESTROY+REASON_EFFECT) and c:GetPreviousControler()==tp
end
function c56773577.setfilter(c)
return c:IsSetCard(0x91) and not c:IsCode(56773577) and c:IsSSetable()
end
function c56773577.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c56773577.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c56773577.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local tc=Duel.SelectMatchingCard(tp,c56773577.setfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc then
Duel.SSet(tp,tc)
Duel.ConfirmCards(1-tp,tc)
end
end
--ダイナレスラー・システゴ
function c56980148.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(56980148,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,56980148)
e1:SetTarget(c56980148.thtg)
e1:SetOperation(c56980148.tgop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetOperation(c56980148.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(56980148,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1,56980149)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(c56980148.spcon)
e3:SetTarget(c56980148.sptg)
e3:SetOperation(c56980148.spop)
c:RegisterEffect(e3)
end
function c56980148.thfilter(c)
return ((c:IsSetCard(0x11a) and c:IsType(TYPE_MONSTER)) or c:IsCode(90173539)) and c:IsAbleToHand()
end
function c56980148.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c56980148.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c56980148.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c56980148.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 c56980148.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(56980148,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c56980148.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(56980148)>0 and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
end
function c56980148.spfilter(c,e,tp)
return c:IsSetCard(0x11a) and not c:IsCode(56980148) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c56980148.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c56980148.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c56980148.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c56980148.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c56980148.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--オルフェゴール・ディヴェル
function c57835716.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(57835716,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,57835716)
e1:SetCost(aux.bfgcost)
e1:SetCondition(c57835716.spcon1)
e1:SetTarget(c57835716.sptg)
e1:SetOperation(c57835716.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCondition(c57835716.spcon2)
c:RegisterEffect(e2)
end
function c57835716.spcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,90351981)
end
function c57835716.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,90351981)
end
function c57835716.spfilter(c,e,tp)
return c:IsSetCard(0x11b) and not c:IsCode(57835716) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c57835716.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c57835716.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c57835716.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c57835716.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
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c57835716.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c57835716.splimit(e,c)
return not c:IsAttribute(ATTRIBUTE_DARK)
end
--おろかな重葬
function c57995165.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,57995165+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c57995165.cost)
e1:SetTarget(c57995165.target)
e1:SetOperation(c57995165.activate)
c:RegisterEffect(e1)
if not c57995165.global_check then
c57995165.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SSET)
ge1:SetOperation(c57995165.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c57995165.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(Card.IsControler,1,nil,tp) then Duel.RegisterFlagEffect(rp,57995165,RESET_PHASE+PHASE_END,0,1) end
end
function c57995165.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,57995165)==0 end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SSET)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
end
function c57995165.tgfilter(c)
return c:IsAbleToGrave()
end
function c57995165.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c57995165.tgfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
end
function c57995165.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c57995165.tgfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--G・ボールパーク
function c58012707.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Damage to 0
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(58012707,0))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,58012707)
e2:SetCondition(c58012707.dmcon)
e2:SetTarget(c58012707.dmtg)
e2:SetOperation(c58012707.dmop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(58012707,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,58012708)
e3:SetCondition(c58012707.spcon)
e3:SetTarget(c58012707.sptg)
e3:SetOperation(c58012707.spop)
c:RegisterEffect(e3)
end
function c58012707.dmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetBattleDamage(tp)>0 or Duel.GetBattleDamage(1-tp)>0
end
function c58012707.tgfilter(c)
return c:IsLevelBelow(4) and c:IsRace(RACE_INSECT) and c:IsAbleToGrave()
end
function c58012707.dmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c58012707.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c58012707.spfilter(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c58012707.dmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetOperation(c58012707.damop)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c58012707.tgfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) and tc:IsType(TYPE_NORMAL) then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c58012707.spfilter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp,tc:GetCode())
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
if g:GetCount()>0 and ft>0 and Duel.SelectYesNo(tp,aux.Stringid(58012707,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,ft,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c58012707.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(tp,0)
Duel.ChangeBattleDamage(1-tp,0)
end
function c58012707.cfilter(c,tp)
return c:IsReason(REASON_EFFECT) and c:IsType(TYPE_MONSTER) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
end
function c58012707.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and eg:IsExists(c58012707.cfilter,1,nil,tp)
end
function c58012707.spfilter2(c,e,tp)
return c:IsRace(RACE_INSECT) and c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c58012707.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c58012707.spfilter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c58012707.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c58012707.spfilter2),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--墓守の霊術師
function c58657303.initial_effect(c)
--fusion summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,58657303)
e1:SetCondition(c58657303.condition)
e1:SetTarget(c58657303.target)
e1:SetOperation(c58657303.operation)
c:RegisterEffect(e1)
end
function c58657303.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(47355498)
end
function c58657303.filter1(c,e)
return c:IsOnField() and not c:IsImmuneToEffect(e)
end
function c58657303.filter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_SPELLCASTER) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf)
end
function c58657303.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(c58657303.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c58657303.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c58657303.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
local mg1=Duel.GetFusionMaterial(tp)
local sg1=Duel.GetMatchingGroup(c58657303.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c58657303.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,c,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,c,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
--オルフェゴール・アインザッツ
function c62834295.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(62834295,0))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,62834295)
e2:SetCondition(c62834295.tgcon)
e2:SetTarget(c62834295.tgtg)
e2:SetOperation(c62834295.tgop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c62834295.cfilter(c,tp)
return c:GetSummonPlayer()==tp
end
function c62834295.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c62834295.cfilter,1,nil,1-tp)
end
function c62834295.tgfilter(c)
return (c:IsSetCard(0xfe) or c:IsSetCard(0x11b)) and c:IsType(TYPE_MONSTER) and (c:IsAbleToGrave() or c:IsAbleToRemove())
end
function c62834295.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c62834295.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c62834295.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(62834295,1))
local g=Duel.SelectMatchingCard(tp,c62834295.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
if tc and tc:IsAbleToGrave() and (not tc:IsAbleToRemove() or Duel.SelectYesNo(tp,aux.Stringid(62834295,2))) then
Duel.SendtoGrave(tc,REASON_EFFECT)
else
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
end
--銀河天翔
function c63956833.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,63956833+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c63956833.cost)
e1:SetTarget(c63956833.target)
e1:SetOperation(c63956833.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(63956833,ACTIVITY_SUMMON,c63956833.counterfilter)
Duel.AddCustomActivityCounter(63956833,ACTIVITY_SPSUMMON,c63956833.counterfilter)
end
function c63956833.counterfilter(c)
return c:IsSetCard(0x55) or c:IsSetCard(0x7b)
end
function c63956833.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000)
and Duel.GetCustomActivityCount(63956833,tp,ACTIVITY_SUMMON)==0
and Duel.GetCustomActivityCount(63956833,tp,ACTIVITY_SPSUMMON)==0 end
Duel.PayLPCost(tp,2000)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c63956833.splimit)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
end
function c63956833.splimit(e,c)
return not (c:IsSetCard(0x55) or c:IsSetCard(0x7b))
end
function c63956833.filter1(c,e,tp)
return c:IsSetCard(0x55) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
and Duel.IsExistingMatchingCard(c63956833.filter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetLevel())
end
function c63956833.filter2(c,e,tp,lv)
return c:IsSetCard(0x7b) and c:IsLevel(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c63956833.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c63956833.filter1(chkc,e,tp) end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingTarget(c63956833.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c63956833.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c63956833.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c63956833.filter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetLevel())
if g:GetCount()>0 then
g:AddCard(tc)
for tc2 in aux.Next(g) do
Duel.SpecialSummonStep(tc2,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc2:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc2:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetValue(2000)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc2:RegisterEffect(e3)
end
Duel.SpecialSummonComplete()
end
end
end
--転生炎獣の意志
function c64178424.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(64178424,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,64178424)
e2:SetTarget(c64178424.sptg)
e2:SetOperation(c64178424.spop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(64178424,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,64178424)
e3:SetCost(c64178424.spcost)
e3:SetTarget(c64178424.sptg2)
e3:SetOperation(c64178424.spop2)
c:RegisterEffect(e3)
end
function c64178424.spfilter(c,e,tp)
return c:IsSetCard(0x119) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c64178424.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c64178424.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 c64178424.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c64178424.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 c64178424.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c64178424.filter(c)
if not c:IsSummonType(SUMMON_TYPE_LINK) then return false end
local mat=c:GetMaterial()
return c:IsFaceup() and c:IsSetCard(0x119) and mat:IsExists(Card.IsLinkCode,1,nil,c:GetCode())
end
function c64178424.spfilter2(c,e,tp)
return c:IsSetCard(0x119) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c64178424.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c56003780.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c64178424.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c64178424.spfilter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c64178424.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c64178424.spop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local ft=math.min(Duel.GetLocationCount(tp,LOCATION_MZONE),tc:GetLink())
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c64178424.spfilter2),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,ft,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--サイバネット・フュージョン
function c65801012.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c65801012.target)
e1:SetOperation(c65801012.activate)
c:RegisterEffect(e1)
end
function c65801012.cfilter(c)
return c:GetSequence()>=5
end
function c65801012.filter1(c,e)
return c:IsAbleToGrave() and not c:IsImmuneToEffect(e)
end
function c65801012.exfilter0(c)
return c:IsType(TYPE_LINK) and c:IsRace(RACE_CYBERSE) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function c65801012.exfilter1(c,e)
return c:IsType(TYPE_LINK) and c:IsRace(RACE_CYBERSE) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
function c65801012.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_CYBERSE) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c65801012.fcheck(tp,sg,fc)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)<=1
end
function c65801012.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsAbleToGrave,nil)
if not Duel.IsExistingMatchingCard(c65801012.cfilter,tp,LOCATION_MZONE,0,1,nil) then
local sg=Duel.GetMatchingGroup(c65801012.exfilter0,tp,LOCATION_GRAVE,0,nil)
if sg:GetCount()>0 then
mg1:Merge(sg)
Auxiliary.FCheckAdditional=c65801012.fcheck
end
end
local res=Duel.IsExistingMatchingCard(c65801012.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
Auxiliary.FCheckAdditional=nil
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c65801012.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c65801012.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c65801012.filter1,nil,e)
local exmat=false
if not Duel.IsExistingMatchingCard(c65801012.cfilter,tp,LOCATION_MZONE,0,1,nil) then
local sg=Duel.GetMatchingGroup(c65801012.exfilter1,tp,LOCATION_GRAVE,0,nil,e)
if sg:GetCount()>0 then
mg1:Merge(sg)
exmat=true
end
end
if exmat then Auxiliary.FCheckAdditional=c65801012.fcheck end
local sg1=Duel.GetMatchingGroup(c65801012.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
Auxiliary.FCheckAdditional=nil
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c65801012.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
mg1:RemoveCard(tc)
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
if exmat then Auxiliary.FCheckAdditional=c65801012.fcheck end
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
Auxiliary.FCheckAdditional=nil
tc:SetMaterial(mat1)
local rg=mat1:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
mat1:Sub(rg)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
--空牙団の大義 フォルゴ
function c66023650.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,3,3,c66023650.lcheck)
--cannot link material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(1)
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)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,66023650)
e2:SetCondition(c66023650.spcon)
e2:SetTarget(c66023650.sptg)
e2:SetOperation(c66023650.spop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_MATERIAL_CHECK)
e3:SetValue(c66023650.valcheck)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,66023651)
e4:SetCondition(c66023650.drcon)
e4:SetTarget(c66023650.drtg)
e4:SetOperation(c66023650.drop)
c:RegisterEffect(e4)
end
function c66023650.lcheck(g)
return g:GetClassCount(Card.GetLinkRace)==g:GetCount()
end
function c66023650.valcheck(e,c)
local g=c:GetMaterial()
local val=0
for tc in aux.Next(g) do
val=bit.bor(val,tc:GetRace())
end
e:GetLabelObject():SetLabel(val)
end
function c66023650.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and e:GetHandler():GetMaterialCount()==3
end
function c66023650.spfilter(c,e,tp,rc)
return c:IsSetCard(0x114) and not c:IsRace(rc) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c66023650.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c66023650.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,e:GetLabel()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c66023650.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,c66023650.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetLabel())
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function c66023650.drcfilter(c,tp)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()~=tp and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function c66023650.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c66023650.drcfilter,1,nil,tp)
end
function c66023650.drfilter(c)
return c:IsFaceup() and c:IsSetCard(0x114)
end
function c66023650.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c66023650.drfilter,tp,LOCATION_MZONE,0,nil)
local ct=1
if g:GetClassCount(Card.GetCode)>=3 then ct=3 end
if chk==0 then return Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function c66023650.drop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c66023650.drfilter,tp,LOCATION_MZONE,0,nil)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
if Duel.Draw(p,1,REASON_EFFECT)>0 and g:GetClassCount(Card.GetCode)>=3 then
Duel.BreakEffect()
Duel.Draw(p,2,REASON_EFFECT)
end
end
--転生炎獣ミーア
function c67225377.initial_effect(c)
--special summon (to hand)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67225377,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_HAND)
e1:SetCountLimit(1,67225377)
e1:SetCondition(c67225377.spcon)
e1:SetCost(c67225377.spcost1)
e1:SetTarget(c67225377.sptg1)
e1:SetOperation(c67225377.spop1)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67225377,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,67225378)
e2:SetCost(c67225377.spcost2)
e2:SetTarget(c67225377.sptg2)
e2:SetOperation(c67225377.spop2)
c:RegisterEffect(e2)
end
function c67225377.spcon(e,tp,eg,ep,ev,re,r,rp)
return not (r==REASON_RULE)
end
function c67225377.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c67225377.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c67225377.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c67225377.cfilter(c)
return c:IsSetCard(0x119) and c:IsDiscardable()
end
function c67225377.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c67225377.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c67225377.cfilter,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
end
function c67225377.sptg2(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 c67225377.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--オルフェゴール・ロンギルス
function c76145142.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,99,c76145142.lcheck)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetCondition(c76145142.indcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--todeck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(76145142,0))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,76145142)
e2:SetCondition(c76145142.tdcon1)
e2:SetCost(c76145142.tdcost)
e2:SetTarget(c76145142.tdtg)
e2:SetOperation(c76145142.tdop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e3:SetCondition(c76145142.tdcon2)
c:RegisterEffect(e3)
end
function c76145142.lcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x11b)
end
function c76145142.indcon(e)
return e:GetHandler():IsLinkState()
end
function c76145142.tdcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,90351981)
end
function c76145142.tdcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,90351981)
end
function c76145142.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function c76145142.tdfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAbleToDeck()
end
function c76145142.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c76145142.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c76145142.tdfilter,tp,LOCATION_REMOVED,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c76145142.tdfilter,tp,LOCATION_REMOVED,0,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
end
function c76145142.tdop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 and Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)~=0 and tg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) then
local g=Duel.GetMatchingGroup(Card.IsLinkState,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(76145142,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
end
--ダイナレスラー・キング・Tレックス
function c77967790.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x11a),2)
c:EnableReviveLimit()
--actlimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,1)
e1:SetValue(c77967790.actlimit)
e1:SetCondition(c77967790.actcon)
c:RegisterEffect(e1)
--atk limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetValue(c77967790.atklimit)
c:RegisterEffect(e2)
--atk limit
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(77967790,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c77967790.atkcon)
e3:SetTarget(c77967790.atktg)
e3:SetOperation(c77967790.atkop)
c:RegisterEffect(e3)
end
function c77967790.actlimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c77967790.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
function c77967790.atklimit(e,c)
return c~=e:GetHandler()
end
function c77967790.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c77967790.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsAttackPos() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAttackPos,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTACK)
Duel.SelectTarget(tp,Card.IsAttackPos,tp,0,LOCATION_MZONE,1,1,nil)
end
function c77967790.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.RegisterFlagEffect(tp,77967790,RESET_PHASE+PHASE_BATTLE,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetLabelObject(tc)
e1:SetCondition(c77967790.descon)
e1:SetTarget(c77967790.atktg2)
e1:SetReset(RESET_PHASE+PHASE_BATTLE)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(77967790,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetCountLimit(1)
e2:SetLabelObject(tc)
e2:SetCondition(c77967790.descon)
e2:SetOperation(c77967790.desop)
e2:SetReset(RESET_PHASE+PHASE_BATTLE)
Duel.RegisterEffect(e2,tp)
end
end
function c77967790.atktg2(e,c)
return c~=e:GetLabelObject()
end
function c77967790.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return Duel.GetFlagEffect(tp,77967790)~=0 and tc:GetAttackAnnouncedCount()==0
end
function c77967790.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Hint(HINT_CARD,0,77967790)
Duel.Destroy(tc,REASON_EFFECT)
end
--ダイプレクサ・キマイラ
function c78084378.initial_effect(c)
--fusion material
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsRace,RACE_CYBERSE),2,false)
c:EnableReviveLimit()
--lock
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(78084378,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c78084378.cost)
e1:SetOperation(c78084378.operation)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(78084378,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,78084378)
e2:SetCondition(c78084378.thcon)
e2:SetTarget(c78084378.thtg)
e2:SetOperation(c78084378.thop)
c:RegisterEffect(e2)
end
function c78084378.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,e:GetHandler(),RACE_CYBERSE) end
local g=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,e:GetHandler(),RACE_CYBERSE)
Duel.Release(g,REASON_COST)
end
function c78084378.operation(e,tp,eg,ep,ev,re,r,rp)
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(c78084378.accon)
e1:SetValue(c78084378.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c78084378.accon(e)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function c78084378.aclimit(e,re,tp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c78084378.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_FUSION)
end
function c78084378.filter1(c)
return c:IsRace(RACE_CYBERSE) and c:IsAbleToHand()
end
function c78084378.filter2(c)
return c:IsCode(65801012) and c:IsAbleToHand()
end
function c78084378.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c78084378.filter1,tp,LOCATION_GRAVE,0,1,e:GetHandler())
and Duel.IsExistingTarget(c78084378.filter2,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=Duel.SelectTarget(tp,c78084378.filter1,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectTarget(tp,c78084378.filter2,tp,LOCATION_GRAVE,0,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,2,0,0)
end
function c78084378.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
end
--墓守の異能者
function c79206925.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x2e),2,true)
--atk/def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MATERIAL_CHECK)
e1:SetValue(c79206925.valcheck)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c79206925.atkcon)
e2:SetOperation(c79206925.atkop)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE+LOCATION_FZONE,0)
e3:SetCondition(c79206925.indcon)
e3:SetTarget(c79206925.indtg)
e3:SetValue(1)
c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(79206925,0))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,79206925)
e4:SetTarget(c79206925.regtg)
e4:SetOperation(c79206925.regop)
c:RegisterEffect(e4)
end
function c79206925.valcheck(e,c)
local lv=c:GetMaterial():GetSum(Card.GetOriginalLevel)
e:SetLabel(lv)
end
function c79206925.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c79206925.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local val=e:GetLabelObject():GetLabel()*100
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
end
function c79206925.indcon(e)
return Duel.IsEnvironment(47355498)
end
function c79206925.indtg(e,c)
return c==e:GetHandler() or c:IsLocation(LOCATION_FZONE)
end
function c79206925.thfilter(c)
return (c:IsSetCard(0x2e) and c:IsType(TYPE_MONSTER)) or c:IsSetCard(0x91)
end
function c79206925.regtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79206925.thfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c79206925.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetCondition(c79206925.thcon)
e1:SetOperation(c79206925.thop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c79206925.thfilter2(c)
return c79206925.thfilter(c) and c:IsAbleToHand()
end
function c79206925.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c79206925.thfilter2,tp,LOCATION_DECK,0,1,nil)
end
function c79206925.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,79206925)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c79206925.thfilter2,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 c80101899.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,80101899+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c80101899.target)
e1:SetOperation(c80101899.activate)
c:RegisterEffect(e1)
end
function c80101899.rmfilter(c,tp)
return c:GetType()==TYPE_TRAP and not c:IsCode(80101899) and c:IsAbleToRemove()
and Duel.IsExistingMatchingCard(c80101899.setfilter,tp,LOCATION_DECK,0,1,c,c:GetCode())
end
function c80101899.setfilter(c,code)
return c:IsCode(code) and c:IsSSetable()
end
function c80101899.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c80101899.rmfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c80101899.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c80101899.rmfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
local tc1=g1:GetFirst()
if tc1 and Duel.Remove(tc1,POS_FACEUP,REASON_EFFECT)~=0 and tc1:IsLocation(LOCATION_REMOVED) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g2=Duel.SelectMatchingCard(tp,c80101899.setfilter,tp,LOCATION_DECK,0,1,1,nil,tc1:GetCode())
local tc2=g2:GetFirst()
if tc2 then
Duel.SSet(tp,tc2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc2:RegisterEffect(e1)
end
end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAINING)
e2:SetOperation(c80101899.aclimit1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_NEGATED)
e3:SetOperation(c80101899.aclimit2)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetTargetRange(1,0)
e4:SetCondition(c80101899.actcon)
e4:SetValue(c80101899.aclimit3)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
end
function c80101899.aclimit1(e,tp,eg,ep,ev,re,r,rp)
if ep==1-tp or not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
Duel.RegisterFlagEffect(tp,80101899,RESET_PHASE+PHASE_END,0,1)
end
function c80101899.aclimit2(e,tp,eg,ep,ev,re,r,rp)
if ep==1-tp or not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
Duel.ResetFlagEffect(tp,80101899)
end
function c80101899.actcon(e)
return Duel.GetFlagEffect(tp,80101899)~=0
end
function c80101899.aclimit3(e,re,tp)
return re:GetHandler():IsType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
--クマモール
function c80141055.initial_effect(c)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_SZONE,0)
e1:SetCondition(c80141055.indcon)
e1:SetTarget(c80141055.indtg)
e1:SetValue(1)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(80141055,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c80141055.atkcon)
e2:SetOperation(c80141055.atkop)
c:RegisterEffect(e2)
end
function c80141055.indcon(e)
return Duel.GetTurnPlayer()~=e:GetHandlerPlayer()
end
function c80141055.indtg(e,c)
return c:GetSequence()<5 and c:IsFacedown()
end
function c80141055.cfilter(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_SZONE) and c:GetPreviousSequence()<5 and c:IsPreviousPosition(POS_FACEDOWN) and c:IsReason(REASON_EFFECT)
end
function c80141055.atkcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and eg:IsExists(c80141055.cfilter,1,nil,tp)
end
function c80141055.atkop(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_ATTACK)
e1:SetValue(800)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--死魂融合
function c81223446.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c81223446.target)
e1:SetOperation(c81223446.activate)
c:RegisterEffect(e1)
end
function c81223446.filter1(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function c81223446.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c81223446.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(c81223446.filter1,tp,LOCATION_GRAVE,0,nil)
local res=Duel.IsExistingMatchingCard(c81223446.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c81223446.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
end
function c81223446.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetMatchingGroup(aux.NecroValleyFilter(c81223446.filter1),tp,LOCATION_GRAVE,0,nil)
local sg1=Duel.GetMatchingGroup(c81223446.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c81223446.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.Remove(mat1,POS_FACEDOWN,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1,true)
tc:CompleteProcedure()
end
end
--幻姫フルドラ
function c81263643.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,81263643)
e1:SetCost(c81263643.cost)
e1:SetTarget(c81263643.target)
e1:SetOperation(c81263643.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function c81263643.cfilter(c,tp)
if not c:IsDiscardable() then return false end
local ty=c:GetType() & (TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP)
local log=math.log(ty)/math.log(2)
return Duel.IsExistingMatchingCard(c81263643.filter,tp,LOCATION_GRAVE,0,1,nil,2 ^ ((log+2) % 3))
end
function c81263643.filter(c,ty)
return c:IsType(ty) and c:IsAbleToHand()
end
function c81263643.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c81263643.cfilter,tp,LOCATION_HAND,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c81263643.cfilter,tp,LOCATION_HAND,0,1,1,nil,tp)
local ty=g:GetFirst():GetType() & (TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP)
local log=math.log(ty)/math.log(2)
e:SetLabel(2 ^ ((log+2) % 3))
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c81263643.target(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_GRAVE)
end
function c81263643.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c81263643.filter),tp,LOCATION_GRAVE,0,1,1,nil,e:GetLabel())
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--百雷のサンダー・ドラゴン
function c82045034.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,82045034+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c82045034.target)
e1:SetOperation(c82045034.activate)
c:RegisterEffect(e1)
end
function c82045034.filter(c,e,tp)
return c:IsRace(RACE_THUNDER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c82045034.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c82045034.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c82045034.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c82045034.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c82045034.gfilter(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c82045034.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 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)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetAbsoluteRange(tp,1,0)
e2:SetTarget(c82045034.splimit)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
ft=ft-1
local g=Duel.GetMatchingGroup(c82045034.gfilter,tp,LOCATION_GRAVE,0,nil,e,tp,tc:GetCode())
if g:GetCount()>0 and ft>0 and Duel.SelectYesNo(tp,aux.Stringid(82045034,0)) then
Duel.BreakEffect()
ft=math.min(ft,g:GetCount())
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,ft,ft,nil)
for tc2 in aux.Next(sg) do
Duel.SpecialSummonStep(tc2,0,tp,tp,false,false,POS_FACEUP)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetReset(RESET_EVENT+RESETS_REDIRECT)
e3:SetValue(LOCATION_REMOVED)
tc2:RegisterEffect(e3,true)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetAbsoluteRange(tp,1,0)
e4:SetTarget(c82045034.splimit)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc2:RegisterEffect(e4)
end
Duel.SpecialSummonComplete()
end
end
end
function c82045034.splimit(e,c)
return not c:IsRace(RACE_THUNDER)
end
--魔神儀-ペンシルベル
function c82085295.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(82085295,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,82085295)
e1:SetCost(c82085295.spcost)
e1:SetTarget(c82085295.sptg)
e1:SetOperation(c82085295.spop)
c:RegisterEffect(e1)
--effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(82085295,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,82085295)
e2:SetCondition(c82085295.thcon)
e2:SetTarget(c82085295.thtg)
e2:SetOperation(c82085295.thop)
c:RegisterEffect(e2)
--spsummon limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(c82085295.sumlimit)
c:RegisterEffect(e3)
end
function c82085295.filter(c,e,tp)
return c:IsSetCard(0x117) and not c:IsCode(82085295) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c82085295.costfilter(c)
return bit.band(c:GetType(),0x81)==0x81 and not c:IsPublic()
end
function c82085295.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c82085295.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c82085295.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function c82085295.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c82085295.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function c82085295.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c82085295.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
g:AddCard(e:GetHandler())
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c82085295.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK)
end
function c82085295.thfilter(c)
return bit.band(c:GetType(),0x81)==0x81 and c:IsAbleToHand()
end
function c82085295.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c82085295.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c82085295.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c82085295.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c82085295.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c82085295.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsLocation(LOCATION_EXTRA)
end
--永遠なる銀河
function c82162616.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(82162616,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,82162616+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c82162616.condition)
e1:SetTarget(c82162616.target)
e1:SetOperation(c82162616.activate)
c:RegisterEffect(e1)
end
function c82162616.cfilter(c)
return c:IsFaceup() and (c:IsSetCard(0x55) or c:IsSetCard(0x7b))
end
function c82162616.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c82162616.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c82162616.filter1(c,e,tp)
local rk=c:GetRank()
return c:IsFaceup() and c:IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c82162616.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+4)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function c82162616.filter2(c,e,tp,mc,rk)
return c:IsRank(rk) and (c:IsSetCard(0x55) or c:IsSetCard(0x7b)) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c82162616.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c82162616.filter1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c82162616.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c82162616.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c82162616.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCountFromEx(tp,tp,tc)<=0 or not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
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,c82162616.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+4)
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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
--オルフェゴール・バベル
function c90351981.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(90351981)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(90351981,0))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(aux.exccon)
e3:SetCost(c90351981.thcost)
e3:SetTarget(c90351981.thtg)
e3:SetOperation(c90351981.thop)
c:RegisterEffect(e3)
end
function c90351981.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST)
end
function c90351981.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c90351981.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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